Learning Segment Similarity and Alignment in Large-Scale Content Based Video Retrieval

Chen Jiang, Kaiming Huang, Sifeng He, Xudong Yang, Wei Zhang, Xiaobo Zhang, Yuan Cheng, Lei Yang, Qing Wang, Furong Xu, Tan Pan, Wei Chu · DOI

Abstract

With the explosive growth of web videos in recent years, large-scale Content-Based Video Retrieval (CBVR) becomes increasingly essential in video filtering, recommendation, and copyright protection. Segment-level CBVR (S-CBVR) locates the start and end time of similar segments in finer granularity, which is beneficial for user browsing efficiency and infringement detection especially in long video scenarios. The challenge of S-CBVR task is how to achieve high temporal alignment accuracy with efficient computation and low storage consumption. In this paper, we propose a Segment Similarity and Alignment Network (SSAN) in dealing with the challenge which is firstly trained end-to-end in S-CBVR. SSAN is based on two newly proposed modules in video retrieval: (1) An efficient Self-supervised Keyframe Extraction (SKE) module to reduce redundant frame features, (2) A robust Similarity Pattern Detection (SPD) module for temporal alignment. In comparison with uniform frame extraction, SKE not only saves feature storage and search time, but also introduces comparable accuracy and limited extra computation time. In terms of temporal alignment, SPD localizes similar segments with higher accuracy and efficiency than existing deep learning methods. Furthermore, we jointly train SSAN with SKE and SPD and achieve an end-to-end improvement. Experimental results on public datasets show that SSAN can obtain higher alignment accuracy while saving storage and online query computational cost compared to existing methods.

Introduction

Content-Based Video Retrieval (CBVR) is a critical component in modern digital ecosystems, serving functions from copyright enforcement to content recommendation. While video-level retrieval is well-established, segment-level retrieval (S-CBVR)—identifying the precise start and end times of matching clips within longer videos—presents a significant technical hurdle. Systems must navigate a "triple threat" of scale (searching billions of videos), variability (handling edits, speed changes, or crops), and efficiency (minimizing storage and latency).

Traditional methods often rely on uniform frame sampling, which either misses critical details or stores redundant data, and brute-force sequence matching, which is computationally prohibitive for real-time applications. To address these challenges, we introduce the Segment Similarity and Alignment Network (SSAN), an end-to-end framework designed for high-accuracy, high-efficiency segment retrieval.

The SSAN Framework

Overview of the SSAN pipeline, including Keyframe Extraction, Index Search, and Temporal Alignment.

SSAN integrates two core innovations into a unified pipeline: Self-supervised Keyframe Extraction (SKE) and Similarity Pattern Detection (SPD).

Self-supervised Keyframe Extraction (SKE)

Rather than sampling frames at fixed intervals, SKE identifies the most informative frames to represent a video. To eliminate the need for manual labeling, we employ a "teacher" model based on dynamic programming to generate ground-truth keyframe annotations. A key technical insight in SKE is the arrangement of frames into a 2D tiled pattern (similar to a contact sheet). This allows the network to utilize standard 2D convolutions to capture long-range temporal dependencies efficiently.

Similarity Pattern Detection (SPD)

SPD reframes temporal alignment as an object detection task. By generating a 2D similarity matrix where the axes represent frames from two different videos, the system can treat matching segments as visual patterns. SPD uses a detection network to identify "bounding boxes" within this matrix that correspond to similar segments. This approach is inherently more robust to variations in video speed and editing than traditional 1D sequence matching.

Visualization of a similarity map where matching segments are identified as diagonal patterns.

Joint End-to-End Training

A unique advantage of SSAN is that SKE and SPD are trained jointly. Keyframe scores from the SKE module are used to weight the similarity matrix, while the detection loss from SPD provides feedback to SKE. This ensures the system learns to prioritize frames that are most useful for the final alignment task.

Experimental Evaluation

Datasets and Setup

We evaluated SSAN on several industry benchmarks, including VCDB (partial video copy detection), CC_WEB (near-duplicate retrieval), and FIVR-200k (fine-grained incident retrieval). To simulate real-world scale, we created VCDB_plus, adding 270,000 "distractor" videos to the standard VCDB set.

Performance and Efficiency

SSAN demonstrates significant improvements in both speed and accuracy:

  • Efficiency: On the VCDB dataset, SSAN completed retrieval in 0.35 hours, a massive speedup compared to the 5+ hours required by previous state-of-the-art methods like LAMV.
  • Accuracy: SSAN achieved an F1 score of 61.22 on VCDB_plus, outperforming LAMV (58.44) while utilizing 6.5x fewer features.
  • Robustness: The SPD module maintained high performance even as the number of distractor videos increased, proving its stability in large-scale environments.

Conclusion

SSAN represents a significant step forward in large-scale segment-level video retrieval. By treating alignment as a visual detection task and optimizing keyframe extraction through self-supervision, the framework achieves state-of-the-art accuracy with drastically reduced storage and computational costs. Future work will explore deep hashing techniques to further compress features for even larger, billion-scale production environments.

Summary updated

BibTeX
@inproceedings{jiang2021learning,
  author = {Chen Jiang and Kaiming Huang and Sifeng He and Xudong Yang and Wei Zhang and Xiaobo Zhang and Yuan Cheng and Lei Yang and Qing Wang and Furong Xu and Tan Pan and Wei Chu},
  title = {{Learning Segment Similarity and Alignment in Large-Scale Content Based Video Retrieval}},
  booktitle = {ACM Multimedia},
  year = {2021},
  doi = {10.1145/3474085.3475301},
}
Figure