Dangerous article detection method and system for optimizing feature CBAM-YOLOv10

By optimizing the hazardous goods detection method of characteristic CBAM-YOLOv10, combining the bidirectional characteristic pyramid network and the CBAM attention mechanism, an inspection model is generated and a small target detection head is added, which solves the problems of misjudgment and low efficiency of traditional detection systems, and achieves high accuracy and high efficiency hazardous goods detection.

CN119810745APending Publication Date: 2025-04-11BEIJING WUZI UNIVERSITY
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411874598.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-18
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

Traditional hazardous goods detection systems rely on manual experience and rules, resulting in misjudgment, misreport and false alarms, and operator fatigue and inattention will reduce detection accuracy and efficiency.

Method used

The hazardous goods detection method with optimized feature CBAM-YOLOv10 is adopted, and the dangerous objects in the X-ray image are automatically identified and classified by training the model, combined with the bidirectional feature pyramid network and the CBAM attention mechanism, a CBAM-YOLOv10 inspection model is generated, and a small target detection head is added to the neck part to optimize the detection of small target dangerous goods.

Benefits of technology

It significantly improves the accuracy and efficiency of dangerous goods security inspection, overcomes the limitations of operator fatigue and manual judgment, improves the detection performance of shading targets and small targets, and enhances the accuracy of dangerous goods detection and the security inspection efficiency of urban subway and intercity railways.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119810745A_ABST
    Figure CN119810745A_ABST
Patent Text Reader

Abstract

The invention discloses a dangerous article detection method and system for optimizing feature CBAM-YOLOv10, and relates to the technical field of dangerous article detection, and the method comprises the steps: obtaining a dangerous article X-ray image, and carrying out the preprocessing of the dangerous article X-ray image; a YOLOv10n network model is constructed in combination with bidirectional feature pyramid network optimization features, a backbone feature fusion part of YOLOv10n is improved by fusing a CBAM attention mechanism, and a CBAM-YOLOv10 inspection model is generated; a small target detection head is added to the check part of the inspection model, and the inspection model is optimized; and inputting the preprocessed X-ray image of the dangerous goods into the inspection model to complete the detection of the image of the dangerous goods. The method can focus on the most important characteristics of the dangerous goods, enhances the expression ability of the characteristics of the dangerous goods, improves the detection accuracy of the dangerous goods, and improves the security check efficiency of urban subways and interurban railways.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of dangerous goods detection, and more specifically to a dangerous goods detection method and system based on an optimized feature CBAM-YOLOv10. Background Art

[0002] Traditional dangerous goods detection systems mainly rely on rule-based and human experience-based technologies, such as X-ray imaging and manual judgment by operators. This method is not only labor-intensive, but security inspectors may also make misjudgments due to fatigue, lack of concentration or subjective lack of experience, especially during peak hours when security inspectors need to quickly process a large amount of luggage and items, which can easily lead to missed reports or false reports, which not only reduces the accuracy of detection, but also may increase traffic safety risks.

[0003] Therefore, proposing a dangerous goods detection method that optimizes the feature CBAM-YOLOv10 is an urgent problem that technicians in this field need to solve. Summary of the invention

[0004] In view of this, the present invention provides a dangerous goods detection method based on optimized feature CBAM-YOLOv10, which automatically identifies and classifies dangerous objects in security inspection X-ray images by training a model corresponding to dangerous goods. It can not only overcome the limitations of operator fatigue and manual judgment in traditional security inspection methods, but also significantly improve the accuracy and efficiency of dangerous goods security inspection.

[0005] In order to achieve the above object, the present invention adopts the following technical solution:

[0006] A method for detecting dangerous goods by optimizing the feature CBAM-YOLOv10, comprising:

[0007] Acquire an X-ray image of dangerous goods, and pre-process the X-ray image of dangerous goods;

[0008] The YOLOv10n network model is constructed by combining the bidirectional feature pyramid network optimization features, and the backbone feature fusion part of YOLOv10n is improved by integrating the CBAM attention mechanism to generate the CBAM-YOLOv10 test model.

[0009] Add a P2 small target detection head to the neck part of the CBAM-YOLOv10 inspection model to optimize small target dangerous goods detection in dangerous goods detection;

[0010] The pre-processed dangerous goods X-ray image is input into the inspection model to complete the detection of the dangerous goods image.

[0011] Specifically, the process of preprocessing the dangerous goods X-ray image includes:

[0012] Performing image scaling on the dangerous goods X-ray image;

[0013] Normalize the scaled image;

