X-ray contraband detection method and device

By adopting a multi-scale parallel network and IoU perceived query selection mechanism in YOLOv10, the problem of small target detection accuracy in complex X-ray contraband detection scenarios is solved, and higher detection accuracy and real-time performance are achieved.

CN119672402APending Publication Date: 2025-03-21SHENZHEN POLYTECHNIC
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411662791.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-20
Publication Date
2025-03-21

AI Technical Summary

Technical Problem

The accuracy of YOLOv10 in complex X-ray contraceptive detection scenarios still needs to be improved, especially when the small target area is small, the resolution is low and susceptible to background interference.

Method used

The preset backbone network model is used to capture all-round features of X-ray images at different resolutions in parallel, and feature fusion is performed through multi-scale parallel networks to generate spatial attention maps, and deeply fusion is performed through activation functions to output feature maps. Based on the preset prediction head, the inter-scale interaction features in the feature map are decoupled and the cross-scale features are deeply fusion to obtain a multi-scale feature sequence, and the feature sequence containing the target object is filtered out using the IoU-aware query selection mechanism.

Benefits of technology

The accuracy and real-time detection of small targets in complex X-ray contraband detection scenarios are improved, and the problems of small targets occupying small areas, low resolution and susceptible to background interference in the image are overcome.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119672402A_ABST
    Figure CN119672402A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image recognition, and discloses an X-ray contraband detection method and device, and the method comprises the steps: obtaining an X-ray image of a target object; a preset backbone network model is adopted, all-dimensional features of different resolutions of the X-ray image are captured in parallel, after all-dimensional feature fusion is carried out, a space attention map is generated, deep fusion is carried out on the space attention map through a preset activation function, and a feature map is output; based on a preset prediction head, decoupling intra-scale interaction features in the feature map and performing deep fusion of cross-scale features to obtain a multi-scale feature sequence, and screening out a multi-scale feature sequence containing a target object from the multi-scale feature sequence by using an IoU perception query selection mechanism; and identifying and outputting the regional position of the X-ray sensitive object on the X-ray image. According to the invention, the precision of small target detection in a complex X-ray contraband detection scene can be improved, and the real-time performance of detection is better.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image recognition technology, and in particular to an X-ray contraband detection method and device. Background Art

[0002] With the rapid progress of society, public transportation and logistics industries play an increasingly core role in daily life, and with it comes the stringent requirements for the security of transportation systems, especially in preventing the infiltration of contraband. With its excellent real-time detection speed and amazing recognition accuracy, the YOLOv10 series technology has naturally become the only choice for building an efficient security inspection system.

[0003] Although YOLOv10 leads the industry with its excellent detection speed, the accuracy of small target detection still needs to be improved because small targets occupy a small area in the image, have low resolution, and are easily affected by background interference, which creates many detection difficulties. Summary of the invention

[0004] In order to improve the accuracy of small target detection in complex X-ray contraband detection scenarios, the present application provides an X-ray contraband detection method and device.

[0005] In a first aspect, the present application provides an X-ray contraband detection method.

[0006] This application is achieved through the following technical solutions:

[0007] An X-ray contraband detection method comprises the following steps:

[0008] Acquire an X-ray image of the target object;

[0009] A preset backbone network model is used to capture omnidirectional features of the X-ray image at different resolutions in parallel, and after fusing the omnidirectional features, a spatial attention map is generated, and the spatial attention map is deeply fused through a preset activation function to output a feature map;

[0010] Based on the preset prediction head, the intra-scale interactive features in the feature map are decoupled and the cross-scale features are deeply fused to obtain a multi-scale feature sequence. Then, the IoU-aware query selection mechanism is used to filter out the multi-scale feature sequence containing the target object from the multi-scale feature sequence, and the regional position of the output X-ray sensitive object on the X-ray image is identified.

[0011] In a preferred example, the present application may be further configured as follows: the backbone network model includes an EMA module;

[0012] The EMA module adopts a multi-scale parallel sub-network design, combined with convolution kernels of different sizes, to capture the omnidirectional features of the X-ray image at different resolutions, and deeply fuses the omnidirectional features through a cross-space learning method to generate a spatial attention map.

