Metaheuristic Hyperparameter Optimization and Explainable Deep Learning for Baggage Threat Detection
Downloads
The American Statistical Association reports that Bangkok, the capital and largest city of Thailand, holds the top spot as the most visited city worldwide in 2023. X-ray imaging for security screening plays a crucial role in upholding transportation security by detecting a diverse range of threats or prohibited items carried by passengers. This study introduces an advanced deep learning model leveraging YOLOv8, renowned for its enhanced efficiency in automating baggage detection processes. To enhance the model's hyperparameters and adjust them finely during the training process using the baggage dataset, the system utilized a metaheuristic optimization algorithm known as Evolutionary Genetic Algorithm, which is based on evolutionary principles. Incorporating explainable artificial intelligence techniques such as Local Interpretable Model-Agnostic Explanations (LIME) and Gradient-weighted Class Activation Mapping (Grad-CAM) allows for visual interpretation of predictions, aiding operators in utilizing the model effectively. We trained and tested the baggage dataset, which included 8,312 images and five classes: gun, knife, pliers, scissors, and wrench. The YOLOv8 model achieved the following metrics for the detection of prohibited objects in baggage inspection: an overall precision of 90.5%, recall of 83.3%, mAP50 of 91.3%, and mAP50-95 of 67%. The proposed method can fully automate the recognition of prohibited objects during baggage inspection. This approach is beneficial for designing an integrated, automatic, and non-destructive X-ray image-based classification system.
Downloads
[1] Travel off Path (2025). These Are The 10 Most Visited Cities In The World Right Now. Travel off Path, Glenville, United States. Available online: https://www.traveloffpath.com/these-are-the-10-most-visited-cities-in-the-world-right-now/ (accessed on January 2026).
[2] Seyfi, G., Esme, E., Yilmaz, M., & Kiran, M. S. (2024). A literature review on deep learning algorithms for analysis of X-ray images. International Journal of Machine Learning and Cybernetics, 15(4), 1165–1181. doi:10.1007/s13042-023-01961-z.
[3] Ayesha, J. A. K., Ahmad, W., Nadeem, M., Zahra, S. W., Arshad, A., Riaz, S., & Shahid, U. (2023). Baggage Detection and Recognition Using Local Tri-Directional Pattern. International Journal of Mobile Computing Technology, 1(1), 8-17.
[4] Wang, B., Tian, Y., Wang, J., Hu, J., Liu, D., & Xu, Z. (2023). Detect occluded items in X-ray baggage inspection. Computers and Graphics (Pergamon), 115, 148–157. doi:10.1016/j.cag.2023.07.013.
[5] Ahmed, A., Velayudhan, D., Hassan, T., Bennamoun, M., Damiani, E., & Werghi, N. (2024). Enhancing security in X-ray baggage scans: A contour-driven learning approach for abnormality classification and instance segmentation. Engineering Applications of Artificial Intelligence, 130, 107639. doi:10.1016/j.engappai.2023.107639.
[6] Otabir, S. A. G., Tiang, S. S., Lim, W. H., Leong, H. Y., & Sun, B. (2023). X-Ray Baggage Object Detection Using Neural Networks Approach for Safety Purpose. Lecture Notes in Electrical Engineering, 988, 341–350. doi:10.1007/978-981-19-8703-8_30.
[7] Migel, S., Zaliskyi, M., Zavhorodnii, S., & Osipchuk, A. (2023). A New Method of Handguns Recognition While Inspecting Baggage for Aviation Security Service. Lecture Notes in Networks and Systems: Vol. 736 LNNS, 194–205. doi:10.1007/978-3-031-38082-2_15.
[8] Hassan, T., Akcay, S., Hassan, B., Bennamoun, M., Khan, S., Dias, J., & Werghi, N. (2023). Cascaded structure tensor for robust baggage threat detection. Neural Computing and Applications, 35(15), 11269–11285. doi:10.1007/s00521-023-08296-4.
[9] Redmon, J., Divvala, S., Girshick, R., & Farhadi, A. (2016). You only look once: Unified, real-time object detection. Proceedings of the IEEE Computer Society Conference on Computer Vision and Pattern Recognition, 2016-December, 779–788. doi:10.1109/CVPR.2016.91.
[10] Girshick, R., Donahue, J., Darrell, T., & Malik, J. (2014). Rich feature hierarchies for accurate object detection and semantic segmentation. Proceedings of the IEEE Computer Society Conference on Computer Vision and Pattern Recognition, 580–587. doi:10.1109/CVPR.2014.81.
[11] Isa, I. S., Rosli, M. S. A., Yusof, U. K., Maruzuki, M. I. F., & Sulaiman, S. N. (2022). Optimizing the Hyperparameter Tuning of YOLOv5 for Underwater Detection. IEEE Access, 10, 52818–52831. doi:10.1109/ACCESS.2022.3174583.
[12] Karaman, A., Pacal, I., Basturk, A., Akay, B., Nalbantoglu, U., Coskun, S., Sahin, O., & Karaboga, D. (2023). Robust real-time polyp detection system design based on YOLO algorithms by optimizing activation functions and hyper-parameters with artificial bee colony (ABC). Expert Systems with Applications, 221, 119741. doi:10.1016/j.eswa.2023.119741.
[13] Ribeiro, M. T., Singh, S., & Guestrin, C. (2016). “Why should I trust you?" Explaining the predictions of any classifier. Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 1135-1144. doi:10.1145/2939672.2939778.
[14] Selvaraju, R. R., Cogswell, M., Das, A., Vedantam, R., Parikh, D., & Batra, D. (2020). Grad-CAM: Visual Explanations from Deep Networks via Gradient-Based Localization. International Journal of Computer Vision, 128(2), 336–359. doi:10.1007/s11263-019-01228-7.
[15] Bhowmik, N., Gaus, Y. F. A., Akcay, S., Barker, J. W., & Breckon, T. P. (2019). On the impact of object and sub-component level segmentation strategies for supervised anomaly detection within X-ray security imagery. Proceedings - 18th IEEE International Conference on Machine Learning and Applications, ICMLA 2019, 986–991. doi:10.1109/ICMLA.2019.00168.
[16] Gaus, Y. F. A., Bhowmik, N., Akcay, S., Guillen-Garcia, P. M., Barker, J. W., & Breckon, T. P. (2019). Evaluation of a Dual Convolutional Neural Network Architecture for Object-wise Anomaly Detection in Cluttered X-ray Security Imagery. Proceedings of the International Joint Conference on Neural Networks, 2019-July, 1–8. doi:10.1109/IJCNN.2019.8851829.
[17] Gaus, Y. F. A., Bhowmik, N., Akcay, S., & Breckon, T. (2019). Evaluating the transferability and adversarial discrimination of convolutional neural networks for threat object detection and classification within x-ray security imagery. Proceedings - 18th IEEE International Conference on Machine Learning and Applications, ICMLA 2019, 420–425. doi:10.1109/ICMLA.2019.00079.
[18] Liang, K. J., Sigman, J. B., Spell, G. P., Strellis, D., Chang, W., Liu, F., ... & Carin, L. (2019). Toward automatic threat recognition for airport X-ray baggage screening with deep convolutional object detection. arXiv preprint, arXiv:1912.06329. doi:10.48550/arXiv.1912.06329.
[19] Miao, C., Xie, L., Wan, F., Su, C., Liu, H., Jiao, J., & Ye, Q. (2019). Sixray: A large-scale security inspection x-ray benchmark for prohibited item discovery in overlapping images. Proceedings of the IEEE Computer Society Conference on Computer Vision and Pattern Recognition, 2019-June, 2114–2123. doi:10.1109/CVPR.2019.00222.
[20] Chouai, M., Merah, M., & Mimi, M. (2020). CH-Net: Deep adversarial autoencoders for semantic segmentation in X-ray images of cabin baggage screening at airports. Journal of Transportation Security, 13(1–2), 71–89. doi:10.1007/s12198-020-00211-5.
[21] Wei, Y., & Liu, X. (2020). Dangerous goods detection based on transfer learning in X-ray images. Neural computing and applications, 32(12), 8711-8724. doi:10.1007/s00521-019-04360-0.
[22] Yao, S. Q., Su, Z. G., Yang, J. F., & Zhang, H. G. (2021). A prohibited items identification approach based on semantic segmentation. Optoelectronics Letters, 17(4), 247-251. doi:10.1007/s11801-021-0017-6.
[23] Dumagpi, J. K., & Jeong, Y. J. (2021). Pixel-level analysis for enhancing threat detection in large-scale x-ray security images. Applied Sciences (Switzerland), 11(21), 10261. doi:10.3390/app112110261.
[24] Ma, B., Jia, T., Su, M., Jia, X., Chen, D., & Zhang, Y. (2023). Automated Segmentation of Prohibited Items in X-Ray Baggage Images Using Dense De-Overlap Attention Snake. IEEE Transactions on Multimedia, 25, 4374–4386. doi:10.1109/TMM.2022.3174339.
[25] Chang, A., Zhang, Y., Zhang, S., Zhong, L., & Zhang, L. (2022). Detecting prohibited objects with physical size constraint from cluttered X-ray baggage images. Knowledge-Based Systems, 237, 107916. doi:10.1016/j.knosys.2021.107916.
[26] Fang, C., Liu, J., Han, P., Chen, M., & Liao, D. (2023). FSVM: A Few-Shot Threat Detection Method for X-ray Security Images. Sensors, 23(8), 4069. doi:10.3390/s23084069.
[27] Wei, Q., Ma, S., Tang, S., Li, B., Shen, J., Xu, Y., & Fan, J. (2023). A deep learning-based recognition for dangerous objects imaged in X-ray security inspection device. Journal of X-Ray Science and Technology, 31(1), 13–26. doi:10.3233/XST-221210.
[28] Andriyanov, N. (2024). Using ArcFace Loss Function and Softmax with Temperature Activation Function for Improvement in X-ray Baggage Image Classification Quality. Mathematics, 12(16), 2547. doi:10.3390/math12162547.
[29] Belal, M., Ahmed, A., Velayudhan, D., Hassan, T., Damiani, E., & Werghi, N. (2024). Addressing Class Imbalance in X-ray Threat Detection with Self-Supervised Balanced DINO. International Conference on Engineering and Emerging Technologies, ICEET, 2024, 1–6. doi:10.1109/ICEET65156.2024.10913663.
[30] Khan, S. M., Usman Akram, M., Salam, A. A., & Nasim, A. (2025). A Robust Semantic Segmentation Framework for Baggage Threat Detection. 2nd International Conference on Emerging Technologies in Electronics, Computing and Communication, ICETECC 2025, 1–6. doi:10.1109/ICETECC65365.2025.11071247.
[31] Nasim, A., Mazhar Khan, S., Abdul Salam, A., Shaukat, A., Hassan, T., Syed, A. M., & Usman Akram, M. (2025). Class and Data-Incremental Learning Framework for Baggage Threat Segmentation via Knowledge Distillation. IEEE Access, 13, 3574919. doi:10.1109/ACCESS.2025.3574919.
[32] Jiang, P., Ergu, D., Liu, F., Cai, Y., & Ma, B. (2021). A Review of Yolo Algorithm Developments. Procedia Computer Science, 199, 1066–1073. doi:10.1016/j.procs.2022.01.135.
[33] Dumitriu, A., Tatui, F., Miron, F., Ionescu, R. T., & Timofte, R. (2023). Rip Current Segmentation: A Novel Benchmark and YOLOv8 Baseline Results. IEEE Computer Society Conference on Computer Vision and Pattern Recognition Workshops, 2023-June, 1261–1271. doi:10.1109/CVPRW59228.2023.00133.
[34] Lou, H., Duan, X., Guo, J., Liu, H., Gu, J., Bi, L., & Chen, H. (2023). DC-YOLOv8: Small-Size Object Detection Algorithm Based on Camera Sensor. Electronics (Switzerland), 12(10), 2323. doi:10.3390/electronics12102323.
[35] Terven, J., Córdova-Esparza, D. M., & Romero-González, J. A. (2023). A Comprehensive Review of YOLO Architectures in Computer Vision: From YOLOv1 to YOLOv8 and YOLO-NAS. Machine Learning and Knowledge Extraction, 5(4), 1680–1716. doi:10.3390/make5040083.
[36] Jocher, G., Chaurasia, A., Qiu, J. (2023). YOLO by Ultralytics. Available online: https://github.com/ultralytics/ultralytics (accessed on December 2025).
[37] Rath, S. (2023). YOLOv8: Comprehensive Guide to State of the Art Object Detection. Available online: https://learnopencv.com/ultralytics-yolov8/#YOLOv8-vs-%20YOLOv5 (accessed on September 2025).
[38] Talaat, F. M., & ZainEldin, H. (2023). An improved fire detection approach based on YOLO-v8 for smart cities. Neural Computing and Applications, 35(28), 20939–20954. doi:10.1007/s00521-023-08809-1.
[39] RangeKing. (2023). Brief summary of YOLOv8 model structure #189. GitHub. Available online: https://github.com/ultralytics/ultralytics/issues/189 (accessed on December 2025).
[40] Li, Y., Fan, Q., Huang, H., Han, Z., & Gu, Q. (2023). A Modified YOLOv8 Detection Network for UAV Aerial Image Recognition. Drones, 7(5), 304. doi:10.3390/drones7050304.
[41] He, K., Zhang, X., Ren, S., & Sun, J. (2015). Spatial Pyramid Pooling in Deep Convolutional Networks for Visual Recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence, 37(9), 1904–1916. doi:10.1109/TPAMI.2015.2389824.
[42] Wang, X., Gao, H., Jia, Z., & Li, Z. (2023). BL-YOLOv8: An improved road defect detection model based on YOLOv8. Sensors, 23(20), 8361. doi:10.3390/s23208361.
[43] Lin, T. Y., Dollár, P., Girshick, R., He, K., Hariharan, B., & Belongie, S. (2017). Feature pyramid networks for object detection. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2117-2125.
[44] Liu, S., Qi, L., Qin, H., Shi, J., & Jia, J. (2018). Path Aggregation Network for Instance Segmentation. Proceedings of the IEEE Computer Society Conference on Computer Vision and Pattern Recognition, 8759–8768. doi:10.1109/CVPR.2018.00913.
[45] Zheng, Z., Wang, P., Liu, W., Li, J., Ye, R., & Ren, D. (2020). Distance-IoU loss: Faster and better learning for bounding box regression. AAAI 2020 - 34th AAAI Conference on Artificial Intelligence, 34(07), 12993–13000. doi:10.1609/aaai.v34i07.6999.
[46] Li, X., Wang, W., Wu, L., Chen, S., Hu, X., Li, J., Tang, J., & Yang, J. (2020). Generalized focal loss: Learning qualified and distributed bounding boxes for dense object detection. Advances in Neural Information Processing Systems, 2020-December, 21002–21012.
[47] Yang, L., & Shami, A. (2020). On hyperparameter optimization of machine learning algorithms: Theory and practice. Neurocomputing, 415, 295–316. doi:10.1016/j.neucom.2020.07.061.
[48] Bischl, B., Binder, M., Lang, M., Pielok, T., Richter, J., Coors, S., Thomas, T., Becker, M., Boulesteix, A. L., Deng, D., & Lindauer, M. Hyperparameter optimization: Foundations, algorithms, best practices, and open challenges. Wiley Interdisciplinary Reviews: Data Mining and Knowledge Discovery, 13(2), 1484.
[49] Decastro-García, N., Muñoz Castañeda, Á. L., Escudero García, D., & Carriegos, M. V. (2019). Effect of the Sampling of a Dataset in the Hyperparameter Optimization Phase over the Efficiency of a Machine Learning Algorithm. Complexity, 2019(1), 6278908. doi:10.1155/2019/6278908.
[50] Xu, L., Yan, W., & Ji, J. (2023). The research of a novel WOG-YOLO algorithm for autonomous driving object detection. Scientific Reports, 13(1), 3699. doi:10.1038/s41598-023-30409-1.
[51] Abreu, S. (2019). Automated architecture design for deep neural networks. arXiv preprint, arXiv:1908.10714. doi:10.48550/arXiv.1908.10714.
[52] Junior, F. A., & Suharjito. (2023). Video based oil palm ripeness detection model using deep learning. Heliyon, 9(1), e13036. doi:10.1016/j.heliyon.2023.e13036.
[53] Ali, Y. A., Awwad, E. M., Al-Razgan, M., & Maarouf, A. (2023). Hyperparameter search for machine learning algorithms for optimizing the computational complexity. Processes, 11(2), 349. doi:10.3390/pr11020349.
[54] Snustad, D. P., & Simmons, M. J. (2015). Principles of genetics. John Wiley & Sons, New Jersey, United States.
[55] Pierce, B. A. (2012). Genetics essentials: concepts and connections. WH Freeman, New York, United States.
[56] Slowik, A., & Kwasnicka, H. (2020). Evolutionary algorithms and their applications to engineering problems. Neural Computing and Applications, 32(16), 12363–12379. doi:10.1007/s00521-020-04832-8.
[57] Bäck, T., & Schwefel, H.-P. (1993). An Overview of Evolutionary Algorithms for Parameter Optimization. Evolutionary Computation, 1(1), 1–23. doi:10.1162/evco.1993.1.1.1.
[58] Simonyan, K., Vedaldi, A., & Zisserman, A. (2014). Deep inside convolutional networks: Visualising image classification models and saliency maps. 2nd International Conference on Learning Representations, ICLR 2014 - Workshop Track Proceedings, 1-8.
[59] Koh, P. W., & Liang, P. (2017). Understanding black-box predictions via influence functions. 34th International Conference on Machine Learning, ICML 2017, 4, 2976–2987.
[60] Zeiler, M. D., & Fergus, R. (2014). Visualizing and understanding convolutional networks. Lecture Notes in Computer Science (Including Subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics), 8689 LNCS(Part 1), 818–833. doi:10.1007/978-3-319-10590-1_53.
- This work (including HTML and PDF Files) is licensed under a Creative Commons Attribution 4.0 International License.



















