Human security check contraband detection model, method and system based on improved yolov8s
By improving the YOLOv8s model and combining it with the heavily parameterized HGNetV2 and GhostDynamicConv and GCADown modules, a lightweight human body security inspection contraband detection model was constructed, which solved the problem of large model parameters and computational load, and achieved efficient and accurate contraband detection.
Patent Information
- Application Number
- CN202411042905.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2044-07-31
AI Technical Summary
Existing deep learning models have too many parameters and computational load when detecting non-metallic items in human security checks, making them difficult to deploy on edge devices. Furthermore, traditional methods are time-consuming, labor-intensive, and prone to misjudgment.
An improved YOLOv8s model is adopted, using a reparameterized HGNetV2 as the backbone network, and combining GhostDynamicConv and GCADown modules for convolution operations and downsampling to construct a lightweight human security inspection contraband detection model.
It improves the accuracy of contraband detection, reduces the number of model parameters and computational load, making it suitable for resource-constrained equipment deployment, and improves detection efficiency and accuracy.
Smart Images

Figure CN119068238B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image detection technology, specifically to an improved YOLOv8s-based model, method, and system for detecting contraband in human security checks. Background Technology
[0002] Traditional methods of detecting prohibited items in security checks combine metal detectors with manual body searches. Metal detectors are primarily used to detect metal objects, but they are ineffective against non-metallic materials such as ceramics, glass, and plastics, as well as flammable and explosive materials and corrosive liquids. Security personnel then use handheld metal detectors behind the metal detectors for further inspection, while simultaneously conducting manual checks on non-metallic items. This method is not only time-consuming and labor-intensive, but may also infringe on personal privacy and is susceptible to human error and negligence. With technological advancements, millimeter-wave metal detectors can be used for prohibited item detection. Deep learning-based detection algorithms can identify and detect prohibited items from images captured by millimeter-wave imaging, enabling rapid detection that meets the demands of fast-paced security checks and significantly improving accuracy. However, image recognition technology faces several challenges: in security scenarios requiring rapid detection, while some deep learning models are accurate, their large parameter count, computational complexity, and model size make them difficult to deploy on limited edge devices. Therefore, lightweighting the model is crucial. Summary of the Invention
[0003] The technical problem to be solved by this invention is how to construct a lightweight human body security screening network for detecting prohibited items.
[0004] The present invention solves the above-mentioned technical problems through the following technical means:
[0005] A human body security inspection contraband detection model based on improved YOLOv8s, including backbone network and neck network;
[0006] The backbone network uses the reparameterized HGNetV2, and the neck network uses the GhostDynamicConv module for convolution operations and the GCADown module for downsampling operations in the neck network.
[0007] The GCADown module uses the GhostConv module as a convolution operation in ADown, and constructs a parallel branch structure with the average pooling, max pooling operations and GhostConv in ADown.
[0008] Furthermore, the specific structure of the backbone network is as follows: the reparameterized HGNetV2 includes HGStem, Rep_HGBlock, and DWConv;
[0009] HGStem, as a preprocessing layer, first extracts features from the input data through convolution operations, then uses max pooling for downsampling to capture features at different scales, and finally fuses them with the convolutional feature map to make the feature information richer.
[0010] Rep_HGBlock utilizes the concept of reparameterization. During the training phase, it uses 1×1 and 3×3 convolutional kernels with BatchNorm to form a parallel multi-branch structure. The input feature map is processed through three parallel branches and then summed to extract multi-scale feature information from the input data, enhancing the network's ability to represent features of small objects. During the inference phase, the reparameterization method merges the parallel multi-branch structure of 1×1 and 3×3 convolutional kernels with BatchNorm into a single-branch structure with only 3×3 convolutional kernels. The process of merging the multi-branch structure into a single-branch structure involves padding the 1×1 convolutional kernel with zeros to transform it into a 3×3 convolutional kernel on the branch with only BN layers. On the branch with only BN layers, 3×3 convolutional kernels are constructed by padding with zeros. Then, on each branch, convolutional kernels and BN layers are merged. The convolution formula is expressed as follows:
[0011] Conv(x)=W(x)+b
[0012] The BatchNorm formula is shown in equation (5), where γ and β are learnable parameters:
[0013]
[0014] After fusing convolution and BatchNorm, its expression can be represented as:
[0015]
[0016] in, This represents the mean. Represents variance. Indicates normalization;
[0017] Finally, by adding the three branches together, the parallel multi-branch structure during training can be converted into a single-branch structure during inference.
[0018] DWConv first performs convolution operations on each channel of the input feature map using convolution kernels, learning features independently on different channels. Then, it performs weighted combination of the obtained feature maps using pointwise convolution to obtain the final feature map.
[0019] Furthermore, the GhostDynamicConv module includes initial convolution operations and a cost-saving operation. In the initial convolution operation, a dynamic convolution with a 1×1 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, resulting in a size of C / 2×H×W. The resulting feature map is then used for the cost-saving operation. The dynamic convolution is defined by aggregating multiple linear functions, expressed as follows:
[0020]
[0021] in, This represents the weight of the k-th linear function. Let g represent the bias of the k-th linear function, g represent the activation function, and π represent the bias of the k-th linear function. k (x) represents the attention weight of the k-th thread function, which is dynamically adjusted based on the input;
[0022] In the low-cost operation, dynamic convolution with a 3×3 kernel is used to convolve the input feature map. Then, the convolved feature map is concatenated with the unconvolved feature map 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, max 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 first undergoes average pooling operation through a pooling window of size 2×2. The specific operation of average pooling is as follows.
[0025]
[0026] Among them, f i,j This represents the output value, where n represents the number of regions. This represents the value of the k-th region of the input data. The output feature map is then divided into two branches, each with half the number of channels and a size of C / 2 × H × W. The first branch directly passes through GhostConv. In GhostConv, a 1×1 convolutional kernel is first used to aggregate the information features between channels. Then, a 3×3 convolutional kernel is used to convolve the result obtained from the 1×1 kernel. The resulting convolutional output is merged with the unconvolved channels to obtain the final result. The height and width of the final feature map are half of the original input, with a size of C / 2 × H / 2 × W / 2. The specific representation is as follows:
[0027]
[0028] Where I represents the original image, I O Indicates the output image, Conv 1×1 Conv represents a convolution operation with a 1×1 kernel. 3×3 This represents a convolution operation with a 3×3 kernel. This indicates merging along the channel dimension; in the second branch, first, max pooling is performed through a 3×3 pooling window, reducing the height and width of the feature map to half of their original size, which is C / 2×H / 2×W / 2. The specific operation is as follows:
[0029]
[0030] f i,j This represents the output value, where k represents the k-th region. This represents the value of the k-th region of the input data; then the output feature map is passed through GhostConv with a 1×1 convolution kernel to obtain the result after the second branch, at which point the feature map size is C / 2×H / 2×W / 2; finally, the results of the two branches are concatenated to obtain a feature map of size C×H / 2×W / 2, and then the result of GCADown is output.
[0031] This 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, an image is input, and image features are extracted through a backbone network. During the training phase, the convolutional operations in Rep_HGBlock consist of a parallel multi-branch structure composed of 1×1 and 3×3 convolutional kernels and batch normalization layers to enhance the image's feature representation capability. During the inference phase, the parallel multi-branch structure is converted into a single-branch structure with only 3×3 convolutional kernels to improve computational efficiency and performance. The feature map output from the backbone network is then processed by a neck network for more refined feature extraction. In the neck network, upsampling first doubles the height and width of the feature map, then feature fusion combines the features from the neck network with those from the backbone network. Further richer image features are extracted through GhostDynamicConv convolutional operations, and downsampling is performed using GCADown. Finally, the refined feature map is fed into a detection head for prediction and classification to obtain the detection result.
[0032] This invention also provides a training method for a human body security screening contraband detection model based on an improved YOLOv8s, comprising the following steps:
[0033] Step 1: Data Acquisition. Use millimeter-wave security inspection equipment to collect a large amount of security inspection data on people carrying prohibited items, such as images of metal objects like metal knives, hammers, and wrenches, or non-metallic items like ceramic knives and alcohol. When collecting data, it is necessary to collect images of prohibited items of different sizes, shapes, positions, and orientations to ensure that the model can learn rich features to improve the model's generalization ability.
[0034] Step 2: Data annotation. Use the LabelImg tool to annotate the collected image data. The annotation of the image data needs to be accurate, and it is also necessary to take into account the possibility that the prohibited items may be occluded or partially hidden to reduce the number of missed annotations. Divide the labeled images into training set, validation set and test set.
[0035] Step 3: Network training. First, the segmented image dataset is input into the detection model. These images undergo preliminary processing through the backbone network of the detection model to extract useful feature information from the images. Next, this feature information is input into the neck network, where feature maps of different scales are fused to enhance the expressive power of the features. Finally, the fused feature map is fed into the detection head part for prediction to obtain the final result.
[0036] The present invention also provides a human body security inspection system for detecting prohibited items based on an improved YOLOv8s, including the detection model described above.
[0037] The advantages of this invention are:
[0038] Improved target detection accuracy: By using three network structures—RepHGNetV2, GCADown, and GhostDynamicConv—yolov8s was improved, effectively increasing the accuracy of contraband detection in the scenario of human security checks.
[0039] Reduced model file computation: By integrating the three network structures RepHGNetV2, GCADown, and GhostDynamicConv, the number of model parameters and computational cost are significantly reduced. Due to the reduction in model file size, it is more conducive to deploying the model on resource-constrained devices. Attached Figure Description
[0040] Figure 1 This is a schematic diagram of the overall structure of the detection model in the embodiment of the invention;
[0041] Figure 2 The HGStem structure is shown in this embodiment of the invention.
[0042] Figure 3 This is the HGBlock structure in the embodiment of the present invention;
[0043] Figure 4 This is the RepConv structure in the embodiments of the present invention;
[0044] Figure 5 This is the GhostDynamicConv structure in the embodiments of the present invention;
[0045] Figure 6 This is the GCAdown structure in the embodiment of the present invention;
[0046] Figure 7 This is a flowchart illustrating the training process of the detection model in an embodiment of the present invention. Detailed Implementation
[0047] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort 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 an improved YOLOv8s. Traditional human body contraband detection methods rely on manual search when inspecting non-metallic items. The deep learning model, trained with a large amount of data, can identify and detect various contraband items, including both metallic and non-metallic items, improving detection accuracy. Furthermore, 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—yolov8s is improved. Compared to yolov8s, it improves the accuracy of contraband detection while reducing the number of parameters and computational cost, making it more suitable for deployment on devices with limited resources.
[0051] The overall structure of the detection model in this embodiment is as follows: Figure 1As shown, the network includes a backbone network, a neck network, and a detection head. A reparameterization method is introduced into the HGNetV2 structure, and the reparameterized HGNetV2 is then used as the backbone network. In the neck network, GhostDynamicConv is used for convolution operations, and GCADown is used for downsampling operations. A dataset is constructed using millimeter-wave images acquired by security inspection equipment, and this dataset is then input into the network. First, the images are input, and image features are extracted through the backbone network. During the training phase, the convolution operations in Rep_HGBlock consist of a parallel multi-branch structure composed of 1×1 and 3×3 convolutional kernels and batch normalization layers to enhance the image feature representation capability. During the inference phase, the parallel multi-branch structure is converted into a single-branch structure with only 3×3 convolutional kernels to improve computational efficiency and performance. The feature map output from the backbone network is then processed by the neck network for further refined feature extraction. In the neck network, upsampling first doubles the height and width of the feature map. Then, feature fusion combines the features from the neck network with those from the backbone network. Finally, GhostDynamicConv convolutions extract richer image features. During downsampling, the GCADown module effectively reduces the model's parameters and computational cost while learning multiple different features, improving object detection accuracy. Finally, the refined feature map is fed into the detection head for prediction and classification, yielding the detection result. The loss function of this network is the CIOU loss function, as shown below:
[0052]
[0053]
[0054]
[0055] Where IOU is the intersection-union ratio of the target box and the predicted box, ρ is the Euclidean distance between the center points of the target box and the predicted box, A and B represent the centers of the target box and the predicted box, respectively, and c is the diagonal of the smallest rectangle covering the detection box and the target box. The penalty term represents the distance from the center point, αv is the aspect ratio penalty term, and w and h represent the length and width of the detection box, respectively. target and h target These represent the length and width of the target bounding box, respectively.
[0056] The following is a detailed description of each part:
[0057] 1. Backbone Network
[0058] The backbone network uses the reparameterized HGNetV2, which consists of three parts: HGStem, Rep_HGBlock, and DWConv.
[0059] like Figure 2 , Figure 3 As shown, HGStem, as a preprocessing layer, first extracts the features of the input data through convolution operations, then uses max pooling for downsampling to capture the features of the data at different scales, and then fuses them with the convolutional feature map to make the feature information richer.
[0060] like Figure 4 The Rep_HGBlock structure shown utilizes reparameterization. During training, it uses 1×1 and 3×3 convolutional kernels with BatchNorm to form a parallel multi-branch structure. The input feature map is processed through three parallel branches and then summed to extract multi-scale feature information from the input data, enhancing the network's ability to represent features of small targets and thus improving the model's accuracy in identifying contraband. During inference, reparameterization is used to fuse the parallel multi-branch structure of 1×1 and 3×3 convolutional kernels with BatchNorm into a single-branch structure with only 3×3 convolutional kernels, reducing computational load and improving efficiency. The process of fusing the multi-branch structure into a single-branch structure involves padding the 1×1 kernel with zeros to create a 3×3 kernel on the 1×1 kernel branch. Similarly, on branches with only BN layers, 3×3 kernels are constructed by padding with zeros. Finally, on each branch, a BN layer is fused between the convolutional kernels. The convolution formula is as follows:
[0061] Conv(x)=W(x)+b (4)
[0062] The BatchNorm formula is shown in equation (5), where γ and β are learnable parameters:
[0063]
[0064] After fusing convolution and BatchNorm, its expression can be represented as:
[0065]
[0066] in, This represents the mean. Represents variance. This indicates normalization.
[0067] Finally, the three branches are added together, thus transforming the parallel multi-branch structure during training into a single-branch structure during inference.
[0068] DWConv first performs convolution operations on each channel of the input feature map using convolution kernels, learning features independently on different channels. Then, it performs weighted combination of the obtained feature maps through pointwise convolution to obtain the final feature map. This method can reduce the number of parameters in the convolution calculation and reduce the computational load.
[0069] 2. Neck network
[0070] 2.1 GhostDynamicConv
[0071] like Figure 5 As shown, the GhostDynamicConv module is mainly divided into initial convolution operations and low-cost operations. The core idea is to obtain a semantically richer model through re-convolution operations on a small number of feature maps. The initial convolution operation compresses the number of channels, reducing the computational cost of subsequent operations. The low-cost operation obtains Ghost feature maps that differ from the original feature maps, allowing for richer semantic information to be acquired during network training. In the initial convolution operation, a dynamic convolution with a 1×1 kernel is first used to compress the number of channels in the input feature map of size C×H×W, reducing it to half its original size (C / 2×H×W). The resulting feature map is then used for the low-cost operation. Dynamic convolution is defined by aggregating multiple linear functions, expressed as...
[0072]
[0073] in, This represents the weight of the k-th linear function. Let g represent the bias of the k-th linear function, g represent the activation function, and π represent the bias of the k-th linear function. k (x) represents the attention weight of the k-th thread function, which is dynamically adjusted based on the input. In the low-cost operation, dynamic convolution with 3×3 kernels is used to convolve the input feature map. Then, the convolved feature map is concatenated with the unconvolved feature map to restore the original number of channels. At this point, the feature map size is C×H×W. This operation allows the network to learn more complex features with only a small increase in computation, thereby improving the accuracy of object detection.
[0074] 2.2 GCADown
[0075] This embodiment proposes a GCADown module for downsampling operations. It uses the GhostConv module as the convolution operation within ADown, constructing a parallel branch structure with the average pooling, max pooling, and GhostConv operations in ADown. The specific structure is as follows: Figure 6As shown. Average pooling helps to capture global information, while max pooling helps to capture local salient features. GhostConv requires only half the computation of a regular convolution operation during convolution. Therefore, the GCADown module can capture features at different scales, enabling the network to learn richer features while effectively reducing the computational cost of the model. The input feature map of size C×H×W is first subjected to average pooling through a 2×2 pooling window. The specific operation of average pooling is shown below.
[0076]
[0077] Among them, f i,j This represents the output value, where n represents the number of regions. This represents the value of the k-th region of the input data. The output feature map is then divided into two branches, each with half the number of channels and a size of C / 2 × H × W. The first branch passes directly through GhostConv. In GhostConv, a 1×1 convolutional kernel is first used to aggregate the information features between channels. Then, a 3×3 convolutional kernel is used to convolve the result obtained from the 1×1 kernel. The resulting convolutional output is merged with the unconvolved channels to obtain the final result. The height and width of the final feature map are half that of the original input, with a size of C / 2 × H / 2 × W / 2. The specific representation is as follows:
[0078]
[0079] Where I represents the original image, I O Indicates the output image, Conv 1×1 Conv represents a convolution operation with a 1×1 kernel. 3×3 This represents a convolution operation with a 3×3 kernel. This indicates merging along the channel dimension. In the second branch, max pooling is first performed through a 3×3 pooling window, reducing the height and width of the feature map to half of their original size, which is C / 2×H / 2×W / 2. The specific operation is shown below.
[0080]
[0081] f i,j This represents the output value, where k represents the k-th region. This represents the value of the k-th region of the input data. The output feature map is then passed through a GhostConv convolution with a 1×1 kernel, resulting in the second branch. At this point, the feature map size is C / 2×H / 2×W / 2. Finally, the results from the two branches are concatenated to obtain a feature map of size C×H / 2×W / 2, which is then output as the GCADown result.
[0082] To verify the effectiveness of the GCADown module, YOLOv8s was used as the baseline model. The Conv module in the YOLOv8s neck network was modified with GCADown, and the performance was compared. As shown in Table 1, using GCADown can effectively reduce the number of model parameters, computational cost, and model size, while also improving the model's recognition accuracy.
[0083] Table 1. Validation of GCADown
[0084]
[0085] The detection model in this embodiment achieves improved accuracy in identifying prohibited items compared to YOLOv8s, while simultaneously reducing computational cost. The improved backbone network effectively reduces the number of parameters and computational cost, while enhancing detection performance. The GhostDynamicConv module used in the neck network can learn richer features with lower computational cost, resulting in better network performance. The GCADown module reduces the number of parameters, computational cost, and model size while fusing different features, further improving model performance.
[0086] Generally, precision (P), recall (R), mean average precision (mAP), number of model parameters, computational cost (Floating Point Operations Per Second, FLOPs), and model size are commonly used as performance metrics for models. The formulas for these metrics are shown below:
[0087]
[0088]
[0089]
[0090]
[0091] Wherein, TP represents the number of prohibited items that the model can correctly identify, FP represents the number of prohibited items that the model incorrectly identifies, and FN represents the number of items that the model identifies as prohibited items but are incorrectly categorized.
[0092] This embodiment 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, our proposed method effectively reduces the number of parameters, computational cost, and model size, while also achieving optimal accuracy in item recognition.
[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 Acquisition. A large amount of security inspection data is collected using millimeter-wave security screening equipment, including images of individuals carrying prohibited items such as metal knives, hammers, wrenches, and other metal objects, or non-metallic items such as ceramic knives and alcohol. During data acquisition, images of prohibited items of different sizes, shapes, positions, and orientations need to be collected to ensure the model can learn rich features to improve its generalization ability.
[0098] Step 2: Data annotation. Use the LabelImg tool to annotate the collected image data. Annotation requires precise labeling of the image data, and also needs to account for situations where prohibited items may be obscured or partially hidden to reduce missed annotations. Divide the labeled images into training, validation, and test sets.
[0099] Step 3: Network Training. First, the segmented image dataset is input into the network. These images undergo preliminary processing through the model's backbone network to extract useful feature information. Next, this feature information is input into the neck network, where feature maps of different scales are fused to enhance the expressive power of the features. Finally, the fused feature map is fed into 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, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A human body security inspection contraband detection model based on an improved YOLOv8s, characterized in that, Including the backbone network and the neck network; The backbone network uses the reparameterized HGNetV2, and the neck network uses the GhostDynamicConv module for convolution operations and the GCADown module for downsampling operations in the neck network. The GCADown module uses GhostConv as a convolution operation in ADown, and constructs a parallel branch structure with the average pooling, max pooling operations and GhostConv in ADown. The specific structure of the backbone network is as follows: the reparameterized HGNetV2 includes HGStem, Rep_HGBlock, and DWConv; HGStem, as a preprocessing layer, first extracts features from the input image data through convolution operations, then performs downsampling using max pooling to capture features at different scales, and finally fuses them with the convolutional feature map to enrich the feature information. Rep_HGBlock utilizes the concept of reparameterization. During the training phase, it uses 1×1 and 3×3 convolutional kernels and BatchNorm to form a parallel multi-branch structure. The input feature map is processed through three parallel branch structures and then summed to extract multi-scale feature information of the input data, thereby enhancing the network's ability to express the features of small targets. During the inference phase, a reparameterization method is used to fuse 1×1 and 3×3 convolutional kernels with BatchNorm into a parallel multi-branch structure, which is then merged into a single-branch structure with only 3×3 convolutional kernels. The process of merging the multi-branch structure into a single-branch structure involves padding the 1×1 kernels with zeros to transform them into 3×3 kernels on branches with only BN layers. Similarly, on branches with only BN layers, 3×3 convolutional kernels are constructed by padding with zeros. Finally, on each branch, a BN layer is fused with the convolutional kernels. The convolution formula is expressed as follows: Conv(x)=W(x)+b The BatchNorm formula is shown below, where γ and β are learnable parameters: After fusing convolution and BatchNorm, its expression can be represented as: Where, μ B σ represents the mean. 2 Indicates variance; Indicates normalization; Finally, by adding the three branches together, the parallel multi-branch structure during training can be converted into a single-branch structure during inference. DWConv first performs convolution operations on each channel of the input feature map using convolution kernels, learning features independently on different channels. Then, it performs weighted combination of the obtained feature maps using pointwise convolution to obtain the final feature map.
2. The human body security inspection contraband detection model based on the improved YOLOv8s as described in claim 1, characterized in that, The GhostDynamicConv module includes an initial convolution operation and a cheapening operation. In the initial convolution operation, a dynamic convolution with a 1×1 kernel is first used to compress the number of channels in the input feature map of size C×H×W, reducing it to half its original size (C / 2×H×W). This resulting feature map is then used for the cheapening operation. The dynamic convolution is defined by aggregating multiple linear functions, expressed as... in, This represents the weight of the k-th linear function. Let g represent the bias of the k-th linear function, g represent the activation function, and π represent the bias of the k-th linear function. k (x′) represents the attention weight of the k-th thread function, which is dynamically adjusted based on the input; In the low-cost operation, dynamic convolution with a 3×3 kernel is used to convolve the input feature map. Then, the convolved feature map is concatenated with the unconvolved feature map to restore the original number of channels. At this time, the feature map size is C×H×W.
3. The human body security inspection contraband detection model based on the improved YOLOv8s as described in claim 1, characterized in that, The operation process of the GCADown module is as follows: The input feature map of size C×H×W first undergoes average pooling through a 2×2 pooling window. The specific operation of average pooling is as follows: Among them, f i,j This represents the output value, where n represents the number of regions. This represents the value of the k-th region of the input data. The output feature map is then divided into two branches, each with half the number of channels and a size of C / 2 × H × W. The first branch passes directly through GhostConv. In GhostConv, a 1×1 convolutional kernel is first used to aggregate the information features after channel aggregation. Then, a 3×3 convolutional kernel is used to convolve the result obtained from the 1×1 kernel. The resulting 3×3 convolution is then merged with the unconvolved channels to obtain the final result. The height and width of the final feature map are half that of the original input, with a size of C / 2 × H / 2 × W / 2. The specific representation is shown below: Where I represents the original image, I O Indicates the output image, Conv 1×1 Conv represents a convolution operation with a 1×1 kernel. 3×3 This represents a convolution operation with a 3×3 kernel. This indicates merging along the channel dimension; in the second branch, first, max pooling is performed through a 3×3 pooling window, reducing the height and width of the feature map to half of their original size, which is C / 2×H / 2×W / 2. The specific operation is as follows: f i,j This represents the output value, where k represents the k-th region. This represents the value of the k-th region of the input data; then the output feature map is passed through GhostConv with a 1×1 convolution kernel to obtain the result after the second branch, at which point the feature map size is C / 2×H / 2×W / 2; finally, the results of the two branches are concatenated to obtain a feature map of size C×H / 2×W / 2, and then the result of GCADown is output.
4. The detection method based on the improved YOLOv8s-based human body security screening contraband detection model as described in any one of claims 1 to 3, characterized in that, Includes the following steps: First, the image is input, and image features are extracted through the backbone network. In the Rep_HGBlock, the convolution operation during the training phase consists of a parallel multi-branch structure composed of 1×1 and 3×3 convolution kernels and batch normalization layers, which is used to enhance the feature representation capability of the image. During the inference phase, the parallel multi-branch structure is converted into a single-branch structure with only 3×3 convolutional kernels to improve computational efficiency and performance. The feature map output after passing through the backbone network is then processed by the neck network for more refined feature extraction. In the neck network, the height and width of the feature map are first enlarged by a factor of two through upsampling. Then, feature fusion is performed to combine the features in the neck network with those in the backbone network. Finally, GhostDynamicConv convolution operation is used to extract richer image features. During downsampling, GCADown is used for downsampling. Finally, the refined feature map is fed into the detection head for prediction and classification to obtain the detection results.
5. The training method for the improved YOLOv8s-based human body security inspection contraband detection model as described in any one of claims 1 to 3, characterized in that, Includes the following steps: Step 1: Data Acquisition. Use millimeter-wave security inspection equipment to collect a large amount of security inspection data on people carrying contraband, including image data of metal or non-metal items. When collecting data, it is necessary to collect images of contraband of different sizes, shapes, positions and orientations to ensure that the model can learn rich features to improve the model's generalization ability. Step 2: Data annotation. Use the LabelImg tool to annotate the collected image data. The annotation of the image data needs to be accurate, and it is also necessary to take into account the possibility that the prohibited items may be occluded or partially hidden to reduce the number of missed annotations. Divide the labeled images into training set, validation set and test set. Step 3: Network training. First, the segmented image dataset is input into the detection model. These images undergo preliminary processing through the backbone network of the detection model to extract useful feature information from the images. Next, this feature information is input into the neck network, where feature maps of different scales are fused to enhance the expressive power of the features. Finally, the fused feature map is fed into the detection head part for prediction to obtain the final result.
6. A human body security screening system for detecting prohibited items based on an improved YOLOv8s, characterized in that: Includes the detection model described in any one of claims 1 to 3.
Citation Information
Patent Citations
Lightweight steel surface defect detection method based on improved YOLOv8n
CN118196529A
Asphalt pavement disease detection method based on YOLOv8n model
CN118247636A