[0013] In a preferred example, the present application may be further configured as follows: the input end of the EMA module performs feature grouping on the X-ray image to obtain features of each dimension;

[0014] The dimensional features are input into two parallel convolution branches of different sizes to capture local channel interaction information and spatial information;

[0015] A cross-space learning method is used to globally encode local channel interaction information and spatial information based on a 2D global average pooling operation.

[0016] The features encoded by the two convolution branches are fused through a matrix dot product operation to generate spatial attention maps corresponding to the two convolution branches respectively.

[0017] In a preferred example, the present application may be further configured as follows: the backbone network model further includes a feature fusion module;

[0018] The feature fusion module uses the Sigmoid function to deeply fuse the spatial attention map and outputs the feature map.

[0019] In a preferred example, the present application can be further configured as follows: the prediction header is a RT-DETR prediction header, including:

[0020] An intra-scale feature interaction module, configured to receive the feature map, capture local region connections between features of the same scale, aggregate the features of the same scale, and obtain fused features of the same scale;

[0021] A cross-scale feature fusion module is used to upsample and downsample the fused same-scale features, align the same-scale features, and concatenate or add the aligned same-scale features to obtain a multi-scale feature sequence;

[0022] An IoU-aware query selector, used to filter out a multi-scale feature sequence containing a target object from the multi-scale feature sequence;

[0023] A hybrid encoder is used to encode multi-scale feature sequences containing target objects.

[0024] In a preferred example, the present application can be further configured as follows: the RT-DETR prediction header also includes:

[0025] The decoder is used to decode the encoded multi-scale feature sequence and output a set of prediction boxes of different scales, each of which includes a width, a height and a center position; based on the offset of each prediction box and in combination with the bounding box parameters, the actual boundaries of each prediction box are determined.

[0026] In a preferred example, the present application can be further configured as follows: the RT-DETR prediction header also includes:

[0027] The head is used to predict the offset of each prediction box, output a classification matrix containing the actual bounding box position and the corresponding category according to the feature map within the actual bounding box of each prediction box, and then combine with the softmax function to predict the classification confidence score of each prediction box, and identify the actual bounding box position with the highest classification confidence score as the regional position of the X-ray sensitive object on the X-ray image.

[0028] In a second aspect, the present application provides an X-ray contraband detection device.

[0029] This application is achieved through the following technical solutions:

[0030] An X-ray contraband detection device, comprising:

[0031] An imaging module, used to obtain an X-ray image of a target object;

[0032] A feature extraction module, used to capture omnidirectional features of different resolutions of the X-ray image in parallel using a preset backbone network model, generate a spatial attention map after fusing the omnidirectional features, and perform deep fusion of the spatial attention map through a preset activation function to output a feature map;

[0033] The prediction module is used to decouple the intra-scale interactive features in the feature map and perform deep fusion of cross-scale features based on a preset prediction head to obtain a multi-scale feature sequence, and then use the IoU-aware query selection mechanism to filter out the multi-scale feature sequence containing the target object from the multi-scale feature sequence, and identify the regional position of the output X-ray sensitive object on the X-ray image.

[0034] In a third aspect, the present application provides a computer device.

[0035] This application is achieved through the following technical solutions:

[0036] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any one of the above-mentioned X-ray contraband detection methods when executing the computer program.

[0037] In a fourth aspect, the present application provides a computer-readable storage medium.

[0038] This application is achieved through the following technical solutions:

[0039] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of any one of the above-mentioned X-ray contraband detection methods.

[0040] In a fifth aspect, the present application provides a computer program product.

[0041] This application is achieved through the following technical solutions:

[0042] A computer program product comprises a computer program, wherein when the computer program is executed by a processor, the steps of any one of the above-mentioned X-ray contraband detection methods are implemented.

[0043] In summary, compared with the prior art, the technical solution provided by this application has at least the following beneficial effects:

[0044] The preset backbone network model is used to capture the full range of features of the X-ray image of the target object at different resolutions in parallel. The multi-scale parallel network simultaneously captures and processes features from different resolutions, which can flexibly capture the full range of features from fine texture to macro structure. After the full range of features are fused, a spatial attention map is generated to ensure that the model focuses on the image area that may contain contraband, which is conducive to improving the accuracy of small target detection in the future. The preset activation function is then used to deeply fuse the spatial attention map and output the feature map to obtain multi-scale features with more complete information in complex X-ray contraband detection scenarios, thereby improving the accuracy of small target detection. Based on the preset The prediction head decouples the intra-scale interactive features in the feature map and performs deep fusion of cross-scale features to obtain a multi-scale feature sequence, preparing for the detection of the subsequent model; then the IoU-aware query selection mechanism is used to screen out the multi-scale feature sequence containing the target object from the multi-scale feature sequence, identify the regional position of the output X-ray sensitive object on the X-ray image, provide the model with a higher quality initial query, and improve the real-time performance of the detection; improve the situation where the detection accuracy is low due to the small area occupied by small targets in the image, low resolution, and susceptibility to background interference, improve the accuracy of small target detection in complex X-ray contraband detection scenarios, and improve the real-time performance of detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 An overall architecture diagram of an X-ray contraband detection method provided for an exemplary embodiment of the present application.

[0046] Figure 2A structural diagram of an EMA module of an X-ray contraband detection method provided as yet another exemplary embodiment of the present application.

[0047] Figure 3 A schematic diagram of training an EMA module of an X-ray contraband detection method provided as another exemplary embodiment of the present application.

[0048] Figure 4 A structural diagram of an RT-DETR prediction head of an X-ray contraband detection method provided as an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0049] This specific embodiment is merely an explanation of the present application and is not a limitation of the present application. After reading this specification, those skilled in the art may make modifications to the present embodiment without any creative contribution as needed, but such modifications are protected by the patent law as long as they are within the scope of the claims of the present application.

[0050] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0051] In addition, the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article, unless otherwise specified, generally means that the associated objects before and after are in an "or" relationship.

[0052] In order to cope with the growing security challenges and promote the leap in security inspection efficiency, deep learning technology has become the core driving force for innovative solutions in the field of X-ray security contraband identification, but it still inevitably encounters a series of complex challenges in practical applications.

[0053] In the existing solutions, accurate prediction of multi-scale bounding boxes is achieved through sophisticated image preprocessing and Darknet network combined with feature extraction of YOLO layer. Alternatively, based on the improved YOLOv4, the sample imbalance problem is solved through GHM-C loss optimization. However, both solutions have high requirements for high-performance computing resources and poor real-time processing capabilities of the models.

[0054] The YOLOv10 series technology is more suitable for building an efficient security inspection system due to its excellent real-time detection speed and amazing recognition accuracy. However, since small targets occupy a small area in the image, have low resolution, and are easily affected by background interference, there are many detection difficulties. As a result, YOLOv10's small target detection accuracy in complex X-ray contraband detection scenarios still needs to be improved, and there is still room for improvement in its adaptability to changing environments.

[0055] To this end, this application cleverly embeds the detection capabilities of the YOLOv10 model deeply into the X-ray image analysis process to achieve rapid and accurate identification of prohibited items in the image. By introducing the RT-DETR detection head and EMA (Efficient Multi-scale Attention) module, combined with lightweight model design and multi-scale feature processing technology, the use of computing resources is optimized, ensuring that real-time and rapid detection can be achieved under limited computing resource conditions, meeting the security inspection system's needs for efficient response, and improving the ability to accurately identify small targets, especially in complex scenes. The detailed features of tiny targets can be effectively extracted, overcoming the problem of poor adaptability of existing technologies to complex backgrounds. At the same time, a more efficient feature extraction and fusion mechanism is introduced, combined with a data enhancement strategy to reduce dependence on large-scale high-quality data, and a high detection accuracy can still be maintained in the case of small samples.

[0056] An embodiment of the present application provides an X-ray contraband detection method, and the main steps of the method are described as follows.

[0057] Acquire an X-ray image of the target object;

