Abstract
Data scientists often struggle to write programs that process object trajectories in video data due to the "fuzzy" nature of real-world observations and the need for hand-tuned parameters. We present Quivr, a framework that synthesizes trajectory queries from a small set of user-provided examples. By leveraging a novel quantitative semantics to prune the parameter search space, Quivr achieves high accuracy and significant speedups over existing methods.
Introduction: The Challenge of Trajectory Querying
Analyzing object trajectories—such as identifying specific vehicle maneuvers at an intersection—requires complex queries. These queries often involve real-valued parameters (e.g., distance thresholds or time durations) that are difficult to tune manually. Traditional program synthesis approaches struggle with the continuous nature of these parameters and the vast search space of possible program structures.
The Quivr Methodology
Quivr treats query creation as a program synthesis problem, searching through a language based on regular expressions. Users can compose predicates like InLane or DistanceLt using sequencing, conjunction, and iteration.
The core innovation of Quivr is quantitative semantics. Unlike binary logic (True/False), quantitative semantics calculates a score representing how much a parameter must change to alter the query result. This allows for boundary pruning, where Quivr directly computes parameter limits to discard inconsistent regions of the search space, rather than relying on slower binary search methods. Furthermore, Quivr utilizes active learning to resolve ambiguities by asking users to label the most informative trajectories.
Evaluation and Results
Quivr was evaluated on 17 tasks across three datasets: YTStreams (traffic), MABe22 (mouse social behavior), and a synthetic Maritime Surveillance benchmark.
Key findings include:
- Accuracy: Quivr achieved F1 scores above 0.90 on nearly all tasks within 25 active learning steps.
- Efficiency: The quantitative pruning strategy provided a 5.0x speedup over previous state-of-the-art techniques.
- Scalability: By reformulating query semantics into matrix operations, Quivr achieved a 7.6x speedup on GPUs compared to CPUs.
- Performance: Quivr significantly outperformed deep learning baselines (LSTMs and Transformers), which failed to generalize from the limited number of examples.
Conclusion
Quivr demonstrates that combining program synthesis with quantitative semantics and active learning is a powerful approach for querying complex trajectory data. While currently limited by search depth and fixed camera perspectives, it represents a significant step toward automating the analysis of fuzzy, real-world spatial data.
Summary updated