Real-time sitting posture detection method based on Kalman filtering fusion algorithm

By introducing Kalman filtering technology into the Mediapipe attitude estimation algorithm, the problems of strong sensor dependence, limited monitoring range and high delay are solved, and efficient and real-time contactless sitting posture monitoring is achieved, improving monitoring accuracy and stability.

CN120580723APending Publication Date: 2025-09-02GUILIN UNIV OF ELECTRONIC TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510754605.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-06
Publication Date
2025-09-02

AI Technical Summary

Technical Problem

The existing sitting posture monitoring technology has problems such as strong sensor dependence, limited monitoring range, key point jitter and high delay, making it difficult to achieve efficient and real-time contactless human sitting posture monitoring.

Method used

The lightweight Mediapipe attitude estimation calculation method combined with Kalman filtering technology is used to collect video streams in real time through the camera, extract the coordinates of key points of the human body, and smooth the process, calculate the angles of the trunk and cervical spine, determine the hunchback state with the threshold, and provide real-time feedback on the sitting posture.

Benefits of technology

Real-time monitoring of 24FPS is realized, the accuracy of hunchback status recognition reaches 94.65%, and the jitter of key points is reduced by 62.65%. It is adapted to multi-angle application scenarios to meet the lightweight needs of embedded devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120580723A_ABST
    Figure CN120580723A_ABST
Patent Text Reader

Abstract

The invention discloses a real-time sitting posture detection method based on a Kalman filtering fusion algorithm. The method comprises the steps that S1, a user sitting posture video stream is collected in real time through a camera; s2, using a MediaPipe attitude estimation framework to extract 33 key point coordinates of a human body in the video stream; s3, smoothing the coordinates of the key points by using a Kalman filtering algorithm to suppress jitter of the key points; s4, calculating a torso bending angle and a cervical vertebra forward inclination angle based on the filtered key point coordinates; s5, jointly judging whether the user is in a humpback state or not according to a preset threshold value, and judging that the user is in a humpback state if any angle exceeds the threshold value; and S6, feeding back the sitting posture state in real time through the interactive interface. According to the invention, a dynamic filtering technology is introduced for optimization through a lightweight Medipe attitude estimation algorithm, and the algorithm is deployed to a common embedded device to realize non-contact mobile human body sitting posture monitoring, so that the problems of low comfort, large measurement error and high time delay are effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of computer vision and health monitoring, and in particular relates to a real-time sitting posture detection method based on a Kalman filter fusion algorithm. Background Art

[0002] In recent years, a variety of spinal and lumbar problems caused by improper sitting posture have become more common among teenagers, office workers and the elderly, causing varying degrees of harm and showing a trend of becoming younger. In order to solve the problems of traditional monitoring technology, such as strong sensor dependence, limited monitoring range, key point jitter and high latency, this paper proposes a lightweight system that integrates Mediapipe posture estimation and Kalman filter dynamic optimization to effectively solve the shortcomings of existing technologies. According to experimental data, the system can achieve 24FPS real-time monitoring when deployed on a Raspberry Pi. Based on the test data of 20 users, the average accuracy of hunchback state recognition reached 94.65%. After filtering, the key point jitter was reduced, the standard deviation of the trunk bending angle was reduced by 62.2%, and the standard deviation of the cervical spine forward tilt angle was reduced by 63.1%. It provides a low-cost and high-quality health management solution for different application scenarios such as campus, office and home, and effectively prevents musculoskeletal diseases for different age groups. Poor sitting posture will increase the risk of diseases in multiple organ systems of the body. According to relevant data, about 2 million people worldwide suffer from various chronic diseases or even die each year due to long-term sitting and improper sitting posture [1]. For teenagers, poor sitting posture can easily lead to a series of irreversible effects such as scoliosis; for office workers, long-term sitting for an average of eight hours a day or a series of poor sitting postures can easily cause lumbar disc herniation; and for the elderly, due to osteoporosis and lumbar degeneration, even slightly poor sitting postures are more likely to cause acute diseases, bringing immeasurable consequences.

[0003] However, there are four main limitations in the current sitting posture monitoring solution:

[0004] High sensor dependence: Existing solutions often rely on wearable sensors for monitoring, which provide low comfort and high deployment costs.

[0005] Limited monitoring range: Contact devices have difficulty accurately measuring and calculating human joint angles, while monitoring cameras used with non-contact devices cannot track people and are difficult to accurately identify and analyze under obstructions.

[0006] Key point jitter: Existing filtering algorithms have shortcomings to varying degrees in the smoothing of multidimensional data. For example, mean filtering is significantly affected by noise interference [2] and is unlikely to play a substantial role in eliminating the jitter of key points.

[0007] High algorithm latency: Existing solutions suffer from significant latency due to high computational complexity, making it difficult to meet the requirements of real-time monitoring. While some lightweight models can reduce latency, they suffer from prominent jitter issues at key points, affecting the reliability of posture estimation. Summary of the Invention

[0008] (1) Technical problems solved

