Abstract
Efficient video retrieval is essential for managing large-scale multimedia databases. Traditional unsupervised video hashing methods often rely on unidirectional sequential models, which fail to capture global temporal context. We introduce Bidirectional Transformers for Hashing (BTH), a self-supervised framework that transforms videos into compact binary codes. By employing a bidirectional transformer architecture and a multi-task learning approach—including visual cloze, similarity reconstruction, and cluster assignment—BTH achieves state-of-the-art performance on major benchmarks without requiring manual labels.
Introduction
As video content explodes across digital platforms, the challenge of scalable retrieval becomes increasingly acute. Video hashing addresses this by compressing high-dimensional video data into short binary strings, enabling rapid search with minimal storage requirements. However, existing unsupervised methods often suffer from two main drawbacks: a reliance on unidirectional models (like RNNs) that ignore future context, and a focus on individual video reconstruction that neglects the global relationships between different videos in a dataset.
Methodology
The BTH framework addresses these limitations by utilizing a Bidirectional Transformer Encoder. Unlike sequential models, the transformer uses self-attention to process all frames simultaneously, capturing complex, non-linear correlations across the entire video sequence.
The model is trained through three complementary self-supervised tasks:
- Visual Cloze: Similar to the masked language modeling in BERT, the model randomly masks certain frames and is tasked with reconstructing the full sequence. This forces the encoder to learn deep internal representations of video content.
- Similarity Reconstruction: To ensure that semantically similar videos are mapped to similar hash codes, the model constructs an approximate similarity graph using anchor points and optimizes the codes to preserve these pairwise connections.
- Cluster Assignment: The model identifies "pseudo-centers" across the dataset. During training, it encourages video embeddings to align with these centers, producing more discriminative and "sharper" binary codes.
Experiments and Results
BTH was evaluated on three widely-used benchmarks: FCVID (~91,000 videos), ActivityNet (~10,000 videos), and YFCC (up to 500,000 videos).
The model consistently outperformed previous state-of-the-art (SOTA) unsupervised methods. On the FCVID dataset with 64-bit codes, BTH achieved a Mean Average Precision (mAP) of 0.308, significantly higher than the next best competitor, NPH (0.287). Precision-Recall curves further demonstrate that BTH maintains higher precision during retrieval. Additionally, BTH proved robust in cross-dataset evaluations, showing minimal performance drops when trained on one dataset and tested on another. Notably, the system is highly efficient, with an encoding time of approximately 1.18ms per video.
Discussion and Conclusion
The results confirm that bidirectional context is vital for video hashing, as "future" frames provide essential context for understanding "past" frames. Furthermore, the inclusion of similarity reconstruction and cluster assignment tasks demonstrates that capturing global dataset structure is critical for generating effective search keys.
While BTH sets a new benchmark, there is room for improvement. The current reliance on pre-trained VGG-16 features could be replaced with more modern backbones or end-to-end training. Additionally, exploring advanced frame sampling strategies, such as keyframe detection, may further enhance the model's ability to capture nuances in long-form video content.
Summary updated