Human body posture detection method and system based on image processing and computer readable medium

Through the dual-model staged detection method, combined with YOLOv5 and the posture detection model, the problem of a small number of human posture detection points and poor matching in the existing technology is solved, and more accurate human posture recognition and multi-person human posture detection are achieved.

CN118629086APending Publication Date: 2024-09-10NANJING XIANWEI INFORMATION TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202311845884.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-28
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

Existing human posture detection algorithms have problems with a small number of detection points and poor posture point matching, which leads to misjudgments in human posture recognition and makes it difficult to accurately determine the posture of a single person.

Method used

A dual-model staged detection method is adopted. First, the pre-trained YOLOv5 target detection model is used to detect human body areas, and high-scoring areas are screened out through the non-maximum suppression method. Then, human body joint points are extracted based on the pre-trained attitude detection model, combined with simulation. The radial transformation and deep attention feature fusion modules improve the accuracy of posture detection.

Benefits of technology

It significantly improves the accuracy of human posture detection and can detect 136 feature point information at the same time. Compared with other algorithms, it can characterize human posture more accurately and improve the accuracy of multi-person human posture detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118629086A
    Figure CN118629086A
Patent Text Reader

Abstract

The invention provides a human body posture detection method and system based on image processing and a computer readable medium. The method comprises the following steps: receiving original image input; preprocessing the original image; detecting areas where a human body is located based on a YOLOv5 target detection model, and obtaining a score of each area; through a non-maximum suppression method, a human body region is screened out according to a set overlapping frame threshold value, and a human body image is obtained; performing affine transformation, and adjusting to adapt to the image size of the posture detection model; carrying out human body joint point extraction based on a pre-trained posture detection model, detecting a human body skeleton network, obtaining a score of each channel, and taking a position with the maximum score of each channel as a posture detection point corresponding to the channel; and finally, projecting the detected posture detection point to the position of the original pixel of the original image based on affine transformation and inverse transformation to obtain the human body posture. According to the method, the detection efficiency and the accuracy of multi-person body posture detection can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image recognition, and in particular to a method, system and computer-readable medium for detecting human posture based on image processing. Background Art

[0002] With the continuous enhancement of image processing capabilities, the demand for human behavior monitoring is increasing. The use of computer vision to analyze human posture is a hot technology in current research and application. It is widely used in many fields such as security, video surveillance, human-computer interaction, business district diversion and identification, training robots, etc., and assists in the judgment of human movements.

[0003] With the development of image technology, the demand for human posture detection and recognition using image algorithms is increasing, and the precision of human monitoring is gradually improving. There are many posture estimation algorithms in the prior art, such as openpose, human pose, etc. Taking the method of using neural network for human posture detection as an example, the input image is feature extracted to obtain a set of feature maps, which are then divided into two forks. After obtaining these two pieces of information, the pair matching in graph theory is used to find the connection information and connect the joints of the same person. Due to the vector nature of the generated confidence map itself, the generated pair matching is very correct and finally merged into the overall skeleton of a person. However, in the application process of this algorithm, we found that the number of detection points detected by the detection network is small, and there is a disadvantage that the posture of the human body cannot be accurately expressed, and the posture points and the human body do not have a good match, so it is difficult to determine the posture of a single person, resulting in misjudgment of the human body posture. Summary of the invention

[0004] In view of the defects and shortcomings of the prior art, the purpose of the present invention is to provide a human posture detection method based on image processing, which uses a dual model for staged detection. Compared with other posture detection algorithms, it can more accurately characterize the human posture and improve the accuracy of multi-person human posture detection.

[0005] According to a first aspect of the present invention, a method for detecting a human body posture based on image processing is provided, comprising:

[0006] Receiving a raw image input including at least one human body;

[0007] Preprocess the original image;

[0008] Based on the pre-trained YOLOv5 target detection model, the area where the human body is located is detected and the score of each area is obtained;

[0009] After the coordinates of the human body area are detected, the human body area whose score meets the threshold requirement is screened out according to the set overlapping frame threshold through the non-maximum suppression method, and the image area at its location is obtained to obtain the human body image;

[0010] Performing affine transformation on the obtained human body image to adjust the image size to fit the posture detection model;

