An x-ray dangerous article detection and identification method based on GYOLOv5

By improving the YOLOv5 network model and combining multi-channel fusion convolutional blocks and skip connection structures, the problems of low accuracy and missed detection in X-ray hazardous material detection under complex backgrounds were solved, achieving efficient and accurate hazardous material identification.

CN115641469BActive Publication Date: 2026-02-06TAIYUAN UNIVERSITY OF TECHNOLOGY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211261135.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-14
Publication Date
2026-02-06
Estimated Expiration
2042-10-14

AI Technical Summary

Technical Problem

Existing X-ray hazardous material detection suffers from low accuracy, missed detections, and false detections in complex backgrounds, especially the insufficient detection capability of deep learning-based target detection algorithms in complex backgrounds.

Method used

A GYOLOv5-based method for detecting hazardous materials under X-ray imaging is adopted. By increasing the network depth, using multi-channel fused convolutional blocks and skip connection structures, the YOLOv5 network model is improved, enhancing the representation of global information and edge features of hazardous materials under X-ray imaging, thereby improving the detection accuracy.

Benefits of technology

It effectively improved the accuracy and recall rate of X-ray hazardous material detection, achieved efficient and accurate hazardous material identification, reduced the waste of computing resources, and improved the overall performance of the detection model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115641469B_ABST
    Figure CN115641469B_ABST
Patent Text Reader

Abstract

The application provides an X-ray dangerous article detection and recognition method based on GYOLOv5, and belongs to the technical field of target detection; solves the problems of low detection accuracy, missed detection, false detection and the like of the existing X-ray dangerous article detection under a complex background; comprises the following steps: using artificially labeled X-ray dangerous article image data as original data for pretreatment; designing network model parameters; deepening the network depth, replacing larger convolution kernels in the backbone with several continuous 3*3 convolution kernels in the backbone layer; improving the constructed basic YOLOv5 network, changing the convolution operation of the network upsampling layer and the network downsampling layer, and replacing the traditional convolution structure with a multi-channel fusion convolution block; using a feature fusion scheme of a part of low-level and high-level features to re-learn the features; adjusting the network parameters, generating and saving a trained dangerous article detection model, inputting data into the trained detection model, and outputting a detection result; and the application is applied to X-ray dangerous article detection.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application provides an X-ray dangerous article detection and identification method based on GYOLOv5, and belongs to the technical field of target detection. BACKGROUND

[0002] The non-contact security inspection equipment of the X-ray security inspection technology is the most widely used tool, and is widely used in the logistics field, transportation hubs and some densely populated public places. Precise control article automatic detection technology is a main research direction in the security inspection field. Since the types of articles to be detected are various, and the placement position may be blocked, the detection personnel are required to have high skills, and since the inspection process is monotonous and boring, human fatigue is easy to occur, and misjudgment and missed detection may occur, which has great safety hazards. The target detection algorithm is mainly divided into a traditional target detection algorithm and a target detection algorithm based on deep learning. The traditional method has poor generalization ability and robustness; the deep learning method has good detection effect at present, such as the Faster R-CNN, YOLO v3, YOLO v4, YOLO v5 and other target detection networks, has good generalization ability, and is the main direction of research on target detection, but the detection ability of dangerous articles in a complex background is still insufficient, effective information is easy to be ignored, and the detection precision needs to be improved. SUMMARY

[0003] The application provides an X-ray dangerous article detection and identification method based on GYOLOv5, and belongs to the technical field of target detection.

[0004] In order to solve the above technical problems, the technical scheme adopted by the application is as follows: an X-ray dangerous article detection and identification method based on GYOLOv5, comprising the following steps:

[0005] Step S1: using the artificially labeled X-ray dangerous article image data as the original data for preprocessing, obtaining the preprocessed picture, and dividing the data set into a training set and a test set;

[0006] Step S2: designing network model parameters: in the configuration file yaml of the YOLOv5 network model, according to the size of the computer memory and the size of the display memory, the required identification effect and the training speed of the user, the size of the convolutional neural network input image, the number of identification types and the iteration number are set; and the user needs to use a graphics card type supporting CUDA acceleration;

[0007] Step S3: deepening the network depth, using 15 continuous 3*3 convolution kernels instead of the 32*32 convolution kernel in the backbone in the backbone layer of the network;

[0008] Step S4: improving the constructed basic YOLOv5 network, changing the convolution operation of the up-sampling and down-sampling layers of the network, and using a multi-channel fusion convolution block to replace the traditional convolution structure;

