YOLOv11 attitude trajectory smoothing and abnormity early warning algorithm based on dynamic window weighted average
By building a YOLOv1 multi-task model and an adaptive trajectory smoothing algorithm, the real-time and robustness issues of the posture detection model on edge devices are solved, and high-precision, low-latency posture detection and early warning are achieved.
Patent Information
- Application Number
- CN202510827216.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-19
- Publication Date
- 2025-09-30
AI Technical Summary
Existing posture detection models have poor real-time performance and insufficient robustness on edge devices, and the single warning logic leads to delays, which cannot meet the real-time monitoring needs in complex scenarios.
A YOLOv1 multi-task model with a posture-specific feature enhancement layer is constructed. Combined with an adaptive trajectory smoothing algorithm and a hierarchical warning decision tree, the posture detection model is optimized to improve real-time performance and robustness.
It achieves high-precision, low-latency posture detection on edge devices, improves the accuracy of key point detection and early warning response speed, and adapts to motion changes in complex scenarios.
Smart Images

Figure CN120726563A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision and intelligent monitoring technology, and specifically to a real-time posture detection and early warning method that integrates a multi-task deep learning model and adaptive trajectory processing. The method is suitable for scenarios such as industrial safety monitoring, smart elderly care, and sports training. Background Art
[0002] In the field of posture detection based on deep learning, existing technologies have the following significant shortcomings:
[0003] Real-time bottleneck: Traditional pose detection models (such as HRNet and OpenPose) have large parameters (typically >50MB), and the inference speed on edge devices is difficult to exceed 20FPS, which cannot meet real-time monitoring requirements.
[0004] Poor robustness in complex scenarios: In scenes with occlusion, sudden changes in illumination, or rapid motion, the confidence level of key point detection fluctuates by more than 30%, which can easily lead to posture misjudgment.
[0005] Single warning logic: Existing methods are mostly based on single-frame posture feature judgment (such as joint angle), without combining the timing analysis of the target motion trajectory, resulting in abnormal behavior (such as falls, collisions) warning delays exceeding 500ms.
[0006] For example, Chinese patent CN202110345678.9 discloses a CNN-based posture detection method, but it does not incorporate trajectory smoothing and dynamic warning, resulting in a missed detection rate of up to 25% in fast-moving scenarios. The trajectory processing method proposed in U.S. Patent US102345678B1 uses fixed-window smoothing, which cannot adapt to targets of varying speeds, resulting in a deviation of more than 15 pixels between the smoothed trajectory and the true trajectory. Summary of the Invention
[0007] Purpose of the Invention
[0008] This paper provides a high-precision, low-latency posture detection and warning technology, which solves the problems of poor real-time performance, insufficient robustness and delayed warning in existing technologies through multi-task model optimization, adaptive trajectory smoothing and hierarchical warning decision trees.
[0009] Technical Solution
[0010] The core technical solutions of the present invention are as follows, which correspond to the specific limitations of claims 1-8:
[0011] 1. Multi-task model construction
[0012] Build a YOLOv11 multi-task model with a pose-specific feature enhancement layer (APEL), featuring:
[0013] Backbone network: uses CSPDarknet53 structure to extract multi-scale visual features;
[0014] APEL layer: integrates channel attention and spatial attention modules,
[0015] The weight calculation formula is:
[0016]
[0017] in,
[0018]
[0019] is the global average pooling and maximum pooling result of the channel dimension, W1 and W2 are the weights of the convolution layer, and σ is the Sigmoid function;
[0020] Multi-task output head: Synchronously outputs target bounding box coordinates (xyxy format), category confidence, and 17 keypoint coordinates and confidences (such as COCO standard keypoints).
[0021] 2. Adaptive trajectory smoothing algorithm
[0022] Perform dynamic window trajectory smoothing on a sequence of consecutive frame keypoints, characterized by:
[0023] Window dynamic calculation: Calculate the adaptive window size W according to the target centroid velocity v,
[0024] The formula is:
[0025]
[0026] Among them, k=2 is the speed coefficient, W min =3 is the minimum window value;
[0027] Smoothing: For the coordinates of the key points in the current frame, take the weighted average of the W frames before and after, with the recent frame weighted at 60%, and the historical frames weighted by time decay.
[0028] 3. Hierarchical warning decision tree
[0029] Joint angles and center of mass velocity are calculated based on smooth trajectories, and an alarm is triggered through a three-level early warning mechanism, which is characterized by:
[0030] Level 1 warning (yellow): The joint angle deviates from the normal range by >20°, such as the knee joint angle <160°;
[0031] Level 2 warning (orange): center of mass speed > 2m / s,
[0032] The calculation formula is:
[0033]
[0034] Level 3 warning (red): Joint angle deviation > 30° and center of mass speed > 1.5 m / s, such as a falling posture combined with rapid displacement. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 : YOLOv11-APEL multi-task model architecture diagram, showing the connection between the CSPDarknet53 backbone network and the APEL layer;
[0036] Figure 2 : Flowchart of the adaptive window trajectory smoothing algorithm, including speed calculation and window dynamic adjustment modules;
[0037] Figure 3 : Hierarchical warning decision tree logic diagram, marking the three-level warning trigger conditions and output interfaces;
[0038] Figure 4 : Experimental data comparison chart showing the missed detection rate and processing delay comparison curves of the present invention and the prior art. DETAILED DESCRIPTION
[0039] Example 1: Model training and deployment
[0040] 1. Dataset Preparation
[0041] Training set: A fusion of COCO Keypoints (80,000 images) and a custom industrial safety dataset (20,000 images), covering scenes such as high-altitude work and elderly activities;
[0042] Data augmentation: Rotation (±15°), scaling (0.8-1.2 times), and Gaussian noise (σ=0.05) are used to enhance the robustness of the model.
[0043] 2. Model training configuration
[0044] Input resolution: 640×640;
[0045] Optimizer: AdamW (initial learning rate 1e-3, cosine decay strategy);
[0046] Loss function:
[0047] T total =L de t+0.8·L pose +0.3·L smooth
[0048] in,
[0049] L det is CIoU loss + classification cross entropy,
[0050] Lpose is the key point MSE+FocalLoss,
[0051] K smooth is the L2 distance of features between adjacent frames;
[0052] Training rounds: 300 rounds (freeze the backbone network for the first 50 rounds).
[0053] 3. Model Quantization Deployment
[0054] The FP32 model was quantized to INT8 using TensorRT and deployed on the Jetson Nano device, increasing the inference speed to 35 FPS (the original FP32 model was 22 FPS).
[0055] Example 2: Real-time posture detection process
[0056] 1. Video stream processing
[0057] Input video: 30FPS, 1080p resolution;
[0058] Preprocessing: Resize to 640×640 and normalize to [0,1].
[0059] 2. Key point detection and trajectory smoothing
[0060] Model reasoning: Output target boxes (confidence > 0.5) and key points (confidence > 0.6);
[0061] Trajectory association: DeepSORT algorithm is used to match the same target in consecutive frames.
[0062] Get trajectory sequence
[0063] T=[(x1,y1,t1,...,(x n ,y n ,t n )]
[0064] Adaptive smoothing: Calculate the window W based on the current frame speed v and perform weighted averaging on the key points.
[0065] like: (When W=3)
[0066] 3. Early warning triggering and response
[0067] Joint angle calculation: Taking the knee joint as an example, the key point sequence is hip joint H, knee joint K, ankle joint A, and the angle formula is:
[0068]
[0069] Early warning response: The three levels of early warning trigger buzzer prompts (level 1), monitoring screen annotation (level 2), and SMS notification to the administrator (level 3).
[0070] Experimental data and beneficial effects
[0071] Real-time performance: The processing speed reaches 35FPS on Jetson Nano, which is 191% higher than HRNet (12FPS);
[0072] Accuracy: The key point detection accuracy in complex scenes is 92.3%, an increase of 13.2% compared to OpenPose (81.5%);
[0073] Warning delay: The average delay of the three-level warning is 120ms, which is 66% lower than that of single posture judgment (350ms);
[0074] Robustness: The missed detection rate in occlusion scenarios is reduced from 25% to 7.8%, and the false detection rate in scenes with sudden changes in illumination is reduced from 18% to 4.1%.
[0075] Advantages of the invention
[0076] 1. Model lightweighting: The APEL layer improves key point detection accuracy by 15% while increasing the number of parameters by 5%;
[0077] 2. Dynamic adaptability: When the target speed changes suddenly (e.g., from 0.5m / s to 3m / s), the trajectory smoothness fluctuation of the adaptive window smoothing algorithm is less than 3%;
[0078] 3. Engineering practicality: It supports edge device deployment and reduces power consumption by 70% compared to cloud solutions, making it suitable for real-time monitoring scenarios.
[0079] Citation relationship of claims
[0080] The detailed description of the present specification fully supports all technical features of claims 1 to 8, among which:
[0081] Example 1 corresponds to the model construction and training of claims 1, 2, and 3;
[0082] Example 2 corresponds to the trajectory processing and warning logic of claims 4, 5, and 6;
[0083] The real data portion supports the system and medium implementation of claims 7 and 8.
Claims
1. A YOLOv11 posture trajectory smoothing and abnormal warning algorithm based on dynamic window weighted averaging, characterized by: The following steps are involved: (1) Construct a YOLOv11 multi-task model, which includes: a CSPDarknet53 backbone network; a posture-specific feature enhancement layer (APEL) that focuses on key area features of the human body through channel attention and spatial attention mechanisms; and a multi-task output head that simultaneously outputs target box coordinates, category confidence, and K key point coordinates and confidences; (2) For the key point sequence of continuous frames, trajectory smoothing is performed using the adaptive window moving average algorithm. The calculation formula of the window size W is: Among them, v is the target center of mass velocity, k is the coefficient, W min is the preset minimum window value; (3) Based on the smoothed trajectory, the joint angle and center of mass velocity are calculated, and an early warning is triggered through a hierarchical decision tree. The hierarchical conditions include: Level 1 warning: The joint angle deviates from the normal range and exceeds the threshold; Level 2 warning: The center of mass speed exceeds the preset speed threshold; Level 3 warning: abnormal joint angle and center of mass speed exceeds the threshold.
2. The method according to claim 1, characterized in that The calculation formula of the attention mechanism of the APEL layer in step (1) is: Channel attention weight: Spatial attention weights: in, is the global average pooling and maximum pooling result of the channel dimension, W1 and W2 are the weights of the convolution layer, σ is the Sigmoid function, and f 7×7 It is a 7×7 convolution operation.
3. The method according to claim 1, characterized in that The total loss function of the multi-task model in step (1) is: L total =L det +α·L pose +β·L smooth Among them, L det is the CIoU loss and classification cross entropy loss for target detection, L pose is the MSE loss of the key point coordinates and the Focal Loss of the confidence, L smooth is the adjacent frame feature smoothing loss, α = 0.8, β = 0.3 are hyper parameters.
4. The method according to claim 1, wherein The target center of mass velocity in step (2) The calculation formula for v is: Among them, (x t ,y t ) is the coordinate of the center of mass of the current frame, (x t-1 ,y t-1 ) is the coordinate of the center of mass of the previous frame, Δt is the frame interval time.
5. The method according to claim 1, wherein The calculation method of the joint angle in step (3) is: For key point sequences A, B, C, joint angle θ satisfy: in, 6. The method according to claim 1, characterized in that The warning thresholds of the hierarchical decision tree include: Level 1 warning: The joint angle deviates from the normal range by >20°; Level 2 warning: center of mass speed > 2m / s; Level 3 warning: joint angle deviation >30° and center of mass speed >1.5m / s.
7. A posture detection and warning system based on YOLOv11, characterized in that: include: (2) a model building module for generating the YOLOv11 multi-task model described in claim 1; (3) a trajectory processing module, configured to execute the adaptive window trajectory smoothing algorithm described in claim 1; (4) An early warning trigger module, used to implement the hierarchical early warning decision tree described in claim 1.
8. A computer-readable storage medium, characterized in that A computer program is stored, and when the program is executed by a processor, the posture detection and early warning method based on YOLOv11 according to any one of claims 1 to 6 is implemented.
