A neural patient rehabilitation training method based on task training and brain-computer interaction
By dynamically adjusting the EEG decoding model through real-time calculation of KL divergence and correction of historical data, the problem of decreased classification accuracy caused by EEG signal drift is solved, and efficient rehabilitation training results are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-29
- Publication Date
- 2026-03-17
AI Technical Summary
EEG data signals are affected by the patient's physiological state and environmental factors, and the feature distribution drifts significantly over time. Traditional static decoding models cannot adapt dynamically, resulting in decreased classification accuracy and affecting the effectiveness of rehabilitation training.
By calculating the KL divergence of adjacent data blocks in real time, the stability of the signal is judged. Historical data is used to correct the motion decoding model. By combining time-frequency features and deep clustering, a dynamic loss function is constructed to correct the model, ensuring that the decoding result matches the training objective.
It improves the continuity and precision of rehabilitation training, ensures that rehabilitation equipment can accurately respond to patients' movement intentions, and enhances the rehabilitation effect for neurological patients.
Smart Images

Figure CN121034540B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of rehabilitation training technology, and specifically to a rehabilitation training method for neurological patients based on task training and brain-computer interaction. Background Technology
[0002] Brain-computer interface (BCI) establishes a direct connection between the human or animal brain (or a culture of brain cells) and an external device. It decodes brain intentions directly from electroencephalogram (EEG) data signals to control the external device. BCI rehabilitation training plays a crucial role in the functional rehabilitation of patients with neurological injuries such as stroke and spinal cord injury, and this method has been widely applied in neurorehabilitation and motor assistance. Specifically, by collecting EEG information related to active motor intentions from patients with neurological injuries, analyzing this information, and controlling rehabilitation training equipment based on the analysis results (related to active motor intentions), the patient's limb motor function is trained, thereby achieving rehabilitation. Compared with traditional rehabilitation methods and robot-assisted rehabilitation methods, BCI-based rehabilitation training involves active participation from patients with neurological injuries, promoting neural plasticity by increasing neural involvement, thus effectively improving the rehabilitation training effect.
[0003] EEG data signals are affected by the patient's physiological state (such as fatigue and fluctuations in attention) and environmental factors (such as changes in electrode contact and electromyography artifacts), and the feature distribution can drift significantly over time. Traditional static decoding models rely on fixed parameters and cannot dynamically adapt to these changes, resulting in a decrease in classification accuracy as training time increases, which affects the actual rehabilitation training effect on patients. Summary of the Invention
[0004] The purpose of this invention is to provide a rehabilitation training method for neurological patients based on task training and brain-computer interaction, and to solve the following technical problems:
[0005] EEG data signals are affected by the patient's physiological state (such as fatigue and fluctuations in attention) and environmental factors (such as changes in electrode contact and electromyography artifacts), and the feature distribution can drift significantly over time. Traditional static decoding models rely on fixed parameters and cannot dynamically adapt to these changes, resulting in a decrease in classification accuracy as training time increases, which affects the actual rehabilitation training effect on patients.
[0006] The objective of this invention can be achieved through the following technical solutions:
[0007] A rehabilitation training method for neurological patients based on task training and brain-computer interaction includes the following steps:
[0008] S1, Obtain the patient's training task in the current rehabilitation training, and determine the corresponding motion decoding model based on the training task;
[0009] S2, real-time acquisition of data signals from the patient's current rehabilitation training, segmentation processing according to a preset time window to obtain several independent data blocks, frequency domain transformation of any independent data block and extraction of the time-frequency characteristics of the independent data block, and calculation of the KL divergence between adjacent independent data blocks based on the time-frequency characteristics;
[0010] If the KL divergence between any two adjacent independent data blocks is less than a preset threshold, the data signal corresponding to the current independent data block is input into the motion decoding model for motion decoding to obtain the motion action, and the target operation of the rehabilitation device is determined based on the motion action.
[0011] S3. If the KL divergence between any adjacent independent data blocks is greater than or equal to a preset threshold, the data signal of the patient in the historical task rehabilitation training is obtained and the motion decoding model is corrected. Based on the corrected motion decoding model, the patient's motion is decoded to obtain the target operation of the rehabilitation device corresponding to the patient.
[0012] As a further aspect of the present invention: the specific calculation process of the KL divergence in S2 is as follows:
[0013] For each independent data block, frequency domain transformation is performed and time-frequency features are extracted to obtain the feature value range. Histogram binning is used to divide the feature value range into several intervals. The frequency of occurrence of feature values in each interval is counted as the probability. The feature distribution of the previous data block is used as the reference distribution, and the feature distribution of the current data block is used as the distribution to be compared. The probability value of the reference distribution is used as the weight and multiplied by the natural logarithm of the probability ratio of the reference distribution to the current distribution. The calculation results of all intervals are summed to obtain the KL divergence value.
[0014] As a further aspect of the present invention: the specific process of correcting the motion decoding model in S3 is as follows:
[0015] S11, acquire the patient's data signals from historical rehabilitation training, and segment the data signals according to a preset time window to obtain several historical independent data blocks; perform preliminary classification on each historical independent data block using a preset static decoding model to obtain a target data block set and a non-target data block set, and perform deep clustering on the target data block set and the non-target data block set respectively to obtain the target cluster center Q and the non-target cluster center F;
[0016] S12, with the current time window as the starting point, a preset observation period H is established. Data signals from the patient's rehabilitation training within the observation period are acquired, and the data signals are segmented according to the preset time window to obtain several independent data blocks and generate a set of reference data blocks. Any reference data block is selected, and the distance values between the reference data block and the target class cluster center Q and the non-target class cluster center F are calculated. Based on the distance values, the probability values of the reference data block corresponding to the target class and the non-target class are obtained through the t-distribution probability. The probability values of the target class and the non-target class are compared, and the one with the largest probability value is taken as the category of the reference data block; the category is the target data block and the non-target data block.
[0017] S13, a second target data block set and a second non-target data block set are obtained according to the category of the reference data block. A loss function is constructed based on the second target data block set and the second non-target data block set. The motion decoding model is backpropagated based on the loss function to obtain a modified motion decoding model.
[0018] As a further aspect of the present invention: in S11, the process of obtaining the preset static decoding model is as follows:
[0019] Acquire training set data, which includes a sample set and training labels; construct a backpropagation network model and set training parameters; normalize the training set data; train the backpropagation network model using the sample set data to obtain a trained static decoding model.
[0020] As a further aspect of the present invention: in S13, the process of constructing the loss function is as follows:
[0021] S31, perform deep clustering on the second target data block set and the second non-target data block set respectively to obtain the target class cluster center Q' and the non-target class cluster center F';
[0022] S32, Select any independent data block and calculate the distance value between the independent data block and the target class cluster center Q and the target class cluster center Q' respectively, and obtain the probability value W of the independent data block corresponding to the target class Q and the target class Q' based on the distance value;
[0023] According to the calculation formula The loss parameter LOSS_ is calculated. kl Where N is the number of all independent data blocks, W'i is the probability value of the i-th independent data block corresponding to the target class Q', and Wi is the probability value of the i-th independent data block corresponding to the target class Q.
[0024] S33, repeat S32 to obtain the probability values W of non-target class F and non-target class F' corresponding to the independent data block. Compare the probability values of target class Q and non-target class F of the independent data block, and take the one with the largest probability value as the category of the independent data block to obtain the first category of the independent data block. Similarly, compare the probability values of target class Q' and non-target class F' of the independent data block to obtain the second category of the independent data block. If the first category and the second category of the independent data block are not the same, then the independent data block is marked as an abnormal data block.
[0025] According to the calculation formula The loss parameter LOSS_ is calculated. jl , where m is the number of abnormal data blocks;
[0026] S34, according to the loss parameter LOSS_ kl and loss parameter LOSS_ jl Construct the loss function LOSS, LOSS = b × LOSS_ kl +d×LOSS_ jl , where b and d are preset coefficients.
[0027] As a further aspect of the present invention: S13 further includes calculating the offset value between the target cluster center Q' and the target cluster center Q. If the offset value is less than or equal to a preset offset threshold, the motion decoding model is not modified.
[0028] As a further aspect of the present invention: S31 further includes obtaining the probability values of the target class and non-target class corresponding to any independent data block in the second target data block set, calculating the absolute value of the difference between the probability value of the target class and the probability value of the non-target class, and if the absolute value of the difference is less than or equal to a preset filtering threshold, then the independent data block is removed from the second target data block set.
[0029] As a further aspect of the present invention: Step S2, which inputs the data signal corresponding to the current independent data block into the motion decoding model for motion decoding, also includes preprocessing the data signal. The specific preprocessing process is as follows:
[0030] The data signal is amplified by an amplifier, then filtered, and finally denoised using wavelet transform.
[0031] The beneficial effects of this invention are:
[0032] This invention first acquires the patient's training task in the current rehabilitation training, and determines the corresponding motor decoding model based on the training task. It can be understood that by using a decoding model that matches the training task, the patient's brain activity and motor intentions can be identified and analyzed. Data signals of the patient in the current rehabilitation training are collected in real time, and the stability of the data signal characteristics is judged in real time by calculating the KL divergence of adjacent data blocks. If the KL divergence is lower than the threshold, it means that the patient's data signal characteristics are relatively stable in the current training. Therefore, the current model is directly used for decoding to ensure the continuity of rehabilitation training. If the KL divergence is greater than or equal to the threshold, it means that there are abnormal changes in the patient's data signal during the training process. If decoding is performed according to the pre-trained decoding model, it will lead to motor deviation, which is not conducive to the patient's rehabilitation training.
[0033] Therefore, in this invention, historical patient data signals are first acquired, and each historical independent data block is initially classified using a preset static decoding model to obtain a target data block set and a non-target data block set. Deep clustering is then performed on each target data block set to obtain target cluster centers and non-target cluster centers. Starting from the current time window, patient data signals are acquired in real-time for a preset observation period and segmented to obtain several independent data blocks. The distance between each independent data block and the target cluster center and non-target cluster centers is calculated. Based on the distance, each independent data block is classified to obtain a second target data block set and a second non-target data block set. Deep clustering is then performed on the second target data block set and the second non-target data block set to obtain the current target cluster center and the current non-target cluster center. A loss function is constructed based on the current target cluster center and the current non-target cluster center. Backpropagation is then performed on the motion decoding model based on the loss function to obtain a modified motion decoding model. This invention selects the corresponding model according to the current rehabilitation training task and dynamically adjusts it in conjunction with real-time signal characteristics to ensure a high degree of matching between the decoding results and the training objectives, thereby improving the rehabilitation training effect for patients. Attached Figure Description
[0034] The invention will now be further described with reference to the accompanying drawings.
[0035] Figure 1 This is a schematic diagram of a rehabilitation training method for neurological patients based on task training and brain-computer interaction according to the present invention. Detailed Implementation
[0036] 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.
[0037] Please see Figure 1 As shown, this invention is a rehabilitation training method for neurological patients based on task training and brain-computer interaction, comprising the following steps:
[0038] S1, Obtain the patient's training task in the current rehabilitation training, and determine the corresponding motion decoding model based on the training task;
[0039] S2, real-time acquisition of data signals from the patient's current rehabilitation training, segmentation processing according to a preset time window to obtain several independent data blocks, frequency domain transformation of any independent data block and extraction of the time-frequency characteristics of the independent data block, and calculation of the KL divergence between adjacent independent data blocks based on the time-frequency characteristics;
[0040] If the KL divergence between any two adjacent independent data blocks is less than a preset threshold, the data signal corresponding to the current independent data block is input into the motion decoding model for motion decoding to obtain the motion action, and the target operation of the rehabilitation device is determined based on the motion action.
[0041] S3. If the KL divergence between any adjacent independent data blocks is greater than or equal to a preset threshold, the data signal of the patient in the historical task rehabilitation training is obtained and the motion decoding model is corrected. Based on the corrected motion decoding model, the patient's motion is decoded to obtain the target operation of the rehabilitation device corresponding to the patient.
[0042] It is understandable that different rehabilitation training tasks (such as hand grasping training, leg extension training, and elbow flexion and extension training) correspond to differences in the activation areas of the patient's motor cortex and the characteristics of EEG signals. For example, "hand grasping" mainly activates the parietal motor area of the brain, with an increased proportion of β wave (13-30Hz) energy in the EEG signal; while "leg extension" activates the frontal motor area more, with more significant inhibition of α wave (8-13Hz). Therefore, it is necessary to improve the initial decoding accuracy by using a task-specific decoding model.
[0043] First, the patient actively selects and determines the specific task of the current rehabilitation training (e.g., "right-hand finger grasping-relaxation cycle training" or "left knee flexion and extension training"). The rehabilitation system has multiple pre-trained motor decoding models built-in, each corresponding to a specific rehabilitation task—the model training phase has optimized parameters using a large amount of patient EEG data under the same task (e.g., the model for the "hand grasping" task has learned the time-frequency characteristics of the EEG signal under this task). Based on the current training task, the corresponding motor decoding model can be automatically called as the initial decoding tool. However, traditional static decoding models cannot cope with the feature distribution drift of data signals caused by factors such as patient fatigue and attention fluctuations, resulting in a decline in decoding performance over training time. Therefore, this invention, through the core step S2, calculates the KL divergence between adjacent data blocks in real time, thereby quantitatively assessing and monitoring signal distribution changes in real time. Once a distribution change is detected to exceed a preset threshold, a model correction mechanism is immediately triggered. By using historical data to establish a stable cluster center reference (Q, F), and reclassifying real-time data based on the t-distribution probability, a model is constructed that incorporates distribution alignment loss (LOSS_). kl ) and classification consistency loss (LOSS_ jl The joint loss function is used to backpropagate and correct the model. This ensures that the motion decoding model can dynamically adapt to the patient's current physiological state, overcomes the drawback of the gradual failure of traditional fixed models, enables rehabilitation equipment to continuously and stably respond to the patient's true movement intentions, and guarantees the effective duration and continuity of a single training session.
[0044] Dual validation using KL divergence thresholding and cluster center offset thresholding effectively distinguishes between distribution drift caused by significant state changes and minor fluctuations caused by random noise. This avoids unnecessary and computationally expensive model adjustments, significantly saving system computing resources and meeting the stringent real-time requirements of brain-computer interface systems. Secondly, when corrections are necessary, the classification method based on cluster center distance and t-distribution probability, along with the mechanism for removing low-confidence samples, enhances robustness against noise and artifacts, ensuring the quality of the dataset used to construct the loss function. Finally, fine-tuning through a joint loss function achieves targeted and constrained smooth updates of model parameters, absorbing information from new data while avoiding forgetting historical knowledge, thus maintaining the model's generalization ability and stability while adapting rapidly.
[0045] By extracting time-frequency features and calculating KL divergence, a high-level perception of signal stability was achieved. Finally, in the model correction stage, the cluster centers (Q, F, Q', F') obtained from deep clustering were innovatively used as a representation of the distribution. By measuring the difference between the current data and historical cluster centers, as well as the difference between the old and new cluster centers, the abstract "distribution change" was transformed into a calculable and optimizable specific loss target. This allows the model to continuously and automatically adjust its internal parameters (model weights) based on its output feedback, forming a positive cycle of continuous self-optimization. This ensures that the target operations performed by the rehabilitation equipment are highly matched with the patient's brain's motor intentions, thereby enhancing the patient's sense of accomplishment and enthusiasm for actively participating in training. Through correct neural feedback, it effectively promotes the reshaping of neural pathways and functional rehabilitation.
[0046] In a preferred embodiment, the specific calculation process of the KL divergence in step S2 is as follows:
[0047] For each independent data block, frequency domain transformation is performed and time-frequency features are extracted to obtain the feature value range. Histogram binning is used to divide the feature value range into several intervals. The frequency of occurrence of feature values in each interval is counted as the probability. The feature distribution of the previous data block is used as the reference distribution, and the feature distribution of the current data block is used as the distribution to be compared. The probability value of the reference distribution is used as the weight and multiplied by the natural logarithm of the probability ratio of the reference distribution to the current distribution. The calculation results of all intervals are summed to obtain the KL divergence value.
[0048] In another preferred embodiment, the specific process of modifying the motion decoding model in step S3 is as follows:
[0049] S11, acquire the patient's data signals from historical rehabilitation training, and segment the data signals according to a preset time window to obtain several historical independent data blocks; perform preliminary classification on each historical independent data block using a preset static decoding model to obtain a target data block set and a non-target data block set, and perform deep clustering on the target data block set and the non-target data block set respectively to obtain the target cluster center Q and the non-target cluster center F;
[0050] S12, with the current time window as the starting point, a preset observation period H is established. Data signals from the patient's rehabilitation training within the observation period are acquired, and the data signals are segmented according to the preset time window to obtain several independent data blocks and generate a set of reference data blocks. Any reference data block is selected, and the distance values between the reference data block and the target class cluster center Q and the non-target class cluster center F are calculated. Based on the distance values, the probability values of the reference data block corresponding to the target class and the non-target class are obtained through the t-distribution probability. The probability values of the target class and the non-target class are compared, and the one with the largest probability value is taken as the category of the reference data block; the category is the target data block and the non-target data block.
[0051] S13, a second target data block set and a second non-target data block set are obtained according to the category of the reference data block. A loss function is constructed based on the second target data block set and the second non-target data block set. The motion decoding model is backpropagated based on the loss function to obtain a modified motion decoding model.
[0052] First, data signals recorded by the patient during past rehabilitation training are retrieved. This historical data is segmented according to a pre-set time length, resulting in multiple independent historical data blocks. This segmentation process transforms the continuous data stream into independently analyzable units, facilitating subsequent feature extraction and pattern recognition. Next, a pre-trained static decoding model is used to perform preliminary classification of these historical data blocks. This static model is a baseline model trained on a large amount of labeled data and possesses preliminary discriminative ability. Through its classification, the data blocks are divided into a "target data block set" related to the target action and a "non-target data block set" unrelated to the target action. This step is necessary because it leverages the knowledge of the existing model to provide preliminary, semantically labeled data segmentation for subsequent deep clustering. Then, deep clustering is performed on the target data block set and the non-target data block set respectively. Deep clustering is a method that integrates deep learning feature extraction and clustering algorithms. It transforms the data nonlinearly through neural networks and mines the inherent distribution structure of the data in a high-dimensional feature space, thereby finding the core feature cluster points that best represent each category, i.e., cluster centers. In this process, the target class cluster center Q and the non-target class cluster center F are calculated. They respectively condense the core feature patterns of the two types of signals in the historical data, providing a reliable reference benchmark for subsequent real-time data comparison.
[0053] Starting from the current moment, a time length H is set as the observation window. Patient data signals within this window are acquired in real time and segmented to generate a new set of independent real-time data blocks, forming a reference data block set. For each data block in this dataset, the distance between it and the two cluster centers Q and F obtained from the historical stage is calculated. The distance is usually calculated using Euclidean distance or cosine distance to measure the similarity between the features of the current data block and the two historical patterns. Based on the calculated distance, the probability value of the current data block belonging to the target class and non-target class is estimated using the t-distribution probability function. Compared with the normal distribution, the t-distribution has a thicker tail and exhibits better robustness to noise and outliers, making the probability estimation more stable on data signals that are susceptible to interference. By comparing the two calculated probability values, the class with the larger probability value is determined as the current class of the data block, thus completing the reclassification of the real-time data block.
[0054] Based on the category labels of all the data blocks obtained above, new "second target data block sets" and "second non-target data block sets" are reconstructed; these two sets reflect the latest distribution of data signal features within the current time window. Subsequently, a loss function is constructed based on these two new datasets, which measures the difference between the model's performance on the current new data and its performance on historical data. Finally, using the backpropagation algorithm, the internal parameters of the motion decoding model are iteratively updated based on the gradient calculated according to this loss function, thereby obtaining a corrected model that better adapts to the patient's current physiological state.
[0055] A dynamic learning loop was constructed to address the non-stationarity of data signals. Data signals drift over time due to factors such as patient fatigue, attention, and environmental noise, leading to performance degradation of the statically trained model in the early stages. First, stable and pure class feature prototypes (cluster centers Q and F) are extracted from historical data. These prototypes are used as "anchors" to reliably reclassify new, potentially drifted, real-time data. This process essentially maps new data back to the historical feature space for interpretation, avoiding the direct use of potentially ineffective old models for classification decisions. Finally, the high-quality, current-consistent dataset obtained after reclassification guides model updates. This makes model adjustments more directional, rather than blind, guiding the model's decision boundary towards the current data distribution while its updates are constrained by historical cluster centers (representing historical knowledge), preventing overfitting to the latest, less noisy data. Ultimately, this process ensures that the motion decoding model can continuously and adaptively track changes in the patient's brain signals, maintaining high-precision intention decoding. This guarantees that the rehabilitation training equipment can accurately execute the patient's motion intentions, improving the effectiveness and reliability of rehabilitation training.
[0056] In another preferred embodiment, the process of obtaining the preset static decoding model in S11 is as follows:
[0057] Acquire training set data, which includes a sample set and training labels; construct a backpropagation network model and set training parameters; normalize the training set data; train the backpropagation network model using the sample set data to obtain a trained static decoding model.
[0058] The establishment of the pre-defined static decoding model begins with acquiring training set data. This training set contains a large number of labeled data signal samples and their corresponding explicit training labels, such as which data signal segments correspond to "left-hand movement intention," which correspond to "right-hand movement intention," or "no movement intention." Acquiring this data allows the model to learn a stable and universal mapping relationship between data signal features and specific movement intentions, providing the model with the foundational knowledge for learning. Next, a neural network model based on the error backpropagation principle is constructed. This model typically includes an input layer, hidden layers, and an output layer, and key training parameters such as learning rate, number of iterations, and number of neurons in the hidden layers are set. This type of model is constructed because it has a strong nonlinear fitting capability, capable of capturing complex and subtle feature patterns in data signals. The backpropagation algorithm is an efficient mechanism for optimizing the internal connection weights of a neural network. It calculates the error between the predicted output and the true label and propagates this error back layer by layer from the output layer to the input layer, thereby guiding the update of each connection weight, making the model's predicted output continuously approach the true situation. Then, the training set data is normalized, that is, the feature values of all data samples are scaled to a uniform range through a linear transformation.
[0059] Normalization is performed because the original voltage values of different channels in the data signal may differ by orders of magnitude. Normalization eliminates this dimensionality effect, preventing certain features from dominating the model training process simply because of their large values, thereby accelerating the model's convergence process and improving training stability. Finally, the normalized sample set data is used to train the constructed backpropagation network model. Through an iterative process of forward propagation to calculate predicted values, calculating the loss function, and backpropagation to update weights, the model's internal parameters are continuously optimized. Ultimately, a static decoding model that has learned a stable mapping relationship on the training set and has good performance is obtained, serving as a benchmark reference model in the subsequent adaptive adjustment process.
[0060] In another preferred embodiment, the process of constructing the loss function in S13 is as follows:
[0061] S31, perform deep clustering on the second target data block set and the second non-target data block set respectively to obtain the target class cluster center Q' and the non-target class cluster center F';
[0062] S32, Select any independent data block and calculate the distance value between the independent data block and the target class cluster center Q and the target class cluster center Q' respectively, and obtain the probability value W of the independent data block corresponding to the target class Q and the target class Q' based on the distance value;
[0063] According to the calculation formula The loss parameter LOSS_ is calculated.kl Where N is the number of all independent data blocks, W'i is the probability value of the i-th independent data block corresponding to the target class Q', and Wi is the probability value of the i-th independent data block corresponding to the target class Q.
[0064] S33, repeat S32 to obtain the probability values W of non-target class F and non-target class F' corresponding to the independent data block. Compare the probability values of target class Q and non-target class F of the independent data block, and take the one with the largest probability value as the category of the independent data block to obtain the first category of the independent data block. Similarly, compare the probability values of target class Q' and non-target class F' of the independent data block to obtain the second category of the independent data block. If the first category and the second category of the independent data block are not the same, then the independent data block is marked as an abnormal data block.
[0065] According to the calculation formula The loss parameter LOSS_ is calculated. jl , where m is the number of abnormal data blocks;
[0066] S34, according to the loss parameter LOSS_ kl and loss parameter LOSS_ jl Construct the loss function LOSS, LOSS = b × LOSS_ kl +d×LOSS_ jl , where b and d are preset coefficients.
[0067] The second target data block set and the second non-target data block set obtained from the real-time data classification are subjected to deep clustering again. Deep clustering extracts high-level nonlinear features of the data through neural networks and groups them in the feature space, thereby obtaining two cluster centers that represent the latest data distribution, namely the current target class cluster center Q' and the current non-target class cluster center F'. This step is to extract the most essential category features in the current state from the latest data division, so as to provide an accurate representation of the current state for subsequent comparison with historical benchmarks.
[0068] Next, a random independent data block is selected, and its distance to the historical target class cluster center Q and the current target class cluster center Q' are calculated. Distance reflects the similarity between the data point and the class core; the closer the distance, the higher the similarity. Based on the calculated two distance values, the probability values W of the data block belonging to the historical target class Q and the current target class Q' are obtained using the t-distribution probability transformation formula. The t-distribution probability function can map the distance to a soft probability value, which has the advantage of being insensitive to outliers, making the probability estimation more robust. Subsequently, based on the two probability values calculated for all data blocks, a loss parameter LOSS_ is calculated using the KL divergence formula. klKL divergence is used to measure the degree of difference between two probability distributions, thereby quantifying the overall difference between "the probability distribution of the current data block belonging to the historical target class" and "the probability distribution of the current data block belonging to the current target class". The larger the difference value, the more significant the drift of the data distribution characteristics.
[0069] Repeat the above process for non-target classes, calculating the probability values of the same data block belonging to the historical non-target class F and the current non-target class F', and classifying the data block twice based on the historical cluster centers (Q and F) and the current cluster centers (Q' and F'), obtaining two class labels (first class and second class); compare these two class labels, and if they are inconsistent, mark the data block as an outlier, because a data point obtaining different results in two independent classifications based on the historical baseline and the current state indicates that the features of the data point may be in a fuzzy boundary region or severely affected by noise, and its classification result is unreliable; count the number m of all outlier data blocks, and calculate another loss parameter LOSS_ accordingly. jl This loss parameter directly reflects the number of outliers with high classification uncertainty in the current dataset.
[0070] It is understandable to use LOSS_ alone. kl (Distribution difference loss) can effectively capture the overall drift trend of data features, ensuring that the model's learning direction is towards adapting to the new data distribution, but it may be sensitive to local noise and outliers. LOSS_ jl The classification consistency loss acts as both a "noise filter" and a "stability constraint." It focuses on outliers with uncertain classification results, penalizing the number of outliers to prevent the model from overfitting to potentially problematic data during adjustments, thus maintaining the model's generalization ability and robustness. Combining these two loss functions in a weighted manner, the resulting joint loss function LOSS can simultaneously address two major objectives: firstly, it accurately tracks and adapts to changes in the overall data distribution (through LOSS_ kl On the other hand, it robustly resists interference from local noise and outliers (through LOSS_ jl Ultimately, the adaptive correction process of the model is no longer simply fitting new data, but achieves the best balance between "absorbing effective new information" and "maintaining its own stability," thereby driving the model to evolve in a more accurate and reliable direction, ensuring that rehabilitation decoding tasks can be carried out in a long-term, stable and efficient manner.
[0071] In another preferred embodiment, step S13 further includes calculating the offset value between the target cluster center Q' and the target cluster center Q. If the offset value is less than or equal to a preset offset threshold, the motion decoding model is not modified.
[0072] Data signals are susceptible to noise. Small deviations may be caused by noise rather than changes in the actual state. If the cluster center deviation does not exceed the threshold, and is due to random noise or small state fluctuations, the model correction process is skipped to reduce the computational overhead of backpropagation and parameter updates, thereby improving system efficiency. At the same time, the model's ability to generalize to historical data is preserved, and the model is only corrected when the deviation is significant. This approach utilizes the experience of historical data while adapting to new features, thus improving the model's adaptability to dynamic signals.
[0073] In another preferred embodiment, step S31 further includes obtaining the probability values of the target class and non-target class corresponding to any independent data block in the second target data block set, calculating the absolute value of the difference between the target class probability value and the non-target class probability value, and removing the independent data block from the second target data block set if the absolute value of the difference is less than or equal to a preset filtering threshold.
[0074] It is understandable that if the absolute value of the difference is less than or equal to the preset screening threshold, then the independent data block is identified as being caused by signal noise, artifacts, or state fluctuations. Therefore, its classification result has high uncertainty. Removing it can reduce the interference of noise on the cluster center and loss function, improve the stability of the model, retain independent data blocks with large probability differences, so that the model can focus on learning features with high discriminative power, avoid being misled by fuzzy samples, and enhance its adaptability to dynamic changes in data signals.
[0075] In another preferred embodiment, step S2, which involves inputting the data signal corresponding to the current independent data block into the motion decoding model for motion decoding, further includes preprocessing the data signal. The specific preprocessing process is as follows:
[0076] The data signal is amplified by an amplifier, then filtered, and finally denoised using wavelet transform.
[0077] The foregoing has provided a detailed description of one embodiment of the present invention, but this description is merely a preferred embodiment and should not be construed as limiting the scope of the invention. All equivalent variations and modifications made within the scope of the claims of this invention should still fall within the patent coverage of this invention.
Claims
1. A neural patient rehabilitation training method based on task training and brain-computer interaction, characterized in that, The method comprises the following steps: S1, obtaining a training task of a patient in current rehabilitation training, and determining a corresponding motion decoding model based on the training task; S2, collecting data signals of the patient in real time during the current rehabilitation training, and segmenting the data signals according to a preset time window to obtain a plurality of independent data blocks, performing frequency domain conversion on any independent data block, and extracting time-frequency features of the independent data block, calculating the KL divergence between adjacent independent data blocks according to the time-frequency features; If the KL divergence between any adjacent independent data blocks is less than a preset threshold, the data signals corresponding to the current independent data block are input into the motion decoding model for motion decoding to obtain a motion action, and a target operation of a rehabilitation device is determined according to the motion action; S3, if the KL divergence between any adjacent independent data blocks is greater than or equal to the preset threshold, data signals of the patient in historical rehabilitation training are obtained, and the motion decoding model is modified, the patient is motion decoded according to the modified motion decoding model to obtain a motion action, and a target operation of a rehabilitation device is determined according to the motion action; The specific process of modifying the motion decoding model is as follows: S11, obtaining data signals of the patient in historical rehabilitation training, and segmenting the data signals according to a preset time window to obtain a plurality of historical independent data blocks; each historical independent data block is preliminarily classified by using a preset static decoding model to obtain a target data block set and a non-target data block set, and the target data block set and the non-target data block set are respectively subjected to deep clustering to obtain a target class clustering center Q and a non-target class clustering center F; S12, taking the current time window as the beginning of a preset observation period H, obtaining data signals of the patient in rehabilitation training within the observation period, and segmenting the data signals according to a preset time window to obtain a plurality of independent data blocks and generate a reference data block set, selecting any reference data block and calculating the distance values of the reference data block from the target class clustering center Q and the non-target class clustering center F, respectively, obtaining the probability values of the reference data block corresponding to the target class and the non-target class based on the distance values through t-distribution probability, and comparing the probability values of the target class and the non-target class to take the probability value with the maximum as the class of the reference data block; The class is a target data block and a non-target data block; S13, obtaining a second target data block set and a second non-target data block set according to the class of the reference data block, constructing a loss function according to the second target data block set and the second non-target data block set, and performing back propagation on the motion decoding model according to the loss function to obtain a modified motion decoding model; The process of constructing the loss function is as follows: S31, respectively performing deep clustering on the second target data block set and the second non-target data block set to obtain a target class clustering center Q' and a non-target class clustering center F'; S32, selecting any independent data block and calculating the distance values of the independent data block from the target class clustering center Q and the target class clustering center Q', respectively, and obtaining the probability values W of the independent data block corresponding to the target class Q and the target class Q' based on the distance values; According to the calculation formula The loss parameter LOSS_kl is calculated; wherein N is the number of all independent data blocks, W'i is the probability value of the target class Q' corresponding to the i-th independent data block, and Wi is the probability value of the target class Q corresponding to the i-th independent data block. S33, repeating S32 to obtain the probability values W of the independent data block corresponding to the non-target class F and the non-target class F', comparing the probability values of the target class Q and the non-target class F of the independent data block, and taking the probability value with the maximum value as the category of the independent data block to obtain the first category of the independent data block; similarly, comparing the probability values of the target class Q' and the non-target class F' of the independent data block to obtain the second category of the independent data block, and if the first category and the second category corresponding to the independent data block are not the same, the independent data block is marked as an abnormal data block; According to the calculation formula The loss parameter LOSS_jl is calculated, where m is the number of abnormal data blocks. S34, constructing a loss function LOSS according to the loss parameter LOSS_kl and the loss parameter LOSS_jl, LOSS=b×LOSS_kl+d×LOSS_jl, wherein b and d are preset coefficients. 2.The neural patient rehabilitation training method based on task training and brain-computer interaction according to claim 1, wherein, In S2, the specific calculation process of KL divergence is as follows: For each independent data block, frequency domain conversion is performed and time-frequency features are extracted to obtain a characteristic value range, the characteristic value range is divided into several intervals by histogram binning, the frequency of occurrence of the characteristic values in each interval is counted as a probability, the characteristic distribution of the previous data block is taken as a reference distribution, the characteristic distribution of the current data block is taken as a to-be-compared distribution, the probability value of the reference distribution is taken as a weight to multiply the natural logarithm of the probability ratio of the reference distribution and the current distribution, and the calculation results of all intervals are accumulated to obtain the K-L divergence value. 3.The neural patient rehabilitation training method based on task training and brain-computer interaction according to claim 1, wherein, In S11, the acquisition process of the preset static decoding model is as follows: Obtain training set data, the training set data including a sample set and a training label, construct a back propagation network model and set training parameters; normalize the training set data; train the back propagation network model using the training set data to obtain a trained static decoding model.
4. The neural patient rehabilitation training method based on task training and brain-computer interaction according to claim 1, characterized in that, In S13, it further includes calculating the offset value of the target class clustering center Q' and the target class clustering center Q, and if the offset value is less than or equal to a preset offset threshold, the motion decoding model is not modified.
5. The neural patient rehabilitation training method based on task training and brain-computer interaction according to claim 1, characterized in that, In S31, it further includes obtaining the probability values of the target class and the non-target class corresponding to any independent data block in the second target data block set, calculating the absolute value of the difference between the target class probability value and the non-target class probability value, and if the absolute value of the difference is less than or equal to a preset screening threshold, the independent data block is removed from the second target data block set.
6. The neural patient rehabilitation training method based on task training and brain-computer interaction according to claim 1, characterized in that, In S2, the data signal corresponding to the current independent data block is input into the motion decoding model for motion decoding, and the specific process of the pre-processing of the data signal is as follows: The data signal is amplified by an amplifier, the amplified data signal is filtered, and the filtered data signal is denoised based on wavelet transform.
Citation Information
Patent Citations
Electroencephalogram signal decoding method, device, equipment and medium
CN119848673A
Musculoskeletal disease risk assessment and early warning method and system based on multi-source data
CN120256880A