[0009] wherein the multi-channel fusion convolution block separates the feature map into three branches S1, S2 and S3, branches S1 and S2 keep the feature map and the number of channels unchanged, and branch S3 is subjected to convolution; then, the feature map subjected to the convolution operation is fused with the feature maps of branches S1 and S2; finally, a multi-channel fusion operation is adopted to exchange information between the channels of the feature map, and the obtained feature map is the same size as the upper layer feature map, and the obtained feature map is subjected to channel separation, branch convolution, channel splicing and fusion operation again;

[0010] Step S5: using a jump connection to fuse the features of the low-level and high-level features of the Focus structure to re-learn the features;

[0011] Step S6: defining the hyperparameters of the detection model, training the data set processed by S1 to obtain the loss value of the loss function and the detection result;

[0012] Step S7: adjusting the network parameters according to the result, generating and saving the trained dangerous goods detection model, inputting the test set data into the trained dangerous goods detection model, detecting the X-ray security inspection image, and outputting the detection result.

[0013] Preferably, the data set of step S1 is the Aliyun Tianchi dangerous goods data set, and there are five different categories of dangerous goods in the data set: scissors, knives, batteries and power supplies, iron shell lighters, and black nail lighters. There are a total of 8000 images in the data set, including 3000 images containing dangerous goods. When testing the effectiveness of the network model, the images containing dangerous goods are used for testing.

[0014] Preferably, the preprocessing of step S1 is to splice the data in a random scaling, random cropping and random arrangement manner, and then process and expand the data set through adaptive anchor frame calculation and adaptive picture scaling.

[0015] Preferably, the network model parameters of step S2 are: when the image size of the input network is 608*608, the batch parameter is 30, the iteration number epoch is 1000, and the number of detected objects is 5, the user uses three GPU to train the model, and at least 24GB of video memory is required; when the image size of the input network is 640*640, the batch parameter is 30, the iteration number epoch is 1000, and the number of detected objects is 5, the user uses three GPU to train the model, and at least 30GB of video memory is required.

[0016] Preferably, the multi-channel fusion convolution block in step S4 is used to extract high-level and low-level feature information of the image, and the multi-channel fusion convolution block comprises two convolution layers, a batch normalization layer and a rectified linear unit (ReLU). The feature map extracted by the convolution block comprises three paths. The first path is connected to a CBAM attention mechanism to extract features of the feature map and transmit the feature map to the next convolution block. The second path is connected to a Transformer attention mechanism to extract features of the feature map and transmit the feature map to the next convolution block. The third path enters a skip connection path.

[0017] Preferably, the feature fusion scheme using skip connection to combine low-level and high-level features in step S5 is as follows: the third path of the multi-channel fusion convolution block is spliced with the feature map of the network neck layer UpSample module in the channel dimension to generate a feature map containing local and high-level global context information.

[0018] The present application has the following beneficial effects compared with the prior art: based on deep learning technology, the present application proposes an X-ray security inspection image detection model combining a multi-channel fusion convolution block, a deep network and a skip connection network structure, which effectively enhances the expression of global information and edge features of X-ray dangerous goods, performs adaptive feature refinement on the input image, improves the detection accuracy of dangerous goods, and has higher detection accuracy and better overall performance compared with the current deep learning method. BRIEF DESCRIPTION OF DRAWINGS

[0019] The present application will be further described below with reference to the accompanying drawings.

[0020] Fig. 1 is a flowchart of the dangerous goods detection method based on the GYOLOv5 network according to an embodiment of the present application.

[0021] Fig. 2 is a structural schematic diagram of the multi-channel fusion convolution block in the up-sampling stage.

[0022] Fig. 3 is a network structure schematic diagram of the dangerous goods detection method based on the GYOLOv5 network according to an embodiment of the present application. DETAILED DESCRIPTION

[0023] As shown in Figs. 1 to 3 , with reference to Fig. 1 , the present application proposes a dangerous goods detection method based on GYOLOv5, which is specifically performed according to the following steps:

[0024] Step S1: using artificially labeled X-ray dangerous goods image data as original data for preprocessing to obtain preprocessed pictures, and dividing the data set into a training set and a test set;

[0025] Step S2: design network model parameters: in the configuration file yaml of the YOLOv5 network model, according to the size of the computer memory, the size of the video memory, the recognition effect and the training speed required by the user, the size of the convolutional neural network input image, the number of recognition categories, the number of iterations are set; and the user needs to use a video card type that supports CUDA acceleration;

[0026] Step S3: deepen the network depth, replace the 32*32 convolution kernel in the backbone with 15 consecutive 3*3 convolution kernels in the backbone layer of the network;

