All models

spikingresformer_tiny

The tiny SpikingResformer: a ResNet-style multi-stage spiking transformer with Dual Spike Self-Attention.

Spiking networks · 1,817 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (23 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
11.1M
Operations
1,817
Framework
PyTorch
Recurrent
No
Published
CVPR (arXiv 2024)
Cited by
90 (as of 27 October 2026)
Authors
Xinyu Shi, Zecheng Hao, Zhaofei Yu
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m12149
Graph hash
c4e2c8b1c85a7453ff01d6f6da31b4eed048876fddfd08851784375bd9f2e18a
Skeleton hash
901bb8fc2f6ac47898d199641323e5f94789710a70174a61518058b805c36e3a
Architecture hash
85caaa4185bf217f5d9538644cd80f0a49b45b259cf697219b5f0d510c814ab3
Diagram SHA-256
fda1d830a01a332bb2d5cd36b096a3a481497c62a6a1180ae0db2cf74759caad
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

SpikingResformer is a spiking Vision Transformer that combines the ResNet-based multi-stage architecture with a new spiking self-attention mechanism called Dual Spike Self-Attention (DSSA). The motivation is that earlier spiking transformers lacked reasonable scaling methods and had a bottleneck in extracting local features. Those earlier designs used a shallow convolutional network before the Transformer encoder to extract local features and shrink the feature maps.

Vanilla self-attention relies on floating-point matrix multiplication and softmax, operations that do not fit the spike-driven nature of SNNs. DSSA instead uses only a Dual Spike Transformation, which removes the need for float-point matrix multiplication and the softmax function. Because both inputs to the transformation are spike matrices, every matrix multiplication reduces to a summation of weights. No softmax is needed because the spiking neuron layer itself produces a binary attention map made of spikes. The scaling factors differ from the usual ones in vanilla attention because spike inputs cannot be assumed to have zero mean and unit variance.

The network starts with a stem of a 7×7 convolution and a 3×3 max pooling, then runs a multi-stage backbone that produces multi-scale feature maps. Each spiking Resformer block pairs a Multi-Head Dual Spike Self-Attention (MHDSSA) module with a Group-Wise Spiking Feed-Forward Network (GWSFFN). A downsample layer before each stage after the first halves the resolution and doubles the channel dimension. The GWSFFN inserts a 3×3 convolution with a residual connection between the two linear layers so the feed-forward path can extract local features. The model ends with global average pooling and a classification layer.

On ImageNet, SpikingResformer-Ti achieves 74.34% accuracy with only 11.14M parameters and 2.73G SOPs. The largest member of the series, SpikingResformer-L, reaches 79.40% top-1 accuracy on ImageNet with 4 time-steps.

Key idea. The key contribution is Dual Spike Self-Attention (DSSA), a novel spiking self-attention mechanism with a reasonable scaling method, and the SpikingResformer architecture built on it.

  • SpikingResformer
  • SpikingResformer-Ti
  • DSSA
  • Dual Spike Self-Attention
  • spiking vision transformer
  • spiking neural network
  • SNN
  • image classification
  • MHDSSA
  • GWSFFN

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{shi2024spikingresformerbridgingresnetvision,
      title={SpikingResformer: Bridging ResNet and Vision Transformer in Spiking Neural Networks}, 
      author={Xinyu Shi and Zecheng Hao and Zhaofei Yu},
      year={2024},
      eprint={2403.14302},
      archivePrefix={arXiv},
      primaryClass={cs.NE},
      url={https://arxiv.org/abs/2403.14302}, 
}