Efficient Self-Supervised Video Hashing with Selective State Spaces

Jinpeng Wang, Niu Lian, Jun Li, Yuting Wang, Yan Feng, Bin Chen, Yongbing Zhang, Shu-Tao Xia

Introduction

Video hashing is essential for large-scale video retrieval, as it compresses high-dimensional video data into compact, searchable binary codes. While Self-Supervised Video Hashing (SSVH) has gained popularity due to the abundance of unlabeled data, current models face a major scalability bottleneck. Transformers currently dominate the field because they excel at capturing temporal relationships, but their computational and memory costs grow quadratically ($O(L^2)$) with the number of video frames ($L$). Older Recurrent Neural Networks (RNNs) scale linearly but struggle with long-range dependencies and vanishing gradients.

The authors introduce S5VH (Self-Supervised Selective State-Space Video Hashing), the first video hashing model to leverage Mamba (Selective State Space Models). S5VH achieves state-of-the-art retrieval accuracy with significantly higher efficiency than Transformer-based methods by combining linear-complexity temporal modeling with a novel "Self-Local-Global" learning paradigm.

Methods: Bidirectional Mamba and SLG Learning

S5VH introduces two primary innovations to address the limitations of existing models:

  1. Bidirectional Mamba Architecture: Instead of self-attention, S5VH uses bidirectional Mamba layers in both the encoder and decoder. Mamba’s data-dependent selective scanning mechanism allows the model to focus on essential information while filtering out noise. By scanning in both forward and backward directions, the model captures a comprehensive temporal context with linear complexity ($O(L)$).
  2. Self-Local-Global (SLG) Learning Paradigm:
    • Self (Temporal Reconstruction): The model learns to reconstruct masked frame features from hash codes.
  3. Local (Contrastive Learning): It aligns hash codes from different augmented views of the same video to ensure discriminative power.
  4. Global (Hash Center Alignment): The authors cluster the entire video corpus to find semantic "centers" in the feature space and optimize them to be well-separated in Hamming space. A new Center Alignment Loss ($L_{CA}$) forces video hash codes to align with these global semantic centers.
The S5VH architecture featuring bidirectional Mamba layers and the Self-Local-Global (SLG) learning paradigm.

Key Results and Efficiency

S5VH was evaluated on four standard benchmarks: ActivityNet, FCVID, UCF101, and HMDB51. It consistently outperformed state-of-the-art models like ConMH and BerVAE across all datasets and bit lengths (16, 32, and 64 bits). The gains are particularly notable at lower bit lengths (e.g., 16-bit), which are most useful for high-speed retrieval.

Linear vs. Quadratic Scaling

Empirical testing confirmed that while Transformers (like ConMH) show quadratic growth in inference time as frame counts increase, S5VH maintains a strictly linear growth rate. At 500 frames, S5VH is significantly faster and more memory-efficient, supporting much larger batch sizes than its Transformer-based counterparts.

Comparison of average encoding time and maximum inference batch size between S5VH and Transformer-based models (MCMSH, ConMH) as video frame numbers increase.

The introduction of the "Global" signal via $L_{CA}$ not only improves accuracy but also acts as a strong guide for the model, leading to approximately 65% faster training convergence and a 6% relative improvement in retrieval performance (mAP).

Conclusion

S5VH successfully bridges the gap between the long-range modeling of Transformers and the linear efficiency of RNNs. By utilizing Selective State Space Models and a global semantic alignment strategy, it sets a new standard for efficient, large-scale self-supervised video hashing. Future work may explore end-to-end hash center generation and deeper integration of temporal modeling into the backbone feature extractors.

Summary updated

BibTeX
@inproceedings{wang2025efficient,
  author = {Jinpeng Wang and Niu Lian and Jun Li and Yuting Wang and Yan Feng and Bin Chen and Yongbing Zhang and Shu-Tao Xia},
  title = {{Efficient Self-Supervised Video Hashing with Selective State Spaces}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i7.32835},
}
Figure