[0027] Step S4: improve the constructed basic YOLOv5 network, change the convolution operation of the up and down sampling layers of the network, and use a multi-channel fusion convolution block to replace the traditional convolution structure;

[0028] The multi-channel fusion convolution block separates the feature map into three branches S1, S2 and S3, branches S1 and S2 keep the feature map and the number of channels unchanged, and branch S3 is convolved; then, the feature map after convolution operation and the feature map of branch S1 and branch S2 are fused; finally, the multi-channel fusion operation is adopted to exchange the information between the channels of the feature map, and the obtained feature map is the same size as the upper layer feature map, and the obtained feature map is subjected to channel separation, branch convolution, channel splicing and fusion operation again;

[0029] Step S5: use the feature fusion scheme of skip connection part low-level and high-level features to re-learn the features;

[0030] Step S6: define the hyperparameters of the detection model, train the data set processed by S1, and obtain the loss value of the loss function and the detection result;

[0031] Step S7: adjust the network parameters according to the result, generate and save the trained dangerous goods detection model, input the test set data into the trained dangerous goods detection model, detect the X-ray security inspection image, and output the detection result.

[0032] The improved network part of the present application will be introduced in turn as follows.

[0033] Multi-channel fusion convolution block: in the current mainstream detection model, many networks use high-level channel convolution to extract deep abstract features of images to obtain better detection results. However, a large number of convolution layers will increase the calculation amount of the model, and the increase of the number of channels will cause the parameter amount to be too large. Therefore, the present application proposes a new multi-channel fusion convolution block, the structure of which is as follows Fig. 2As shown. The module is divided into three branches S1, S2 and S3 after the feature map is separated, branches S1 and S2 keep the feature map unchanged with the channel number, and branch S3 is subjected to convolution; then, the feature map subjected to the convolution operation is fused with the feature maps of branches S1 and S2; finally, a multi-channel fusion operation is adopted to exchange information between the channels of the feature map, and the obtained feature map is the same size as the upper layer feature map. The obtained feature map is subjected to channel separation, branch convolution, channel splicing and fusion operation again; then, the feature map subjected to the convolution operation is fused with the feature maps of branches S1 and S2; finally, a channel fusion operation is adopted to exchange information between the channels of the feature map, and the information interaction between different groups of feature maps is enhanced. At this time, the obtained feature map is the same size as the upper layer feature map, and the obtained feature map is subjected to channel separation, branch convolution, channel splicing and fusion operation again. The channel fusion and channel spilt operation not only can effectively reduce the calculation amount in the convolution process, but also can increase the information interaction between different channels, effectively extract the local feature information of the dangerous goods, and prevent the waste of calculation resources caused by feature redundancy.

[0034] Deepening network depth: replace the larger convolution kernel in the backbone with several 3x3 convolution kernels in succession. For a given receptive field (local size of the input picture related to the output), using stacked small convolution kernels is better than using large convolution kernels, because multiple nonlinear layers can increase the network depth to ensure learning more complex patterns, and the cost is relatively small (fewer parameters). The main purpose of this is to increase the depth of the network under the condition of ensuring the same receptive field, to a certain extent, to improve the effect of the neural network. For example, the layer-by-layer stacking of three 3x3 convolution kernels with a step of 1 can be regarded as a receptive field of 7, and the total number of parameters is 3x(9xC 2 ), if a 7x7 convolution kernel is used directly, the total number of parameters is 49xC 2 , where C refers to the number of input and output channels. Moreover, the 3x3 convolution kernel is conducive to better maintaining the image properties.

[0035] The X-ray dangerous goods detection and identification method provided by the present application combines the X-ray security inspection image detection model of the multi-channel fusion convolution block, deepening network depth and skip connection network structure, effectively enhances the expression of global information and edge features of X-ray dangerous goods, performs adaptive feature fusion and refinement on the input image, improves the detection accuracy of dangerous goods, establishes an efficient and high-accuracy X-ray dangerous goods detection model, and realizes real-time and effective detection and identification of dangerous goods. Through ablation experiments on the X-ray security inspection image dataset, GYOLOv5 can achieve better results in precision, recall and mAP evaluation indicators compared with the current mainstream network.

