Efficient Modulation for Vision Networks

Xu Ma, Xiyang Dai, Jianwei Yang, Bin Xiao, Yinpeng Chen, Yun Fu, Lu Yuan

Introduction

EfficientMod is a novel vision network architecture that optimizes the "modulation mechanism"—a technique that fuses convolutional context with feature projections via element-wise multiplication. By streamlining fragmented operations and simplifying context modeling, EfficientMod achieves a new state-of-the-art in accuracy-efficiency trade-offs. It successfully outperforms recent models like EfficientFormerV2 while running significantly faster on GPUs.

The Challenge with Mobile Vision Backbones

While Vision Transformers (ViTs) have revolutionized computer vision with their ability to model long-range dependencies, they are notoriously difficult to deploy on edge devices. Their self-attention mechanism carries a quadratic computational complexity relative to the number of pixels, making them slow and memory-intensive.

Recent "pure" convolutional alternatives, such as FocalNet and VAN, introduced Modulation Mechanisms. These use large-kernel convolutions to "modulate" features, mimicking the dynamic properties of attention without the heavy computational cost. However, these designs often suffer from high inference latency on real hardware due to two main culprits:

  1. Fragmented Operations: Relying on too many small, successive layers (like multiple depth-wise convolutions) violates hardware efficiency guidelines, leading to significant overhead.
  2. Redundancy: Isofunctional operations and redundant linear projections consume a large portion of the operating time without providing proportional accuracy gains.

The EfficientMod Architecture

To address these inefficiencies, the authors propose the EfficientMod block, which refines the modulation mechanism for practical speed and deployment.

Comparison of block architectures
  • Slimming the Design: Instead of maintaining separate MLP and modulation blocks, EfficientMod fuses them into a unified structure. It uses a flexible expansion factor to project features into a higher-dimensional space, performs modulation, and then squeezes them back. This drastically reduces the number of "fragments" the GPU has to process.
  • Simplified Context Modeling: Rather than complex multi-scale aggregations, the architecture uses a single $7 \times 7$ depth-wise convolution followed by a linear projection. This balances a large receptive field with high throughput.
  • Hybrid Architecture: While the core is convolutional, the authors found that adding vanilla self-attention blocks in the final two stages (where the feature map resolution is small) provides a global "boost" in accuracy without significantly hurting latency.

Hardware-Aware Optimizations

Beyond architectural restructuring, the authors implemented specific hardware-aware tweaks. For instance, they use the Repeat operation instead of Reshape to match channel dimensions. As demonstrated in their profiling, Reshape acts as a significant bottleneck on many CPU implementations, and swapping it out yields noticeable latency improvements.

Latency comparison of Repeat vs. Reshape

Key Insights

  • FLOPs are Deceptive: The paper reinforces the idea that lower FLOPs (Floating Point Operations) do not always equate to faster models. EfficientMod often has similar FLOP counts to competitors but achieves significantly lower latency because it respects hardware data-flow properties.
  • The "Taylor Expansion" of Modulation: In a fascinating theoretical section, the authors suggest that modulation blocks act like a recursive projection. With just a few blocks, the network can effectively project input into a "very high-dimensional feature space," explaining why these models perform so well even with a small number of parameters.
  • Modulation vs. MBConv: Compared to the standard Mobile Inverted Bottleneck (MBConv) used in MobileNetV2, EfficientMod inserts spatial context modeling into the middle of the feature projection via multiplication rather than sequential addition. This "dynamic" interaction is key to its superior representation power.

Performance and Results

EfficientMod sets a new bar for efficient vision backbones across standard industry benchmarks:

  • Classification (ImageNet-1K): EfficientMod-s achieves 81.0% top-1 accuracy. This is 0.6% higher than EfficientFormerV2-S2 while being 25% faster on a P100 GPU.
  • Mobile Performance: On an iPhone 13, the ultra-lightweight "xxs" version achieves 75.3% accuracy with a latency of only 1.2ms.
  • Downstream Tasks: The gains are even more pronounced in dense prediction. On the ADE20K semantic segmentation benchmark, EfficientMod-s outperforms EfficientFormerV2-s by a massive 3.6 mIoU with comparable complexity.
  • Comparison to MobileViT: It outperforms MobileViTv2-1.0 by 2.9% accuracy at the same GPU latency.

Limitations and Future Work

The authors acknowledge that while large-kernel convolutions are effective, they might not be the absolute most efficient way to capture the widest possible receptive field in every scenario. Additionally, while the "high-dimensional projection" theory is a compelling explanation for the model's success, they note it is currently a tentative explanation that requires more formalized, in-depth mathematical investigation in future research.

Summary updated

BibTeX
@inproceedings{ma2024efficient,
  author = {Xu Ma and Xiyang Dai and Jianwei Yang and Bin Xiao and Yinpeng Chen and Yun Fu and Lu Yuan},
  title = {{Efficient Modulation for Vision Networks}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=ip5LHJs6QX},
}
Figure