Human body key point detection method and system based on DSW-YOLO network
By improving the YOLOv8 model to the DSW-YOLO network, using C2Dcn, SPPFCDC, DySample and WIoUv3 technical means, the problem of low accuracy of human key points detection in the YOLOv8 model under occlusion is solved, and more efficient and stable key point detection is achieved.
Patent Information
- Application Number
- CN202510587844.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-08
- Publication Date
- 2025-08-08
AI Technical Summary
When dealing with the detection of key points of the obstructed human body, the existing YOLOv8 model is prone to missed detection and missed detection, especially in an environment where multiple people are obstructed, the detection accuracy is not high.
The YOLOv8 model is improved to a DSW-YOLO network, and the feature extraction and fusion capability is enhanced by designing the variable convolution feature enhancement module C2Dcn, the dynamic convolution feature pyramid pooling module SPPFCDC, the dynamic sampling interpolation algorithm DySample and the third-generation weighted interpolation loss function WIoUv3, the feature extraction and fusion capabilities are enhanced and the model is robust to occlusion conditions.
It significantly improves the accuracy and stability of human key points detection, especially in complex scenarios and occlusion situations, reduces false detection and missed detection, and improves detection efficiency and generalization capabilities of the model.
Smart Images

Figure CN120452022A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a human key point detection method and system based on a DSW-YOLO network. Background Art
[0002] Human keypoint detection is a core task in computer vision. Its goal is to accurately locate the 2D or 3D coordinates of key human parts (such as the head, shoulders, elbows, and knees) from images or videos. This task not only directly serves high-level vision tasks such as behavior recognition and motion capture, but also has broad applications in augmented reality (AR), virtual reality (VR), intelligent monitoring, medical rehabilitation, motion analysis, and other fields. For example, human keypoint detection enables real-time analysis of athletes' movements and postures to optimize athletic performance. In the medical field, keypoint detection can assist in assessing patients' gait or providing accurate feedback for rehabilitation training. In the entertainment industry, human pose estimation is a key technology driving the motion capture and real-time generation of virtual characters.
[0003] Currently, there are two mainstream approaches to human pose recognition: top-down and bottom-up. These two methods employ different strategies and processes for estimating the pose of multiple people. The top-down method first detects people and then detects key points within the image frame of each person. The advantage of this method is that it can leverage existing object detection technology to locate each person, simplifying the subsequent key point detection process. Each detected person can be processed individually, resulting in more accurate estimation of key point locations. These methods are generally slower, but offer higher pose estimation accuracy. Currently, mainstream algorithms include CPN, Hourglass, CPM, Alpha Pose, HRNet, RMPE, and RTMPose.
[0004] Bottom-up methods first detect all possible keypoints and then combine these keypoints into different tasks using an association algorithm. This method does not require pre-detection of human frames and can therefore handle dense crowd scenes. However, due to the need to match multiple keypoints, this method can be more complex. Because it first detects human body parts in the image and then combines the parts of multiple people in the image into a human body, this method is often faster during testing and inference, but with slightly lower accuracy. A typical example is the COCO 2016 human keypoint detection algorithm Open Pose. This model is a single-stage network that directly regresses all keypoints of all objects through the network, then binds the scattered keypoints to each object, ultimately generating keypoint groups for different objects.
[0005] The complexity of human keypoint detection lies in the need to accurately cope with a variety of scenarios and pose variations, including occlusion, varying illumination, background interference, and multi-person interactions. Early research primarily relied on traditional methods based on handcrafted features. While these methods achieved some useful results, they were limited by the expressive power of feature extraction and struggled to cope with complex pose variations and environmental interference. In recent years, with the rapid development of deep learning technology and the public availability of large-scale annotated datasets, methods based on deep neural networks have significantly improved the accuracy and robustness of keypoint detection. Among them, the keypoint detection algorithm of the YOLOv8 model has garnered widespread application and attention due to its fast detection and end-to-end training capabilities. However, it also has some significant drawbacks. In some cases where the human body is occluded, the algorithm struggles to accurately predict the occluded keypoint information, making missed detections and false detections a common problem. This is particularly true in environments where multiple people are occluded, where false detections are more pronounced. Therefore, the present invention proposes a human key point detection method and system based on the DSW-YOLO network to solve the above problems. Summary of the Invention
[0006] In view of the shortcomings of the existing technology, the present invention develops a human key point detection method and system based on the DSW-YOLO network. The DSW-YOLO network model constructed by improving the YOLOv8 model can fully extract the occluded key point information.
[0007] On the one hand, the technical solution to the technical problem of the present invention is a human key point detection method based on the DSW-YOLO network, comprising the following steps: S1. Select an existing image dataset for key point detection, obtain data in the image dataset, and preprocess the data in the image dataset; S2. Build the DSW-YOLO dynamic spatial weighted single-shot detection network model based on the YOLOv8 model. The DSW-YOLO network model includes the Backbone network module, the Neck module, the Head module, and the loss function. The DSW-YOLO network model is obtained by improving the YOLOv8 model. The improvements are as follows: In the YOLOv8 model, a variable convolution feature enhancement module C2Dcn is designed to replace the two-stage feature fusion convolution module C2f in the YOLOv8 model. A dynamic convolution feature pyramid pooling module SPPFCDC is designed to replace the original feature pyramid module SPPF in the backbone network of the YOLOv8 model. In the Neck module of the YOLOv8 model, the dynamic sampling interpolation algorithm DySample is used to replace the original upsampling algorithm module. The network loss function of the YOLOv8 model is replaced with the third-generation weighted intersection-over-union loss function WIoUv3. S3, input the preprocessed data set into the DSW-YOLO network model, and train and verify the DSW-YOLO network model; S4. Input the trained DSW-YOLO network model into the key point detection system to detect the key point positions of the human body.
[0008] S1 is as follows: The existing COCO2017 image dataset is selected for model training and verification. The data in the COCO2017 image dataset is preprocessed. The preprocessing operations include data cleaning, data enhancement and data normalization, and then a dataset for key point detection is obtained, in which each image contains task information.
[0009] The C2Dcn module is as follows: By adopting the double-layer deformable convolution DCNv2 stacking operation and combining it with the residual connection to form the bottleneck structure module Bottleneck_DCNv of the deformable convolution, the Bottleneck module in C2f is replaced by the Bottleneck_DCNv2 module to obtain the C2Dcn module; Replace the C2f modules after the third stage P3 and the fifth stage P5 in the YOLOv8 model backbone network with the C2Dcn module, and replace all C2f modules in the Neck network of the YOLOv8 model with C2Dcn modules, and use the replaced C2Dcn modules as feature fusion modules; After the feature map is input to the C2Dcn module, it first passes through a convolution layer to reduce the number of channels of the feature map. Then, the feature map is divided into two parts through the Split operation. One part is input to n Bottleneck_DCNv2 modules for deformable convolution operation, and the other part is directly output and spliced with the feature maps processed by n Bottleneck_DCNv2 modules. The spliced features are input to a convolution layer again to restore the number of channels of the feature map to obtain the final output feature map of the C2Dcn module. In the process of processing the feature map by the Bottleneck_DCNv2 module, the add setting is provided to indicate whether to perform the residual operation. add indicates whether to add the residual operation. If add is set to true, it indicates that the residual connection operation is performed. At the same time, the add setting is provided in the Neck network to indicate whether to perform the residual operation. If add is set to false, it indicates that the residual connection operation is not performed, and DCNv2 is directly used for feature transformation.
[0010] The double-layer deformable convolution DCNv2 is as follows: The convolution kernel of the double-layer deformable convolution DCNv2 dynamically adjusts the sampling position through a learnable offset to capture the geometric deformation characteristics of the target. Assume that the input feature map of DCNv2 is X, the output feature map is Y, the convolution kernel is W, and the size of the convolution kernel W is K×K; Based on the standard convolution operation, DCNv2 introduces an offset for each sampling point of the convolution kernel. , so that the sampling position is from a fixed grid Convert to dynamic position , and then obtain the single-layer deformable convolution DCNv1, Indicates the index of the sampling point; where the offset Generated by a separate convolutional layer, the convolutional layer is the offset prediction layer, the input of the offset prediction layer is the input feature map X, and the output is the offset feature map , the calculation process is , Represents the convolution kernel weight of the offset prediction layer, which is back-propagated to Perform optimization training. For convolution kernel size K×K, the offset feature map have offsets, where is the number of convolution kernel positions, The offset is split into and , and Represents the offset in the x and y directions respectively, It means the offset in two directions; Then, based on the deformable convolution DCNv1, a modulation coefficient is introduced for each sampling point To represent the weight of the sampling point, , and then get the double-layer deformable convolution DCNv2; where the modulation coefficient Generated by a single convolutional layer whose input is the feature map X and output is the modulation coefficient , the calculation process is , Represents the convolution kernel weight of the convolution layer, Represents the Sigmoid function, the convolution layer is learned by the convolution kernel weight Perform weighted summation on the input feature map X to generate an intermediate feature map, apply the Sigmoid function to normalize each sampling point of the intermediate feature map, and obtain the final modulation coefficient Through the modulation coefficient, the network can dynamically adjust the weight of each sampling point, thereby enhancing the ability to express complex targets. In this process, the convolution kernel weight is a learnable parameter that is automatically adjusted through training to minimize the network's loss function. Output feature map after deformable convolution , the calculation formula is as follows: , in, Indicates the output location point, Represents the pixel value obtained according to the offset sampling position in the input feature map X, Indicates The output feature map at represents a fixed sampling position, Indicates the offset of each sampling point, Indicates the modulation coefficient.
[0011] The dynamic convolution feature pyramid pooling module SPPFCDC is as follows: The SPPFCDC module replaces the feature pyramid module SPPF in the YOLOv8 model. The SPPFCDC module combines the SPPF module in the YOLOv8 model with the idea of performing convolution processing on one part of the cross-stage partial network CSPNet and directly saving the other part. It also introduces DCNv2. After the feature map is input into the SPPFCDC module, it is divided into two branches. The first branch is responsible for extracting multi-scale local features. The feature map first passes through a 1×1 convolution layer to compress the number of channels of the feature map, and then passes through DCNv2 to extract the features of the local area, thereby obtaining a feature map with high local adaptability and deformation processing capabilities. The multi-scale context information of the feature map is then enhanced through the feature pyramid module SPPF, where the last convolution layer of the feature pyramid module SPPF is replaced by DCNv2, and the output of the feature pyramid module SPPF is then subjected to a 3×3 convolution, and finally the fused multi-scale feature map is output. ; The second branch compresses the number of channels through a 1×1 convolution layer to generate a new feature map ; Multi-scale feature maps and feature maps The splicing is performed in the channel dimension to form the spliced features. Finally, the number of channels of the spliced features is compressed to the target output channel number through one 1×1 convolution layer, and the final output feature map of the SPPFCDC module is obtained.
[0012] The dynamic sampling interpolation algorithm DySample is as follows: The dynamic sampling interpolation algorithm DySample module replaces the nearest neighbor upsampling algorithm module in the YOLOv8 model. DySample dynamically adjusts the sampling position by offsetting each pixel in the feature map to adapt to the local set structure of the input feature map, assigns a dynamic weight to each sampling point, and then weights the sampling area based on content information. The calculation formula of DySample is as follows: , in, represents the input feature map of DySample, express The output feature map at Indicates a fixed sampling reference point location, express No. sampling points, express The offset, Indicates the number of sampling points, express Dynamic weight.
[0013] The WIoUv3 loss function is as follows: The WIoUv3 loss function introduces a dynamic non-monotonic aggregation mechanism, which defines the degree of departure from the skirt. To evaluate the quality of the anchor frame, and according to the degree of skirt Dynamically adjust the gradient gain, that is, through the skirt Construct a non-monotonic focusing coefficient and apply it to the first-generation weighted intersection-over-union loss function WIoUv1 to obtain the WIoUv3 loss function; Skirt The smaller the value, the higher the anchor frame quality, the smaller the gradient benefit, and thus the less interference training of the DSW-YOLO network model. If the value is large, the anchor box quality is average, which distributes a large gradient benefit and promotes the learning of the DSW-YOLO network model; The calculation process of defining the WIoUv3 loss function is as follows: , , , , , , in, express loss function, represents the dynamic adjustment factor, , Representation basis loss, , Indication Standard loss, and represents the center coordinate of the anchor box, and Indicates the center coordinates of the target box, and Represent the length and width of the union area of the anchor box and the target box respectively, Indicates the degree of separation from the skirt, * indicates the separation of the computational graph, Represents the weighted loss, express The average value of represents the WIoUv3 loss function, represents the gradient gain, represents the adjustment factor, Represents the exponential parameter.
[0014] S3 is as follows: Input the data in the preprocessed dataset into the DSW-YOLO network model for training and testing, preset the number of training times, set the number of images input to the DSW-YOLO network model, set the average accuracy as the evaluation indicator, save the trained weights and configuration information of the DSW-YOLO network model after training and testing the DSW-YOLO network model, update the parameters of the DSW-YOLO network model, and obtain the trained DSW-YOLO network model.
[0015] S4 is as follows: The trained DSW-YOLO network model is input into the key point detection system for key point position detection of the human body. The key point detection system includes a model selection module, an image selection module and a video selection module. After the image selection module and the video selection module determine the data to be detected, they are input into the DSW-YOLO network model in the model selection module for key point detection of the human body.
[0016] On the other hand, the present invention also provides a human key point detection system based on the DSW-YOLO network, including a module for executing processing instructions for each step in a human key point detection method based on the DSW-YOLO network.
[0017] The effects provided in the summary of the invention are only the effects of the embodiments, rather than all the effects of the invention. The above technical solution has the following advantages or beneficial effects: The DSW-YOLO network proposed in this invention adopts a new convolution block DCNv2 to replace the traditional convolution module, and fuses it with the C2f module to form the C2Dcn module, which is then introduced into the Backbone backbone network and the Neck network, enhancing the network's feature extraction and fusion capabilities. Specifically, by replacing the two C2f modules after P3 and P5 in the Backbone backbone network with the C2Dcn module as the feature extraction module, low-resolution and high-resolution features are better extracted, helping the model capture more detailed key point information, especially for key point positioning on complex scenes or small objects in the image. In the Neck network, the C2Dcn module significantly improves the expression ability of features of different scales through a more sophisticated feature fusion mechanism. As a module replacing conventional convolution, DCNv2 uses dynamic convolution kernels to adjust the convolution operation, making the model more flexible and efficient. Through the C2Dcn module, the DSW-YOLO network can efficiently extract features at multiple scales and maintain the fine-grained information of the feature map, thereby achieving more accurate key point positioning. The design uses the SPPFCDC module to replace the pyramid pooling layer SPPF module in the original Backbone network to further optimize the multi-scale feature fusion process. The introduction of DCNv2 in the SPPFCDC module enables the SPPFCDC module to perform dynamic convolution operations and automatically adjust the size and shape of the receptive field according to the form of the input features. This enables the network to flexibly cope with target geometric deformation when facing complex postures, occlusions, or non-rigid objects, significantly enhancing the robustness of the model. The dynamic sampling interpolation algorithm DySample replaces the traditional upsampling method in Neck, improving model accuracy, reducing computational complexity, and enhancing generalization. DySample dynamically adjusts sampling position and density to achieve more accurate interpolation around key points, helping to avoid key point errors caused by upsampling distortion or blur. Through its dynamic sampling strategy, the DySample algorithm dynamically adjusts interpolation based on the characteristics of the input image, providing better feature recovery in occluded or distorted areas. Furthermore, DySample's adaptive sampling mechanism not only improves detection accuracy but also optimizes computational efficiency and reduces unnecessary computational redundancy, thereby enhancing the overall performance and responsiveness of the entire key point detection system. The WIoUv3 loss function is used to replace the original loss function to accelerate the model convergence and improve the detection accuracy. The loss function WIoUv1 based on the attention mechanism is introduced into the WIoUv3 loss function, which can perform weighted adjustment on the bounding box regression loss to alleviate the negative impact of low-quality samples on model training. This dynamic adjustment strategy enables the WIoUv3 model to adaptively adjust the learning focus according to the quality of the anchor box and the degree of match between the target box during the training process, thereby improving the positioning performance and robustness of the model, thereby enhancing the generalization ability of the model in various complex scenarios.
[0018] In summary, the method proposed in the present invention can effectively detect the positions of key points of the human body and improve detection efficiency and stability. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention.
[0020] Figure 1 This is the structure diagram of the DSW-YOLO model of the present invention.
[0021] Figure 2 Schematic diagram of the structure of the bottleneck structure module Bottleneck_DCNv of the variable convolution.
[0022] Figure 3 Schematic diagram of the structure of the variable convolution feature enhancement module C2Dcn.
[0023] Figure 4 Schematic diagram of the structure of the dynamic convolutional feature pyramid pooling module SPPFCDC.
[0024] Figure 5 It is the detection result diagram of the present invention. DETAILED DESCRIPTION
[0025] To clearly illustrate the technical features of this solution, the present invention is described in detail below through specific embodiments and in conjunction with the accompanying drawings. The following disclosure provides many different embodiments or examples for implementing different structures of the present invention. To simplify the disclosure of the present invention, the components and configurations of specific examples are described below.
[0026] Example 1 like Figures 1 to 4 As shown in FIG, a method for detecting key points of a human body based on a DSW-YOLO network includes the following steps: Step 1: Preprocess the public COCO2017 image dataset to obtain a dataset for key point detection. After preprocessing, each image in the dataset contains person information.
[0027] Step 2: Build the DSW-YOLO dynamic spatial weighted single detection network model based on the YOLOv8 model: (1) Deformable convolution DCNv2 is introduced into the YOLOv8 model. The convolution kernel of Deformable convolution DCNv2 can dynamically adjust the sampling position through a learnable offset, so that the convolution operation can better capture the geometric deformation characteristics of the target. DCNv2 shows higher key point detection accuracy for targets with obvious deformation (such as bending movements in human posture).
[0028] Assuming the input feature map of the standard convolution operation is X and the output feature map is Y, and the convolution kernel is W (size is K×K), the calculation process of DCNv2 can be described as follows: For each sampling point of the convolution kernel, an offset is introduced , so that the sampling position is from a fixed grid Convert to dynamic position , offset Generated by a single convolutional layer and trained via backpropagation, which optimizes the parameters of the offset prediction layer , which can make the generated offset Able to better adapt to the target geometry.
[0029] Based on DCNv1, a modulation coefficient is introduced for each sampling point , represents the weight of the sampling point, the modulation coefficient It is also generated and learned through a separate convolutional layer. Through the modulation coefficient, the network can dynamically adjust the weight of each sampling point, thereby enhancing the ability to express complex targets. In this process, the convolution kernel weight is a learnable parameter, which is automatically adjusted through training to minimize the network's loss function.
[0030] The final output of the convolution can be expressed as: , in, is the output location, is the fixed sampling position of the standard convolution kernel, is the offset of each sampling point, is the modulation coefficient.
[0031] Compared to the standard convolution formula: ,DCNv2 is more flexible and can dynamically adjust the sampling position and sampling weight, effectively improving the detection accuracy and model robustness.
[0032] In practical applications (such as multi-target human pose estimation), key points are often blurred by occlusion (such as clothing, objects or other human parts), and traditional convolution has limited feature extraction capabilities in occluded areas. DCNv2 application offset It can guide the sampling points of the convolution kernel to move to the effective area, avoid the blocked or irrelevant background area, and make the convolution kernel more accurately align with the features of the key point area; the modulation coefficient The weights of occluded areas can be dynamically adjusted to make the model focus more on unoccluded features. This allows DCNv2 to accurately capture the features of key points in occluded scenes, significantly reducing false detections and missed detections.
[0033] Improve the C2f module in the YOLOv8 model to a C2Dcn module. Replace the two C2f modules after P3 and P5 in the YOLOv8 model backbone network with C2Dcn modules as feature extraction modules. At the same time, replace all C2f modules in the Neck network with C2Dcn modules as feature fusion modules for further feature fusion and enhancement. The third stage P3 in the YOLOv8 model backbone network has a higher resolution, usually corresponding to 1 / 8 the size of the input image, and a smaller receptive field. It is located in a shallower layer and retains more detailed information. It is a high-resolution, low-semantic feature map suitable for detecting small targets. The fifth stage P5 has a lower resolution, usually corresponding to 1 / 32 the size of the input image, and a larger receptive field. It is usually located in a deeper layer and contains more semantic information. It is a low-resolution, high-semantic feature map suitable for detecting large targets. The C2Dcn module is an enhanced version of the traditional C2f module. It uses a double-layer deformable convolution DCNv2 stacking operation and combines it with a residual connection to form a Bottleneck_DCNv2 module. Figure 2 As shown in , the structure consists of two layers of DCNv2 convolution nesting. The add setting of whether to add residual is set in the input of the structure, and then the Bottleneck module in C2f is replaced by the Bottleneck_DCNv2 module to form the designed C2Dcn module, as shown in Figure 3 As shown in the figure, the structure consists of a layer of conv convolution module, a split segmentation module, multiple Bottleneck_DCNv2 modules, a Concat fusion module, and finally a layer of conv convolution module. The introduction of this module helps improve the performance of feature extraction and feature fusion. In the key point detection task, fine feature fusion is crucial for accurately locating key points on small objects or occluded objects. The designed C2Dcn module is an enhanced version of the traditional C2f module. It adopts a double-layer deformable convolution module DCNv2 superposition operation and combines it with residual connection to form a Bottleneck_DCNv2 module, and then uses the Bottleneck_DCNv2 module to replace the Bottleneck module in C2f to form the designed C2Dcn module. The C2Dcn module fuses feature maps of different levels in a more detailed way, which not only improves the feature expression ability, but also enhances the network's performance on multi-scale targets. By replacing the traditional C2f module, C2Dcn enhances the information flow between features of different scales in a more efficient feature fusion method, thereby improving the network's detection ability for targets in complex scenes.
[0034] The processing process of the C2Dcn module is as follows: the input feature map is first processed by a convolution module Conv to reduce the number of channels, thereby reducing computational complexity; this operation compresses the number of channels of the input feature map from the original value to half of the original value, and then the feature map is divided into two parts through the Split operation. One part of the feature map will enter n Bottleneck_DCNv2 modules for deformable convolution operation, where n is the different number of repetitions given in the model training phase. The n Bottleneck_DCNv2 modules will be processed with different numbers of repetitions to enhance the adaptability of this part of the feature map to the positions of various joints of the human body; The other part of the feature map will be directly output and concat with the feature map processed by n Bottleneck_DCNv2 modules. The concat operation helps to combine different feature information so that the final output feature map contains rich information from both parts of the feature map. Finally, the concatenated feature map will be processed again through convolution to obtain the final output feature map. This process enhances the expressiveness of the feature map and helps to perform subsequent key point detection more accurately. The Bottleneck_DCNv2 module provides an add setting to determine whether to perform residual operations. This design uses different configurations in the backbone network and the neck network, corresponding to different task requirements and optimization strategies. In the Bottleneck_DCNv2 module within the C2Dcn module in the backbone network, its add setting is set to true, indicating the use of residual connections. This can alleviate gradient vanishing, improve feature reuse, and accelerate training convergence. In the Bottleneck_DCNv2 module in the Neck network, setting add to false means that no residual connection is performed. Instead, double-layer DCNv2 convolution is used directly for feature transformation. This can enhance feature transformation capabilities, avoid feature redundancy, and improve the effect of cross-scale feature fusion.
[0035] (2) The original feature pyramid module SPPF is improved to the SPPFCDC module. SPPFCDC is an improved structure that combines the SPPF module in the original YOLOv8 model and the CSP idea in the CSPNet network while introducing the DCNv2 variable convolution operation. The SPPFCDC module is as follows: Figure 4 As shown in the figure, the structure consists of a 1x1 Conv module, a DCNv2 variable convolution module, multiple MaxPool2d maximum pooling modules, a Concat fusion module, and a 3x3 Conv module. The residual operation is combined to form the designed dynamic convolution feature pyramid pooling module SPPFCDC, which aims to improve the expression ability of multi-scale information. The SPPFCDC module is an enhanced and improved version of the original feature pyramid SPPF module. The feature map input in the SPPFCDC module is divided into two branches. The two branches each perform different feature processing operations, focusing on different types of features and information. The first branch is responsible for extracting multi-scale local features. The input feature map first passes through a 1x1 convolution layer to compress the number of channels to a smaller number, which helps to reduce computational complexity and allows subsequent convolution operations to focus on higher-level features. The compressed feature map is subjected to the DCNv2 variable convolution operation to extract features from the local area. The DCNv2 convolution can adaptively adjust the shape of the convolution kernel, making it more effective. It captures fine-grained features in images, especially in human pose detection tasks, and is able to cope with complex local deformations. After DCNv2 processing, a feature map with high local adaptability and deformation processing capabilities is obtained, which is then processed by the feature pyramid SPPF module to enhance the multi-scale contextual information of the feature map. At the same time, in the SPPFCDC module, the last ordinary convolution layer of the SPPF module is improved to a DCNv2 variable convolution, which can further extract more refined features. These multi-scale features are then further processed by a 3x3 convolution layer to obtain the fused multi-scale feature map Y1, which ensures that the multi-scale features can be fully integrated and extract more comprehensive contextual information. The second branch is relatively simple. The input feature map is compressed through a 1x1 convolution layer to generate a new feature map Y2. This reduces the amount of calculation and retains the key information of the input feature map. Finally, the feature maps Y1 and Y2 of the first and second branches are spliced in the channel dimension to form a new feature map. The spliced feature map passes through a 1x1 convolution layer to compress the number of channels to the target output channel number; in this way, the network can integrate all feature information into a more compact output feature map. This branch design allows the network to perform multi-angle feature fusion on different feature dimensions, thereby improving the representation ability of the model. The design of the SPPFCDC module helps to improve the performance of the network at different scales and local deformations, improves the diversity and richness of features, and optimizes the feature representation ability through efficient calculation and fusion methods. This design enables the module to not only improve the expression ability of multi-scale features, but also reduce computational redundancy and achieve lightweight and efficient computing.
[0036] (3) The dynamic sampling interpolation algorithm DySample module is used in the Neck network of the constructed DSW-YOLO model to replace the original nearest neighbor upsampling algorithm module. DySample is a dynamic sampling interpolation algorithm that achieves more accurate sampling and interpolation of feature maps by learning the dynamic sampling weights of pixels in space. Compared with traditional fixed sampling interpolation methods (such as bilinear interpolation, nearest neighbor interpolation, etc.), DySample dynamically adjusts the sampling position and weight according to the content of the input data, thereby improving the model's ability to model local features, especially in the presence of significant deformation, complex background or object edge areas.
[0037] The key to DySample is to dynamically adjust the sampling position by learning the offset of each pixel to adapt to the local geometric structure of the input feature map; assign a dynamic weight to each sampling point and weight the sampling area based on the content information. Assuming the input feature map is , the output feature map is , the process of DySample can be expressed as: , in, represents the position index in the target feature map, represents a fixed sampling reference point (such as the grid center), Represents the offset of the kth sampling point obtained by dynamic learning, represents the dynamic weight of the k-th sampling point, Indicates the number of sampling points.
[0038] (4) The original model network loss function is replaced with the WIoUv3 loss function to improve the accuracy of key point detection and the optimization effect during training. WIoUv3 introduces a dynamic non-monotonic focusing mechanism, which defines the “outlier degree”. " is used to evaluate the quality of the anchor frame and dynamically adjust the gradient gain according to the outlier degree. Specifically, a small outlier degree means a high-quality anchor frame. By assigning a small gradient benefit to it, the bounding box regression can be focused on the anchor frame of normal quality, reducing the interference on the model training. The anchor frame of normal quality obtains a larger gradient gain, which promotes model learning. A non-monotonic focusing coefficient is constructed and applied to WIoUv1 to obtain the loss function WIoUv3 with dynamic non-monotonicity. WIoUv1 is a loss function based on the attention mechanism. By introducing the distance attention mechanism, the bounding box regression loss is weighted and adjusted to alleviate the negative impact of low-quality samples on model training. This dynamic adjustment strategy enables WIoUv3 to adaptively adjust the learning focus according to the quality of the anchor box and the degree of match between the target box during the training process, thereby improving the positioning performance and robustness of the model, thereby enhancing the model's generalization ability in various complex scenarios.
[0039] The calculation formula of WIoUv3 is as follows: , , , , , , in, express loss function, represents the dynamic adjustment factor, , which will significantly amplify the normal quality anchor box , Representation basis loss, , which will significantly reduce the quality of high-quality anchor boxes , and significantly reduce its attention to the distance between center points when the anchor frame and the target frame overlap well, Indication Standard loss, and represents the center coordinate of the anchor box, and Indicates the center coordinates of the target box, and Represent the length and width of the union area of the anchor box and the target box respectively, Indicates the degree of separation from the skirt, * indicates the separation of the computational graph, Represents the weighted loss, express The average value of represents the WIoUv3 loss function, represents the gradient gain, Indicates the adjustment factor used for smoothing To avoid excessive gradients, Represents the exponential parameter, used to control nonlinear changes.
[0040] Step 3: Use the preprocessed dataset to train and verify the DSW-YOLO network model. The training and verification method of the DSW-YOLO network is as follows: use the preprocessed dataset for verification once per training round. The model is trained for 100 rounds, with 128 images input for each training round. The mean average precision (mAP@0.5 and mAP@0.5-0.95) is used as the evaluation index of the model to evaluate the DSW-YOLO network model. After training, the trained weights and network model configuration information are saved.
[0041] Step 4: Use the trained DSW-YOLO network to detect the key points of the human body. After the best weight information obtained after training the DSW-YOLO network model is input into the key point detection system, the key points of the human body in the image and video can be detected and displayed in the system in real time.
[0042] Example 2 A human key point detection system based on a DSW-YOLO network includes a module for executing processing instructions for each step in a human key point detection method based on a DSW-YOLO network.
[0043] Example 3 The target detection models Yolov8 and Yolo11 were selected and trained based on the COCO dataset. The COCO dataset contains 58,945 images of human bodies, of which 56,599 are training sets. The human key point detection method based on the DSW-YOLO network proposed in the present invention was evaluated on this dataset. The experimental results show that, as shown in Table 1, the features extracted by the model in this method have strong discrimination and generalization capabilities. Table 1 Comparison of the performance of different detection models and the proposed method on the COCO dataset From the above experimental results, it can be seen that the DSW-YOLO network model in the present invention improves the mAP(0.5) and mAP(0.5-0.95) indicators by 2.1% and 2.2% respectively compared with Yolov8, and improves by 0.7% and 2.5% respectively compared with Yolo11. It can be seen that the model in the present invention is superior to the latest posture detection model.
[0044] To further verify the effectiveness of the DSW-YOLO network model, a series of ablation experiments were set up to explore the impact of each DSW-YOLO module on model performance. The experimental results are shown in Table 2 below.
[0045] Table 2 Ablation experiment results Comprehensive experimental results show that each module improves the accuracy of the DSW-YOLO network to varying degrees. Ultimately, compared with the original model, the mAP(0.5) of the proposed DSW-YOLO model is improved by 2.1% and the mAP(0.5-0.95) is improved by 2.2%.
[0046] Figure 5 This is a real-time result display diagram of a human key point detection system based on the DSW-YOLO network of the present invention. By inputting an image into the system, a prediction result diagram can be obtained in real time. Figure 5 It can be seen that the key points of the prediction result image obtained by the present invention are accurately and clearly positioned. The model in the present invention recognizes the input image, and the probability of identifying the content in the image as a person is 0.90. This proves that the method in the present invention can achieve the expected effect.
[0047] Although the above describes the specific implementation methods of the invention in conjunction with the accompanying drawings, it does not limit the scope of protection of the invention. Based on the technical solution of the present invention, various modifications or variations that can be made by those skilled in the art without creative work are still within the scope of protection of the present invention.
Claims
1. A human key point detection method based on DSW-YOLO network, characterized by: The following steps are involved: S1. Select an existing image dataset for key point detection, obtain data in the image dataset, and preprocess the data in the image dataset; S2. Build the DSW-YOLO dynamic spatial weighted single-shot detection network model based on the YOLOv8 model. The DSW-YOLO network model includes the Backbone network module, the Neck module, the Head module, and the loss function. The DSW-YOLO network model is obtained by improving the YOLOv8 model. The improvements are as follows: In the YOLOv8 model, a variable convolution feature enhancement module C2Dcn is designed to replace the two-stage feature fusion convolution module C2f in the YOLOv8 model. A dynamic convolution feature pyramid pooling module SPPFCDC is designed to replace the original feature pyramid module SPPF in the backbone network of the YOLOv8 model. In the Neck module of the YOLOv8 model, the dynamic sampling interpolation algorithm DySample is used to replace the original upsampling algorithm module. The network loss function of the YOLOv8 model is replaced with the third-generation weighted intersection-over-union loss function WIoUv3. S3, input the preprocessed data set into the DSW-YOLO network model, and train and verify the DSW-YOLO network model; S4. Input the trained DSW-YOLO network model into the key point detection system to detect the key point positions of the human body.
2. A human key point detection method based on DSW-YOLO network according to claim 1, characterized in that: S1 is as follows: The existing COCO2017 image dataset is selected for model training and verification. The data in the COCO2017 image dataset is preprocessed. The preprocessing operations include data cleaning, data enhancement and data normalization, and then a dataset for key point detection is obtained, in which each image contains task information.
3. A human key point detection method based on DSW-YOLO network according to claim 2, characterized in that: The C2Dcn module is as follows: By adopting the double-layer deformable convolution DCNv2 stacking operation and combining it with the residual connection to form the bottleneck structure module Bottleneck_DCNv of the deformable convolution, the Bottleneck module in C2f is replaced by the Bottleneck_DCNv2 module to obtain the C2Dcn module; Replace the C2f modules after the third stage P3 and the fifth stage P5 in the YOLOv8 model backbone network with the C2Dcn module, and replace all C2f modules in the Neck network of the YOLOv8 model with C2Dcn modules, and use the replaced C2Dcn modules as feature fusion modules; After the feature map is input to the C2Dcn module, it first passes through a convolution layer to reduce the number of channels of the feature map. Then, the feature map is divided into two parts through the Split operation. One part is input to n Bottleneck_DCNv2 modules for deformable convolution operation, and the other part is directly output and spliced with the feature maps processed by n Bottleneck_DCNv2 modules. The spliced features are input to a convolution layer again to restore the number of channels of the feature map to obtain the final output feature map of the C2Dcn module. In the process of processing the feature map by the Bottleneck_DCNv2 module, the add setting is provided to indicate whether to perform the residual operation. add indicates whether to add the residual operation. If add is set to true, it indicates that the residual connection operation is performed. At the same time, the add setting is provided in the Neck network to indicate whether to perform the residual operation. If add is set to false, it indicates that the residual connection operation is not performed, and DCNv2 is directly used for feature transformation.
4. A human key point detection method based on DSW-YOLO network according to claim 3, characterized in that: The double-layer deformable convolution DCNv2 is as follows: The convolution kernel of the double-layer deformable convolution DCNv2 dynamically adjusts the sampling position through a learnable offset to capture the geometric deformation characteristics of the target. Assume that the input feature map of DCNv2 is X, the output feature map is Y, the convolution kernel is W, and the size of the convolution kernel W is K×K; Based on the standard convolution operation, DCNv2 introduces an offset for each sampling point of the convolution kernel. , so that the sampling position is changed from a fixed grid Convert to dynamic position , and then obtain the single-layer deformable convolution DCNv1, Indicates the index of the sampling point; where the offset Generated by a separate convolutional layer, the convolutional layer is the offset prediction layer, the input of the offset prediction layer is the input feature map X, and the output is the offset feature map , the calculation process is , Represents the convolution kernel weight of the offset prediction layer, which is back-propagated to Perform optimization training. For convolution kernel size K×K, the offset feature map have offsets, where is the number of convolution kernel positions, The offset is split into and , and Represents the offset in the x and y directions respectively, It means the offset in two directions; Then, based on the deformable convolution DCNv1, a modulation coefficient is introduced for each sampling point To represent the weight of the sampling point, , and then get the double-layer deformable convolution DCNv2; where the modulation coefficient Generated by a single convolutional layer whose input is the feature map X and output is the modulation coefficient , the calculation process is , represents the convolution kernel weight of the convolution layer, Represents the Sigmoid function, the convolution layer is learned by the convolution kernel weight Perform weighted summation on the input feature map X to generate an intermediate feature map, apply the Sigmoid function to normalize each sampling point of the intermediate feature map, and obtain the final modulation coefficient ; Output feature map after deformable convolution , the calculation formula is as follows: , in, Indicates the output location point, Represents the pixel value obtained according to the offset sampling position in the input feature map X, Indicates The output feature map at represents a fixed sampling position, Indicates the offset of each sampling point, Indicates the modulation coefficient.
5. A human key point detection method based on DSW-YOLO network according to claim 4, characterized in that: The dynamic convolution feature pyramid pooling module SPPFCDC is as follows: The SPPFCDC module replaces the feature pyramid module SPPF in the YOLOv8 model. The SPPFCDC module combines the SPPF module in the YOLOv8 model with the idea of performing convolution processing on one part of the cross-stage partial network CSPNet and directly saving the other part. It also introduces DCNv2. After the feature map is input into the SPPFCDC module, it is divided into two branches. The first branch is responsible for extracting multi-scale local features. The feature map first passes through a 1×1 convolution layer to compress the number of channels of the feature map, and then passes through DCNv2 to extract the features of the local area, thereby obtaining a feature map with high local adaptability and deformation processing capabilities. The multi-scale context information of the feature map is then enhanced through the feature pyramid module SPPF, where the last convolution layer of the feature pyramid module SPPF is replaced by DCNv2, and the output of the feature pyramid module SPPF is then subjected to a 3×3 convolution, and finally the fused multi-scale feature map is output. ; The second branch compresses the number of channels through a 1×1 convolution layer to generate a new feature map ; Multi-scale feature maps and feature maps The splicing is performed in the channel dimension to form the spliced features. Finally, the number of channels of the spliced features is compressed to the target output channel number through one 1×1 convolution layer, and the final output feature map of the SPPFCDC module is obtained.
6. A human key point detection method based on DSW-YOLO network according to claim 5, characterized in that: The dynamic sampling interpolation algorithm DySample is as follows: The dynamic sampling interpolation algorithm DySample module replaces the nearest neighbor upsampling algorithm module in the YOLOv8 model. DySample dynamically adjusts the sampling position by offsetting each pixel in the feature map to adapt to the local set structure of the input feature map, assigns a dynamic weight to each sampling point, and then weights the sampling area based on content information. The calculation formula of DySample is as follows: , in, represents the input feature map of DySample, express The output feature map at Indicates a fixed sampling reference point location, express No. sampling points, express The offset, Indicates the number of sampling points, express Dynamic weight.
7. The method for detecting key points of a human body based on a DSW-YOLO network according to claim 6, wherein: The WIoUv3 loss function is as follows: The WIoUv3 loss function introduces a dynamic non-monotonic aggregation mechanism, which defines the degree of departure from the skirt. To evaluate the quality of the anchor frame, and according to the degree of skirt Dynamically adjust the gradient gain, that is, through the skirt Construct a non-monotonic focusing coefficient and apply it to the first-generation weighted intersection-over-union loss function WIoUv1 to obtain the WIoUv3 loss function; Skirt The smaller the value, the higher the quality of the anchor frame, the smaller the gradient benefit, and the less interference training of the DSW-YOLO network model. If the value is large, the anchor box quality is average, which distributes a large gradient benefit and promotes the learning of the DSW-YOLO network model; The calculation process of defining the WIoUv3 loss function is as follows: , , , , , , in, express loss function, represents the dynamic adjustment factor, , Representation basis loss, , Indication Standard loss, and represents the center coordinate of the anchor box, and Indicates the center coordinates of the target box, and Represent the length and width of the union area of the anchor box and the target box respectively, Indicates the degree of separation from the skirt, * indicates the separation of the computational graph, Represents the weighted loss, express The average value of represents the WIoUv3 loss function, represents the gradient gain, represents the adjustment factor, Represents the exponential parameter.
8. The method for detecting key points of a human body based on a DSW-YOLO network according to claim 7, wherein: S3 is as follows: Input the data in the preprocessed dataset into the DSW-YOLO network model for training and testing, preset the number of training times, set the number of images input to the DSW-YOLO network model, set the average accuracy as the evaluation indicator, save the trained weights and configuration information of the DSW-YOLO network model after training and testing the DSW-YOLO network model, update the parameters of the DSW-YOLO network model, and obtain the trained DSW-YOLO network model.
9. The method for detecting key points of a human body based on a DSW-YOLO network according to claim 8, wherein: S4 is as follows: The trained DSW-YOLO network model is input into the key point detection system for key point position detection of the human body. The key point detection system includes a model selection module, an image selection module and a video selection module. After the image selection module and the video selection module determine the data to be detected, they are input into the DSW-YOLO network model in the model selection module for key point detection of the human body.
10. A human key point detection system based on DSW-YOLO network, characterized by: The invention comprises a module for executing processing instructions of each step in a human key point detection method based on a DSW-YOLO network as described in any one of claims 1 to 9.
Citation Information
Cited By
A C-L-P three-band combined strip matrix antenna passive microwave radiometer
CN122546220A