Two-Stream Video Classification with Cross-Modality Attention

Lu Chi, Guiyu Tian, Yadong Mu, Qi Tian

TL;DR

Standard video classification often treats appearance (RGB) and motion (Optical Flow) as two separate silos, only combining them at the very last step. This paper introduces Cross-Modality Attention (CMA), a plug-and-play block that allows these streams to interact hierarchically, enabling one modality to "query" the other for complementary information and significantly improving classification accuracy.

What Problem Does This Paper Address?

In video understanding, humans naturally combine static visual cues (what an object looks like) with dynamic motion cues (how it moves). For example, to distinguish between "salsa" and "tango," a single frame isn't enough; you need the trajectory of the dancers.

The current state-of-the-art approach is the "two-stream" network, which processes RGB frames and optical flow fields in parallel. However, most implementations use late fusion, simply averaging the final prediction scores of both branches. The authors argue this is suboptimal. It misses the chance for the network to learn richer, joint features where motion informs appearance (and vice versa) at intermediate stages. Furthermore, existing models often struggle to attend to subtle, discriminative details—like a sword in a "sword fighting" clip—amidst complex backgrounds.

Methods

The core contribution is the Cross-Modality Attention (CMA) block.

Inspired by the Query-Key-Value (QKV) mechanism used in Transformers and Non-Local Networks, the CMA block allows one modality to attend to all positions in the other modality.

  • The Mechanism: If the RGB branch is the "query" ($Q$), it looks at the "keys" ($K$) and "values" ($V$) of the Flow branch. This allows the RGB stream to selectively absorb motion information that is most relevant to the current visual scene.
  • Architecture: The CMA block is designed as a residual wrapper (see Figure 1), making it easy to insert into standard backbones like ResNet-50.
  • Iterative Training: Because the Flow branch converges much slower than the RGB branch, the authors use an iterative training strategy. They first train the Flow branch, then freeze it to train the RGB branch with CMA, and then alternate to ensure both branches adapt to the cross-modal information.
Figure 1: An example of CMA block. We show the shape of fea- ture maps at each stage, such as H ×W ×1024, where 1024 is the number of channels. Let X be the feature maps of the RGB branch and Y be the feature maps of flow branch. The number of chan- nels is halved via 1 × 1 convolutions. Reshaping or transposing is performed whenever needed. “N” denotes matrix multiplication, and “L” denotes element-wise sum.
Figure 2: An overview of the video classification model. This model contains both RGB branch and Flow branch. In each branch, we insert n CMA blocks, which play an important role in transmitting information between different branches. There are three outputs in this model. Operations in dotted box are not essential since practically we can only use the output of the RGB branch for prediction.

Datasets

The authors evaluated their approach on two benchmark datasets:

  1. Kinetics: A massive dataset with over 300,000 video clips across 400 human-centric action classes.
  2. UCF-101: A smaller, widely-used dataset containing 13,320 clips of 101 action categories.

Key Insights and Ideas

  • Global Context is Key: Unlike standard convolutions that look at local neighborhoods, CMA is global. A pixel on a boxer’s glove can attend to the movement of the opponent across the entire frame, capturing long-range dependencies.
  • Motion as an Attention Guide: The authors found that motion often points to the most important objects. In "making a sandwich," the most relevant visual information is usually concentrated around the moving hands. CMA allows the model to use motion to "zoom in" on these visual details.
  • Generalization of Non-Local Blocks: The authors point out that if the two modalities being compared are identical, CMA effectively becomes a standard Non-Local block. This makes CMA a more flexible generalization of self-attention for multi-modal data.
  • Efficiency: Interestingly, the RGB branch alone (when enhanced with CMA blocks that query a fixed Flow branch) can outperform a standard two-stream model that uses twice the parameters.

Key Results

The CMA-enhanced models showed clear superiority over baseline two-stream and non-local architectures:

  • Kinetics: The RGB branch with CMA (CMA_iter1-R) achieved 72.17% top-1 accuracy, outperforming the standard two-stream baseline (71.21%) while using significantly fewer parameters (1.8x vs 2x relative to a single ResNet-50).
  • UCF-101: Through transfer learning, the model reached 96.5% top-1 accuracy, surpassing many 3D convolutional models despite using a 2D backbone.
  • Qualitative Success: Visualization of attention maps (Figure 5) shows the model successfully focusing on key moving parts, such as a swimmer's body or a person's hands while tying a bow tie, even when the rest of the body is in motion.
Figure 5: Examples of the attention maps. We train CMA iter1-R on Kinetics and visualize the attention maps of the last CMA block in res4 since the last block is the most related to the final classification. These samples are taken from Kinetics randomly. Each set contains three images, including (from left to right) RGB frame, optical flow fields, and the attention map. In the attention map, we draw some arrows that start from the query location and point to the more interesting parts in the CMA block. We observe that the block can easily focus on moving objects, such as the moving hand in the top-left set and the swimming person in the bottom-left set. And as a result, the RGB branch can take important information from the Flow branch as much as possible within limited capacity. We also find that the CMA operation is global. Looking at the example in the top-right, the pixel on the right person can not only focus on the nearby region but also pay attention to the other boxer, which shows our CMA block can capture long-range dependencies. Moreover, not all the moving objects can attract the attention, only key information does. In the last example tying bow tie, the block pays more attention to the region around the hand although the whole upper body is moving, because that the object held in hands often has more impact on the prediction. And more attention maps can be found in Appendix A.

Limitations and Future Work

  • Overfitting: The authors noted that the model is somewhat prone to overfitting on smaller datasets like UCF-101.
  • Background Noise: In some failure cases, if the query point is located in the background, the attention mechanism might erroneously focus on other background elements rather than the primary action.
  • Expanding Modalities: The current work focuses on RGB and Flow. The authors suggest that future work could extend CMA to other modalities like audio or human pose data.
  • Backbone Sophistication: The evaluations were primarily on ResNet-50; testing on more modern or complex architectures remains a future direction.

Summary updated

Abstract

Fusing multi-modality information is known to be able to effectively bring significant improvement in video classification. However, the most popular method up to now is still simply fusing each stream's prediction scores at the last stage. A valid question is whether there exists a more effective method to fuse information cross modality. With the development of attention mechanism in natural language processing, there emerge many successful applications of attention in the field of computer vision. In this paper, we propose a cross-modality attention operation, which can obtain information from other modality in a more effective way than two-stream. Correspondingly we implement a compatible block named CMA block, which is a wrapper of our proposed attention operation. CMA can be plugged into many existing architectures. In the experiments, we comprehensively compare our method with two-stream and non-local models widely used in video classification. All experiments clearly demonstrate strong performance superiority by our proposed method. We also analyze the advantages of the CMA block by visualizing the attention map, which intuitively shows how the block helps the final prediction.
BibTeX
@misc{chi2019two,
  author = {Lu Chi and Guiyu Tian and Yadong Mu and Qi Tian},
  title = {{Two-Stream Video Classification with Cross-Modality Attention}},
  year = {2019},
  eprint = {1908.00497},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1908.00497},
}
Figure