[0014] Adjust the normalized image channels.

[0015] Specifically, a bidirectional feature pyramid network is used to adjust the learning weights, perform weighted summation on feature images of different scales, and fuse the image features of feature images at different levels.

[0016] Specifically, the convolutional attention mechanism includes: a channel attention module and a spatial attention module; the output features of the channel attention module and the spatial attention module are multiplied element by element to obtain the final attention enhancement feature; the final attention enhancement feature is used as the input of the subsequent network layer to obtain the CBAM-YOLOv10 test model.

[0017] Specifically, the channel attention module is used to enhance the feature expression of each image channel, and the channel attention weight matrix formula used is as follows:

[0018]

[0019] Among them, AvgPool is average pooling, MaxPool is maximum pooling, Fcavg is the feature map of average pooling, Fcmax is the feature map of maximum pooling, W0∈RC / r×C, W1∈RC×C / r (where r represents the channel compression ratio, which is set to 4 in the example, and C is the number of channels), and σ is the sigmoid function.

[0020] Specifically, the spatial attention module is used to highlight the important areas of the feature image; the spatial attention module pays attention to the location of the information, and the formula is as follows:

[0021]

[0022] Among them, f 7×7 It uses a convolution operation with a step size of 7*7 to obtain a feature map of size H×W×1, σ is the sigmoid function, AvgPool is the average pooling, and MaxPool is the maximum pooling.

[0023] Specifically, a small target detection head P2 is added to the neck part of the CBAM-YOLOv10 detection model to optimize the detection model. The small target detection head is used to improve the detection performance of the CBAM-YOLOv10 detection model for small target dangerous goods.

[0024] Specifically, the present invention also provides a dangerous goods detection system with optimized feature CBAM-YOLOv10, including:

[0025] Image processing module: used to obtain X-ray images of dangerous goods and pre-process the X-ray images of dangerous goods;

[0026] Model building module: Combine the bidirectional feature pyramid network to optimize the features and build the YOLOv10n network model. Integrate the CBAM attention mechanism to improve the backbone feature fusion part of YOLOv10n and generate the CBAM-YOLOv10 test model.

[0027] Model optimization module: used to add a small target detection head to the neck part of the CBAM-YOLOv10 test model to optimize the test model;

[0028] Detection module: used to input the pre-processed dangerous goods X-ray image into the inspection model to complete the detection of dangerous goods images.

[0029] Through the above technical solutions, it can be known that compared with the prior art, the present invention discloses a method and system for detecting dangerous goods with optimized features of CBAM-YOLOv10, firstly scaling and normalizing the X-ray image data for preprocessing; combining the bidirectional feature pyramid network to optimize the features to improve the YOLOv10n network model, integrating the CBAM attention mechanism in the backbone feature fusion part of YOLOv10n, generating the CBAM-YOLOv10 inspection model; adding a small target detection head in the YOLOv10neck part to complete the detection of small target dangerous goods. By integrating the optimized extracted image adding feature fusion module and adding a small target feature module with the CBAM attention mechanism, the model can focus on the most important features for dangerous goods, enhance the expression ability of dangerous goods features, improve the detection performance of occluded targets and small targets in dangerous goods detection, improve the accuracy of dangerous goods detection, and improve the security inspection efficiency of urban subways and intercity railways.

[0030] The advantages of the present invention compared with the prior art are as follows:

[0031] 1. A bidirectional pyramid network integrating the CBAM attention mechanism is used to optimize the extraction of global and local features of the image to improve the backbone part, thereby increasing the detection rate of dangerous goods targets (especially occluded targets).

[0032] 2. Add a small target detection head to perform feature extraction in the shallower layer of the network with higher feature map resolution to achieve detection of small target dangerous goods.

[0033] 3. Add a bidirectional pyramid network to adjust the attention feature weight fusion module, optimize the dangerous goods target features, and improve the accuracy of dangerous goods target detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0035] Figure 1 The improved diagram of YOLOv10n network provided by the present invention;

[0036] Figure 2 A bidirectional feature extraction pyramid network diagram provided by the present invention;

[0037] Figure 3 A diagram of the convolutional attention mechanism provided by the present invention;

[0038] Figure 4 A diagram of the channel attention mechanism provided by the present invention;

[0039] Figure 5 Diagram of the spatial attention mechanism provided by the present invention. DETAILED DESCRIPTION

[0040] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0041] See also Figure 1 , the embodiment of the present invention discloses a dangerous goods detection method of optimizing the feature CBAM-YOLOv10, comprising:

