Transcranial direct current stimulation data analysis method based on electroencephalogram signal processing
By using CNN and tree models to screen key features in EEG signal processing, and using SVM to establish a benchmark model to generate personalized transcranial DC stimulation parameters, the problem of excessive features in EEG signal processing is solved, the efficiency and accuracy of the model are improved, and personalized stroke rehabilitation conditioning is achieved.
Patent Information
- Application Number
- CN202411966446.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-03-04
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, EEG signal processing contains a large number of unnecessary features, resulting in increased computational complexity and decreased model performance, making it difficult to effectively use in stroke rehabilitation conditioning.
The transcranial DC stimulation data analysis method based on EEG signal processing was adopted, and signal classification and feature extraction were performed through CNN, combined with the tree model's feature importance evaluation, a key subset of features related to stroke rehabilitation was screened, and a benchmark model was established using SVM to generate personalized transcranial DC stimulation parameters.
Signal processing efficiency and accuracy are significantly improved, data dimensions are reduced, overfitting risks are reduced, model generalization ability is improved, and personalized conditioning parameters are generated that are more in line with the actual needs of patients.
Smart Images

Figure CN119548155A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electroencephalogram (EEG) signal processing and analysis, and in particular to a transcranial direct current stimulation (DCS) data analysis method based on EEG signal processing. Background Art
[0002] Stroke is a disease associated with sudden focal or systemic neurological dysfunction, with symptoms lasting more than 24 hours, and is one of the main causes of disability and death in humans. In my country, the overall lifetime risk of stroke is as high as 39.9%. After a stroke, more than 80% of patients will experience acute functional impairment, and more than 50% of patients will have long-term functional impairment, which imposes a huge economic burden on families and society. Therefore, rehabilitation and conditioning after stroke is particularly important. EEG signals are weak electrical signals generated when the brain is active, and these signals contain rich information about neural activity. By real-time monitoring and analysis of EEG signals, the patient's brain activity state can be understood, providing a strong basis for formulating personalized rehabilitation plans.
[0003] In the existing technology, EEG signals contain a large number of features, such as amplitude, frequency, phase, etc., but not all features are useful for subsequent classification or prediction tasks. Too many features will not only increase the computational complexity, but may also introduce noise and affect the performance of the model. Summary of the invention
[0004] In view of the shortcomings of the prior art, the present invention provides a transcranial direct current stimulation data analysis method based on electroencephalogram signal processing.
[0005] The technical solution adopted by the present invention to solve the above technical problems is:
[0006] A method for analyzing transcranial direct current stimulation data based on electroencephalogram signal processing comprises the following steps:
[0007] S1: EEG signal acquisition: The patient wears an EEG channel sensor, which monitors the patient's EEG signals in real time. The acquired signals include time domain features such as frequency and amplitude;
[0008] S2: Signal transmission and conversion: extract the time domain features of the EEG signal, perform high-pass and low-pass filtering and signal amplification on the collected EEG signal, and perform A / D conversion on the processed EEG signal;
[0009] S3: Signal processing: Use CNN to classify the converted signals into continuous signals and discrete signals. After classification, different methods are used to perform imaging, image filtering, and feature extraction operations on different signals.
[0010] S4: Feature selection: Extract key features related to stroke rehabilitation from the features obtained in S3, define different categories according to stroke type (such as ischemic stroke, hemorrhagic stroke), rehabilitation stage (such as acute stage, recovery stage, sequelae stage) or patient group (such as age, gender, complications, etc.), apply feature importance evaluation based on tree model, evaluate the predictive ability of each feature for a specific category, and screen out feature subsets related to stroke rehabilitation;
[0011] S5: Model training and prediction: Based on the feature subset screened in S4, a benchmark model is established using SVM, and the benchmark model predicts the patient's stroke recovery status and transcranial direct current stimulation conditioning parameters based on the input feature data;
[0012] S6: Transcranial direct current stimulation parameter adjustment: Compare the user's EEG signal characteristics with the benchmark model, and generate personalized transcranial direct current stimulation conditioning parameters according to the comparison results, including voltage, current, frequency, pulse width, etc. The control module adjusts the stimulation parameters of the transcranial direct current stimulation electrode according to the generated personalized conditioning parameters;
[0013] S7: Real-time monitoring and feedback: During the conditioning process, the patient's EEG signal changes are monitored in real time, and the transcranial direct current stimulation parameters are adjusted in time according to the real-time monitoring results to ensure the accuracy and safety of the conditioning;
[0014] S8: Data analysis and evaluation: Analyze the data collected during the conditioning process, evaluate the conditioning effect and the optimization effect of the transcranial direct current stimulation parameters, and continuously iterate and optimize the prediction model and transcranial direct current stimulation parameter adjustment strategy based on the evaluation results.
[0015] The above technical solution further includes:
[0016] Furthermore, in S2, the time domain characteristics of the EEG signal include frequency, amplitude, and input and output signal values. The frequency of the EEG signal reflects the speed of brain activity. Usually, EEG signals can be divided into different frequency bands, such as delta (1-3Hz), theta (4-7Hz), alpha (8-12Hz), beta (13-30Hz) and gamma (>30Hz), etc. The amplitude represents the strength or voltage of the EEG signal, and the amplitude is related to the discharge intensity of neurons. The input and output signal values are the original values of the signal or the values after some preprocessing.
[0017] Furthermore, in S3, CNN is used to classify the signals into continuous signals and discrete signals. After classification, different signals are imaged, image filtered, and feature extracted in different ways, and the function results are recorded as y(t) or y[n];
[0018] The basic mathematical expression of y(t) or y[n] is:
[0019]
[0020] Among them, f(t) and g(t) are the time-varying functions of EEG signals, * is the convolution operator, τ is the integral variable, x[n] and h[n] are both EEG signal functions, which are characterized as discrete functions, and m is the cumulative variable, whose value varies according to different data results.
[0021] Furthermore, in S4, the specific steps of extracting key features related to stroke rehabilitation from the features obtained in S3 are as follows:
[0022] Feature collection: collect features obtained from S3 to form a feature set;
[0023] Define different categories: Define categories in the feature set, and divide patients into different categories according to different types of stroke (such as ischemic stroke, hemorrhagic stroke); divide patients into different rehabilitation stages according to their rehabilitation process, such as the acute stage, recovery stage, sequelae stage, etc.; divide patients into different groups according to factors such as their age, gender, and medical history.
[0024] Feature importance evaluation based on tree model: The decision tree model is trained using the extracted features and defined category labels, and the decision tree Gini index is used to evaluate the predictive ability of each feature for a specific category. The decision tree Gini index is expressed as Where D is the feature set, k is the number of categories, and p i is the probability of category i;
[0025] Screening feature subsets: Based on the feature importance evaluation results, screen out feature subsets related to stroke rehabilitation.
[0026] Furthermore, when defining different categories, if the number of samples in some categories is much less than that in other categories, the following steps are used for evaluation and data processing:
[0027] Evaluate data imbalance: Check whether the number of samples in each category in the data set is balanced. The degree of imbalance can be evaluated by counting the number of samples in each category, such as calculating the ratio of the number of samples in the majority class to the number of samples in the minority class. If the number of samples in some categories is much smaller than that in other categories, there is a data imbalance problem.
[0028] Data processing: Use the SMOTE algorithm to generate new minority class samples.
[0029] Furthermore, the specific steps of using the SMOTE algorithm to generate new minority class samples are:
[0030] Determine K value: Choose an appropriate K value for the K nearest neighbor algorithm to find the nearest neighbors of each minority class sample.
[0031] Generate new samples: For each minority class sample, randomly select one or more samples from its K nearest neighbors, and generate new sample points on the line between these samples and the original samples. The generation formula of the new sample is X(new)=x+rand(0,1)*(x'-x), where x is the original minority class sample, x′ is its nearest neighbor sample, and rand(0,1) is a random number between 0 and 1.
[0032] Furthermore, in defining different categories, it is checked whether there is overlap between the features of different categories, and the overlapped features detected are fused, including the following steps:
[0033] Identify feature overlap: Check whether there is overlap between features of different categories by calculating the Pearson correlation coefficient between the features. If the Pearson correlation coefficient is high, it indicates that there is overlap between the features. The Pearson correlation coefficient is expressed as Among them, x i and i are the i-th observation values of the two features, and are the means of the two features, respectively, and n is the number of observations;
[0034] Feature fusion: The overlapping features detected are fused through PCA.
[0035] Furthermore, the specific steps for fusing the detected overlapping features through PCA are as follows:
[0036] Construct feature matrix: Construct the identified overlapping features into a feature matrix X, where each row represents a sample and each column represents a feature;
[0037] Standardized feature matrix: Standardize the feature matrix X so that the mean of each feature is 0 and the variance is 1. The standardization formula is: Where Z is the standardized feature matrix, X is the original feature matrix, μ is the mean vector of the feature, and σ is the standard deviation vector of the feature;
[0038] Calculate the covariance matrix: Calculate the covariance matrix C of the standardized feature matrix Z. The covariance matrix reflects the correlation between features. The calculation formula of the covariance matrix is Where n is the number of samples, Z T is the transposed matrix of Z;
[0039] Calculate eigenvalues and eigenvectors: Perform eigendecomposition on the covariance matrix C to obtain the eigenvalue λ and the corresponding eigenvector v. The eigenvalue λ represents the variance explained by each principal component, and the eigenvector v represents the direction of each principal component in the original feature space.
[0040] Select principal components: According to the size of the eigenvalues, select the eigenvectors corresponding to the first k largest eigenvalues. The eigenvectors constitute a new feature space. Usually, the selection of k can be determined according to the cumulative contribution rate of the eigenvalues (i.e., the ratio of the sum of the first k eigenvalues to the sum of the total eigenvalues);
[0041] Construct the fused feature vector: Project the original feature matrix X onto the new feature space to obtain the fused feature vector. Specifically, for each sample, perform matrix multiplication between its original feature vector and the selected feature vector to obtain the representation of the sample in the new feature space (i.e., the fused feature vector).
[0042] Furthermore, the feature subset selected in S4 is transmitted to the benchmark model for data fitting and model training. SVM finds the optimal decision boundary according to the data characteristics and calls the corresponding kernel function to calculate the preliminary image model. The SVM decision function is where a i is the coefficient of the support vector, y i is a label, K(x i ,x) is the kernel function, b is the bias term. In the process of continuously adding new measured data and multiple model fitting, SVM adjusts its model in real time, so that the longer the model is applied, the more it conforms to the actual situation.
[0043] The present invention has the following beneficial effects:
[0044] In the present invention, CNN is used to classify EEG signals into continuous signals and discrete signals, as well as to perform imaging, image filtering and feature extraction operations, which significantly improves the efficiency and accuracy of signal processing. The feature selection stage uses a feature importance evaluation based on a tree model, which can quickly screen out the feature subsets that have the greatest impact on subsequent predictions, thereby reducing the data dimension, reducing the risk of overfitting, and improving the generalization ability of the model. Based on the screened feature subset, a benchmark model is established using SVM, and the accuracy and predictive ability of the model are significantly improved. By comparing the patient's EEG signal characteristics with the benchmark model, personalized transcranial direct current stimulation parameter conditioning parameters that better meet the patient's actual needs can be generated. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 This is a step diagram of a transcranial direct current stimulation data analysis method based on EEG signal processing proposed by the present invention. DETAILED DESCRIPTION
[0046] The technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings and specific embodiments.
[0047] like Figure 1 As shown, the present invention is a transcranial direct current stimulation data analysis method based on EEG signal processing, comprising the following steps:
[0048] S1: EEG signal acquisition: The patient wears an EEG channel sensor, which monitors the patient's EEG signals in real time. The acquired signals include time domain features such as frequency and amplitude;
[0049] S2: Signal transmission and conversion: extract the time domain features of the EEG signal, perform high-pass and low-pass filtering and signal amplification on the collected EEG signal, and perform A / D conversion on the processed EEG signal;
[0050] S3: Signal processing: Use CNN to classify the converted signals into continuous signals and discrete signals. After classification, different methods are used to perform imaging, image filtering, and feature extraction operations on different signals.
[0051] S4: Feature selection: Extract key features related to stroke rehabilitation from the features obtained in S3, define different categories according to stroke type (such as ischemic stroke, hemorrhagic stroke), rehabilitation stage (such as acute stage, recovery stage, sequelae stage) or patient group (such as age, gender, complications, etc.), apply feature importance evaluation based on tree model, evaluate the predictive ability of each feature for a specific category, and screen out feature subsets related to stroke rehabilitation;
[0052] S5: Model training and prediction: Based on the feature subset screened in S4, a benchmark model is established using SVM, and the benchmark model predicts the patient's stroke recovery status and transcranial direct current stimulation conditioning parameters based on the input feature data;
[0053] S6: Transcranial direct current stimulation parameter adjustment: Compare the user's EEG signal characteristics with the benchmark model, and generate personalized transcranial direct current stimulation conditioning parameters according to the comparison results, including voltage, current, frequency, pulse width, etc. The control module adjusts the stimulation parameters of the transcranial direct current stimulation electrode according to the generated personalized conditioning parameters;
[0054] S7: Real-time monitoring and feedback: During the conditioning process, the patient's EEG signal changes are monitored in real time, and the transcranial direct current stimulation parameters are adjusted in time according to the real-time monitoring results to ensure the accuracy and safety of the conditioning;
[0055] S8: Data analysis and evaluation: Analyze the data collected during the conditioning process, evaluate the conditioning effect and the optimization effect of the transcranial direct current stimulation parameters, and continuously iterate and optimize the prediction model and transcranial direct current stimulation parameter adjustment strategy based on the evaluation results.
[0056] In one embodiment, for the above-mentioned S2, in S2, the time domain characteristics of the EEG signal include frequency, amplitude, and input and output signal values. The frequency of the EEG signal reflects the speed of brain activity. Usually, EEG signals can be divided into different frequency bands, such as delta (1-3Hz), theta (4-7Hz), alpha (8-12Hz), beta (13-30Hz) and gamma (>30Hz), etc. The amplitude indicates the strength or voltage of the EEG signal, and the amplitude is related to the discharge intensity of neurons. The input and output signal values are the original values of the signal or the values after some preprocessing.
[0057] The brain wave frequency of a large number of healthy people is measured, and their original brain wave data is recorded. After the above signal filtering and amplification, the data is corrected to F = μ0*(F0+δ0), where μ0 and δ0 are the data amplification factor and the error value before and after signal filtering, respectively, and δ0 can be read from the instrument;
[0058] By increasing the number of measurements, a series of data on the brain wave frequency of healthy people is obtained and recorded as F n , find its average level as the nominal value of brain wave frequency
[0059] The original value of the brain wave frequency of the measured object is f0. After the above signal processing, the data is corrected to f=μ0*(f0+δ), where δ is the error value before and after filtering of each measurement data, which is read from the instrument;
[0060] After multiple measurements of the user, a set of brain wave data is obtained and recorded as f i , the relative deviation SDF from the nominal value can be calculated using the following calculation method:
[0061] Where n is the number of data points and p is the number of fitted model parameters.
[0062] In one embodiment, for the above S3, in S3, CNN is used to classify the signal into continuous signal and discrete signal, and after classification, different methods are used to perform imaging, image filtering, and feature extraction operations on different signals, and the obtained function result is recorded as y(t) or y[n];
[0063] The basic mathematical expression of y(t) or y[n] is:
[0064]
[0065] Among them, f(t) and g(t) are the time-varying functions of EEG signals, * is the convolution operator, τ is the integral variable, x[n] and h[n] are both EEG signal functions, which are characterized as discrete functions, and m is the cumulative variable, whose value varies according to different data results.
[0066] In one embodiment, for the above S4, in S4, the specific steps of extracting key features related to stroke rehabilitation from the features obtained in S3 are:
[0067] Feature collection: collect features obtained from S3 to form a feature set;
[0068] Define different categories: Define categories in the feature set, and divide patients into different categories according to different types of stroke (such as ischemic stroke, hemorrhagic stroke); divide patients into different rehabilitation stages according to their rehabilitation process, such as the acute stage, recovery stage, sequelae stage, etc.; divide patients into different groups according to factors such as their age, gender, and medical history.
[0069] Feature importance evaluation based on tree model: The decision tree model is trained using the extracted features and defined category labels, and the decision tree Gini index is used to evaluate the predictive ability of each feature for a specific category. The decision tree Gini index is expressed as Where D is the feature set, k is the number of categories, and p i is the probability of category i;
[0070] Screening feature subsets: Based on the feature importance evaluation results, screen out feature subsets related to stroke rehabilitation.
[0071] In one embodiment, for the above-mentioned definition of different categories, if the number of samples of some categories is much less than that of other categories, the following steps are used for evaluation and data processing:
[0072] Evaluate data imbalance: Check whether the number of samples in each category in the data set is balanced. The degree of imbalance can be evaluated by counting the number of samples in each category, such as calculating the ratio of the number of samples in the majority class to the number of samples in the minority class. If the number of samples in some categories is much smaller than that in other categories, there is a data imbalance problem.
[0073] Data processing: Use the SMOTE algorithm to generate new minority class samples.
[0074] In one embodiment, for the above data processing, the specific steps of using the SMOTE algorithm to generate new minority class samples are:
[0075] Determine K value: Choose an appropriate K value for the K nearest neighbor algorithm to find the nearest neighbors of each minority class sample.
[0076] Generate new samples: For each minority class sample, randomly select one or more samples from its K nearest neighbors, and generate new sample points on the line between these samples and the original samples. The generation formula of the new sample is X(new)=x+rand(0,1)*(x'-x), where x is the original minority class sample, x′ is its nearest neighbor sample, and rand(0,1) is a random number between 0 and 1.
[0077] In one embodiment, for the above-mentioned definition of different categories, in the definition of different categories, checking whether there is overlap between features of different categories, and fusing the checked overlapping features, including the following steps:
[0078] Identify feature overlap: Check whether there is overlap between features of different categories by calculating the Pearson correlation coefficient between the features. If the Pearson correlation coefficient is high, it indicates that there is overlap between the features. The Pearson correlation coefficient is expressed as Among them, x i and i are the i-th observation values of the two features, and are the means of the two features, respectively, and n is the number of observations;
[0079] Feature fusion: The overlapping features detected are fused through PCA.
[0080] In one embodiment, for the above feature fusion, the specific steps of fusing the detected overlapping features through PCA are as follows:
[0081] Construct feature matrix: Construct the identified overlapping features into a feature matrix X, where each row represents a sample and each column represents a feature;
[0082] Standardized feature matrix: Standardize the feature matrix X so that the mean of each feature is 0 and the variance is 1. The standardization formula is: Where Z is the standardized feature matrix, X is the original feature matrix, μ is the mean vector of the feature, and σ is the standard deviation vector of the feature;
[0083] Calculate the covariance matrix: Calculate the covariance matrix C of the standardized feature matrix Z. The covariance matrix reflects the correlation between features. The calculation formula of the covariance matrix is Where n is the number of samples, Z T is the transposed matrix of Z;
[0084] Calculate eigenvalues and eigenvectors: Perform eigendecomposition on the covariance matrix C to obtain the eigenvalue λ and the corresponding eigenvector v. The eigenvalue λ represents the variance explained by each principal component, and the eigenvector v represents the direction of each principal component in the original feature space.
[0085] Select principal components: According to the size of the eigenvalues, select the eigenvectors corresponding to the first k largest eigenvalues. The eigenvectors constitute a new feature space. Usually, the selection of k can be determined according to the cumulative contribution rate of the eigenvalues (i.e., the ratio of the sum of the first k eigenvalues to the sum of the total eigenvalues);
[0086] Construct the fused feature vector: Project the original feature matrix X onto the new feature space to obtain the fused feature vector. Specifically, for each sample, perform matrix multiplication between its original feature vector and the selected feature vector to obtain the representation of the sample in the new feature space (i.e., the fused feature vector).
[0087] In one embodiment, for the above model training and prediction, the feature subset selected in S4 is transmitted to the benchmark model for data fitting and model training. SVM finds the optimal decision boundary according to the data characteristics and calls the corresponding kernel function to calculate the preliminary image model. The SVM decision function is where a i is the coefficient of the support vector, y i is a label, K(x i ,x) is the kernel function, b is the bias term. In the process of continuously adding new measured data and multiple model fitting, SVM adjusts its model in real time, so that the longer the model is applied, the more it conforms to the actual situation.
[0088] Suppose we have a dataset of 100 patients, 50 of whom received tDCS conditioning and recovered, and 50 of whom did not receive conditioning or the conditioning was ineffective. We can use the SVM algorithm to build a prediction model, using the extracted EEG features (such as the power spectral density of the alpha band) as input features and the stroke recovery status as the output label.
[0089] Although the preferred embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications and substitutions may be made to these embodiments without departing from the principles and spirit of the present invention, and the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A transcranial direct current stimulation data analysis method based on electroencephalogram signal processing, characterized in that: The following steps are involved: S1: EEG signal acquisition: The patient wears an EEG channel sensor, which monitors the patient's EEG signals in real time; S2: Signal transmission and conversion: extract the time domain features of the EEG signal, perform high-pass and low-pass filtering and signal amplification on the collected EEG signal, and perform A / D conversion on the processed EEG signal; S3: Signal processing: Use CNN to classify the converted signals into continuous signals and discrete signals. After classification, different methods are used to perform imaging, image filtering, and feature extraction operations on different signals. S4 : Feature selection: Extract key features related to stroke rehabilitation from the features obtained in S3, define different categories according to stroke type, rehabilitation stage or patient group, apply feature importance evaluation based on tree model to evaluate the predictive ability of each feature for a specific category, and screen out feature subsets related to stroke rehabilitation; S5: Model training and prediction: Based on the feature subset screened in S4, a benchmark model is established using SVM, and the benchmark model predicts the patient's stroke recovery status and transcranial direct current stimulation conditioning parameters based on the input feature data; S6: Transcranial direct current stimulation parameter adjustment: comparing the user's EEG signal characteristics with the benchmark model, generating personalized transcranial direct current stimulation conditioning parameters according to the comparison results, and the control module adjusting the stimulation parameters of the transcranial direct current stimulation electrode sheet according to the generated personalized conditioning parameters; S7: Real-time monitoring and feedback: During the conditioning process, the patient's EEG signal changes are monitored in real time, and the transcranial direct current stimulation parameters are adjusted in time according to the real-time monitoring results; S8: Data analysis and evaluation: Analyze the data collected during the conditioning process, evaluate the conditioning effect and the optimization effect of the transcranial direct current stimulation parameters, and continuously iterate and optimize the prediction model and transcranial direct current stimulation parameter adjustment strategy based on the evaluation results.
2. The method for analyzing transcranial direct current stimulation data based on electroencephalogram signal processing according to claim 1, characterized in that: In S2, the time domain characteristics of the EEG signal include frequency, amplitude, and input / output signal values. The frequency of the EEG signal reflects the speed of brain activity, the amplitude represents the strength or voltage of the EEG signal, and the input / output signal value is the original value of the signal or the value after some preprocessing.
3. The method for analyzing transcranial direct current stimulation data based on electroencephalogram signal processing according to claim 1, characterized in that: In S3, CNN is used to classify the signals into continuous signals and discrete signals. After classification, different signals are visualized, image filtered, and feature extracted in different ways, and the function results are recorded as y(t) or y[n]; The basic mathematical expression of y(t) or y[n] is: Among them, f(t) and g(t) are the time-varying functions of EEG signals, * is the convolution operator, τ is the integral variable, x[n] and h[n] are both EEG signal functions characterized by discrete functions, and m is the cumulative variable.
4. The method for analyzing transcranial direct current stimulation data based on electroencephalogram signal processing according to claim 1, characterized in that: In S4, the specific steps of extracting key features related to stroke rehabilitation from the features obtained in S3 are: Feature collection: collect features obtained from S3 to form a feature set; Define different categories: Define categories in the feature set, divide patients into different categories according to different types of stroke; divide patients into different rehabilitation stages and different groups according to their rehabilitation process; Feature importance evaluation based on tree model: The decision tree model is trained using the extracted features and defined category labels, and the decision tree Gini index is used to evaluate the predictive ability of each feature for a specific category. The decision tree Gini index is expressed as Where D is the feature set, k is the number of categories, and p i is the probability of category i; Screening feature subsets: Based on the feature importance evaluation results, screen out feature subsets related to stroke rehabilitation.
5. The method for analyzing transcranial direct current stimulation data based on electroencephalogram signal processing according to claim 4, characterized in that: When defining different categories, if the number of samples in some categories is much smaller than that in other categories, the following steps are used for evaluation and data processing: Evaluate data imbalance: Check whether the number of samples in each category in the data set is balanced, and evaluate the degree of imbalance by counting the number of samples in each category; Data processing: Use the SMOTE algorithm to generate new minority class samples.
6. The method for analyzing transcranial direct current stimulation data based on electroencephalogram signal processing according to claim 5, characterized in that: The specific steps to use the SMOTE algorithm to generate new minority class samples are: Determine the K value: Select an appropriate K value for the K nearest neighbor algorithm to find the nearest neighbors of each minority class sample; Generate new samples: For each minority class sample, randomly select one or more samples from its K nearest neighbors, and generate new sample points on the line between these samples and the original samples. The generation formula of the new sample is X(new)=x+rand(0,1)*(x'-x), where x is the original minority class sample, x′ is its nearest neighbor sample, and rand(0,1) is a random number between 0 and 1.
7. The method for analyzing transcranial direct current stimulation data based on electroencephalogram signal processing according to claim 4, characterized in that: When defining different categories, check whether there is overlap between the features of different categories, and fuse the overlapping features found. The following steps are involved: Identify feature overlap: Check whether there is overlap between features of different categories by calculating the Pearson correlation coefficient between the features. If the Pearson correlation coefficient is high, it indicates that there is overlap between the features. The Pearson correlation coefficient is expressed as Among them, x i and i are the i-th observation values of the two features, and are the means of the two features, respectively, and n is the number of observations; Feature fusion: The overlapping features detected are fused through PCA.
8. The method for analyzing transcranial direct current stimulation data based on electroencephalogram signal processing according to claim 7, characterized in that: The specific steps for fusing the detected overlapping features through PCA are as follows: Construct feature matrix: Construct the identified overlapping features into a feature matrix X, where each row represents a sample and each column represents a feature; Standardized feature matrix: Standardize the feature matrix X so that the mean of each feature is 0 and the variance is 1. The standardization formula is: Where Z is the standardized feature matrix, X is the original feature matrix, μ is the mean vector of the feature, and σ is the standard deviation vector of the feature; Calculate the covariance matrix: Calculate the covariance matrix C of the standardized feature matrix Z. The covariance matrix reflects the correlation between features. The calculation formula of the covariance matrix is Where n is the number of samples, Z T is the transposed matrix of Z; Calculate eigenvalues and eigenvectors: Perform eigendecomposition on the covariance matrix C to obtain the eigenvalue λ and the corresponding eigenvector v. The eigenvalue λ represents the variance explained by each principal component, and the eigenvector v represents the direction of each principal component in the original feature space. Select principal components: According to the size of the eigenvalues, select the eigenvectors corresponding to the first k largest eigenvalues, and the eigenvectors constitute a new feature space; Construct the fused feature vector: Project the original feature matrix X onto the new feature space to obtain the fused feature vector.
9. The method for analyzing transcranial direct current stimulation data based on electroencephalogram signal processing according to claim 1, characterized in that: The feature subset selected in S4 is transferred to the benchmark model for data fitting and model training. SVM finds the optimal decision boundary according to the data characteristics and calls the corresponding kernel function to calculate the preliminary image model. The SVM decision function is where a i is the coefficient of the support vector, y i is a label, K(x i ,x) is the kernel function, b is the bias term. In the process of continuously adding new measured data and multiple model fitting, SVM adjusts its model in real time, so that the longer the model is applied, the more it conforms to the actual situation.