Human body security check contraband detection model, method and system based on improved yov8s
Through the improved yolov8s model, the reparameterization and parallel branch structure are used to solve the problem of excessive parameters of the deep learning model, and efficient contraband detection on edge devices is achieved, improving the accuracy and speed of detection.
Patent Information
- Application Number
- CN202411042905.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2044-07-31
AI Technical Summary
Among the existing methods for detecting contraband in human security inspection, the parameters and calculation volume of the deep learning model are too large, making it difficult to deploy on edge devices, and there are problems such as artificial misjudgment and time-consuming and labor-consuming.
The improved yolov8s model is adopted, and the reparameterized HGNetV2 backbone network and GhostDynamicConv and GCADown modules are combined with parallel branch structure and convolution operations to reduce the parameter amount and calculate the model, and improve the feature expression ability and detection efficiency.
It significantly improves the accuracy of contraband identification, reduces the calculation volume and volume of model files, makes it easier to deploy on resource-constrained devices, and improves the speed and accuracy of detection.
Smart Images

Figure CN119068238A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image detection, and in particular to a human body security inspection contraband detection model, method and system based on improved yolov8s. Background Art
[0002] The traditional method of detecting prohibited items in human security inspections is to detect prohibited items through a combination of metal security gates and manual body searches. Metal security gates are mainly used to detect metal objects, but they are powerless against non-metallic materials such as ceramics, glass, and plastics, as well as flammable and explosive items and corrosive liquids. Security personnel use handheld metal detectors to conduct further inspections behind the metal security gates, and manually inspect non-metallic items at the same time. This detection method is not only time-consuming and labor-intensive, but may also infringe on personal privacy, and there are also human factors such as misjudgment and negligence. With the development of technology, millimeter wave security gates can be used to detect prohibited items, and deep learning-based detection algorithms can be used to identify and detect prohibited items in images imaged by millimeter waves. This can not only quickly complete the detection process of prohibited items, adapt to the fast-paced security inspection needs, but also effectively improve the accuracy of prohibited item detection. However, image recognition technology has the following technical problems: In security inspection scenarios, it is necessary to quickly complete the detection of prohibited items. Although some deep learning models have accurate detection, the number of parameters, the amount of calculation, and the model volume are too large, making it difficult to deploy on some limited edge devices, so lightweight processing of the model is particularly necessary. Summary of the invention
[0003] The technical problem to be solved by the present invention is how to construct a lightweight human body security contraband detection network.
[0004] The present invention solves the above technical problems through the following technical means:
[0005] The human body security contraband detection model based on the improved yolov8s includes the backbone network and the neck network;
[0006] The backbone network uses the re-parameterized HGNetV2, the neck network uses the GhostDynamicConv module for convolution operation, and the GCADown module is used as the downsampling operation in the neck network;
[0007] The GCADown uses the GhostConv module as a convolution operation in ADown, and constructs a parallel branch structure with the average pooling, maximum pooling operations and GhostConv in ADown.
[0008] Furthermore, the specific structure of the backbone network is as follows: the re-parameterized HGNetV2 includes HGStem, Rep_HGBlock and DWConv;
[0009] As a preprocessing layer, HGStem first extracts the features of the input data through convolution operations, then uses maximum pooling for downsampling to capture the features of the data at different scales, and then fuses them with the feature map after convolution to enrich the feature information;
[0010] Rep_HGBlock uses the idea of reparameterization. In the training phase, 1×1 and 3×3 convolution kernels are used with BatchNorm to form a parallel multi-branch structure. The input feature map is added after three parallel branch structures to extract the multi-scale feature information of the input data and enhance the network's feature expression ability for small targets. In the inference phase, the reparameterization method is used to fuse the parallel multi-branch structure formed by 1×1 and 3×3 convolution kernels with BatchNorm into a single branch structure with only 3×3 convolution kernels. The process of fusing the multi-branch structure into a single branch structure is to fill the 1×1 convolution kernel with 0 values on the branch of the 1×1 convolution kernel to a 3×3 convolution kernel. On the branch with only BN layer, a 3×3 convolution kernel is constructed by filling 0. Then, on each branch, the convolution layer and BN layer are fused. The convolution formula is as follows:
[0011] Conv(x)=W(x)+b
[0012] The BatchNorm formula is shown in formula (5), where γ and β are learnable parameters:
[0013]
[0014] After fusing convolution and BatchNorm, the expression can be expressed as:
[0015]
[0016] in, represents the mean, represents the variance, represents normalization;
[0017] Finally, by adding the three branches together, the parallel multi-branch structure during training can be converted to a single-branch structure during inference.
[0018] DWConv first convolves each channel of the input feature map with a convolution kernel, learns features independently on different channels, and then performs weighted combination of the obtained feature maps through point-by-point convolution to obtain the final feature map.
[0019] Furthermore, the GhostDynamicConv module includes an initial convolution operation and a cheap operation. In the initial convolution operation, the number of channels of the input feature map of size C×H×W is first compressed using a dynamic convolution with a 1×1 convolution kernel, and the number of channels is reduced to half of the original size, C / 2×H×W, and the obtained feature map is used for the cheap operation; the dynamic convolution is defined by aggregating multiple linear functions, expressed as
[0020]
[0021] in, represents the weight of the kth linear function, represents the bias of the kth linear function, g represents the activation function, π k (x) represents the attention weight of the kth thread function, which is dynamically adjusted according to the input;
[0022] In the cheap operation, the input feature map is convolved using dynamic convolution with a 3×3 convolution kernel, and then the feature map that has undergone the convolution operation is concatenated with the feature map that has not undergone the convolution operation to restore the original number of channels. At this time, the feature map size is C×H×W.
[0023] Furthermore, the GCADown module uses the GhostConv module as a convolution operation in ADown, and constructs a parallel branch structure with the average pooling, maximum pooling operations and GhostConv in ADown.
[0024] Furthermore, the operation process of the GCADown module is as follows: the input feature map of size C×H×W is first subjected to an average pooling operation through a pooling window of size 2×2, and the specific operation of average pooling is as follows.
[0025]
[0026] Among them, f i,j represents the output value, n represents the number of regions, Represents the value of the kth region of the input data; then the output feature map is divided into two branches, the number of channels of the feature map on each branch is half of the original, the size is C / 2×H×W, the first branch directly passes through GhostConv, in GhostConv, first use a 1×1 convolution kernel to aggregate the information features of the channel, and then use a 3×3 convolution kernel to convolve the result obtained by the 1×1 convolution kernel, and merge the convolution result with the other half of the channels without convolution to obtain the final result. The height and width of the final result feature map are half of the original size, and the size is C / 2×H / 2×W / 2; the specific representation is as follows:
[0027]
[0028] Among them, I represents the original image, I O Represents the output image, Conv 1×1 Represents the convolution operation of a 1×1 convolution kernel, Conv 3×3 represents the convolution operation of a 3×3 convolution kernel. Indicates merging along the channel dimension; on the second branch, the maximum pooling operation is first performed through a pooling window of size 3×3 to reduce the height and width of the feature map to half of the original size, C / 2×H / 2×W / 2. The specific operation is as follows:
[0029]
[0030] f i,j represents the output value, k represents the kth region, Represents the value of the kth region of the input data; then the output feature map passes through GhostConv with a convolution kernel of size 1×1 to obtain the result of the second branch. At this time, the feature map size is C / 2×H / 2×W / 2; finally, the results of the two branches are spliced to obtain a feature map of size C×H / 2×W / 2, and then the result of GCADown is output.
[0031] The present invention also provides a detection method for a human body security inspection contraband detection model based on an improved yolov8s, comprising the following steps: first, inputting an image, and extracting image features through a backbone network, wherein the convolution operation in Rep_HGBlock is a parallel multi-branch structure composed of convolution kernels of 1×1 and 3×3 sizes and a batch normalization layer in the training stage, which is used to enhance the feature expression ability of the image; in the inference stage, the parallel multi-branch structure is converted into a single branch structure with only a convolution kernel of 3×3 size, so as to improve the calculation efficiency and performance; the feature map output after passing through the backbone network is subjected to a neck network for more refined feature extraction, in which the height and width of the feature map are firstly enlarged by two times through an upsampling operation, and then the features in the neck network are combined with the feature map in the backbone network through feature fusion, and then a GhostDynamicConv convolution operation is performed to extract richer image features, and when downsampling, GCADown is used for downsampling; finally, the refined feature map is sent to the detection head for prediction and classification to obtain a detection result.
[0032] The present invention also provides a training method for a human body security inspection contraband detection model based on an improved yolov8s, comprising the following steps:
[0033] Step 1: Data collection: Use millimeter wave security inspection equipment to collect a large amount of human body security inspection data with prohibited items, such as image data of metal objects such as metal knives, hammers, wrenches, or ceramic knives and alcohol non-metal objects. When collecting data, it is necessary to collect images of prohibited items of different sizes, shapes, positions, and directions to ensure that the model can learn rich features to improve the generalization ability of the model.
[0034] Step 2: Data labeling: Use the LabelImg tool to label the collected image data. When labeling, the image data needs to be accurately labeled, and it is also necessary to consider that the contraband may be blocked or partially hidden to reduce the possibility of missing labels. The labeled images are divided into training sets, validation sets, and test sets.
[0035] Step 3: Network training. First, the divided image data set is input into the detection model. These images are preliminarily processed through the backbone network of the detection model to extract useful feature information from the images. Then, these feature information are input into the neck network, and feature maps of different scales are fused in the neck network to enhance the expression ability of the features. Finally, the fused feature maps are sent to the detection head for prediction to obtain the final result.
[0036] The present invention also provides a human body security inspection contraband detection system based on improved yolov8s, including the above-mentioned detection model.
[0037] The advantages of the present invention are:
[0038] Improved target detection accuracy: Yolov8s was improved by using three network structures: RepHGNetV2, GCADown, and GhostDynamicConv. In the scenario of human body security inspection contraband detection and identification, the accuracy of contraband identification was effectively improved.
[0039] The computational complexity of the model file is reduced: By integrating the three network structures of RepHGNetV2, GCADown and GhostDynamicConv, the number of model parameters and the amount of computation are significantly reduced. Due to the reduction in the size of the model file, it is more conducive to deploying the model on resource-constrained devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 It is a schematic diagram of the overall structure of the detection model in the embodiment of the invention;
[0041] Figure 2 It is the HGStem structure in the embodiment of the present invention;
[0042] Figure 3 It is the HGBlock structure in the embodiment of the present invention;
[0043] Figure 4 It is the RepConv structure in the embodiment of the present invention;
[0044] Figure 5 It is the GhostDynamicConv structure in the embodiment of the present invention;
[0045] Figure 6 It is the GCAdown structure in the embodiment of the present invention;
[0046] Figure 7 This is a training flowchart of the detection model in an embodiment of the present invention. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in combination with the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0048] Example 1
[0049] This embodiment provides a human body security inspection contraband detection model based on improved yolov8s. Traditional human body contraband detection methods need to rely on manual searches when checking non-metallic objects. The deep learning model is trained with a large amount of data and can identify and detect various contraband, including metal and non-metallic objects, thereby improving the accuracy of detection. The deep learning model has better generalization ability and can adapt to changing environments and types of contraband.
[0050] By using three networks, RepHGNetV2, GCADown and GhostDynamicConv, to improve yolov8s, compared with yolov8s, the accuracy of prohibited items detection is improved while reducing the number of parameters and calculations, which is more conducive to deploying the model on devices with limited resources.
[0051] The overall structure of the detection model in this embodiment is as follows Figure 1As shown in the figure, it includes a backbone network, a neck network, and a detection head; the reparameterization method is introduced into the HGNetV2 structure, and then the reparameterized HGNetV2 is used as the backbone network. In the neck network, GhostDynamicConv is used as the convolution operation, and GCADown is used as the downsampling operation. The data set is constructed using the millimeter wave images collected by the security inspection equipment, and then the data set is input into the network. First, the image is input and the image features are extracted through the backbone network. Among them, the convolution operation in Rep_HGBlock is a parallel multi-branch structure composed of 1×1, 3×3 convolution kernels and batch normalization layers in the training stage, which is used to enhance the feature expression ability of the image. In the inference stage, the parallel multi-branch structure will be converted into a single-branch structure with only 3×3 convolution kernels to improve computational efficiency and performance. The feature map output after the backbone network will be passed through the neck network for more refined feature extraction. In the neck network, the height and width of the feature map are first doubled through upsampling operations, and then the features in the neck network are combined with the feature map in the backbone network through feature fusion. Then, through the GhostDynamicConv convolution operation, richer image features are extracted. When downsampling, the GCADown module is used to effectively reduce the number of model parameters and calculations, while learning a variety of different features to improve target detection accuracy. Finally, the refined feature map will be sent to the detection head for prediction and classification to obtain the detection result. The loss function of this network is the CIOU loss function, which is as follows:
[0052]
[0053]
[0054]
[0055] Among them, IOU is the intersection-over-union ratio of the target box and the prediction box, ρ is the Euclidean distance between the center points of the target box and the prediction box, A and B represent the center of the target box and the prediction box respectively, and c is the diagonal of the smallest rectangular box covering the detection box and the target box. represents the penalty term for the center point distance, αv is the penalty term for the aspect ratio, w and h represent the length and width of the detection box respectively, w target and h target Represent the length and width of the target box respectively.
[0056] The following is a detailed description of each part:
[0057] 1. Backbone network
[0058] The backbone network uses the re-parameterized HGNetV2, which consists of three parts: HGStem, Rep_HGBlock and DWConv.
[0059] like Figure 2 , Figure 3 As shown in the figure, HGStem, as a preprocessing layer, first extracts the features of the input data through convolution operations, then uses maximum pooling for downsampling to capture the features of the data at different scales, and then fuses them with the feature map after convolution to enrich the feature information.
[0060] like Figure 4 The specific structure of Rep_HGBlock shown in the figure uses the idea of reparameterization. In the training stage, 1×1 and 3×3 convolution kernels are used with BatchNorm to form a parallel multi-branch structure. The input feature map is added after three parallel branch structures to extract the multi-scale feature information of the input data, enhance the network's feature expression ability for small targets, and thus improve the recognition accuracy of the model for contraband targets. In the inference stage, the reparameterization method is used to fuse the parallel multi-branch structure formed by 1×1 and 3×3 convolution kernels and BatchNorm into a single branch structure with only 3×3 convolution kernels, thereby reducing the amount of model calculation and improving calculation efficiency. The process of fusing the multi-branch structure into a single branch structure is to fill the 1×1 convolution kernel with 0 values on the branch of the 1×1 convolution kernel to a 3×3 convolution kernel. On the branch with only BN layer, a 3×3 convolution kernel is constructed by filling 0. Then on each branch, the convolution layer and BN layer are fused. The convolution formula is expressed as follows:
[0061] Conv(x)=W(x)+b (4)
[0062] The BatchNorm formula is shown in formula (5), where γ and β are learnable parameters:
[0063]
[0064] After fusing convolution and BatchNorm, the expression can be expressed as:
[0065]
[0066] in, represents the mean, represents the variance, Indicates normalization.
[0067] Finally, the three branches are added together, thus converting the parallel multi-branch structure during training into a single-branch structure during inference.
[0068] DWConv first convolves each channel of the input feature map with a convolution kernel, learns features independently on different channels, and then performs weighted combination of the obtained feature maps through point-by-point convolution to obtain the final feature map. In this way, the number of parameters for convolution calculation can be reduced and the computational load can be reduced.
[0069] 2. Neck network
[0070] 2.1 GhostDynamicConv
[0071] like Figure 5 As shown in the figure, the GhostDynamicConv module is mainly divided into the initial convolution operation and the cheap operation. The main idea is to obtain a semantically richer model through the re-convolution operation of a small number of feature maps. The initial convolution operation compresses the number of channels, which can reduce the computational complexity of subsequent operations. The cheap operation obtains a Ghost feature map that is different from the original feature map, so that richer semantic information can be obtained during the network training process. In the initial convolution operation, the dynamic convolution with a 1×1 convolution kernel is first used to compress the number of channels of the input feature map of size C×H×W, reducing the number of channels to half of the original size, C / 2×H×W, and the obtained feature map is used for the cheap operation. Dynamic convolution is defined by aggregating multiple linear functions, expressed as
[0072]
[0073] in, represents the weight of the kth linear function, represents the bias of the kth linear function, g represents the activation function, π k (x) represents the attention weight of the k-th thread function, which is dynamically adjusted according to the input. In the cheap operation, the input feature map is convolved using a dynamic convolution with a 3×3 convolution kernel, and then the feature map that has undergone the convolution operation is concatenated with the feature map that has not undergone the convolution operation to restore the original number of channels. At this time, the feature map size is C×H×W. Such an operation allows the network to learn more complex features while only increasing the amount of computation, thereby improving the accuracy of network target detection.
[0074] 2.2GCADown
[0075] This embodiment proposes a GCADown module for downsampling operation, uses the GhostConv module as a convolution operation in ADown, and constructs a parallel branch structure with the average pooling, maximum pooling operation and GhostConv in ADown. The specific structure is as follows: Figure 6As shown in the figure. Average pooling helps to obtain global information, while maximum pooling helps to obtain local significant features. GhostConv only requires half the computational effort of ordinary convolution operations during convolution operations. Therefore, the GCADown module can obtain features of different scales, allowing the network to learn richer features, while also effectively reducing the computational effort of the model. The input feature map of size C×H×W is first averaged over a pooling window of size 2×2. The specific operation of average pooling is shown below.
[0076]
[0077] Among them, f i,j represents the output value, n represents the number of regions, Represents the value of the kth region of the input data. The output feature map is then divided into two branches, and the number of channels of the feature map on each branch is half of the original number, with a size of C / 2×H×W. The first branch directly passes through GhostConv. In GhostConv, a 1×1 convolution kernel is first used to aggregate the information features of the channels, and then a 3×3 convolution kernel is used to convolve the result obtained by the 1×1 convolution kernel. The convolution result is combined with the other half of the channels without convolution to obtain the final result. The height and width of the final result feature map are half of the original size, with a size of C / 2×H / 2×W / 2. The specific representation is as follows:
[0078]
[0079] Among them, I represents the original image, I O Represents the output image, Conv 1×1 Represents the convolution operation of a 1×1 convolution kernel, Conv 3×3 represents the convolution operation of a 3×3 convolution kernel. Indicates merging along the channel dimension. On the second branch, a maximum pooling operation is first performed through a pooling window of size 3×3 to reduce the height and width of the feature map to half of the original size, C / 2×H / 2×W / 2. The specific operation is as follows.
[0080]
[0081] f i,j represents the output value, k represents the kth region, Represents the value of the kth region of the input data. Then the output feature map passes through GhostConv with a convolution kernel of size 1×1, and the result after the second branch is obtained. At this time, the feature map size is C / 2×H / 2×W / 2. Finally, the results of the two branches are spliced to obtain a feature map of size C×H / 2×W / 2, and then the result of GCADown is output.
[0082] In order to verify the effectiveness of the GCADown module, yolov8s is used as the benchmark model, and the Conv module in the yolov8s neck network is modified to GCADown to compare the performance. As can be seen from Table 1, the use of GCADown can effectively reduce the number of model parameters, the amount of calculation, and the model size, while also improving the accuracy of model recognition.
[0083] Table 1 GCADown validity verification
[0084]
[0085] The detection model of this embodiment has improved accuracy in the identification and detection of prohibited items compared to yolov8s, and while the accuracy is improved, the amount of calculation is reduced. The backbone network of the improved model effectively reduces the number of parameters and the amount of calculation, while improving the detection performance of the model. GhostDynamicConv used in the neck network can learn richer features with lower calculation amount, so that the network can achieve better performance. The GCADown module can reduce the number of parameters, the amount of calculation, and the size of the model, while integrating different features to improve the performance of the model.
[0086] In general, precision (P), recall (R), mean average precision (mAP), model parameters (Params), calculation amount (Floating Point Operations Per Second, FLOPs), and model file size (Model Size) are usually used as evaluation indicators of model performance. The formulas of these evaluation indicators are as follows:
[0087]
[0088]
[0089]
[0090]
[0091] Among them, TP represents the number of contraband that the model can correctly identify, FP represents the number of contraband that is incorrectly identified by the model, and FN represents the number of contraband that is identified by the model but is of the wrong category.
[0092] This example compares yolov3-tiny, yolov5s, yolov6s and yolov8s on the public dataset AMMW2. The comparison results are shown in Table 2. As can be seen from Table 2, the method we proposed effectively reduces the number of parameters, the amount of calculation and the size of the model, and at the same time, the accuracy of object recognition is also optimal.
[0093] Table 2 Performance comparison of different models
[0094]
[0095] Example 2
[0096] This embodiment provides a training method for the detection model of embodiment 1, such as Figure 7 As shown, the details are as follows:
[0097] Step 1: Data collection: Use millimeter wave security inspection equipment to collect a large amount of human security inspection data with prohibited items, such as image data of metal objects such as metal knives, hammers, wrenches, or non-metal objects such as ceramic knives and alcohol. When collecting data, it is necessary to collect images of prohibited items of different sizes, shapes, positions, and directions to ensure that the model can learn rich features to improve the generalization ability of the model.
[0098] Step 2: Data labeling: Use the LabelImg tool to label the collected image data. When labeling, the image data needs to be accurately labeled, and it is also necessary to consider that the contraband may be blocked or partially hidden to reduce the possibility of missing labels. The labeled images are divided into training sets, validation sets, and test sets.
[0099] Step 3: Network training. First, the divided image data set is input into the network. These images are preliminarily processed by the backbone network of the model to extract useful feature information from the images. Then, these feature information is input into the neck network, where feature maps of different scales are fused to enhance the feature expression capability. Finally, the fused feature map is sent to the detection head for prediction to obtain the final result.
[0100] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. Human body security inspection contraband detection model based on improved yolov8s, It is characterized in that Includes backbone network and neck network; The backbone network uses the re-parameterized HGNetV2, the neck network uses the GhostDynamicConv module for convolution operation, and the GCADown module is used as the downsampling operation in the neck network; The GCADown uses the GhostConv module as a convolution operation in ADown, and constructs a parallel branch structure with the average pooling, maximum pooling operations and GhostConv in ADown.
2. According to claim 1, the human body security inspection contraband detection model based on improved yolov8s, It is characterized in that The specific structure of the backbone network is as follows: the re-parameterized HGNetV2 includes HGStem, Rep_HGBlock and DWConv; As a preprocessing layer, HGStem first extracts the features of the input data through convolution operations, then uses maximum pooling for downsampling to capture the features of the data at different scales, and then fuses them with the feature map after convolution to enrich the feature information; Rep_HGBlock uses the idea of re-parameterization. In the training phase, it uses 1×1 and 3×3 convolution kernels and BatchNorm to form a parallel multi-branch structure. The input feature map is added after passing through three parallel branch structures to extract the multi-scale feature information of the input data and enhance the network's ability to express small targets. In the inference stage, the multi-branch structure consisting of 1×1 and 3×3 convolution kernels and BatchNorm is fused into a single-branch structure with only 3×3 convolution kernels by using the reparameterization method. The process of fusing the multi-branch structure into a single-branch structure is to fill the 1×1 convolution kernel with 0 values on the branch of the 1×1 convolution kernel to a 3×3 convolution kernel. On the branch with only the BN layer, a 3×3 convolution kernel is constructed by filling 0. Then, on each branch, the convolution layer and the BN layer are fused. The convolution formula is as follows: Conv(x)=W(x)+b The BatchNorm formula is shown in formula (5), where γ and β are learnable parameters: After fusing convolution and BatchNorm, the expression can be expressed as: in, represents the mean, represents the variance, represents normalization; Finally, by adding the three branches together, the parallel multi-branch structure during training can be converted to a single-branch structure during inference. DWConv first convolves each channel of the input feature map with a convolution kernel, learns features independently on different channels, and then performs weighted combination of the obtained feature maps through point-by-point convolution to obtain the final feature map.
3. According to claim 1, the human body security inspection contraband detection model based on improved yolov8s, It is characterized in that The GhostDynamicConv module includes an initial convolution operation and a cheap operation. In the initial convolution operation, the dynamic convolution with a 1×1 convolution kernel is first used to compress the number of channels of the input feature map of size C×H×W, and the number of channels is reduced to half of the original size, C / 2×H×W, and the obtained feature map is used for the cheap operation; the dynamic convolution is defined by aggregating multiple linear functions, expressed as in, represents the weight of the kth linear function, represents the bias of the kth linear function, g represents the activation function, π k (x) represents the attention weight of the kth thread function, which is dynamically adjusted according to the input; In the cheap operation, the input feature map is convolved using dynamic convolution with a 3×3 convolution kernel, and then the feature map that has undergone the convolution operation is concatenated with the feature map that has not undergone the convolution operation to restore the original number of channels. At this time, the feature map size is C×H×W.
4. According to claim 1, the human body security inspection contraband detection model based on improved yolov8s, It is characterized in that The GCADown module uses the GhostConv module as a convolution operation in ADown, and constructs a parallel branch structure with the average pooling, maximum pooling operations and GhostConv in ADown.
5. According to claim 4, the human body security inspection contraband detection model based on improved yolov8s, It is characterized in that The operation process of the GCADown module is as follows: the input feature map of size C×H×W is first subjected to an average pooling operation through a pooling window of size 2×2. The specific operation of average pooling is as follows. Among them, f i,j represents the output value, n represents the number of regions, Represents the value of the kth region of the input data; then the output feature map is divided into two branches, the number of channels of the feature map on each branch is half of the original, the size is C / 2×H×W, the first branch directly passes through GhostConv, in GhostConv, first use a 1×1 convolution kernel to aggregate the information features of the channel, and then use a 3×3 convolution kernel to convolve the result obtained by the 1×1 convolution kernel, and merge the convolution result with the other half of the channels without convolution to obtain the final result. The height and width of the final result feature map are half of the original size, and the size is C / 2×H / 2×W / 2; the specific representation is as follows: Among them, I represents the original image, I O Represents the output image, Conv 1×1 Represents the convolution operation of a 1×1 convolution kernel, Conv 3×3 represents the convolution operation of a 3×3 convolution kernel. Indicates merging along the channel dimension; on the second branch, the maximum pooling operation is first performed through a pooling window of size 3×3 to reduce the height and width of the feature map to half of the original size, C / 2×H / 2×W / 2. The specific operation is as follows: f i,j represents the output value, k represents the kth region, Represents the value of the kth region of the input data; then the output feature map passes through GhostConv with a convolution kernel of size 1×1 to obtain the result of the second branch. At this time, the feature map size is C / 2×H / 2×W / 2; finally, the results of the two branches are spliced to obtain a feature map of size C×H / 2×W / 2, and then the result of GCADown is output.
6. Detection method based on the improved yolov8s human body security inspection contraband detection model, It is characterized in that The following steps are involved: First, the image is input and the image features are extracted through the backbone network. The convolution operation in Rep_HGBlock is a parallel multi-branch structure composed of 1×1 and 3×3 convolution kernels and batch normalization layers during the training phase, which is used to enhance the feature expression ability of the image. During the inference stage, the parallel multi-branch structure will be converted into a single-branch structure with only a 3×3 convolution kernel to improve computing efficiency and performance. After passing through the backbone network, the output feature map will be passed through the neck network for more refined feature extraction. In the neck network, the height and width of the feature map are first doubled through an upsampling operation, and then the features in the neck network are combined with the feature map in the backbone network through feature fusion. The GhostDynamicConv convolution operation is then used to extract richer image features. When downsampling, GCADown is used for downsampling. Finally, the refined feature map will be sent to the detection head for prediction and classification to obtain the detection result.
7. Training method of human body security contraband detection model based on improved yolov8s, It is characterized in that The following steps are involved: Step 1: Data collection: Use millimeter wave security inspection equipment to collect a large amount of human body security inspection data with prohibited items, such as image data of metal objects such as metal knives, hammers, wrenches, or ceramic knives and alcohol non-metal objects. When collecting data, it is necessary to collect images of prohibited items of different sizes, shapes, positions, and directions to ensure that the model can learn rich features to improve the generalization ability of the model. Step 2: Data labeling: Use the LabelImg tool to label the collected image data. When labeling, the image data needs to be accurately labeled, and it is also necessary to consider that the contraband may be blocked or partially hidden to reduce the possibility of missing labels. The labeled images are divided into training sets, validation sets, and test sets. Step 3: Network training. First, the divided image data set is input into the detection model. These images are preliminarily processed through the backbone network of the detection model to extract useful feature information from the images. Then, these feature information are input into the neck network, and feature maps of different scales are fused in the neck network to enhance the feature expression ability. Finally, the fused feature map is sent to the detection head for prediction to obtain the final result.
8. Human body security contraband detection system based on improved yolov8s, It is characterized in that The invention comprises the detection model described in any one of claims 1 to 5.
Citation Information
Patent Citations
X-ray contraband detection method based on improved YOLOX
CN117173634A
X-ray contraband detection method based on improved YOLOv7
CN117496514A
Lightweight steel surface defect detection method based on improved YOLOv8n
CN118196529A
Asphalt pavement disease detection method based on YOLOv8n model
CN118247636A
Text detection method based on rotating frame
CN118314563A
Cited By
Lightweight driver distraction behavior detection method
CN119904845A
A lightweight driver distraction detection method
CN119904845B