[0042] Acquire an X-ray image of dangerous goods, and pre-process the X-ray image of dangerous goods;

[0043] The YOLOv10n network model is improved by combining the optimization features of the bidirectional feature pyramid network, and the CBAM attention mechanism is integrated into the backbone feature fusion part of YOLOv10n to generate the CBAM-YOLOv10 test model;

[0044] Add a small target detection head to the neck part of the CBAM-YOLOv10 test model to optimize the test model;

[0045] The pre-processed dangerous goods X-ray image is input into the inspection model to complete the detection of the dangerous goods image.

[0046] Preferably, the process of preprocessing the dangerous goods X-ray image includes:

[0047] Performing image scaling on the dangerous goods X-ray image;

[0048] Normalize the scaled image;

[0049] Adjust the normalized image channels.

[0050] Furthermore, YOLO requires that the input image size of dangerous goods be fixed, so the input image will first be scaled to adapt it to the input requirements of the network; a scaling operation without maintaining the aspect ratio is adopted, that is, it is directly scaled to a fixed size to ensure that the images processed by the model have the same input dimensions.

[0051] During normalization, the pixel values ​​of the input image are usually between [0, 255]; in YOLO, the pixel values ​​are normalized to between [0, 1], and excessively large value ranges are avoided to affect the training effect of the network, helping the network converge faster.

[0052] The process of image channel adjustment is that the image is input in RGB format, usually a three-dimensional matrix of size (H(height)t, W(width), C(channels)), which represents the height, width and number of channels of the image. Therefore, a three-channel convolution kernel is used to adjust the image channel of the normalized image.

[0053] Preferably, a bidirectional feature pyramid network is used to adjust the learning weights, perform weighted summation on feature images of different scales, and fuse the image features of feature images of different levels to obtain a feature map F.

[0054] Furthermore, the bidirectional feature pyramid network (BiFPN) in the embodiment of the present invention adopts a bidirectional connection mechanism, which can transmit features from top to bottom and from bottom to top, and can achieve more comprehensive multi-scale hazardous material feature fusion; this bidirectional fusion mechanism enables hazardous material feature maps at different levels to share more information, further improving the model's detection performance for hazardous material targets of different scales.

[0055] For details, see Figure 2First, the model extracts multiple levels of dangerous goods feature maps through the backbone network. These dangerous goods feature maps contain information of different scales (for example, low-resolution global features and high-resolution local details); after obtaining these feature maps F, the bidirectional feature pyramid network (BiFPN) first performs a downsampling, passing the high-level dangerous goods features to the low-level dangerous goods feature maps through a top-down path, forming a multi-scale dangerous goods feature representation (for example, P3, P4, P5, P6 and P7). In this way, the multi-scale dangerous goods information can be fully integrated; then, the bidirectional feature pyramid network (BiFPN) performs upsampling through a bottom-up path, starting from the highest level of dangerous goods feature maps (such as P7), and gradually feeds back the low-level dangerous goods features to the high-level dangerous goods feature maps; each layer of the dangerous goods feature map will be fused with the dangerous goods feature map of the previous layer, so as to pass the low-level dangerous goods detail information to the high-level dangerous goods feature map, enriching the expression of high-level dangerous goods features.

[0056] In the process of bidirectional transmission, the feature map of dangerous goods at each scale will be fused with the feature maps of dangerous goods in the adjacent upper and lower layers. In the feature fusion process of the Bidirectional Feature Pyramid Network (BiFPN), a learnable weight is assigned to each input feature map, so that the network can learn and adjust the importance of each input feature to achieve more accurate dangerous goods feature fusion; at the same time, this fusion process is weighted, that is, the weighted summation of dangerous goods feature maps of different scales is performed through learnable weights, so that the network can automatically adjust the contribution of each dangerous goods feature map in feature fusion.

[0057] Among them, a fast normalized fusion method is adopted for the weighted method, as shown in the following formula.

[0058]

[0059] Among them, ò=0.0001, w i is the weight corresponding to the weights of different feature maps in the bidirectional feature pyramid network (i=1, 2, 3...), exponential function The weight w i Converted to positive value, w i >=0 is ensured by parameter linear rectification function (Relu function), ò=0.0001 is used to ensure numerical stability, and fast normalization fusion can maintain the validity of feature information without increasing the computational complexity of the model too much. It has small computational complexity and fast speed, and can meet the real-time requirements of dangerous goods detection.

