Intelligent wearing and AI combined clinical research data real-time analysis method and system

By collecting gait data through smart wearable devices, constructing a dynamic graph structure, and extracting multi-dimensional gait features by combining spatiotemporal graph convolution and graph attention mechanisms, anomaly identification is performed using variational autoencoders and conditional random field models, and personalized rehabilitation strategies are generated based on deep reinforcement learning. This solves the problem of traditional gait analysis equipment being expensive and complex, and achieves accurate gait anomaly detection and personalized rehabilitation guidance.

CN120932299AInactive Publication Date: 2025-11-11THE PEOPLES HOSPITAL OF GUANGXI ZHUANG AUTONOMOUS REGION
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511038920.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-28
Publication Date
2025-11-11
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional gait analysis equipment is expensive and complex, and cannot meet the needs of daily continuous monitoring, making it difficult to achieve early identification and accurate rehabilitation guidance.

Method used

Gait data is collected through smart wearable devices, a dynamic graph structure is constructed, and multi-dimensional gait features are extracted by combining spatiotemporal graph convolution and graph attention mechanisms. Anomaly identification is performed using variational autoencoders and conditional random field models, and personalized rehabilitation strategies are generated based on deep reinforcement learning.

Benefits of technology

It enables precise classification and quantification of gait abnormalities, generates personalized rehabilitation guidance plans, and improves the efficiency and effectiveness of rehabilitation training.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120932299A_ABST
    Figure CN120932299A_ABST
Patent Text Reader

Abstract

The invention provides an intelligent wearing and AI combined clinical research data real-time analysis method and system, and relates to the technical field of AI.The method comprises the steps that gait data are collected through an intelligent wearing device, a dynamic graph structure is constructed, and multi-dimensional gait features are extracted through space-time graph convolution and a graph attention mechanism; recognizing gait abnormity by using a variational auto-encoder and a conditional random field model; and constructing a rehabilitation strategy generation model based on deep reinforcement learning, and dynamically optimizing a personalized rehabilitation guidance scheme. According to the method, accurate recognition and personalized rehabilitation guidance of the abnormal gaits are realized, and the clinical rehabilitation effect is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of AI technology, and in particular to a method and system for real-time analysis of clinical research data combining smart wearables and AI. Background Technology

[0002] With the aging population and the increasing number of patients with chronic diseases, the demand for rehabilitation medicine is growing. Gait abnormalities are an important clinical manifestation of many neurological diseases, musculoskeletal diseases, and age-related diseases. Early identification and precise rehabilitation of gait abnormalities are of great significance for improving patients' quality of life and reducing the burden on healthcare.

[0003] Traditional gait analysis mainly relies on three-dimensional motion capture systems in professional medical institutions. Although these systems are highly accurate, they are expensive, complex to use, and can only collect gait data for a short period of time in a specific laboratory environment, which cannot meet the needs of daily continuous monitoring. Summary of the Invention

[0004] This invention provides a method and system for real-time analysis of clinical research data that combines smart wearables and AI, which can solve the problems in the prior art.

[0005] A first aspect of this invention provides a method for real-time analysis of clinical research data combining smart wearables and AI, comprising:

[0006] By collecting gait data of users during walking through smart wearable devices, skeletal joints are constructed into a dynamic graph structure. Spatial correlation features between skeletal joints are extracted through spatiotemporal graph convolution, and graph attention mechanism is used to adaptively assign weights to the motion features of different skeletal joints, ultimately obtaining multi-dimensional gait features that include inter-joint coordination relationships.

[0007] The multi-dimensional gait features are input into the anomaly recognition framework. The anomaly recognition framework uses a variational autoencoder to construct the latent variable space of the gait features, models the feature distribution in the latent variable space, calculates the anomaly probability score of the multi-dimensional gait features, and uses a conditional random field model to capture temporal anomaly patterns in the gait data. The framework then outputs the gait anomaly type discrimination result and anomaly degree quantification index.

[0008] A rehabilitation strategy generation model is constructed based on deep reinforcement learning. The type discrimination result and the abnormality degree quantification index are used as state inputs. The rehabilitation training action sequence is dynamically planned and optimized through a pre-set rehabilitation objective function. The rehabilitation objective function comprehensively considers two dimensions: rehabilitation effect index and user motor ability score. The rehabilitation effect index is calculated based on the temporal changes of the multi-dimensional gait representation, and the user motor ability score is evaluated based on the gait abnormality type. Finally, a personalized rehabilitation guidance plan with adaptive adjustment is output.

[0009] The skeletal joints are constructed as a dynamic graph structure. Spatial correlation features between skeletal joints are extracted through spatiotemporal graph convolution. A graph attention mechanism is then used to adaptively assign weights to the motion features of different skeletal joints, ultimately yielding multi-dimensional gait features that include inter-joint coordination relationships.

[0010] The skeletal joints are mapped to a dynamic graph structure, which includes a set of nodes and a set of edges. The set of nodes corresponds to the skeletal joints, and each node contains a feature vector consisting of three-dimensional spatial coordinates and corresponding velocity information. The edge weights in the set of edges are obtained by calculating the Euclidean distance between the skeletal joints and combining it with a Gaussian kernel function.

[0011] Graph convolution is performed on the dynamic graph structure, and graph attention mechanism is used to adaptively assign weights to the motion features of different skeletal joints. Within a preset time window, one-dimensional convolution is performed on the spatial correlation features to obtain temporal correlation features.

[0012] By performing dimensionality reduction transformation and nonlinear mapping on the spatial correlation features and temporal correlation features through a feedforward neural network, multidimensional gait features containing spatiotemporal correlation information are obtained.

[0013] The multi-dimensional gait features are input into an anomaly detection framework. The anomaly detection framework uses a variational autoencoder to construct a latent variable space for the gait features, models the feature distribution in the latent variable space, and calculates the anomaly probability score of the multi-dimensional gait features, including:

[0014] The variational autoencoder includes an encoder subnetwork and a decoder subnetwork. The multi-dimensional gait features of the input are mapped to the latent variable space through the encoder subnetwork to obtain latent variable distribution parameters. The latent variable distribution parameters include a mean vector and a variance vector describing the feature distribution.

[0015] The latent variable distribution parameters are reconstructed into original features through the decoder subnetwork. The reconstruction error between the original features and the multidimensional gait features is calculated, and the KL divergence between the latent variable distribution parameters and the standard normal distribution is calculated. The reconstruction error and the KL divergence are used to construct a variational evidence lower bound.

[0016] Based on the variational evidence lower bound, the parameters of the variational autoencoder are optimized, and the parameters of the encoder subnetwork and the decoder subnetwork are iteratively updated through the backpropagation algorithm to maximize the variational evidence lower bound.

[0017] The variational autoencoder, based on parameter optimization, calculates the log-likelihood probability of the multi-dimensional gait features to obtain an anomaly probability score. The anomaly probability score is then compared with an adaptive threshold to obtain the anomaly detection result.

[0018] The Conditional Random Field (CRF) model is used to capture temporal anomalous patterns in gait data. The comprehensive output of gait anomaly type discrimination results and anomalous degree quantification indicators includes:

[0019] The conditional random field model is used to detect anomalies in the test gait sequence. The Viterbi algorithm is used to decode the state sequence of the test gait sequence to obtain the optimal state label corresponding to each time point. The state label includes normal and different types of anomalies.

[0020] The abnormality quantification index of the test gait sequence is calculated, and the temporal anomaly score is calculated based on the posterior probability and state transition probability of the state sequence. The temporal anomaly score reflects the duration and trend of gait anomaly.

[0021] Output gait anomaly detection results, which include anomaly type discrimination results and anomaly degree quantification index, wherein the anomaly type discrimination results are determined based on the optimal state label, and the anomaly degree quantification index is calculated based on the time-series anomaly score.

[0022] A rehabilitation strategy generation model is constructed based on deep reinforcement learning. The model uses the type discrimination result and the abnormality degree quantification index as state inputs, and dynamically plans and optimizes the rehabilitation training action sequence through a pre-defined rehabilitation objective function, including:

[0023] Construct a rehabilitation state vector, which includes an abnormality type feature vector and an abnormality degree feature vector. The abnormality type feature vector uses a multidimensional discrete vector to represent the confidence score of different types of gait abnormalities, and the abnormality degree feature vector includes the temporal abnormality score and the duration of abnormality.

[0024] A rehabilitation action space is constructed based on the rehabilitation state vector. The rehabilitation action space includes a set of basic rehabilitation training actions and a movement transfer constraint graph. Each rehabilitation training action in the set of basic rehabilitation training actions determines a movement type parameter based on the abnormality type feature vector and a training intensity parameter and a duration parameter based on the abnormality degree feature vector. The movement transfer constraint graph describes the transfer cost and safety constraints between adjacent rehabilitation training actions.

[0025] A rehabilitation reward function is constructed for the rehabilitation state vector and the rehabilitation action space. The rehabilitation reward function calculates the degree of abnormality improvement based on the abnormality type feature vector, calculates the abnormality reduction based on the abnormality degree feature vector, and calculates the smoothness of the action sequence and the training intensity cost based on the action transfer constraint graph. The cumulative discount value of the rehabilitation reward function is used as the rehabilitation value function.

[0026] The method further includes:

[0027] A rehabilitation training constraint model is established, which includes physiological constraints and dynamic constraints. The physiological constraints include joint range of motion constraints and muscle fatigue constraints. The joint range of motion constraints limit the upper and lower thresholds of joint angles, and the muscle fatigue constraints limit the dynamic threshold of muscle fatigue based on the fatigue recovery coefficient. The dynamic constraints include angular velocity constraints and angular acceleration constraints.

