Synthesizing Trajectory Queries from Examples
Stephen Mell, Favyen Bastani, Steve Zdancewic, Osbert Bastani
TL;DR
Quivr addresses the challenge of synthesizing trajectory queries with real-valued parameters from few examples by introducing a parameter-pruning framework based on a novel quantitative semantics. It defines a DSL for trajectory predicates with subsequence matching and enables multi-object queries via sequencing and iteration, while maintaining soundness and partial completeness. The approach yields substantial synthesis-time speedups, especially with GPU-accelerated evaluation, and achieves high accuracy on traffic, animal, and maritime trajectory tasks with minimal labeling. This work enables efficient, programmable querying of trajectory data with practical impact on autonomous driving, behavioral analysis, and surveillance.
Abstract
Data scientists often need to write programs to process predictions of machine learning models, such as object detections and trajectories in video data. However, writing such queries can be challenging due to the fuzzy nature of real-world data; in particular, they often include real-valued parameters that must be tuned by hand. We propose a novel framework called Quivr that synthesizes trajectory queries matching a given set of examples. To efficiently synthesize parameters, we introduce a novel technique for pruning the parameter space and a novel quantitative semantics that makes this more efficient. We evaluate Quivr on a benchmark of 17 tasks, including several from prior work, and show both that it can synthesize accurate queries for each task and that our optimizations substantially reduce synthesis time.