[0060] Preferably, see Figure 3The convolutional attention mechanism includes: a channel attention module and a spatial attention module; the output features of the channel attention module and the spatial attention module are multiplied element by element to obtain a final attention-enhanced feature vector; the final attention-enhanced feature vector can suppress noise and irrelevant information while retaining the key information of dangerous goods, and the feature is used as the input of the subsequent network layer to obtain the CBAM-YOLOv10 inspection model.

[0061] The channel attention module in the embodiment of the present invention is used to enhance the feature expression of each image channel, input the feature map F, perform global maximum pooling MaxPool and global average pooling AvgPool on the feature map F, and obtain R C×1×1 Two vectors of , where C represents the number of channels and R represents the channel dimension;

[0062] The two fully connected vectors are added through the weight-sharing multi-layer perception layer MLP, and the channel attention mechanism vector M is obtained through the Sigmoid activation function. C ;

[0063] The channel attention module is used to enhance the feature expression of each image channel, and the channel attention weight matrix formula used is as follows:

[0064]

[0065] Among them, AvgPool is average pooling, MaxPool is maximum pooling, Fcavg is the feature map of average pooling, Fcmax is the feature map of maximum pooling, W0∈RC / r×C, W1∈RC×C / r (where r represents the channel compression ratio, which is set to 4 in the example, R represents the channel dimension, and C represents the number of channels), and σ is the sigmoid function.

[0066] Further, the attention module flow chart in the embodiment of the present invention is specifically referred to Figure 4 The goal of the channel attention module is to enhance the feature expression of each channel. For the input feature map, firstly, global maximum pooling and global average pooling operations are performed on each channel to calculate the maximum eigenvalue and average eigenvalue on each channel; two vectors containing the number of channels are generated, which represent the global maximum feature and average feature of each channel respectively, and the feature vectors after global maximum pooling and average pooling are input into a shared fully connected layer. This fully connected layer is used to learn the attention weight of each channel. Through learning, the network can adaptively decide which channels are more important for the current task, and finally obtain the channel attention mechanism vector.

[0067] Preferably, the spatial attention module is used to highlight the important areas of the feature image; the spatial attention module pays attention to the location of the information, and the input feature map F at this moment is subjected to the global maximum pooling MaxPool and the global average pooling AvgPool in the channel dimension to obtain the maximum pooling feature map F of the two feature maps with the same feature map F and the number of channels being 1. s max And the global average pooling feature map F s avg , merge the two feature maps, and then use a 7*7 convolution kernel for convolution operation, and obtain the spatial attention vector Ms through the Sigmoid activation function; the public is as follows:

[0068]

[0069] Among them, f 7×7 It uses a convolution operation with a step size of 7*7 to obtain a feature map of size H×W×1, σ is the sigmoid function, AvgPool is the average pooling, and MaxPool is the maximum pooling.

[0070] Further, the attention module flow chart in the embodiment of the present invention is specifically referred to Figure 5 ; The goal of the spatial attention module is to emphasize the importance of different positions in the image. For the input feature map, maximum pooling and average pooling operations are performed along the channel dimension to generate features of different context scales; the features after maximum pooling and average pooling are connected (concatenated) along the channel dimension to obtain a feature map with context information of different scales; similar to the channel attention module, the Sigmoid activation function is applied to the generated spatial attention weights to limit the weights between 0 and 1; the obtained spatial attention weights are applied to the original feature map, the features of each spatial position are weighted, and the spatial attention vector is obtained.

[0071] Preferably, a small target detection head P2 is added to the neck part of the CBAM-YOLOv10 detection model to optimize the detection model, and the small target detection head is used to improve the detection performance of the CBAM-YOLOv10 detection model.

[0072] In the security inspection process of the embodiment of the present invention, the detection of small dangerous goods (such as blades, lighters, nails, etc.) is a very challenging task; these items are usually small in size and their features are difficult to capture. In order to meet this challenge, additional small target detection heads are added to facilitate the extraction of small target features.

[0073] Furthermore, in the process of feature fusion, multi-scale feature maps (such as P3, P4, and P5) are usually used for target detection; these feature maps correspond to image layers of different resolutions, with the P3 layer being shallower and the P5 layer being deeper; although the feature maps of the three levels of P3, P4, and P5 can handle small to large-scale targets well, they come from deeper network levels and have relatively low resolutions, and the detailed information of tiny targets is not sufficiently retained, resulting in difficulty in detecting small targets. Object ghosting and occlusion may exist in X-ray images, which will make some originally small targets more difficult to detect. By adding a small target detection head P2, the small target hazardous goods detection performance of the model can be effectively improved, especially the detection capability for controlled small targets.