[0028] A state-space discretization model is constructed to map the continuous rehabilitation state space into a set of discrete states. A state transition cost matrix is ​​calculated based on the physiological and dynamic constraints. The state transition cost matrix represents the difficulty of transitioning between adjacent states. A state value function is constructed for the set of discrete states.

[0029] Based on the state transition cost matrix, an optimal path search strategy is designed, and a dynamic programming method is used to solve for the optimal solution of the state value function. The optimal solution of the state value function consists of the immediate state transition cost and the discounted cumulative value of the future state value. The immediate state transition cost is calculated based on the state transition cost matrix, and the future state value is calculated recursively.

[0030] The rehabilitation training action sequence is adjusted online using a rolling time-domain optimization method. The optimal action sequence is planned based on the optimal path search strategy in the prediction time domain. After executing the first action in the optimal action sequence, the rehabilitation status feedback is obtained in real time, and the state transition cost matrix is ​​updated according to the rehabilitation status feedback.

[0031] An adaptive adjustment mechanism is constructed based on the rehabilitation status feedback to monitor the patient's joint motion parameters and muscle fatigue status in real time. The threshold of the joint range of motion constraint is dynamically adjusted based on the joint motion parameters, and the fatigue recovery coefficient is dynamically adjusted based on the muscle fatigue status. The updated constraints are used for the optimization planning of the next round of rehabilitation training movement sequence.

[0032] A second aspect of the present invention provides a real-time analysis system for clinical research data combining smart wearables and AI, comprising:

[0033] The first unit is used to collect gait data of users during walking through smart wearable devices, construct skeletal joints into a dynamic graph structure, extract spatial correlation features between skeletal joints through spatiotemporal graph convolution, and use graph attention mechanism to adaptively assign weights to the motion features of different skeletal joints, and finally obtain multi-dimensional gait features that include inter-joint coordination relationships.

[0034] The second unit is used to input the multi-dimensional gait features into the anomaly recognition framework. The anomaly recognition framework uses a variational autoencoder to construct the latent variable space of gait features, models the feature distribution in the latent variable space, calculates the anomaly probability score of the multi-dimensional gait features, and uses a conditional random field model to capture temporal anomaly patterns in gait data. It then outputs the gait anomaly type discrimination result and anomaly degree quantification index in combination.

[0035] The third unit is used to construct a rehabilitation strategy generation model based on deep reinforcement learning. It takes the type discrimination result and the abnormality degree quantification index as state input, and performs dynamic planning and optimization of rehabilitation training action sequence through a pre-set rehabilitation objective function. The rehabilitation objective function comprehensively considers two dimensions: rehabilitation effect index and user motor ability score. The rehabilitation effect index is calculated based on the temporal changes of the multi-dimensional gait representation, and the user motor ability score is evaluated based on the gait abnormality type. Finally, it outputs a personalized rehabilitation guidance plan with adaptive adjustment.

[0036] A third aspect of the present invention provides an electronic device, comprising:

[0037] processor;

[0038] Memory used to store processor-executable instructions;

[0039] The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.

[0040] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.

[0041] The beneficial effects of this application are as follows:

[0042] This invention collects user gait data through smart wearable devices and constructs a dynamic graph structure. It then extracts multi-dimensional gait features by combining spatiotemporal graph convolution and graph attention mechanisms, thereby achieving a precise characterization of the spatial correlation and collaborative relationship between skeletal joints and effectively improving the comprehensiveness and accuracy of gait feature expression.

[0043] This invention employs an anomaly recognition framework that combines variational autoencoders and conditional random fields. It can not only accurately classify gait anomalies but also quantify the degree of anomaly. By modeling the spatial feature distribution of latent variables and capturing temporal anomaly patterns, it significantly improves the sensitivity and specificity of gait anomaly detection.

[0044] This invention is based on a rehabilitation strategy generation model constructed using deep reinforcement learning. It can automatically generate personalized rehabilitation guidance plans according to the user's gait abnormality type and degree. By dynamically planning and optimizing the rehabilitation training movement sequence, and comprehensively considering the rehabilitation effect and the user's motor ability, it achieves the precision and personalization of rehabilitation training, thereby improving the efficiency and effectiveness of rehabilitation training. Attached Figure Description

[0045] Figure 1 This is a flowchart illustrating a real-time analysis method for clinical research data combining smart wearables and AI, according to an embodiment of the present invention.

[0046] Figure 2 This is a flowchart of the gait anomaly detection based on conditional random fields according to an embodiment of the present invention;

[0047] Figure 3 This is a flowchart of the rehabilitation training constraint optimization method according to an embodiment of the present invention. Detailed Implementation

[0048] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0049] The technical solution of the present invention will be described in detail below with reference to specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0050] Figure 1 This is a flowchart illustrating a real-time analysis method for clinical research data combining smart wearables and AI, as described in an embodiment of the present invention. Figure 1 As shown, the method includes:

[0051] By collecting gait data of users during walking through smart wearable devices, skeletal joints are constructed into a dynamic graph structure. Spatial correlation features between skeletal joints are extracted through spatiotemporal graph convolution, and graph attention mechanism is used to adaptively assign weights to the motion features of different skeletal joints, ultimately obtaining multi-dimensional gait features that include inter-joint coordination relationships.

[0052] The multi-dimensional gait features are input into the anomaly recognition framework. The anomaly recognition framework uses a variational autoencoder to construct the latent variable space of the gait features, models the feature distribution in the latent variable space, calculates the anomaly probability score of the multi-dimensional gait features, and uses a conditional random field model to capture temporal anomaly patterns in the gait data. The framework then outputs the gait anomaly type discrimination result and anomaly degree quantification index.

[0053] A rehabilitation strategy generation model is constructed based on deep reinforcement learning. The type discrimination result and the abnormality degree quantification index are used as state inputs. The rehabilitation training action sequence is dynamically planned and optimized through a pre-set rehabilitation objective function. The rehabilitation objective function comprehensively considers two dimensions: rehabilitation effect index and user motor ability score. The rehabilitation effect index is calculated based on the temporal changes of the multi-dimensional gait representation, and the user motor ability score is evaluated based on the gait abnormality type. Finally, a personalized rehabilitation guidance plan with adaptive adjustment is output.

[0054] In one optional implementation, skeletal joints are constructed as a dynamic graph structure. Spatial correlation features between skeletal joints are extracted through spatiotemporal graph convolution, and a graph attention mechanism is used to adaptively assign weights to the motion features of different skeletal joints. The final result is a multi-dimensional gait feature containing inter-joint cooperative relationships, including:

[0055] The skeletal joints are mapped to a dynamic graph structure, which includes a set of nodes and a set of edges. The set of nodes corresponds to the skeletal joints, and each node contains a feature vector consisting of three-dimensional spatial coordinates and corresponding velocity information. The edge weights in the set of edges are obtained by calculating the Euclidean distance between the skeletal joints and combining it with a Gaussian kernel function.

[0056] Graph convolution is performed on the dynamic graph structure, and graph attention mechanism is used to adaptively assign weights to the motion features of different skeletal joints. Within a preset time window, one-dimensional convolution is performed on the spatial correlation features to obtain temporal correlation features.

[0057] By performing dimensionality reduction transformation and nonlinear mapping on the spatial correlation features and temporal correlation features through a feedforward neural network, multidimensional gait features containing spatiotemporal correlation information are obtained.

[0058] By mapping skeletal joints to a dynamic graph structure, spatial correlation features are extracted through spatiotemporal graph convolution, and weights are assigned using a graph attention mechanism, ultimately obtaining multidimensional gait features that include inter-joint collaborative relationships.

[0059] Skeletal joints can be extracted from video sequences using skeletal extraction algorithms. Each human body model typically contains 15-25 key skeletal joints. Taking the commonly used COCO skeletal model as an example, it contains 17 joints, corresponding to the nose, left eye, right eye, left ear, right ear, left shoulder, right shoulder, left elbow, right elbow, left wrist, right wrist, left hip, right hip, left knee, right knee, left ankle, and right ankle. Each joint has three-dimensional spatial coordinates (x, y, z).

[0060] When mapping skeletal joints to a dynamic graph structure, the node set V corresponds to all skeletal joints. For each node vi, its feature vector consists of the joint's three-dimensional spatial coordinates (xi, yi, zi) and velocity information (Δxi, Δyi, Δzi). The velocity information is calculated by the position difference between two adjacent frames. Specifically, if the current frame index is t, then the velocity of vi is the difference between the current frame position and the position of frame t-1. To capture the relationships between joints, the edge set E determines the edge weights by calculating the Euclidean distance between joints and combining it with a Gaussian kernel function. For any two joints vi and vj, the Euclidean distance dij between them can be expressed as the square root of the sum of the squares of their three-dimensional coordinates. The edge weight wij is calculated using the Gaussian kernel function: the negative of the Euclidean distance dij is divided by the square of a preset parameter σ, and then the exponential value is calculated. Here, σ is an adjustable parameter that controls the distance decay rate; in practice, a value of 1.0 can be used. When the Euclidean distance is less than a preset threshold (e.g., 0.3 meters), a connection is established between the two nodes; when it is greater than the threshold, the weight is set to 0, indicating no connection.

[0061] For example, if the coordinates of the left elbow joint are (0.2, 0.5, 0.1) and the coordinates of the left wrist joint are (0.3, 0.7, 0.05), then the Euclidean distance between them is approximately 0.224 meters. Assuming a threshold of 0.3 meters and σ of 1.0, the edge weight between these two joints is approximately 0.95, indicating that they have a strong spatial relationship.