[0009] To address the shortcomings of the existing technology, the present invention introduces dynamic filtering technology to optimize the lightweight Mediapipe posture estimation algorithm, and deploys it to common embedded devices to realize non-contact mobile human sitting posture monitoring, effectively solving the problems of low comfort, large measurement error, and high latency.

[0010] (2) Technical solution

[0011] To achieve the above objectives, the present invention provides the following technical solution: a real-time sitting posture detection method based on a Kalman filter fusion algorithm, comprising the following steps:

[0012] S1, collect user sitting posture video stream in real time through the camera;

[0013] S2, use the MediaPipe pose estimation framework to extract the coordinates of 33 key points of the human body in the video stream;

[0014] S3, applying a Kalman filter algorithm to smooth the coordinates of the key points to suppress key point jitter;

[0015] S4. Based on the filtered key point coordinates, calculate the trunk flexion angle (shoulder-hip-knee) and cervical spine forward tilt angle (nose-shoulder midpoint-hip midpoint);

[0016] S5. Determine whether the user is in a hunchback state based on a preset threshold value, and determine that the user is in a hunchback state if any angle exceeds the threshold value;

[0017] S6. Real-time feedback on sitting posture status is provided through the interactive interface, a three-dimensional articulated diagram of the current sitting posture of the human body and a curve of sitting posture changes during the monitoring process are drawn, and changes in angles and sitting postures are dynamically displayed. The IPS display is used as a carrier to provide feedback to the user, so that the user can understand his or her own sitting posture in real time.

[0018] As a preferred solution, the Kalman filter technology is used in S3 to smooth the key points, which includes:

[0019] a) State Model

[0020] Considering that the posture of a person sitting on a chair changes little and changes at approximately uniform speed, only the position and velocity are tracked, that is, a uniform velocity model is adopted, and the state vector is:

[0021] X=[p,v] T

[0022] P is the key point position, and V is the key point velocity. This two-dimensional state model can significantly reduce computational complexity, reduce the consumption of Raspberry Pi performance, and reduce the delay caused by adding Kalman filtering.

[0023] b) Process noise covariance Q

[0024] The rate at which a person adjusts their sitting posture when sitting on a chair is low, so a smaller process noise is given to enhance the confidence of the model, i.e., the process noise covariance is: Q = 10 -4 ;

[0025] c) Measurement noise covariance R

[0026] The actual measurement of Mediapipe monitoring process has inherent jitter, and the standard deviation of key point jitter is about ±5 pixels. If R < 10 -1 , the filtering result is sensitive to noise; if R>100, the smoothing effect is weakened, and the measurement noise covariance R=10 is set comprehensively. -1 ;

[0027] d) Kalman filter formula

[0028] Prediction steps:

[0029]

[0030] Update steps:

[0031]

[0032] in represents the prior state estimation vector at the kth moment; F represents the state transfer matrix, which is Where Δt = 1 frame, the frame rate is 25fps; X k-1 Represents the posterior state estimation vector at the k-1th moment; represents the prior estimation error covariance matrix at the kth moment; P k-1 represents the posterior estimation error covariance matrix at the k-1th moment; Q represents the process noise covariance matrix; K k is represented by the Kalman gain matrix; H is represented by the observation matrix of only the observation position, that is, H = [1 0]; R is represented by the measurement noise covariance matrix; X k Represents the posterior state estimation vector at the kth moment; Z k Represented as the actual observation vector at the kth moment; P k represents the posterior estimation error covariance matrix at the kth moment; I represents the identity matrix.

[0033] As a preferred solution, the trunk bending angle in S4 is calculated as follows:

[0034] Extract the key point coordinates of the right shoulder, right hip, right knee and the left shoulder, left hip, and left knee;

[0035] Construct the vectors from hip to shoulder and hip to knee, calculate the left and right trunk bending angles respectively using the law of cosines, and take the average as the final angle. The coordinates of the key nodes are:

[0036] Right shoulder: p 12 =(x 12 ,y 12 ,z 12 ), right hip: p 24 =(x 24 ,y 24 ,z 24 ), right knee: p 26 =(x 26 ,y 26 ,z 26 );

[0037] Left shoulder: p 11 =(x 11 ,y 11 ,z 11 ), left hip: p 23 =(x 23 ,y 23 ,z 23 ), left knee: p 25 =(x 25 ,y 25 ,z 25 );

[0038] For the right torso, construct the vectors from the hip node to the shoulder and knee:

[0039]

[0040] Similarly, the left torso vector is:

[0041]

[0042] Use the law of cosines to calculate the left and right trunk bending angles respectively, in degrees.

[0043] Right torso angle θ right Defined as and The angle between:

[0044]

[0045] Combine the left and right torso bending angles and calculate their average to eliminate unilateral errors:

[0046]

[0047] As a preferred solution, the calculation method of the cervical vertebrae forward tilt angle in S4 is:

[0048] Extract the coordinates of the key points of the nose tip, the midpoint of the shoulders, and the midpoint of the hips;

[0049] Construct vectors from the nose tip to the midpoint of the shoulders and from the midpoint of the shoulders to the midpoint of the hips, and calculate the angle between them using the law of cosines.

