Reinforcement Learning for Weakly Supervised Temporal Grounding of Natural Language in Untrimmed Videos

Jie Wu, Guanbin Li, Xiaoguang Han, Liang Lin

TL;DR

The Boundary Adaptive Refinement (BAR) framework is the first approach to bring reinforcement learning (RL) to the task of weakly supervised temporal video grounding. By replacing rigid, computationally expensive sliding windows with an RL agent that iteratively adjusts a segment's boundaries, BAR achieves state-of-the-art performance using only video-level text descriptions—even outperforming some fully supervised models.

What Problem Does This Paper Address?

Temporal language grounding is the task of localizing a specific event within a long, untrimmed video based on a text query (e.g., finding the exact seconds where a "person goes back to close the door"). While fully supervised models excel at this, they rely on precise, frame-level timestamps for training, which are incredibly tedious and expensive to collect manually.

Weakly supervised learning offers a more scalable alternative by training models on coarse, video-level descriptions without explicit timestamps. However, existing weakly supervised methods typically rely on a rigid "proposal-and-rank" pipeline. They generate thousands of predefined sliding windows and rank them. This approach is not only computationally heavy but also struggles with videos of varying lengths and fails to capture fine-grained context within the video itself.

Figure 1: The diagrams of sliding window based proposal-and-rank pattern and the novel boundary adaptive refinement pro- cess. The input query in this example is “person goes back to close the door.” Traditional pattern is constrained by fixed sliding window templates and has to process extensive candidate segments one by one to localize queries. However, the boundary adaptive refinement manages to flexibly adjust the boundary via a series of actions.

Methods

The authors introduce Boundary Adaptive Refinement (BAR), framing temporal grounding as a sequential decision-making process solved via reinforcement learning (specifically, the Advantage Actor-Critic, or A2C, algorithm). Instead of evaluating a massive pool of static window proposals, an RL agent starts with a generic initial boundary and dynamically resizes and shifts it over a series of time steps.

As shown in the architecture diagram below, the framework consists of three core components:

  1. Context-aware Feature Extractor: Rather than evaluating a video segment in isolation, this module encodes the state by looking at the current segment, its immediate left/right surroundings, and the global video context.
  2. Adaptive Action Planner: This RL agent determines the direction (shift start/end forward/backward) and the amplitude (step size) of the boundary adjustment. It dynamically takes larger steps when it is far from the target and smaller steps for fine-tuning when it is close.
  3. Cross-modal Alignment Evaluator: Because there are no ground-truth boundaries to calculate traditional RL rewards, the authors designed a self-supervised evaluator. It maps video segments and text queries into a joint embedding space to calculate an alignment score. If an agent's action increases this score, it receives a positive reward; otherwise, it receives a negative reward.

To train the evaluator without boundary annotations, the authors combine an inter-video ranking loss (ensuring a query matches its own video better than other videos) with a novel intra-video ranking loss (ensuring the query matches the target segment better than the surrounding segments within the same video).

Figure 2: The overall architecture of the Boundary Adaptive Refinement (BAR) framework, which consists of a context-aware feature extractor, an adaptive action planner and a cross-modal alignment evaluator.

Datasets

The framework was evaluated on two standard video grounding benchmarks:

  • Charades-STA: Contains 12,408 training and 3,720 testing video-sentence pairs. The videos average 29.8 seconds, and the described clips are around 8 seconds long.
  • ActivityNet: A larger, more challenging dataset containing 37,421 training and 17,505 testing pairs. The videos are significantly longer and more diverse, averaging 2 minutes in duration.

Key Insights and Ideas

  • Self-Supervised Rewards for RL: The biggest hurdle to using RL in a weakly supervised setting is the absence of a ground-truth reward function (like Intersection-over-Union). BAR elegantly bypasses this by using relative changes in a learned cross-modal alignment score as a proxy reward.
  • Human-like Coarse-to-Fine Search: Fixed-step boundary shifting is inefficient. By tying the action amplitude to the alignment score, the agent mimics human visual search behavior—making large leaps when context clues are weak and micro-adjustments when fine-tuning the boundaries.
  • The Power of Intra-Video Contrast: Most weak supervision methods only contrast positive video-query pairs against completely different videos. BAR's intra-video ranking loss forces the model to understand the internal timeline of a single video, drastically improving boundary precision.

Key Results

  • New Weakly Supervised State-of-the-Art: On Charades-STA (using TSN features), BAR achieved a 33.98% success rate at [email protected], a massive leap over the previous best method, SCN (23.58%). On ActivityNet, it reached 33.12% at [email protected].
  • Beating Fully Supervised Models: Remarkably, BAR outperformed several competitive fully supervised models (such as QSPN and SAP) on both datasets, despite having zero access to frame-level annotations during training.
  • Drastic Efficiency Gains: Because BAR progressively refines a single boundary rather than ranking dozens of overlapping windows, it cut down inference time on Charades-STA from 0.104 seconds to 0.068 seconds per video, reducing the candidate proposal count to just 1.

Limitations and Future Work

  • Heuristic Length Penalty: During inference, the model utilizes a manually tuned Gaussian penalty function to prevent the agent from outputting abnormally long or short video segments. Replacing this with a data-driven, learned length prior remains future work.
  • Absence of an Explicit Stop Action: The action space does not include a termination command because segment-query matching under weak supervision isn't stable enough to reliably trigger a stop. Instead, the agent runs for a fixed maximum number of steps ($T_{max}=12$) and selects the historical step with the highest confidence score.

Summary updated

BibTeX
@inproceedings{wu2020reinforcement,
  author = {Jie Wu and Guanbin Li and Xiaoguang Han and Liang Lin},
  title = {{Reinforcement Learning for Weakly Supervised Temporal Grounding of Natural Language in Untrimmed Videos}},
  booktitle = {ACM Multimedia},
  year = {2020},
  doi = {10.1145/3394171.3413862},
}
Figure