SVM-based human body posture estimation algorithm
Through the SVM-based human posture estimation algorithm, combined with the YOLOv8 Pose model and the Canny edge detection algorithm, the problem of insufficient accuracy of human posture detection in complex scenarios is solved, and more stable and high-precision fall detection is achieved.
Patent Information
- Application Number
- CN202411267935.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-11
- Publication Date
- 2025-02-18
AI Technical Summary
The prior art has poor feature extraction in human posture detection in complex scenarios, light changes, occlusion and rich textures, which leads to low fall detection accuracy.
Using SVM-based human pose estimation algorithm, 17 key points were quickly extracted through the YOLOv8 Pose model, and the reference vector was generated in combination with the Canny edge detection algorithm to form a support vector of 5-dimensional data, and input to SVM for classification.
Improve the accuracy and stability of human posture estimation, especially in complex lighting changes and occlusion, and enhance the accuracy of fall detection.
Smart Images

Figure CN119478481A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer vision recognition, and in particular to a human body posture estimation algorithm based on SVM (Support Vector Machine). Background Art
[0002] In the existing literature [Bo LU. Human Fall Detection for Smart Home Caring using Yolo Networks. International Journal of Advanced Computer Science and Applications. 2023; 14(4): 59-68] and the literature [Shu Y, Hu LA Vision-based Human Posture Detection Approach for Smart Home Applications. International Journal of Advanced Computer Science and Applications. 2023; 14(10): 209-216.], three network models, YOLOv5s, YOLOv5n and YOLOv6s, were used to conduct comparative tests on three human posture behaviors: walking, sitting and falling, and it was concluded that YOLOv5s had the best detection performance. Reference [Yin Y, Lei L, Liang M, Li X, He Y, Qin L. Research on fall detection algorithm for the elderly living alone based on YOLO. In 2021 IEEE International Conference on Emergency Science and Information Technology (ICESIT) 2021 Nov 22 (pp. 403-408). IEEE: 403-408.] solves the problem of mutual occlusion of detected targets by using YOLOv4 and YOLOv5s network models and adding prediction box center points to improve the loss function. However, the article only trains one state of falling, which has limitations for the recognition and detection of complex human posture behaviors. Reference [4] proposes a camera-based YOLOv8 small target detection algorithm, which extracts feature information through the downsampling operation of deep separable convolution and improves the C2f module of the original model to perform feature fusion of different sizes to improve the performance of the small target detection algorithm. However, after lightweight processing, the detection accuracy of the algorithm still has a lot of room for improvement. When it is used for fall detection, the probability of misjudgment is high. Reference [5] uses the attention mechanism to locate the target heat map, adopts the masked cross-attention mechanism to optimize the coarse-scale features, and introduces fine-scale features to improve the contour details, thereby improving the accuracy of target detection.Reference [6] proposed a multi-scale target detection algorithm based on the YOLO framework, a super-resolution reconstruction module combined with a channel attention mechanism, which improved the detection accuracy of targets with a large scale span. The fall detection algorithm based on posture recognition extracts the key points of the human skeleton and analyzes the position changes of the key points of the human center of mass to make a judgment.
[0003] As mentioned above, although many improvements have been made to the fall detection algorithm, the following problems still exist:
[0004] (1) The object detection algorithm in complex scenes has the problem of imprecise feature extraction. The human contour extraction of fall detection has higher requirements. Insufficient feature extraction is the bottleneck of the development of fall detection technology.
[0005] (2) The existing algorithms are unstable in estimating human posture in scenes with complex lighting changes, occluded key points, and rich textures, which affects the accuracy of fall detection. The human body is occluded, only half of the body is exposed, and the picture is blurred, which makes it impossible to accurately estimate the posture.
[0006] For complex human behaviors, it is difficult to distinguish between lying and falling behaviors by using only a single height-to-width ratio of the calibration frame as a judgment basis.
[0007] It is not difficult to see that there are still many problems in the existing technology, and it is necessary to improve the existing human posture estimation behavior algorithm to overcome the defects of the existing technology. Summary of the invention
[0008] Therefore, in order to solve the above problems in the prior art, the present invention proposes a human posture estimation algorithm based on SVM.
[0009] The present invention solves the above problems by the following technical means:
[0010] A human posture estimation algorithm based on SVM, including:
[0011] S1, obtaining a human body posture image;
[0012] S2, using the YOLOv8 Pose model to quickly and accurately extract 17 key points from the image obtained in S1;
[0013] S3, using the Canny edge detection algorithm to extract edge information from the image obtained in S1 and generate a reference vector;
[0014] S4, integrating the detection results of S2 and S3 to form a support vector containing 5-dimensional data;
[0015] S5, inputting the support vector formed in S4 into a support vector machine (SVM) to classify human body posture.
[0016] Furthermore, the 17 key points extracted in S2 include:
[0017] S21, determining whether the image dimension is lost;
[0018] S22, according to S21, if yes, use a dimension loss algorithm to process the dimension-loss image, generate a processing result, and then enter S4;
[0019] S23. If not, enter S4.
[0020] Further, the S22 includes:
[0021] S221, if the image has a single dimension lost, process the single dimension lost image based on KDtree;
[0022] S222. If the image loses multiple dimensions, the formula is used: and Processing of multi-dimensional lost images.
[0023] Furthermore, generating the reference vector in S3 includes:
[0024] Based on the Canny line detection technology, the length, total number, and minimum angle between the x-axis vector and the y-axis vector of each angle line in the image frame are calculated. The three weight parameters are 0.3, 0.4, and 0.3 respectively, and then the reference vector is generated.
[0025] Furthermore, the support vectors of the 5-dimensional data in S4 include:
[0026] The first dimension support vector, the vector between the human key points 5 and 11, and the vector between the human key points 6 and 12 are averaged with the reference vector.
[0027] The second dimension support vector, the vector between the human key points 11 and 13, and the vector between the human key points 12 and 14, respectively calculate the average of the angles between them and the reference vector.
[0028] The third-dimensional support vector, the vector between the human key points 13 and 15, and the vector between the human key points 14 and 16, respectively calculate the average of the angles between them and the reference vector.
[0029] The fourth dimension support vector, the vector between the human key points 5 and 7, the vector between the human key points 6 and 8, and the angle between them and the reference vector are averaged;
[0030] The fifth dimension support vector, the average of the angles between the vectors of the human body key points 1 and 2 and the reference vector.
[0031] Furthermore, the angle calculation formula from the first dimension to the fourth dimension is:
[0032] Where m represents the angle of the mth dimension, the angle is represented by a constant, j and k represent the coordinates of the key points, and β represents the reference vector.
[0033] Furthermore, the calculation formula for the angle of the fifth dimension is:
[0034] j and k represent the coordinates of the key points, and β represents the reference vector.
[0035] Furthermore, the classification of human body posture in S5 includes:
[0036] stand, sit, lie down;
[0037] This paper detects 17 key points of the human body and extracts coordinates based on the YOLOv8 Pose model, calculates the dynamic reference vector based on the Canny edge detection algorithm, and transmits the 5 different dimensional information generated by the above two technologies to the SVM support vector machine for model training. The training results are comprehensively evaluated by the 5-fold cross-validation method. The evaluation indicators involve the average accuracy, precision, recall rate and F1 score of 4 different SVM training kernel functions to ensure the effectiveness of the model. In order to deal with the problem of dimensionality loss, this study combines the KDTree structure and the k-nearest neighbor average algorithm to predict the lost dimensions.
[0038] The present invention adopts Yolov8pose to accurately predict the key points of the human body, based on the dimension calculation formula and retrograde human posture estimation, to solve the problems of human body occlusion and the problem of insufficient accuracy and precision of multi-person posture estimation;.
[0039] The present invention adopts the prediction of single-dimensional loss of human body based on KDtree and the prediction of multi-dimensional loss of human body based on the technology of predicting lost dimensions of known key points, which solves the dimensional loss problems caused by the inability to accurately identify key points of human body, human body occlusion, only half of the body is exposed, and the picture is blurred.
[0040] The project implements real-time human posture estimation based on the ARM architecture, solving the problems of slow response and lack of real-time performance of existing posture estimation. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0042] Figure 1 is a flow chart of the human body posture estimation algorithm based on SVM of the present invention;
[0043] Figure 2 is a schematic diagram of 17 key points of the human body according to the present invention;
[0044] Figure 3 is a schematic diagram of a single-dimensional lost image according to the present invention;
[0045] Figure 4 It is a schematic diagram of the multi-dimensional lost image described in the present invention. DETAILED DESCRIPTION
[0046] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the technical solution of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be pointed out that the described implementation examples are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0047] Example
[0048] The present invention is described in more detail below:
[0049] It should be noted that the present invention realizes real-time human posture estimation based on ARM architecture.
[0050] like Figure 1 As shown, a human posture estimation algorithm based on SVM includes:
[0051] S1. Acquire a human body posture image. Preferably, the present invention uses a camera to acquire a human body posture image.
[0052] S2, using the YOLOv8 Pose model to quickly and accurately extract 17 key points from the image obtained in S1; preferably, Figure 2 As shown, the 17 key points extracted in S2 include:
[0053] Preferably, the 17 key points are: key point 0-nose, key point 1-left eye, key point 2-right eye, key point 3-left ear, key point 4-right ear, key point 5-left shoulder, key point 6-right shoulder, key point 7-left elbow, key point 8-right elbow, key point 9-left wrist, key point 10-right wrist, key point 11-left hip, key point 12-right hip, key point 13-left knee, key point 14-right knee, key point 15-left ankle, key point 16-right ankle.
[0054] The present invention uses the yolov8pose human posture estimation algorithm model to extract the coordinates of 17 key points such as human eyes and leg joints from top to bottom. Figure 2 The coordinates and order of each key point in the vector are calculated by the SVM vector calculation formula below to calculate the required five-dimensional vector coordinates.
[0055] It should be noted that the present invention divides the parts of the human body into five dimensions: the eyes are one dimension, the shoulders are one dimension, the hands are one dimension, the hip bones are one dimension, and the legs are one dimension.
[0056] S21. Determine whether the image dimension is lost. It should be noted that, that is, determine whether some dimensions as mentioned above are lost in the image, that is, whether the human body parts corresponding to the dimensions as mentioned above are missing in the image. Indeed, a certain human body part corresponds to the loss of a certain dimension, the loss of one human body part corresponds to the loss of a single dimension, and the loss of two or more human body parts corresponds to the loss of multiple dimensions.
[0057] S22. According to S21, if yes, a dimension loss algorithm is used to process the dimension-lost image, generate a processing result, and then enter S4.
[0058] Preferably, the S22 includes:
[0059] S221, if the image has a single dimension lost, the single dimension lost image is processed based on KDtree; to make the present invention easier to understand, an example is given for illustration, such as Figure 3 As shown, Figure 3It is not difficult to find that the human foot joints do not appear in the picture and the foot joint coordinates cannot be detected normally, that is, the image has a single dimension loss. In this case, the single dimension lost image is processed based on KDtree, and the data of the other four dimensions closest to the detection image in the existing training set data are used to predict the detection image result.
[0060] S222. If the image loses multiple dimensions, the formula is used: and (In the formula, i represents the lost dimension and j represents the known dimension), the multi-dimensional lost image is processed. To make the present invention easier to understand, an example is given for illustration. Figure 4 As shown, Figure 4 Only eyes, shoulders, and hands are found in the image, but hip bones and legs are not found. That is, two dimensions are missing in the image, that is, multi-dimensional loss occurs. If multi-dimensional loss occurs, the above formula is used to predict the missing dimensions, for example Figure 4 The vectors of the two shoulder key points can be used to predict the leg vector.
[0061] That is, if one of the five dimensions in the image is lost, the KDTree technology is used to fill the missing dimension to form complete five-dimensional data; if multiple dimensions are lost, the technology based on predicting the missing dimensions with known key points is used to generate complete five-dimensional data.
[0062] S23. If not, enter S4.
[0063] S3, using the Canny edge detection algorithm to extract edge information from the image obtained in S1 and generate a reference vector;
[0064] Preferably, the method for generating the reference vector in S3 is: based on the Canny line detection technology, the length, total number, and minimum angle between each angle line in the picture frame and the x-axis vector and the y-axis vector are calculated, and the three weight parameters are 0.3, 0.4, and 0.3 respectively, so as to obtain the most accurate reference vector.
[0065] S4, integrating the detection results of S2 and S3 to form a support vector containing 5-dimensional data;
[0066] Preferably, the support vector of the 5-dimensional data in S4 includes:
[0067] The first dimension support vector, the vector between the human key points 5 and 11, and the vector between the human key points 6 and 12 are averaged with the reference vector.
[0068] The second dimension support vector, the vector between the human key points 11 and 13, and the vector between the human key points 12 and 14, respectively calculate the average of the angles between them and the reference vector.
[0069] The third-dimensional support vector, the vector between the human key points 13 and 15, and the vector between the human key points 14 and 16, respectively calculate the average of the angles between them and the reference vector.
[0070] The fourth dimension support vector, the vector between human key points 5 and 7, and the vector between human key points 6 and 8 are averaged with the reference vector.
[0071] The fifth dimension support vector, the average of the angles between the vectors of the human body key points 1 and 2 and the reference vector.
[0072] Preferably, the angle calculation formula from the first dimension to the fourth dimension is:
[0073] Where m represents the angle of the mth dimension, the angle is represented by a constant, j and k represent the coordinates of the key points, and β represents the reference vector.
[0074] Preferably, the calculation formula for the angle of the fifth dimension is:
[0075] j and k represent the coordinates of the key points, and β represents the reference vector.
[0076] S5, inputting the support vector formed in S4 into a support vector machine (SVM) to classify human body posture.
[0077] Preferably, the classification of human body posture in S5 includes:
[0078] Stand, sit, lie down.
[0079] Preferably, the present invention uses different kernel functions (linear, polynomial, Gaussian, radial, sigmoid) for training of three different postures, selects the optimal model through 5-fold cross validation, and conducts a comprehensive evaluation of the model. The evaluation indicators involve the average accuracy, precision, recall rate and F1 score of 4 different SVM training kernel functions to ensure the effectiveness of the model.
[0080] For the human fall task in this study, we used four scoring indicators: average accuracy, average precision, average recall, and mean F1.
[0081] In this study, the predicted values obtained by predicting the test set of the model results of three different posture states were compared with the actual values, and the confusion matrix was obtained as shown in Table 1, where ns, f, and s are the abbreviations of normal stand, fall, and sit.
[0082] Table 1 Confusion matrix Confusion matrix
[0083]
[0084]
[0085] The abbreviations of the four indicators mentioned above are: Avg.Acc, Avg.Prec, Avg.Rec, Avg.F1. Among them, ns represents the normal walking state, f represents the falling state, and s represents the sitting state.
[0086] There are 4 indicators in the study, and the specific formula is as follows:
[0087]
[0088] In the above formula, k represents the number of cross-validation times, and j represents three different states.
[0089] This paper detects 17 key points of the human body and extracts coordinates based on the YOLOv8 Pose model, calculates the dynamic reference vector based on the Canny edge detection algorithm, and transmits the 5 different dimensional information generated by the above two technologies to the SVM support vector machine for model training. The training results are comprehensively evaluated by the 5-fold cross-validation method. The evaluation indicators involve the average accuracy, precision, recall rate and F1 score of 4 different SVM training kernel functions to ensure the effectiveness of the model. In order to deal with the problem of dimensionality loss, this study combines the KDTree structure and the k-nearest neighbor average algorithm to predict the lost dimensions.
[0090] The present invention adopts Yolov8pose to accurately predict the key points of the human body, based on the dimensional calculation formula and retrograde human posture estimation, to solve the problems of human body occlusion and the problem of insufficient accuracy and precision in multi-person posture estimation.
[0091] The present invention adopts the prediction of single-dimensional loss of human body based on KDtree and the prediction of multi-dimensional loss of human body based on the technology of predicting lost dimensions of known key points, which solves the dimensional loss problems caused by the inability to accurately identify key points of human body, human body occlusion, only half of the body is exposed, and the picture is blurred.
[0092] The present invention realizes real-time human posture estimation based on the ARM architecture, solving the problems of slow response and insufficient real-time performance of the existing posture estimation.
[0093] References to "one embodiment", "another embodiment", "embodiment", "preferred embodiment", etc. in this specification refer to specific features, structures or characteristics described in conjunction with the example included in at least one embodiment generally described in this application. The appearance of the same expression in multiple places in the specification does not necessarily refer to the same embodiment. Further, when a specific feature, structure or characteristic is described in conjunction with any embodiment, it is claimed that the realization of such feature, structure or characteristic in conjunction with other embodiments also falls within the present invention. Although the present invention is described herein with reference to a number of illustrative examples of the present invention, it should be understood that those skilled in the art can design many other modifications and implementations that fall within the scope and spirit of the principles disclosed in this application. More specifically, within the scope of the present application disclosure, drawings and claims, in addition to the deformation and improvement that can be made to the components and / or layout of the subject combination layout, other uses will also be obvious to those skilled in the art.
Claims
1. A human posture estimation algorithm based on SVM, characterized in that: include: S1, obtaining a human body posture image; S2, using the YOLOv8 Pose model to quickly and accurately extract 17 key points from the image obtained in S1; S3, using the Canny edge detection algorithm to extract edge information from the image obtained in S1 and generate a reference vector; S4, integrating the detection results of S2 and S3 to form a support vector containing 5-dimensional data; S5, inputting the support vector formed in S4 into a support vector machine SVM to classify human body posture.
2. The human body posture estimation algorithm according to claim 1, characterized in that: The 17 key points extracted from S2 include: S21, determining whether the image dimension is lost; S22, according to S21, if yes, use a dimension loss algorithm to process the dimension-loss image, generate a processing result, and then enter S4; S23. If not, enter S4.
3. The human body posture estimation algorithm according to claim 2, characterized in that: The S22 includes: S221, if the image has a single dimension lost, process the single dimension lost image based on KDtree; S222. If the image loses multiple dimensions, the formula is used: and Processing of multi-dimensional lost images.
4. The human body posture estimation algorithm according to claim 1, characterized in that: The method for generating the reference vector in S3 is as follows: Based on the Canny line detection technology, the length, total number, and minimum angle between the x-axis vector and the y-axis vector of each angle line in the image frame are calculated. The three weight parameters are 0.3, 0.4, and 0.3 respectively, and then the reference vector is generated.
5. The human body posture estimation algorithm according to claim 1, characterized in that: The support vectors of the 5-dimensional data in S4 include: The first dimension is to find the average of the angles between the vectors of the key points 5 and 11 and the vectors of the key points 6 and 12 and the reference vector. The second dimension is to find the average of the angles between the vectors between the key points 11 and 13 of the human body, and the vectors between the key points 12 and 14 of the human body and the reference vector; The third dimension is to calculate the average of the angles between the vectors between the key points 13 and 15 of the human body, and the vectors between the key points 14 and 16 of the human body and the reference vector; The fourth dimension is to find the average of the angles between the vectors of the key points 5 and 7 and the vectors of the key points 6 and 8 and the reference vector; In the fifth dimension, the angle between the vector of human key points 1 and 2 and the reference vector is averaged.
6. The human body posture estimation algorithm according to claim 5, characterized in that: The angle calculation formula from the 1st dimension to the 4th dimension is: Where m represents the angle of the mth dimension, the angle is represented by a constant, j and k represent the coordinates of the key points, and β represents the reference vector.
7. The human body posture estimation algorithm according to claim 5, characterized in that: The calculation formula of the angle of the fifth dimension is: j and k represent the coordinates of the key points, and β represents the reference vector.
8. The human body posture estimation algorithm according to claim 1, characterized in that: The classification of human body posture in S5 includes: Stand, sit, lie down.