[0062] When performing graph convolution operations on dynamic graph structures, a multi-layer graph convolutional network is used. Each graph convolution operation weights and aggregates the features of a node with the features of its neighboring nodes. Assuming the input feature dimension is Cin and the output feature dimension is Cout, for node vi, the graph convolution update formula is: multiply the current feature of vi by the weight matrix W1, add the product of the features of all nodes vj connected to vi and the weight matrix W2, where the product term also needs to be multiplied by the corresponding edge weight wij, and finally apply the ReLU activation function to obtain the updated node features. In practice, Cin can be 6 (position and velocity), Cout can be 64, and 2-3 graph convolutional layers are constructed.

[0063] Graph attention mechanisms are used to adaptively adjust the importance of different skeletal joints. For each node vi, an attention coefficient αij is calculated, representing the importance of node vj to node vi. The attention calculation process is as follows: concatenate the features of vi and vj, multiply them by the attention weight vector, pass them through the LeakyReLU activation function, and then apply softmax normalization to all neighboring nodes to obtain αij. The attention weight vector is typically designed to be 2Cout dimensional.

[0064] Within a preset time window (e.g., 32 frames), a one-dimensional convolution operation is performed on the spatial correlation features to capture temporal correlations. The one-dimensional convolution kernel size can be set to 3 or 5, the stride is 1, and the number of output channels is the same as the input. This step can capture the motion patterns of key points in the temporal dimension.

[0065] A feedforward neural network is used to perform dimensionality reduction and nonlinear mapping on spatial correlation features and temporal correlation features. The feedforward network consists of multiple fully connected layers, such as a three-layer structure: the first layer maps the features from 64 dimensions to 128 dimensions, the second layer keeps the 128 dimensions unchanged, and the last layer compresses the features to 64 dimensions. ReLU activation and Dropout (with a ratio of 0.2) are applied after each layer to enhance the model's generalization ability.

[0066] The resulting feature vectors integrate spatial relationships and temporal variations between joints, forming a multi-dimensional feature representation rich in gait information. Experiments show that this method improves accuracy by approximately 5-8 percentage points compared to traditional methods in gait recognition tasks, and is particularly robust in scenarios with large pose changes and severe occlusion.

[0067] In one optional implementation, the multi-dimensional gait features are input into an anomaly detection framework. This framework employs a variational autoencoder to construct a latent variable space for the gait features, models the feature distribution within the latent variable space, and calculates the anomaly probability score of the multi-dimensional gait features, including:

[0068] The variational autoencoder includes an encoder subnetwork and a decoder subnetwork. The multi-dimensional gait features of the input are mapped to the latent variable space through the encoder subnetwork to obtain latent variable distribution parameters. The latent variable distribution parameters include a mean vector and a variance vector describing the feature distribution.

[0069] The latent variable distribution parameters are reconstructed into original features through the decoder subnetwork. The reconstruction error between the original features and the multidimensional gait features is calculated, and the KL divergence between the latent variable distribution parameters and the standard normal distribution is calculated. The reconstruction error and the KL divergence are used to construct a variational evidence lower bound.

[0070] Based on the variational evidence lower bound, the parameters of the variational autoencoder are optimized, and the parameters of the encoder subnetwork and the decoder subnetwork are iteratively updated through the backpropagation algorithm to maximize the variational evidence lower bound.

[0071] The variational autoencoder, based on parameter optimization, calculates the log-likelihood probability of the multi-dimensional gait features to obtain an anomaly probability score. The anomaly probability score is then compared with an adaptive threshold to obtain the anomaly detection result.

[0072] Multidimensional gait features were collected from accelerometers, gyroscopes, and pressure sensors, and feature extraction algorithms were used to obtain features in the time, frequency, and spatial domains. Time-domain features included gait cycle, gait frequency, stride length, and left-right symmetry indicators. Gait cycle was calculated by detecting the time interval between two consecutive heel strikes on the same side; the gait cycle of normal individuals is generally between 1.0 and 1.2 seconds. Gait frequency was calculated by the number of steps per unit time, with a normal value of approximately 100 to 120 steps per minute. Stride length was obtained from the integrated acceleration signal; the stride length of healthy adults is approximately 0.6 to 0.8 meters.

[0073] The left-right symmetry index is calculated by comparing the parameter differences between the left and right legs during the same gait phase; the difference ratio is typically less than 5%. Frequency domain features are extracted by performing a Fast Fourier Transform on the original signal, including the dominant frequency component and spectral energy distribution. The dominant frequency component is generally located in the range of 0.8 to 2.0 Hz, corresponding to the basic walking frequency. The spectral energy distribution describes the energy distribution across different frequency bands; in normal gait, energy is mainly concentrated in the low-frequency band. Spatial domain features describe the movement trajectory of body joints in three-dimensional space, including hip joint angles (normal range 25 to 30 degrees), knee joint angles (normal range 60 to 70 degrees), and ankle joint angles (normal range 15 to 20 degrees). These features are normalized to form a 128-dimensional feature vector, which serves as the input to the variational autoencoder.

[0074] The encoder subnetwork of the variational autoencoder consists of four fully connected neural networks. The input layer has 128 nodes, corresponding to the dimensions of the multi-dimensional gait features. The first hidden layer has 86 nodes and uses the ReLU activation function. The second hidden layer has 64 nodes, also using the ReLU activation function. The output layer is divided into two parts, outputting the mean vector μ and the log-variance vector logσ, respectively. 2 Each part has 16 nodes, corresponding to the dimension of the latent variable space. No activation function is used in either the mean vector or the log-variance vector to ensure that the numerical range is unrestricted. Input features are processed by the weight matrices W1 (128×86), W2 (86×64), and W3 of each layer of the encoder. μ (64×16) and W3 log σ 2(64×16) and bias vectors b1 (86-dimensional), b2 (64-dimensional), b3 μ (16-dimensional) and b3 log σ 2 (16-dimensional) transformation.

[0075] The specific calculation steps of the encoding process are as follows: The input feature vector x undergoes a linear transformation and ReLU activation in the first hidden layer to obtain h1 = ReLU(W1·x + b1), where the ReLU function sets negative values ​​to 0 and retains positive values. h1 undergoes a linear transformation and ReLU activation in the second hidden layer to obtain h2 = ReLU(W2·h1 + b2). h2 undergoes linear transformations in both output layers to obtain the mean vector μ = W3. μ ·h2+b3 μ And the log-variance vector logσ 2 =W3 log σ 2 ·h2+b3 log σ 2 The logarithmic variance vector is transformed into the variance vector σ through an exponential transformation. 2 , i.e. σ 2 =exp(logσ) 2 The element takes positive values ​​to ensure that the variance is positive.

[0076] The latent variable sampling process employs a reparameterization technique. A 16-dimensional random noise vector ε is sampled from a standard normal distribution N(0,1), with each element being independent and identically distributed. The noise vector is then combined with the mean vector and standard deviation vector to calculate the actual latent variable vector z = μ + σ × ε, where σ is the variance vector. 2 The square root of the multiplication is obtained through element-wise multiplication. This method ensures that the gradient can be passed to the encoder parameters through sampling operations, enabling the entire model to be trained end-to-end.

[0077] The decoder subnetwork also consists of four fully connected neural networks. The input layer has 16 nodes, corresponding to the dimension of the latent variable space. The first hidden layer has 64 nodes and uses the ReLU activation function. The second hidden layer has 86 nodes and also uses the ReLU activation function. The output layer has 128 nodes, corresponding to the dimension of the original features, and uses the Sigmoid activation function to restrict the output values ​​to the [0,1] interval. The weight matrices of each layer of the decoder are W4 (16×64), W5 (64×86), and W6 (86×128), and the bias vectors are b4 (64-dimensional), b5 (86-dimensional), and b6 (128-dimensional).

[0078] The specific calculation steps of the decoding process are as follows: The latent variable vector z undergoes a linear transformation and ReLU activation in the first hidden layer to obtain h3 = ReLU(W4·z + b4). h3 undergoes a linear transformation and ReLU activation in the second hidden layer to obtain h4 = ReLU(W5·h3 + b5). h4 undergoes a linear transformation and Sigmoid activation in the output layer to obtain the reconstructed feature vector x' = Sigmoid(W6·h4 + b6), where the Sigmoid function maps the output value to the interval [0,1], and the calculation formula is Sigmoid(t) = 1 / (1 + exp(-t)).

[0079] The reconstruction error is calculated using the binary cross-entropy function, which calculates the difference between the original and reconstructed values ​​for each feature dimension and then sums them to obtain the total error. Binary cross-entropy is particularly suitable when the original features have been normalized to the [0,1] interval. Specifically, for each element xi of the 128-dimensional feature vector and its corresponding reconstructed value xi', -xi·log(xi')-(1-xi)·log(1-xi') is calculated, and then summed over all elements to obtain the total reconstruction error. To prevent numerical instability caused by log(0), a very small constant ε (e.g., 1e-10) is added in the actual calculation, resulting in -xi·log(xi'+ε)-(1-xi)·log(1-xi'+ε).

[0080] KL divergence is used to measure the distribution of latent variables N(μ,σ) in the encoder output. 2 The difference between the KL divergence and the standard normal distribution N(0,1). In the 16-dimensional latent variable space, the KL divergence is calculated as follows: for each dimension i, calculate 0.5 × (μi) 2 +σi 2 -logσi 2 -1), and then sum over 16 dimensions to obtain the total KL divergence. This formula is derived from the analytical solution of the KL divergence between two multivariate Gaussian distributions, avoiding the computational complexity of estimating the KL divergence through sampling.

