SGLFormer
SGLFormer, a directly trained spiking transformer that fuses convolution and self-attention for image classification.
Spiking networks · 3,761 operations Checked
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
- Task
- Spiking networks
- Parameters
- 64M
- Operations
- 3,761
- Framework
- PyTorch
- Recurrent
- No
- Published
- 2024, Frontiers in Neuroscience 18
- Cited by
- 13 (as of 24 October 2026)
- Authors
- Han Zhang, Chenlin Zhou, Liutao Yu and others
- License
- MIT
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m20034
- Graph hash
- bed17234d769a24084b2dac742fe6c79479e001353387df531a892f03d585e7a
- Skeleton hash
- c6c515089c5afe26d10ae3c9ce7351f0828273a8dfab89ec99f623f0b3b41caa
- Architecture hash
- d31295510ade3cdea8e94571af5ac838415928c0215bec8223dba9090d5a6b65
- Diagram SHA-256
- 7c5f72d8ff5de5f6155d3302e79e2929d7fa773795b9cd4a960da83db0cce99b
- 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
SGLFormer (Spiking Global-Local-Fusion Transformer) is a directly trained spiking neural network (SNN) for image classification that combines convolutional and transformer structures. The paper is motivated by the performance gap it sees between spiking transformers and their conventional (ANN) counterparts.
The network has a Tokenizer module, a Global-Local-Fusion Stage and a linear classification head, and its neurons are leaky integrate-and-fire (LIF) units. A stage of N blocks holds one local feature extraction block, one local transformer block and N − 2 global transformer blocks. The paper also reports that Maxpooling causes inaccurate gradient backpropagation in SNNs and develops a new Maxpooling module to address it. In the classification head, a spatio-temporal block (STB) takes the place of global average pooling.
A static image is repeated T times along the time dimension as input. On ImageNet the paper reports a top-1 accuracy of 83.73% for its highest performance model, SGLFormer-8-768. In these names the first number is the total count of blocks in the Global-Local-Fusion Stage and the second is the embedding dimension. The repository's results table lists SGLFormer-8-768 at 64.02M parameters with T = 4 at 224x224 resolution.
Key idea. SGLFormer integrates convolution and transformer structures in a directly trained spiking network, with a new Maxpooling module and a spatio-temporal block in the classification head.
- sglformer
- spiking global-local-fusion transformer
- spiking transformer
- spiking neural network
- snn
- directly trained snn
- image classification
- lif neurons
- neuromorphic vision
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@article{Zhang_2024, title={SGLFormer: Spiking Global-Local-Fusion Transformer with high performance}, volume={18}, ISSN={1662-453X}, url={http://dx.doi.org/10.3389/fnins.2024.1371290}, DOI={10.3389/fnins.2024.1371290}, journal={Frontiers in Neuroscience}, publisher={Frontiers Media SA}, author={Zhang, Han and Zhou, Chenlin and Yu, Liutao and Huang, Liwei and Ma, Zhengyu and Fan, Xiaopeng and Zhou, Huihui and Tian, Yonghong}, year={2024}, month=Mar }