Skip to main content
Log in

AC-YOLOv4: an object detection model incorporating attention mechanism and atrous convolution for contraband detection in x-ray images

  • Published:
Multimedia Tools and Applications Aims and scope Submit manuscript

Abstract

The complex background of X-ray security detection images and the overlapping of contraband items with each other and their different sizes and locations lead to a high leakage rate and false detection of contraband items during the security screening process. To address the above problems, this paper proposes a target detection algorithm based on the YOLOv4 model with fused attention mechanism and atrous spatial pyramidal pooling, and calls it AC-YOLOv4. First, the original spatial pyramid pooling in YOLOv4 is replaced by atrous spatial pyramid pooling, which can enlarge the image receptive field and extract the features of contraband under different sizes. Second, the attention mechanism module is added to the neck part of the model to improve the extraction of deeper features of contraband and reduce background interference. Before training, we use K-means clustering algorithm to obtain the Anchor box which is more suitable for the specific X-ray security image dataset, and use transfer learning to train the network to accelerate the training speed of the model and improve the detection accuracy. The proposed X-ray security contraband detection model improves the recognition accuracy by 5.56%, 6.83% and 12.24% on the X-ray security datasets SIXray, OPIXray and XDXray respectively compared to the excellent SOTA target detection model – YOLOv7. The experimental results show that AC-YOLOv4 has a significantly improved detection capability compared to YOLOv4 and can effectively reduce the rate of missed and false detections of contraband in X-ray security screening, while improving the generalisation of the model for detecting contraband of different shapes and sizes.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14

Similar content being viewed by others

Data availability

The data that support the findings of this study are available from the corresponding author, upon reasonable request.

