CMAD: a cooperative multi-agent framework leveraging transformer-contextual q-networks for unsupervised traffic anomaly detection
Abstract
Traffic anomaly detection (TAD) is a critical task in Intelligent Transportation Systems (ITS), as it aims to identify potential traffic disturbances or irregular events in real time. However, traditional TAD methods struggle with the lack of labelled data, complex periodic structures, and the inherent variability of real-world traffic dynamics. To address these issues, we propose the Cooperative Multi-Agent Detection (CMAD) framework, a novel unsupervised approach based on multi-agent reinforcement learning. CMAD formulates the anomaly detection task as a cooperative Markov decision process. In this framework, multiple agents, each responsible for a distinct loop detector modality, are coordinated through a shared reward signal. Each agent is equipped with a Transformer-Contextual Q-Network (TCQ-Net), which integrates real-time observations with long-range periodic patterns via cross-attention, enabling refined temporal reasoning. A hybrid reward function is designed by combining structural features based on kernel density with dynamic residual feedback, allowing the model to learn fully unsupervised. When evaluated on an open-access benchmark dataset with supervised labels (used only for evaluation), CMAD achieves state-of-the-art performance with 98.2% precision, 95.4% recall and 96.8% F1-score. Additional experiments on a real-world unlabelled dataset further confirm its robustness under complex traffic conditions, highlighting its potential for deployment in ITS.
Fields of Study & Subjects
Network Security and Intrusion Detection
Internet Traffic Analysis and Secure E-voting
Software System Performance and Reliability
Publication details
- Journal / source
- Transportmetrica A Transport Science
- Publisher
- Informa UK Limited
- Pages
- 1–28
- Publication date
- 3 April 2026
- Language
- EN