[0058] A preset backbone network model is used to capture omnidirectional features of the X-ray image at different resolutions in parallel, and after fusing the omnidirectional features, a spatial attention map is generated, and the spatial attention map is deeply fused through a preset activation function to output a feature map;

[0059] Based on the preset prediction head, the intra-scale interactive features in the feature map are decoupled and the cross-scale features are deeply fused to obtain a multi-scale feature sequence. Then, the IoU-aware query selection mechanism is used to filter out the multi-scale feature sequence containing the target object from the multi-scale feature sequence, and the regional position of the output X-ray sensitive object on the X-ray image is identified.

[0060] In one embodiment, the backbone network model includes an EMA module;

[0061] The EMA module adopts a multi-scale parallel sub-network design, combined with convolution kernels of different sizes, to capture the omnidirectional features of the X-ray image at different resolutions, and deeply fuses the omnidirectional features through a cross-space learning method to generate a spatial attention map.

[0062] In one embodiment, the input end of the EMA module performs feature grouping on the X-ray image to obtain features of each dimension;

[0063] The dimensional features are input into two parallel convolution branches of different sizes to capture local channel interaction information and spatial information;

[0064] A cross-space learning method is used to globally encode local channel interaction information and spatial information based on a 2D global average pooling operation.

[0065] The features encoded by the two convolution branches are fused through a matrix dot product operation to generate spatial attention maps corresponding to the two convolution branches respectively.

[0066] In one embodiment, the backbone network model further includes a feature fusion module;

[0067] The feature fusion module uses the Sigmoid function to deeply fuse the spatial attention map and outputs the feature map.

[0068] The embodiments of the present application are further described in detail below in conjunction with the drawings in the specification.

[0069] Reference Figure 1 , the collected X-ray image of the target object is input into the model, and the input X-ray image is taken as the starting point. It is sequentially preprocessed by the Stem initial module, and the backbone network captures the full range of features of the X-ray image at different resolutions in parallel. After the full range of features are fused, a spatial attention map is generated, and the spatial attention map is deeply fused through a preset activation function, and the feature map is output. The intra-scale interaction features in the prediction head decouple the feature map and perform deep fusion of cross-scale features to obtain a multi-scale feature sequence. Then, the IoU-aware query selection mechanism is used to screen out the multi-scale feature sequence containing the target object from the multi-scale feature sequence, identify the output X-ray sensitive object on the X-ray image, and obtain the X-ray sensitive object detection result.

[0070] Among them, the Stem initial module preprocesses the X-ray images of luggage items obtained from the X-ray security inspection machine to enhance image quality and reduce noise interference, and extracts features from them.

[0071] The backbone network model includes an EMA module (EMA attention) and a feature fusion module.

[0072] In complex X-ray contraband detection scenarios, higher requirements are placed on information integrity and sensitivity to multi-scale features. Therefore, this solution replaces the original PSA module in the backbone network model with an EMA module to optimize the feature fusion process, while avoiding channel dimensionality reduction and ensuring lossless transmission of information between channels, which is crucial for identifying complex and changeable contraband features in X-ray images.

[0073] The EMA module adopts a multi-scale parallel sub-network design, which can simultaneously capture and process features from different resolutions. It combines convolution kernels of different sizes, such as 1×1 convolution kernel and 3×3 convolution kernel, to capture different resolution features of X-ray images, thereby achieving the purpose of flexibly capturing a full range of features from fine textures to macro structures.

[0074] Furthermore, the EMA module performs a deep fusion of all-round features through a cross-space learning method to generate a spatial attention map.

[0075] The Efficient Multi-scale Attention (EMA) module is mainly used to improve the multi-scale information extraction capability of deep learning models when processing images, while reducing the amount of computation. Its core working principles can be summarized as follows:

[0076] Multi-scale feature extraction: The EMA module uses multi-scale feature extraction to capture information of different sizes and levels in the image through convolution kernels or feature pooling of different scales. In deep neural networks, this multi-scale information can help the model better understand the local details and global semantics in the image;