[0050] Define the key point nose tip as: p0 = (x0, y0, z0), the midpoint of the shoulders;

[0051] midpoint of both hips;

[0052]

[0053] Construct vectors from the tip of the nose to the midpoint of the shoulders, and from the midpoint of the shoulders to the midpoint of the hips: Cervical angle θ cervical for and The angle between:

[0054]

[0055] As a preferred solution, the hunchback determination rule is to set thresholds for the trunk and cervical spine for joint determination. If one of them is met, it is determined to be a hunchback. At the same time, the trunk symmetry constraint principle is added to assist in the determination:

[0056] In a correct sitting posture, the left and right torso bending angles should be nearly symmetrical. Excessive differences may be caused by scoliosis or unilateral sitting. Considering the angle fluctuations caused by camera shake or short-term adjustment of sitting posture, Kalman filtering technology will be used to suppress noise to avoid large fluctuations in key points. The threshold is set to 10° based on empirical values, that is: |θ right -θ left |≤10°;

[0057] In an upright sitting position, the spine is in a straight line, that is, the shoulder-hip-knee is close to a straight line. A decrease in the angle indicates that the trunk is leaning forward. Clinically, the trunk bending angle θ torso <160°, the lumbar spine load increases significantly

[11] , which can be diagnosed as kyphosis;

[0058] In a normal state of the cervical spine, the nose tip, shoulder midpoint, and hip midpoint are close to a straight line. A decrease in the angle indicates that the head is tilted forward. Clinically, the cervical spine tilt angle θ cervical If the angle is less than 150°, the cervical spine pressure increases by 30%

[12] , which can be diagnosed as kyphosis.

[0059] As a preferred solution, the process noise covariance of the Kalman filter in S3 is set to 0.1, and the measurement noise covariance is dynamically adjusted based on the MediaPipe key point jitter standard deviation.

[0060] As a preferred solution, the preset thresholds in S5 are: the trunk bending angle threshold is set to 30°; the cervical spine forward tilt angle threshold is set to 20°.

[0061] As a preferred solution, the interactive interface in S6 is implemented through PyQt5, which displays the three-dimensional skeleton articulation diagram and angle change curve in real time.

[0062] (3) Beneficial effects

[0063] Compared with the existing technology, the present invention provides a real-time sitting posture detection method based on the Kalman filter fusion algorithm, which has the following beneficial effects:

[0064] This invention innovatively introduces a Kalman filter algorithm into the traditional Mediapipe framework, designs appropriate process noise and measurement noise parameters, smoothes monitoring data, balances state prediction, and updates measurement weights, suppresses high noise while retaining valid sitting posture information, and effectively smooths out key point jitter during the monitoring process. The user's current sitting posture category is comprehensively determined by calculating the trunk flexion angle of the shoulder-hip-knee and the cervical flexion angle of the nose tip-shoulder midpoint-hip midpoint. Judgment thresholds and conditions are set in conjunction with medical research and related data to effectively ensure accuracy during the monitoring process. A comprehensive sitting posture monitoring system is built with a two-dimensional pan-tilt head and camera, achieving 24FPS real-time monitoring, adapting to multi-angle application scenarios, and meeting the lightweight requirements of embedded devices. The system's average accuracy in identifying hunchback states reaches 94.65%, and key point jitter is reduced by 62.65% after filtering. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] Figure 1 This is a schematic diagram of the process of detecting human sitting posture by the hardware layer, algorithm layer and interaction layer of the present invention;

[0066] Figure 2 This is a schematic diagram showing the key nodes of the human body in Mediapipe33 of the present invention;

[0067] Figure 3 This is a flow chart of the sitting posture monitoring algorithm of the present invention;

[0068] Figure 4 This is a flow chart of the experiment of the present invention;

[0069] Figure 5 A 1-minute curve graph of the trunk bending angle before and after the introduction of the Kalman filter in the present invention;

[0070] Figure 6This is a 1-minute curve graph of the cervical vertebrae forward tilt angle before and after the introduction of Kalman filtering in the present invention. DETAILED DESCRIPTION

[0071] In order to better understand the purpose, structure and function of the present invention, the real-time sitting posture detection method based on the Kalman filter fusion algorithm of the present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.

[0072] Example 1

[0073] refer to Figure 1-6 The present invention provides a real-time sitting posture detection method based on a Kalman filter fusion algorithm, the method comprising the following steps:

[0074] S1, collect user sitting posture video stream in real time through the camera;

[0075] S2, use the MediaPipe pose estimation framework to extract the coordinates of 33 key points of the human body in the video stream;

[0076] S3, applying a Kalman filter algorithm to smooth the coordinates of the key points to suppress key point jitter;

[0077] S4. Based on the filtered key point coordinates, calculate the trunk flexion angle (shoulder-hip-knee) and cervical spine forward tilt angle (nose-shoulder midpoint-hip midpoint);

[0078] S5. Determine whether the user is in a hunchback state based on a preset threshold value, and determine that the user is in a hunchback state if any angle exceeds the threshold value;