[0081] The variational lower bound of evidence (ELBO) is formed by subtracting the KL divergence from the negative value of the reconstruction error. Let the reconstruction error be RE and the KL divergence be KL, then ELBO = -RE - KL. The goal of model training is to maximize ELBO, which is equivalent to minimizing -ELBO = RE + KL. In this way, the model can both reconstruct the input features (minimize RE) and make the latent variable distribution approximate a standard normal distribution (minimize KL).

[0082] Model training employed mini-batch gradient descent with a batch size of 64. The Adam optimizer was used, with an initial learning rate of 0.001, β1 of 0.9, β2 of 0.999, and ε of 1e-8. Cosine annealing was employed for learning rate adjustment, starting with an initial learning rate of 0.001 and a minimum of 0.00001, with a training period of 50 epochs. Weight initialization used the He initialization method, and biases were initialized to 0. An early stopping strategy was employed during training, halting training when the ELBO on the validation set showed no improvement for 10 consecutive epochs. The training dataset contained gait characteristics from 1000 healthy subjects, with approximately 100 gait cycles provided for each subject, totaling approximately 100,000 samples.

[0083] During parameter optimization, the ELBO values ​​on both the training and validation sets are calculated at each training epoch. The ELBO on the training set gradually increases from an initial -256.8, reaching -42.3 in the 87th training epoch and then stabilizing. The ELBO on the validation set increases from an initial -260.2 to -46.5 in the 93rd training epoch, then begins to decrease slightly, indicating that the model is starting to overfit. At this point, the early stopping mechanism is triggered to terminate training. The final model parameters are saved as those from the 93rd epoch with the highest ELBO on the validation set.

[0084] The anomaly probability score is calculated based on a trained variational autoencoder. For the gait feature x to be tested, the mean vector μ and variance vector σ are obtained through the encoder. 2 The model performs M samplings (M=100) to obtain latent variable vectors z1, z2...zM. Each z1 is decoded to obtain a reconstructed feature xi'. The reconstruction error REi between each reconstructed feature and the original feature is calculated, and the average of the M reconstruction errors is taken as the anomaly probability score APS = (1 / M)×Σ(REi). Features of normal gait are usually reconstructed well by the model, resulting in lower reconstruction errors and anomaly probability scores; while features of abnormal gait are reconstructed poorly, resulting in higher scores.

[0085] The adaptive threshold is determined by the distribution of anomalous probability scores among normal samples. The anomalous probability scores of all normal samples in the validation set are calculated, resulting in a score set S = {APS1, APS2, ..., APSn}. The mean μS and standard deviation σS of S are calculated, and the threshold T = μS + 3 × σS is set. In actual validation, the average anomalous probability score μS of normal samples is approximately 0.35, and the standard deviation σS is approximately 0.08; therefore, the threshold T is set to 0.59. When the anomalous probability score of a test sample exceeds the threshold T, it is determined to be an anomalous gait.

[0086] The anomaly detection performance was evaluated using metrics such as accuracy, precision, recall, and F1 score. On a test set including 200 healthy subjects and 100 patients with gait abnormalities, the proposed method achieved an accuracy of 94.7%, precision of 92.1%, recall of 93.5%, and an F1 score of 92.8%. Compared to traditional statistical threshold-based methods, this represents a 12.3 percentage point improvement in accuracy and a 14.6 percentage point improvement in the F1 score, validating the effectiveness of the proposed method in gait abnormality identification.

[0087] In one optional implementation, a conditional random field model is used to capture temporal anomaly patterns in gait data, and the comprehensive output of gait anomaly type discrimination results and anomaly degree quantification indicators includes:

[0088] The conditional random field model is used to detect anomalies in the test gait sequence. The Viterbi algorithm is used to decode the state sequence of the test gait sequence to obtain the optimal state label corresponding to each time point. The state label includes normal and different types of anomalies.

[0089] The abnormality quantification index of the test gait sequence is calculated, and the temporal anomaly score is calculated based on the posterior probability and state transition probability of the state sequence. The temporal anomaly score reflects the duration and trend of gait anomaly.

[0090] Output gait anomaly detection results, which include anomaly type discrimination results and anomaly degree quantification index, wherein the anomaly type discrimination results are determined based on the optimal state label, and the anomaly degree quantification index is calculated based on the time-series anomaly score.

[0091] like Figure 2 As shown, the method includes:

[0092] Gait data acquisition utilized six inertial sensing units (MPU-9250), integrating a three-axis accelerometer, a three-axis gyroscope, and a three-axis magnetometer. The sensing units were fixed to the outer sides of the subject's left and right ankles, the front of the left and right thighs, and both sides of the waist, with a sampling frequency set to 100Hz. Subjects walked six round trips along a 10-meter straight corridor at a natural pace, with each test lasting approximately 3 minutes. Raw data was transmitted in real-time via Bluetooth to a data acquisition terminal and saved as a CSV file, with each line containing a timestamp and sensor readings from 54 channels.

[0093] Raw data preprocessing includes noise removal, data segmentation, and feature extraction. Noise removal employs a fourth-order Butterworth bandpass filter with cutoff frequencies set at 0.5Hz and 15Hz to filter out high-frequency electronic noise and low-frequency body motion interference. The acceleration signal is subtracted from the gravitational component to obtain pure dynamic acceleration. The angular velocity signal is subtracted from the zero-drift value under stationary conditions to eliminate gyroscope bias. Data segmentation is achieved by identifying gait cycles. Specifically, this involves detecting local maxima of the vertical acceleration signal of the right ankle; the data segment between two adjacent maxima is defined as a complete gait cycle. A normal gait cycle is approximately 1.0 to 1.2 seconds, corresponding to 100 to 120 data points.

[0094] Gait feature extraction calculates time-domain and frequency-domain features from the segmented data. Time-domain features include the mean, standard deviation, maximum, minimum, peak-to-peak value, root mean square value, kurtosis, and skewness of each signal channel. Gait parameters such as cadence (approximately 90-110 steps / minute), stride length (approximately 0.6-0.8 meters), stride width (approximately 0.1-0.15 meters), gait phase ratio (swing phase approximately 40%, support phase approximately 60%), and left-right symmetry index (normal value less than 5%) are also included. Frequency-domain features are calculated using a 512-point Fast Fourier Transform to extract the energy proportions of three frequency bands: 1-3Hz, 3-5Hz, and 5-10Hz. Normal gait energy is mainly concentrated in the 1-3Hz band, accounting for over 80%. All features undergo min-max normalization, mapping to the [0,1] interval. A 128-dimensional feature vector is generated for each gait cycle as observation data for a conditional random field.

[0095] The Conditional Random Field (CRF) model is defined as a first-order linear chain structure. The state space includes five labels: "Normal," "Limping," "Small Gait," "Frozen Gait," and "Waddling Gait." Feature functions are divided into two categories: state feature functions and transition feature functions. State feature functions associate observations with state labels, with a total of 640 state feature functions designed, including 128 features, each combined with 5 state labels. Transition feature functions describe state transition patterns, with 25 designed to correspond to the probability of transition between any two state labels. Feature functions are in the form of indicator functions, taking a value of 1 when specific conditions are met, and 0 otherwise. For example, when the step size feature value is less than 0.3 and the state label is "Small Gait," the corresponding state feature function outputs 1; when the previous time step label is "Normal" and the current time step label is "Frozen Gait," the corresponding transition feature function outputs 1.

[0096] Model training was based on the maximum log-likelihood criterion. The training data consisted of labeled gait sequences from 200 subjects, including 100 healthy controls and 100 patients with different types of gait disorders. Each gait sequence contained 30 to 50 consecutive gait cycles, with three gait experts independently labeling the state at each time point, and the majority opinion was used as the final label. The L-BFGS algorithm was used to optimize the feature function weights during training, with all weights initially set to 0 and the initial learning rate at 0.01. A cosine annealing strategy was used, reducing the learning rate to 0.9 times the original value every 20 iterations. To prevent overfitting, an L2 regularization term with a regularization coefficient of 0.8 was added. Training was iterated for 500 iterations or until the relative change in log-likelihood was less than 0.0001. The final model's feature function weights ranged from -3.5 to 4.2. Feature functions with larger absolute weight values ​​corresponded to key discriminative features of gait abnormalities, such as decreased stride length, increased gait asymmetry, and increased gait variability.

