VideoMamba: Spatio-Temporal Selective State Space Model

Jinyoung Park, Hee-Seon Kim, Kangwook Ko, Minbeom Kim, Changick Kim

Introduction

Video understanding represents a significant frontier in computer vision, yet it remains a "computational nightmare." While Transformers have established themselves as the gold standard for capturing long-range dependencies, their core mechanism—self-attention—suffers from quadratic complexity ($O(N^2)$). As video resolution or frame counts increase, the memory and processing requirements explode, creating a "computational wall" that limits the processing of long-form content.

VideoMamba introduces a paradigm shift by adapting the pure Mamba architecture (Selective State Space Model) for video recognition. By replacing heavy self-attention with a linear-complexity selective scan mechanism, it achieves state-of-the-art efficiency while maintaining the modeling power of traditional video Transformers.

The VideoMamba Architecture

The core of VideoMamba is the Selective State Space Model (SSM). Unlike Transformers that compute a global attention matrix, Mamba processes sequences like an advanced Recurrent Neural Network (RNN) that can selectively "remember" or "forget" information based on the input.

The VideoMamba architecture utilizes a bidirectional Spatio-Temporal SSM to process video tokens with linear complexity.

Key Technical Innovations

  1. Video Tokenization: The model employs 3D convolutions (tubelet embedding) to convert raw video clips into a 1D sequence of tokens, preserving local spatio-temporal structures.
  2. Bidirectional Scanning: Since SSMs are inherently directional, VideoMamba introduces a bidirectional scanning strategy. The authors found that "Spatio-temporal reversal"—flipping the entire flattened sequence for the backward pass—was the most effective method for integrating spatial and temporal cues.
  3. Image-to-Video Transfer: To mitigate the data-hungry nature of training from scratch, the authors developed specific recipes to initialize VideoMamba using weights from Mamba models pre-trained on ImageNet-1K.

Efficiency and Scaling

One of the most significant advantages of VideoMamba is its linear scaling. As the number of frames increases, GFLOPs and GPU memory usage grow linearly, whereas Transformer-based models like VideoSwin hit memory limits (Out of Memory - OOM) much sooner.

Comparison of VideoMamba against VideoSwin-T and VideoMAE-S across accuracy, GFLOPs, and GPU memory usage.

The linear complexity allows VideoMamba to handle significantly longer sequences. For instance, on the SSV2 dataset, VideoMamba achieved 63.7% Top-1 accuracy using only 34 GFLOPs. In contrast, VideoSwin-T achieved a lower 52.3% while requiring 88 GFLOPs—nearly triple the computational cost for inferior performance.

Experimental Results

The model was rigorously evaluated on three major benchmarks: Kinetics-400 (K400), Something-Something V2 (SSV2), and HMDB51.

  • Temporal Sensitivity: By shuffling frames during testing, the authors demonstrated that VideoMamba genuinely relies on the sequential flow of time. It doesn't just treat videos as "bags of images" but learns the underlying dynamics of actions.
  • Long-Range Modeling: Performance gains were consistent as input sequence lengths increased from 8 to 32 frames, proving the architecture's capability to handle long-range dependencies effectively without the quadratic overhead of attention.
  • State-of-the-Art Performance: On HMDB51, VideoMamba reached 75.7% Top-1 accuracy (with K400 pre-training), outperforming concurrent Mamba-based and Transformer-based models of similar scale.

Conclusion and Future Directions

VideoMamba proves that the Mamba architecture is a viable, highly efficient alternative to Transformers for video understanding. By achieving linear complexity without sacrificing accuracy, it opens the door for processing much longer video sequences than previously possible.

While currently focused on classification, future work could extend VideoMamba to complex tasks like spatio-temporal action localization or video object detection. Additionally, exploring "pure" video self-supervised pre-training could further enhance the model's ability to learn temporal dynamics without relying on spatial biases from still-image datasets.

Summary updated

BibTeX
@inproceedings{park2024videomamba,
  author = {Jinyoung Park and Hee-Seon Kim and Kangwook Ko and Minbeom Kim and Changick Kim},
  title = {{VideoMamba: Spatio-Temporal Selective State Space Model}},
  booktitle = {European Conference on Computer Vision},
  year = {2024},
  doi = {10.1007/978-3-031-72698-9\_1},
}
Figure