SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2401.02020 · 2024

Spikformer V2: Join the High Accuracy Club on ImageNet with an SNN Ticket

arXiv · PDF · Open in the Atlas

Code that ran

We lifted 8 functions out of this paper's own repositories and ran 6 of them in a sandbox. "Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results.

RepositoryRoleRan
zk-zhou/spikformer canonical 6 of 8
FunctionStatusWhere it lives
accuracy Ran zk-zhou/spikformer/cifar10dvs/utils.py
code served (permissive licence) · get_code("4134b8420b4c48b5")
fast_collate Ran zk-zhou/spikformer/cifar10/loader.py
code served (permissive licence) · get_code("8eee4204b6767c33")
shear_y Ran zk-zhou/spikformer/cifar10/aa_snn.py
code served (permissive licence) · get_code("2d7b973a4b160d73")
transforms_imagenet_eval Ran zk-zhou/spikformer/cifar10/transforms_factory.py
code served (permissive licence) · get_code("d5a693c429aa8571")
transforms_noaug_train Ran zk-zhou/spikformer/cifar10/transforms_factory.py
code served (permissive licence) · get_code("c82a60e3c9859e18")
unpack_len1_tuple Ran zk-zhou/spikformer/cifar10dvs/monitor.py
code served (permissive licence) · get_code("68edbf1d7855d1bc")
shear_x Not yet run zk-zhou/spikformer/cifar10/aa_snn.py
code served (permissive licence) · get_code("b31e84df5541213a")
translate_x_rel Not yet run zk-zhou/spikformer/cifar10/aa_snn.py
code served (permissive licence) · get_code("61f2a3e08a11e1f5")

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Spiking Neural Networks (SNNs), known for their biologically plausible architecture, face the challenge of limited performance. The self-attention mechanism, which is the cornerstone of the high-performance Transformer and also a biologically inspired structure, is absent in existing SNNs. To this end, we explore the potential of leveraging both self-attention capability and biological properties of SNNs, and propose a novel Spiking Self-Attention (SSA) and Spiking Transformer (Spikformer). The SSA mechanism eliminates the need for softmax and captures the sparse visual feature employing spike-based Query, Key, and Value. This sparse computation without multiplication makes SSA efficient and energy-saving. Further, we develop a Spiking Convolutional Stem (SCS) with supplementary convolutional layers to enhance the architecture of Spikformer. The Spikformer enhanced with the SCS is referred to as Spikformer V2. To train larger and deeper Spikformer V2, we introduce a pioneering exploration of Self-Supervised Learning (SSL) within the SNN. Specifically, we pre-train Spikformer V2 with masking and reconstruction style inspired by the mainstream self-supervised Transformer, and then finetune the Spikformer V2 on the image classification on ImageNet. Extensive experiments show that Spikformer V2 outperforms other previous surrogate training and ANN2SNN methods. An 8-layer Spikformer V2 achieves an accuracy of 80.38% using 4 time steps, and after SSL, a 172M 16-layer Spikformer V2 reaches an accuracy of 81.10% with just 1 time step. To the best of our knowledge, this is the first time that the SNN achieves 80+% accuracy on ImageNet. The code will be available at Spikformer V2.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2401.02020")
get_code_for_paper("2401.02020")
have("2401.02020")

Connect an agent — have() is free.