A fine-grained temporal alignment-based motion instruction error correction system and method
By employing fine-grained temporal alignment and dynamic temporal warping algorithms, combined with a school-age group-sports project parameter library and error causal association rules, we have achieved accurate localization and real-time error correction of movement errors in AI sports teaching. This solves the problems of coarse temporal alignment granularity and low computational efficiency in existing technologies, and improves the accuracy and practicality of error correction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- RONGMENGYUESHI (SHANGHAI) SPORTS TECHNOLOGY CO LTD
- Filing Date
- 2026-04-22
- Publication Date
- 2026-05-26
AI Technical Summary
Existing AI-based sports teaching methods for motion correction have coarse temporal alignment granularity, making it impossible to accurately locate errors. They also fail to adapt to the temporal characteristics of different age groups and sports, lack error correlation analysis between temporal stages, have low computational efficiency, are difficult to achieve real-time error correction, and lack the authority of the discipline in the correction results.
The motion teaching error correction system based on fine-grained temporal alignment breaks down standard sports movements into multiple fine-grained temporal stages, sets temporal time windows and posture key point thresholds, constructs a two-dimensional temporal alignment parameter library for school age groups and sports projects, and combines dynamic temporal regularization algorithms and error causal association rules to perform dynamic temporal alignment and error correction prompt generation. It adopts terminal lightweight computing and hybrid computing modes to ensure real-time performance.
It enables precise identification of movement errors and their root causes, is adaptable to multiple age groups and sports, improves the efficiency and real-time nature of error correction in sports movement teaching, reduces costs, and enhances the accuracy and practicality of error correction.
Smart Images

