Efficient Movie Scene Detection using State-Space Transformers

Md Mohaiminul Islam, Mahmudul Hasan, Kishan Shamsundar Athrey, Tony Braskich, Gedas Bertasius

TL;DR

The TranS4mer model introduces a hybrid architecture that combines the local precision of self-attention with the global efficiency of Structured State-Space (S4) layers to detect movie scene boundaries. It achieves state-of-the-art results across major benchmarks while being 2x faster and requiring 3x less GPU memory than standard Transformer-based approaches.

What Problem Does This Paper Address?

Detecting scene boundaries in movies is a "long-range" problem. While standard action recognition deals with clips lasting 5–10 seconds, a single movie scene can span several minutes and dozens of individual shots.

The challenge lies in the hierarchical nature of film:

  1. Frames make up Shots (uninterrupted camera takes).
  2. Shots make up Scenes (semantically cohesive units of the story).

Existing methods often struggle. Convolutional Neural Networks (CNNs) have limited receptive fields, making them "nearsighted." Transformers can see everything, but their self-attention mechanism has a quadratic computational cost ($O(L^2)$), making them prohibitively expensive for processing the thousands of tokens required for long-form video. The authors aim to bridge this gap with a model that is both "farsighted" and computationally efficient.

Figure 2. The hierarchical structure of long movie videos. First, multiple consecutive frames captured from the same camera po- sition depict a shot. Next, multiple neighboring shots constitute a movie scene. Finally, a movie is composed of a collection of scenes. Here, we show one scene that contains N shots with K frames in each shot.

Methods

The core innovation is the S4A Block, which stacks two specialized modules:

  • Intra-Shot Module (Self-Attention): This module applies standard multi-headed self-attention only to the frames within a single shot. This allows the model to capture short-range visual cues—like which characters are present or what objects are in the background—without the cost of attending to the entire movie.
  • Inter-Shot Module (Gated S4): To understand the relationship between shots far apart in time, the model uses a Structured State-Space (S4) layer. S4 layers are designed for long-sequence modeling and have linear complexity ($O(L)$), allowing the model to aggregate "inter-shot" cues across long temporal windows efficiently.

By stacking these blocks, the TranS4mer can reason about local details and global narrative flow simultaneously. The model is trained using a self-supervised pretraining strategy (predicting "pseudo-boundaries") followed by supervised finetuning on labeled datasets.

Figure 3. Overview of the TranS4mer model. Left: Our model takes a sequence of frames divided into automatically-detected shots. Following the ViT [16], the frames are decomposed into non-overlapping patches and passed through a linear projection layer. Afterward, we feed these patch-level embeddings through our TranS4mer model, which consists of B state-space self-attention (S4A) blocks stacked on top of each other. Finally, the CLS tokens of all shots are passed to two linear layers, i.e., the boundary prediction head (which outputs a binary label indicating the boundary shot) and the contrastive head (which maximizes intra-shot similarity). Right: Each of our proposed S4A blocks contains a self-attention-based intra-shot module that models the interaction among frames in the same shot and a Gated S4- based inter-shot module that aggregates long-range temporal cues from shots far away from each other.

Datasets

The authors evaluated TranS4mer on three primary movie scene detection benchmarks:

  • MovieNet: The largest dataset, containing 1,100 movies and 1.6 million shots.
  • BBC: 11 episodes from the Planet Earth series.
  • OVSD: 21 short films with scenes extracted from original scripts.

To test generalizability, they also applied the model to long-range video classification tasks using the LVU (movie clips), Breakfast, and COIN (procedural activities) datasets.

Key Insights and Ideas

  • Efficiency through Decoupling: The "aha moment" is that you don't need to attend to every frame in a movie at once. By decoupling local visual recognition (via attention) from global temporal reasoning (via S4), the model avoids the "quadratic bottleneck" of Transformers.
  • Complementary Strengths: The intra-shot module handles the "what" (visual concepts), while the inter-shot module handles the "when" (narrative transitions). Ablation studies showed that removing either module significantly degrades performance.
  • Scaling with Context: Unlike standard Transformers, which see performance plateau or crash due to memory limits as input length increases, TranS4mer continues to improve as it is given more temporal context.

Key Results

TranS4mer set new performance records across the board:

  • Accuracy: On MovieNet, it outperformed the previous best method (BaSSL) by +3.38% AP. It saw even larger gains on BBC (+4.66%) and OVSD (+7.36%).
  • Speed and Memory: It is 2.68x faster and uses 3.38x less GPU memory than previous state-of-the-art models like ShotCoL and BaSSL.
  • Generalization: It achieved top-tier results on procedural activity datasets (Breakfast and COIN) despite using significantly less pretraining data than competitors.
Performance and efficiency comparison between TranS4mer and standard Transformers.

Limitations and Future Work

While the paper demonstrates a massive leap in efficiency, the authors note that the current model primarily relies on visual information. In the future, they plan to extend TranS4mer to multi-modal tasks, incorporating audio and text (scripts) to further improve scene understanding. They also see potential for the architecture in movie summarization and natural language grounding in long-form video.

Summary updated

BibTeX
@misc{islam2022efficient,
  author = {Md Mohaiminul Islam and Mahmudul Hasan and Kishan Shamsundar Athrey and Tony Braskich and Gedas Bertasius},
  title = {{Efficient Movie Scene Detection using State-Space Transformers}},
  year = {2022},
  eprint = {2212.14427},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2212.14427},
}
Figure