[0011] Extract human joints based on the pre-trained posture detection model, detect the human skeleton network, obtain the score of each channel, and use the position with the maximum score of each channel as the posture detection point corresponding to the channel; and

[0012] The posture detection points detected are projected to the positions of the original pixels of the original image based on the inverse transformation of the affine transformation to obtain the human body posture.

[0013] As an optional implementation, the training process of the pre-trained YOLOv5 target detection model includes:

[0014] Obtain N color images containing human bodies as a first training data set, where N is greater than or equal to 1000, and each color image is scaled to a size of 640*640, and the area and coordinates where the human body is located are marked in the form of a rectangular frame, with the center of the rectangular frame as the center of the area;

[0015] Generate M initial regions of interest from the pixels in each color image according to a preset aspect ratio p*q, where p is equal to the length of the rectangular frame and q is equal to the height of the rectangular frame;

[0016] The centers of the M initial interest regions are respectively calculated with the center of the marked rectangular box for Euclidean distance, the initial interest regions whose calculated Euclidean distance exceeds a preset value are deleted, and the initial interest regions whose calculated Euclidean distance is less than the preset value are retained and used together with the marked rectangular box as the second training data set;

[0017] The first training data set and the second training data set are combined as a training set to train the YOLOv5 target detection model, and the intersection-over-union loss is used as the loss function to train a model with a detection accuracy greater than or equal to 98%.

[0018] As an optional implementation, the posture detection model uses a shuffle network shufflenetv2 as a skeleton network for feature extraction, then performs upsampling restoration through pixel mapping pixelshuffle, and then performs feature fusion through a two-layer deep attention feature fusion module DUC_attention, and finally uses a single-layer convolution layer to adjust the channel to the adaptation dimension for model training;

[0019] During the training process, the mean square error distance loss MSELOSS is used as the loss function. The learning rate used in the training process is a multi-stage learning rate decrease. The initial learning rate is 1e-3. The adaptive optimizer adam is used as the optimizer. After 240-300 rounds of training, data enhancement is added to improve the generalization of model detection, and finally the posture detection model is trained.

[0020] According to a second aspect of the present invention, a computer system is provided, comprising:

[0021] one or more processors;

[0022] A memory stores operable instructions, which, when executed by the one or more processors, enable the one or more processors to perform operations, wherein the operations include the process of executing the aforementioned human posture detection method based on image processing.

[0023] According to the third aspect of the purpose of the present invention, a computer-readable medium storing software is proposed, wherein the software includes instructions that can be executed by one or more computers, and when the instructions are executed by the one or more computers, the process of the aforementioned image processing-based human posture detection method is performed.

[0024] The human posture detection method based on image processing of the above embodiment of the present invention uses dual-model staged detection, first extracts the image of the human body area, and then identifies the key points of the human body area, wherein the training of the target detection model uses an optimized data set to reduce the number of training theories and significantly improve the accuracy of the model; on the basis of obtaining the key points of the human body area, a posture recognition network is used to identify specific postures, wherein the posture recognition uses a very lightweight network, which makes the recognition and reasoning speed faster; through the human posture detection method of the present invention, 136 feature point information of the human body can be detected at the same time, compared with other posture detection algorithms, it can more accurately characterize the posture of the human body and improve the accuracy of multi-person human posture detection.

[0025] It should be understood that all combinations of the aforementioned concepts and the additional concepts described in more detail below can be considered as part of the inventive subject matter of the present disclosure as long as such concepts are not mutually inconsistent. In addition, all combinations of the claimed subject matter are considered as part of the inventive subject matter of the present disclosure.

[0026] The foregoing and other aspects, embodiments and features of the present invention can be more fully understood from the following description in conjunction with the accompanying drawings. Other additional aspects of the present invention, such as the features and / or beneficial effects of the exemplary embodiments, will be apparent from the following description or learned from the practice of the specific embodiments according to the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] The accompanying drawings are not intended to be drawn to scale. In the accompanying drawings, each identical or nearly identical component shown in each figure may be represented by the same reference numeral. For clarity, not every component is labeled in each figure. Embodiments of various aspects of the present invention will now be described by way of example and with reference to the accompanying drawings.