[0036] It should be noted that the connection relationship between the components and modules of the present application is determined and can be realized. Except for the special description in the embodiments, the specific connection relationship can bring about the corresponding technical effects, and based on the premise of not relying on the corresponding software program execution, the technical problems proposed by the present application are solved. The model of the components, modules, specific elements, the connection mode between them, and the conventional use method and the expected technical effects brought by the above technical features, except for the specific description, all belong to the public content that can be obtained by the prior art before the application date, such as patents, journal papers, technical manuals, technical dictionaries, textbooks, and other existing technologies, which do not need to be described in detail. The technical solutions provided in the present application are clear, complete, and realizable, and the corresponding physical products can be reproduced or obtained according to the technical means.

[0037] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A GYOLOv5-based X-ray dangerous article detection and identification method, characterized in that: Comprise the following steps: Step S1: using artificial labeled X-ray dangerous goods image data as raw data for preprocessing, obtaining a data set, and dividing the data set into a training set and a test set; Step S2: build a basic YOLOv5 network model and configure network model parameters; Step S3: deepen the network depth, replace the convolution kernel in the backbone with multiple consecutive 3x3 convolution kernels in the backbone layer of the basic YOLOv5 network; Step S4: improve the basic YOLOv5 network constructed, change the convolution operation of the network upsampling layer and downsampling layer, and use a multi-channel fusion convolution block to replace the traditional convolution structure; Wherein the multi-channel fusion convolution block separates the feature map into three branches S1, S2 and S3 after separation, branches S1 and S2 keep the feature map and the number of channels unchanged, and branch S3 is convolved; then, the feature map after convolution operation and the feature map of branch S1 and branch S2 are fused; finally, a multi-channel fusion operation is adopted to exchange information between each channel of the feature map, and the obtained feature map is the same size as the upper layer feature map, and the obtained feature map is separated again, branch convolution, channel splicing and fusion operation; The multi-channel fusion convolution block of step S4 is used to extract high-level and low-level feature information of the image, and the multi-channel fusion convolution block includes 2 convolution layers, a batch normalization layer and a rectified linear unit ReLU, the feature map extracted by the multi-channel fusion convolution block includes three branches S1, S2 and S3, branch S1 connects the CBAM attention mechanism to extract features from the feature map and pass it to the next convolution block; branch S2 connects the Transformer attention mechanism to extract features from the feature map and pass it to the next convolution block; branch S3 enters the skip connection path; Step S5: using a feature fusion scheme of skip connection low-level and high-level features, relearning the features; Step S6: define the hyperparameters of the detection model, train the data set processed in step S1 to obtain the loss value of the loss function and the detection result; Step S7: adjust the network parameters according to the detection result, generate and save the trained dangerous goods detection model, input the test set data into the trained dangerous goods detection model, and detect the X-ray security inspection image to output the detection result.

2. The GYOLOv5-based X-ray dangerous article detection and identification method according to claim 1, characterized in that: The data set in step S1 uses the Aliyun Tianchi dangerous goods data set, which includes 5 different categories of dangerous goods: scissors, knives, batteries and power supplies, iron shell lighters, and black pin lighters.

3. The GYOLOv5-based X-ray dangerous article detection and identification method according to claim 1, characterized in that: The preprocessing of step S1 is to splice the data by random scaling, random cropping and random arrangement, and then process and expand the data set by adaptive anchor box calculation and adaptive picture scaling.

4. The GYOLOv5-based X-ray dangerous article detection and identification method according to claim 1, characterized in that: The network model parameters in step S2 are set by the size of the computer memory and video memory, the required recognition effect and training speed of the user in the configuration file of the YOLOv5 network model, the size of the convolutional neural network input image, the number of recognition categories, and the iteration number; and the user needs to use a graphics card type that supports CUDA acceleration.

5. The GYOLOv5-based X-ray dangerous article detection and identification method according to claim 4, characterized in that: The network model parameters in the step S2 are specifically: when the image size of the input network is 608*608, the batch parameter is 30, the iteration number epoch is 1000, and the detected object category is 5, the user needs to use three GPUs to train the model, and at least 24 GB of video memory is required; When the image size of the input network is 640*640, the batch parameter is 30, the iteration number epoch is 1000, and the detected object category is 5, the user needs to use three GPUs to train the model, and at least 30 GB of video memory is required.

6. The GYOLOv5-based X-ray dangerous article detection and identification method according to claim 1, characterized in that: The feature fusion scheme of using the skip connection to fuse the low-level and high-level features of the Focus structure in the step S5: the third path of the multi-channel fusion convolution block is spliced with the feature map of the network Neck layer convolution block in the channel dimension to generate a feature map containing local and high-level global context information.

Citation Information

Patent Citations

  • X-ray security inspection article identification method and system based on hyper-parameter residual convolution and clustering fusion

    CN114926785A

  • Improved yolov5-based mask face detection method

    CN115171183A