[0079] S6. Real-time feedback on sitting posture status is provided through the interactive interface, a three-dimensional articulated diagram of the current sitting posture of the human body and a curve of sitting posture changes during the monitoring process are drawn, and changes in angles and sitting postures are dynamically displayed. The IPS display is used as a carrier to provide feedback to the user, so that the user can understand his or her own sitting posture in real time.

[0080] like Figure 1 As shown, the present invention mainly realizes the detection of human sitting posture through the hardware layer, algorithm layer and interaction layer. Specifically:

[0081] Hardware layer: Use Raspberry Pi as the core controller, and use a 2D pan-tilt camera to collect all necessary environmental data for dynamic video streams;

[0082] Algorithm layer: The Mediapipe Pose framework is used to extract the coordinates of nodes such as the thigh, shoulder, and torso in the frame. Kalman filtering technology is introduced for data smoothing to eliminate key point jitter. The nodes required for sitting posture detection are then selected from the processed joint point data to calculate the torso flexion angle (shoulder-hip-knee) and cervical spine angle (nose-shoulder midpoint-hip midpoint). The user's current sitting posture is determined using a set threshold.

[0083] Interaction layer: Use PyQt5 to build the user interface, draw a three-dimensional articulated diagram of the human body's current sitting posture and the sitting posture change curve during the monitoring process, dynamically display the changes in angle and sitting posture, and use the IPS display as a carrier to feedback to the user, so that the user can understand his or her own sitting posture in real time.

[0084] The algorithm used in the posture monitoring of the present invention is MediaPipe Pose, which is a human posture monitoring method formed by using the Blaze Pose lightweight convolutional neural network architecture under the MediaPipe framework. The key point coordinates directly output by the Mediapipe Pose framework have instantaneous jitter, and the fluctuation amplitude increases as the user adjusts the sitting posture. Therefore, Kalman filtering technology is used to smooth the key points. The Mediapipe Pose framework has 33 human body key points, as shown in the attached manual. Figure 2 shown.

[0085] Furthermore, in step S3 of the present invention, the Kalman filter technology is used to smooth the key points. The design of the Kalman filter is described below, which includes:

[0086] a) State Model

[0087] Considering that the posture of a person sitting on a chair changes little and changes at approximately uniform speed, only the position and velocity are tracked, that is, a uniform velocity model is adopted, and the state vector is:

[0088] X=[p,v] T

[0089] P is the key point position, and V is the key point velocity. This two-dimensional state model can significantly reduce computational complexity, reduce the consumption of Raspberry Pi performance, and reduce the delay caused by adding Kalman filtering.

[0090] b) Process noise covariance Q

[0091] The rate at which a person adjusts their sitting posture when sitting on a chair is low, so a smaller process noise is given to enhance the confidence of the model, i.e., the process noise covariance is: Q = 10 -4 ;

[0092] c) Measurement noise covariance R

[0093] The actual measurement of Mediapipe monitoring process has inherent jitter, and the standard deviation of key point jitter is about ±5 pixels. If R < 10 -1 , the filtering result is sensitive to noise; if R>10°, the smoothing effect is weakened, and the measurement noise covariance R=10 is set comprehensively. -1 ;

[0094] d) Kalman filter formula

[0095] Prediction steps:

[0096]

[0097] Update steps:

[0098]

[0099]

[0100] in represents the prior state estimation vector at the kth moment; F represents the state transfer matrix, which is Where Δt = 1 frame, the frame rate is 25fps; X k-1 Represents the posterior state estimation vector at the k-1th moment; represents the prior estimation error covariance matrix at the kth moment; P k-1 represents the posterior estimation error covariance matrix at the k-1th moment; Q represents the process noise covariance matrix; K k is represented by the Kalman gain matrix; H is represented by the observation matrix of only the observation position, that is, H = [1 0]; R is represented by the measurement noise covariance matrix; X k Represents the posterior state estimation vector at the kth moment; Z k Represented as the actual observation vector at the kth moment; P k represents the posterior estimation error covariance matrix at the kth moment; I represents the identity matrix.

[0101] Example 2

[0102] The present invention is based on a real-time sitting posture detection method based on a Kalman filter fusion algorithm. It stipulates that the user's hunchback is comprehensively judged by calculating the dual indicators of trunk bending angle and cervical vertebra angle. The trunk bending angle is calculated by the position angle relationship of three key points: the left and right shoulders, hips and knees; the cervical vertebra angle is determined by the position angle relationship of three key points: the nose tip, the midpoint of both shoulders and the midpoint of both hips. The key points used for calculation are: 0, 11, 23, 25 and 12, 24, 26. The flowchart of the sitting posture monitoring algorithm is attached to the specification. Figure 3 As shown;

[0103] Specifically, the calculation method of the trunk bending angle in S4 is:

[0104] Extract the key point coordinates of the right shoulder, right hip, right knee and the left shoulder, left hip, and left knee;

[0105] Construct the vectors from hip to shoulder and hip to knee, calculate the left and right trunk bending angles respectively using the law of cosines, and take the average as the final angle. The coordinates of the key nodes are:

[0106] Right shoulder: p 12 =(x 12 ,y 12 ,z 12 ), right hip: p 24 =(x 24 ,y 24 ,z 24 ), right knee: p 26 =(x 26 ,y 26 ,z 26 );

[0107] Left shoulder: p 11 =(x 11 ,y 11 ,z 11 ), left hip: p 23 =(x 23 ,y 23 ,z 23 ), left knee: p 25 =(x 25 ,y 25 ,z 25 );

[0108] For the right torso, construct the vectors from the hip node to the shoulder and knee:

[0109]

[0110]

[0111] Similarly, the left torso vector is:

[0112]

[0113] Use the law of cosines to calculate the left and right trunk bending angles respectively, in degrees.

[0114] Right torso angle θ right Defined as and The angle between:

[0115]

[0116] Combine the left and right torso bending angles and calculate their average to eliminate unilateral errors:

[0117]

[0118] Specifically, the calculation method of the cervical spine forward tilt angle in S4 is:

[0119] Extract the coordinates of the key points of the nose tip, the midpoint of the shoulders, and the midpoint of the hips;

[0120] Construct vectors from the nose tip to the midpoint of the shoulders and from the midpoint of the shoulders to the midpoint of the hips, and calculate the angle between them using the law of cosines.

[0121] Define the key point nose tip as: p0 = (x0, y0, z0), the midpoint of the shoulders;

[0122] midpoint of both hips;

[0123]

[0124] Construct vectors from the tip of the nose to the midpoint of the shoulders, and from the midpoint of the shoulders to the midpoint of the hips: Cervical angle θ cervical for and The angle between:

[0125]

[0126] Furthermore, the hunchback determination rule of the present invention is to set thresholds for the trunk and cervical spine for joint determination. If one of them is met, it is determined to be a hunchback. At the same time, the trunk symmetry constraint principle is added to assist in the determination:

[0127] In a correct sitting posture, the left and right torso bending angles should be nearly symmetrical. Excessive differences may be caused by scoliosis or unilateral sitting. Considering the angle fluctuations caused by camera shake or short-term adjustment of sitting posture, Kalman filtering technology will be used to suppress noise to avoid large fluctuations in key points. The threshold is set to 10° based on empirical values, that is: |θ right -θ left |≤10°;

[0128] In an upright sitting position, the spine is in a straight line, that is, the shoulder-hip-knee is close to a straight line. A decrease in the angle indicates that the trunk is leaning forward. Clinically, the trunk bending angle θ torso <160°, the lumbar spine load increases significantly

[11] , which can be diagnosed as kyphosis;

[0129] In a normal state of the cervical spine, the nose tip, shoulder midpoint, and hip midpoint are close to a straight line. A decrease in the angle indicates that the head is tilted forward. Clinically, the cervical spine tilt angle θ cervical <150°, the cervical spine pressure increases by 30%

[12] , which can be judged as kyphosis. In the normal state of the cervical spine, the nose tip-shoulder midpoint-hip midpoint is close to a straight line. A decrease in the angle indicates that the head is tilted forward. Clinically, the cervical spine tilt angle θ cervical <150°, cervical spine pressure increases by 30%, which can be determined as kyphosis.

[0130] Example 3

[0131] In order to better understand the design scheme of the present invention, the real-time sitting posture detection method based on the Kalman filter fusion algorithm of the present invention will evaluate the accuracy, stability and real-time performance of monitoring the human sitting posture over a period of time through multiple groups of comparative experiments using cameras located at different positions of the user.

[0132] Specific, preliminary preparation:

[0133] Experimental environment: The hardware equipment uses a Raspberry Pi 4B + a camera with a resolution of 640*480 + a 7-inch IPS touch screen; at the algorithm level, pycharm is used to run Python scripts, and the operating environment is: Python 3.11.

[0134] Variable control: Ensure that the lighting in the experimental environment is uniform and stable, the seat height is fixed at 45 cm, and the monitoring equipment height is fixed at 75 cm.

[0135] Experimental group settings:

[0136] The cameras are located in front and on the side of the experimental subject, and the Kalman filtering technology is used to monitor the subject's upright and hunched sitting postures.

[0137] Control group: directly use the original keypoint coordinates output by MediaPipe (without filtering);

[0138] Experimental group: keypoint coordinates after applying Kalman filtering (process noise, observation noise);

[0139] Set up the experimental groups as shown in Table 1 below:

[0140]

[0141] Table 1

[0142] Evaluation Metrics

[0143] 1) Monitoring accuracy

[0144] Monitoring accuracy: used to observe the overall prediction success rate of the system:

[0145]

[0146] Precision: The proportion of actual hunchbacks among cases predicted by the observation system:

[0147]

[0148] Recall rate: used to observe the proportion of correct identification in real hunchback cases:

[0149]

[0150] Table 2 below shows the meaning of the characters used in the monitoring accuracy formula

[0151] name meaning TP (True Positive) Correctly identify hunchback sitting posture TN (True Negative) Correctly identify normal sitting posture FP (False Positive) Normal sitting posture is mistakenly reported as hunchback FN (False Negative) Hunchback sitting posture missed detection