[0077] Reduce redundant features: Through multi-scale feature fusion, the EMA module can effectively reduce redundant information and retain only the key information that is helpful for image understanding. This feature compression method not only improves the computational efficiency of the model, but also reduces memory overhead, making the EMA module an extensible module in the deep network and easily integrated with different network structures;

[0078] Cross-scale attention fusion: The EMA module also combines attention mechanisms of different scales, allowing the model to balance details and global semantics through cross-scale fusion. This fusion method can capture the relationship between features at each level, thereby improving the overall performance of the model.

[0079] Specifically, refer to Figure 2 ,The backbone network model performs feature grouping on the input X-ray image,and carefully divides the input X-ray feature map X into g groups, each group contains C / g channels, where C represents the total number of input channels, to lay a solid foundation for the subsequent parallel processing, h refers to the image width, w refers to the image height, and g refers to the number of groups.

[0080] Next, two parallel convolutional sub-networks are introduced, namely the 1x1 convolutional branch and the 3x3 convolutional branch. The 1x1 convolutional branch focuses on capturing local channel interaction information, while the 3x3 convolutional branch is dedicated to capturing broader spatial information. The two parallel convolutional sub-network branches work together to improve the richness and accuracy of feature extraction.

[0081] Then, we enter the cross-space learning phase, using 2D global average pooling to encode the global spatial information of the outputs of the 1x1 convolution branch and the 3x3 convolution branch. Through the matrix dot product operation, the output feature maps of the two branches are cleverly fused to generate a spatial attention map, which not only captures the pairwise relationship at the pixel level, but also highlights the global contextual information for all pixels, thereby further improving the quality of feature representation. Figure 2 The "+" in refers to tensor addition, and the "⊙" refers to tensor concatenation.

[0082] Next, feature deep fusion is performed, and the spatial attention maps generated by the two branches are fused through an activation function such as Sigmoid to obtain the final output feature map. The size of this feature map is consistent with the size of the original input X-ray feature map, so that it can be directly used in subsequent network layers or integrated into the existing CNN architecture as a feature enhancement.

[0083] The data is downsampled through the average pooling layer to reduce the spatial size of the feature map. X-average pooling and Y-average pooling are applied on different dimensions to further reduce the size of the feature map. Group normalization is applied after the convolutional layer to group the input channels and normalize each group to stabilize the training process of the model. Softmax function and Sigmoid function can be used as the output layer for classification tasks.

[0084] Reference Figure 3 During the training process of the EMA module, the input features are merged through the convolution layer and the EMA attention layer to obtain the first extracted features; the first extracted features are then successively input into two convolution layers and then merged with the first extracted features to obtain the second extracted features. Finally, the second extracted features are input into the convolution layer again and then output. The nonlinear activation function is used to optimize the model parameters during training.

[0085] The EMA module is based on model integration, combining model parameters from different training stages to improve the overall performance of the model.

[0086] The EMA module not only improves the learning efficiency of the model, but also provides more powerful and flexible feature support for various computer vision tasks.

[0087] The EMA mechanism performs well in improving detection efficiency and accuracy, especially in the processing of high-resolution X-ray images. Its high computing efficiency and fast response capabilities perfectly meet the stringent requirements of real-time, accuracy and efficiency in the field of X-ray contraband detection. The EMA mechanism can not only improve the overall performance of the detection system, but also provide strong technical support for building a more efficient, accurate and real-time contraband detection system.

[0088] Finally, refer to Figure 4 After the backbone model outputs the feature map, based on the preset prediction head, the intra-scale interactive features in the feature map are decoupled and the cross-scale features are deeply fused to obtain a multi-scale feature sequence; then the IoU-aware query selection mechanism is used to screen out the multi-scale feature sequence containing the target object from the multi-scale feature sequence, and then input it into the decoder and the head, output a set of prediction boxes of different scales, and select the actual bounding box position with the highest classification confidence score as the regional position of the X-ray sensitive object on the X-ray image, and identify the output regional position of the X-ray sensitive object on the X-ray image.

[0089] In one embodiment, the prediction header is a RT-DETR prediction header, comprising:

[0090] An intra-scale feature interaction module, configured to receive the feature map, capture local region connections between features of the same scale, aggregate the features of the same scale, and obtain fused features of the same scale;

[0091] A cross-scale feature fusion module is used to upsample and downsample the fused same-scale features, align the same-scale features, and concatenate or add the aligned same-scale features to obtain a multi-scale feature sequence;

[0092] An IoU-aware query selector, used to filter out a multi-scale feature sequence containing a target object from the multi-scale feature sequence;

[0093] A hybrid encoder is used to encode multi-scale feature sequences containing target objects.

[0094] In one embodiment, the RT-DETR prediction header further includes:

[0095] The decoder is used to decode the encoded multi-scale feature sequence and output a set of prediction boxes of different scales, each of which includes a width, a height and a center position; based on the offset of each prediction box and in combination with the bounding box parameters, the actual boundaries of each prediction box are determined.

[0096] In one embodiment, the RT-DETR prediction header further includes:

[0097] The head is used to predict the offset of each prediction box, output a classification matrix containing the actual bounding box position and the corresponding category according to the feature map within the actual bounding box of each prediction box, and then combine with the softmax function to predict the classification confidence score of each prediction box, and identify the actual bounding box position with the highest classification confidence score as the regional position of the X-ray sensitive object on the X-ray image.

[0098] This solution improves the performance of small object detection by replacing the original YOLOv10 detection head with the RT-DETR detection head. As an end-to-end object detector based on Transformer, the RT-DETR detection head does not need to rely on the post-processing step of non-maximum suppression (NMS), so there is no delay in the reasoning speed and it can remain stable, which is especially important for X-ray security inspection scenarios that require fast and accurate identification of contraband.

[0099] The RT-DETR detection head uses an efficient hybrid encoder, which efficiently processes multi-scale features by decoupling intra-scale interactions and cross-scale fusion, providing rich information for detection. At the same time, the hybrid encoder is a parallel large-kernel convolution, forming a single-layer efficient hybrid encoder structure, which improves parameter efficiency. The efficient hybrid encoder using convolutional modules uses structural parameterization technology, which makes the inference stage have lower latency and higher prediction efficiency. In addition, the IoU-aware query selection mechanism provides the decoder with higher quality initial queries, which further improves the real-time performance of detection.

[0100] The parameter performance of detecting X-ray contraband using the original YOLOv10 is shown in Table 1.

[0101] Table 1

[0102] Item Type mAP50-90 gun 0.745 knife 0.633 wrench 0.665 pliers 0.640 scissors 0.640

[0103] The parameter performance of replacing the YOLOv10 detection head with the RT-DETR detection head is shown in Table 2.

[0104] Table 2

[0105]

[0106]

[0107] The parameter performance after replacing the YOLOv10 detection head with the RT-DETR detection head and replacing the original PSA with the EMA module is shown in Table 3.

[0108] Table 3

[0109] Item Type mAP50-90 gun 0.769 knife 0.659 wrench 0.687 pliers 0.655 scissors 0.679

[0110] By comparing the detection data of the model before and after the improvement, it is found that the average mAP of X-ray contraband detection in the IoU threshold range of 0.5 to 0.95 before the improvement is 66.5%, while the average mAP after the improvement is increased to 69.0%, as shown in Table 4, which shows that the model improvement has been successful.

[0111] Table 4

[0112]

[0113] In summary, an X-ray contraband detection method adopts a preset backbone network model to capture the full range of features of different resolutions of the X-ray image of the target object in parallel. The multi-scale parallel network simultaneously captures and processes features from different resolutions, and can flexibly capture the full range of features from fine texture to macro structure. After the fusion of the full range of features, a spatial attention map is generated to ensure that the model focuses on the image area that may contain contraband, which is conducive to the subsequent improvement of the accuracy of small target detection. The preset activation function is then used to deeply fuse the spatial attention map and output the feature map to obtain multi-scale features with more complete information in complex X-ray contraband detection scenarios, thereby improving the accuracy of small target detection. Accuracy; based on the preset prediction head, the intra-scale interactive features in the feature map are decoupled and the cross-scale features are deeply fused to obtain a multi-scale feature sequence to prepare for the detection of the subsequent model; the IoU-aware query selection mechanism is then used to screen out the multi-scale feature sequence containing the target object from the multi-scale feature sequence, identify the regional position of the output X-ray sensitive object on the X-ray image, provide the model with a higher quality initial query, and improve the real-time performance of the detection; improve the situation where the detection accuracy is low due to the small area occupied by small targets in the image, low resolution, and susceptibility to background interference, improve the accuracy of small target detection in complex X-ray contraband detection scenarios, and improve the real-time performance of detection.

