Skip to main content
QUICK REVIEW

[Paper Review] Global Filter Networks for Image Classification

Yongming Rao, Wenliang Zhao|arXiv (Cornell University)|Jul 1, 2021
Neural Networks and ApplicationsComputer Science47 references19 citations
TL;DR

This paper proposes Global Filter Networks (GFNet), a vision transformer alternative that replaces self-attention with learnable global filters in the frequency domain using 2D FFT/IFFT, achieving log-linear complexity and superior efficiency. GFNet matches or exceeds vision transformers and MLP models in accuracy while significantly reducing computational cost, especially on high-resolution features.

ABSTRACT

Recent advances in self-attention and pure multi-layer perceptrons (MLP) models for vision have shown great potential in achieving promising performance with fewer inductive biases. These models are generally based on learning interaction among spatial locations from raw data. The complexity of self-attention and MLP grows quadratically as the image size increases, which makes these models hard to scale up when high-resolution features are required. In this paper, we present the Global Filter Network (GFNet), a conceptually simple yet computationally efficient architecture, that learns long-term spatial dependencies in the frequency domain with log-linear complexity. Our architecture replaces the self-attention layer in vision transformers with three key operations: a 2D discrete Fourier transform, an element-wise multiplication between frequency-domain features and learnable global filters, and a 2D inverse Fourier transform. We exhibit favorable accuracy/complexity trade-offs of our models on both ImageNet and downstream tasks. Our results demonstrate that GFNet can be a very competitive alternative to transformer-style models and CNNs in efficiency, generalization ability and robustness. Code is available at https://github.com/raoyongming/GFNet

Motivation & Objective

  • To address the quadratic computational complexity of self-attention and MLPs in vision transformers when scaling to high-resolution features.
  • To develop a model that captures long-range spatial dependencies efficiently without relying on inductive biases like convolutional inductive bias.
  • To explore frequency-domain operations as a computationally efficient alternative to attention and fully connected layers in vision models.
  • To improve model efficiency, generalization, and robustness while maintaining competitive accuracy on image classification benchmarks.

Proposed method

  • Replace the self-attention sub-layer in Vision Transformers with a global filter layer based on 2D discrete Fourier transform (DFT).
  • Apply a 2D DFT to convert spatial feature maps into the frequency domain.
  • Perform element-wise multiplication between frequency-domain features and learnable global filters.
  • Apply a 2D inverse DFT (IFFT) to map the filtered features back to the spatial domain.
  • Leverage the fast Fourier transform (FFT) algorithm to achieve O(L log L) complexity, where L is the number of tokens.
  • Integrate the global filter layer into a standard Vision Transformer architecture with minimal modifications, retaining feed-forward networks and layer normalization.

Experimental results

Research questions

  • RQ1Can frequency-domain operations with learnable filters effectively replace self-attention in vision transformers while maintaining or improving performance?
  • RQ2Does the proposed global filter layer achieve log-linear complexity and scale efficiently to high-resolution feature maps compared to quadratic-complexity attention and MLP layers?
  • RQ3How does GFNet perform in terms of accuracy, robustness, and generalization on ImageNet and downstream vision tasks compared to CNNs, vision transformers, and MLP-based models?
  • RQ4Can the global filter layer learn interpretable and meaningful spatial interactions, particularly in the frequency domain?
  • RQ5Does the frequency-domain mixing mechanism improve model generalization and robustness under distribution shift and adversarial attacks?

Key findings

  • GFNet-S achieves 80.1% top-1 accuracy on ImageNet, outperforming DeiT-S (79.8%) and ResMLP-12 (76.6%) with comparable FLOPs.
  • GFNet-XS achieves 75.8% top-1 accuracy on ImageNet with only 1.5 GFLOPs, demonstrating strong efficiency-accuracy trade-offs.
  • On ImageNet-C, GFNet-S achieves a mean corruption error (mCE) of 53.8, outperforming DeiT-S (54.6) and ResMLP-12 (66.0), indicating superior robustness.
  • On ImageNet-A, GFNet-S achieves 14.3% top-1 accuracy, outperforming DeiT-S (18.9%) and ResNet-50 (0.0%), showing strong adversarial robustness.
  • Visualization of learned global filters reveals clearer, more structured patterns in the frequency domain than in the spatial domain, especially in deeper layers.
  • GFNet maintains strong performance on downstream semantic segmentation and transfer learning tasks, demonstrating strong generalization ability.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.