[0152] Table 2

[0153] 2) Stability

[0154] The stability of the monitoring system is reflected by calculating the standard deviation of the angle fluctuation SD, which can reflect the degree of angle fluctuation. The larger the standard deviation, the more drastic the data fluctuation and the worse the stability; the smaller the standard deviation, the more stable the system. t and the standard deviation of the cervical vertebrae anterograde angle σ c Quantitatively evaluate the noise suppression effect of Kalman filtering.

[0155] The calculation formula for angle fluctuation standard deviation SD is:

[0156]

[0157] Where N represents the number of data points; θ i represents a single data point; μ represents the data mean.

[0158] 3) Real-time

[0159] In order to evaluate the impact of Kalman filtering on the real-time performance of the system, a comparative analysis was conducted using the single-frame processing time to ensure that the system can run smoothly on the hardware device, with a requirement of less than 50ms.

[0160] Furthermore, the experimental process is as follows:

[0161] 1) System calibration

[0162] Before the formal test, check whether the monitoring equipment is in normal working condition and confirm whether it can be turned on automatically to ensure that the current experimental environment has no impact on the experimental results.

[0163] 2) Data Collection

[0164] Standard sitting posture: The subject maintains an upright sitting posture for 1 minute, and baseline data is collected. Sitting posture switching: The subject switches to a hunched sitting posture at a constant speed and maintains the current sitting posture for 1 minute.

[0165] 3) Data Recording

[0166] After the experiment, a 30-second window period was maintained to record the coordinates and relative angles of key points before and after filtering, as well as the sitting posture change curve and time nodes during the experiment.

[0167] Results and Discussion

[0168] 1) Monitoring accuracy analysis

[0169] Based on the above experimental steps, relevant data from the two-minute experiment was compiled. Table 3 shows the accuracy, precision, and recall rates. As shown in Table 3, with the support of Kalman filtering technology, the accuracy, precision, and recall rates increased simultaneously when the monitoring device was positioned in front of the subject, with an average improvement of 3.7%. Table 4 shows that the accuracy, precision, and recall rates increased simultaneously when the monitoring device was positioned to the side of the subject, with an average improvement of 5.6%.

[0170] Experimental groups Accuracy Accuracy Recall 1 92.3 88.5 94.1 2 89.7 91.2 87.5 3 95.6 93.8 96.3 4 93.1 94.5 91.8

[0171] Table 3

[0172] Experimental groups Accuracy Accuracy Recall 5 93.0 90.2 95.0 6 90.5 88.8 91.2 7 97.0 95.1 98.2 8 96.2 94.7 97.5

[0173] Table 4

[0174] From Table 3 and Table 4, we can see that:

[0175] The side detection effect is better than the front detection. When no filtering is used, the accuracy of side detection is improved by an average of 0.75% compared to the front detection. After using Kalman filtering, the accuracy of hunchback recognition in the side is +6.3%, while that in the front detection is only +3.4%. The accuracy of hunchback recognition before and after filtering is as follows:

[0176]

[0177] The above data shows that the accuracy gain after filtering is significantly improved by 4.55%. This is because the monitoring equipment located on the side is more likely to expose the curvature of the human back, with fewer obstacles and other obstructions, making it easier to capture key nodes of the human body, and the monitoring is more accurate and complete.

[0178] 2) Kalman filter effect analysis

[0179] Table 5 below shows the system stability data before and after filtering

[0180] condition Standard deviation of trunk flexion angle (degrees) Standard deviation of cervical vertebrae anteversion angle (degrees) Before filtering 8.2° 6.5° After filtering 3.1° 2.4°

[0181] Table 5

[0182] According to the data in Table 5, we calculate the improvement rate of filtering effect:

[0183]

[0184] Among them, σ o Expressed as the standard deviation of the angle before filtering, σ fIt is expressed as the standard deviation of the angle after filtering. According to Table 5 and the calculated filtering effect improvement rate, it is found that the standard deviation of the trunk bending angle is reduced by 62% and the standard deviation of the cervical vertebrae forward tilt angle is reduced by 63.1%. Figure 5 and Figure 6 It can be seen that the standard deviation is significantly reduced after filtering, indicating that the Kalman filter parameters set in the present invention can effectively suppress the angle fluctuation during the sitting posture change process, and the cervical spine forward tilt noise suppression effect is slightly better than the trunk bending noise. This is related to the smaller amplitude of neck movement during the sitting posture change. The Kalman filter algorithm has a better smoothing effect on this type of high-frequency noise signal, which comprehensively improves the stability of sitting posture judgment.

[0185] 3) Real-time analysis

[0186] Table 6 below shows the system single frame processing time before and after filtering

[0187] Experimental conditions Single frame processing time (ms) No Kalman filter used 35 Using Kalman filtering 42

[0188] Table 6

[0189] The data in Table 6 shows that the introduction of Kalman filtering in the system increases the single-frame processing time by 7ms. This time mainly comes from the matrix operations and data fusion performed for state prediction and update in the Kalman filter. The single-frame processing time of 42ms can still support a frame rate of approximately 24fps, meeting the requirements of various scenarios.