[0097] The state sequence decoding employs the Viterbi algorithm. For a test gait sequence of length T, the state score at each time point t under each state s is first calculated. The state score is equal to the sum of the products of all feature functions involved in that state and their corresponding weights. Then, the maximum cumulative score and the optimal preceding state for each state at each time point are recursively calculated. In the specific implementation, a T×5 score matrix D and a T×5 backtracking matrix B are maintained. The first row of D is initialized to the initial state score. Then, for t = 2 to T, D[t,s] = max{D[t-1,s'] + TransScore(s',s) + StateScore(t,s)} is calculated, where s' traverses all previous states, TransScore is the state transition score, and StateScore is the current state score. Simultaneously, B[t,s] = argmax{D[t-1,s'] + TransScore(s',s)} is recorded. After the calculation is completed, the state corresponding to the maximum value in the last row of D is identified as the final state. Then, the complete optimal state sequence is constructed from back to front using the backtracking matrix B. The computation time for decoding a sequence with 30 gait cycles is approximately 50 milliseconds.

[0098] Anomaly quantification is achieved by calculating a time-series anomaly scores. For the decoded state sequence, the posterior probability of the state label at each time point is calculated. The posterior probability calculation uses a forward-backward algorithm. The forward variable α[t,s] represents the joint probability of the observed sequence from 1 to t with state s at time t, and the backward variable β[t,s] represents the conditional probability of the observed sequence from t+1 to T given state s at time t. The posterior probability P(s|t) = α[t,s] × β[t,s] / Z, where Z is a normalization factor to ensure that the sum of the posterior probabilities of all states is 1. A posterior probability value of 0.6 or higher for anomaly states generally indicates a high degree of confidence. The time-series anomaly score is calculated as a weighted sum of the posterior probabilities of the anomaly states, with weights set according to the severity of the anomaly: 0.6 for "limping," 0.7 for "small gait," 0.9 for "frozen gait," and 0.8 for "shaky gait." A typical abnormal gait sequence has a normal label ratio of about 20%, a dominant abnormality type ratio of about 60%, other abnormality types ratio of about 20%, and a temporal abnormality score of about 0.65.

[0099] The severity of abnormality is further assessed by considering the duration and trend of the abnormal state. Duration is determined by calculating the length of consecutive abnormal labels; normal individuals may occasionally exhibit abnormal labels for 1-2 cycles, while pathological abnormalities typically last for more than 5 cycles. Trend is determined by calculating the rate of change of the abnormal score within adjacent time windows, with the time window length set at 5 gait cycles. A positive rate of change indicates worsening of the abnormality, while a negative rate indicates mitigation. Both duration and trend influence the final severity score. For example, a high abnormality score (>0.7) lasting more than 15 cycles with a worsening trend (rate of change >0.05) is considered a severe abnormality, and immediate intervention is recommended; a moderate abnormality score (0.4-0.7) lasting 5-10 cycles with a stable trend (rate of change between -0.03 and 0.03) is considered a moderate abnormality, and regular monitoring is recommended.

[0100] The abnormality type is determined based on the distribution of various labels in the state sequence. When a certain abnormal label accounts for more than 50% of the sequence, it is judged as a single abnormality of that type; when two or more abnormal labels each account for more than 20% and the total accounts for more than 60%, it is judged as a mixed abnormality, and the main abnormality types are listed in descending order of their proportions; when the total proportion of all abnormal labels is less than 30% and no single abnormal label accounts for more than 20%, it is judged as normal gait. In practical applications, a single "microgait" abnormality accounts for 45% of Parkinson's patients, a single "limping" abnormality accounts for 62% of osteoarthritis patients, and a mixed abnormality of "frozen gait" and "microgait" accounts for 38% of late-stage Parkinson's patients.

[0101] The quantitative indicators of abnormality severity include global abnormality scores and local abnormality pattern descriptions. The global abnormality score is the mean temporal abnormality score for the entire sequence, categorized into four levels: mild (0.3-0.5), moderate (0.5-0.7), severe (0.7-0.85), and very severe (0.85-1.0). Local abnormality pattern descriptions include the frequency of abnormal episodes (the number of times the abnormality score suddenly increases per unit time), the average duration of an episode, and the stability of the episode interval. For example, a typical Parkinson's patient with a global abnormality score of 0.62 (moderate abnormality) exhibits local abnormalities of an average of 0.8 "frozen gait" episodes per minute, with an average duration of 2.3 seconds and a coefficient of variation of 0.35 for the episode interval.

[0102] Clinical validation results showed that in tests on 80 patients with multiple gait disorders, the method achieved an abnormality type identification accuracy of 91.2%, and the inter-indicative compliance (ICC) between the quantification of abnormality severity and expert scores was 0.876. Compared with traditional threshold-based methods, the F1 score was improved by 0.15, especially in identifying early and mild gait abnormalities. A gait abnormality monitoring system based on this method has been piloted in the neurology and rehabilitation departments of three tertiary hospitals, providing physicians with an objective tool for assessing gait abnormalities, helping to identify gait disorders early and evaluate treatment effectiveness.

[0103] In one optional implementation, a rehabilitation strategy generation model is constructed based on deep reinforcement learning. The type discrimination result and the abnormality degree quantification index are used as state inputs. The model then dynamically plans and optimizes the rehabilitation training action sequence using a pre-defined rehabilitation objective function, including:

[0104] Construct a rehabilitation state vector, which includes an abnormality type feature vector and an abnormality degree feature vector. The abnormality type feature vector uses a multidimensional discrete vector to represent the confidence score of different types of gait abnormalities, and the abnormality degree feature vector includes the temporal abnormality score and the duration of abnormality.

[0105] A rehabilitation action space is constructed based on the rehabilitation state vector. The rehabilitation action space includes a set of basic rehabilitation training actions and a movement transfer constraint graph. Each rehabilitation training action in the set of basic rehabilitation training actions determines a movement type parameter based on the abnormality type feature vector and a training intensity parameter and a duration parameter based on the abnormality degree feature vector. The movement transfer constraint graph describes the transfer cost and safety constraints between adjacent rehabilitation training actions.

[0106] A rehabilitation reward function is constructed for the rehabilitation state vector and the rehabilitation action space. The rehabilitation reward function calculates the degree of abnormality improvement based on the abnormality type feature vector, calculates the abnormality reduction based on the abnormality degree feature vector, and calculates the smoothness of the action sequence and the training intensity cost based on the action transfer constraint graph. The cumulative discount value of the rehabilitation reward function is used as the rehabilitation value function.

[0107] The rehabilitation state vector construction receives the abnormality type discrimination results and abnormality severity quantification index output by the gait abnormality detection module. The abnormality type discrimination results are converted into 5-dimensional discrete vectors, corresponding to five common gait abnormality types: foot drop, knee hyperextension, hip internal rotation, limping, and short gait. A confidence score is calculated for each abnormality type, ranging from 0 to 1, directly obtained from the posterior probability in the discrimination results. A temporal abnormality score, ranging from 0 to 1, is extracted from the abnormality severity quantification index. Simultaneously, the duration of the abnormality, in seconds, is extracted and calculated from the length of the continuous non-zero interval of the temporal abnormality score.

[0108] The duration of abnormalities was normalized using a piecewise linear mapping, mapping 0 to 120 seconds to the interval 0 to 1. A 5-dimensional abnormality type feature vector was concatenated with a 2-dimensional abnormality severity feature vector (temporal abnormality score and normalized abnormal duration) to form a 7-dimensional rehabilitation state vector. In practical applications, an example feature vector for the small gait of Parkinson's patients is [0.1, 0.2, 0.1, 0.3, 0.9, 0.72, 0.85], indicating a predominantly small gait abnormality with a severity of 0.72 and a relatively long duration.

[0109] The rehabilitation movement space defines a basic set of rehabilitation training movements, including 20 movements targeting different temporal abnormalities, such as ankle dorsiflexion (number 1), ankle eversion (number 2), knee extension (number 3), and hip abduction (number 4). Each movement is defined with three parameters: movement type, intensity, and duration. The movement type parameter ranges from 1 to 20, corresponding to the movement number; the intensity parameter ranges from 1 to 4, representing low, medium, high, and maximum intensity levels; and the duration parameter ranges from 5, 10, 15, and 20 minutes. A mapping table between abnormality types and training movements is established; for example, foot drop abnormalities mainly correspond to movement numbers 1, 2, 7, and 8; knee hyperextension abnormalities correspond to movement numbers 3, 9, 13, and 14, etc.

[0110] A motion transfer constraint graph is constructed, represented by a 20×20 adjacency matrix. Matrix element values ​​represent the transfer cost between motions, ranging from 1 to 10. Disallowed transfers are set to infinity. The transfer cost is determined comprehensively based on the amplitude of changes in motion posture, changes in the force applied to the affected area, and changes in balance difficulty. For example, the transfer cost from motion 4 (hip abduction training) to motion 5 (hip extension training) is 2, while the transfer cost to motion 15 (single-leg standing training) is 8. Motion transfer restrictions are set based on patient safety risks. For patients with abnormal severity exceeding a threshold (e.g., 0.8), high-risk motion transfers are prohibited, and the corresponding position in the adjacency matrix is ​​set to infinity.

[0111] The rehabilitation movement determination process uses anomaly type feature vectors to identify a set of candidate training movements. From the 5-dimensional vector, dimensions with values ​​greater than 0.5 are identified, and the corresponding mapping movement set for each anomaly type is obtained. If multiple anomaly types meet the criteria, their union is taken as the candidate set; if no anomaly type has a value greater than 0.5, the movement set corresponding to the maximum value across all dimensions is selected. The training intensity parameters are determined based on the temporal anomaly score in the anomaly severity feature vector.

[0112] A threshold-based mapping was employed: scores of 0 to 0.3 corresponded to intensity level 1, 0.3 to 0.6 to intensity level 2, 0.6 to 0.8 to intensity level 3, and 0.8 to 1.0 to intensity level 4. Duration parameters were determined based on the normalized duration of abnormalities: 0 to 0.25 corresponded to 5 minutes, 0.25 to 0.5 to 10 minutes, 0.5 to 0.75 to 15 minutes, and 0.75 to 1.0 to 20 minutes. Considering patient physiological constraints, such as heart rate not exceeding 85% of maximum heart rate and training time not exceeding the patient's maximum tolerance time, safety adjustments were made to the training intensity and duration parameters.

[0113] The rehabilitation reward function is constructed to calculate the reward component for the degree of improvement in abnormalities. The abnormality type feature vectors of the current state and the next state after the action are taken are obtained, and the difference in each dimension (current value minus the next state value, positive values ​​indicate improvement) is calculated. The differences are then weighted and summed, with weights of 0.15 for foot drop, 0.25 for knee hyperextension, 0.2 for hip internal rotation, 0.2 for limping, and 0.2 for short gait. The weighted sum is multiplied by a scaling factor of 3.0 to obtain the reward component for the degree of improvement in abnormalities. The abnormality reduction reward component is calculated. The reduction in the temporal abnormality score (current value minus the next state value) is multiplied by a scaling factor of 5.0 to obtain the abnormality reduction reward component. Finally, the smoothness reward component of the action sequence is calculated.

[0114] Query the transition cost from the current action to the next action in the action transition constraint graph, take a negative value and divide by 10 to obtain the smoothness reward component. Calculate the training intensity cost component. Calculate the cost based on the training intensity parameters: 0.1 for level 1, 0.2 for level 2, 0.3 for level 3, and 0.4 for level 4, taking a negative value as the intensity cost component. Weight the four components. The weights are 0.4 for anomaly improvement, 0.3 for anomaly reduction, 0.2 for action sequence smoothness, and 0.1 for training intensity cost. Sum the weighted values ​​to obtain the single-step reward value. Calculate the discounted cumulative reward. Using a discount factor of 0.95, calculate the discounted cumulative sum of all future rewards starting from the current state, which serves as the target value of the rehabilitation value function.

[0115] The deep reinforcement learning model is constructed using a deep Q-network structure, comprising an input layer, hidden layers, and an output layer. The input layer receives a 7-dimensional rehabilitation state vector; the hidden layers employ a two-layer fully connected structure with 64 and 32 nodes respectively; the output layer has the number of nodes equal to the number of training actions, with each node corresponding to the Q-value of an action. The hidden layers use ReLU activation, while the output layer does not. Network parameters are initialized using the He initialization method for weights and a default bias value of 0. The target network is constructed, with the same structure as the behavior network but independent parameters.

[0116] An experience replay buffer with a capacity of 10000 is set up, storing data in tuples (s, a, r, s', done), representing the current state, the action performed, the reward obtained, the next state, and whether the round has ended, respectively. The optimizer is set to Adam with a learning rate of 0.001, β1 parameter of 0.9, β2 parameter of 0.999, and ε parameter of 1e-8. The loss function is defined as mean squared error, calculating the difference between the predicted Q-value and the target Q-value. An ε-greedy exploration strategy is implemented, with an initial ε value of 1.0, gradually decreasing to a minimum of 0.05 at a decay rate of 0.9995. The target network update frequency is set to once every 100 training steps, using a soft parameter update method with an update rate of 0.01.

[0117] The training process initializes the environment and obtains the initial rehabilitation state vector s. Action a is selected according to an ε-greedy policy, randomly chosen with probability ε and selecting the action with the largest Q value with probability 1-ε. Action a is executed, and the reward r and the next state s' are obtained. The transition sample (s, a, r, s', done) is stored in the experience replay buffer. 64 transition samples are randomly sampled from the buffer for batch training.

[0118] Calculate the target Q-value. For non-terminating states, the target Q-value is r + γ·max(Q(s',a';θ-)), where γ is the discount factor of 0.95 and θ- represents the target network parameters. For terminating states, the target Q-value is r. Calculate the loss function value, which is the mean squared error between the predicted Q-value and the target Q-value. Update the behavioral network parameters through backpropagation. Update the target network parameters every 100 steps: θ- = τ·θ + (1-τ)·θ-, where τ is the update rate of 0.01. The training process continues until the model converges or reaches the maximum training step count of 50,000 steps.

[0119] The rehabilitation strategy generation process receives the patient's current rehabilitation state vector as the initial state. A pre-trained deep Q-network is used to predict the Q-value of each action, and the action with the largest Q-value is selected as the current optimal action. This action is executed, and the rehabilitation state vector is updated. The first two operations are repeated to generate an action sequence of length 10 to 15, forming a complete rehabilitation strategy. The generated rehabilitation strategy undergoes a safety check to ensure that the action sequence meets the constraints of the patient's physical condition and the requirements for a smooth transition in training intensity; adjustments are made as necessary.

[0120] In a specific example, for Parkinson's patients with a predominantly short gait, the generated rehabilitation strategy included moderate-intensity ankle dorsiflexion training (10 minutes), moderate-intensity ankle eversion training (10 minutes), moderate-intensity knee extension training (15 minutes), high-intensity gait training (10 minutes), and moderate-intensity balance training (15 minutes). After training, the patient's temporal abnormality score decreased from 0.72 to 0.54, and the short gait component in the abnormality type feature vector decreased from 0.9 to 0.65.

[0121] A clinical validation trial was conducted to evaluate and optimize the process, recruiting 100 patients with different types of gait abnormalities, divided into an experimental group and a control group, with 50 patients in each group. The experimental group used a rehabilitation strategy generated by deep reinforcement learning, while the control group used a traditional standardized rehabilitation program. Rehabilitation training was implemented for 8 weeks, 3 times a week, with each session lasting 30 to 60 minutes. Rehabilitation effectiveness was evaluated, with indicators including the improvement rate of gait abnormality scores, improvement in Functional Independence Scale (FIM) scores, and patient satisfaction.

[0122] Experimental results showed that the experimental group achieved an average improvement of 42.5% in gait abnormality scores, compared to 28.9% in the control group; the experimental group saw an increase of 15.3 points in FIM scores, compared to 10.8 points in the control group; and the experimental group had a patient satisfaction score of 8.7 out of 10, compared to 7.1 in the control group. Based on the evaluation results, the model was optimized by adjusting the reward function weights and network structure parameters, and the model was retrained to improve performance. In a new round of clinical validation, the optimized model further increased the improvement rate to 47.8%, demonstrating the effectiveness and adaptability of this method in generating personalized rehabilitation strategies.

[0123] In one optional implementation, the method further includes:

[0124] A rehabilitation training constraint model is established, which includes physiological constraints and dynamic constraints. The physiological constraints include joint range of motion constraints and muscle fatigue constraints. The joint range of motion constraints limit the upper and lower thresholds of joint angles, and the muscle fatigue constraints limit the dynamic threshold of muscle fatigue based on the fatigue recovery coefficient. The dynamic constraints include angular velocity constraints and angular acceleration constraints.

[0125] A state-space discretization model is constructed to map the continuous rehabilitation state space into a set of discrete states. A state transition cost matrix is ​​calculated based on the physiological and dynamic constraints. The state transition cost matrix represents the difficulty of transitioning between adjacent states. A state value function is constructed for the set of discrete states.

[0126] Based on the state transition cost matrix, an optimal path search strategy is designed, and a dynamic programming method is used to solve for the optimal solution of the state value function. The optimal solution of the state value function consists of the immediate state transition cost and the discounted cumulative value of the future state value. The immediate state transition cost is calculated based on the state transition cost matrix, and the future state value is calculated recursively.

[0127] The rehabilitation training action sequence is adjusted online using a rolling time-domain optimization method. The optimal action sequence is planned based on the optimal path search strategy in the prediction time domain. After executing the first action in the optimal action sequence, the rehabilitation status feedback is obtained in real time, and the state transition cost matrix is ​​updated according to the rehabilitation status feedback.

[0128] An adaptive adjustment mechanism is constructed based on the rehabilitation status feedback to monitor the patient's joint motion parameters and muscle fatigue status in real time. The threshold of the joint range of motion constraint is dynamically adjusted based on the joint motion parameters, and the fatigue recovery coefficient is dynamically adjusted based on the muscle fatigue status. The updated constraints are used for the optimization planning of the next round of rehabilitation training movement sequence.

[0129] like Figure 3 As shown, the method includes:

[0130] The rehabilitation training constraint model employs a multi-level constraint system, including physiological and dynamic constraints. The joint range of motion constraints within the physiological constraints set safe ranges of motion for major joints, including the hip, knee, and ankle. Taking the knee joint as an example, the normal range of motion for healthy individuals is 0 to 135 degrees, while the safe range for stroke patients is typically limited to 10 to 110 degrees to avoid excessive extension or flexion that could lead to secondary injury.

[0131] Joint range of motion constraints are represented by upper and lower thresholds, recorded as a binary tuple (θmin, θmax) for each joint. For the hip joint, the upper limit of flexion is 120 degrees, and the lower limit of extension is -15 degrees; for the ankle joint, the upper limit of dorsiflexion is 20 degrees, and the lower limit of plantarflexion is -40 degrees. These thresholds are individually adjusted based on the severity of the patient's condition and the stage of rehabilitation, with a more conservative range used in the early stages of rehabilitation and gradually relaxed as rehabilitation progresses.

[0132] Muscle fatigue constraints are modeled using electromyography (EMG) signals and exercise duration. Muscle fatigue is defined as the percentage decrease in muscle working capacity, ranging from 0 to 1, where 0 represents no fatigue and 1 represents complete fatigue. The dynamic threshold for fatigue is calculated based on the fatigue recovery coefficient, which represents the percentage of fatigue recovered by the muscles per unit time. The fatigue recovery coefficient for healthy adults is approximately 0.05 / min, while it is typically lower in patients with neurological disorders, ranging from approximately 0.02 to 0.03 / min.

[0133] The muscle fatigue threshold is initially set to 0.7. When muscle fatigue is detected to exceed this threshold, the training intensity is automatically reduced or a rest interval is inserted. Fatigue calculation takes into account exercise intensity and duration. For example, moderate-intensity training increases fatigue by 0.05 per minute, high-intensity training increases it by 0.1 per minute, and the fatigue value decreases by the recovery coefficient per minute during rest.

[0134] Kinetic constraints include angular velocity and angular acceleration constraints to ensure smooth and safe rehabilitation training movements. Angular velocity constraints limit joint angular velocities to safe thresholds to prevent pain or injury caused by rapid movements. Based on clinical data, the upper limit for hip angular velocity is set at 60 degrees / second, knee at 80 degrees / second, and ankle at 70 degrees / second. Angular acceleration constraints limit the rate of change of angular velocity to ensure smooth transitions in movement and avoid sudden acceleration or deceleration. The upper limit for hip angular acceleration is 120 degrees / second², knee at 150 degrees / second², and ankle at 130 degrees / second². These kinetic constraints are particularly suitable for elderly patients and those with impaired balance and can be adjusted according to the patient's mobility.

[0135] The state-space discretization model maps the continuous rehabilitation state space into a finite set of discrete states, facilitating computation and optimization. Rehabilitation states include four dimensions: joint angle, angular velocity, muscle fatigue, and training progress. The joint angle space is discretized at 5-degree intervals; for example, the knee joint range of 10 to 110 degrees is discretized into 21 state points. The angular velocity space is discretized at 10 degrees / second intervals, covering a range of -80 to 80 degrees / second. Muscle fatigue is discretized into 11 state points at 0.1-degree intervals, and training progress is discretized into 21 state points at 5% intervals. Combining these four dimensions, the total size of the state space is approximately 100,000 discrete states.

[0136] The state transition cost matrix is ​​calculated based on the difficulty of transitioning between adjacent states, considering both physiological and dynamic constraints. For two adjacent states s1 and s2, the transition cost c(s1,s2) integrates four factors: joint angle change cost, angular velocity change cost, muscle fatigue increase cost, and training effect cost. The joint angle change cost is proportional to the angle difference, increasing as the joint approaches its range of motion. The angular velocity change cost is proportional to the angular velocity difference and angular acceleration. The muscle fatigue increase cost is proportional to the fatigue increment, increasing rapidly as fatigue approaches a threshold. The training effect cost is inversely proportional to the improvement in training progress, encouraging effective improvement in training progress. The weights of each factor are 0.3, 0.2, 0.3, and 0.2, respectively, and the weighted summation yields the total transition cost.

[0137] In practical applications, the state transition cost matrix is ​​a high-dimensional sparse matrix. Only physically reachable adjacent states have a finite cost, while the cost between unreachable states is set to infinite. For example, within a 100-millisecond control cycle, the joint angle change cannot exceed 8 degrees, and the corresponding state transition is marked as unreachable. The proportion of non-zero elements in the matrix is ​​approximately 0.5%, and the sparse matrix storage format saves memory. The cost range is typically 0 to 10, where 0 represents an ideal transition and 10 represents a transition with extremely high cost but still acceptable.

[0138] The state-value function is constructed using the Bellman equation approach. The state value is defined as the long-term reward obtainable by following the optimal strategy from the current state. The state-value function V(s) consists of two parts: immediate transition costs and a discounted cumulative value of future states. Immediate transition costs are directly obtained from the state transition cost matrix, while future state values ​​are calculated recursively. A discount factor of 0.95 is set to balance short-term costs and long-term rewards. The state values ​​are initialized as uniform random values ​​in the range [-1, 0], and gradually converge to a stable value through iterative calculation.

[0139] The optimal path search strategy employs a value iteration method to find the optimal solution for the state value function. During iteration, for each state s, all successor states s' are tried, and the sum of the immediate transition cost c(s,s') and the future discount value is calculated. The action that maximizes the total value is selected as the optimal action for the current state. The iteration formula is expressed as: the current state value equals the maximum value obtained by adding the negative of the immediate transition cost to the next state value multiplied by the discount factor. Iterative calculations continue until the state value change is less than a preset threshold of 0.001 or the maximum number of iterations (1000) is reached. In practical applications, convergence typically occurs after 100 to 200 iterations.

