Trajectory anomaly detection underpins applications from fraud detection to urban mobility analysis. Dense GPS methods preserve fine-grained evidence such as abnormal speeds and short-duration events, but their quadratic cost makes multi-month analysis intractable; consequently, no existing approach detects anomalies over multi-month dense GPS trajectories. The field instead relies on scalable sparse stay-point methods that discard this evidence, forcing separate architectures for each regime and preventing knowledge transfer. We argue this bottleneck is unnecessary: human trajectories, dense or sparse, share a natural two-dimensional cyclic structure along within-day and across-day axes. We therefore propose TITAnD (Trajectory Image Transformer for Anomaly Detection), which reformulates trajectory anomaly detection as a vision problem by representing trajectories as a Hyperspectral Trajectory Image (HTI): a day x time-of-day grid whose channels encode spatial, semantic, temporal, and kinematic information from either modality, unifying both under a single representation. Under this formulation, agent-level detection reduces to image classification and temporal localization to semantic segmentation. To model this representation, we introduce the Cyclic Factorized Transformer (CFT), which factorizes attention along the two temporal axes, encoding the cyclic inductive bias of human routines, while reducing attention cost by orders of magnitude and enabling dense multi-month anomaly detection for the first time. Empirically, TITAnD achieves the best AUC-PR across sparse and dense benchmarks, surpassing vision models like UNet while being 11-75x faster than the Transformer with comparable memory, demonstrating that vision reformulation and structure-aware modeling are jointly essential. Code will be made public soon.
翻译:轨迹异常检测支撑着从欺诈检测到城市移动分析的应用场景。密集GPS方法能够保留异常速度与短时事件等细粒度证据,但其二次方复杂度使得多月分析难以实现;因此,现有方法均无法针对多月的密集GPS轨迹进行异常检测。该领域转而依赖可扩展的稀疏停留点方法,但这类方法丢弃了上述细粒度证据,迫使针对不同数据形态采用独立架构,阻碍了知识迁移。我们认为这一瓶颈并非必要:人类轨迹无论密集与否,均具有沿日内与日间两个时间轴的自然二维循环结构。为此,我们提出TITAnD(轨迹图像Transformer异常检测方法),将轨迹异常检测重新定义为视觉问题:将轨迹表示为高光谱轨迹图像(HTI),即以天为行、日内时间为列的网格,其多个通道编码来自密集或稀疏模态的空间、语义、时间与运动学信息,从而在单一表示下统一两种模态。在此框架下,个体层面的异常检测简化为图像分类,时间定位简化为语义分割。为建模该表示,我们引入循环因子化Transformer(CFT),沿两个时间轴对注意力进行因子化分解,编码人类日常行为的循环归纳偏置,同时将注意力计算代价降低数个数量级,首次实现密集多月份的异常检测。实验表明,TITAnD在稀疏与密集基准数据集上均达到最优AUC-PR指标,超越UNet等视觉模型,同时在可比内存消耗下比标准Transformer快11–75倍,证明视觉重新表述与结构感知建模的联合必要性。代码即将开源。