[0190] Furthermore, the present invention proposes a sitting posture monitoring system that integrates lightweight posture estimation and Kalman filtering. By innovatively introducing the Kalman filtering algorithm on the traditional Mediapipe framework, appropriate process noise and measurement noise parameters (Q = 10 -4 , R=10 -1 ) Smooth monitoring data, balance state prediction and measurement update weights, suppress high noise while retaining effective sitting posture information, and effectively smooth the jitter problem of key points in the monitoring process. By calculating the trunk flexion angle of the shoulder-hip-knee and the cervical flexion angle of the nose tip-shoulder midpoint-hip midpoint, the user's current sitting posture category is comprehensively determined. Combining medical research and related data to set judgment thresholds and conditions, the accuracy of the monitoring process is effectively guaranteed. With the two-dimensional pan-tilt and camera, a sitting posture monitoring system is built in all directions to achieve 24FPS real-time monitoring, adapt to multi-angle application scenarios, and meet the lightweight requirements of embedded devices. The system has an average hunchback state recognition accuracy of 94.65%, and the key point jitter is reduced by 62.65% after filtering;

[0191] Based on the above design, the system provides new design ideas and optimization solutions for human sitting posture monitoring. At the same time, due to the lightweight performance of Mediapipe, the system is more suitable for focusing on single-person sitting posture monitoring. It provides feedback to users on their current sitting posture through 3D skeletal images and sitting posture change curves to help them adjust and develop better sitting habits in the long term. It can also provide a new quantitative assessment tool for people with scoliosis and musculoskeletal diseases to assist them in corresponding rehabilitation training.

[0192] In the future, this technology can be combined with the Internet of Things to achieve cross-platform synchronous display and viewing, further bringing a convenient experience to users; it can also be combined with other sensor devices (millimeter wave radar) to provide basic vital signs and other information for sitting posture monitoring, build a health risk warning model, and facilitate users to further understand their own physical condition; introduce LSTM network to extract sitting posture time series features, identify other unhealthy sitting postures such as leaning over the desk, leaning back, and crossing legs, and establish data sets for different scenarios, providing low-cost and high-quality health management solutions for different application scenarios such as campuses, offices, and homes, and further preventing musculoskeletal diseases for different age groups.

[0193] Limitations: This invention focuses on the innovation of the sitting posture monitoring algorithm and key point de-jittering. The introduction of Kalman filtering technology reduces key point jitter but also brings a delay of 2-3 frames. In the future, we will focus on further optimizing Kalman filtering technology to balance noise suppression and real-time performance.

[0194] It will be understood that the present invention is described by way of some embodiments, and it will be appreciated by those skilled in the art that various changes or equivalent substitutions may be made to these features and embodiments without departing from the spirit and scope of the present invention. In addition, under the teachings of the present invention, these features and embodiments may be modified to adapt to specific circumstances and materials without departing from the spirit and scope of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of this application are intended to be protected by the present invention.

Claims

1. A real-time sitting posture detection method based on Kalman filter fusion algorithm is characterized by: The steps include: S1, collect user sitting posture video stream in real time through the camera; S2, use the MediaPipe pose estimation framework to extract the coordinates of 33 key points of the human body in the video stream; S3, applying a Kalman filter algorithm to smooth the coordinates of the key points to suppress key point jitter; S4. Based on the filtered key point coordinates, calculate the trunk flexion angle (shoulder-hip-knee) and cervical spine forward tilt angle (nose-shoulder midpoint-hip midpoint); S5. Determine whether the user is in a hunchback state based on a preset threshold value, and determine that the user is in a hunchback state if any angle exceeds the threshold value; S6. Real-time feedback on sitting posture status is provided through the interactive interface, a three-dimensional articulated diagram of the current sitting posture of the human body and a curve of sitting posture changes during the monitoring process are drawn, and changes in angles and sitting postures are dynamically displayed. The IPS display is used as a carrier to provide feedback to the user, so that the user can understand his or her own sitting posture in real time.

2. The real-time sitting posture detection method based on the Kalman filter fusion algorithm according to claim 1 is characterized in that: The Kalman filter technique is used in S3 to smooth the key points, which includes: a) State Model Considering that the posture of a person sitting on a chair changes little and changes at approximately uniform speed, only the position and velocity are tracked, that is, a uniform velocity model is adopted, and the state vector is: X=[p,v] T P is the key point position, and V is the key point velocity. This two-dimensional state model can significantly reduce computational complexity, reduce the consumption of Raspberry Pi performance, and reduce the delay caused by adding Kalman filtering. b) Process noise covariance Q The rate at which a person adjusts their sitting posture when sitting on a chair is low, so a smaller process noise is given to enhance the confidence of the model, i.e., the process noise covariance is: Q = 10 -4 ; c) Measurement noise covariance R The actual measurement of Mediapipe monitoring process has inherent jitter, and the standard deviation of key point jitter is about ±5 pixels. If R < 10 -1 , the filtering result is sensitive to noise; if R>10 0 , the smoothing effect is weakened, and the measurement noise covariance R is set to 10 -1 ; d) Kalman filter formula Prediction steps: Update steps: in represents the prior state estimation vector at the kth moment; F represents the state transfer matrix, which is Where Δt = 1 frame, the frame rate is 25fps; X k-1 Represents the posterior state estimation vector at the k-1th moment; represents the prior estimation error covariance matrix at the kth moment; P k-1 represents the posterior estimation error covariance matrix at the k-1th moment; Q represents the process noise covariance matrix; K k is represented by the Kalman gain matrix; H is represented by the observation matrix of only the observation position, that is, H = [1 0]; R is represented by the measurement noise covariance matrix; X k Represents the posterior state estimation vector at the kth moment; Z k Represented as the actual observation vector at the kth moment; P k represents the posterior estimation error covariance matrix at the kth moment; I represents the identity matrix.