[0028] Figure 1 is a flow chart of a method for detecting human posture based on image processing according to an embodiment of the present invention.

[0029] Figure 2 Schematic diagram of the detection process of the posture detection model according to an embodiment of the present invention. DETAILED DESCRIPTION

[0030] In order to better understand the technical content of the present invention, specific embodiments are given and described as follows in conjunction with the accompanying drawings.

[0031] Various aspects of the present invention are described in this disclosure with reference to the accompanying drawings, in which many illustrative embodiments are shown. The embodiments of the present disclosure are not necessarily intended to include all aspects of the present invention. It should be understood that the various concepts and embodiments introduced above, as well as those described in more detail below, can be implemented in any of many ways, because the concepts and embodiments disclosed by the present invention are not limited to any implementation. In addition, some aspects disclosed by the present invention can be used alone or in any appropriate combination with other aspects disclosed by the present invention.

[0032] Combination Figure 1 , 2 The human posture detection method based on image processing of the example shown includes the following processes:

[0033] S101, receiving an original image input including at least one human body;

[0034] S102, preprocessing the original image;

[0035] S103, based on the pre-trained YOLOv5 target detection model, detect the area where the human body is located and obtain a score for each area;

[0036] S104, after the coordinates of the human body area are detected, the human body area whose score meets the threshold requirement is screened out according to the set overlapping frame threshold by using the non-maximum suppression method, and the image area at the location thereof is obtained to obtain the human body image;

[0037] S105, performing affine transformation on the obtained human body image to adjust the image size to adapt to the posture detection model;

[0038] S106, extracting human joints based on the pre-trained posture detection model, detecting the human skeleton network, obtaining a score for each channel, and taking the position with the maximum score for each channel as the posture detection point corresponding to the channel; and

[0039] S107, projecting the posture detection points detected to the positions of the original pixels of the original image based on the inverse transformation of the affine transformation to obtain the human body posture.

[0040] As an optional embodiment, the preprocessing of the original image includes resizing to adapt to the detection of images with different resolutions, image normalization, color channel adjustment, etc.

[0041] In an embodiment of the present invention, the original image is scaled to a size of 640*640.

[0042] Based on the Max-Min normalization of the original image, that is, by traversing each pixel in the image matrix, normalization is performed according to the set pixel maximum value max and pixel minimum value min.

[0043] As an example, the Max-Min normalization process includes:

[0044] x′=(x-min(x)) / (max(x)-min(x))

[0045] Therefore, the original image is converted to the range of [0,1] using a linear method, and the calculation result x' is the normalized data, x is the original data, that is, x represents the pixel in the original image, and x' represents the normalized pixel.

[0046] In an embodiment of the present invention, the training process of the pre-trained YOLOv5 target detection model includes:

[0047] Obtain N color images containing human bodies as a first training data set, where N is greater than or equal to 1000, and each color image is scaled to a size of 640*640, and the area and coordinates of the human body are marked in the form of a rectangular frame, with the center of the rectangular frame as the center of the area;

[0048] Generate M initial regions of interest from the pixels in each color image according to a preset aspect ratio p*q, where p is equal to the length of the rectangular frame and q is equal to the height of the rectangular frame;

[0049] The centers of the M initial interest regions are respectively calculated with the center of the marked rectangular box for Euclidean distance, the initial interest regions whose calculated Euclidean distance exceeds a preset value are deleted, and the initial interest regions whose calculated Euclidean distance is less than the preset value are retained and used together with the marked rectangular box as the second training data set;

[0050] The first training data set and the second training data set are combined as a training set to train the YOLOv5 target detection model, and the intersection-over-union loss is used as the loss function to train a model with a detection accuracy greater than or equal to 98%.

[0051] Therefore, by optimizing the labeled data of the training data set, the labeled anchor data includes valid labeled boxes and approximate boxes that are directly related to and interfere with the labeled boxes, eliminating invalid training data, effectively improving the training efficiency, reducing training time, and improving the accuracy of model detection.