[0140] The rolling time-domain optimization method dynamically adjusts the rehabilitation training movement sequence during execution. The prediction time domain is set to 10 steps, corresponding to a 1-second training process. At the beginning of each control cycle, based on the current rehabilitation state and state value function, the optimal movement sequence for the next 10 steps is planned. The planning process uses a dynamic programming method, starting from the current state and sequentially selecting movements that maximize the total value to construct a complete movement sequence. Only the first movement in the sequence is executed, and then the actual rehabilitation state feedback is obtained, including real-time measurements of joint angles, angular velocities, and muscle fatigue. This feedback data is collected through sensors on the rehabilitation training equipment, including angle sensors, accelerometers, and electromyography (EMG) sensors.

[0141] The state transition cost matrix is ​​updated based on rehabilitation status feedback, adjusting the state transition model to suit the patient's actual situation. If a significant difference is detected between the actual state transition and the prediction, the corresponding state transition cost is updated. For example, when a patient has difficulty moving within a specific joint angle range, the cost of the corresponding state transition increases by 25%; when the rate of increase in muscle fatigue is higher than expected, the cost of movement transition involving that muscle group increases by 20%. This adaptive adjustment ensures that the model accurately reflects the patient's actual abilities and limitations.

[0142] An adaptive adjustment mechanism monitors the patient's joint motion parameters and muscle fatigue status in real time. Joint motion parameters include actual range of motion, mean angular velocity, and motion smoothness. Actual range of motion is obtained by recording the maximum and minimum joint angles during training; mean angular velocity is calculated as the ratio of angle change to time; and motion smoothness is measured by the standard deviation of angular acceleration. Muscle fatigue status is monitored through changes in the median frequency and amplitude of electromyographic signals; a decrease in median frequency and an increase in amplitude indicate increased muscle fatigue.