[0114] This application replaces the original PSA module with the EMA module, and through parallel sub-networks, including 1x1 convolution and 3x3 convolution kernels, effectively avoids sequential processing, reduces the amount of calculation and model depth; and groups the channels of the input feature map, learns different semantics, and fuses the outputs of the two parallel sub-networks through a cross-space learning method, thereby capturing pixel-level pairwise relationships and global contextual information, and enhancing the representation capability of multi-scale features.

[0115] This application replaces the detection head of YOLOv10 with RT-DETR, which not only retains the real-time detection capability of YOLOv10 and meets the high throughput requirements in X-ray security inspection scenarios, but also incorporates the deep feature analysis advantages of RT-DETR to improve detection accuracy, thereby achieving a significant improvement in performance. RT-DETR enhances the flexibility of the model in handling contraband of various sizes, shapes, and quantities, improves the universality and reliability of detection, thereby improving security inspection efficiency, reducing waiting time, and greatly enhancing public safety and the safety of cargo transportation.

[0116] This application integrates the EMA efficient mechanism and the RT-DETR detection head within the YOLOv10 framework, achieving a disruptive leap in small target detection capabilities while ensuring the dual advantages of detection speed and information integrity.

[0117] This application not only maintains the advantage of high-speed detection through the design of lightweight network architecture and deep optimization of the inference process, but also greatly improves the real-time response capability and stability of the system, ensuring the efficient operation and immediate response of the model in complex application scenarios, and perfectly meets the urgent demand for high performance and high reliability in the field of X-ray contraband detection.

[0118] This application uses cutting-edge data augmentation technology and customized small sample learning strategies to significantly enhance the generalization potential of the model, so that the accuracy of the detection results is no longer limited by the number of samples, demonstrating excellent adaptability.

[0119] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0120] The present application also provides an X-ray contraband detection device, which corresponds one-to-one to an X-ray contraband detection method in the above embodiment. The X-ray contraband detection device includes:

[0121] An imaging module, used to obtain an X-ray image of a target object;

[0122] A feature extraction module, used to capture omnidirectional features of different resolutions of the X-ray image in parallel using a preset backbone network model, generate a spatial attention map after fusing the omnidirectional features, and perform deep fusion of the spatial attention map through a preset activation function to output a feature map;

[0123] The prediction module is used to decouple the intra-scale interactive features in the feature map and perform deep fusion of cross-scale features based on a preset prediction head to obtain a multi-scale feature sequence, and then use the IoU-aware query selection mechanism to filter out the multi-scale feature sequence containing the target object from the multi-scale feature sequence, and identify the regional position of the output X-ray sensitive object on the X-ray image.

[0124] For the specific definition of an X-ray contraband detection device, please refer to the definition of an X-ray contraband detection method above, which will not be repeated here.

[0125] Each module in the above-mentioned X-ray contraband detection device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.

[0126] In one embodiment, a computer device is provided, which may be a server. The computer device includes a processor, a memory, a network interface, and a database connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, any one of the above-mentioned X-ray contraband detection methods is implemented.

[0127] In one embodiment, a computer-readable storage medium is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, any one of the above-mentioned X-ray contraband detection methods is implemented.

[0128] In one embodiment, a computer program product is provided, which includes a computer program, and when the computer program is executed by a processor, any one of the above-mentioned X-ray contraband detection methods is implemented.

[0129] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. When the computer program is executed, it may include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in the present application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0130] Those skilled in the art will clearly understand that for the sake of convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the system can be divided into different functional units or modules to complete all or part of the functions described above.

