VisionGRU: A Linear-Complexity RNN Model for Efficient Image Analysis

Shicheng Yin, Kaixuan Yin, Weixing Chen, Enbo Huang, Yang LiuarXiv 2024

Abstract

Convolutional Neural Networks (CNNs) and Vision Transformers (ViTs) are two dominant models for image analysis. While CNNs excel at extracting multi-scale features and ViTs effectively capture global dependencies, both suffer from high computational costs, particularly when processing high-resolution images. Recently, state-space models (SSMs) and recurrent neural networks (RNNs) have attracted attention due to their efficiency. However, their performance in image classification tasks remains limited. To address these challenges, this paper introduces VisionGRU, a novel RNN-based architecture designed for efficient image classification. VisionGRU leverages a simplified Gated Recurrent Unit (minGRU) to process large-scale image features with linear complexity. It divides images into smaller patches and progressively reduces the sequence length while increasing the channel depth, thus facilitating multi-scale feature extraction. A hierarchical 2DGRU module with bidirectional scanning captures both local and global contexts, improving long-range dependency modeling, particularly for tasks like semantic segmentation. Experimental results on the ImageNet and ADE20K datasets demonstrate that VisionGRU outperforms ViTs, significantly reducing memory usage and computational costs, especially for high-resolution images. These findings underscore the potential of RNN-based approaches for developing efficient and scalable computer vision solutions.

Introduction

For years, computer vision has been dominated by a trade-off between CNNs—efficient at local patterns but limited in global context—and Vision Transformers (ViTs), which excel at global dependencies but face a "Quadratic Wall." ViTs rely on self-attention mechanisms where computational costs grow quadratically ($O(N^2)$) relative to the number of pixels. This makes high-resolution processing for tasks like medical imaging or autonomous driving prohibitively expensive. While State-Space Models (SSMs) offer linear complexity ($O(N)$), they have historically lagged behind ViTs in classification accuracy. VisionGRU addresses these limitations by reimagining Recurrent Neural Networks (RNNs) for modern hardware, providing a linear-complexity backbone that is both accurate and efficient.

Methods

VisionGRU's architecture is built on three primary innovations designed to modernize the RNN for vision tasks:

  1. The minGRU Unit: VisionGRU utilizes a simplified Gated Recurrent Unit (minGRU) that removes reset gates and hidden state dependencies in the update gate. This eliminates the need for Backpropagation Through Time (BPTT), allowing the model to be trained using parallel prefix-scan algorithms. This results in training speeds comparable to Transformers.
  2. 2DGRU with Bidirectional Scanning: To handle the non-sequential nature of images, the 2DGRU module processes patches using bidirectional scanning (forward and reverse raster orders). This ensures every pixel aggregates information from both preceding and succeeding regions, effectively capturing global context.
  3. Hierarchical Architecture: Similar to ResNet or Swin Transformer, VisionGRU employs a multi-stage approach. It begins with small patches and progressively reduces sequence length (downsampling) while increasing channel depth, enabling the capture of fine-grained details early and high-level semantic features in deeper layers.
The hierarchical architecture of VisionGRU, featuring the 2DGRU module and the simplified minGRU unit.

Experimental Results

The model was evaluated on ImageNet-1K for classification and ADE20K for semantic segmentation.

Classification and Efficiency

On ImageNet-1K, VisionGRU-Ti (30M parameters) achieved 82.0% top-1 accuracy, significantly outperforming DeiT-Ti (72.2%) and the SSM-based Vim-Ti (76.1%). As resolution increases, VisionGRU’s linear complexity becomes a decisive advantage. At a resolution of 1248x1248, VisionGRU-Ti is nearly 3x more computationally efficient than DeiT-S.

Semantic Segmentation

On the ADE20K dataset, VisionGRU-Ti achieved a mean Intersection-over-Union (mIoU) of 44.7%, surpassing both Swin-Ti (44.5%) and DeiT-S (43.8%). This confirms that its bidirectional global context modeling is highly effective for dense, pixel-level prediction tasks.

Performance comparison of VisionGRU-Ti vs. DeiT-S across classification, semantic segmentation, and computational scaling.

Conclusion and Future Work

VisionGRU demonstrates that RNNs, when restructured for parallelization and hierarchical processing, are highly competitive with modern ViTs and SSMs. By overcoming the quadratic scaling bottleneck, VisionGRU provides a scalable solution for high-resolution image analysis. Future research will explore extending this linear-complexity architecture to video analysis, where the temporal dimension presents even greater computational challenges that VisionGRU's sequential nature is uniquely suited to address.

Summary updated

BibTeX
@misc{yin2024visiongru,
  author = {Shicheng Yin and Kaixuan Yin and Weixing Chen and Enbo Huang and Yang Liu},
  title = {{VisionGRU: A Linear-Complexity RNN Model for Efficient Image Analysis}},
  year = {2024},
  eprint = {2412.18178},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2412.18178},
}
Figure