X-ray security inspection method based on improved FCOS network
Through the improved FCOS network, combined with edge guidance and foreground-background separation modules, the problems of complex background and multi-object occlusion in X-ray security image detection are solved, achieving higher detection accuracy and efficiency, and is suitable for a variety of scenarios and tasks.
Patent Information
- Application Number
- CN202410096916.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-24
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2044-01-24
AI Technical Summary
Existing deep learning-based X-ray security image detection methods have low detection accuracy when faced with complex backgrounds and multi-scale occlusions, are prone to missed detections and false detections, and are difficult to effectively identify contraband.
An improved FCOS network is adopted, combined with the edge guidance module, foreground-background separation module and attention module. The edge features are extracted by the Sobel operator, the foreground and background are separated by the U-Net network, and the foreground features are recorded and fused to improve the detection accuracy.
It improves the accuracy and efficiency of X-ray image detection, reduces the missed detection rate, enhances the network's perception of the objects to be detected, adapts to different scenarios and tasks, and has higher detection accuracy.
Smart Images

Figure CN117911380B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of X-ray contraband detection, and in particular to an X-ray security inspection method based on an improved FCOS network. Background Art
[0002] X-ray security inspection technology has been widely used for security checks in public transportation, logistics, and express delivery industries. It uses X-rays to illuminate items such as packages and then generates security images based on the differences in X-ray absorption rates of different items. However, most security inspections are currently performed manually, which is susceptible to various unstable factors. This is not only inefficient but also prone to missing or misdetecting prohibited items. This demonstrates the practical application of deep learning-based X-ray security image detection methods. However, X-ray security image formation can be severely interfered with by issues such as stacked objects, cluttered backgrounds, and the multi-scale nature of prohibited items. Therefore, overcoming these interferences has become a key and challenging aspect of X-ray security inspection.
[0003] Traditional detection algorithms are generally easy to implement and can effectively detect security inspection images with a simple background. However, for security inspection images with complex backgrounds and severe occlusion, traditional detection algorithms often miss or misdetect items, resulting in low detection accuracy. Therefore, deep learning, which has rapidly developed in recent years, is of great research value in improving security inspection accuracy. Existing deep learning-based X-ray security inspection image detection methods mainly use two-stage detection algorithms or single-stage detection algorithms. These detection methods first collect X-ray security inspection images of luggage and parcels, then manually annotate the collected images with item labels. The X-ray security inspection images and label files are packaged to form a security inspection dataset. The next step is to divide the dataset into training and test sets. The training set is input into the network to train the detection model, and the test set is used to verify the network's detection performance. The problem is that these deep learning-based detection algorithms were originally designed for the detection of visible spectrum images. Since the imaging principle of X-ray security images is different from that of visible spectrum images, they usually have problems such as high noise, blurred edges, complex backgrounds, and stacked objects. These problems will strongly interfere with the detection algorithm, and the detection network cannot accurately learn the characteristics of the objects, resulting in low detection accuracy.
[0004] Therefore, starting from solving the problems existing in the existing X-ray security image detection, a new deep recognition network for contraband security inspection is designed. Summary of the Invention
[0005] The present invention mainly addresses the problem that the existing technology has low detection accuracy for X-ray images of multi-object stacking. It proposes an X-ray security inspection detection method based on an improved FCOS network, which can achieve fast and accurate detection of X-ray images, reduce working costs, improve detection efficiency and detection accuracy of intelligent security inspection systems.
[0006] In order to achieve the above-mentioned purpose, the technical solution provided by the present invention is: an X-ray security inspection detection method based on an improved FCOS network, which realizes the accurate detection of contraband in X-ray security inspection based on the improved FCOS network. The improvement of the FCOS network lies in the addition of an edge guidance module, a foreground-background separation module and an attention module. The edge guidance module calculates the edge features of the target to be detected in the X-ray image through the Sobel operator, which is used to improve the recognition sensitivity of the FCOS network for the target to be detected; the foreground-background separation module separates the foreground and background in the X-ray image by receiving the edge features extracted by the edge guidance module, reduces the aliasing interference of the background in the X-ray image and improves the recognition ability of the FCOS network for contraband; the attention module is used to record the foreground features extracted by the foreground-background separation module after multiple rounds of iterative training, and fuses the recorded foreground features to obtain an attention activation map. The detection accuracy of the FCOS network is improved by weighting the attention activation map.
[0007] The specific implementation of the X-ray security inspection method includes:
[0008] Collect X-ray images of the objects to be inspected on the conveyor belt;
[0009] The trained improved FCOS network is used to process X-ray images as follows:
[0010] Input the X-ray image into the edge guidance module to obtain the edge feature map E, fuse the X-ray image with the edge feature map E and extract features to obtain the edge weighted map C;
[0011] The foreground-background separation module separates the foreground and background of the edge weighted map C to obtain the separated foreground and background maps. The foreground map is feature extracted to obtain the foreground attention activation map I. The edge weighted map C is dot-multiplied with the foreground attention activation map I to obtain the foreground weighted fused edge feature E′.
[0012] The attention module records the edge features E′ after foreground weighted fusion, and fuses all edge features recorded in the attention module to obtain the attention feature M;
[0013] The attention feature M is input into the feature extraction backbone network of the improved FCOS network to obtain the backbone feature G, which is then input into the prediction module of the improved FCOS network for target positioning and classification, and finally the detection information is output and marked in the X-ray image.
[0014] Furthermore, collecting X-ray images includes the following operations:
[0015] The object to be inspected is placed on a tray. When the tray is transported to the inspection area by a conveyor belt, the multi-view X-ray instrument scans the object to be inspected by emitting an X-ray beam. The X-ray beam passes through the object to be inspected and reaches the receiver, where an X-ray image of the object to be inspected is rendered by a computer program.
[0016] Furthermore, the improved FCOS network includes:
[0017] An edge guidance module, which is divided into an edge extraction module for calculating the edge of a target in an image and an edge attention guidance module for calculating edge attention based on the target edge;
[0018] The foreground-background separation module consists of a U-Net network for encoding and decoding the foreground-background separation, a pixel selection iterator for optimizing foreground acquisition, and a foreground attention activation module for calculating foreground attention based on the extracted foreground.
[0019] Attention module, consisting of convolutional layer and Sigmoid activation layer;
[0020] Feature extraction backbone network, consisting of 5 computational layers and a residual structure;
[0021] The prediction module consists of four linear convolutional layers, a ReLU activation function, and Group Normalization. The use of Group Normalization can effectively increase the robustness of the network.
[0022] Furthermore, the edge extraction module extracts edge feature maps from the input X-ray image using the Sobel operator. The Sobel operator extraction process is as follows:
[0023] E h =f[x, y]*s h [x, y]
[0024] E v =f[x, y]*s v [x, y]
[0025]
[0026] Where f[x, y] is the data of the X-ray image in the (x, y) region, x represents the horizontal coordinate of the X-ray image, y represents the vertical coordinate of the X-ray image, and s h [x, y] is the convolution kernel in the horizontal direction, s v [x, y] is the convolution kernel in the vertical direction, E h is the edge image in the horizontal direction, E v is the edge image in the vertical direction, and E is the edge feature map;
[0027] The edge attention guiding module is composed of multiple convolution layers, batch normalization layers and nonlinear activation layers, takes the edge feature map E output by the edge extraction module as input, and finally obtains an edge weighting graph C through calculation, and the calculation process is as follows:
[0028] C=ReLU(w e ·E+b e )+E
[0029] In the formula, w e represents a convolution kernel, b e represents an offset distance, and ReLU represents a nonlinear activation. The edge weighting graph C improves the identification sensitivity of the FCOS network to contraband.
[0030] Further, the foreground-background separation module is provided with a U-Net network, and after obtaining the edge weighting graph, the U-Net network inputs the edge weighting graph and outputs a foreground graph containing the target to be detected and a background graph not containing the target to be detected after processing;
[0031] The pixel selection iterator is used to obtain the foreground in an iterative manner during the training process. In each training iteration, the U-Net network outputs a foreground graph and a background graph. First, all pixels outside the bounding box are set to 1, and a selection threshold is set in advance as a judgment condition for pixel selection. Then, a selection factor is set, which is between 0 and 1, and is used to control how much of the predicted foreground of the last iteration is used as the comparison interval of this iteration, i.e. the part of the predicted foreground that accounts for more than the selection factor is used for comparison. These parts greater than the selection factor are used as the comparison interval. If the absolute value loss function L1-loss of the predicted foreground in the comparison interval in this iteration and the corresponding region of the X-ray image is less than the selection threshold, the corresponding pixels in the bounding box of the predicted foreground in this iteration are selected as the target, otherwise the corresponding pixels in the predicted foreground of the last iteration are selected. The iterative prediction process is represented by a mathematical formula as follows:
[0032] D oc =|F ko -F kc |
[0033]
[0034] In the formula, F ko represents the pixel value of the comparison interval in the X-ray image, F kc represents the pixel value of the comparison interval in the current iteration predicted foreground, D oc represents the discrimination between F ko and F kc , F c represents the foreground predicted in this iteration, and B c represents the background predicted in this iteration, and Fl represents the outlook predicted by the previous iteration, B l Indicates the background of the previous iteration prediction, threshold indicates the selected threshold, F t Indicates the pixel value as the foreground in the corresponding comparison interval in this iterative prediction, B t Indicates the pixel value used as background in the corresponding comparison interval in this iterative prediction;
[0035] The calculation process of the loss function of the foreground-background separation module training is expressed as:
[0036] Loss fb =|FF final |+|BB fianl |+λ(|F i -F o |+|B i -B o |)
[0037] Where, Loss fb represents the loss function of the foreground-background separation module training, F represents the target foreground, B represents the target background, and F final represents the final forecast outlook, B fianl represents the final predicted background, F i Indicates the predicted foreground in the marked box, B i Indicates the predicted background within the marked box, F o Indicates the predicted foreground outside the marked box, B o represents the predicted background outside the marked box, and λ represents the balance coefficient;
[0038] The foreground attention activation module includes multiple convolutional layers, batch normalization layers and nonlinear activation layers. First, the final predicted foreground F final Input the foreground attention activation module and output the foreground attention activation map. The activation process is expressed as:
[0039] I=ReLU(w e ·F final +b e )
[0040] Where w e represents the convolution kernel, b e represents the offset distance, ReLU represents the nonlinear activation, and I represents the foreground attention activation map;
[0041] Then, the edge weighted map C is multiplied with the foreground attention activation map I to obtain the foreground weighted fused edge feature E′. The calculation process is as follows:
[0042] E′=C·I.
[0043] Furthermore, the attention module records the edge features after foreground weighted fusion as input and extracts attention features, thereby guiding the subsequent training of the background separation module and improving the foreground prediction effect of the background separation module. In the attention module, the attention feature is first extracted through the convolution layer, and then the attention mask is obtained through the Sigmoid activation layer. The attention mask is multiplied with the X-ray image to obtain the attention feature M. The process is expressed as follows:
[0044] M=σ(w a ·E′+b a )·f
[0045] Where σ represents the Sigmoid function, w a represents the convolution kernel, E′ represents the edge features after foreground weighted fusion, b a represents the offset distance, and f represents the X-ray image.
[0046] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0047] 1. Compared with other X-ray target detection methods, the present invention improves the detection speed while maintaining detection accuracy. The proposed method separates the target to be detected in a complex background by setting a foreground-background separation module, and then weights the X-ray image according to the separated foreground, so that the target to be detected in the X-ray image is guided and emphasized, effectively enhancing the network's perception ability of the target to be detected, reducing the missed detection rate, and improving detection efficiency.
[0048] 2. The present invention combines an edge guidance module with X-ray detection to extract more discriminative features, and then passes the significant features to the network for fusion, reducing feature interference under X-ray transmission imaging when multiple objects are stacked. The improved FCOS network proposed in the present invention has higher detection accuracy.
[0049] 3. The present invention sets up an attention module. The foreground weighted features of each round of iterative training will be recorded by the attention module and the weighted attention features will be output according to the records, thereby improving the mapping ability between the feature space and the solution space, so that the network can better identify the target to be detected. The method proposed in the present invention has higher detection accuracy.
[0050] 4. The method of the present invention has a wide range of applications in computer vision tasks, can achieve end-to-end training, has strong adaptability to different scenarios and tasks, and has broad application prospects. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1It is a total framework diagram of the method of the present application; in the diagram, Conv & Sigmoid represents a convolution layer and an activation layer, Decoder represents an encoder, N round represents N rounds of iteration, Matrix Multiplication represents matrix multiplication, Concatenation represents a splicing operation, and Attention Map represents an attention activation map.
[0052] Figure 2 It is a test picture used in the present embodiment.
[0053] Figure 3 It is a background image obtained by the foreground-background separation module of the present embodiment.
[0054] Figure 4 It is a foreground image obtained by the foreground-background separation module of the present embodiment. DETAILED DESCRIPTION
[0055] The present application will be further described below in combination with specific embodiments.
[0056] As shown in Figure 1 , the present embodiment discloses an X-ray security inspection detection method based on an improved FCOS network. The method is based on the improved FCOS network to realize the accurate detection of contraband in X-ray security inspection. The improvement of the FCOS network lies in the addition of an edge guiding module, a foreground-background separation module and an attention module. The edge guiding module calculates the edge features of the target to be detected in the X-ray image through a sobel operator, which is used to improve the recognition sensitivity of the FCOS network for the target to be detected. The foreground-background separation module separates the foreground and background in the X-ray image by receiving the edge features extracted by the edge guiding module, reduces the aliasing interference of the background in the X-ray image and improves the recognition ability of the FCOS network for the contraband. The attention module is used to record the foreground features extracted by the foreground-background separation module before multiple rounds of iteration training, and fuse the recorded foreground features to obtain an attention activation map. Through the attention activation map weighting, the detection accuracy of the FCOS network is improved. The specific implementation of the X-ray security inspection detection method includes the following steps:
[0057] 1) Place the object to be detected with a folding knife in a tray, and when the tray is transported to the detection area by the conveyor belt, the multi-view X-ray radiograph scans the object to be detected by emitting an X-ray beam. The X-ray beam passes through the object to be detected and reaches the receiver. The X-ray image of the object to be detected is obtained by rendering through a computer program, as shown in Figure 2 .
[0058] 2) Use the trained improved FCOS network to process the X-ray image as follows:
[0059] The X-ray image is input into the edge guidance module, and the Sobel operator is used in the edge guidance module to extract the edge feature map. The Sobel operator extraction process is as follows:
[0060] E h =f[x, y]*s h [x, y]
[0061] E v =f[x, y]*s v [x, y]
[0062]
[0063] Where f[x, y] is the data of the image in the (x, y) region, x represents the horizontal coordinate of the X-ray image, y represents the vertical coordinate of the X-ray image, and s h [x, y] is the convolution kernel in the horizontal direction, s v [x, y] is the convolution kernel in the vertical direction, E h is the edge image in the horizontal direction, E v is the edge image in the vertical direction, and E is the edge feature map.
[0064] The edge attention guidance module consists of multiple convolutional layers, batch normalization layers, and nonlinear activation layers. It takes the edge feature map E output by the edge extraction module as input and finally obtains the edge weighted map C through calculation. The calculation process is as follows:
[0065] C=ReLU(w e E+b e )+E
[0066] Where w e represents the convolution kernel, E represents the edge feature map, b e Represents the offset distance, ReLU represents the nonlinear activation, and the edge weighted graph C improves the recognition sensitivity of the FCOS network for contraband.
[0067] After obtaining the edge weighted graph, an encoder-decoder network for separating the foreground and background of the X-ray image is set in the foreground-background separation module. The input is the edge weighted graph, and the output is the processed foreground image containing the target to be detected and the background image excluding the target to be detected, such as Figure 3 、 Figure 4 As shown;
[0068] The specific structure of the encoder-decoder network is as follows: the backbone network adopts the U-Net network structure, and a pixel selection iterator is added between the encoder and the decoder to obtain the foreground through iteration during the training process. In each training iteration, all pixels outside the bounding box are first set to 1, and a selection threshold is pre-set as the judgment condition for pixel selection. Then, a selection factor is set. The selection factor is between 0 and 1 and is used to control how much of the predicted foreground of the previous iteration is used as the comparison interval of this iteration, that is, the part of the predicted foreground that is greater than the selection factor is used for comparison, and the part greater than the selection factor is used as the comparison interval. If the L1-loss (absolute value loss function) of the predicted foreground in the comparison interval of this iteration and the corresponding area of the X-ray image is less than the selection threshold, the corresponding pixel in the bounding box of the predicted foreground of this iteration is selected as the target, otherwise the corresponding pixel in the predicted foreground of the previous iteration is selected. The iterative prediction process can be expressed by a mathematical formula as follows:
[0069] D oc =|F ko -F kc |
[0070]
[0071] Where, F ko Indicates the pixel value of the comparison interval in the X-ray image, F kc Indicates the pixel value of the comparison interval in the current iteration prediction foreground, D oc Indicates F ko and F kc The discrimination between c Indicates the prospect of this iteration prediction, B c Indicates the background of this iteration prediction, F l represents the outlook predicted by the previous iteration, B l Indicates the background of the previous iteration prediction, threshold indicates the selected threshold, F t Indicates the pixel value as the foreground in the corresponding comparison interval in this iterative prediction, B t Indicates the pixel value used as the background in the corresponding comparison interval in this iterative prediction.
[0072] The calculation process of the loss function of the foreground-background separation module training can be expressed as:
[0073] Loss fb =|FF final |+|BB fianl |+λ(|F i -F o |+|B i -B o |)
[0074] Where, Loss fb represents the loss function of the foreground-background separation module training, F represents the target foreground, B represents the target background, and F final represents the final forecast outlook, B fianl represents the final predicted background, F i Indicates the predicted foreground in the marked box, B i Indicates the predicted background within the marked box, F o Indicates the predicted foreground outside the marked box, B o represents the predicted background outside the marked box, and λ represents the balance coefficient.
[0075] The foreground attention activation module includes multiple convolutional layers, batch normalization layers and nonlinear activation layers. First, the final predicted foreground F final Input the foreground attention activation module and output the foreground attention activation map. Its activation process can be expressed as:
[0076] I=ReLU(w e ·F final +b e )
[0077] Where w e represents the convolution kernel, F final represents the final forecast outlook, b e represents the offset distance, ReLU represents the nonlinear activation, and I represents the foreground attention activation map.
[0078] Then, the edge weighted map C is multiplied with the foreground attention activation map I to obtain the foreground weighted fused edge feature E′; the calculation process is as follows:
[0079] E′=C·I
[0080] The attention module consists of a convolution layer and a Sigmoid activation layer. The edge features after foreground weighted fusion are input into the attention module for recording and extracting attention features, thereby guiding the subsequent training of the background separation module and improving the foreground prediction effect of the background separation module. In the attention module, attention features are first extracted through the convolution layer, and then the attention mask is obtained through the Sigmoid function. The attention mask is multiplied by the X-ray image to obtain the attention feature. The process is shown as follows:
[0081] M=σ(w a ·E′+b a )·f
[0082] Where σ represents the Sigmoid function, w a represents the convolution kernel, E′ represents the edge features after foreground weighted fusion, b arepresents the offset distance, and f represents the X-ray image.
[0083] The attention features M are fed into the feature extraction backbone of the improved FCOS network to obtain the backbone features G. This backbone feature G is then fed into the prediction module of the improved FCOS network for target location and classification. Finally, the detection information is output and annotated in the X-ray image. The feature extraction backbone network consists of five computational layers and a residual structure, while the prediction module consists of four linear convolutional layers, a ReLU activation function, and Group Normalization. The use of Group Normalization effectively increases network robustness.
[0084] The above-described embodiments are only preferred embodiments of the present invention and are not intended to limit the scope of implementation of the present invention. Therefore, any changes made based on the shape and principle of the present invention should be included in the scope of protection of the present invention.
Claims
1. The X-ray security inspection method based on the improved FCOS network is characterized by: This method is based on an improved FCOS network to achieve accurate detection of prohibited items in X-ray security inspections. The improvements to the FCOS network include an edge guidance module, a foreground-background separation module, and an attention module. The edge guidance module uses the Sobel operator to calculate the edge features of the target to be detected in the X-ray image, which is used to improve the FCOS network's recognition sensitivity for the target to be detected. The foreground-background separation module separates the foreground and background in the X-ray image by receiving the edge features extracted by the edge guidance module, reducing the aliasing interference of the background in the X-ray image and improving the FCOS network's ability to identify contraband. The attention module is used to record the foreground features extracted by the background separation module before multiple rounds of iterative training, and fuse the recorded foreground features to obtain an attention activation map. By weighting the attention activation map, the detection accuracy of the FCOS network is improved. The specific implementation of the X-ray security inspection method includes: Collect X-ray images of the objects to be inspected on the conveyor belt; The trained improved FCOS network is used to process X-ray images as follows: Input the X-ray image into the edge guidance module to obtain the edge feature map E, fuse the X-ray image with the edge feature map E and extract features to obtain the edge weighted map C; The foreground-background separation module separates the foreground and background of the edge weighted map C to obtain the separated foreground and background maps. The foreground map is feature extracted to obtain the foreground attention activation map I. The edge weighted map C is dot-multiplied with the foreground attention activation map I to obtain the foreground weighted fused edge feature E′. The attention module records the edge features E′ after foreground weighted fusion, and fuses all edge features recorded in the attention module to obtain the attention feature M; The attention feature M is input into the feature extraction backbone network of the improved FCOS network to obtain the backbone feature G, which is then input into the prediction module of the improved FCOS network for target positioning and classification, and finally the detection information is output and marked in the X-ray image.
2. The X-ray security inspection method based on the improved FCOS network according to claim 1 is characterized in that: Acquiring X-ray images involves the following operations: The object to be inspected is placed on a tray. When the tray is transported to the inspection area by a conveyor belt, the multi-view X-ray instrument scans the object to be inspected by emitting an X-ray beam. The X-ray beam passes through the object to be inspected and reaches the receiver, where an X-ray image of the object to be inspected is rendered by a computer program.
3. The X-ray security inspection method based on the improved FCOS network according to claim 1 is characterized in that: The improved FCOS network includes: An edge guidance module, which is divided into an edge extraction module for calculating the edge of a target in an image and an edge attention guidance module for calculating edge attention based on the target edge; The foreground-background separation module consists of a U-Net network for encoding and decoding the foreground-background separation, a pixel selection iterator for optimizing foreground acquisition, and a foreground attention activation module for calculating foreground attention based on the extracted foreground. Attention module, consisting of convolutional layer and Sigmoid activation layer; Feature extraction backbone network, consisting of 5 computational layers and a residual structure; The prediction module consists of 4 linear convolution layers, ReLU activation function and Group Normalization. The use of Group Normalization can effectively increase the robustness of the network.
4. The X-ray security inspection method based on the improved FCOS network according to claim 3 is characterized in that: The edge extraction module extracts edge feature maps from the input X-ray image using the Sobel operator. The Sobel operator extraction process is as follows: E h =f[x,y]*s h [x,y] E v =f[x,y]*s v [x,y] Where f[x,y] is the data of the X-ray image in the (x,y) region, x represents the horizontal coordinate of the X-ray image, y represents the vertical coordinate of the X-ray image, and s h [x,y] is the convolution kernel in the horizontal direction, s v [x,y] is the convolution kernel in the vertical direction, E h is the edge image in the horizontal direction, E v is the edge image in the vertical direction, and E is the edge feature map; The edge attention guidance module consists of multiple convolutional layers, batch normalization layers, and nonlinear activation layers. It takes the edge feature map E output by the edge extraction module as input and finally obtains the edge weighted map C through calculation. The calculation process is as follows: C=ReLU(w e ·E+b e )+E Where w e represents the convolution kernel, b e Represents the offset distance, ReLU represents the nonlinear activation, and the edge weighted graph C improves the recognition sensitivity of the FCOS network for contraband.
5. The X-ray security inspection method based on the improved FCOS network according to claim 3 is characterized in that: A U-Net network is set in the foreground-background separation module. After obtaining an edge weighted graph, the U-Net network inputs the edge weighted graph and outputs a processed foreground image containing the target to be detected and a background image not containing the target to be detected; The pixel selection iterator is used to obtain the foreground in an iterative manner during the training process; In each training iteration, the U-Net network outputs the foreground image and the background image. First, all pixels outside the bounding box are set to 1, and a selection threshold is pre-set as the judgment condition for pixel selection. Then, a selection factor is set. The selection factor is between 0 and 1, which is used to control how much of the predicted foreground of the previous iteration is used as the comparison interval of this iteration. That is, the part of the predicted foreground that is greater than the selection factor is used for comparison, and the part greater than the selection factor is used as the comparison interval; if the absolute value loss function L1-loss of the predicted foreground in the comparison interval of this iteration and the corresponding area of the X-ray image is less than the selection threshold, then the corresponding pixel in the bounding box of the predicted foreground of this iteration is selected as the target, otherwise the corresponding pixel in the predicted foreground of the previous iteration is selected. The iterative prediction process is expressed by the mathematical formula: D oc =|F ko -F kc | Where, F ko Indicates the pixel value of the comparison interval in the X-ray image, F kc Indicates the pixel value of the comparison interval in the current iteration prediction foreground, D oc Indicates F ko and F kc The discrimination between c Indicates the prospect of this iteration prediction, B c Indicates the background of this iteration prediction, F l represents the outlook predicted by the previous iteration, B l Indicates the background of the previous iteration prediction, threshold indicates the selected threshold, F t Indicates the pixel value as the foreground in the corresponding comparison interval in this iterative prediction, B t Indicates the pixel value used as background in the corresponding comparison interval in this iterative prediction; The calculation process of the loss function of the foreground-background separation module training is expressed as: Loss fb =|FF final |+|BB fianl |+λ(|F i -F o |+|B i -B o |) where Loss fb represents the loss function of the foreground-background separation module training, F represents the target foreground, B represents the target background, and F final represents the final forecast outlook, B fianl represents the final predicted background, F i Indicates the predicted foreground in the marked box, B i Indicates the predicted background within the marked box, F o Indicates the predicted foreground outside the marked box, B o represents the predicted background outside the marked box, and λ represents the balance coefficient; The foreground attention activation module includes multiple convolutional layers, batch normalization layers and nonlinear activation layers. First, the final predicted foreground F final Input the foreground attention activation module and output the foreground attention activation map. The activation process is expressed as: I=ReLU(w e ·F final +b e ) Where w e represents the convolution kernel, b e represents the offset distance, ReLU represents the nonlinear activation, and I represents the foreground attention activation map; Then, the edge weighted map C is multiplied with the foreground attention activation map I to obtain the foreground weighted fused edge feature E′. The calculation process is as follows: E′=C·I.
6. The X-ray security inspection method based on the improved FCOS network according to claim 3 is characterized in that: The attention module records the edge features after foreground weighted fusion as input and extracts attention features, thereby guiding the subsequent training of the background separation module and improving the foreground prediction effect of the background separation module. In the attention module, the attention feature is first extracted through the convolution layer, and then the attention mask is obtained through the Sigmoid activation layer. The attention mask is multiplied with the X-ray image to obtain the attention feature M. The process is expressed as follows: M=σ(w a ·E′+b a )·f Where σ represents the Sigmoid function, w a represents the convolution kernel, E′ represents the edge features after foreground weighted fusion, b a represents the offset distance, and f represents the X-ray image.
Citation Information
Patent Citations
Vehicle tracking method and system based on FCOS
CN111178161A
Image processing method and related apparatus
WO2022179606A1