Figure CN122076005A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of artificial intelligence sports teaching technology, specifically a motion teaching error correction system and method based on fine-grained temporal alignment. Background Technology
[0002] Existing AI-based motion correction methods in physical education teaching often employ single-point alignment of overall motion frames or keyframes, resulting in coarse temporal alignment granularity that fails to accurately pinpoint the location of errors. Furthermore, the use of uniform alignment templates fails to adapt to the temporal characteristics of different age groups and sports, and neglects individual student athletic abilities, leading to distorted alignment results. Additionally, the lack of error correlation analysis between temporal stages prevents the identification of independent errors and hinders the tracing of their root causes. Fine-grained temporal analysis is computationally inefficient, making real-time correction difficult on embedded AI terminals. Moreover, the standard motion temporal library is not aligned with physical education curriculum standards and international physical fitness testing standards, resulting in a lack of disciplinary authority in the correction results. Ultimately, this leads to poor accuracy, adaptability, and real-time performance in motion correction, failing to meet the needs of large-scale, precise, and comprehensive teaching correction across all age groups in school physical education. Summary of the Invention
[0003] To address the shortcomings of existing technologies, this invention proposes a motion teaching error correction system and method based on fine-grained temporal alignment. It breaks down standard sports movements into multiple fine-grained temporal stages, sets temporal time windows, posture key point thresholds, and error causal association rules between stages, and constructs a two-dimensional temporal alignment parameter library for different age groups and sports projects. The system acquires the temporal frame data of the student's movements to be corrected and achieves fine-grained temporal alignment with standard movements through a dynamic temporal warping algorithm. Error points are detected based on posture key point thresholds, and the root cause stage of the error is traced using association rules. Lightweight feature dimensionality reduction and error correction prompt generation are performed on the terminal, and computational latency is monitored in real time. When the threshold is exceeded, a hybrid computation mode combining edge pre-computation and cloud optimization is switched to ensure real-time performance. This invention can accurately locate motion errors and their root causes, is adaptable to multiple age groups and sports projects, and improves the efficiency and real-time performance of motion teaching error correction.
[0004] To achieve the above objectives, the present invention provides the following technical solution:
[0005] Action instruction error correction methods based on fine-grained temporal alignment include:
[0006] S1: Obtain standard sports movement data, break down the standard sports movements into N fine-grained temporal stages, set the temporal time window, posture key point threshold and error causal association rules between stages for each fine-grained temporal stage, and construct a two-dimensional temporal alignment parameter library of school age group and sports project.
[0007] S2: Obtain the time frame data of the student's action to be corrected, call the matching school age and project parameters from the time alignment parameter library, perform dynamic time alignment on the time frame data of the action to be corrected and the N fine-grained time stages of the standard sports action, and generate fine-grained time alignment data.
[0008] S3: Based on the attitude key point threshold, detect the error points in each stage of the fine-grained temporal alignment data, and trace the root cause stage of the error by combining the error causal association rules between the stages.
[0009] S4: On the terminal, perform lightweight feature dimensionality reduction on the time frame data of the action to be corrected, perform judgment calculations for error points and error root causes, generate time-series error correction prompts, monitor the delay of the judgment calculation, and if the delay exceeds the preset real-time delay threshold, switch to a hybrid calculation mode that combines edge pre-computation and cloud lightweight optimization until the delay is less than the real-time delay threshold.
[0010] Specifically, the construction of the time-series alignment parameter library in two dimensions—age group and sports item—includes:
[0011] S1.1: Obtain standard sports movement data, use human pose estimation algorithm to process each frame of the standard sports movement data, extract the spatial coordinates of multiple skeletal key points of the human body, and generate standard movement skeletal sequence data;
[0012] S1.2: The dynamic time warping algorithm is used to calculate the similarity matrix between the standard action skeletal sequence data and itself at different time points, detect local minimum points in the similarity matrix, and determine each local minimum point as an action time sequence segmentation point. Based on the action time sequence segmentation points, the complete standard sports action is divided into N sub-sequences, and the action time period corresponding to each sub-sequence is defined as a fine-grained time sequence stage.
[0013] S1.3: For each fine-grained timing stage, the average duration of the corresponding fine-grained timing stage in all standard motion skeleton sequence data is statistically analyzed. Based on the average duration and the preset allowable time deviation, the start time tolerance range and the end time tolerance range of the corresponding fine-grained timing stage are calculated. The union of the start time tolerance range and the end time tolerance range is defined as the timing window of the corresponding fine-grained timing stage.
[0014] Specifically, the construction of the time-series alignment parameter library with a two-dimensional dimension of school age group and sports project also includes:
[0015] S1.4: For each fine-grained temporal stage, traverse the skeletal keypoints of all frames within the corresponding fine-grained temporal stage. For each skeletal keypoint, collect the spatial coordinates of the corresponding skeletal keypoints in all frames within the corresponding fine-grained temporal stage to form a coordinate sample set of skeletal keypoints. Use a Gaussian mixture model to model the probability distribution of the coordinate sample set and solve the model parameters using the expectation-maximization algorithm.
[0016] S1.5: Based on the solved Gaussian mixture model, calculate the spatial coordinate boundary corresponding to the probability density value equal to the preset confidence threshold, and define the upper and lower limits of the spatial coordinate boundary as the attitude key point threshold of the skeletal key point in its respective fine-grained temporal stage.
[0017] S1.6: Based on the principles of sports biomechanics, analyze the posture correlation between N fine-grained temporal stages, identify the causal relationship between the specified erroneous posture pattern that appears in the previous stage and the specified erroneous posture pattern induced in the next stage, and record the error source stage identifier, the affected stage identifier and the error type to form the error causal correlation rules between stages.
[0018] S1.7: Organize and index the standard motion skeletal sequence data, N fine-grained temporal stages, the temporal time window of each stage, the posture key point threshold, and the error causal association rules between stages according to two dimensions: school age group and sports project, to construct a two-dimensional temporal alignment parameter library of school age group and sports project.
[0019] Specifically, the process of splitting the fine-grained timing stage includes:
[0020] S1.2.1: For the standard motion skeleton sequence data, calculate the instantaneous velocity vector and instantaneous acceleration vector of multiple skeletal key points in each frame of the sequence;
[0021] S1.2.2: Based on the instantaneous velocity vector magnitude of each skeletal key point, identify local minimum points in the curve of instantaneous velocity vector magnitude changing with time; based on the instantaneous acceleration vector magnitude of each skeletal key point, identify points in the curve of instantaneous acceleration vector magnitude changing with time that pass through zero, obtain the zero-crossing point of acceleration magnitude, and merge all the identified local minimum points and the zero-crossing point of acceleration magnitude into the first type of action temporal segmentation candidate points;
[0022] S1.2.3: The dynamic time warping algorithm is used to calculate the similarity matrix between the standard action skeletal sequence data and itself. Local minimum similarity points are detected in the main diagonal region of the similarity matrix. All detected local minimum similarity points are defined as candidate points for the second type of action temporal segmentation.
[0023] Specifically, the process of splitting the fine-grained timing stage further includes:
[0024] S1.2.4: Merge the first type of action time sequence segmentation candidate points with the second type of action time sequence segmentation candidate points to obtain a candidate point set, and sort the candidate point set according to their chronological order on the time axis. Traverse the sorted candidate point set. If the time interval between two adjacent candidate points is less than a preset merging threshold, they are merged into a new candidate point. The position of the new candidate point is taken as the average of the time positions of the corresponding two adjacent candidate points. Then, the candidate point set after redundancy removal is determined as the action time sequence segmentation point for action segmentation.
[0025] S1.2.5: Based on the position of the action timing segmentation point on the time axis, the standard action skeletal sequence data is segmented at the corresponding time point to obtain N temporally continuous subsequences, and the time period in the complete action corresponding to each subsequence is defined as a fine-grained timing stage.
[0026] Specifically, dynamic timing alignment is performed on the timing frame data of the action to be corrected and N fine-grained timing stages of the standard sports action to generate fine-grained timing alignment data, including:
[0027] S2.1: Acquire the action time frame data to be corrected by the video acquisition device, and use the same human skeleton key point detection algorithm as the one used to construct the standard action skeleton sequence data to extract the skeleton key points of the action time frame data to be corrected, and generate student action skeleton sequence data. Based on the current student's age group information and the current sports project information, query and call the corresponding standard action skeleton sequence data, N fine-grained time stages, time windows and posture key point thresholds from the time alignment parameter library.
[0028] S2.2: A dynamic time warping algorithm is adopted. Based on a preset similarity metric, the optimal bending path between the student motion skeleton sequence data and the standard motion skeleton sequence data is calculated, and a temporal constraint is introduced in the process of calculating the optimal bending path. The temporal constraint means that the frames in the student motion skeleton sequence data that are mapped to the kth fine-grained temporal stage of the call are only allowed to be aligned and matched with the frames in the standard motion skeleton sequence data that belong to the kth, k-1th, or k+1th fine-grained temporal stages, where k is an integer from 1 to N.
[0029] S2.3: Based on the optimal bending path, establish a frame-by-frame mapping relationship between each frame of the student motion skeleton sequence data and the corresponding frame of the standard motion skeleton sequence data. Based on the frame-by-frame mapping relationship and the fine-grained temporal stage, determine the standard fine-grained temporal stage to which each frame of the student motion skeleton sequence data belongs and assign it a fine-grained temporal stage label. Define the data set containing the frame-by-frame mapping relationship and the fine-grained temporal stage label as fine-grained temporal alignment data.
[0030] Specifically, the steps of S3 include:
[0031] S3.1: Based on the fine-grained temporal alignment data, each frame in the student motion skeleton sequence data is classified into the corresponding fine-grained temporal stage according to its assigned fine-grained temporal stage label;
[0032] S3.2: Within each fine-grained temporal stage, all predefined pose keypoint thresholds for the corresponding fine-grained temporal stage are retrieved from the temporal alignment parameter library. The spatial coordinates of each bone keypoint in each frame of the student motion skeleton sequence data within the corresponding fine-grained temporal stage are compared with the retrieved pose keypoint thresholds for the corresponding bone keypoints. If the spatial coordinates of any bone keypoint are higher than the upper limit of its spatial coordinate boundary or lower than the lower limit of its spatial coordinate boundary, it is determined that there is an error point at the corresponding bone keypoint. The fine-grained temporal stage identifier, the bone keypoint identifier, and the coordinate offset between the measured coordinates of the corresponding bone keypoint and the corresponding pose keypoint threshold boundary are recorded.
[0033] Specifically, the steps of S3 further include:
[0034] S3.3: For each detected error point, based on its corresponding fine-grained temporal stage identifier, query the error causal association rules between the stages, and based on the queried error causal association rules between the stages, obtain one or more preceding stage identifiers with the stage where the error point is located as the affected stage; the preceding stage identifier indicates the potential error source stage that caused the current error.
[0035] S3.4: Using the obtained preceding stage identifier as a new query starting point, iteratively execute the query operation. That is, for each newly obtained preceding stage identifier, query the error causal association rules between stages again to obtain its own preceding stage identifier, until for any stage identifier, it is impossible to find a preceding stage identifier for it as the affected stage from the error causal association rules between stages. The stage for which no earlier preceding stage identifier can be found is determined as the error root source stage corresponding to the error point.
[0036] Specifically, the terminal performs lightweight feature dimensionality reduction on the time-series frame data of the action to be corrected, performs error point and root cause determination calculations, and generates time-series error correction prompts, including:
[0037] S4.1: In the terminal device, receive lightweight feature data corresponding to the action to be corrected, and load the attitude key point thresholds of all fine-grained temporal stages corresponding to the current action and the error causal association rules between stages from the temporal alignment parameter library.
[0038] S4.2: The attitude key point thresholds are organized into a local attitude key point threshold index in the terminal device memory based on the fine-grained temporal stage identifiers to which they belong. At the same time, the error causal association rules between stages are organized into a local error causal association graph in the terminal device memory that supports forward and backward queries.
[0039] S4.3: Based on the lightweight feature data, restore the spatial coordinates of each skeletal key point in each fine-grained temporal stage of the student's motion skeletal sequence data. For each fine-grained temporal stage, retrieve the upper and lower limits of the spatial coordinates of each skeletal key point in the corresponding stage based on the local posture key point threshold index.
[0040] S4.4: Compare the restored spatial coordinates with the upper and lower limits of the retrieved spatial coordinates. If the spatial coordinates exceed the threshold range, it is determined that an error point has been detected, and the fine-grained temporal stage identifier, skeletal key point identifier, and coordinate offset of the error point are recorded.
[0041] Specifically, the terminal performs lightweight feature dimensionality reduction on the time-series frame data of the action to be corrected, performs error point and root cause determination calculations, and generates time-series error correction prompts, and also includes:
[0042] S4.5: For each detected error point, take its corresponding fine-grained temporal stage identifier as the starting node, and perform a reverse graph traversal operation in the local error causal relationship graph. The reverse graph traversal operation is to start from the current node, search for its predecessor node along the directed edge pointing to the current node in the local error causal relationship graph, and take the found predecessor node as the new current node. Iterate the search until no new predecessor node can be found. The fine-grained temporal stage corresponding to the node that finally cannot find a predecessor node is determined as the error root source stage corresponding to the error point.
[0043] S4.6: Based on the obtained error point information and error root cause stage, generate query conditions, and based on the query conditions, retrieve matching error correction prompt content units from the preset error correction prompt knowledge base; the error correction prompt content unit includes text correction instructions corresponding to the error root cause stage, annotated demonstration images corresponding to the action frame where the error point is located and the skeletal key point identifiers, and voice correction instructions corresponding to the time sequence of the error point occurrence.
[0044] S4.7: Organize and synchronize the retrieved text correction instructions, labeled demonstration images and voice correction commands according to the temporal sequence of action execution, and generate and output multimodal temporal error correction prompts.
[0045] A fine-grained temporal alignment-based action instruction error correction system includes:
[0046] The parameter construction module is used to acquire standard sports movement data, extract skeletal key points through human posture estimation algorithms, break down the movement into multiple fine-grained temporal stages, and form a two-dimensional temporal alignment parameter library of school age group and sports project by constructing error causal association rules between stages.
[0047] The dynamic temporal alignment module is used to collect the temporal frame data of the student's movements to be corrected and extract the student's movement skeletal sequence data. It calls the standard parameters of the corresponding school age and sports project, and uses a dynamic time warping algorithm with added temporal constraints to complete the temporal matching of the student's movements and the standard movements, generating fine-grained temporal alignment data.
[0048] The root cause tracing module, based on fine-grained temporal alignment data, compares the coordinates of key points of the student's skeleton with the threshold of key points of the posture according to the fine-grained temporal stages, identifies posture error points at each stage, and then traces the root cause stage through reverse iterative query.
[0049] The error correction output module is used to perform feature dimensionality reduction on action data at the terminal, complete error point identification and error root cause stage tracing, generate time-series error correction prompts, monitor computing latency in real time, and automatically switch to a hybrid computing mode that combines edge pre-computation and cloud lightweight optimization when the latency exceeds the real-time latency threshold.
[0050] Compared with the prior art, the beneficial effects of the present invention are:
[0051] 1. This invention proposes an action teaching error correction system based on fine-grained temporal alignment, and optimizes and improves its architecture, operation steps and processes. The system has the advantages of simple process, low investment and operation costs and low production and working costs.
[0052] 2. This invention proposes a motion teaching error correction method based on fine-grained temporal alignment. Through fine-grained temporal decomposition and dynamic temporal alignment, standard sports movements are precisely divided into continuous temporal stages according to their biomechanical characteristics. Combined with a Gaussian mixture model to set thresholds for key posture points, it can detect student movement deviations stage by stage and skeletal key points. Coupled with the error causal relationship rules mined by the Apriori algorithm, it can trace back from surface errors to the root stage, achieving accurate error location and efficient cause identification. This solves the pain point of traditional motion correction methods, which can only point out surface problems and cannot determine the source of errors, thus improving the accuracy and relevance of sports motion correction.
[0053] 3. This invention proposes a motion teaching error correction method based on fine-grained temporal alignment. This method adopts a dynamic switching architecture of lightweight terminal computing and hybrid computing. First, feature dimensionality reduction and real-time error correction prompt generation are completed on the terminal. When the computing latency exceeds the threshold, it automatically switches to a collaborative mode of edge pre-computation and cloud lightweight optimization, taking into account both terminal operating efficiency and cloud computing power advantages, and ensuring the real-time nature of error correction feedback. At the same time, a two-dimensional temporal alignment parameter library of school age group and sports project is constructed to adapt to the teaching and physical testing needs of different school age groups and sports projects. It has strong versatility, can reduce the error correction cost of physical education teaching, and improve the practicality and implementation capability of intelligent teaching systems. Attached Figure Description
[0054] Figure 1 This is a schematic diagram of the action teaching error correction method based on fine-grained temporal alignment according to the present invention;
[0055] Figure 2 This is a flowchart illustrating the principle of the action teaching error correction method based on fine-grained temporal alignment of the present invention.
[0056] Figure 3 This is an architecture diagram of the action teaching error correction system based on fine-grained temporal alignment according to the present invention. Detailed Implementation
[0057] Example 1:
[0058] Please see Figure 1 and Figure 2 The present invention provides an embodiment of an action teaching error correction method based on fine-grained temporal alignment, comprising the following steps:
[0059] S1: Obtain standard sports movement data, break down the standard sports movements into N fine-grained temporal stages, set the temporal time window, posture key point threshold and error causal association rules between stages for each fine-grained temporal stage, and construct a two-dimensional temporal alignment parameter library of school age group and sports project.
[0060] This embodiment takes the fourth to sixth grade of primary school and the standing long jump as the main application line. Students in this grade are in a period of rapid bone development, and their coordination and strength control are not yet mature. As the standing long jump is a core item of the national physical fitness test, the standardization of the movement directly affects the test results and sports safety. Therefore, this grade and item are selected as the typical implementation scenario.
[0061] In this embodiment, when constructing a time-series alignment parameter library for school age groups and sports events, standard sports movement data jointly calibrated by the physical education curriculum standards and the national standard physical fitness test standards are first obtained. In this embodiment, videos of standard standing long jump movements demonstrated by 10 professional physical education teachers from grades 4 to 6 of primary school are selected as the raw data. The videos are uniformly captured at a frame rate of 25 frames per second, and the shooting angle is simultaneously captured from both front and side angles to ensure complete coverage of the movement trajectory of key points of the human skeleton. A human posture estimation algorithm is used to process each frame of the standard sports movement data. The algorithm prioritizes extracting 17 core skeletal key points of the human body, including key positions such as the head, neck, shoulders, elbows, wrists, hips, knees, ankles, and waist. The three-dimensional spatial coordinates of each key point are calculated frame by frame, and abnormal coordinate values caused by shooting angle and lighting interference are removed. Finally, continuous, stable, and complete standard movement skeletal sequence data is generated. The standard movement skeletal sequence data completely records the skeletal movement information of the standard standing long jump from the preparation, pre-swing, take-off, flight, and landing cushioning.
[0062] Furthermore, a dynamic time warping algorithm is used to calculate the similarity matrix between the standard action skeletal sequence data and itself at different time points. The dynamic time warping algorithm generates a two-dimensional matrix representing action similarity by comparing the coordinate differences of key skeletal points frame by frame; the smaller the value in the matrix, the more similar the action postures of the two frames. Local minima are detected in the matrix; these local minima correspond to key nodes where the action motion state changes significantly, i.e., action temporal segmentation points. Simultaneously, the instantaneous velocity and acceleration vectors of the four core key points (shoulder, elbow, hip, and knee joints) in the standard action skeletal sequence data are calculated to identify local minima in the velocity magnitude change curve and zero-crossing points of the acceleration magnitude. These points are used as candidate points for the first type of action temporal segmentation. The local minima obtained by the dynamic time warping algorithm are used as... The second category of candidate points for action timing segmentation is merged and sorted according to the timeline. Redundant candidate points with time intervals less than 50 milliseconds are eliminated, resulting in 8 precise action timing segmentation points. Based on these points, the complete standard standing long jump action is divided into 9 consecutive fine-grained timing stages: the standing phase with feet together, the arm swing and knee bend pre-squat phase, the arm swing and push-off phase, the initial phase of foot lift-off, the body extension and take-off phase, the leg retraction and take-off phase, the heel touch-the-ground preparation phase, the full foot landing and cushioning phase, and the stabilization and finishing phase. The action time interval corresponding to each subsequence is a fine-grained timing stage, achieving a refined timing decomposition of the standing long jump action. The dynamic time warping algorithm is existing technology in this field and is not an inventive solution of this application, so it will not be described in detail here.
[0063] Furthermore, for each fine-grained temporal stage, the average duration of that stage in 10 sets of standard motion skeletal sequence data is statistically analyzed. Combined with a preset ±10% allowable time deviation, the start time tolerance range and end time tolerance range of each stage are calculated. The union of the two ranges is the temporal window of that fine-grained temporal stage. For example, the average duration of the arm swing and knee flexion pre-squat stage is 320 milliseconds, and its time window is 288 milliseconds to 352 milliseconds, ensuring that reasonable time deviations are allowed during alignment. At the same time, the coordinates of skeletal keypoints in all frames within each stage are traversed, and a coordinate sample set of each skeletal keypoint is collected. A Gaussian mixture model is used to model the probability distribution of the coordinate sample set, and the model parameters are solved using the expectation-maximization algorithm. Based on a preset confidence threshold, the spatial coordinate boundary of each keypoint is calculated. The upper and lower limits together constitute the posture keypoint threshold of that skeletal keypoint in the corresponding stage. Taking the knee joint as a key point, during the push-off phase, the upper limit of the coordinate corresponding to the knee joint bending angle in the standard movement is 85 degrees and the lower limit is 75 degrees. Exceeding this range is judged as excessive or insufficient knee flexion, providing a quantitative standard for subsequent error detection. Among them, the Gaussian mixture model and the expectation-maximization algorithm are existing technologies in this field and are not the inventive solutions of this application, and will not be elaborated here.
[0064] Furthermore, based on the principles of sports biomechanics and combined with the characteristics of common movement errors among students in grades 4-6, the postural correlations between nine fine-grained temporal stages were analyzed. Simultaneously, 200 sets of sample data on incorrect standing long jump movements from students in this grade were obtained, and the error posture type was labeled for each sample's fine-grained temporal stage. The Apriori association rule mining algorithm was used to process the error sample data, mining error stage-type combinations that met the support and confidence criteria, and constructing causal association rules between stages. For example, the mining revealed that errors such as knee valgus in the pre-squat stage directly lead to uneven force exertion during the take-off stage, resulting in a chain reaction of errors including body tilt during the flight stage and landing on one foot first; errors such as incomplete arm swing back cause insufficient power during the take-off stage, ultimately leading to a short flight distance. The error source stage, affected stage, error type, and confidence value were stored according to rules, forming a complete causal association rule library between stages. Finally, the standard motion skeleton sequence data, 9 fine-grained temporal stages, the temporal time window of each stage, the posture key point threshold, and the error causal association rules between stages are indexed and stored according to the 4th-6th grade elementary school grades and the standing long jump project, thus constructing a dedicated temporal alignment parameter library that can be directly used for motion alignment and error correction. Among them, the Apriori association rule mining algorithm is the existing technology in this field and is not an inventive solution of this application, so it will not be described in detail here.
[0065] S2: Obtain the time frame data of the student's action to be corrected, call the matching school age and project parameters from the time alignment parameter library, perform dynamic time alignment on the time frame data of the action to be corrected and the N fine-grained time stages of the standard sports action, and generate fine-grained time alignment data.
[0066] In this embodiment, a video of a fifth-grade elementary school student's standing long jump was selected as the data to be corrected. The video acquisition equipment was consistent with the standard action acquisition specifications, with 25 frames per second and dual-camera shooting, to obtain the student's complete time frame data of the action to be corrected.
[0067] In this embodiment, the same human skeletal key point detection algorithm used to construct the standard motion skeletal sequence data is employed to process the temporal frame data of the student's motion to be corrected. The three-dimensional spatial coordinates of 17 core skeletal key points are extracted frame by frame, and outliers are removed to generate the student's motion skeletal sequence data. The system inputs the student's current school grade as 5th grade and the physical education event as standing long jump. The system automatically retrieves the matching standard motion skeletal sequence data, 9 fine-grained temporal stages, time windows for each stage, and posture key point thresholds from the temporal alignment parameter library to complete parameter matching and loading.
[0068] Furthermore, a dynamic time warping algorithm is employed, based on a similarity metric of the differences in skeletal keypoint coordinates, to calculate the optimal bending path between the student's motion skeletal sequence data and the standard motion skeletal sequence data. Strict temporal constraints are introduced during the calculation: frames in the student's motion mapped to the k-th fine-grained temporal stage time window are only allowed to align with frames in the k, k-1, and k+1 stages of the standard motion, avoiding cross-stage misalignment and ensuring the rationality of the temporal logic. Through iterative algorithm calculation, the optimal bending path is generated, establishing a frame-by-frame mapping relationship between each frame of the student's motion and the corresponding frame of the standard motion. Based on the mapping relationship and the fine-grained temporal stages, each frame of the student's motion is assigned a corresponding stage label. For example, frames 30 to 55 of the student's motion are labeled as the "arm backswing and knee flexion pre-squat stage," and frames 56 to 70 are labeled as the "arm forwardswing and push-off stage." All data containing the frame-by-frame mapping relationship and stage labels constitutes the fine-grained temporal alignment data, achieving precise temporal matching between the student's motion and the standard motion at a fine-grained level.
[0069] S3: Based on the attitude key point threshold, detect the error points in each stage of the fine-grained temporal alignment data, and trace the root cause stage of the error by combining the error causal association rules between the stages.
[0070] Furthermore, based on fine-grained temporal alignment data, the student motion skeleton sequence data is categorized into nine fine-grained temporal stages by stage labels. Error detection is performed stage by stage and key point by key point. Within each fine-grained temporal stage, the system automatically calls the threshold values for all pose key points corresponding to that stage and compares the spatial coordinates of each skeleton key point in the student motion with the upper and lower limits of the threshold values one by one. If the coordinates of any skeleton key point are higher than the upper limit or lower than the lower limit, it is immediately determined that there is an error point in that skeleton key point in that frame, and the error information is recorded in detail, including the fine-grained temporal stage identifier, the skeleton key point identifier, and the offset of the measured coordinate value from the threshold boundary. Taking the student's movements in this embodiment as an example, three obvious errors were detected: the first occurred in the "arms swing back and knees bend pre-squat phase", where the coordinates of the knee joint key point were below the lower threshold limit, indicating insufficient knee flexion; the second occurred in the "arms swing forward and push-off phase", where the coordinates of the shoulder joint key point did not reach the upper threshold limit, indicating incomplete arm swing; and the third occurred in the "both feet off the ground initial phase", where the coordinates of the waist key point deviated from the threshold range, indicating excessive forward lean.
[0071] Furthermore, for each detected error, the causal relationship rules between stages are queried based on the stage identifier to iteratively trace the root cause of the error. Taking the error of excessive forward leaning as an example, its stage is the initial takeoff stage. Querying the rule base reveals that the cause of excessive forward leaning in this stage is insufficient arm swing during the push-off phase. Continuing to trace forward, insufficient arm swing is caused by insufficient arm swing during the pre-squat phase, which is directly related to insufficient knee flexion. Finally, when the iteration query reaches a stage with no preceding stage, it is determined that insufficient knee flexion during the pre-squat phase is the root stage of all errors in the student's standing long jump. The remaining errors are chain reactions caused by the root error. Through this tracing process, the core source of the movement error is accurately located, rather than just identifying surface errors, providing a basis for targeted error correction.
[0072] S4: On the terminal, perform lightweight feature dimensionality reduction on the time frame data of the action to be corrected, perform judgment calculations for error points and error root causes, generate time-series error correction prompts, monitor the delay of the judgment calculation, and if the delay exceeds the preset real-time delay threshold, switch to a hybrid calculation mode that combines edge pre-computation and cloud lightweight optimization until the delay is less than the real-time delay threshold.
[0073] Furthermore, the switching to a hybrid computing mode combining edge pre-computation and cloud-based lightweight optimization includes:
[0074] (1) Real-time monitoring of the total delay of the entire process from acquiring the timing frame data of the action to be corrected to generating multimodal timing error correction prompts on the terminal device. When the total delay exceeds the preset real-time delay threshold, a switch from terminal computing mode to hybrid computing mode is triggered.
[0075] (2) After the trigger mode is switched, the terminal device stops the local feature dimensionality reduction calculation and sends the original action time frame data to be corrected to the edge server. The edge server receives and performs feature dimensionality reduction calculation to generate lightweight feature data and uploads the generated lightweight feature data to the cloud server.
[0076] (3) The cloud server receives the lightweight feature data from the edge server, and based on the lightweight feature data, the cloud server performs error point detection, error root cause tracing and multimodal temporal error correction prompt generation calculation;
[0077] (4) In the hybrid computing mode, the cloud server continuously monitors the uplink network bandwidth from the terminal device to the edge server and the computing resource utilization rate of the edge server. Based on the monitored network bandwidth and the computing resource utilization rate of the edge server, the cloud server dynamically adjusts the feature dimension control threshold in the feature dimensionality reduction calculation performed by the edge server and sends the adjusted feature dimension control threshold to the edge server.
[0078] Furthermore, this embodiment uses a lightweight tablet device commonly used on campus as the terminal. The device is equipped with an entry-level processor for real-time display of error correction content. First, the terminal's local computing mode is activated. The terminal device receives lightweight feature data of the action to be corrected. This data has been processed by feature dimensionality reduction, retaining only the coordinates of the core skeletal key points and temporal information, reducing the data volume to 15% of the original data, thus reducing the terminal's computing pressure. The posture key point thresholds for all stages of the standing long jump event and the error causal association rules between stages are loaded from the temporal alignment parameter library. A local posture key point threshold index that can be quickly retrieved is built in the terminal's memory, as well as a local error causal association graph that supports forward and reverse queries. Based on the lightweight feature data, the key point coordinates of each stage of the student's action are restored and quickly compared with the threshold index to complete the secondary verification of error points and the final confirmation of the error root cause. The entire judgment calculation process is completed locally on the terminal without cloud involvement.
[0079] Furthermore, based on error point information and error root cause stage identifiers, the system retrieves matching content from a pre-set error correction prompt knowledge base. This knowledge base includes easy-to-understand text descriptions, clearly marked demonstration images, and rhythmic voice instructions designed for students in grades 4-6. For example, regarding insufficient knee flexion in this embodiment, the retrieved text correction instruction is: "When squatting, gently bend your knees, keeping the angle between your thighs and calves between 75 and 85 degrees; do not squat upright." The demonstration image is a side view of the standard squatting motion, with the correct knee position and angle marked in red. The voice instruction is a slow, clear, conversational prompt: "Ready, swing your arms back, slowly bend your knees, and lean your body slightly forward." Simultaneously, for derivative errors such as incomplete arm swings and excessive forward leaning, corresponding sequential error correction content is generated. Following the order of action execution, text, images, and voice are synchronously integrated to generate multimodal sequential error correction prompts that fit nine fine-grained temporal stages. These prompts are played stage by stage on the terminal screen, allowing students to compare their own errors with the standard movements in real time.
[0080] Furthermore, the system monitors the total latency of the entire process from acquiring action data to generating error correction prompts in real time. A preset real-time latency threshold of 200 milliseconds is set; latency exceeding this value will cause the error correction prompts to be out of sync with the actions, impacting the user experience. In local computing mode, the initial latency is 220 milliseconds. If this threshold is exceeded, the system automatically triggers a computing mode switch, stopping local feature dimensionality reduction calculations on the terminal and sending the original action sequence frame data to be corrected to the edge server. The edge server, with its enhanced computing power, completes feature dimensionality reduction processing, generates lightweight feature data, and uploads it to the cloud server. The cloud server then performs all calculations based on the lightweight feature data, including error detection, root cause tracing, and error correction prompt generation, reducing the terminal load.
[0081] Furthermore, in hybrid computing mode, the cloud continuously monitors the uplink network bandwidth from the terminal to the edge server, as well as the CPU and memory usage of the edge server, and dynamically adjusts the feature dimension control threshold. When network bandwidth is sufficient and the edge server load is low, the feature dimension is appropriately increased to retain more action details; when network congestion occurs and the server load is too high, the feature dimension is reduced to ensure data transmission and computing speed. After mode switching and parameter adjustment, the overall terminal latency is reduced to 150 milliseconds, lower than the real-time latency threshold, and error correction prompts are displayed without lag and in real-time, meeting the real-time requirements of classroom teaching.
[0082] Furthermore, the terminal will simultaneously display the final generated time-series error correction prompts to students and physical education teachers. Teachers can view detailed data such as the root cause of errors, error distribution, and offset through the terminal, and provide targeted guidance to students to correct them. Students can practice and correct themselves by referring to the stage-by-stage demonstration movements and voice prompts.
[0083] The constructed time-series alignment parameter library, which combines school age groups and sports events, includes:
[0084] S1.1: Obtain standard physical movement data jointly calibrated by the physical education curriculum standards and the national standard physical fitness and health test standards; use human posture estimation algorithm to process each frame of the standard physical movement data, extract the spatial coordinates of multiple skeletal key points of the human body, and generate standard movement skeletal sequence data.
[0085] Furthermore, the specific steps of S1.1 include:
[0086] (1) Based on the movement requirements of the physical education curriculum standards and the national student physical fitness test standards, certified physical education teachers with standardized movements and stable performance were selected as standard movement demonstrators. Finally, ten qualified physical education teachers were selected to form a demonstration group. All demonstrators uniformly completed the standing long jump movement demonstration according to the standard specifications, fully presenting the entire movement process of preparation, pre-swing, take-off, flight, and landing cushioning, forming standard physical education movement demonstration content that meets the curriculum standards and physical fitness test standards.
[0087] (2) For the standard sports movement demonstration content, a dual-camera high-definition camera was used to collect video. The two cameras were placed in front of and to the side of the demonstrator, respectively. The horizontal distance between the camera and the demonstrator was 3.5 meters and the vertical height was 1.2 meters. All cameras were set to a frame rate of 25 frames per second, a video resolution of 1920×1080 pixels, an exposure value of 100 milliseconds, and a white balance parameter of 5200 Kelvin. Each demonstrator completed 5 standard movement demonstrations in a row. Each demonstration generated an independent video. Finally, 50 original video data of standard movements were collected.
[0088] (3) Taking 50 standard action original video data as the processing object, each video is split frame by frame according to a uniform acquisition frame rate, and 25 continuous static images are obtained per second. All images are uniformly saved as bitmap format to form standard action original image data.
[0089] (4) Filter the original image data of the standard action, remove blurry images with a clarity score of less than 85, retain clear and usable images, and then perform size standardization processing on qualified images, uniformly adjust all images to a fixed size of 512×512 pixels, and finally perform brightness equalization processing on all images, uniformly adjust the overall brightness value of the image to 120, eliminate the differences in the image caused by light and shooting angle, and obtain the pre-processed standard action image.
[0090] (5) Based on the preprocessed standard action image, a lightweight, high-precision single-stage human pose estimation algorithm model is loaded. The input size of the human pose estimation algorithm model is set to 512×512 pixels. The feature extraction network adopts an 18-layer lightweight convolutional structure. The kernel size is set to 3×3, the convolution stride is set to 1, the padding value is set to 1, and the number of output channels of the key point detection branch is set to 17, corresponding to 17 fixed skeletal key points of the human body, namely the top of the head, the center of the neck, the left shoulder, the right shoulder, the left elbow, the right elbow, the left wrist, the right wrist, the left hip, the right hip, the left knee, the right knee, the left ankle, the right ankle, the left waist, the right waist, and the center of the torso. The confidence threshold of the key point is set to 0.85. The human pose estimation algorithm model after initialization can be directly used for key point detection.
[0091] (6) Input the preprocessed standard motion images one by one into the initialized human pose estimation algorithm model. The model extracts edge features, texture features and human contour features from the input images layer by layer. After convolution operation, it is connected to the activation function. The slope of the negative interval of the activation function is set to 0.01. After feature extraction, a key point heatmap with a size of 128×128 pixels is generated. The center position of the key point is located by peak detection of the heatmap. Then the position is mapped to the two-dimensional spatial coordinates of the original image. The coordinates retain two decimal places. The effective results are filtered according to the confidence threshold of 0.85. The effective spatial coordinate data containing 17 skeletal key points is output frame by frame.
[0092] (7) Using the effective spatial coordinate data of all frames of a single video segment as the processing object, the skeletal key point coordinates of each frame are spliced in a fixed order according to the time sequence of video playback to form single frame skeletal coordinate data. Then, all single frame skeletal coordinate data are concatenated in time sequence to form the initial skeletal sequence data of the video segment. The coordinate fluctuation threshold is set to 15 pixels. The continuous coordinates of all key points are traversed. Values with a change in coordinates of adjacent frames exceeding 15 pixels are judged as abnormal values. The abnormal values are replaced with the average value of the coordinates of two adjacent frames to obtain the purified skeletal sequence data of the single video segment.
[0093] (8) Taking the 50 video segments purified skeletal sequence data as the processing object, the most standard sequence of the action timing is selected as the reference sequence, and the remaining 49 sequences are aligned with the reference sequence through the timing alignment algorithm. The time tolerance of the alignment process is set to 3 frames. After the alignment is completed, the arithmetic mean of the coordinates of the same timing position and the same skeletal key point is calculated. The average value is used as the final standard coordinate of the position. All standard coordinates are combined according to the fixed timing order and key point order to generate unique and stable standard action skeletal sequence data. The timing alignment algorithm and the calculation of the arithmetic mean are the prior art in this field and are not the inventive solution of this application. They will not be described in detail here.
[0094] S1.2: The dynamic time warping algorithm is used to calculate the similarity matrix between the standard action skeletal sequence data and itself at different time points, detect local minimum points in the similarity matrix, and determine each local minimum point as an action time sequence segmentation point. Based on the action time sequence segmentation points, the complete standard sports action is divided into N sub-sequences, and the action time period corresponding to each sub-sequence is defined as a fine-grained time sequence stage.
[0095] S1.3: For each fine-grained timing stage, the average duration of the corresponding fine-grained timing stage in all standard motion skeleton sequence data is statistically analyzed. Based on the average duration and the preset allowable time deviation, the start time tolerance range and the end time tolerance range of the corresponding fine-grained timing stage are calculated. The union of the start time tolerance range and the end time tolerance range is defined as the timing window of the corresponding fine-grained timing stage.
[0096] S1.4: For each fine-grained temporal stage, traverse the skeletal keypoints of all frames within the corresponding fine-grained temporal stage. For each skeletal keypoint, collect the spatial coordinates of the skeletal keypoint in all frames within the corresponding fine-grained temporal stage to form a coordinate sample set of the skeletal keypoint. Use a Gaussian mixture model to model the probability distribution of the coordinate sample set and solve the model parameters using the expectation-maximization algorithm.
[0097] Furthermore, a Gaussian mixture model is used to model the probability distribution of the coordinate sample set, and the model parameters are solved using the expectation-maximization algorithm, including:
[0098] (1) For a single fine-grained temporal stage that has been divided, extract the spatial coordinates of a single skeletal key point corresponding to all temporal frames in the stage, summarize all coordinates in temporal order to form a coordinate sample set corresponding to the skeletal key point, and use it as input data for probability distribution modeling.
[0099] (2) Based on the coordinate sample set, the Gaussian mixture model is set to include three Gaussian distribution components. The model has a mixture weight calculation module, a mean vector solution module, and a covariance matrix solution module. The three modules work together to complete the probability distribution modeling of the coordinate sample set.
[0100] (3) Initialize the parameters of the configured Gaussian mixture model. Initialize the mixture weight parameters of the three Gaussian distribution components to 1 / 3. Use the overall average value of the coordinate sample set to initialize the mean vector parameter. Initialize the covariance matrix parameter to a matrix with diagonal elements of 0.1 and off-diagonal elements of zero. Complete the initial parameter configuration of the model.
[0101] (4) Using the Gaussian mixture model as the solution object, set the maximum number of iterations of the expectation maximization algorithm to 100 times and the convergence termination threshold to 0.0001, and complete the configuration of the algorithm's running parameters;
[0102] (5) Based on the initialized model parameters and coordinate sample set, traverse all coordinate samples and calculate the posterior probability of each coordinate sample corresponding to the three Gaussian distribution components. All posterior probabilities are combined to form a probability response matrix. The formula for calculating the posterior probability is the prior art in this field and is not an inventive solution of this application. It will not be elaborated here.
[0103] (6) Based on the probability response matrix and the coordinate sample set, the mixture weight parameters, mean vector parameters and covariance matrix parameters of the Gaussian mixture model are updated in a weighted manner, and the calculation process retains four decimal places of precision.
[0104] (7) Calculate the log-likelihood function of the model in the current iteration round and calculate the difference with the number of the previous round to obtain the iteration change. If the iteration change is less than the set convergence termination threshold, the model is determined to be converged and the iteration calculation is stopped. If the convergence condition is not met, return to (5).
[0105] (8) When the algorithm meets the convergence condition, extract the mixing weights, mean vectors and covariance matrices of the three Gaussian distribution components in the Gaussian mixture model as the final model parameters of the probability distribution of the skeleton key point coordinates. Then, associate and store the final model parameters with the corresponding fine-grained time series stage and the corresponding skeleton key point to complete the probability distribution modeling and parameter solving of a single skeleton key point. Finally, complete the standardized modeling of all skeleton key points in the same fine-grained time series stage according to the process of (1)-(8).
[0106] S1.5: Based on the solved Gaussian mixture model, calculate the spatial coordinate boundary corresponding to the probability density value equal to the preset confidence threshold. Define the upper and lower limits of the spatial coordinate boundary as the posture key point threshold of the skeletal key point in its fine-grained time series. In this embodiment, according to the judgment requirements of sports movement teaching and national physical fitness test standards, the confidence threshold on which the probability density calculation is based is fixed at 0.95.
[0107] S1.6: Based on the principles of sports biomechanics, analyze the posture correlation between N fine-grained temporal stages, identify the causal relationship between the specified erroneous posture pattern that appears in the previous stage and the specified erroneous posture pattern induced in the next stage, and record the error source stage identifier, the affected stage identifier, and the error type to form an error causal correlation rule between stages. Among these, sports biomechanics is the prior art in this field and is not an inventive solution of this application, so it will not be described in detail here.
[0108] Furthermore, the process of constructing the erroneous causal association rules between the stages includes:
[0109] (1) Obtain multiple sets of labeled error action sample data, wherein each set of error action sample data contains an action sequence that has been pre-divided into multiple fine-grained temporal stages, and each fine-grained temporal stage is labeled with whether there is an error posture and the specific type of the error posture.
[0110] (2) Extract the fine-grained time series stages marked with erroneous postures from each set of erroneous action sample data, combine each fine-grained time series stage marked with erroneous postures with the specific type of erroneous posture marked in that stage to form an erroneous stage-type transaction item, and define the set of all erroneous stage-type transaction items from all erroneous action sample data as the set of transaction items to be mined.
[0111] (3) The Apriori association rule mining algorithm is used to mine all error stage-type transaction items from the set of transaction items to be mined, and the support is not lower than the preset minimum support threshold. These are defined as frequent error itemsets. The Apriori association rule mining algorithm is the prior art in this field and is not an inventive solution of this application. It will not be described in detail here.
[0112] Furthermore, the minimum support threshold is set using a dynamic configuration across two dimensions: age group and sports activity. First, the average frequency percentage of error samples for the target age group and activity is statistically analyzed. Then, the threshold is calculated as 0.8 times this percentage. Typical values are set for each age group, such as 5% for lower elementary grades, 6% for upper elementary grades, 7% for junior high grades, and 8% for senior high grades. The default value is 6%. The minimum support threshold is set to filter out occasional individual errors and retain high-frequency error patterns that are common in teaching and have corrective value. Since the younger the age group, the lower the stability of the movements and the more dispersed the error distribution, the minimum support threshold is gradually lowered to adapt to the characteristics of different age groups.
[0113] (4) Generate candidate association rules based on the temporal order of each error stage-type transaction item in the frequent error item set, calculate the confidence of each candidate association rule, select candidate association rules with a confidence of not less than the preset minimum confidence threshold, and define them as high confidence association rules.
[0114] Furthermore, the minimum confidence threshold is also set according to age group and sports item, with the calculation logic being 0.9 times the benchmark score of movement standardization for the target grade level. The threshold is set at 75% for lower elementary grades, 80% for upper elementary grades, 85% for junior high grades, and 90% for senior high grades, with a general default value of 80%. The minimum confidence threshold is set to ensure that there is a stable and reproducible causal relationship between preceding and subsequent errors, and to ensure that the rules conform to the rationality of sports biomechanics. The higher the age, the stronger the movement control ability and the more stable the error causal relationship. Therefore, the minimum confidence threshold is increased step by step.
[0115] (5) For each high-confidence association rule, extract the fine-grained temporal stage identifier and its error posture type contained in its preconditions as the error source stage identifier and error source posture type, extract the fine-grained temporal stage identifier and its error posture type contained in its conclusion as the affected stage identifier and affected posture type, and record the confidence value of the high-confidence association rule.
[0116] (6) The error source stage identifier, error source posture type, affected stage identifier, affected posture type and confidence value are organized and stored according to the preset formatting rules to form an error causal association rule library between stages.
[0117] Furthermore, to adapt to the terminal's lightweight loading and fast traversal and tracing requirements, the rule base, attitude threshold base, and error correction prompt knowledge base fields are aligned to reduce parsing overhead. This enables isolated storage of rules for multiple projects and educational stages to avoid mutual interference. The preset formatted rules adopt a key-value pair structured storage format containing fixed fields. Each rule includes fixed fields such as rule number, error source stage and attitude, affected stage and attitude, confidence, support, applicable age group and sports project, etc. Secondary indexes are established according to age group and sports project, and the rules are stored in chronological order. Both forward and reverse dual-path retrieval are supported.
[0118] S1.7: Organize and index the standard motion skeletal sequence data, N fine-grained temporal stages, the temporal time window of each stage, the posture key point threshold, and the error causal association rules between stages according to two dimensions: school age group and sports project, to construct a two-dimensional temporal alignment parameter library of school age group and sports project.
[0119] The process of splitting the fine-grained timing stage includes:
[0120] S1.2.1: For the standard motion skeleton sequence data, calculate the instantaneous velocity vector and instantaneous acceleration vector of multiple skeletal key points in each frame of the sequence;
[0121] Furthermore, the specific steps in S1.2.1 include:
[0122] (1) Read the standard motion skeleton sequence data, and determine the time interval between adjacent time frames in the standard motion skeleton sequence data to be 0.04 seconds based on the standard motion video acquisition frame rate of 25 frames per second;
[0123] (2) According to the order of the time frames, extract the horizontal and vertical coordinates of each bone key point in each time frame, and combine the horizontal and vertical coordinates of the same target bone key point in the same time frame to form the complete spatial coordinates of the bone key point in that time frame.
[0124] (3) Starting from the second time frame of the standard motion skeleton sequence data, subtract the horizontal coordinate of the same skeleton key point in the previous frame from the horizontal coordinate of the target skeleton key point in the current frame to obtain the change in horizontal coordinate, and subtract the vertical coordinate of the same skeleton key point in the previous frame from the vertical coordinate of the target skeleton key point in the current frame to obtain the change in vertical coordinate, and complete the calculation of the coordinate change of all time frames.
[0125] (4) Divide the change in horizontal coordinate by the time interval to obtain the instantaneous horizontal velocity of the target bone key point in the current frame, divide the change in vertical coordinate by the time interval to obtain the instantaneous vertical velocity of the target bone key point in the current frame, combine the instantaneous horizontal velocity and the instantaneous vertical velocity to form the instantaneous velocity vector of the bone key point in the current frame, and complete the instantaneous velocity vector calculation for all time frames.
[0126] (5) Starting from the third time frame of the standard motion skeleton sequence data, subtract the horizontal instantaneous velocity of the same bone key point in the previous frame from the horizontal instantaneous velocity of the target bone key point in the current frame to obtain the horizontal velocity change, and subtract the vertical instantaneous velocity of the same bone key point in the previous frame from the vertical instantaneous velocity of the target bone key point in the current frame to obtain the vertical velocity change, and complete the velocity change calculation for all time frames.
[0127] (6) Divide the change in lateral velocity by the time interval to obtain the instantaneous lateral acceleration of the target bone key point in the current frame, divide the change in longitudinal velocity by the time interval to obtain the instantaneous longitudinal acceleration of the target bone key point in the current frame, and combine the instantaneous lateral acceleration and the instantaneous longitudinal acceleration to form the instantaneous acceleration vector of the bone key point in the current frame.
[0128] (7) Align and organize the instantaneous velocity vector and instantaneous acceleration vector of the skeletal key points corresponding to each time frame according to the time frame number order to generate an instantaneous velocity vector sequence and an instantaneous acceleration vector sequence that completely match the standard motion skeletal sequence data.
[0129] S1.2.2: Based on the instantaneous velocity vector magnitude of each skeletal key point, identify local minimum points in the curve of instantaneous velocity vector magnitude changing with time; based on the instantaneous acceleration vector magnitude of each skeletal key point, identify points in the curve of instantaneous acceleration vector magnitude changing with time that pass through zero, obtain the zero-crossing point of acceleration magnitude, and merge all the identified local minimum points and the zero-crossing point of acceleration magnitude into the first type of action temporal segmentation candidate points;
[0130] Furthermore, the specific steps in S1.2.2 include:
[0131] (1) Load the instantaneous velocity vector and instantaneous acceleration vector of the key points of the skeleton;
[0132] (2) Traverse the instantaneous velocity vector of each time frame, calculate the corresponding magnitude value, arrange all the magnitude values in time sequence to form a continuous velocity magnitude time sequence. The formula for calculating the vector magnitude is the prior art in this field and is not an inventive solution of this application. It will not be elaborated here.
[0133] (3) Traverse the instantaneous acceleration vector of each time frame, calculate the corresponding magnitude value, and arrange all the magnitude values in time sequence to form a continuous acceleration magnitude time sequence.
[0134] (4) A sliding window is used to smooth the velocity modulus time sequence. The sliding window length is set to 5 frames. The window traverses the entire sequence in time sequence. The arithmetic mean of all modulus values in the window is used to replace the original modulus value at the center of the window to obtain the velocity modulus smooth sequence. Starting from the second value of the velocity modulus smooth sequence, the second to the last value is judged point by point. When the current value is less than both the value of the previous frame and the value of the next frame, the time sequence position is determined as the local minimum value of the velocity modulus. After the traversal is completed, all local minimum values of the velocity modulus are summarized.
[0135] (5) A sliding window with a length of 5 frames is used to smooth the acceleration modulus time sequence. The arithmetic mean of all modulus values in the window is used to replace the original modulus value at the center of the window to obtain the acceleration modulus smooth sequence. Starting from the second value in the acceleration modulus smooth sequence, the adjacent values are compared frame by frame. When the two values are distributed on both sides of the zero value, the time sequence position is determined as the zero-crossing point of the acceleration modulus. After traversing, all zero-crossing points of the acceleration modulus are summarized.
[0136] (6) Align the local minimum points of velocity magnitude and the zero-crossing points of acceleration magnitude according to the standard action sequence frame number to form an ordered sequence of local minimum points of velocity magnitude and sequence of zero-crossing points of acceleration magnitude.
[0137] S1.2.3: The similarity matrix between the standard action skeletal sequence data and itself is calculated using the dynamic time warping algorithm. Local minimum similarity points are detected in the region near the main diagonal of the similarity matrix. All detected local minimum similarity points are defined as candidate points for the second type of action temporal segmentation.
[0138] Furthermore, the specific steps in S1.2.3 include:
[0139] (1) Obtain the generated standard motion skeleton sequence data, which contains continuous temporal frames and the two-dimensional spatial coordinates of 17 fixed skeletal key points of the human body corresponding to each frame;
[0140] (2) Perform numerical mapping on the two-dimensional spatial coordinates of all skeletal key points in the standard motion skeletal sequence data, and uniformly map all coordinate values to the range of zero to one, eliminating the dimensional differences of coordinate data, and obtain normalized standard motion skeletal sequence data, which serves as the input data for the dynamic time warping algorithm.
[0141] (3) The normalized standard motion skeleton sequence data is set as the reference sequence and comparison sequence of the dynamic time warping algorithm. The calculation structure of sequence self-matching is established. At the same time, the distance calculation method of the dynamic time warping algorithm is set to Euclidean distance, the warping bandwidth parameter is set to 5, and the local constraint condition is set to continuous single-step movement. The initial configuration of all parameters of the dynamic time warping algorithm is completed.
[0142] (4) Based on the dynamic time warping algorithm with complete configuration, traverse all time point combinations of the baseline sequence and the comparison sequence, calculate the skeletal feature difference value of each time point and convert it into a similarity value, and finally generate a two-dimensional original similarity matrix with the same size as the total number of frames of the standard action skeletal sequence. The horizontal and vertical dimensions of the matrix correspond to the time frame number of the sequence.
[0143] (5) The original similarity matrix is numerically smoothed by the sliding window filtering method. The sliding window size is set to 3×3. All matrix values are traversed in the order from left to right and from top to bottom. The original value in the center of the window is replaced by the arithmetic mean of the values in the window to obtain the target similarity matrix after noise reduction and stabilization. The sliding window filtering method is the prior art in this field and is not an inventive solution of this application. It will not be described in detail here.
[0144] (6) Using the target similarity matrix as the detection object, perform local minimum detection point by point according to the matrix time sequence. The judgment rule is that the value of the current point is less than the values of all its eight neighboring points. At the same time, the minimum value screening threshold is set to 0.7 times the average similarity value of the matrix. Only points below this threshold are retained as valid local minimum points. The matrix time sequence positions corresponding to all valid local minimum points are summarized.
[0145] (7) Based on the matrix temporal position of the effective local minimum point, the matrix temporal position is reverse-mapped to the actual temporal frame position of the standard action skeleton sequence data. Each mapping result is determined as an action temporal segmentation point. All action temporal segmentation points are arranged in ascending order according to the order of action execution to form the second type of action temporal segmentation candidate points.
[0146] S1.2.4: Merge the first type of action temporal segmentation candidate points with the second type of action temporal segmentation candidate points to obtain a candidate point set. Sort the candidate point set according to their chronological order on the time axis. Traverse the sorted candidate point set. If the time interval between two adjacent candidate points is less than a preset merging threshold, they are merged into a new candidate point. The position of the new candidate point is the average of the time positions of the two adjacent candidate points. Then, the candidate point set after redundancy removal is determined as the action temporal segmentation point for action segmentation. In this embodiment, based on the acquisition parameter of 25 frames per second for standard action video, the merging threshold of adjacent candidate points is fixed at the time length corresponding to 2 frames to determine whether adjacent candidate points need to be merged.
[0147] S1.2.5: Based on the position of the action timing segmentation point on the time axis, the standard action skeletal sequence data is segmented at the corresponding time point to obtain N temporally continuous subsequences, and the time period in the complete action corresponding to each subsequence is defined as a fine-grained timing stage.
[0148] Dynamic timing alignment is performed on the timing frame data of the action to be corrected and N fine-grained timing stages of the standard sports action to generate fine-grained timing alignment data, including:
[0149] S2.1: Acquire the action time frame data to be corrected by the video acquisition device, and use the same human skeleton key point detection algorithm as the one used to construct the standard action skeleton sequence data to extract the skeleton key points of the action time frame data to be corrected, and generate student action skeleton sequence data. Based on the current student's age group information and the current sports project information, query and call the corresponding standard action skeleton sequence data, N fine-grained time stages, time windows and posture key point thresholds from the time alignment parameter library.
[0150] S2.2: A dynamic time warping algorithm is adopted. Based on a preset similarity metric, the optimal bending path between the student motion skeleton sequence data and the standard motion skeleton sequence data is calculated, and a temporal constraint is introduced in the process of calculating the optimal bending path. The temporal constraint means that the frames in the student motion skeleton sequence data that are mapped to the kth fine-grained temporal stage of the call are only allowed to be aligned and matched with the frames in the standard motion skeleton sequence data that belong to the kth, k-1th, or k+1th fine-grained temporal stages, where k is an integer from 1 to N.
[0151] Furthermore, the specific steps of S2.2 include:
[0152] (1) Read the standard motion skeleton sequence data, student motion skeleton sequence data, standard motion fine-grained temporal stage division results and student motion fine-grained temporal stage division results. All data contain temporal frame numbers and skeleton key point coordinates, and maintain complete temporal continuity.
[0153] (2) Set the normalization bandwidth parameter of the expected matching calculation to 5, use Euclidean distance as the similarity measure, set the maximum number of algorithm iterations to 100, and complete the configuration of all basic parameters of the algorithm;
[0154] (3) Based on the fine-grained temporal stage division results of student actions and standard actions, it is set that all temporal frames in the kth fine-grained temporal stage of student actions are only allowed to be aligned and matched with the temporal frames in the (k-1), kth, and k+1th stages of standard actions, forming a unified temporal constraint rule.
[0155] (4) Construct a two-dimensional cost matrix with the total number of frames of the student motion skeleton sequence as the vertical dimension and the total number of frames of the standard motion skeleton sequence as the horizontal dimension, and set all initial values in the matrix to zero.
[0156] (5) Iterate through each time frame of the student's action, determine the range of the standard action stage that is allowed to be matched in the current frame according to the time constraint rules, calculate the Euclidean distance cost value only within this range, directly assign the matrix position to infinity outside the constraint range, and prohibit cross-stage matching.
[0157] (6) Starting from the beginning of the cost matrix, search for the continuous path with the minimum cumulative cost value according to the preset regular bandwidth and continuous single-step movement rules, and determine the path as the optimal curved path that satisfies the time-series constraints.
[0158] Furthermore, the specific steps for finding the optimal curved path include:
[0159] 1) Read the calculated two-dimensional cost matrix and load the matching range defined by the temporal constraint rules. The value within the constrained region of the matrix is the effective cost value, and the value in the unconstrained region is infinite.
[0160] 2) Set the matrix position corresponding to the first frame of the student action and the first frame of the standard action as the starting position of the path search, and set the matrix position corresponding to the last frame of the student action and the last frame of the standard action as the ending position of the path search.
[0161] 3) The fixed bandwidth value is set to 5 to limit the offset range of the path in the matrix, and to clarify the continuous single-step movement rules, allowing only three legal ways to move to the right, down, and diagonally to the lower right.
[0162] 4) Create a cumulative cost array with the same size as the cost matrix, assign the cumulative cost at the starting position to the value at the starting position of the cost matrix, and initialize the rest of the array to infinity;
[0163] 5) Starting from the initial position, traverse the valid positions of the matrix according to the single-step movement rule, calculate the cumulative cost value of the current position from the three legal directions, select the minimum value as the cumulative cost of the current position, and record the corresponding source direction;
[0164] 6) During the cumulative cost calculation process, the current position offset distance is checked in real time to see if it exceeds the normalized bandwidth range, and the current matching relationship is checked to see if it meets the timing constraints. Only compliant movement paths are retained.
[0165] 7) When the path search reaches the termination position, stop the forward calculation process. At this time, the value at the termination position is the minimum cumulative cost of the entire path.
[0166] 8) Starting from the end position, trace back to the starting position according to the source direction of each step record, and connect all the matrix positions passed through in sequence to form a continuous path;
[0167] 9) Determine the continuous path generated by backtracking as the optimal curved path that satisfies all temporal constraints, output the student action frame number and standard action frame number corresponding to all positions in the path, and complete the path search.
[0168] (7) Traverse all nodes of the optimal curved path and check each matching relationship to ensure that all matching nodes meet the stage constraint requirements.
[0169] (8) The optimal curved path that passes the verification is determined as the final alignment path, and the corresponding matching relationship of all time frames in the output path is determined.
[0170] S2.3: Based on the optimal bending path, establish a frame-by-frame mapping relationship between each frame of the student motion skeleton sequence data and the corresponding frame of the standard motion skeleton sequence data. Based on the frame-by-frame mapping relationship and the fine-grained temporal stage, determine the standard fine-grained temporal stage to which each frame of the student motion skeleton sequence data belongs and assign it a fine-grained temporal stage label. Define the data set containing the frame-by-frame mapping relationship and the fine-grained temporal stage label as fine-grained temporal alignment data.
[0171] Furthermore, the specific steps in S2.3 include:
[0172] (1) Read the calculated optimal bending path data, and at the same time read the student motion skeleton sequence data, standard motion skeleton sequence data and standard motion fine-grained temporal stage division results. The standard motion fine-grained temporal stage division results include the start frame number and end frame number corresponding to each stage. All data are temporally continuous and correspond to each other.
[0173] (2) Traverse each group of path nodes in the optimal curved path, extract the corresponding student action skeleton sequence frame number and standard action skeleton sequence frame number in each group of path nodes, bind the single frame number of the student action to the single frame number of the standard action one-to-one, and form the original frame-by-frame mapping relationship from student action frame to standard action frame.
[0174] (3) Reorder the original frame-by-frame mapping relationship in ascending order of student action frame number to ensure that the mapping relationship is consistent with the actual execution sequence of student actions. Check one by one whether there are missing or duplicate bindings in the mapping relationship. Use adjacent valid mapping results to fill in the missing frame positions. For duplicate binding frame positions, retain the mapping result with the highest confidence to form a stable and effective regularized frame-by-frame mapping relationship.
[0175] (4) Read the start and end frames corresponding to each stage in the fine-grained timing stage division results of the standard action, associate and store the number of each stage with the standard action frame range it covers, and form a standard stage frame range lookup table that can be directly queried.
[0176] (5) Traverse each set of data in the frame-by-frame mapping relationship after normalization, first extract the standard action frame number mapped to the current student action frame, then match the standard action frame number with the standard stage frame interval lookup table, determine the standard fine-grained timing stage to which the standard action frame number belongs, and determine the stage as the standard fine-grained timing stage corresponding to the current student action frame.
[0177] (6) The determined standard fine-grained timing stage number is directly assigned as the stage label to the corresponding student action frame. The label content is completely consistent with the standard fine-grained timing stage number. The stage label assignment of all student action frames is completed in sequence to ensure that each frame has a unique and accurate stage label.
[0178] (7) Merge and organize the regularized frame-by-frame mapping relationship with the fine-grained temporal stage labels corresponding to all student action frames, arrange them according to the order of student action frame numbers, and form a data set with complete structure and continuous temporal sequence. This data set is formally defined as fine-grained temporal alignment data.
[0179] (8) Perform integrity verification on fine-grained temporal alignment data to ensure that there are no missing frames, no errors in stage labels, and no disorder in temporal order. After the verification is passed, associate and store the fine-grained temporal alignment data with student action labels and corresponding sports project labels.
[0180] The specific steps of S3 include:
[0181] S3.1: Based on the fine-grained temporal alignment data, each frame in the student motion skeleton sequence data is classified into the corresponding fine-grained temporal stage according to its assigned fine-grained temporal stage label;
[0182] S3.2: Within each fine-grained temporal stage, all predefined pose keypoint thresholds for the corresponding fine-grained temporal stage are retrieved from the temporal alignment parameter library. The spatial coordinates of each bone keypoint in each frame of the student motion skeleton sequence data within the corresponding fine-grained temporal stage are compared with the retrieved pose keypoint thresholds of the corresponding bone keypoints. If the spatial coordinates of any bone keypoint are higher than the upper limit of its spatial coordinate boundary or lower than the lower limit of its spatial coordinate boundary, it is determined that there is an error point at the corresponding bone keypoint. The fine-grained temporal stage identifier, the bone keypoint identifier, and the coordinate offset between the measured coordinates of the corresponding bone keypoint and the corresponding pose keypoint threshold boundary are recorded.
[0183] Furthermore, for the identified erroneous points, the corresponding offset is calculated based on the direction of the out-of-limit coordinates. If the measured coordinate value is higher than its upper limit value in space, the upper limit value is subtracted from the measured coordinate value to obtain the positive offset. If the measured coordinate value is lower than its lower limit value in space, the measured coordinate value is subtracted from the lower limit value to obtain the negative offset. The offset values are uniformly retained to two decimal places.
[0184] S3.3: For each detected error point, based on its corresponding fine-grained temporal stage identifier, query the error causal association rules between the stages, and based on the queried error causal association rules between the stages, obtain one or more preceding stage identifiers with the stage where the error point is located as the affected stage; the preceding stage identifier indicates the potential error source stage that may cause the current error.
[0185] Furthermore, the specific steps of S3.3 include:
[0186] (1) Read all error point information that has been detected. The error point information includes the fine-grained temporal stage identifier, skeletal key point identifier and coordinate offset corresponding to the error point. At the same time, read the error causal association rule library between stages that has been constructed. This rule library stores the error source stage identifier, the affected stage identifier, the error pose type and the association confidence value. The minimum filtering threshold for association confidence is fixed at 0.8.
[0187] (2) Traverse all rules in the erroneous causal association rule base between stages, compare the association confidence value of each rule with the screening threshold of 0.8, retain only the rules with an association confidence greater than or equal to 0.8, remove invalid rules with low confidence, and form a set of erroneous causal association rules between effective stages;
[0188] (3) Select individual error points as the current processing objects in sequence according to the timing detection order of error points to ensure that each error point can be processed independently;
[0189] (4) Extract the fine-grained time-series stage identifier of the selected current error point from the current error point information, and determine the identifier as the target affected stage identifier for this rule query;
[0190] (5) Using the set of erroneous causal association rules between effective stages as the query scope and the target affected stage identifier as the query condition, traverse the set of erroneous causal association rules between effective stages, find all rule entries whose affected stage identifier is consistent with the target affected stage identifier, and determine them as the association rule entries of the current error point.
[0191] (6) Read each matched association rule entry one by one and extract the corresponding error source stage identifier. The error source stage identifier is the previous stage identifier of the current error point.
[0192] (7) Summarize and organize all the extracted pre-stage identifiers, remove duplicate identifiers, retain the unique pre-stage identifiers, and form the pre-stage identifier set corresponding to the current error point.
[0193] (8) Using the set of preceding stage identifiers as objects, check the stage corresponding to each preceding stage identifier to ensure that all preceding stages are earlier than the affected stage where the current error point is located in terms of action execution sequence. Remove abnormal identifiers that are later than the affected stage to obtain a compliant set of preceding stage identifiers. Bind and store the compliant set of preceding stage identifiers with the complete information of the current error point to clarify the corresponding relationship between the current error point and the preceding stage.
[0194] (9) After completing the query and storage of the current error point, select the next error point in chronological order and repeat (3)-(8) until all the pre-stage identifier query work of all error points is completed.
[0195] S3.4: Using the obtained preceding stage identifier as a new query starting point, iteratively execute the query operation. That is, for each newly obtained preceding stage identifier, query the error causal association rules between stages again to obtain its own preceding stage identifier, until for any stage identifier, it is impossible to find a preceding stage identifier for it as the affected stage from the error causal association rules between stages. The stage for which no earlier preceding stage identifier can be found is determined as the error root source stage identifier corresponding to the error point.
[0196] The terminal performs lightweight feature dimensionality reduction on the time-series frame data of the action to be corrected, performs error point and root cause determination calculations, and generates time-series error correction prompts, including:
[0197] S4.1: In the terminal device, receive lightweight feature data corresponding to the action to be corrected, and load the attitude key point thresholds of all fine-grained temporal stages corresponding to the current action and the error causal association rules between stages from the temporal alignment parameter library.
[0198] S4.2: The attitude key point thresholds are organized in the terminal device memory as a local attitude key point threshold index that can be quickly retrieved, based on the fine-grained temporal stage identifiers to which they belong. At the same time, the error causal association rules between stages are organized in the terminal device memory as a local error causal association graph that supports forward and backward queries.
[0199] Furthermore, the specific steps of S4.2 include:
[0200] (1) Read the attitude key point thresholds corresponding to all fine-grained timing stages, and at the same time read the error causal association rules between the effective stages that have been filtered;
[0201] (2) Two independent storage areas are divided in the terminal device memory to store the local attitude key point threshold index and the local error causal relationship graph, respectively. The threshold index storage area is initially allocated 10 megabytes of memory space, and the relationship graph storage area is initially allocated 15 megabytes of memory space. At the same time, 5 megabytes of expansion space is reserved to avoid storage failure due to insufficient memory. The index retrieval response threshold is set to 50 milliseconds to ensure fast retrieval needs. The relationship graph query cache size is set to 1000 rules to improve query efficiency.
[0202] (3) Based on the initialized memory storage area and parameters, a local pose key point threshold index is constructed using a hash index structure. Fine-grained temporal stage identifiers are used as first-level hash keys, and skeletal key point identifiers are used as second-level hash keys to form a second-level hash index structure. This enables the rapid location of the corresponding threshold through stage identifiers and skeletal key point identifiers. The hash function collision resolution method is set to chain addressing. When a hash collision occurs, the conflicting threshold data is stored sequentially in the form of a linked list. The maximum length of a single linked list is limited to 50. At the same time, the hash table load factor threshold is set to 0.7. When the actual load factor reaches 0.7, the hash table is automatically expanded to twice its original size to maintain stable retrieval performance.
[0203] It should be noted that chaining is an effective method for resolving hash collisions. In hashing, collisions occur because multiple elements may map to the same hash address. Chaining solves this problem by storing all elements with the same hash address in a linked list. In the hash list, each slot stores a head pointer to these linked lists. The specific implementation process of chaining is prior art in this field and is not an inventive solution of this application, so it will not be described in detail here.
[0204] It should also be noted that the load factor is the ratio of the number of elements stored in the hash table to the total capacity of the hash table, used to measure the degree of filling of the hash table. Setting the load factor threshold to 0.7 is to achieve a balance between hash table storage density and retrieval efficiency. When the ratio reaches 0.7, it indicates that the hash table space is approaching saturation. Continuing to store data will increase the probability of hash collisions, lengthen the linked list, and reduce retrieval speed. At this time, automatically expanding the hash table to twice its original size can effectively reduce collisions, maintain the fast retrieval performance of the local attitude key point threshold index, and meet the computational efficiency requirements of real-time error correction at the terminal.
[0205] (4) According to the constructed two-level hash index structure, each pose key point threshold is filled into the corresponding memory location one by one. Specifically, the first-level hash address is calculated by hash function based on the fine-grained temporal stage identifier, and the second-level hash address is calculated based on the skeleton key point identifier. The upper and lower limits of the coordinates of the threshold are bound with the corresponding identifier information and stored in the memory location corresponding to the second-level hash address. During the filling process, the data integrity is checked in real time to ensure that each threshold accurately corresponds to its stage identifier and skeleton key point identifier. After the filling is completed, an index directory is established to record the hash address range corresponding to each stage identifier to further improve the retrieval speed.
[0206] (5) A local error causal relationship graph is constructed using a directed graph structure, where each fine-grained temporal stage identifier is used as a node of the graph, and the error causal relationship rule between each stage is used as a directed edge. The node corresponding to the error source stage identifier is used as the starting point of the directed edge, and the node corresponding to the affected stage identifier is used as the ending point of the directed edge. Each directed edge carries the corresponding error pose type and association confidence information. The storage format of the directed graph node is set as a structure, and each node contains information such as stage identifier, number of associated edges, and edge pointer. The storage format of the edge contains information such as starting node pointer, ending node pointer, error pose type, and association confidence. At the same time, the node cache pool size of the graph is set to 100 to quickly allocate node memory and improve the construction efficiency of the graph.
[0207] (6) Based on the error causal association rules between effective stages, extract the error source stage identifier, affected stage identifier, error pose type and association confidence from each rule. First, find the corresponding start node and end node in the initialized directed graph. If the node does not exist, create a new node and add it to the node cache pool. Then, create a directed edge to connect the start node and end node through the edge. At the same time, store the error pose type and association confidence information in the corresponding field of the edge. The association confidence of each edge meets the filtering requirement of not less than 0.8. During the filling process, establish a forward edge list and a reverse edge list for each node. The forward edge list stores all the associated edges of the node as the error source stage, and the reverse edge list stores all the associated edges of the node as the affected stage, ensuring that the association graph supports forward and reverse queries.
[0208] (7) Taking the completed local attitude key point threshold index and local error causal relationship graph as objects, the threshold index is optimized, an ordered index table of stage identifiers is established, all fine-grained temporal stage identifiers are arranged in ascending order, and the hash address corresponding to each stage identifier is recorded. When searching by stage identifier, the hash address range is quickly located through the ordered index table first, and then a secondary hash search is performed to control the search response time within 50 milliseconds. The relationship graph is optimized, an ordered index is established for the forward edge list and reverse edge list of each node, sorted from high to low according to the relationship confidence. When querying, the high confidence rule is matched first. At the same time, the relationship graph query cache is enabled, and the information of the 100 most recently queried edges is stored in the cache. When querying again, it is directly read from the cache to improve the query efficiency.
[0209] (8) Using the optimized index and association graph as objects, traverse the local pose key point threshold index, randomly extract 10% of the threshold data, and check whether the stored stage identifier, skeleton key point identifier, spatial coordinate upper and lower limits are consistent with the data loaded in (1), to ensure that the index data is error-free and without omissions. At the same time, traverse the local error causal association graph, check whether the start point, end point, error pose type and association confidence of each edge are consistent with the error causal association rules between the loaded effective stages, check whether the forward edge list and reverse edge list of each node are complete, and ensure that the association graph can normally support forward and reverse queries without broken edges or wrong edges.
[0210] (9) Based on the verified index and association graph, a memory persistence mechanism is set up for both. Every 60 seconds, a snapshot of the index and association graph data in memory is taken to prevent data loss due to unexpected power failure of the terminal device. At the same time, a data update trigger condition is set. When the fine-grained time sequence stage division result, attitude key point threshold or error causal association rule between stages changes, the index and association graph will be automatically updated. When updating, the old data in memory is deleted first, and then (3)-(7) are re-executed to ensure that the data in memory is consistent with the latest basic data.
[0211] (10) When the persistence and update mechanism is set up and the local retrieval function is enabled, when the terminal device queries the attitude key point threshold, it can quickly retrieve the corresponding threshold through the local attitude key point threshold index by using the fine-grained temporal stage identifier and the skeleton key point identifier; when querying the error causal association rule between stages, it can perform a forward query through the error source stage identifier to obtain all the affected stages, or perform a reverse query through the affected stage identifier to obtain all the corresponding error source stages.
[0212] S4.3: Based on the lightweight feature data, restore the spatial coordinates of each skeletal key point in each fine-grained temporal stage of the student's motion skeletal sequence data. For each fine-grained temporal stage, retrieve the upper and lower limits of the spatial coordinates of each skeletal key point in the corresponding stage based on the local posture key point threshold index.
[0213] S4.4: Compare the restored spatial coordinates with the upper and lower limits of the retrieved spatial coordinates. If the spatial coordinates exceed the threshold range, it is determined that an error point has been detected, and the fine-grained temporal stage identifier, skeletal key point identifier, and coordinate offset of the error point are recorded. In this embodiment, the threshold range refers to the range defined by the upper and lower limits of the spatial coordinates.
[0214] S4.5: For each detected error point, take its corresponding fine-grained temporal stage identifier as the starting node, and perform a reverse graph traversal operation in the local error causal relationship graph. The reverse graph traversal operation is to start from the current node, search for its predecessor node along the directed edge pointing to the current node in the local error causal relationship graph, and take the found predecessor node as the new current node. Iterate the search until no new predecessor node can be found. The fine-grained temporal stage corresponding to the node that finally cannot find a predecessor node is determined as the error root source stage corresponding to the error point.
[0215] S4.6: Based on the obtained error point information and error root cause stage, generate query conditions, and based on the query conditions, retrieve matching error correction prompt content units from the preset error correction prompt knowledge base; the error correction prompt content unit includes text correction instructions corresponding to the error root cause stage, annotated demonstration images corresponding to the action frame where the error point is located and the skeletal key point identifiers, and voice correction instructions corresponding to the time sequence of the error point occurrence.
[0216] S4.7: Organize and synchronize the retrieved text correction instructions, labeled demonstration images and voice correction commands according to the temporal sequence of action execution, and generate and output multimodal temporal error correction prompts.
[0217] Example 2:
[0218] Please see Figure 3 Another embodiment of the present invention provides: an action teaching error correction system based on fine-grained temporal alignment, comprising:
[0219] The parameter construction module 10 is used to obtain standard sports movement data based on the physical education teaching curriculum standards and national physical test standards. It extracts skeletal key points through human posture estimation algorithms, breaks down the movement into multiple fine-grained temporal stages, sets the temporal time window and posture key point threshold for each stage, and mines and constructs error causal association rules between stages based on the principles of sports biomechanics and association rules. Finally, it forms a two-dimensional temporal alignment parameter library of school age group and sports project, providing a unified standard and judgment basis for movement error correction.
[0220] The dynamic temporal alignment module 20 is used to collect the temporal frame data of the student's movements to be corrected and extract the student's movement skeletal sequence data. It calls the standard parameters of the corresponding school age and sports project, and uses a dynamic time warping algorithm with added temporal constraints to complete the temporal matching of the student's movements and the standard movements, generating fine-grained temporal alignment data to achieve accurate temporal matching of the student's movements and the standard movements.
[0221] The root cause tracing module 30, based on fine-grained temporal alignment data, compares the coordinates of the student's skeletal key points with the threshold of the posture key points according to the fine-grained temporal stages, identifies the posture error points in each stage, and then iterates backward through the error causal association rules between stages to trace from the affected error stage to the root cause stage without any preceding cause, accurately locating the position and core cause of the action error.
[0222] The error correction output module 40 is used to perform lightweight feature dimensionality reduction on action data at the terminal, complete error point identification and error root cause stage tracing calculation, and generate multimodal time-series error correction prompts. It monitors the calculation latency in real time, and automatically switches to a hybrid calculation mode that combines edge pre-computation and cloud lightweight optimization when the latency exceeds the threshold. This mode balances error correction real-time performance and calculation efficiency, and is adaptable to different device operating scenarios.
[0223] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments under the guidance of the present invention without departing from the spirit and scope of the present invention. All of these variations are within the protection scope of the present invention.
Claims
1. A method for error correction in action instruction based on fine-grained temporal alignment, characterized in that, include: S1: Obtain standard sports movement data, break down the standard sports movements into N fine-grained temporal stages, set the temporal time window, posture key point threshold and error causal association rules between stages for each fine-grained temporal stage, and construct a two-dimensional temporal alignment parameter library of school age group and sports project. S2: Obtain the time frame data of the student's action to be corrected, call the matching school age and project parameters from the time alignment parameter library, perform dynamic time alignment on the time frame data of the action to be corrected and the N fine-grained time stages of the standard sports action, and generate fine-grained time alignment data. S3: Based on the attitude key point threshold, detect the error points in each stage of the fine-grained temporal alignment data, and trace the root cause stage of the error by combining the error causal association rules between the stages. S4: On the terminal, perform lightweight feature dimensionality reduction on the time frame data of the action to be corrected, perform judgment calculations for error points and error root causes, generate time-series error correction prompts, monitor the delay of the judgment calculation, and if the delay exceeds the preset real-time delay threshold, switch to a hybrid calculation mode that combines edge pre-computation and cloud lightweight optimization until the delay is less than the real-time delay threshold.
2. The action teaching error correction method based on fine-grained temporal alignment as described in claim 1, characterized in that, The constructed time-series alignment parameter library, which combines school age groups and sports events, includes: S1.1: Obtain standard sports movement data, use human pose estimation algorithm to process each frame of the standard sports movement data, extract the spatial coordinates of multiple skeletal key points of the human body, and generate standard movement skeletal sequence data; S1.2: The dynamic time warping algorithm is used to calculate the similarity matrix between the standard action skeletal sequence data and itself at different time points, detect local minimum points in the similarity matrix, and determine each local minimum point as an action time sequence segmentation point. Based on the action time sequence segmentation points, the complete standard sports action is divided into N sub-sequences, and the action time period corresponding to each sub-sequence is defined as a fine-grained time sequence stage. S1.3: For each fine-grained timing stage, the average duration of the corresponding fine-grained timing stage in all standard motion skeleton sequence data is statistically analyzed. Based on the average duration and the preset allowable time deviation, the start time tolerance range and the end time tolerance range of the corresponding fine-grained timing stage are calculated. The union of the start time tolerance range and the end time tolerance range is defined as the timing window of the corresponding fine-grained timing stage.
3. The action teaching error correction method based on fine-grained temporal alignment as described in claim 2, characterized in that, The construction of the time-series alignment parameter library with a two-dimensional dimension of school age group and sports project also includes: S1.4: For each fine-grained temporal stage, traverse the skeletal keypoints of all frames within the corresponding fine-grained temporal stage. For each skeletal keypoint, collect the spatial coordinates of the corresponding skeletal keypoints in all frames within the corresponding fine-grained temporal stage to form a coordinate sample set of skeletal keypoints. Use a Gaussian mixture model to model the probability distribution of the coordinate sample set and solve the model parameters using the expectation-maximization algorithm. S1.5: Based on the solved Gaussian mixture model, calculate the spatial coordinate boundary corresponding to the probability density value equal to the preset confidence threshold, and define the upper and lower limits of the spatial coordinate boundary as the attitude key point threshold of the skeletal key point in its respective fine-grained temporal stage. S1.6: Based on the principles of sports biomechanics, analyze the posture correlation between N fine-grained temporal stages, identify the causal relationship between the specified erroneous posture pattern that appears in the previous stage and the specified erroneous posture pattern induced in the next stage, and record the error source stage identifier, the affected stage identifier and the error type to form the error causal correlation rules between stages. S1.7: Organize and index the standard motion skeletal sequence data, N fine-grained temporal stages, the temporal time window of each stage, the posture key point threshold, and the error causal association rules between stages according to two dimensions: school age group and sports project, to construct a two-dimensional temporal alignment parameter library of school age group and sports project.
4. The action teaching error correction method based on fine-grained temporal alignment as described in claim 2, characterized in that, The process of splitting the fine-grained timing stage includes: S1.2.1: For the standard motion skeleton sequence data, calculate the instantaneous velocity vector and instantaneous acceleration vector of multiple skeletal key points in each frame of the sequence; S1.2.2: Based on the instantaneous velocity vector magnitude of each skeletal key point, identify local minimum points in the curve of instantaneous velocity vector magnitude changing with time; based on the instantaneous acceleration vector magnitude of each skeletal key point, identify points in the curve of instantaneous acceleration vector magnitude changing with time that pass through zero, obtain the zero-crossing point of acceleration magnitude, and merge all the identified local minimum points and the zero-crossing point of acceleration magnitude into the first type of action temporal segmentation candidate points; S1.2.3: The dynamic time warping algorithm is used to calculate the similarity matrix between the standard action skeletal sequence data and itself. Local minimum similarity points are detected in the main diagonal region of the similarity matrix. All detected local minimum similarity points are defined as candidate points for the second type of action temporal segmentation.
5. The action teaching error correction method based on fine-grained temporal alignment as described in claim 4, characterized in that, The process of splitting the fine-grained timing stages also includes: S1.2.4: Merge the first type of action time sequence segmentation candidate points with the second type of action time sequence segmentation candidate points to obtain a candidate point set, and sort the candidate point set according to their chronological order on the time axis. Traverse the sorted candidate point set. If the time interval between two adjacent candidate points is less than a preset merging threshold, they are merged into a new candidate point. The position of the new candidate point is taken as the average of the time positions of the corresponding two adjacent candidate points. Then, the candidate point set after redundancy removal is determined as the action time sequence segmentation point for action segmentation. S1.2.5: Based on the position of the action timing segmentation point on the time axis, the standard action skeletal sequence data is segmented at the corresponding time point to obtain N temporally continuous subsequences, and the time period in the complete action corresponding to each subsequence is defined as a fine-grained timing stage.
6. The action teaching error correction method based on fine-grained temporal alignment as described in claim 1, characterized in that, Dynamic timing alignment is performed on the timing frame data of the action to be corrected and N fine-grained timing stages of the standard sports action to generate fine-grained timing alignment data, including: S2.1: Acquire the time frame data of the action to be corrected collected by the video acquisition device and extract the skeletal key points to generate student action skeletal sequence data. Based on the current student's age group information and the current sports project information, query and call the corresponding standard action skeletal sequence data, N fine-grained time stages, time windows and posture key point thresholds from the time alignment parameter library. S2.2: Based on a preset similarity metric, calculate the optimal bending path between the student motion skeleton sequence data and the standard motion skeleton sequence data, and introduce temporal constraints in the process of calculating the optimal bending path; the temporal constraints refer to the fact that frames in the student motion skeleton sequence data that are mapped to the kth fine-grained temporal stage of the call are only allowed to be aligned and matched with frames in the standard motion skeleton sequence data that belong to the kth, k-1th, or k+1th fine-grained temporal stages; S2.3: Based on the optimal bending path, establish a frame-by-frame mapping relationship between each frame of the student motion skeleton sequence data and the corresponding frame of the standard motion skeleton sequence data. Based on the frame-by-frame mapping relationship and the fine-grained temporal stage, determine the standard fine-grained temporal stage to which each frame of the student motion skeleton sequence data belongs and assign it a fine-grained temporal stage label. Define the data set containing the frame-by-frame mapping relationship and the fine-grained temporal stage label as fine-grained temporal alignment data.
7. The action teaching error correction method based on fine-grained temporal alignment as described in claim 1, characterized in that, The specific steps of S3 include: S3.1: Based on the fine-grained temporal alignment data, each frame in the student motion skeleton sequence data is classified into the corresponding fine-grained temporal stage according to its assigned fine-grained temporal stage label; S3.2: Within each fine-grained temporal stage, all predefined pose keypoint thresholds for the corresponding fine-grained temporal stage are retrieved from the temporal alignment parameter library. The spatial coordinates of each bone keypoint in each frame of the student motion skeleton sequence data within the corresponding fine-grained temporal stage are compared with the retrieved pose keypoint thresholds for the corresponding bone keypoints. If the spatial coordinates of any bone keypoint are higher than the upper limit of its spatial coordinate boundary or lower than the lower limit of its spatial coordinate boundary, it is determined that there is an error point at the corresponding bone keypoint. The fine-grained temporal stage identifier, the bone keypoint identifier, and the coordinate offset between the measured coordinates of the corresponding bone keypoint and the corresponding pose keypoint threshold boundary are recorded.
8. The action teaching error correction method based on fine-grained temporal alignment as described in claim 7, characterized in that, The specific steps of S3 also include: S3.3: For each detected error point, based on its corresponding fine-grained temporal stage identifier, query the error causal association rules between the stages, and based on the queried error causal association rules between the stages, obtain one or more preceding stage identifiers with the stage where the error point is located as the affected stage; the preceding stage identifier indicates the potential error source stage that caused the current error. S3.4: Using the obtained preceding stage identifier as a new query starting point, iteratively execute the query operation. That is, for each newly obtained preceding stage identifier, query the error causal association rules between stages again to obtain its own preceding stage identifier, until for any stage identifier, it is impossible to find a preceding stage identifier for it as the affected stage from the error causal association rules between stages. The stage for which no earlier preceding stage identifier can be found is determined as the error root source stage corresponding to the error point.
9. The action teaching error correction method based on fine-grained temporal alignment as described in claim 1, characterized in that, The terminal performs lightweight feature dimensionality reduction on the time-series frame data of the action to be corrected, performs error point and root cause determination calculations, and generates time-series error correction prompts, including: S4.1: In the terminal device, receive lightweight feature data corresponding to the action to be corrected, and load the attitude key point thresholds of all fine-grained temporal stages corresponding to the current action and the error causal association rules between stages from the temporal alignment parameter library. S4.2: The attitude key point thresholds are organized into a local attitude key point threshold index in the terminal device memory based on the fine-grained temporal stage identifiers to which they belong. At the same time, the error causal association rules between stages are organized into a local error causal association graph in the terminal device memory that supports forward and backward queries. S4.3: Based on the lightweight feature data, restore the spatial coordinates of each skeletal key point in each fine-grained temporal stage of the student's motion skeletal sequence data. For each fine-grained temporal stage, retrieve the upper and lower limits of the spatial coordinates of each skeletal key point in the corresponding stage based on the local posture key point threshold index. S4.4: Compare the restored spatial coordinates with the upper and lower limits of the retrieved spatial coordinates. If the spatial coordinates exceed the threshold range, it is determined that an error point has been detected, and the fine-grained temporal stage identifier, skeletal key point identifier, and coordinate offset of the error point are recorded.
10. The action teaching error correction method based on fine-grained temporal alignment as described in claim 9, characterized in that, The terminal performs lightweight feature dimensionality reduction on the time-series frame data of the action to be corrected, performs error point and root cause determination calculations, and generates time-series error correction prompts, and also includes: S4.5: For each detected error point, take its corresponding fine-grained temporal stage identifier as the starting node, and perform a reverse graph traversal operation in the local error causal relationship graph. The reverse graph traversal operation is to start from the current node, search for its predecessor node along the directed edge pointing to the current node in the local error causal relationship graph, and take the found predecessor node as the new current node. Iterate the search until no new predecessor node can be found. The fine-grained temporal stage corresponding to the node that finally cannot find a predecessor node is determined as the error root source stage corresponding to the error point. S4.6: Based on the obtained error point information and error root cause stage, generate query conditions, and based on the query conditions, retrieve matching error correction prompt content units from the preset error correction prompt knowledge base; the error correction prompt content unit includes text correction instructions corresponding to the error root cause stage, annotated demonstration images corresponding to the action frame where the error point is located and the skeletal key point identifiers, and voice correction instructions corresponding to the time sequence of the error point occurrence. S4.7: Organize and synchronize the retrieved text correction instructions, labeled demonstration images and voice correction commands according to the temporal sequence of action execution, and generate and output multimodal temporal error correction prompts.
11. A motion instruction error correction system based on fine-grained temporal alignment, used to implement the motion instruction error correction method based on fine-grained temporal alignment as described in any one of claims 1-10, characterized in that, include: The parameter construction module is used to acquire standard sports movement data, extract skeletal key points through human posture estimation algorithms, break down the movement into multiple fine-grained temporal stages, and form a two-dimensional temporal alignment parameter library of school age group and sports project by constructing error causal association rules between stages. The dynamic temporal alignment module is used to collect the temporal frame data of the student's movements to be corrected and extract the student's movement skeletal sequence data. It calls the standard parameters of the corresponding school age and sports project, and uses a dynamic time warping algorithm with added temporal constraints to complete the temporal matching of the student's movements and the standard movements, generating fine-grained temporal alignment data. The root cause tracing module, based on fine-grained temporal alignment data, compares the coordinates of key points of the student's skeleton with the threshold of key points of the posture according to the fine-grained temporal stages, identifies posture error points at each stage, and then traces the root cause stage through reverse iterative query. The error correction output module is used to perform feature dimensionality reduction on action data at the terminal, complete error point identification and error root cause stage tracing, generate time-series error correction prompts, monitor computing latency in real time, and automatically switch to a hybrid computing mode that combines edge pre-computation and cloud lightweight optimization when the latency exceeds the real-time latency threshold.