Logic-in-Frames: Dynamic Keyframe Search via Visual Semantic-Logical Verification for Long Video Understanding

Weiyu Guo, Ziyang Chen, Shaoguang Wang, JianXiang He, Yijie Xu, Jinhui Ye, Ying Sun, Hui Xiong · OpenReview

TL;DR

This paper introduces Logic-in-Frames (VSLS), a novel framework for efficiently selecting keyframes in long videos by leveraging semantic and logical relationships within user queries. VSLS significantly improves video understanding tasks like question answering by intelligently focusing on critical frames, achieving state-of-the-art results while processing a mere 1.4% of video frames.

What Problem Does This Paper Address?

Understanding long videos is a major challenge for current Vision-Language Models (VLMs). These models struggle with the sheer volume of data, often resorting to coarse frame subsampling or dense processing, which can miss crucial information or be computationally prohibitive. A key issue is that existing methods often overlook the logical connections between what a user is asking for (the query) and the visual content in the video. This gap makes it hard to pinpoint the most relevant frames for tasks like video question answering, akin to finding a needle in a haystack.

Methods

The core of VSLS is its Visual Semantic-Logical Search (VSLS) framework. Instead of uniform sampling, VSLS dynamically refines its frame selection process based on four fundamental logical dependencies extracted from the query:

  1. Spatial Co-occurrence: Objects appearing together in the same frame.
  2. Temporal Proximity: Events or objects occurring close in time.
  3. Attribute Dependency: Objects sharing specific visual properties (e.g., color, size).
  4. Causal Order: One event or object leading to another.

The process involves:

  • Query Parsing: Using LLMs (like GPT-40) to break down the query into key objects, cue objects, and these four types of logical relationships.
  • Adaptive Sampling: Iteratively sampling frames based on an evolving probability distribution, focusing on areas likely to contain relevant information.
  • Multi-modal Object Detection: Using models like YOLO-WORLD to detect objects in sampled frames.
  • Visual Semantic Logic Detection: Scoring frames based on the presence and confidence of detected objects and their logical relationships as defined by the query.
  • Score Propagation & Distribution Update: Spreading confidence scores to neighboring frames to capture temporal context and updating the sampling distribution for the next iteration.

This iterative process allows VSLS to intelligently narrow down the search space and identify semantically critical frames with high precision.

Datasets

The paper evaluates VSLS on several established benchmarks:

  • VIDEO-MME: A comprehensive benchmark for multimodal video evaluation, emphasizing diversity, temporal complexity, and multi-modal integration.
  • LONGVIDEOBENCH: Focuses on long-context interleaved video-language understanding, with detailed retrieval and temporal reasoning over hour-long inputs.
  • LV-HAYSTACK: Designed for temporal search in long-form videos, evaluating keyframe selection accuracy with human-annotated ground truth.
  • EGO4D: A large-scale egocentric video dataset for first-person visual perception research.

The authors also mention HAYSTACK-LVBENCH and HAYSTACK-EGO4D, which are extensions of LONGVIDEOBENCH and EGO4D, respectively, featuring human-annotated keyframes for more precise evaluation.

Key Insights and Ideas

  • Logic is Key: The most significant insight is that explicitly modeling the logical relationships described in a query, not just individual objects, is crucial for effective keyframe selection in long videos. This moves beyond simple object detection to understanding the narrative or context of the query.
  • Efficiency Through Intelligence: By using semantic-logical cues to guide frame sampling, VSLS achieves remarkable efficiency. Processing only 1.4% of frames while maintaining or improving performance is a major leap.
  • Bridging the Gap: VSLS effectively bridges the gap between the logical reasoning capabilities of LLMs and the visual content of videos, enabling more accurate and context-aware video understanding.
  • Generalizability: The four defined logical relations (spatial, temporal, attribute, causal) appear to be comprehensive enough to capture the intent of a wide range of video queries, as demonstrated by their successful application across different datasets.

Key Results

  • State-of-the-Art Performance: VSLS achieves new state-of-the-art results on keyframe selection metrics on the LV-HAYSTACK benchmark.
  • Downstream Task Improvement: When applied to video question answering (VQA) on LONGVIDEOBENCH and VIDEO-MME, VSLS leads to significant accuracy gains. For instance, it improves GPT-40's long video QA accuracy by 8.7% while sampling only 1.4% of frames.
  • Efficiency: VSLS significantly reduces computational complexity compared to dense sampling methods, offering a much better performance-efficiency trade-off.
  • Temporal Precision: A case study demonstrates VSLS's ability to precisely pinpoint critical moments in time, even distinguishing between visually similar events, which baselines often fail to do.

Limitations and Future Work

  • Computational Complexity: While significantly more efficient than dense methods, the computational complexity for extremely long videos (around 7.8 seconds of search overhead) might still be a consideration for real-time applications.
  • Detector Dependency: The performance of VSLS is inherently tied to the accuracy of the underlying object detection model (YOLO-WORLD). Challenging visual conditions like poor lighting or occlusion could degrade detection accuracy and, consequently, temporal coverage.
  • Future Work: The authors suggest exploring more logical relations, developing learnable search methods, enhancing interpretability, and extending VSLS to more downstream tasks. They also note that their modular design allows for easy substitution of object detectors with improved versions.

Summary updated

BibTeX
@inproceedings{guo2025logic,
  author = {Weiyu Guo and Ziyang Chen and Shaoguang Wang and JianXiang He and Yijie Xu and Jinhui Ye and Ying Sun and Hui Xiong},
  title = {{Logic-in-Frames: Dynamic Keyframe Search via Visual Semantic-Logical Verification for Long Video Understanding}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=yONFNHGoeP},
}
Figure