[0143] The dynamic adjustment of joint range of motion constraint thresholds is based on actual movement performance. When a patient's actual range of motion reaches more than 90% of the current threshold in three consecutive training sessions without any discomfort, the upper threshold is increased by 5 degrees and the lower threshold is decreased by 5 degrees, expanding the range of motion. When pain or compensatory movements are detected when the patient approaches the threshold boundary, the corresponding threshold is tightened by 3 degrees to increase the safety margin. For example, if a patient with a knee injury initially has a range of motion set to 15 to 100 degrees, and after two weeks of training, the patient stably reaches an actual range of 15 to 95 degrees, the system automatically adjusts the upper limit to 105 degrees, encouraging the patient to gradually increase the flexion angle.

[0144] The dynamic adjustment of the fatigue recovery coefficient is based on the muscle fatigue recovery pattern. During training, the growth rate and recovery rate of muscle fatigue are recorded and compared with the initial set values. If the actual recovery rate is more than 20% lower than the initial value, the fatigue recovery coefficient is decreased by 0.005 / minute; if it is more than 20% higher than the initial value, it is increased by 0.005 / minute. This adjustment is performed weekly to ensure that the model accurately reflects the patient's actual recovery ability. For example, if a stroke patient's initial fatigue recovery coefficient is set to 0.03 / minute, and monitoring reveals an actual recovery rate of only 0.022 / minute, the system adjusts the recovery coefficient to 0.025 / minute and accordingly adjusts the training plan, increasing rest intervals.

[0145] The updated constraints are used to optimize the planning of the next round of rehabilitation training movement sequences. After each training session, the system saves the adjusted constraint parameters as initial values ​​for the next training session. Long-term tracking shows that this adaptive mechanism enables the constraints to converge to the patient's actual ability level within 4-6 weeks, making the training plan more personalized and effective. Clinical validation results indicate that patients using this method experience 32% faster rehabilitation progress, 28% better training adherence, and a 45% lower incidence of adverse reactions compared to traditional fixed protocols.

[0146] This invention relates to a real-time clinical research data analysis system combining smart wearables and AI, comprising:

[0147] The first unit is used to collect gait data of users during walking through smart wearable devices, construct skeletal joints into a dynamic graph structure, extract spatial correlation features between skeletal joints through spatiotemporal graph convolution, and use graph attention mechanism to adaptively assign weights to the motion features of different skeletal joints, and finally obtain multi-dimensional gait features that include inter-joint coordination relationships.

[0148] The second unit is used to input the multi-dimensional gait features into the anomaly recognition framework. The anomaly recognition framework uses a variational autoencoder to construct the latent variable space of gait features, models the feature distribution in the latent variable space, calculates the anomaly probability score of the multi-dimensional gait features, and uses a conditional random field model to capture temporal anomaly patterns in gait data. It then outputs the gait anomaly type discrimination result and anomaly degree quantification index in combination.

[0149] The third unit is used to construct a rehabilitation strategy generation model based on deep reinforcement learning. It takes the type discrimination result and the abnormality degree quantification index as state input, and performs dynamic planning and optimization of rehabilitation training action sequence through a pre-set rehabilitation objective function. The rehabilitation objective function comprehensively considers two dimensions: rehabilitation effect index and user motor ability score. The rehabilitation effect index is calculated based on the temporal changes of the multi-dimensional gait representation, and the user motor ability score is evaluated based on the gait abnormality type. Finally, it outputs a personalized rehabilitation guidance plan with adaptive adjustment.

[0150] A third aspect of the present invention,

[0151] An electronic device is provided, comprising:

[0152] processor;

[0153] Memory used to store processor-executable instructions;

[0154] The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.

[0155] Fourth aspect of the embodiments of the present invention,

[0156] A computer-readable storage medium is provided, having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.

