Unsupervised Behavior Anomaly Detection Model Based on Contrastive Learning
In the context of the rapid popularization of intelligent monitoring and edge perception, automatic identification of abnormal behaviors in complex scenarios has become a key issue in video understanding. This paper proposes an unsupervised behavior anomaly detection model based on contrastive learning. Through hierarchical organization of normal samples, joint spatio-temporal encoding, time attention aggregation, and “instance contrast – prototype traction – time smoothing” joint optimization, stable behavior embedding representations are learned. In the detection stage, a comprehensive anomaly score is constructed by integrating the recent prototype deviation, second-order temporal residual, and local neighborhood support information, and an adaptive threshold based on the median and absolute median difference is adopted for judgment. Experimental results show that the model achieves an AUC of 97.4% on UCSD Ped2, 91.8% on CUHK Avenue, and 83.7% on ShanghaiTech. The average AUC and average F1 are 91.0% and 88.1% respectively. The study demonstrates that this method can enhance the stability and generalization ability of anomaly detection in complex video scenarios, providing a reference technical path for video intelligent early warning in the absence of labels.