References

  1. Zhao C, Zhu L, Dou S, Deng W, Wang L (2022) Detecting Overlapped Objects in X-Ray Security Imagery by a Label-Aware Mechanism. IEEE Trans Inf Forensics Secur 17:998–1009. https://doi.org/10.1109/TIFS.2022.3154287

    Article  Google Scholar 

  2. Gao Q, Hong R, Zhu X, Liu X (2021) An X-ray Image Enhancement Algorithm for Dangerous Goods in Airport Security Inspection. Asia-Pac Conf Commun Technol Comput Sci (ACCTCS) 2021:43–46. https://doi.org/10.1109/ACCTCS52002.2021.00017

    Article  Google Scholar 

  3. Mery D, Svec E, Arias M, Riffo V, Saavedra JM, Banerjee S (April 2017) Modern Computer Vision Techniques for X-Ray Testing in Baggage Inspection. IEEE Trans Syst Man Cybernet: Syst 47(4):682–692. https://doi.org/10.1109/TSMC.2016.2628381

    Article  Google Scholar 

  4. Akçay S, Kundegorski ME, Devereux M, Breckon TP (2016) Transfer learning using convolutional neural networks for object classification within X-ray baggage security imagery. IEEE Int Conf Image Process (ICIP) 2016:1057–1061. https://doi.org/10.1109/ICIP.2016.7532519

    Article  Google Scholar 

  5. Gaus YFA, Bhowmik N, Akçay S, Guillén-Garcia PM, Barker JW, Breckon TP (2019) Evaluation of a Dual Convolutional Neural Network Architecture for Object-wise Anomaly Detection in Cluttered X-ray Security Imagery. Int Joint Conf Neural Netw (IJCNN) 2019:1–8. https://doi.org/10.1109/IJCNN.2019.8851829

    Article  Google Scholar 

  6. Galvez RL, Dadios EP, Bandala AA, Vicerra RRP (2018) "Threat Object Classification in X-ray Images Using Transfer Learning," 2018 IEEE 10th International Conference on Humanoid, Nanotechnology, Information Technology, Communication and Control, Environment and Management (HNICEM), pp. 1–5, https://doi.org/10.1109/HNICEM.2018.8666344

  7. Koçi J, Topal AO, Ali M (2020) "Threat Object Detection in X-ray Images Using SSD, R-FCN and Faster R-CNN," 2020 International Conference on Computing, Networking, Telecommunications & Engineering Sciences Applications (CoNTESA), pp. 10–15, https://doi.org/10.1109/CoNTESA50436.2020.9302863

  8. Wu X, Liu C (2022) X-ray security check image recognition based on attention mechanism[C]//Journal of Physics: Conference Series. IOP Publ 2216(1):012104

    Google Scholar 

  9. Nguyen HD, Cai R, Zhao H et al (2022) Towards More Efficient Security Inspection via Deep Learning: A Task-Driven X-ray Image Cropping Scheme[J]. Micromachines 13(4):565

    Article  PubMed  PubMed Central  Google Scholar 

  10. Zhu X, Zhang J, Chen X et al (2021) AMOD-Net: attention-based multi-scale object detection network for X-ray baggage security inspection[C]. In: Proceedings of the 2021 5th International Conference on Computer Science and Artificial Intelligence, pp 27–32

  11. Guo RH, Zhang L, Yang Y et al (2021) X-Ray Image Controlled Knife Detection and Recognition Based on Improved SSD[J]. Laser Optoelectron Progress 58(04):65–72

    Google Scholar 

  12. Bochkovskiy A, Wang C Y, Liao H Y M (2020) Yolov4: Optimal speed and accuracy of object detection[J]. arXiv preprint arXiv:2004.10934

  13. He K, Zhang X, Ren S et al (2015) Spatial pyramid pooling in deep convolutional networks for visual recognition[J]. IEEE Trans Pattern Anal Mach Intell 37(9):1904–1916

    Article  PubMed  Google Scholar 

  14. Chen LC, Papandreou G, Kokkinos I et al (2016) DeepLab: Semantic Image Segmentation with Deep Convolutional Nets, Atrous Convolution, and Fully Connected CRFs[J]. IEEE Trans Pattern Anal Mach Intell 40(4):834–848

    Article  Google Scholar 

  15. Woo S, Park J, Lee J Y et al (2018) Cbam: convolutional block attention module[C]. In: Proceedings of the European conference on computer vision (ECCV), pp 3–19

  16. Likas A, Vlassis N, Verbeek JJ (2003) The global k-means clustering algorithm[J]. Pattern Recogn 36(2):451–461

    Article  ADS  Google Scholar 

  17. Weiss K, Khoshgoftaar TM, Wang DD (2016) A survey of transfer learning[J]. J Big data 3(1):1–40

    Article  Google Scholar 

  18. Nan X, Zehao G, Bingdi T et al (2023) Material-aware multiscale atrous convolutional network for prohibited items detection in x-ray image[J]. J Electron Imaging 32(2):023019–023019

    Article  ADS  Google Scholar 

  19. Ni Q, Song Y, Zhang Y (2023) Few-shot X-ray prohibited-item detection based on multi-scale feature fusion and sample balancing. PREPRINT (Version 1) available at Research Square. https://doi.org/10.21203/rs.3.rs-2897746/v1

  20. Ma C, Zhuo L, Li J et al (2023) Occluded prohibited object detection in X-ray images with global Context-aware Multi-Scale feature Aggregation[J]. Neurocomputing 519:1–16

    Article  Google Scholar 

  21. Zhang Y, Xu W, Yang S et al (2022) Improved YOLOX detection algorithm for contraband in X-ray images[J]. Appl Opt 61(21):6297–6310

    Article  ADS  PubMed  Google Scholar 

  22. Yu Q, Wu Q, Liu H (2022) Research on x-ray contraband detection and overlapping target detection based on convolutional network. In: 2022 4th International Conference on Frontiers Technology of Information and Computer (ICFTIC), Qingdao, pp 736–741. https://doi.org/10.1109/ICFTIC57696.2022.10075330

  23. Song B, Li R, Pan X, Liu X, Xu Y (2022) Improved YOLOv5 Detection Algorithm of Contraband in X-ray Security Inspection Image. In: 2022 5th International Conference on Pattern Recognition and Artificial Intelligence (PRAI), Chengdu, pp 169–174. https://doi.org/10.1109/PRAI55851.2022.9904110

  24. Wang Z, Zhang H, Lin Z, Tan X, Zhou B (2022) Prohibited items detection in baggage security based on improved YOLOv5. In: 2022 IEEE 2nd International Conference on Software Engineering and Artificial Intelligence (SEAI), Xiamen, pp 20–25. https://doi.org/10.1109/SEAI55746.2022.9832407

  25. Li M, Ma B, Jia T et al (2022) PIXDet: Prohibited Items X-Ray Image Detection in Complex Background[M]//Proceedings of CECNet. IOS Press 2022:81–90

    Google Scholar 

  26. Dai Y, Chen P (2023) YOLO lightweight contraband detection network using attention mechanism [C]//International Conference on Mechatronics Engineering and Artificial Intelligence (MEAI 2022). SPIE 12596:302–306

    Google Scholar 

  27. Neubeck A, Van Gool L (2006) Efficient non-maximum suppression[C]//18th international conference on pattern recognition (ICPR’06). IEEE 3:850–855

    Google Scholar 

  28. Redmon J, Divvala S, Girshick R et al (2016) You only look once: unified, real-time object detection[C]. In: Proceedings of the IEEE conference on computer vision and pattern recognition, pp 779–788

  29. Redmon J, Farhadi A (2017) YOLO9000: better, faster, stronger[C]. In: Proceedings of the IEEE conference on computer vision and pattern recognition, pp 7263–7271

  30. Redmon J, Farhadi A (2018) Yolov3: An incremental improvement[J]. arXiv preprint arXiv:1804.02767

  31. Thuan D (2021) Evolution of Yolo algorithm and Yolov5: The State-of-the-Art object detention algorithm[J]

  32. Junming L, Weihua M (2020) Review on Single-Stage Object Detection Algorithm Based on Deep Learning[J]. Aero Weaponry 27(3):44–53

    Google Scholar 

  33. Liu S, Qi L, Qin H et al (2018) Path aggregation network for instance segmentation[C]. In: Proceedings of the IEEE conference on computer vision and pattern recognition, pp 8759–8768

  34. Ren S, He K, Girshick R et al (2015) Faster r-cnn: Towards real-time object detection with region proposal networks[J]. Adv Neural Inf Process Syst 2015:28

  35. Niu Z, Zhong G, Yu H (2021) A review on the attention mechanism of deep learning[J]. Neurocomputing 452:48–62

    Article  Google Scholar 

  36. Hu J, Shen L, Sun G (2018) Squeeze-and-excitation networks[C]. In: Proceedings of the IEEE conference on computer vision and pattern recognition, pp 7132–7141

  37. Zhou B, Khosla A, Lapedriza A et al (2016) Learning deep features for discriminative localization[C]. In: Proceedings of the IEEE conference on computer vision and pattern recognition, pp 2921–2929

  38. Wang Q, Wu B, Zhu P et al (2020) ECA-Net: Efficient channel attention for deep convolutional neural networks[C]. In: Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp 11534–11542

  39. Krizhevsky A, Sutskever I, Hinton GE (2017) Imagenet classification with deep convolutional neural networks[J]. Commun ACM 60(6):84–90

    Article  Google Scholar 

  40. LeCun Y, Bottou L, Bengio Y et al (1998) Gradient-based learning applied to document recognition[J]. Proc IEEE 86(11):2278–2324

    Article  Google Scholar 

  41. Wu HB, Wei XY, Liu MH et al (2021) Improved YOLOv4 for X-ray security in dangerous goods detection with combined atrous convolution and transfer learning[J]. Chin Opt 14(6):1–10

    CAS  Google Scholar 

  42. Lin TY, Maire M, Belongie S, Microsoft coco: Common objects in context[C], , Computer Vision–ECCV et al (2014) 13th European Conference, Zurich, Switzerland, September 6–12, 2014, Proceedings, Part V 13. Springer Int Publ 2014:740–755

  43. Miao C, Xie L G, Wan F et al (2019) SIXray: a large-scale security inspection X-ray benchmark for prohibited item Discovery in overlapping images[C]. In: Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp 2119–2128

  44. Wei Y, Tao R, Wu Z, et al. (2020) Occluded prohibited items detection: An x-ray security inspection benchmark and de-occlusion attention module[C]. In: Proceedings of the 28th ACM international conference on multimedia, pp 138–146

  45. Liu W, Anguelov D, Erhan D, Ssd: Single shot multibox detector[C], , Computer Vision–ECCV et al (2016) 14th European Conference, Amsterdam, The Netherlands, October 11–14, 2016, Proceedings, Part I 14. Springer Int Publ 2016:21–37

  46. Wang C Y, Bochkovskiy A, Liao H Y M (2022) YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors[J]. arXiv preprint arXiv:2207.02696

  47. Cheng ZW, Li XW (2023) Prohibit item detection in few-shot X-ray images based on FPID[J]. Radio Eng 53(08):1836–1843

    Google Scholar 

  48. Fang C, Liu J, Han P et al (2023) FSVM: A Few-Shot Threat Detection Method for X-ray Security Images[J]. Sensors 23(8):4069

    Article  ADS  PubMed  PubMed Central  Google Scholar 

  49. Chang A, Zhang Y, Zhang S et al (2022) Detecting prohibited objects with physical size constraint from cluttered X-ray baggage images[J]. Knowl-Based Syst 237:107916

    Article  Google Scholar 

  50. Yuan J, Zhang N, Xie Y et al (2022) Detection of Prohibited Items Based upon X-ray Images and Improved YOLOv7[C]//Journal of Physics: Conference Series. IOP Publishing 2390(1):012114

    Google Scholar 

Download references

Acknowledgements

this work was supported by the Xinjiang Autonomous Region Key R&D Project (2021B01002)

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Cheng Chen.

Ethics declarations

Competing interests

The authors have no competing interests to declare that are relevant to the content of this article.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Wang, B., Ding, H. & Chen, C. AC-YOLOv4: an object detection model incorporating attention mechanism and atrous convolution for contraband detection in x-ray images. Multimed Tools Appl 83, 26485–26504 (2024). https://doi.org/10.1007/s11042-023-16628-8

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11042-023-16628-8

Keywords

Navigation