[0052] In this embodiment, a lightweight single-stage target detection network is used in the first stage of posture analysis, which can significantly improve the operation speed, increase the receptive field of pixels, and reduce the consumption of system resources and detection efficiency and accuracy.

[0053] In an embodiment of the present invention, the posture detection model uses a shuffle network shufflenetv2 as a skeleton network for feature extraction, then performs upsampling restoration through pixel mapping pixelshuffle, and then performs feature fusion through a two-layer deep attention feature fusion module DUC_attention, and finally uses a single-layer convolution layer to adjust the channel to the adaptation dimension for model training;

[0054] During the training process, the mean square error distance loss MSELOSS is used as the loss function. The learning rate used in the training process is a multi-stage learning rate decrease. The initial learning rate is 1e-3. The adaptive optimizer adam is used as the optimizer. After 240-300 rounds of training, data enhancement is added to improve the generalization of model detection, and finally the posture detection model is trained.

[0055] {Example 1}

[0056] Combined with the process of example 1, the complete process of human posture detection is a staged human posture detection process, in which the goal of the first stage is to detect the area where the human body is located, and the second stage detects the posture information of the human body in the area.

[0057] 1) Preprocessing

[0058] Preprocessing before image recognition, including image resizing, normalization, color channel adjustment, etc.

[0059] In this example, the original image is first scaled to a resolution of 640*640, and then the image is normalized as the input of the network to detect objects of different resolutions.

[0060] 2) Object Detection Network

[0061] In this example, a single-stage target detection network is used to detect the area where the human body is located and obtain a score for each area.

[0062] The input of the detection network is the original image, and the output is a series of classifications, coordinate points, and confidence levels of the detected objects.

[0063] In this example, the lightweight single-stage target detection network used is trained based on the optimization of the labeled data of the training data set. The labeled anchor data includes valid labeled boxes and approximate boxes that are directly related to and interfere with the labeled boxes, and invalid training data is eliminated, which effectively improves the training efficiency, reduces the training time, and improves the accuracy of model detection.

[0064] In an optional embodiment, a mosaic data augmentation method is used during model training, and a generalized intersection-over-union loss is used as a loss function to improve training results.

[0065] 3) Non-maximum suppression (NMS) and post-processing

[0066] After detecting the coordinates of the human body area, the non-maximum suppression method is used to filter out the human body area whose score meets the threshold requirement according to the set overlapping frame threshold, and obtain the image area where it is located.

[0067] Then post-processing is performed to adjust the region to a form suitable for the posture detection network through affine transformation, and the image size used is 192*256.

[0068] Finally, the 192*256 image can be normalized.

[0069] 4) Joint point extraction model (i.e. posture detection model)

[0070] In the gesture detection model, a lightweight algorithm is used in the exemplary embodiments of the present invention.

[0071] First, the second-generation shuffle network (shufflenetv2) was used as the skeleton network for feature extraction, and then pixel mapping (pixelshuffle) was used for upsampling restoration. Then, feature fusion was performed through a two-layer deep attention feature fusion (DUC_attention) module. Finally, a single-layer convolutional layer was used to adjust the channel to the adaptive dimension for model training.

[0072] In order to achieve the effect of network inference, this example uses mean square error distance loss (MSELOSS) as the loss function. The learning rate used in the training process is a multi-stage learning rate decrease. The initial learning rate is 1e-3. The adaptive optimizer (ADAM) is used as the optimizer. After 240 rounds of training, data enhancement is added to improve its generalization.

[0073] {Example 2}

[0074] In combination with the human body posture detection method based on image processing of the above embodiment, the present invention also proposes a computer system, comprising: one or more processors and a memory. The aforementioned memory is used to store operable instructions, and when the instructions are executed by the one or more processors, the one or more processors perform operations, and the operations include the process of executing the aforementioned human body posture detection method based on image processing.

[0075] {Example 3}

[0076] In combination with the human body posture detection method based on image processing in the above embodiment, the present invention also proposes a computer-readable medium storing software, wherein the software includes instructions that can be executed by one or more computers, and when the instructions are executed by the one or more computers, the process of the aforementioned human body posture detection method based on image processing is executed.