[0157] This invention can be a method, apparatus, system, and / or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for performing various aspects of the invention.

[0158] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A real-time analysis method for clinical research data combining smart wearables and AI, characterized in that, include: By collecting gait data of users during walking through smart wearable devices, skeletal joints are constructed into a dynamic graph structure. Spatial correlation features between skeletal joints are extracted through spatiotemporal graph convolution, and graph attention mechanism is used to adaptively assign weights to the motion features of different skeletal joints, ultimately obtaining multi-dimensional gait features that include inter-joint coordination relationships. The multi-dimensional gait features are input into the anomaly recognition framework. The anomaly recognition framework uses a variational autoencoder to construct the latent variable space of the gait features, models the feature distribution in the latent variable space, calculates the anomaly probability score of the multi-dimensional gait features, and uses a conditional random field model to capture temporal anomaly patterns in the gait data. The framework then outputs the gait anomaly type discrimination result and anomaly degree quantification index. A rehabilitation strategy generation model is constructed based on deep reinforcement learning. The type discrimination result and the abnormality degree quantification index are used as state inputs. The rehabilitation training action sequence is dynamically planned and optimized through a pre-set rehabilitation objective function. The rehabilitation objective function comprehensively considers two dimensions: rehabilitation effect index and user motor ability score. The rehabilitation effect index is calculated based on the temporal changes of the multi-dimensional gait representation, and the user motor ability score is evaluated based on the gait abnormality type. Finally, a personalized rehabilitation guidance plan with adaptive adjustment is output.

2. The method according to claim 1, characterized in that, The skeletal joints are constructed as a dynamic graph structure. Spatial correlation features between skeletal joints are extracted through spatiotemporal graph convolution. A graph attention mechanism is then used to adaptively assign weights to the motion features of different skeletal joints, ultimately yielding multi-dimensional gait features that include inter-joint coordination relationships. The skeletal joints are mapped to a dynamic graph structure, which includes a set of nodes and a set of edges. The set of nodes corresponds to the skeletal joints, and each node contains a feature vector consisting of three-dimensional spatial coordinates and corresponding velocity information. The edge weights in the set of edges are obtained by calculating the Euclidean distance between the skeletal joints and combining it with a Gaussian kernel function. Graph convolution is performed on the dynamic graph structure, and graph attention mechanism is used to adaptively assign weights to the motion features of different skeletal joints. Within a preset time window, one-dimensional convolution is performed on the spatial correlation features to obtain temporal correlation features. By performing dimensionality reduction transformation and nonlinear mapping on the spatial correlation features and temporal correlation features through a feedforward neural network, multidimensional gait features containing spatiotemporal correlation information are obtained.

3. The method according to claim 1, characterized in that, The multi-dimensional gait features are input into an anomaly detection framework. The anomaly detection framework uses a variational autoencoder to construct a latent variable space for the gait features, models the feature distribution in the latent variable space, and calculates the anomaly probability score of the multi-dimensional gait features, including: The variational autoencoder includes an encoder subnetwork and a decoder subnetwork. The multi-dimensional gait features of the input are mapped to the latent variable space through the encoder subnetwork to obtain latent variable distribution parameters. The latent variable distribution parameters include a mean vector and a variance vector describing the feature distribution. The latent variable distribution parameters are reconstructed into original features through the decoder subnetwork. The reconstruction error between the original features and the multidimensional gait features is calculated, and the KL divergence between the latent variable distribution parameters and the standard normal distribution is calculated. The reconstruction error and the KL divergence are used to construct a variational evidence lower bound. Based on the variational evidence lower bound, the parameters of the variational autoencoder are optimized, and the parameters of the encoder subnetwork and the decoder subnetwork are iteratively updated through the backpropagation algorithm to maximize the variational evidence lower bound. The variational autoencoder, based on parameter optimization, calculates the log-likelihood probability of the multi-dimensional gait features to obtain an anomaly probability score. The anomaly probability score is then compared with an adaptive threshold to obtain the anomaly detection result.

4. The method according to claim 1, characterized in that, The Conditional Random Field (CRF) model is used to capture temporal anomalous patterns in gait data. The comprehensive output of gait anomaly type discrimination results and anomalous degree quantification indicators includes: The conditional random field model is used to detect anomalies in the test gait sequence. The Viterbi algorithm is used to decode the state sequence of the test gait sequence to obtain the optimal state label corresponding to each time point. The state label includes normal and different types of anomalies. The abnormality quantification index of the test gait sequence is calculated, and the temporal anomaly score is calculated based on the posterior probability and state transition probability of the state sequence. The temporal anomaly score reflects the duration and trend of gait anomaly. Output gait anomaly detection results, which include anomaly type discrimination results and anomaly degree quantification index, wherein the anomaly type discrimination results are determined based on the optimal state label, and the anomaly degree quantification index is calculated based on the time-series anomaly score.

5. The method according to claim 1, characterized in that, A rehabilitation strategy generation model is constructed based on deep reinforcement learning. The model uses the type discrimination result and the abnormality degree quantification index as state inputs, and dynamically plans and optimizes the rehabilitation training action sequence through a pre-defined rehabilitation objective function, including: Construct a rehabilitation state vector, which includes an abnormality type feature vector and an abnormality degree feature vector. The abnormality type feature vector uses a multidimensional discrete vector to represent the confidence score of different types of gait abnormalities, and the abnormality degree feature vector includes the temporal abnormality score and the duration of abnormality. A rehabilitation action space is constructed based on the rehabilitation state vector. The rehabilitation action space includes a set of basic rehabilitation training actions and a movement transfer constraint graph. Each rehabilitation training action in the set of basic rehabilitation training actions determines a movement type parameter based on the abnormality type feature vector and a training intensity parameter and a duration parameter based on the abnormality degree feature vector. The movement transfer constraint graph describes the transfer cost and safety constraints between adjacent rehabilitation training actions. A rehabilitation reward function is constructed for the rehabilitation state vector and the rehabilitation action space. The rehabilitation reward function calculates the degree of abnormality improvement based on the abnormality type feature vector, calculates the abnormality reduction based on the abnormality degree feature vector, and calculates the smoothness of the action sequence and the training intensity cost based on the action transfer constraint graph. The cumulative discount value of the rehabilitation reward function is used as the rehabilitation value function.

6. The method according to claim 5, characterized in that, The method further includes: A rehabilitation training constraint model is established, which includes physiological constraints and dynamic constraints. The physiological constraints include joint range of motion constraints and muscle fatigue constraints. The joint range of motion constraints limit the upper and lower thresholds of joint angles, and the muscle fatigue constraints limit the dynamic threshold of muscle fatigue based on the fatigue recovery coefficient. The dynamic constraints include angular velocity constraints and angular acceleration constraints. A state-space discretization model is constructed to map the continuous rehabilitation state space into a set of discrete states. A state transition cost matrix is ​​calculated based on the physiological and dynamic constraints. The state transition cost matrix represents the difficulty of transitioning between adjacent states. A state value function is constructed for the set of discrete states. Based on the state transition cost matrix, an optimal path search strategy is designed, and a dynamic programming method is used to solve for the optimal solution of the state value function. The optimal solution of the state value function consists of the immediate state transition cost and the discounted cumulative value of the future state value. The immediate state transition cost is calculated based on the state transition cost matrix, and the future state value is calculated recursively. The rehabilitation training action sequence is adjusted online using a rolling time-domain optimization method. The optimal action sequence is planned based on the optimal path search strategy in the prediction time domain. After executing the first action in the optimal action sequence, the rehabilitation status feedback is obtained in real time, and the state transition cost matrix is ​​updated according to the rehabilitation status feedback. An adaptive adjustment mechanism is constructed based on the rehabilitation status feedback to monitor the patient's joint motion parameters and muscle fatigue status in real time. The threshold of the joint range of motion constraint is dynamically adjusted based on the joint motion parameters, and the fatigue recovery coefficient is dynamically adjusted based on the muscle fatigue status. The updated constraints are used for the optimization planning of the next round of rehabilitation training movement sequence.

7. A real-time clinical research data analysis system combining smart wearables and AI, used to implement the method as described in any one of claims 1-6, characterized in that, include: The first unit is used to collect gait data of users during walking through smart wearable devices, construct skeletal joints into a dynamic graph structure, extract spatial correlation features between skeletal joints through spatiotemporal graph convolution, and use graph attention mechanism to adaptively assign weights to the motion features of different skeletal joints, and finally obtain multi-dimensional gait features that include inter-joint coordination relationships. The second unit is used to input the multi-dimensional gait features into the anomaly recognition framework. The anomaly recognition framework uses a variational autoencoder to construct the latent variable space of gait features, models the feature distribution in the latent variable space, calculates the anomaly probability score of the multi-dimensional gait features, and uses a conditional random field model to capture temporal anomaly patterns in gait data. It then outputs the gait anomaly type discrimination result and anomaly degree quantification index in combination. The third unit is used to construct a rehabilitation strategy generation model based on deep reinforcement learning. It takes the type discrimination result and the abnormality degree quantification index as state input, and performs dynamic planning and optimization of rehabilitation training action sequence through a pre-set rehabilitation objective function. The rehabilitation objective function comprehensively considers two dimensions: rehabilitation effect index and user motor ability score. The rehabilitation effect index is calculated based on the temporal changes of the multi-dimensional gait representation, and the user motor ability score is evaluated based on the gait abnormality type. Finally, it outputs a personalized rehabilitation guidance plan with adaptive adjustment.

8. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the method described in any one of claims 1 to 6.