CN-121999289-A - Ankle rehabilitation training identification method and system based on GF-GATResBlock model
Abstract
The invention discloses an ankle rehabilitation training recognition method and system based on a GF-GATResBlock model, which belong to the technical field of ankle rehabilitation training recognition, and specifically comprise the steps of 1) obtaining an ankle thermal image data set, 2) preprocessing the ankle thermal image data set, 3) preliminarily extracting characteristics of the ankle thermal image through two-layer convolution plus a ReLU activation function and 2x2 maximum pooling, outputting ankle characteristic images with dimensions of 64x16x16, 4) constructing an initial K nearest neighbor image through KNN _graph by the ankle characteristic image extracted and output, simultaneously generating all possible node pairs for combination, splicing source node characteristics and target node characteristics, predicting edges with MLP, screening edges with weights larger than a threshold value, finally merging KNN edges with dynamic prediction edges to obtain ankle characteristic image structure data, 5) combining ankle characteristic image structure data obtained through dynamic image construction processing by a main path GAT convolution and a residual path, adjusting each attention weight through layered attention mechanism and dynamic gating, carrying out ankle characteristic fusion, and further carrying out ankle characteristic classification, and 8) carrying out ankle classification and classification, and 8) carrying out training classification, and 8) carrying out classification and classification, and the training. The ankle rehabilitation training effect recognition method and device can improve ankle rehabilitation training effect recognition accuracy.
Inventors
- Lao Xiangyi
- MA JIAQING
- LIU HONGJU
- LI YONGJIE
- ZHAN YU
- WU QINMU
- HE ZHIQIN
Assignees
- 贵州大学
Dates
- Publication Date
- 20260508
- Application Date
- 20260127
Claims (9)
- 1. An ankle rehabilitation training identification method based on a GF-GATResBlock model is characterized by comprising the following steps of: step 1, acquiring a thermal image map of an ankle to acquire a thermal image map data set of the ankle; Step 2, preprocessing an ankle thermal image data set; step 3, CNN feature extraction, namely preliminarily extracting features of the ankle thermal image through two-layer convolution plus a ReLU activation function and maximum pooling, and outputting ankle feature images with dimensions of 64x16x 16; step 4, constructing a dynamic graph, namely constructing an initial K neighbor graph from the ankle feature image extracted from the CNN features in the step 3 through a KNN _graph, simultaneously generating all possible node pair combinations, splicing source node and target node features, predicting edge weights through MLP, screening edges with the weights larger than a threshold value, and finally merging KNN edges with dynamic predicted edges to obtain ankle feature graph structure data; Step 5, carrying out residual processing on the dynamic graph constructed in the step 4, namely taking ankle feature graph structural data of the dynamic graph construction processing as input, regulating all attention weights and carrying out ankle feature fusion by combining a main path GAT convolution and a residual path through a hierarchical attention mechanism and dynamic gating, and carrying out further graph reasoning on ankle features; step 6, constructing a classifier, and mapping ankle features inferred in the step 5 to category numbers; Step 7, training a model, namely training a classification recognition model by using the classification model in the step 6, loading an ankle thermographic training set into a classifier, acquiring a prediction result through forward propagation, and feeding back a loss value to the front end to acquire a trained classifier; And 8, predicting, namely inputting an ankle thermal image by using a trained classifier, and carrying out classification recognition to obtain a classification result.
- 2. The ankle rehabilitation training identification method based on the GF-GATResBlock model according to the claim 1 is characterized in that the preprocessing method comprises the steps of automatically identifying a category folder structure by using an ImageFolder after an acquired thermographic image dataset is loaded from a designated path, printing a mapping relation from category to index, and finally converting the mapping relation into a Tensor format with the size of 64x64 pixels through a transform.
- 3. The ankle rehabilitation training identification method based on the GF-GATResBlock model according to claim 2 is characterized in that the preprocessing method comprises three steps of scaling an image to 64 x 64 pixels, converting the scaled image into PyTorch tensor and normalizing the PyTorch tensor to a [0,1] range, and finally performing normalization processing to enable pixel values to be distributed in a [ -1,1] range, and providing normalized input for model training, wherein the three steps are as follows: Step 2.1, adjusting the image to 64×64 pixels by bilinear interpolation to ensure that all samples have the same spatial dimension, involving calculating the scale and sampling the new pixel position by using an interpolation formula; For the target pixel (x ', y'), a corresponding floating point coordinate (x, y) is found in the source image: (1), (2), Wherein, x 'is the abscissa of the pixel in the target image, y' is the ordinate of the pixel in the target image, the abscissa of the x target pixel in the original image corresponds to the y target pixel in the original image; Is the width of the original image; Is the width of the target image; is the height of the original image; is the height of the target image; Calculating interpolation weights: (3), in the formula, And Respectively representing the distance proportion of the target coordinates to the upper left corner pixel in the horizontal direction and the vertical direction; bilinear interpolation formula: (4), in the formula, Is the abscissa of the upper left pixel in the original image; is the ordinate of the upper left corner pixel in the original image; The interpolation weight in the horizontal direction is the value range [0, 1); Interpolation weight in the vertical direction is taken as a value range [0, 1); in position for original image Pixel values at (possibly single or multiple channels, each independently calculated); Step 2.2, converting the image from the PIL format to a PyTorch tensor using ToTensor transform, normalizing the pixel values from an integer range of [0,255] to a floating point number range of [0.0,1.0], and rearranging the dimensional order from (H, W, C) to (C, H, W); step 2.3, performing normalization processing, and respectively applying Z-score normalization to each color channel, and converting the pixel value from the range of [0.0,1.0] to the range of [ -1.0,1.0] by using a mean value of 0.5 and a standard deviation of 0.5.
- 4. The ankle rehabilitation training identification method based on the GF-GATResBlock model according to claim 3, wherein the specific steps of the step 2.2 are as follows: step 2.2.1 normalization, for each channel of each pixel, performs: (5), in the formula, Taking the value range of 0 to 255 as the original pixel value; the value range of the normalized floating point number is 0.0 to 1.0; Step 2.2.2 dimension transform, the image is sequentially transformed from the dimension of (height, width, number of channels) to (number of channels, height, width).
- 5. The ankle rehabilitation training identification method based on the GF-GATResBlock model according to claim 3, wherein the normalization in step 2.3 uses a mean (mean) and a standard deviation (std) to normalize each channel, and the formula is: (6), in the formula, Is the mean value; is the standard deviation of the standard, in the present model, 。
- 6. The ankle rehabilitation training identification method based on the GF-GATResBlock model according to claim 4, wherein the convolutional neural network model adopted by the CNN features in the step 3 extracts features deeper in the feature image through two convolution-activation-pooling operations, simultaneously introduces a ReLU function to enhance the expression capability of the model, and retains more remarkable features through compressing space dimensions.
- 7. The ankle rehabilitation training identification method based on the GF-GATResBlock model according to claim 5, wherein the dynamic diagram construction method in the step 3 is as follows: the dynamic graph constructor is adopted to construct a reserved data local aggregate structure through the KNN graph, and the deep association among MLP learning features is utilized to dynamically adjust the connection mode according to the feature similarity, and the method is concretely as follows: step 3.1, constructing a KNN graph, and selecting K most similar neighbor nodes for each node to establish connection: step 3.1.1, calculating the similarity of all node pairs: (7), in the formula, Is the distance between nodes; And Respectively nodes Sum node A feature vector of j; step 3.1.2, selecting K nodes with the smallest distance for each node: (8), in the formula, Is a node Is a neighbor set of (a); Selecting a function for the index that takes the first k minima; step 3.1.3 creation of a directed edge from source node to neighbor (9), In the formula, Is an edge set; Is the total number of nodes; step 3.2, the MLP converts the traditional hard-coded diagram construction into a data-driven self-adaptive process through a characteristic-driven dynamic connection mechanism, and the method specifically comprises the following steps: Let node feature matrix be The candidate edge set is For each candidate edge : (10), In the formula, Representing the prediction probability of the existence of an edge between the nodes i and j; The vector is spliced for the characteristics; And Are all learnable parameters; Is a Sigmoid function; And Is a bias term; To activate the function.
- 8. The ankle rehabilitation training identification method based on the GF-GATResBlock model according to claim 7, wherein the residual processing of the dynamic diagram in the step 5 adopts an enhanced diagram annotating force residual block, specifically comprising the following steps: Step 5.1, a multi-head graph attention mechanism comprises attention coefficient calculation and feature aggregation, wherein the multi-head graph attention mechanism uses K independent attention heads to generate K different nodes: (11), in the formula, Output characteristics of the node i on the kth attention head; Annotating force heads for k drawings; Finally, the output obtained by each head is spliced along the characteristic dimension, and finally expressed as: (12), in the formula, The final output feature vector of the node i; splicing the outputs of all the attention heads along the characteristic dimension; step 5.2, residual connection, which is used for fusing the higher-order neighbor features of graph attention aggregation with the original node features of the residual path to obtain a multi-head graph attention mechanism network model of residual processing, wherein the residual connection can bypass a complex GAT convolution layer and is carried out by back propagation: (13), in the formula, Gradient of weight for loss function; Gradient of output for loss function; the final fusion weight; And 5.2, adopting a dynamic gating fusion strategy for a multi-head graph attention mechanism network model of residual processing, wherein the specific processing steps are as follows: step 5.2.1, calculating the attention coefficient of the node-head level by the small MLP so as to capture the difference of the importance of the local features; Step 5.2.2, normalizing the dynamic head weight by Softmax, and distributing the global importance of different attention heads; step 5.2.3, calculating importance of feature dimensions by Softmax, wherein the importance is used for reflecting the significance of different feature channels; and 5.2.4, output gating, namely generating a global mixing proportion by Sigmoid and balancing the output after nonlinear transformation and the original residual error.
- 9. Ankle rehabilitation training identification system based on GF-GATResBlock model, characterized by comprising: the thermal image acquisition module is used for acquiring an ankle thermal image data set; the preprocessing module is used for preprocessing the ankle thermal image data set; The feature extraction module is used for primarily extracting features of the ankle thermal image through two-layer convolution plus a ReLU activation function and 2x2 maximum pooling on the preprocessed ankle thermal image and outputting ankle feature images with dimensions of 64x16x 16; The dynamic graph construction module is used for constructing an initial K neighbor graph through KNN _graph according to the ankle feature image output by feature extraction, generating all possible node pair combinations, splicing source node and target node features, predicting edge weights through MLP, screening edges with weights larger than a threshold value, and finally merging KNN edges with dynamic predicted edges to obtain ankle feature graph structure data; The residual processing module is used for carrying out residual processing on the constructed dynamic graph, wherein ankle feature graph structural data of the dynamic graph construction processing is taken as input, the main path GAT convolution and the residual path are combined, each attention weight is regulated through a layered attention mechanism and dynamic gating, ankle feature fusion is carried out, and further graph reasoning is carried out on ankle features; The classification module is used for constructing a classifier and mapping the ankle characteristics after reasoning to the category number; the model training module is used for training the constructed classification model; and the prediction module is used for identifying the input ankle thermal image by adopting a trained classification model to obtain a classification structure.
Description
Ankle rehabilitation training identification method and system based on GF-GATResBlock model Technical Field The invention relates to the technical field of ankle rehabilitation effect recognition, in particular to an ankle rehabilitation training recognition method based on a GF-GATResBlock model and an ankle rehabilitation training recognition system based on a GF-GATResBlock model. Background During the movement of the human body, the ankle joint is the most vulnerable to damage as a bearing joint, and the quality of the rehabilitation training determines the quality of the rehabilitation of the movement function of the patient. From the world health organization report data, about 23.4% of sports injuries worldwide are associated with improper rehabilitation training. The current mainstream rehabilitation effect recognition method captures actions through a wearable sensor, the requirements on the dependence of equipment and the skin contact of a patient are high, the pure depth learning model [6] based on RGB video is insufficient in robustness under the condition of complex illumination or shielding, and accurate monitoring is difficult to realize in a home rehabilitation scene. Developments in the field of dynamic identification are the transition from traditional manual recording of features to machine deep learning. In early studies, SIFT feature extraction was combined with an SVM classifier, for example, literature "F. Wang, "Research on Workpiece Image Classification based on SVM and Improved SIFT Algorithm," 2023 9th Annual International Conference on Network and Information Systems for Computers (ICNISC), Wuhan, China, 2023, pp. 639-642" identified images by training feature descriptors of each image, and the model, although having stable feature advantages, had poor deep information capturing capability for motion. The improved residual 3D-CNN and the hyperspectral remote sensing image classification of neighbor attention [ J/OL ]. Natural resource remote sensing, the improved residual convolution and the deep learning model represented by the 3D-CNN of the neighbor attention network model, which is proposed by the document "Y. Zou, S. Du, H. Han, Y. Liu and Z. Tian, "Two-Stream (2+1)D CNN Based on Frame Difference Attention for Driver Behavior Recognition," 2023 10th International Conference on Dependable Systems and Their Applications (DSA), Tokyo, Japan, 2023, pp. 782-788", have accurate feature learning capability, but neglect the spatial topological relation of local key points. Literature "Y. H. Suh, E. H. Kim, Y. G. Choi and J. Jeon, "Real-Time Dynamic Image Stitching Using GNN-Based Feature Matching," 2025 11th International Conference on Mechatronics and Robotics Engineering (ICMRE), Lille, France, 2025, pp. 156-160" attempts to introduce Graph Neural Networks (GNNs) into dynamic motion recognition to improve recognition accuracy by constructing associations between nodes, but there is still a problem of inadequate feature recognition for small amplitude changes in ankle rehabilitation motion (e.g., 5-to 8-degree differences in ankle rotation). Disclosure of Invention The technical problem to be solved by the invention is that the ankle rehabilitation training identification method and system based on the GF-GATResBlock model can improve the accuracy of ankle rehabilitation training identification. In order to solve the technical problems, the technical scheme adopted by the invention is that the ankle rehabilitation training identification method based on the GF-GATResBlock model comprises the following steps: step 1, acquiring a thermal image map of an ankle to acquire a thermal image map data set of the ankle; Step 2, preprocessing an ankle thermal image data set; Step 3, CNN feature extraction, namely preliminarily extracting features of the ankle thermal image obtained by preprocessing in the step 2 through two-layer convolution (convolution kernel 3x3, padding=1, without changing the size) plus a ReLU activation function and maximum pooling (pooling kernel 2x 2) and outputting ankle feature images with dimensions 64x16x 16; Step 4, constructing a dynamic graph, namely constructing an initial K neighbor graph from the ankle feature image with the output dimension 16384 extracted from the CNN features in the step 3 through KNN _graph, generating all possible node pair combinations, splicing source node and target node features, predicting edge weights through MLP, screening edges with the weights larger than a threshold, and finally merging KNN edges with dynamic predicted edges to obtain ankle feature graph structure data; Step 5, carrying out residual processing on the dynamic graph constructed in the step 4, namely taking ankle feature graph structural data of the dynamic graph construction processing as input, regulating all attention weights and carrying out ankle feature fusion by combining a main path GAT convolution and a residual path through a hierarchical attention mec