[0074] Preferably, the dangerous goods detection process and specific parameter settings in the embodiment of the present invention are as follows:

[0075] The experiment will detect dangerous goods through training models. In order to ensure the stability of training results and the repeatability of experiments, the parameters are set as follows:

[0076] The batch size is set to 16, the training epochs is 100, the learning rate is 0.01, the input image size is 640×640, the optimizer is SGD, and the rest of the parameters are the YOLOv10 default values.

[0077] The dataset uses OPIXray public datasets to conduct small target and occluded target detection experiments, with 5008 images in the train set and 1778 images in the val validation set. The experimental results show that the feature-optimized CBAM-YOLOv10 model is better than the original YOLOv10 model in detecting occluded target dangerous goods and small dangerous goods. In actual detection, it can accurately detect dangerous goods and is easy to deploy, which has certain practical value.

[0078] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0079] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A dangerous goods detection method based on optimized feature CBAM-YOLOv10, characterized in that: include: Acquire an X-ray image of dangerous goods, and pre-process the X-ray image of dangerous goods; The YOLOv10n network model is constructed by combining the bidirectional feature pyramid network optimization features, and the backbone feature fusion part of YOLOv10n is improved by integrating the CBAM attention mechanism to generate the CBAM-YOLOv10 test model. Add a small target detection head to the neck part of the CBAM-YOLOv10 test model to optimize the test model; The pre-processed dangerous goods X-ray image is input into the inspection model to complete the detection of the dangerous goods image.

2. The method for detecting dangerous goods by optimizing the feature CBAM-YOLOv10 according to claim 1, characterized in that: The process of preprocessing the dangerous goods X-ray image includes: Performing image scaling on the dangerous goods X-ray image; Normalize the scaled image; Adjust the normalized image channels.

3. The method for detecting dangerous goods according to claim 1, wherein: The bidirectional feature pyramid network is used to adjust the learning weights, perform weighted summation on feature images of different scales, and fuse the image features of feature images at different levels.

4. The method for detecting dangerous goods by optimizing the feature CBAM-YOLOv10 according to claim 1, characterized in that: The convolutional attention mechanism includes: a channel attention module and a spatial attention module; the output features of the channel attention module and the spatial attention module are multiplied element by element to obtain the final attention enhancement feature; the final attention enhancement feature is used as the input of the subsequent network layer to obtain the CBAM-YOLOv10 test model.

5. The method for detecting dangerous goods according to claim 4, characterized in that: The channel attention module is used to enhance the feature expression of each image channel, and the channel attention weight matrix formula used is as follows: Among them, AvgPool is the average pooling, MaxPool is the maximum pooling, and F c avg is the feature map of average pooling, F c max is the feature map of the maximum pooling, W0∈R C / r×C , W1∈R C×C / r Wherein, r represents the channel compression ratio, which is set to 4 in the embodiment, and σ is the sigmoid function.

6. The method for detecting dangerous goods by optimizing the feature CBAM-YOLOv10 according to claim 4, characterized in that: The spatial attention module is used to highlight the important areas of the feature image; the spatial attention module pays attention to the location of the information, and the formula is as follows: Among them, f 7×7 It uses a convolution operation with a step size of 7*7 to obtain a feature map of size H×W×1, σ is the sigmoid function, AvgPool is the average pooling, and MaxPool is the maximum pooling.

7. The method for detecting dangerous goods by optimizing the feature CBAM-YOLOv10 according to claim 1, characterized in that: A small target detection head P2 is added to the neck part of the CBAM-YOLOv10 detection model to optimize the detection model. The small target detection head is used to improve the small dangerous target detection performance of the CBAM-YOLOv10 detection model.

8. A dangerous goods detection system with optimized feature CBAM-YOLOv10, characterized in that: include: Image processing module: used to obtain X-ray images of dangerous goods and pre-process the X-ray images of dangerous goods; Model building module: Combine the bidirectional feature pyramid network to optimize the features and build the YOLOv10n network model. Integrate the CBAM attention mechanism to improve the backbone feature fusion part of YOLOv10n and generate the CBAM-YOLOv10 test model. Model optimization module: used to add a small target detection head to the neck part of the CBAM-YOLOv10 test model to optimize the test model; Detection module: used to input the pre-processed dangerous goods X-ray image into the inspection model to complete the detection of dangerous goods images.

Citation Information

Cited By

  • Visual identification method and device for mixed placement of articles in hazardous chemical substance storehouse

    CN121170433A