[Paper Review] TYolov5: A Temporal Yolov5 Detector Based on Quasi-Recurrent Neural Networks for Real-Time Handgun Detection in Video
This paper proposes TYolov5, a real-time temporal handgun detection system that enhances YOLOv5 with Quasi-Recurrent Neural Networks (QRNNs) to exploit spatio-temporal features in video. By integrating QRNNs into multi-scale feature maps and applying temporal data augmentation (Mosaic and Mixup), TYolov5 achieves faster inference and improved mAP 50:95 (up to 60.2) compared to YOLOv5 and ConvLSTM-based models, while maintaining real-time performance across small, medium, and large architectures.
Timely handgun detection is a crucial problem to improve public safety; nevertheless, the effectiveness of many surveillance systems still depends of finite human attention. Much of the previous research on handgun detection is based on static image detectors, leaving aside valuable temporal information that could be used to improve object detection in videos. To improve the performance of surveillance systems, a real-time temporal handgun detection system should be built. Using Temporal Yolov5, an architecture based on Quasi-Recurrent Neural Networks, temporal information is extracted from video to improve the results of handgun detection. Moreover, two publicly available datasets are proposed, labeled with hands, guns, and phones. One containing 2199 static images to train static detectors, and another with 5960 frames of videos to train temporal modules. Additionally, we explore two temporal data augmentation techniques based on Mosaic and Mixup. The resulting systems are three temporal architectures: one focused in reducing inference with a mAP$_{50:95}$ of 55.9, another in having a good balance between inference and accuracy with a mAP$_{50:95}$ of 59, and a last one specialized in accuracy with a mAP$_{50:95}$ of 60.2. Temporal Yolov5 achieves real-time detection in the small and medium architectures. Moreover, it takes advantage of temporal features contained in videos to perform better than Yolov5 in our temporal dataset, making TYolov5 suitable for real-world applications. The source code is publicly available at https://github.com/MarioDuran/TYolov5.
Motivation & Objective
- To address the limitation of static image-based handgun detectors that ignore temporal context in video surveillance.
- To develop a real-time temporal object detection system that leverages sequential video information for improved accuracy.
- To evaluate the effectiveness of Quasi-Recurrent Neural Networks (QRNNs) in temporal object detection compared to ConvLSTMs.
- To introduce two publicly available datasets—HGP (2199 static images) and THGP (5960 video frames)—labeled with hands, guns, and phones.
- To explore and validate temporal data augmentation techniques (temporal Mosaic and Mixup) for enhancing spatio-temporal model performance.
Proposed method
- Integrates QRNN modules into YOLOv5's multi-scale feature maps to extract and propagate temporal features across frames.
- Uses a quasi-recurrent pooling mechanism with convolutional layers to enable parallel processing and faster training/inference compared to standard RNNs.
- Applies temporal data augmentation by extending Mosaic and Mixup techniques to video sequences, improving generalization without increasing model complexity.
- Trains and evaluates three architectures (small, medium, large) using mixed datasets HGP and THGP over 200 epochs with mixed-precision and full-precision inference.
- Compares QRNN-based models against YOLOv5 and ConvLSTM-based variants in terms of mAP 50:95, inference speed (FPS), and parameter efficiency.
- Employs a three-stage training pipeline: pre-training on static images (HGP), fine-tuning on video frames (THGP), and end-to-end training with temporal augmentation.
Experimental results
Research questions
- RQ1Can QRNNs effectively extract spatio-temporal features in video for real-time handgun detection, outperforming or matching ConvLSTM-based models?
- RQ2To what extent does temporal data augmentation (temporal Mosaic and Mixup) improve the accuracy of temporal object detectors without increasing model complexity?
- RQ3How do QRNN-based architectures compare to ConvLSTM-based and standard YOLOv5 in terms of inference speed and mAP 50:95 on a video-based handgun detection benchmark?
- RQ4Can QRNNs maintain high accuracy while significantly reducing inference time compared to RNN-based alternatives in real-time video detection?
- RQ5To what extent do the proposed public datasets (HGP and THGP) improve model generalization compared to existing static-image-only handgun detection benchmarks?
Key findings
- TYolov5 with QRNNs achieved a mAP 50:95 of 60.2 on the large architecture, outperforming YOLOv5l (59.3) and matching the best ConvLSTM-based model (60.0) while offering faster inference.
- The small architecture of TYolov5 achieved 55.9 mAP 50:95 with 52.6 FPS, maintaining real-time performance and surpassing YOLOv5s (54.8 mAP 50:95).
- The medium architecture of TYolov5 achieved 59.0 mAP 50:95 with QRNNs and 31.0 FPS, outperforming YOLOv5m (58.2 mAP 50:95) and showing a 1.5x speedup over ConvLSTM-based counterparts.
- Temporal data augmentation (Mosaic and Mixup) increased model accuracy by 2.1 mAP 50:95 points, demonstrating its effectiveness in improving spatio-temporal generalization.
- QRNNs reduced inference time by up to 16x compared to standard RNNs and outperformed ConvLSTMs in speed while maintaining comparable accuracy, especially in full-precision float settings.
- The proposed datasets HGP (2199 images) and THGP (5960 video frames) provide realistic, context-rich training data with bounding boxes for hands, guns, and phones, enhancing model robustness.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.