CausalTAD: Causal Implicit Generative Model for Debiased Online Trajectory Anomaly Detection

Wenbin Li, Di Yao, Chang Gong, Xiaokai Chu, Quanliang Jing, Xiaolei Zhou, Yuxuan Zhang, Yunxia Fan, Jingping Bi

Introduction

Trajectory Anomaly Detection (TAD) is a critical component for modern ride-hailing and logistics platforms. By monitoring vehicle movements in real-time, these systems can identify suspicious behaviors, such as unauthorized detours or safety-related deviations. While deep learning models have significantly advanced the field, they often struggle with generalization. Specifically, these models frequently exhibit "road preference bias," where they over-rely on popular routes seen during training, leading to high false-positive rates when drivers navigate new or rare source-destination (SD) pairs.

This paper introduces CausalTAD, a framework designed to eliminate this confounding bias using causal inference. By shifting from standard conditional probability to a causal intervention framework, CausalTAD achieves superior performance in both standard and out-of-distribution (OOD) scenarios.

The Confounding Bias Problem

Traditional learning-based TAD models attempt to calculate the probability of a trajectory $T$ given a context $C$ (the SD pair), expressed as $P(T|C)$. However, this approach is susceptible to a hidden confounder: road preference ($E$).

In any urban environment, certain roads are naturally more popular due to speed limits, infrastructure quality, or proximity to points of interest. Standard models learn these preferences as inherent rules. Consequently, when a model encounters a new SD pair it hasn't seen during training, it may incorrectly flag a perfectly valid route as an anomaly simply because the driver did not utilize the "popular" roads the model expects. This creates a significant gap in OOD generalization, where the model fails to distinguish between a legitimate route choice and a genuine anomaly.

Methodology: Causal Intervention via $do$-calculus

To address this, CausalTAD utilizes $do$-calculus to simulate an intervention that breaks the link between road network popularity and the specific trip context. The goal is to estimate the causal probability $P(T|do(C))$ rather than the simple conditional probability $P(T|C)$.

Architecture

The framework employs a dual Variational Autoencoder (VAE) architecture:

  1. TG-VAE (Trajectory Generation VAE): This module focuses on learning the underlying patterns of trajectories. It incorporates "road-constrained prediction," ensuring the model only considers logically adjacent road segments. This prevents the model from being dominated by globally popular roads that are geographically irrelevant to the current trip.
  2. RP-VAE (Road Preference VAE): This module is dedicated to estimating the "scaling factor" required to debias the model. It factorizes the bias down to the level of individual road segments, allowing the system to adjust its expectations based on the inherent popularity of specific infrastructure.

Online Detection Efficiency

For real-world deployment, efficiency is paramount. CausalTAD is designed for online detection, where anomaly scores must be updated as the vehicle moves. Because the scaling factors derived from the RP-VAE can be precomputed for the entire road network, the system can update an anomaly score in $O(1)$ time whenever a vehicle enters a new road segment. This ensures the model can scale to monitor thousands of concurrent trips without significant computational overhead.

Experimental Evaluation

The researchers evaluated CausalTAD using two large-scale datasets provided by DiDi Global Inc.:

  • Xi’an Dataset: Approximately 10,000 trajectories.
  • Chengdu Dataset: Approximately 20,000 trajectories.

Given the scarcity of verified real-world anomaly labels, the team generated synthetic anomalies to test the model's robustness:

  • Detours: Plausible but incorrect sub-paths generated via Dijkstra’s algorithm.
  • Switches: Replacing segments of a trajectory with different routes that share the same SD pair but have low similarity to the original path.

Key Results

CausalTAD was benchmarked against several state-of-the-art baselines, including VSAE, GM-VSAE, and DeepTEA. The results demonstrated clear advantages:

  • In-Distribution (ID) Performance: On SD pairs present in the training data, CausalTAD improved ROC-AUC by 2.1% to 5.7%.
  • Out-of-Distribution (OOD) Performance: On entirely new SD pairs, the improvement was even more pronounced, ranging from 10.6% to 32.7%. This confirms that the causal intervention effectively mitigates the bias that plagues traditional models.
  • Operational Viability: The model maintains a runtime efficiency comparable to non-causal generative models, making it suitable for production environments.

Discussion and Future Work

The primary innovation of CausalTAD is the identification of road preference as a hidden confounder and the application of weighting to compensate for it. By assigning higher weights to popular roads and lower weights to rare ones, the model avoids overestimating the "strangeness" of uncommon but valid paths.

One current limitation is that the model treats road preference as a static variable. In reality, road preferences are dynamic, influenced by time of day, weather, and traffic congestion. Future research will focus on factorizing the scaling factor by time periods to account for these temporal dynamics, further refining the accuracy of real-time anomaly detection.

Summary updated

BibTeX
@inproceedings{li2024causaltad,
  author = {Wenbin Li and Di Yao and Chang Gong and Xiaokai Chu and Quanliang Jing and Xiaolei Zhou and Yuxuan Zhang and Yunxia Fan and Jingping Bi},
  title = {{CausalTAD: Causal Implicit Generative Model for Debiased Online Trajectory Anomaly Detection}},
  booktitle = {ICDE},
  year = {2024},
  url = {https://openreview.net/forum?id=JILLFg6Quj},
}
Figure