arXiv:2609.02540cs.LGSep 2026

Manuscript Offprint

arXiv:2609.02540

TrajMind: Chaining Role-Specialized LoRAs for Fast-and-Slow Collective Trajectory Anomaly Diagnosis

Jiahao Wu, Zhenqun Yang, Chen Jason Zhang, Qing Li

Jiahao Wu

jiahao.wu@connect.polyu.hk

The Hong Kong Polytechnic University

Hong Kong, China

Chen Jason Zhang

jason-c.zhang@polyu.edu.hk

The Hong Kong Polytechnic University

Hong Kong, China

Zhen-qun Yang

look.jessica@gmail.com

The Hong Kong Polytechnic University

Hong Kong, China

Qing Li

csqli@comp.polyu.edu.hk

The Hong Kong Polytechnic University

Hong Kong, China

Abstract

Diagnosing collective anomalies from urban trajectories is increasingly important for traffic governance, as it reveals what happened, who was involved, and where and when the event occurred. Existing detectors efficiently produce scores or labels, whereas vision-language pipelines provide richer semantics; neither couples verifiable diagnosis with low-latency monitoring. The central challenge is to recognize collective patterns and recover exact event details from the source trajectories without running the full diagnostic pipeline for every monitored window. We therefore separate always-on screening from on-demand diagnosis: screening raises alerts, while diagnosis releases only source-verified what-who-where-when records. We present TrajMind, a fast-and-slow framework that switches three role-specialized LoRA adapters over one frozen vision-language backbone. Its slow path, TrajMindslow_{slow}, chains canvas-based typing, type-conditioned localization over serialized trajectories, and executable verification, yielding structured, evidence-backed diagnoses. Additionally, the fast path, TrajMindfast_{fast}, screens each window in a single text-only pass, delivering efficient structured alerts. Extensive experiments show that, TrajMindslow_{slow} outperforms the strongest baselines by at least 15.3 percentage points in anomaly typing and 13.8 percentage points in localization. These gains persist under cross-city transfer, and TrajMindfast_{fast} reduces latency by 41.1% and maintains binary balanced accuracy of at least 93.5%. Together, TrajMind delivers accurate, evidence-backed diagnoses across cities and efficient front-line monitoring.

1 Introduction

Collective trajectory anomaly detection and diagnosis are becoming indispensable to modern urban traffic governance. Developing effective anomaly detection and diagnosis methods is crucial for ensuring traffic safety, enhancing the overall efficiency of urban transportation systems and has become an increasingly important research topic [3, 9, 33]. However, turning the trajectories into operational evidence requires more than assigning an anomaly score to an isolated trip, which is far from what existing methods can accomplish [9, 18, 27, 33]. Given a window of map-matched trajectories, a collective anomaly system must reason over agent interactions to detect abnormal collective behavior and identify its type, participants, affected road segments, and duration. Operational systems must do so accurately while keeping pace with continuously arriving windows. Building a practical model capable

of accurate diagnosis and efficient monitoring remains a fundamental challenge.

Classical trajectory anomaly detectors define normality through route similarity, density, or isolation [15, 33]. Although efficient, these detectors rely on route frequency, distance, or reference statistics that vary across locations and traffic conditions, and therefore generalize poorly without per-site recalibration. They also focus primarily on isolated trajectories rather than events produced by interactions among co-present road users. Deep sequence models capture time-dependent route distributions [9, 18], while graph-based approaches model social dependencies among nearby vehicles [3]. These richer representations improve the ability to recognize complex motion patterns, but they remain optimized mainly for producing an anomaly score or label. Therefore, these methods fails to identify the involved event participants, and ground the event in space and time with evidence.

Recently, vision-language models (VLMs) have introduced semantic reasoning into trajectory anomaly analysis [16, 32, 34]. For instance, Traj-MLLM renders an individual trajectory and its map context as interleaved multiview image-text inputs for training-free multimodal reasoning [16]. However, this paradigm remains limited for operational group anomaly diagnosis. By reasoning largely over one trajectory at a time, it may miss anomalies that emerge only from the timing and co-occurrence of multiple agents, and it does not explicitly identify the anomaly type, involved agents, affected road segments, and time span. Moreover, multiview rendering and repeated invocation of a large multimodal backbone introduce substantial latency, making always-on monitoring costly [21]. Thus, although VLMs enable richer semantic reasoning, existing VLM pipelines are neither sufficiently group-aware nor efficient for continuous trajectory anomaly diagnosis.

To address these challenges, we propose TrajMind, a VLM framework with specialized roles for collective trajectory anomaly detection and diagnosis. Our key insight is that the task decomposes into three heterogeneous capabilities: scene-level understanding to determine what happened, precise grounding to recover who, where, and when, and efficient monitoring to decide whether an incoming window warrants attention. Supporting all three capabilities simultaneously entails conflicting representational requirements:

  • Scene-level understanding benefits from a holistic yet lossy visual rendering of the window, which captures the overall traffic pattern and context.

  • Precise grounding requires lossless textual access to agent identities, coordinates, and timestamps, enabling accurate identification of involved participants and their spatiotemporal details.

  • Efficient monitoring must forgo visual processing to sustain throughput, requiring to quickly screen incoming windows.

These conflicting requirements motivate role specialization rather than a single shared objective. TrajMind therefore assigns each capability to a lightweight role-specific LoRA adapter over a common frozen VLM backbone [10].

TrajMind composes these adapters into two operating modes. For in-depth diagnosis, TrajMind_{slow} chains scene typing on a map-aligned canvas with grounding over lossless textual records to produce a complete, evidence-checked diagnosis. For monitoring, TrajMind_{fast} invokes only the monitoring adapter, dropping visual processing and staged reasoning altogether and screening each window in a single text-only pass. Unlike generic multi-LoRA or adapter-composition schemes that route among interchangeable skills over a common input, TrajMind's specialists deliberately consume different views of the same window. This division provides detailed, evidence-backed reasoning for in-depth investigation and an efficient screening path for always-on monitoring. Our contributions are threefold:

  • Diagnosis formulation and evaluation protocol. We define structured what-who-where-when diagnoses. Our evaluation protocol distinguishes alerts from evidence-backed diagnoses. We evaluate this formulation on held-out trajectories from Chengdu, Xi'an, and Porto. Controlled collective anomalies provide type, participant, segment, and temporal ground truth.

  • Framework. We propose TrajMind, which specializes a shared frozen VLM using role-specific LoRA adapters. The slow path supports anomaly typing and exact localization, while the fast path provides efficient monitoring. An executable verifier checks each diagnosis against the source trajectories.

  • Results. Across the three cities, TrajMind_{slow} improves three-way balanced accuracy by 15.3–29.0% over the strongest non-TrajMind baseline. Under type-conditioned localization, it improves participant F1 by 13.8–23.2%. Results on Xi'an and Porto are zero-shot. TrajMind_{fast} reduces latency from 9.026 to 5.315 seconds per window (41.1%) while retaining binary balanced accuracy of .960/.949/.935. The slow path remains stronger in fine-grained typing and participant localization.