Introduction
Detecting anomalies in long-term trajectories—such as a taxi taking an unusual route or a cargo ship deviating from its path—is a critical task for urban planning and maritime safety. However, traditional methods struggle with two main challenges: the diversity of "normal" behavior (multimodality) and maintaining spatiotemporal consistency over long durations. Most existing models focus on either fine-grained coordinates or high-level destinations, but rarely integrate both.
The Intention-aware Hierarchical Diffusion model (IHiD) addresses these gaps by decomposing long-term trajectories into a sequence of subgoals and analyzing both the high-level intent and low-level execution.
Problem Definition: Types of Anomalies
Long-term trajectories can exhibit different types of deviations. A "detour" occurs when an agent takes an inefficient path between two points, while a "route-switching" anomaly occurs when an agent logically switches from one valid route to another. These route-switching events are particularly difficult to detect because they might appear normal at a local coordinate level but are logically inconsistent with the overall journey's intent.
Methodology: The IHiD Framework
IHiD utilizes a two-stage hierarchical approach to evaluate trajectories:
1. High-Level Intent Evaluation (The "Why")
Using Inverse Q-Learning (IQL), the model learns the typical decision-making preferences of agents from normal data. It models the probability of selecting a specific next subgoal $a$ given the current subgoal $s$, denoted as $q(a|s)$. If the predicted Q-value for a chosen subgoal falls below a threshold, the model flags a "strategic" anomaly, such as route-switching.
2. Low-Level Subtrajectory Generation (The "How")
For the path between subgoals, IHiD employs a Diffusion Model (specifically a Transformer-based UNet). This generative model is conditioned on subgoal information and learns to reconstruct normal subtrajectories. Anomalies are detected when the reconstruction error $E_\Delta$ between the actual path and the generated "normal" path exceeds a threshold $\beta$.
Experimental Evaluation
The model was evaluated on two real-world datasets: the Chengdu Dataset (taxi trajectories in a constrained road network) and the AIS Dataset (maritime vessel traffic in the unconstrained Bass Strait).
Key Results
IHiD demonstrated significant improvements over state-of-the-art baselines like OCSVM and DeCoRTAD:
- Overall Improvement: An average F1 score increase of 18% across all test scenarios.
- Route-Switching Detection: A notable 30.2% jump in F1 score for route-switching anomalies in the Chengdu dataset, highlighting the effectiveness of the IQL module.
- Ablation Insights: Results confirmed that the IQL module is vital for catching strategic anomalies, while the Diffusion module excels at identifying physical detours.
Conclusion
The IHiD framework represents a significant step forward in long-term trajectory analysis by explicitly modeling agent intent. By combining the logical reasoning of Inverse Q-Learning with the generative power of Diffusion Models, it effectively captures the multimodality of normal travel. Future work will focus on integrating physical constraints and road network topology directly into the diffusion process to further refine detection accuracy.
Summary updated