VideoMamba: State Space Model for Efficient Video Understanding

Kunchang Li, Xinhao Li, Yi Wang, Yinan He, Yali Wang, Limin Wang, Yu Qiao

Introduction

Video understanding is a complex task that requires a model to balance the capture of local spatiotemporal details with the modeling of long-range dependencies. Historically, two primary architectures have dominated this field: 3D Convolutional Neural Networks (CNNs) and Video Transformers. While CNNs are adept at local features, they lack the receptive field for long-range modeling. Transformers offer global dependencies via self-attention but suffer from quadratic complexity ($O(L^2)$) relative to sequence length. As video resolution and duration increase, the computational and memory costs of Transformers become prohibitive.

VideoMamba addresses this fundamental bottleneck by adapting the Selective State Space Model (Mamba) to the video domain. By leveraging Mamba's linear complexity ($O(L)$), VideoMamba provides a scalable, efficient alternative that is "better, faster, and cheaper" than traditional attention-based models.

The VideoMamba Architecture

VideoMamba is built upon the Mamba (S6) architecture, which uses a selective scan mechanism to achieve efficient sequence modeling. However, standard Mamba is causal, designed for unidirectional data like text. Since video data is spatiotemporal and non-causal, the authors introduced several key innovations:

The architecture of standard Mamba compared to the proposed Bidirectional Mamba block used in VideoMamba.
  1. Bidirectional Mamba (B-Mamba) Blocks: To ensure the model has a global view of the video sequence, VideoMamba processes flattened spatiotemporal tokens in both forward and backward directions.
  2. Spatiotemporal Scanning: The model employs a Spatial-First scanning approach. By organizing tokens by location and then stacking them frame-by-frame, the architecture effectively leverages 2D pretrained knowledge.
  3. Self-Distillation: To prevent overfitting and improve convergence as the model scales, a self-distillation strategy is used where a smaller teacher model guides the training of a larger student model.
  4. Masked Modeling: The authors adapted masked video pretraining (similar to VideoMAE) using a specialized row masking strategy that respects Mamba’s reliance on continuous token sequences for its internal 1D convolutions.

Efficiency and Scalability

The standout feature of VideoMamba is its linear scaling. Unlike Transformers, where doubling the video length quadruples the resource requirement, VideoMamba’s costs only double. This allows for end-to-end training on sequences that would typically crash a standard Transformer.

Performance metrics comparing VideoMamba-Ti and TimeSformer-Ti in terms of throughput and GPU memory usage.

As illustrated in the efficiency plots, VideoMamba-Ti achieves a 6x increase in throughput and a 40x reduction in GPU memory usage compared to TimeSformer when processing 64-frame videos. This efficiency enables the model to handle long-form video understanding tasks with ease, avoiding the out-of-memory (OOM) issues that plague attention-based systems.

Experimental Results

VideoMamba was rigorously tested across a wide range of benchmarks, demonstrating state-of-the-art performance:

  • Image Classification: On ImageNet-1K, VideoMamba-M (74M parameters) achieved 84.0% top-1 accuracy, outperforming isotropic ConvNeXt-B and DeiT-B.
  • Short-term Video: On Kinetics-400, the model reached 83.3% top-1 accuracy, surpassing ViViT-L by 2.0% while requiring significantly less pretraining data.
  • Long-term Video: VideoMamba showed a massive leap in performance on the Breakfast dataset, achieving 97.9% accuracy compared to the previous state-of-the-art of 89.9%.
  • Temporal Sensitivity: The model proved exceptionally capable on motion-heavy tasks like Something-Something V2, outperforming Transformers in distinguishing fine-grained actions such as "opening" versus "closing."
  • Multi-modal Integration: In zero-shot text-to-video retrieval tasks on DiDeMo and MSRVTT, VideoMamba set new benchmarks, proving its versatility in CLIP-style architectures.

Conclusion

VideoMamba demonstrates that State Space Models are a viable and highly efficient alternative to Transformers for video understanding. By achieving linear complexity without sacrificing performance, it opens the door for "hour-level" video comprehension and more accessible large-scale video modeling. Future research will focus on scaling to billion-parameter models and integrating additional modalities like audio for a truly holistic understanding of video content.

Summary updated

BibTeX
@inproceedings{li2024videomamba,
  author = {Kunchang Li and Xinhao Li and Yi Wang and Yinan He and Yali Wang and Limin Wang and Yu Qiao},
  title = {{VideoMamba: State Space Model for Efficient Video Understanding}},
  booktitle = {European Conference on Computer Vision},
  year = {2024},
  doi = {10.1007/978-3-031-73347-5\_14},
}
Figure