Enhanced YOLOv5 for superior object detection: a comprehensive study
Dhrgam AL Kafaf 1 and Noor Thamir2
Ministry of Education,General Directorate of Education of Rusafa II, Baghdad,Iraq2
Corresponding Author : Dhrgam AL Kafaf
Recieved : 20-May-2024; Revised : 21-Feb-2025; Accepted : 23-Feb-2025
Abstract
This study presents an improved methodology for object detection by introducing modifications to the front end of the you only look once (YOLOv5) model. Utilizing the Microsoft common objects in context (COCO) dataset, it features key enhancements in data preprocessing, feature extraction, and the integration of attention mechanisms within a feature pyramid network (FPN). Major modifications include improved bounding box prediction and optimized non-maximum suppression (NMS) to reduce false positives, resulting in more accurate detection. Comprehensive evaluation results demonstrate that the modified YOLOv5 significantly outperforms the baseline model across multiple metrics. Notably, the enhanced model achieves a 15.5% increase in average precision at an intersection over union (IoU) threshold of 0.5 to 0.95, improving localization and classification accuracy. Additionally, it exhibits substantial gains in precision and recall, particularly in scenarios involving small or overlapping objects. These findings highlight the effectiveness of the proposed modifications in enhancing real-time object detection capabilities. The optimized model is expected to be valuable for various practical applications, including autonomous driving, medical imaging, and security systems. By providing an efficient model with robust detection capabilities across diverse environments, this research advances the state of the art in object detection.
Keywords
YOLOv5, Object detection, Feature pyramid network (FPN), Non-maximum suppression (NMS), Attention mechanisms, Precision and Recall optimization.
References
[1] Hu D, Li S, Wang M. Object detection in hospital facilities: a comprehensive dataset and performance evaluation. Engineering Applications of Artificial Intelligence. 2023; 123:106223.
[2] Mahaur B, Mishra KK. Small-object detection based on YOLOv5 in autonomous driving systems. Pattern Recognition Letters. 2023; 168:115-22.
[3] Petton E. Object detection: train YOLOv5 on a custom dataset [Internet]. 2023.
[4] Singh G. Train your own YoloV5 object detection model. https://www.analyticsvidhya.com/blog/2021/08/train-your-own-yolov5-object-detection-model/. Accessed 20 January 2025.
[5] Zhu X, Lyu S, Wang X, Zhao Q. TPH-YOLOv5: improved YOLOv5 based on transformer prediction head for object detection on drone-captured scenarios. In proceedings of the IEEE/CVF international conference on computer vision 2021 (pp. 2778-88). IEEE.
[6] Kim JH, Kim N, Park YW, Won CS. Object detection and classification based on YOLO-V5 with improved maritime dataset. Journal of Marine Science and Engineering. 2022; 10(3):1-14.
[7] Horvat M, Jelečević L, Gledec G. A comparative study of YOLOv5 models performance for image localization and classification. In central European conference on information and intelligent systems 2022 (pp. 349-56). Faculty of Organization and Informatics Varazdin.
[8] Sirisha U, Praveen SP, Srinivasu PN, Barsocchi P, Bhoi AK. Statistical analysis of design aspects of various YOLO-based deep learning models for object detection. International Journal of Computational Intelligence Systems. 2023; 16(1):1-29.
[9] Majeed F, Khan FZ, Iqbal MJ, Nazir M. Real-time surveillance system based on facial recognition using YOLOv5. In Mohammad Ali Jinnah university international conference on computing 2021 (pp. 1-6). IEEE.
[10] Bhanbhro H, Hooi YK, Hassan Z. Modern approaches towards object detection of complex engineering drawings. In international conference on digital transformation and intelligence 2022 (pp. 1-6). IEEE.
[11] Jia X, Tong Y, Qiao H, Li M, Tong J, Liang B. Fast and accurate object detector for autonomous driving based on improved YOLOv5. Scientific Reports. 2023; 13(1):1-13.
[12] Kumar S, Jailia M, Varshney S, Pathak N, Urooj S, Elmunim NA. Robust vehicle detection based on improved you look only once. Computers, Materials & Continua. 2023; 74(2):3561-77.
[13] Ali ML, Zhang Z. The YOLO framework: a comprehensive review of evolution, applications, and benchmarks in object detection. Computers. 2024; 13(12):1-37.
[14] Iqra, Giri KJ, Javed M. Small object detection in diverse application landscapes: a survey. Multimedia Tools and Applications. 2024; 83:1-36.
[15] Nurminen JK, Rainio K, Numminen JP, Syrjänen T, Paganus N, Honkoila K. Object detection in design diagrams with machine learning. In progress in computer recognition systems 2020 (pp. 27-36). Springer International Publishing.
[16] Pathak AR, Pandey M, Rautaray S. Application of deep learning for object detection. Procedia Computer Science. 2018; 132:1706-17.
[17] Sartipi F. Automatic sorting of recycled aggregate using image processing and object detection. Journal of Construction Materials. 2020; 1(3):15-9.
[18] Shindo T, Watanabe T, Yamada K, Watanabe H. Accuracy improvement of object detection in VVC coded video using YOLO-v7 features. In international conference on artificial intelligence in engineering and technology 2023 (pp. 247-51). IEEE.
[19] Terven J, Córdova-eparza DM, Romero-gonzález JA. A comprehensive review of yolo architectures in computer vision: from YOLOv1 to YOLOv8 and YOLO-NAS. Machine Learning and Knowledge Extraction. 2023; 5(4):1680-716.
[20] Wang CY, Bochkovskiy A, Liao HY. YOLOv7: trainable bag-of-freebies sets new state-of-the-art for real-time object detectors. In proceedings of the IEEE/CVF conference on computer vision and pattern recognition 2023 (pp. 7464-75). IEEE.
[21] Jiang K, Xie T, Yan R, Wen X, Li D, Jiang H, et al. An attention mechanism-improved YOLOv7 object detection algorithm for hemp duck count estimation. Agriculture. 2022; 12(10):1-18.
[22] Zhao H, Zhang H, Zhao Y. Yolov7-sea: object detection of maritime UAV images based on improved yolov7. In proceedings of the IEEE/CVF winter conference on applications of computer vision 2023 (pp. 233-8). IEEE.
[23] Li S, Tao T, Zhang Y, Li M, Qu H. YOLO v7-CS: a YOLO v7-based model for lightweight bayberry target detection count. Agronomy. 2023; 13(12):1-18.
[24] Lai Y, Ma R, Chen Y, Wan T, Jiao R, He H. A pineapple target detection method in a field environment based on improved yolov7. Applied Sciences. 2023; 13(4):1-18.
[25] Xia Y, Nguyen M, Yan WQ. A real-time kiwifruit detection based on improved YOLOv7. In international conference on image and vision computing New Zealand 2022 (pp. 48-61). Cham: Springer Nature Switzerland.
[26] Yang H, Liu Y, Wang S, Qu H, Li N, Wu J, et al. Improved apple fruit target recognition method based on YOLOv7 model. Agriculture. 2023; 13(7):1-21.
[27] Li S, Wang S, Wang P. A small object detection algorithm for traffic signs based on improved YOLOv7. Sensors. 2023; 23(16):1-22.
[28] Liu P, Yin H. Yolov7-peach: an algorithm for immature small yellow peaches detection in complex natural environments. Sensors. 2023; 23(11):1-20.
[29] Tang F, Yang F, Tian X. Long-distance person detection based on YOLOv7. Electronics. 2023; 12(6):1-14.
[30] Kim YE, Huh K, Park YJ, Peck KR, Jung J. Association between vaccination and acute myocardial infarction and ischemic stroke after COVID-19 infection. Jama. 2022; 328(9):887-9.