GFNet (Global Filter Network)
GFNet-B, an image classifier that mixes tokens with learned frequency-domain filters instead of self-attention.
Image classification · 313 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
- Image classification
- Parameters
- 43.1M
- Operations
- 313
- Framework
- PyTorch
- Recurrent
- No
- Published
- NeurIPS 2021
- Cited by
- 418 (as of 29 October 2026)
- Authors
- Yongming Rao, Wenliang Zhao, Zheng Zhu and others
- Source
- GitHub: raoyongming/GFNet
- 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
- m16852
- Graph hash
- 4e7035f5346ab687be904893adb4dcca953ec31b0bcfe083aa732abf3f29e51b
- Skeleton hash
- 5976f799c975507f146c153d3874f5fee13ce4011665cd3bd01ec03e4729e34c
- Architecture hash
- 9b922ee2deee8967ddb4c39d6a2cd64220b896d253b41223214d1efaff0bf4c7
- Diagram SHA-256
- a658f63ab51102832f19bb98bd2d58eec6087cdb1e6c547528a18c9f24cb2cd2
- 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
GFNet, the Global Filter Network, is an image classifier laid out like a vision transformer, with the self-attention layer replaced by three operations: a 2D Fourier transform, an element-wise multiplication with learnable global filters, and an inverse transform. The motivation is cost: the paper notes that the complexity of self-attention and MLP grows quadratically with image size. The global filter layer instead mixes tokens with log-linear complexity, using the Fast Fourier Transform.
The network is a stack of global filter layers and feedforward networks. The paper shows that the layer is equivalent to a depthwise global circular convolution whose filter is as large as the feature map. Because the input is real, its transform is conjugate symmetric, and the implementation keeps only half of the frequency values without losing information.
The paper studies transformer-style models with a fixed number of tokens in each block and CNN-style hierarchical models with gradually downsampled tokens. GFNet-B, the model on this page, is one of the transformer-style models, derived from the 12-layer GFNet-XS by adjusting the depth and embedding dimension. The README lists GFNet-B at 43M parameters and 7.9G FLOPs, with a top-1 accuracy of 80.7 for the ImageNet-pretrained model.
Key idea. GFNet replaces self-attention with a learned filter applied in the frequency domain, so spatial dependencies are modeled with log-linear complexity.
- GFNet
- Global Filter Network
- Global Filter Networks
- GFNet-B
- image classification
- global filter layer
- frequency domain
- Fourier transform
- ImageNet
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{rao2021globalfilternetworksimage,
title={Global Filter Networks for Image Classification},
author={Yongming Rao and Wenliang Zhao and Zheng Zhu and Jiwen Lu and Jie Zhou},
year={2021},
eprint={2107.00645},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2107.00645},
}