A knife detection and segmentation method for security inspection images based on semantic contour information
Through the Faster MaskRCNN model and multi-task convolutional network strategy based on semantic contour information, the problem of low manual determination efficiency and missed detection in traditional X-ray security inspection is solved, high-precision tool detection and position annotation are achieved, and the security inspection efficiency and accuracy.
Patent Information
- Application Number
- CN201911327345.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-20
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2039-12-20
AI Technical Summary
Traditional X-ray security inspection image detection relies on manual judgment, which is inefficient and difficult to effectively identify dangerous goods. Existing algorithms fail to effectively utilize the semantic contour information in the image, resulting in frequent missed detection problems.
A security inspection image tool detection and segmentation method based on semantic contour information is used to establish a Faster MaskRCNN model by defining high-dimensional data. Combined with a multi-task convolution network strategy, the contour information features are used to improve detection accuracy and shorten neural network training time, achieving accurate and fast tool detection. Detection and location annotation.
It achieves high-precision detection of tools in security inspection images, shortens detection time, improves detection accuracy, and can reach 92.6% mAP detection accuracy under large-scale data, significantly improving security inspection efficiency and accuracy.
Smart Images

Figure CN111127499B
Abstract
Description
Technical Field
[0001] The present invention relates to a content-aware image detection and segmentation technology in the field of image processing technology, and in particular to the research and implementation of a security inspection image knife detection and segmentation method based on semantic contour information. Background Art
[0002] With the continuous expansion of urban transportation and logistics services, transportation and logistics play a vital role in promoting urban economic development and optimizing urban structure. Every day, a large number of passengers and goods are transferred through major railways, highways, and airports around the world. Urban rail transit is more likely to cause catastrophic consequences after a terrorist attack due to its closed space and large passenger flow. How to quickly and effectively check passengers' luggage for dangerous goods has always troubled relevant security departments. X-ray security inspection machines have been widely used in transportation, logistics and other fields. The rapid development of society has put higher and higher requirements on security inspection speed and accuracy, and the traditional X-ray image judgment is Figure 1 It has always relied on manual labor, which is of low quality and efficiency, time-consuming, and heavy workload. It is also unable to efficiently identify contraband in X-ray images, and missed inspections often occur. Currently, mainstream security inspection machines use advanced security inspection technologies such as X-ray imaging technology, computer tomography imaging technology, ion mobility spectrometry analysis technology, Raman spectroscopy technology, and radioactive material monitoring. However, these technologies are only imaging, and manual judgment is still needed to determine whether there are dangerous items in the security inspection images.
[0003] The mainstream algorithms of traditional X-ray detection mainly check contraband through image classification. They all use hand-designed features for target classification, use some common hand-designed features for image classification, extract some important features of X-ray images, and use classifiers for classification after feature expression. The earliest discrimination algorithm based on organic, inorganic and metal in images was proposed by Richard DRMaccdonald at home and abroad. This algorithm uses a dual energy system. On this basis, Saskia M.Steiner-Koller and others discovered a method for evaluating the interpretability of security inspection image X-rays. Abbott studied the grayscale influencing factors of X-ray images and simulated and verified that the noise of the forward scattered signal in X-rays has a greater impact on the image than the transmission signal. Richard F.Eilhert and others studied the improved images of X-ray security inspection systems. In terms of the identification of contraband in security inspection images, Shahan Nercessian and others proposed an image processing method based on the feature vector of the edge of the object. This method is effective in identifying the appearance of dangerous goods. Professor He proposed a new enhancement method for security inspection X-ray images through fuzzy theory, and Professor Ge proposed a method to remove the overlapping effect in X-ray fluoroscopic images by extracting the true grayscale of the object. A large number of new theories and methods have emerged, such as using edge detection and pattern matching to detect targets, using wavelet transform algorithm to extract features, and then using KNN algorithm for classification, and extracting features by using scale-invariant feature transform algorithm (SIFT) for identification. The above traditional detection methods do not consider the semantic contour information of the content in the image. In order to more intelligently assist security inspectors in their security inspection work, it is necessary to detect dangerous goods knives in the content of security inspection images, and mark their positions and categories. Then the detection technology based on semantic contour information is used to solve the problem of how to detect knives in security inspection images with high precision.
[0004] Traditional image segmentation techniques can be roughly divided into threshold-based, cluster-based, region-based, edge-based and physical-based segmentation methods. In recent years, new methods have emerged, including Turbopixels algorithm, SLIC algorithm and deep learning-based segmentation algorithm.
[0005] The threshold segmentation method is to divide the image pixels into several categories by setting different feature thresholds. Each category forms a region corresponding to the real target. Each region has consistent attributes, and the adjacent regions have this consistent attribute. Commonly used features include the grayscale or color features of the original image and the features obtained by transforming the original grayscale or color values. Although this type of algorithm is simple to implement, has a small amount of calculation, and has relatively stable performance, the selection of the threshold is a key technology of the threshold segmentation method. The quality of the threshold directly affects the quality of the final result. Most of the existing algorithms focus on the research of threshold determination.
[0006] The clustering-based segmentation method is to divide N data sample points into K groups on average, place the input K points as the cluster center to be converged, calculate the Euclidean distance from other sample points in the cluster to the center point, and classify them by comparing the smallest Euclidean distance until the clustering performance criterion function is optimal and the overall error is minimized. It is characterized by a simple and efficient algorithm that is relatively scalable and efficient for processing large data sets, and the time complexity is O(NK t ), where N represents the total number of data samples, K represents the number of clusters, and t represents the number of algorithm iterations. When the algorithm is used to segment an image with a large number of clusters and the differences between each cluster are obvious, the effect is better. However, the determination of the initial cluster center point will affect the overall segmentation effect. When dealing with irregular clusters, the distance function is used as a method to determine the similarity between samples, which will affect the segmentation result. The clustered results are easily affected by noise points, which is also unfavorable to the results.
[0007] SLIC is a simple superpixel processing method. The image color information required is taken from the CIE-Lab color space. First, the color space conversion is required. Corresponding to each pixel in the image, it is decomposed into a 5-dimensional vector {L, a, b, x, y} consisting of components L, a, b represented by the CIE-Lab color space and pixel coordinates x, y. The similarity between two pixels is measured by vector distance, and it is summarized that pixel similarity is inversely proportional to vector distance. After repeated calculations, all data objects are classified and refreshed to obtain a new convergence center point until the overall error converges to the minimum and the iteration is stopped. In order to ensure the iterative effect and ensure that there are no continuous superpixels in the segmentation process, the connectivity is deliberately enhanced during the iteration process. However, due to the position restriction of the edge retention, the fit between the superpixel and the image edge will deteriorate.
[0008] Image segmentation algorithms based on deep learning mainly use convolutional neural networks (CNNs), which have strong data summarization and feature learning capabilities and can effectively extract high-level semantic information from images. Typical image segmentation networks at this stage include fully convolutional neural networks (FCNs), SegNet, U-Net, DeepLab, etc. These algorithms achieve end-to-end semantic segmentation, but in terms of data input, they only have a single RGB image or binary image. By converting CNN into a convolution operation network composed entirely of convolution layers (convolution operations) and pooling layers (convolution operations), the semantic contour information of the target in the image is not effectively utilized. Most multi-operation methods have high time complexity, so how to shorten the convergence time of the algorithm is also a problem that needs to be seriously considered. Summary of the invention
[0009] The present invention provides a technology for detecting and segmenting knives in security inspection images based on semantic contour information, so that knives in security inspection images can be accurately and quickly detected and segmented, and displayed on a terminal device. At the same time, the position and category of the knives can be marked as accurately as possible, and key objects can be kept completely segmented to achieve auxiliary security inspection with the best effect.
[0010] This paper proposes a tool detection and segmentation method based on semantic contour information. By defining a series of high-dimensional data that effectively utilizes contour information to establish a Faster MaskRCNN optimization model for tool detection and segmentation, it ensures that the image fully utilizes the semantic contour information features of the tool during the neural network training process, thereby improving the detection accuracy of the model. On the other hand, we propose a multi-task convolutional network strategy that can effectively improve the speed of loss function convergence and greatly shorten the training time of the neural network.
[0011] The general idea of the present invention is to first detect the contour information of the original image, and in the process of edge detection, retain the contour information of the image content as much as possible, and then use the detected contour information features to splice with the original image features to form higher dimensional data with contour information, and finally add a tool edge segmentation task to the MaskRCNN task to finally obtain the tool detection segmentation image.
[0012] In order to solve the above problem, the present invention provides an effective detection and segmentation method based on content-aware semantic contour information. The method specifically comprises:
[0013] 1) Input an original image of size W*H. The corresponding edge detection image has the same size as the original image, where W is the width of the original image and H is the height of the original image.
[0014] 2) Perform edge detection on the original image content and the supervised sample mask (binary image). The specific steps are as follows:
[0015] ① Optimize the edge detection model of the original image: Use the HED (Holistically-Nested Edge Detection) model to perform edge detection on the original image content, and retain the edge detection image in the Side-output4 stage instead of the image in the final stage. For the tool, the edge detection image in the final stage adds more non-edge information.
[0016] ② Establish the optimization model of the mask image: Use the Laplace operator to detect the edge of the mask. The goal is to make the edge pixels of the tool in the mask image have different pixels. The pixels close to the edge center have a larger weight, and the farther from the edge center, the smaller the weight. The tool contour information can be retained to a large extent. The discrete Laplace operator function of the two variables is established as:
[0017]
[0018] Formula (1) can be written as filter mask as follows:
[0019] 1 1 1 1 -8 1 1 1 1
[0020] In formula (1), x and y are the coordinate points of the x-axis and y-axis on the image respectively; the original derivation process of formula (1) requires the definition of the simplest second-order differential Laplace operator first. The Laplace operator is a second-order differential linear operator. In image edge processing, the second-order differential has a stronger edge positioning ability and a better sharpening effect. Therefore, when performing image edge processing, the second-order differential operator is directly used instead of the first-order differential:
[0021]
[0022] In formula (2), any order of differentiation is a linear operation, so the Laplace operator is a linear operator. Differentiating the second-order derivatives of the Laplace operator in the x and y directions respectively gives the Laplace operator of the discrete function. In a two-dimensional function f(x, y), the second-order differences in the x and y directions are:
[0023]
[0024]
[0025] Formulas (2) and (3) can derive the discrete Laplace operator function.
[0026] 3) The original image and its corresponding edge binary image are used as training samples and input into the MaskRCNN network at the same time. The features of the tool and the features of the tool semantic contour information are spliced. Finally, the multi-task strategy is implemented by adding the edge semantic segmentation task. This step specifically includes:
[0027] ① Design the RPN (Region Proposal Networks) twin network structure, use RPN to input the original image and its corresponding edge binary image into the network, extract features of the tool as a whole and the tool edge information respectively, and perform feature splicing in the block 5 stage of the ResNet network. The goal is to make the most effective use of the tool semantic contour features and increase the weight of the tool's important features as much as possible, among which,
[0028] The RPN loss function is:
[0029]
[0030] In formula (4), N cls Indicates the number of categories, the value is 2, N reg Represents the number of regression coordinates, the value is 4, i represents the i-th anchor point, p i Indicates the probability of whether anchor point i is predicted to be a target. When the anchor point is a positive sample The negative samples are t i A vector representing the 4 parameterized coordinates of the predicted box of the i-th anchor point, represents the coordinates of a ground true box associated with a positive sample anchor point. The hyperparameter λ represents the balance factor, which is used to balance the classification loss and regression loss. The value is 10, which is determined based on cross-validation. We experimentally prove that the results are insensitive to the value of λ in a large range and are universal. cls represents the binary classification softmax loss function, L reg Represents the regression loss, using the Smooth-L1 function, which are:
[0031]
[0032] In formula (5), e is a natural constant, It represents the feature output value of the previous layer of the softmax layer, which is the exponent of the natural constant e. i represents the category index, which is an integer in the range [1, j]. j represents the number of tool categories, which is 2.
[0033]
[0034] In formula (6), x represents the difference between the predicted box and the ground truth.
[0035] ② Establish a tool edge semantic segmentation task branch, which is parallel to the classification task branch, detection task branch and tool segmentation task branch. The goal is to shorten the training time and segment along the edge more accurately. On the one hand, due to the large depth of the neural network, more complex tasks can optimize network performance. On the other hand, the tool edge semantic segmentation task can affect the accuracy of other tasks, and the impact is good. For the predicted binary mask output, the sigmoid function is applied to each pixel point. The overall loss is defined as the average binary cross-entropy loss, which is the same as L Mask The loss function is the same. The introduction of a mechanism to predict K outputs allows each class to generate an independent mask to avoid inter-class competition, with the goal of decoupling mask and category prediction.
[0036] Average Binary Cross Entropy Loss Function:
[0037]
[0038] In formula (7), i represents the i-th pixel, p i Indicates the probability that pixel i is predicted to be on the tool. When the pixel is on the tool Otherwise
[0039] Define the total loss function of the model:
[0040] L MRCNN =L Class +L Box +L Mask +L Edge +L(p i , t i ) (8)
[0041] In formula (8), L Class The loss function is:
[0042]
[0043] In formula (9), e is a natural constant, It represents the feature output value of the previous layer of the softmax layer, which is the exponent of the natural constant e. i represents the category index value, which is an integer in the range [1, j]. j represents the number of tool categories, which is 2.
[0044] L Box The loss function also uses the Smooth-L1 function:
[0045]
[0046] In formula (10), x represents the difference between the tool prediction box and the ground truth.
[0047] L Mask Loss function:
[0048]
[0049] In formula (11), i represents the i-th pixel, p i Indicates the probability that pixel i is predicted to be on the tool. When the pixel is on the tool Otherwise
[0050] ③Solve the optimization model, L MRCNN The loss function is reduced to a stable range.
[0051] 4) Test the trained detection and segmentation model, input the original security inspection image content, and then obtain the tool detection segmentation result image.
[0052] The present invention mainly has two aspects of work content: first, edge detection is performed on the original security inspection image to detect the contour information of the image content as completely as possible; tool edge detection is performed on the supervision information mask image, a twin network is designed in the RPN network structure, the original image and the corresponding edge image are simultaneously input into the RPN twin network structure, the tool features are extracted through RPN, and in the final stage, the features extracted from the original image are spliced with the features extracted from the edge image. Since the original image may lose important features during the feature extraction process, the tool edge features can be enhanced and the semantic contour information can be effectively utilized. Second, since the MaskRCNN network has a depth of more than 100 layers and a complex network structure, by adding a task branch for segmenting the tool edge, the model is guided to learn the tool contour information features, which accelerates the model convergence speed and improves the accuracy of the model in detecting tools. Experimental data show that, given the experimental data of 1,000 security inspection images, the application of this method can detect tools with a mAP of 92.6%, so it also has a high detection accuracy in the context of large-scale data applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 This is the edge detection result of the original image in this example.
[0054] Figure 2 It is the mask image corresponding to the original image in this example.
[0055] Figure 3 It is the tool edge detection image corresponding to the supervision information mask image of this example. DETAILED DESCRIPTION
[0056] 1) Input an original image of size 664*492;
[0057] 2) Perform edge detection on the original image content and supervise the sample mask ( Figure 3 ) to perform edge detection. The specific steps are as follows:
[0058] ① Optimize the original image edge detection model: Use the HED (Holistically-Nested Edge Detection) model to detect the edge of the original image content, and retain the edge detection image in the Side-output4 stage instead of the image in the final stage. For the tool, the edge detection image in the final stage adds more non-edge information, and the result is as follows Figure 1 shown.
[0059] ② Establish the optimization model of the mask image: Use the Laplace operator to detect the edge of the mask. The goal is to make the edge pixels of the tool in the mask image have different pixels. The pixels close to the edge center have a larger weight, and the farther from the edge center, the smaller the weight. The tool contour information can be retained to a large extent. The discrete Laplace operator function of the two variables is established as:
[0060]
[0061] Formula (1) can be written as filter mask as follows:
[0062] 1 1 1 1 -8 1 1 1 1
[0063] In formula (1), x and y are the coordinate points of the x-axis and y-axis on the image respectively; the original derivation process of formula (1) requires the definition of the simplest second-order differential Laplace operator first. The Laplace operator is a second-order differential linear operator. In image edge processing, the second-order differential has a stronger edge positioning ability and a better sharpening effect. Therefore, when performing image edge processing, the second-order differential operator is directly used instead of the first-order differential:
[0064]
[0065] In formula (2), any order of differentiation is a linear operation, so the Laplace operator is a linear operator. Differentiating the second-order derivatives of the Laplace operator in the x and y directions respectively gives the Laplace operator of the discrete function. In a two-dimensional function f(x, y), the second-order differences in the x and y directions are:
[0066]
[0067]
[0068] Formula (2) and (3) can be used to obtain the discrete Laplace operator function, and the result is as follows: Figure 3 shown.
[0069] 3) The original image and its corresponding edge binary image are used as training samples and input into the MaskRCNN network at the same time. The features of the tool and the features of the tool semantic contour information are spliced. Finally, the multi-task strategy is implemented by adding the edge semantic segmentation task. This step specifically includes:
[0070] ③ Design the RPN (Region Proposal Networks) twin network structure, use RPN to input the original image and its corresponding edge binary image into the network, extract features of the tool as a whole and the tool edge information respectively, and perform feature splicing in the block 5 stage of the ResNet network. The goal is to make the most effective use of the tool semantic contour features and increase the weight of the important features of the tool as much as possible, among which,
[0071] The RPN loss function is:
[0072]
[0073] N in formula (4) cls Indicates the number of categories, the value is 2, N reg Represents the number of regression coordinates, the value is 4, i represents the i-th anchor point, p i Indicates the probability of whether anchor point i is predicted to be a target. When the anchor point is a positive sample The negative samples are t i A vector representing the 4 parameterized coordinates of the predicted box of the i-th anchor point, represents the coordinates of a ground true box associated with a positive sample anchor point. The hyperparameter λ represents the balance factor, which is used to balance the classification loss and regression loss. The value is 10, which is determined based on cross-validation. We experimentally prove that the results are insensitive to the value of λ in a large range and are universal. cls represents the binary classification softmax loss function, L reg Represents the regression loss, using the Smooth-L1 function, which are:
[0074]
[0075] In formula (5), e is a natural constant, It represents the feature output value of the previous layer of the softmax layer, which is the exponent of the natural constant e. i represents the category index, which is an integer in the range [1, j]. j represents the number of tool categories, which is 2.
[0076]
[0077] In formula (6), x represents the difference between the predicted box and the ground truth.
[0078] ④ Establish a tool edge semantic segmentation task branch, which is parallel to the classification task branch, detection task branch and tool segmentation task branch. The goal is to shorten the training time and segment along the edge more accurately. On the one hand, due to the excessive depth of the neural network, more complex tasks can optimize network performance. On the other hand, the tool edge semantic segmentation task can affect the accuracy of other tasks, and the impact is good. For the predicted binary mask output, the sigmoid function is applied to each pixel, and the overall loss is defined as the average binary cross-entropy loss. The mechanism of predicting K outputs is introduced to allow each class to generate an independent mask to avoid inter-class competition. The purpose is to decouple mask and category prediction.
[0079] Average Binary Cross Entropy Loss Function:
[0080]
[0081] In formula (7), i represents the i-th pixel, p i Indicates the probability that pixel i is predicted to be on the tool. When the pixel is on the tool Otherwise
[0082] Define the total loss function of the model:
[0083] L MRCNN =L Class +L Box +L Mask +L Edge +L(p i , t i ) (8)
[0084] In formula (8), L Class The loss function is:
[0085]
[0086] In formula (9), e is a natural constant, It represents the feature output value of the previous layer of the softmax layer, which is the exponent of the natural constant e. i represents the category index value, which is an integer in the range [1, j]. j represents the number of tool categories, which is 2.
[0087] L Box The loss function also uses the Smooth-L1 function:
[0088]
[0089] In formula (10), x represents the difference between the tool prediction box and the ground truth.
[0090] L Mask Loss function:
[0091]
[0092] In formula (11), i represents the i-th pixel, p i Indicates the probability that pixel i is predicted to be on the tool. When the pixel is on the tool Otherwise
[0093] ⑤Solve the optimization model, L MRCNN The loss function is reduced to a stable range.
[0094] 4) Test the trained detection and segmentation model, input the original security inspection image content, and then obtain the tool detection segmentation image.
Claims
1. A tool detection and segmentation method based on deep learning semantic contour information, characterized in that: Specifically include: 1) Input an original image of size W*H. The corresponding edge detection image has the same size as the original image, where W is the width of the original image and H is the height of the original image. 2) Perform edge detection on the original image content and on the supervised sample binary image mask. The specific steps are as follows: ① Optimize the original image edge detection model: Use the HED model to perform edge detection on the original image content and retain the edge detection image in the Side-output4 stage; ② Establish the optimization model of mask image: Use Laplace operator to detect the edge of mask. The goal is to make the edge pixels of the tool in the mask image have different pixels. The pixels close to the edge center have a larger weight, and the farther from the edge center, the smaller the weight. The tool contour information can be retained to a large extent. The discrete Laplace operator function of two variables is established as follows: Formula (1) can be written as filter mask as follows: In formula (1), x and y are the coordinate points of the x-axis and y-axis on the image respectively; the original derivation process of formula (1) requires the definition of the simplest second-order differential Laplace operator first. The Laplace operator is a second-order differential linear operator. In image edge processing, the second-order differential has a stronger edge positioning ability and a better sharpening effect. Therefore, when performing image edge processing, the second-order differential operator is directly used instead of the first-order differential: In formula (2), any order of differentiation is a linear operation, so the Laplace operator is a linear operator. Differentiating the second-order derivatives of the Laplace operator in the x and y directions respectively gives the Laplace operator of the discrete function. In a two-dimensional function f(x, y), the second-order differences in the x and y directions are: Formula (2) (3) can derive the discrete Laplace operator function; 3) The original image and its corresponding edge binary image are used as training samples and input into the MaskRCNN network at the same time. The features of the tool and the features of the tool semantic contour information are spliced. Finally, the multi-task strategy is implemented by adding the edge semantic segmentation task. This step specifically includes: ① Design the RPN twin network structure, use RPN to input the original image and its corresponding edge binary image into the network, extract features of the tool as a whole and the tool edge information respectively, and perform feature splicing in the block 5 stage of the ResNet network; the goal is to make the most effective use of the tool semantic contour features and increase the weight of the important features of the tool as much as possible, among which, The RPN loss function is: In formula (4), N cls Indicates the number of categories, the value is 2, N reg Represents the number of regression coordinates, the value is 4, i represents the i-th anchor point, p i Indicates the probability of whether anchor point i is predicted to be a target. When the anchor point is a positive sample The negative samples are t i A vector representing the 4 parameterized coordinates of the predicted box of the i-th anchor point, represents the coordinates of a groundtrue box associated with a positive sample anchor point. The hyperparameter λ represents the balance factor, which is used to balance the classification loss and regression loss. The value is 10 according to cross-validation. cls represents the binary softmax loss function, L reg Represents the regression loss, using the Smooth-L1 function, which are: In formula (5), e is a natural constant, It represents the feature output value of the previous layer of the softmax layer, which is the exponent of the natural constant e. i represents the category index, which is an integer in the range [1, j]. j represents the number of tool categories, which is 2. In formula (6), x represents the difference between the predicted box and the ground truth; ② Establish a tool edge semantic segmentation task branch, which is parallel to the classification task branch, detection task branch and tool segmentation task branch. The goal is to shorten the training time and segment along the edge more accurately. On the one hand, due to the excessive depth of the neural network, more complex tasks can optimize network performance. On the other hand, the tool edge semantic segmentation task can affect the accuracy of other tasks, and the impact is good. For the predicted binary mask output, the sigmoid function is applied to each pixel, and the overall loss is defined as the average binary cross loss entropy; introduce a mechanism to predict K outputs, allowing each class to generate an independent mask to avoid inter-class competition. The purpose is to decouple mask and category prediction; Average binary cross entropy loss function: In formula (7), i represents the i-th pixel, p i Indicates the probability that pixel i is predicted to be on the tool. When the pixel is on the tool Otherwise Define the total loss function of the model: L MRCNN =L Class +L Box +L Mask +L Edge +L(p i ,t i ) (8) In formula (8), L Class The loss function is: In formula (9), e is a natural constant, It represents the feature output value of the previous layer of the softmax layer, which is the exponent of the natural constant e. i represents the category index value, which is an integer in the range [1, j]. j represents the number of tool categories, which is 2. L Box The loss function also uses the Smooth-L1 function: In formula (10), x represents the difference between the tool prediction box and the ground truth; L Mask Loss function: In formula (11), i represents the i-th pixel, p i Indicates the probability that pixel i is predicted to be on the tool. When the pixel is on the tool Otherwise ③Solve the optimization model, L MRCNN The loss function is reduced to a stable range; 4) Test the trained detection and segmentation model, input the original security inspection image content, and then obtain the tool detection segmentation result image.