3. The real-time sitting posture detection method based on Kalman filter fusion algorithm according to claim 1 is characterized in that: The calculation method of the trunk bending angle in S4 is: Extract the key point coordinates of the right shoulder, right hip, right knee and the left shoulder, left hip, and left knee; Construct the vectors from hip to shoulder and hip to knee, calculate the left and right trunk bending angles respectively using the law of cosines, and take the average as the final angle. The coordinates of the key nodes are: Right shoulder: p 12 =(x 12 ,y 12 ,z 12 ), right hip: p 24 =(x 24 ,y 24 ,z 24 ), right knee: p 26 =(x 26 ,y 26 ,z 26 ); Left shoulder: p 11 =(x 11 ,y 11 ,z 11 ), left hip: p 23 =(x 23 ,y 23 ,z 23 ), left knee: p 25 =(x 25 ,y 25 ,z 25 ); For the right torso, construct the vectors from the hip node to the shoulder and knee: Similarly, the left torso vector is: Use the law of cosines to calculate the left and right trunk bending angles respectively, in degrees. Right torso angle θ right Defined as and The angle between: Combine the left and right torso bending angles and calculate their average to eliminate unilateral errors:

4. The real-time sitting posture detection method based on the Kalman filter fusion algorithm according to claim 1 is characterized in that ,The calculation method of the cervical vertebrae forward tilt angle in S4 is: Extract the coordinates of the key points of the nose tip, the midpoint of the shoulders, and the midpoint of the hips; Construct vectors from the nose tip to the midpoint of the shoulders and from the midpoint of the shoulders to the midpoint of the hips, and calculate the angle between them using the law of cosines. Define the key point nose tip as: p0 = (x0, y0, z0), the midpoint of the shoulders; midpoint of both hips; Construct vectors from the tip of the nose to the midpoint of the shoulders, and from the midpoint of the shoulders to the midpoint of the hips: Cervical angle θ cervical for and The angle between:

5. The real-time sitting posture detection method based on the Kalman filter fusion algorithm according to claim 3 or 4 is characterized in that The hunchback judgment rule is to set thresholds for the trunk and cervical spine for joint judgment. If one of them is met, it is judged as a hunchback. At the same time, the trunk symmetry constraint principle is added to assist the judgment: In a correct sitting posture, the left and right torso bending angles should be nearly symmetrical. Excessive differences may be caused by scoliosis or unilateral sitting. Considering the angle fluctuations caused by camera shake or short-term adjustment of sitting posture, Kalman filtering technology will be used to suppress noise to avoid large fluctuations in key points. The threshold is set to 10° based on empirical values, that is: |θ right -θ left |≤10°; In an upright sitting position, the spine is in a straight line, that is, the shoulder-hip-knee is close to a straight line. A decrease in the angle indicates that the trunk is leaning forward. Clinically, the trunk bending angle θ torso <160°, the lumbar spine load increases significantly [11], which can be diagnosed as kyphosis; In a normal state of the cervical spine, the nose tip, shoulder midpoint, and hip midpoint are close to a straight line. A decrease in the angle indicates that the head is tilted forward. Clinically, the cervical spine tilt angle θ cervical If the angle is less than 150°, the cervical spine pressure increases by 30%[12], which can be diagnosed as kyphosis.

6. The real-time sitting posture detection method based on the Kalman filter fusion algorithm according to claim 1 is characterized in that ,The process noise covariance of the Kalman filter in S3 is set to 0.1, and the measurement noise covariance is dynamically adjusted based on the standard deviation of the MediaPipe key point jitter.

7. The real-time sitting posture detection method based on Kalman filter fusion algorithm according to claim 1 is characterized in that ,The preset thresholds in S5 are as follows: the trunk bending angle threshold is set to 30°; the cervical vertebrae forward tilt angle threshold is set to 20°.

8. The real-time sitting posture detection method based on Kalman filter fusion algorithm according to claim 1 is characterized in that ,The interactive interface in the S6 is implemented through PyQt5, which ,displays the three-dimensional skeleton articulation diagram and angle ,change curve in real time.

Citation Information

Cited By

  • A classroom sitting posture detection and identity recognition method and system based on multi-modal fusion and feature engineering

    CN122454631A