Claims

1. An X-ray contraband detection method, characterized in that: The following steps are included: Acquire an X-ray image of the target object; A preset backbone network model is used to capture omnidirectional features of the X-ray image at different resolutions in parallel, and after fusing the omnidirectional features, a spatial attention map is generated, and the spatial attention map is deeply fused through a preset activation function to output a feature map; Based on the preset prediction head, the intra-scale interactive features in the feature map are decoupled and the cross-scale features are deeply fused to obtain a multi-scale feature sequence. Then, the IoU-aware query selection mechanism is used to filter out the multi-scale feature sequence containing the target object from the multi-scale feature sequence, and the regional position of the output X-ray sensitive object on the X-ray image is identified.

2. The X-ray contraband detection method according to claim 1, characterized in that: The backbone network model includes an EMA module; The EMA module adopts a multi-scale parallel sub-network design, combined with convolution kernels of different sizes, to capture the omnidirectional features of the X-ray image at different resolutions, and deeply fuses the omnidirectional features through a cross-space learning method to generate a spatial attention map.

3. The X-ray contraband detection method according to claim 2, characterized in that: The input end of the EMA module performs feature grouping on the X-ray image to obtain features of each dimension; The dimensional features are input into two parallel convolution branches of different sizes to capture local channel interaction information and spatial information; A cross-space learning method is used to globally encode local channel interaction information and spatial information based on a 2D global average pooling operation. The features encoded by the two convolution branches are fused through a matrix dot product operation to generate spatial attention maps corresponding to the two convolution branches respectively.

4. The X-ray contraband detection method according to claim 1, characterized in that: The backbone network model also includes a feature fusion module; The feature fusion module uses the Sigmoid function to deeply fuse the spatial attention map and outputs the feature map.

5. The X-ray contraband detection method according to any one of claims 1 to 4, characterized in that: The prediction header is a RT-DETR prediction header, including: An intra-scale feature interaction module, configured to receive the feature map, capture local region connections between features of the same scale, aggregate the features of the same scale, and obtain fused features of the same scale; A cross-scale feature fusion module is used to upsample and downsample the fused same-scale features, align the same-scale features, and concatenate or add the aligned same-scale features to obtain a multi-scale feature sequence; An IoU-aware query selector, used to filter out a multi-scale feature sequence containing a target object from the multi-scale feature sequence; A hybrid encoder is used to encode multi-scale feature sequences containing target objects.

6. The X-ray contraband detection method according to claim 5, characterized in that: The RT-DETR prediction header also includes, The decoder is used to decode the encoded multi-scale feature sequence and output a set of prediction boxes of different scales, each of which includes a width, a height and a center position; based on the offset of each prediction box and in combination with the bounding box parameters, the actual boundaries of each prediction box are determined.

7. The X-ray contraband detection method according to claim 6, characterized in that: The RT-DETR prediction header also includes, The head is used to predict the offset of each prediction box, output a classification matrix containing the actual bounding box position and the corresponding category according to the feature map within the actual bounding box of each prediction box, and then combine with the softmax function to predict the classification confidence score of each prediction box, and identify the actual bounding box position with the highest classification confidence score as the regional position of the X-ray sensitive object on the X-ray image.

8. An X-ray contraband detection device, characterized in that: include, An imaging module, used to obtain an X-ray image of a target object; A feature extraction module, used to capture omnidirectional features of different resolutions of the X-ray image in parallel using a preset backbone network model, generate a spatial attention map after fusing the omnidirectional features, and perform deep fusion of the spatial attention map through a preset activation function to output a feature map; The prediction module is used to decouple the intra-scale interactive features in the feature map and perform deep fusion of cross-scale features based on a preset prediction head to obtain a multi-scale feature sequence, and then use the IoU-aware query selection mechanism to filter out the multi-scale feature sequence containing the target object from the multi-scale feature sequence, and identify the regional position of the output X-ray sensitive object on the X-ray image.

9. A computer device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • X-ray security check image contraband detection method based on generative sparsity

    CN120339264A