arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2403.16552cs.NEcs.AIcs.CV
收藏

QKFormer: 基于Q-K注意力的分层脉冲变换器

QKFormer: Hierarchical Spiking Transformer using Q-K Attention

Pengcheng Laboratory(鹏城实验室);Harbin Institute of Technology(哈尔滨工业大学);Peking University(北京大学)

Chenlin Zhou, Han Zhang, Zhaokun Zhou, Liutao Yu, Liwei Huang, Xiaopeng Fan, Li Yuan, Zhengyu Ma, Huihui Zhou, Yonghong Tian

AI总结:

本文提出QKFormer,一种基于Q-K注意力的分层脉冲变换器,通过引入新的脉冲形式Q-K注意力机制、分层结构和灵活的补丁嵌入模块,提升了脉冲神经网络在图像分类任务中的性能,实现了在ImageNet-1K数据集上85.65%的top-1准确率。

摘要:

Spiking Transformers,将脉冲神经网络(SNNs)与变换器架构相结合,因其在能效和高性能方面的潜力而受到广泛关注。然而,现有模型在此领域仍存在性能不佳的问题。我们引入了几个创新来提高性能:i)我们提出了一种新的脉冲形式Q-K注意力机制,专为SNNs设计,通过二进制向量以线性复杂度高效建模token或通道维度的重要性。ii)我们将层次结构引入脉冲变换器,显著提升了生物和人工神经网络的性能,以获得多尺度脉冲表示。iii)我们设计了一个灵活且强大的补丁嵌入模块,具有特定于脉冲变换器的变形快捷方式。共同,我们开发了QKFormer,一种基于Q-K注意力的直接训练分层脉冲变换器。QKFormer在各种主流数据集上显著优于现有最先进SNN模型。值得注意的是,与Spikformer(66.34 M,74.81%)相比,QKFormer(64.96 M)在ImageNet-1k上实现了突破性的top-1准确率85.65%,大幅超越Spikformer 10.84%。据我们所知,这是首次直接训练SNNs在ImageNet-1K上超过85%的准确率。代码和模型可在https://github.com/zhouchenlin2096/QKFormer公开获取。

英文摘要:

Spiking Transformers, which integrate Spiking Neural Networks (SNNs) with Transformer architectures, have attracted significant attention due to their potential for energy efficiency and high performance. However, existing models in this domain still suffer from suboptimal performance. We introduce several innovations to improve the performance: i) We propose a novel spike-form Q-K attention mechanism, tailored for SNNs, which efficiently models the importance of token or channel dimensions through binary vectors with linear complexity. ii) We incorporate the hierarchical structure, which significantly benefits the performance of both the brain and artificial neural networks, into spiking transformers to obtain multi-scale spiking representation. iii) We design a versatile and powerful patch embedding module with a deformed shortcut specifically for spiking transformers. Together, we develop QKFormer, a hierarchical spiking transformer based on Q-K attention with direct training. QKFormer shows significantly superior performance over existing state-of-the-art SNN models on various mainstream datasets. Notably, with comparable size to Spikformer (66.34 M, 74.81%), QKFormer (64.96 M) achieves a groundbreaking top-1 accuracy of 85.65% on ImageNet-1k, substantially outperforming Spikformer by 10.84%. To our best knowledge, this is the first time that directly training SNNs have exceeded 85% accuracy on ImageNet-1K. The code and models are publicly available at https://github.com/zhouchenlin2096/QKFormer

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