AI-Based Crowd Violence Detection Using Vision Transformer and Temporal Transformer
Abstract
This work describes a crowd-violence classification pipeline that analyses short video sequences rather than making a decision from a single image. Eight frames are sampled from each clip and encoded with the pretrained google/vit-base-patch16-224-in21k Vision Transformer. The resulting 768-dimensional descriptors are reduced to 256 dimensions and processed by a two-layer Temporal Transformer to predict Fight or Non-Fight. The experiments use the RWF-2000 dataset and the recorded project split, which contains 1,594 training videos and 400 validation videos. The model obtained 92.75% accuracy on that validation set. A webcam prototype was also implemented to display predictions and demonstrate sound alerts, email notifications, and timestamped JPEG capture. The reported score is specific to this validation split; evaluation on an independent test set and additional surveillance conditions remains necessary. Index Terms—crowd violence detection, Vision Transformer, Temporal Transformer, RWF-2000, video classification, deep learning, surveillance.