UniMD: Towards Unifying Moment Retrieval and Temporal Action Detection

Yingsen Zeng, Yujie Zhong, Chengjian Feng, Lin Ma

TL;DR

UniMD unifies Temporal Action Detection (TAD) and Moment Retrieval (MR) into a single framework by framing both as open-ended query tasks. By co-training on both tasks simultaneously using a shared set of parameters, the model exploits natural semantic synergies between action categories and language descriptions, achieving state-of-the-art results while reducing deployment costs.

What Problem Does This Paper Address?

Video understanding often involves two distinct but closely related tasks:

  1. Temporal Action Detection (TAD): Localizing pre-defined, closed-set actions (e.g., "cooking" or "running").
  2. Moment Retrieval (MR): Finding video segments that match open-ended natural language queries (e.g., "a person pours water into a pot").

Historically, researchers have treated these as independent problems, deploying separate, dedicated models for each. This creates an artificial separation and misses a massive opportunity: complex MR descriptions are frequently just sequences or combinations of simpler TAD actions.

This paper addresses this gap by asking a fundamental question: Can we build a single model that solves both tasks simultaneously and allows them to mutually benefit each other?

Methods

The authors introduce UniMD (Unified Moment Detection), an anchor-free, one-stage temporal detector designed to handle both tasks through a uniform interface.

Input Query ("a video of [action/event]") ──> CLIP Text Encoder ──> Shared Embedding Space
                                                                          │
Video Frames ───────────────────────────────> ConvNext + BiFPN ───────────┴──> Query-Dependent Decoders
  • Uniform Input Interface: Both tasks are converted into text queries (e.g., "a video of [action name]" for TAD, or the raw natural language description for MR).
  • Dual Encoders: Text queries are mapped into a shared embedding space using a frozen, pre-trained CLIP text encoder. For video, instead of using a heavy Transformer, UniMD employs a pure convolutional backbone (ConvNext + BiFPN), arguing that local convolutional operations are more efficient at capturing short-term motion patterns for local action detection.
  • Query-Dependent Decoders: To bridge the multi-modal gap, the architecture introduces two novel heads:
  • Classification Head: Uses the CLIP text embeddings directly as a classifier against the visual features to generate foreground confidence scores.
  • Regression Head: Employs a query transformation branch (an MLP and a resize operation) to transform text embeddings into a dynamic convolutional kernel. This kernel is convolved with visual features to predict precise start and end offsets.
  • Synchronized Task Sampling: During co-training, this strategy prioritizes video samples containing annotations for both tasks within each training iteration, maximizing cross-task collaboration.

Datasets

The model is evaluated on three paired datasets where videos share the same source but feature different annotations for TAD and MR:

  • Ego4D: Evaluated on Moment Query (TAD) and Natural Language Query (MR).
  • Charades & Charades-STA: Closed-set action categories (TAD) paired with sentence descriptions (MR).
  • ActivityNet & ActivityNet-Caption: Dense action categories (TAD) paired with open-ended event captions (MR).

Key Insights and Ideas

  • Mutual Synergy is Real: MR annotations help TAD by providing context on action sequencing and co-occurrence (e.g., knowing that "sitting down" happens before "looking at a book"). Conversely, TAD provides fine-grained action decomposition that serves as strong negative or positive samples for MR.
Mutual benefits of combining TAD and MR tasks
  • Data Efficiency via Co-training: Remarkably, co-training with synchronized task sampling allows the model to beat dedicated, single-task models even when trained on only a fraction of the data. For example, using just 25% of MR training data or 50% of TAD training data still yields superior performance compared to models trained exclusively on 100% of a single task's data. This proves the performance boost stems from semantic synergy, not just a larger volume of annotations.
Performance under various training data volumes

Key Results

UniMD achieves state-of-the-art (SOTA) results across all three benchmarks while introducing negligible computational overhead (less than 1% compared to single-task architectures like ActionFormer):

  • Ego4D: Reaches 23.25% mAP on TAD and 14.16% R1@30 on MR on the test set, establishing a new SOTA.
  • Charades-STA: Achieves a new SOTA of 63.98% R1@50 for Moment Retrieval.
  • ActivityNet: Achieves 39.83% mAP for TAD and 80.54% R5@50 for MR, outperforming strong dedicated baselines like InternVideo.

Limitations and Future Work

  • Pre-training Pitfalls: The authors note that sequential pre-training (training on one task and fine-tuning on the other) can cause the model to overfit to a specific domain. For instance, pre-training on TAD actually hurt subsequent MR performance, highlighting the necessity of joint co-training.
  • Dense Action Challenges: While UniMD performs competitively, specialized models utilizing graph-based classifiers (like CTRN) still hold a slight edge in highly dense action environments where modeling intricate action-to-action graphs is critical.
  • Future Directions: The authors suggest that the insights and sampling methods developed here provide a valuable foundation for training larger language-based video models (e.g., LLaMA-vid) on localized action and event detection tasks.

Summary updated

Abstract

Temporal Action Detection (TAD) focuses on detecting pre-defined actions, while Moment Retrieval (MR) aims to identify the events described by open-ended natural language within untrimmed videos. Despite that they focus on different events, we observe they have a significant connection. For instance, most descriptions in MR involve multiple actions from TAD. In this paper, we aim to investigate the potential synergy between TAD and MR. Firstly, we propose a unified architecture, termed Unified Moment Detection (UniMD), for both TAD and MR. It transforms the inputs of the two tasks, namely actions for TAD or events for MR, into a common embedding space, and utilizes two novel query-dependent decoders to generate a uniform output of classification score and temporal segments. Secondly, we explore the efficacy of two task fusion learning approaches, pre-training and co-training, in order to enhance the mutual benefits between TAD and MR. Extensive experiments demonstrate that the proposed task fusion learning scheme enables the two tasks to help each other and outperform the separately trained counterparts. Impressively, UniMD achieves state-of-the-art results on three paired datasets Ego4D, Charades-STA, and ActivityNet. Our code is available at https://github.com/yingsen1/UniMD.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
Ego4D-MQ (Ego4D test set, TAD)UniMD+Sync.mAP23.25%split: test · features=VideoMAE-verb
Source quote
L346: 23.25
Ego4D-NLQ · Ego4D test set, MRUniMD+Sync.R1@3014.16%split: test · features=VideoMAE-verb
Source quote
L348: 14.16
Charades-STA · test set, MRUniMD+Sync.R1@5063.98%split: test · backbone=CLIP · features=I3D+CLIP
Source quote
L391: UniMD+Sync. │ I3D+CLIP │ {\ul{26.53}} │ 63.98 │ 44.46 │ {\ul{91.94}} │ 67.72
ActivityNet · ANet validation set, TADUniMD+Sync.mAP@5060.29%split: val · features=InternVideo
Source quote
L421: UniMD+Sync. │ InternVideo │ 39.83 │ 60.29 │ 80.54 │ 57.04
ANet-Caption (val_2, MR)UniMD (Random co-training)R5@5079.72split: val-2 · co-training=random · TAD-MR data ratio=0.25-0.25 · MR training-video subset=25%
Source quote
L289: 0.25-0.25 │ 36.78 │ 56.96 │ 79.72 │ 54.43
BibTeX
@inproceedings{zeng2024unimd,
  author = {Yingsen Zeng and Yujie Zhong and Chengjian Feng and Lin Ma},
  title = {{UniMD: Towards Unifying Moment Retrieval and Temporal Action Detection}},
  booktitle = {European Conference on Computer Vision},
  year = {2024},
  doi = {10.1007/978-3-031-72952-2\_17},
}
Figure