[0077] Although the present invention has been disclosed as above with preferred embodiments, it is not intended to limit the present invention. A person with ordinary knowledge in the technical field to which the present invention belongs may make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be determined by the definition of the claims.

Claims

1. A human posture detection method based on image processing, It is characterized in that include: Receiving a raw image input including at least one human body; Preprocess the original image; Based on the pre-trained YOLOv5 target detection model, the area where the human body is located is detected and the score of each area is obtained; After the coordinates of the human body area are detected, the human body area whose score meets the threshold requirement is screened out according to the set overlapping frame threshold through the non-maximum suppression method, and the image area at its location is obtained to obtain the human body image; Performing affine transformation on the obtained human body image to adjust the image size to fit the posture detection model; Based on the pre-trained posture detection model, human joint points are extracted, the human skeleton network is detected, the score of each channel is obtained, and the position with the maximum score of each channel is used as the posture detection point corresponding to the channel; as well as The posture detection points detected are projected to the positions of the original pixels of the original image based on the inverse transformation of the affine transformation to obtain the human body posture.

2. The human body posture detection method based on image processing according to claim 1, It is characterized in that The preprocessing of the original image comprises: The original image is scaled to 640*640 size.

3. The human body posture detection method based on image processing according to claim 1, It is characterized in that The preprocessing of the original image comprises: Based on the Max-Min normalization of the original image, that is, by traversing each pixel in the image matrix, normalization is performed according to the set pixel maximum value max and pixel minimum value min.

4. The human body posture detection method based on image processing according to claim 1, It is characterized in that The training process of the pre-trained YOLOv5 target detection model includes: Obtain N color images containing human bodies as a first training data set, where N is greater than or equal to 1000, and each color image is scaled to a size of 640*640, and the area and coordinates where the human body is located are marked in the form of a rectangular frame, with the center of the rectangular frame as the center of the area; Generate M initial regions of interest from the pixels in each color image according to a preset aspect ratio p*q, where p is equal to the length of the rectangular frame and q is equal to the height of the rectangular frame; The centers of the M initial interest regions are respectively calculated with the center of the marked rectangular box for Euclidean distance, the initial interest regions whose calculated Euclidean distance exceeds a preset value are deleted, and the initial interest regions whose calculated Euclidean distance is less than the preset value are retained and used together with the marked rectangular box as the second training data set; The first training data set and the second training data set are combined as a training set to train the YOLOv5 target detection model, and the intersection-over-union loss is used as the loss function to train a model with a detection accuracy greater than or equal to 98%.

5. The method for detecting human posture based on image processing according to claim 1, It is characterized in that The image size adapted to the pose detection model is 192*256.

6. The human body posture detection method based on image processing according to claim 1, It is characterized in that The posture detection model uses the shuffle network shufflenetv2 as the skeleton network for feature extraction, then performs upsampling restoration through pixel mapping pixelshuffle, and then performs feature fusion through a two-layer deep attention feature fusion module DUC_attention. Finally, a single-layer convolution layer is used to adjust the channel to the adaptation dimension for model training; During the training process, the mean square error distance loss MSELOSS is used as the loss function. The learning rate used in the training process is a multi-stage learning rate decrease. The initial learning rate is 1e-3. The adaptive optimizer adam is used as the optimizer. After 240-300 rounds of training, data enhancement is added to improve the generalization of model detection, and finally the posture detection model is trained.

7. A computer system, It is characterized in that include: one or more processors; A memory storing operable instructions, wherein when the instructions are executed by the one or more processors, the one or more processors perform operations, wherein the operations include the process of executing the human posture detection method based on image processing as described in any one of claims 1 to 6.

8. A computer-readable medium storing software, It is characterized in that The software includes instructions that can be executed by one or more computers, and when the instructions are executed by the one or more computers, the process of the human posture detection method based on image processing described in any one of claims 1-6 is performed.

Citation Information

Patent Citations

  • Human body image key point attitude estimation method

    CN111160085A

  • Small target detection method based on distribution distance

    CN113378905A

  • Real-time skeleton key point identification method and system based on coordinate system regression

    CN114519868A

  • Real-time robust two-stage attitude estimation method

    CN114842389A

  • Real-time learning state detection system based on human body posture detection

    CN116206329A