X-ray security inspection for prohibited item detection is widely used to maintain social order and personal safety. Deploying most modern object identification algorithms on portable security inspection devices is difficult because of their high computational complexity and many parameters. Consequently, an enhanced YOLOv7-tiny model is presented in this research and used to the problem of forbidden object recognition in X-ray images. First, the upgraded model’s feature extraction backbone is a lightweight network called FasterNet, which lowers computing complexity and speeds up detection. Second, the ELAN module in the original YOLOv7-tiny is replaced with a New-ELAN module with PConv in the neck layer to further reduce repeated computations and memory usage. Finally, to improve the detection performance of forbidden objects with smaller sizes, a lightweight CA attention mechanism is inserted between the neck and backbone layers. The studies are carried out using the SIXray dataset. The enhanced model decreases the volume, computational complexity, and number of parameters by 14.7%, 19.7%, and 12.2%, respectively, in comparison to the original YOLOv7-tiny model. The model achieves 88.7% identification accuracy for forbidden items, and the speed of detection rises from 82.4 FPS to 89.5 FPS. The experimental findings demonstrate that the improved model achieves overall lightweighting while maintaining good detection accuracy and speeding up detection. Code is available at https://github.com/zhg-SZPT/TinyRay.
Read full abstract