Motor imagery eeg decoding method and device based on dynamic time window

By combining dynamic time windows and multi-band filtering with the sparse learning LASSO algorithm, the problems of individual differences and time-varying drift under the fixed time window strategy are solved, achieving more efficient motor imagery EEG decoding and improving decoding accuracy and robustness.

CN123047770APending Publication Date: 2026-11-06NANTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610364640.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-03-24
Publication Date
2026-11-06

AI Technical Summary

Technical Problem

In existing brain-computer interface systems for motor imagery, the fixed time window strategy is difficult to adapt to individual differences in neural response latency and changes in mental state, resulting in insufficient decoding accuracy and robustness.

Method used

A dynamic time window-based approach is adopted, which dynamically determines the optimal motion visualization time window through a bidirectional sliding search strategy. Combined with multi-band filtering and sparse learning LASSO algorithm, high-dimensional feature vectors are extracted and a support vector machine model is constructed to accurately locate task-related time periods.

Benefits of technology

It improves the accuracy and robustness of EEG decoding of motor imagery, enhances individual adaptability, and improves the ability to represent neural signal features and classify generalization performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123047770A_ABST
    Figure CN123047770A_ABST
Patent Text Reader

Abstract

This invention relates to a method and apparatus for decoding motor imagery EEG based on a dynamic time window. The method comprises the following steps: First, EEG data is acquired and an initial time window containing complete action cycles is preset. Correlation analysis is performed on the data within the initial time window using a dynamic time window module, and a bidirectional search strategy is employed to dynamically determine the optimal time window, addressing the problem that fixed time windows cannot adapt to individual differences and time-varying drift. Then, multi-band filtering is applied to the EEG data within the optimal time window, and spatial features are extracted using a co-space pattern algorithm to obtain high-dimensional feature vectors. Next, sparse feature selection is performed using the LASSO algorithm to retain the most discriminative feature subset. Finally, a recognition model is constructed using a support vector machine to achieve decoding of motor imagery EEG data. This invention accurately locates task-related time periods, enhances feature representation and classification generalization performance, and improves the accuracy, robustness, and individual adaptability of decoding.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of biomedical engineering and human-computer interaction, and in particular to a method and device for decoding motor imagery EEG based on dynamic time windows. Background Technology

[0002] Brain-computer interface (BCI) technology can establish a direct communication and control channel between the brain and external devices without relying on peripheral nerves and muscle tissue. Among them, brain-computer interfaces based on motor imagery are one of the most widely used paradigms, often used in stroke rehabilitation training and prosthetic limb control. Its core principle is that when a person imagines limb movement, the sensorimotor cortex on the opposite side of the brain shows a decrease in energy in a specific frequency band, i.e., event-related desynchronization.

[0003] However, existing brainwave decoding algorithms in motor imagery brain-computer interface systems generally employ a fixed time window strategy: data is extracted and processed within a fixed time period after the task prompt appears, but this method has obvious drawbacks:

[0004] (a) The latency of neural responses varies greatly among different users, and the event-related desynchronization phenomenon may appear several seconds after the prompt in some users; (ii) Even for the same subject, the activation time point will drift with changes in mental state and fatigue level in each trial. Summary of the Invention

[0005] In view of the shortcomings of the prior art, the purpose of the present invention is to provide a method and apparatus for decoding motor imagery EEG based on dynamic time windows, so as to solve one or more problems in the prior art.

[0006] To achieve the above objectives, the technical solution of the present invention is as follows: The EEG decoding method for motor imagery based on dynamic time windows includes the following steps: S1. Collect EEG data of the subject performing a motor imagery task using an EEG acquisition module, and preset an initial time window containing the complete movement cycle. , ]; S2. Based on the dynamic time window module, the initial time window is [ , Correlation analysis was performed on internal EEG data to determine the optimal time window for motor imagery. , ]; S3. Based on the EEG decoding module, perform filter bank spatial domain feature extraction on the EEG data within the optimal motor imagery time window to obtain a high-dimensional feature vector. S4. Based on the sparse learning LASSO algorithm in the EEG decoding module, feature selection is performed on high-dimensional EEG features to retain the most discriminative feature subset. S5. Use the support vector machine algorithm in the EEG decoding module to train and learn the corresponding categories of the selected feature set to build a motor imagery EEG recognition model for subsequent motor imagery EEG decoding.

[0007] Furthermore, determining the optimal motion visualization window in S2 includes the following steps: S21, Fixed time window endpoint, and based on preset step size Different new starting points are obtained by sliding backward from the initial time window, and the calculation formula is shown in the following formula:

[0008] In the formula: The initial moment of the original motion imagination, Imagine the starting moment for a new movement. The sliding step size, It is a constant; S22. Calculate the correlation matrix and mean of the sample data at different starting points, and select the time corresponding to the maximum mean as the optimal starting time. ; S23. Fix the determined optimal start time. And based on a preset time step Slide the time window forward to adjust the endpoint; the calculation formula is as follows:

[0009] In the formula: The moment when the original motion imagination ends. Imagine the end of a new sport. The sliding step size, It is a constant; S24. Calculate the correlation matrix and its mean of the sample data under different endpoints, and select the time corresponding to the maximum mean as the optimal end time. .

[0010] Furthermore, calculating the correlation and mean of the sample data in S22 and S24 to obtain the optimal moment includes the following steps: Based on the sliding motion imagery time window and the corresponding EEG data matrix, the correlation coefficient between different channels in the matrix is ​​defined; Obtain the correlation coefficient matrix and calculate its mean; The time corresponding to the maximum mean is selected as the optimal time.

[0011] Furthermore, the correlation coefficient of the channel EEG data is defined as follows:

[0012] In the formula: and The mean and standard deviation of the EEG data from each channel are represented. The number of sampling points is represented by A and B, which are the EEG channels contained in the corresponding EEG data matrix.

[0013] Furthermore, obtaining the high-dimensional feature vector in S3 includes the following steps: S31. Filter bank division, including wideband, Mu rhythm band, Beta rhythm band and several sub-bands of the two rhythm band; S32. Extract cosmic pattern features from the filtered EEG data of each frequency band; S33. Combine the EEG features of each frequency band to form a high-dimensional feature vector.

[0014] Furthermore, the sparse learning LASSO algorithm in S4 obtains the sparse regression coefficients by solving an optimization problem, as shown in the following formula:

[0015] In the formula: These are real category labels. These are the initial regression parameters. It is a D-dimensional eigenvector. These are hyperparameters that control sparsity. These are D-dimensional sparse regression coefficients. It is the number of training samples.

[0016] An EEG decoding device, wherein the device is applied to the above-described dynamic time-window-based motor imagery EEG decoding method, the device comprising: The EEG acquisition module is configured to collect EEG data in real time during the subject's performance of a motor imagery task; The dynamic time window module is configured to perform correlation analysis on EEG data to obtain the optimal time window for motor imagery. The EEG decoding module is configured to analyze EEG data within the optimal motor imagery window, extract sparse spatial EEG features, and identify and classify them. The human-computer interaction module is configured to provide prompts for motor imagery tasks and feedback on EEG decoding results.

[0017] Furthermore, the EEG decoding module includes a multi-band filtering unit, a spatial feature extraction unit, a sparse feature selection unit, and an SVM classification and recognition unit.

[0018] An electronic device includes: a processor, a memory, and a computer program; wherein the computer program is stored in the memory and configured to be executed by the processor to implement the above-described dynamic time-window-based motor imagery EEG decoding method.

[0019] A computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the above-described method for decoding motor imagery EEG based on dynamic time windows.

[0020] Compared with the prior art, the beneficial technical effects of the present invention are as follows: This invention employs a dynamic time window module to perform correlation analysis on EEG data within an initial time window, and uses a bidirectional search strategy to dynamically determine the optimal time window, solving the problem that fixed time windows are difficult to capture individual differences and time-varying drift. Based on this, it combines multi-band filtering units to divide frequency bands, uses a common spatial pattern algorithm to extract spatial features of each frequency band, and then uses the sparse learning LASSO algorithm for sparse selection to retain the most discriminative feature subset. Finally, a recognition model is constructed using a support vector machine to accurately locate task-related time periods, enhance the ability to represent neural signal features and improve classification generalization performance, comprehensively improving the accuracy, robustness, and individual adaptability of motor imagery EEG decoding. Attached Figure Description

[0021] Figure 1 This diagram illustrates the method flow of the motion imagery EEG decoding method and apparatus based on dynamic time windows according to an embodiment of the present invention.

[0022] Figure 2 The diagram shows the architecture of the various modules of the motion imagery EEG decoding method and apparatus based on dynamic time windows according to an embodiment of the present invention. Detailed Implementation

[0023] To make the objectives, technical solutions, and advantages of this invention clearer, the following detailed description of the motion imagery EEG decoding method and device based on dynamic time windows proposed by this invention, in conjunction with the accompanying drawings and specific embodiments, will provide a more detailed explanation. The advantages and features of this invention will become clearer from the following description. It should be noted that the accompanying drawings are in a very simplified form and use non-precise proportions, used only to facilitate and clearly illustrate the purpose of the embodiments of this invention. Please refer to the accompanying drawings to make the objectives, features, and advantages of this invention more apparent and understandable. It should be understood that the structures, proportions, sizes, etc., depicted in the accompanying drawings are only used to complement the content disclosed in the specification, for those skilled in the art to understand and read, and are not intended to limit the implementation conditions of this invention. Therefore, they have no substantial technical significance. Any modifications to the structure, changes in the proportional relationships, or adjustments to the size, without affecting the effects and objectives achieved by this invention, should still fall within the scope of the technical content disclosed in this invention.

[0024] Please refer to the following: Figure 1 The EEG decoding method for motor imagery based on dynamic time windows includes the following steps: S1. EEG data of the subject performing a motor imagery task is collected through the EEG acquisition module. The human-computer interaction module provides prompts for the current motor imagery task. The subject performs the motor imagery task according to the prompts. An initial time window containing a complete movement cycle is preset. , This provides a data foundation for determining the subsequent dynamic time window. The initial time window needs to cover the complete response cycle of the motor imagery task to ensure that the delayed response characteristics of different subjects can be captured.

[0025] S2. Based on the dynamic time window module, the initial time window is [ , Correlation analysis was performed on internal EEG data to determine the optimal time window for motor imagery. , By utilizing a dynamic time window module to perform correlation analysis on EEG data within the initial time window, and adjusting the start and end times of motor imagery respectively, the optimal time window for motor imagery is finally obtained. Specifically, the steps include the following: S21, Fixed time window endpoint, and based on preset step size Different new starting points are obtained by sliding backward from the initial time window, and the calculation formula is shown in Equation 1 below:

[0026] In the formula: The initial moment of the original motion imagination, Imagine the starting moment for a new movement. The sliding step size, It is a constant.

[0027] By fixing the end point of a time window and sliding the start time backward, the optimal starting point can be systematically searched, avoiding premature data extraction and missing key neural response information. The sliding step size needs to be set in a balance between temporal resolution and computational efficiency. Too small a step size will lead to a surge in computation, while too large a step size may cause the best starting time to be missed.

[0028] S22. Calculate the correlation matrix and mean of the sample data at different starting points, and select the time corresponding to the maximum mean as the optimal starting time. Specifically, the correlation and mean of the sample data are calculated to obtain the optimal starting point. Includes the following steps: Define the correlation coefficients between different channels in the matrix. The motion visualization window after sliding is [ , The corresponding EEG data is a matrix. (includes) (if there are 1 EEG channel), then the correlation coefficient between the EEG data of channel A and channel B is defined as shown in Equation 2 below:

[0029] In the formula: and The mean and standard deviation of the EEG data from each channel are represented. The number of sampling points is represented by A and B, which are the EEG channels contained in the corresponding EEG data matrix.

[0030] Furthermore, the correlation coefficient matrix is ​​obtained and its mean is calculated. For those containing... A matrix of EEG data from multiple EEG channels can be constructed. Correlation coefficient matrix The element r in the i-th row and j-th column of the matrix ij This represents the Pearson correlation coefficient between the EEG signals of channel i and channel j. Since the correlation coefficient matrix is ​​symmetric and its diagonal elements are all 1, the mean of the off-diagonal elements in the upper or lower triangular portion of the matrix is ​​taken as a measure of the overall correlation of the EEG signals within that time window.

[0031] Furthermore, the time corresponding to the maximum mean is selected as the optimal starting time. The mean of the correlation matrix at this moment reflects the state of strongest synchronization between EEG channels, indicating that the EEG data starting at this moment contains the richest information related to motor imagery. By maximizing the mean of the inter-channel correlation, it is possible to effectively capture the cortical activation patterns induced by the motor imagery task and eliminate noise interference from the resting state or that is irrelevant to the task.

[0032] S23. Fix the determined optimal start time. And based on a preset time step Slide the time window forward to adjust the endpoint, as shown in Equation 3 below:

[0033] In the formula: The moment when the original motion imagination ends. Imagine the end of a new sport. The sliding step size, It is a constant.

[0034] Determining the optimal starting time Then, by fixing the starting point and sliding the endpoint forward, the optimal ending time can be systematically searched, avoiding the introduction of post-task noise due to an excessively long time window or the loss of crucial motion visualization information due to an excessively short time window. The endpoint sliding strategy complements the starting point sliding strategy, jointly constructing a two-dimensional search space to locate the optimal time window boundary.

[0035] S24. Calculate the correlation matrix and its mean of the sample data under different endpoints, and select the time corresponding to the maximum mean as the optimal end time. Similarly to step S22, calculate the correlation matrix and its mean of the sample data under different endpoints, and select the time corresponding to the maximum mean as the optimal ending time. This process is also based on the calculation of inter-channel correlation coefficients and the matrix mean maximization criterion. By comparing the mean of the correlation coefficient matrix corresponding to different endpoint positions, the latest time that can maintain the strongest channel synchronization is determined. Optimal End Time The determination of this marks the optimal window for motion visualization. , The complete construction of the time window precisely corresponds to the period during which neural activity is most active and inter-channel synergy is strongest during the subjects' performance of the motor imagery task.

[0036] S3. Based on the EEG decoding module, perform filter bank spatial domain feature extraction on the EEG data within the optimal motor imagery time window to obtain a high-dimensional feature vector. Specifically, this includes the following steps: S31. Filter bank division, including a wideband, a Mu rhythm band, a Beta rhythm band, and several sub-bands of the two-rhythm band. In this embodiment, a total of 8 bands are included: one wideband (8-30Hz), a Mu rhythm band (8-13Hz), a Beta rhythm band (13-30Hz), and 5 sub-bands of the two-rhythm band. This multi-band division strategy fully considers the functional specificity of different neural oscillation components in the motor imagery task. The Mu rhythm is closely related to the desynchronization phenomenon of the sensorimotor cortex, while the Beta rhythm reflects the resynchronization process after motor preparation and execution. By combining the wideband and narrow sub-bands, both the overall information between bands is preserved, and the local features of specific frequency bands can be finely characterized.

[0037] S32. Co-spatial pattern feature extraction is performed on the filtered EEG data for each frequency band. The co-spatial pattern algorithm extracts discriminative spatial features by constructing spatial filters to maximize the variance difference of EEG signals corresponding to the motor imagery task. For EEG data in each frequency band, the co-spatial pattern algorithm first calculates the task's covariance matrix, and then solves for the optimal spatial filter bank through joint diagonalization. The first and last few components of the extracted feature vector correspond to the projection direction of the maximum variance difference, which can effectively enhance task-related neural signals and suppress background noise interference. After multi-band co-spatial pattern feature extraction, each frequency band obtains a set of spatial features, forming a feature set.

[0038] S33. EEG features from various frequency bands are combined to form a high-dimensional feature vector, representing spatial information across different frequency bands and providing a complete feature space for subsequent sparse feature selection. Feature combination employs vector concatenation, sequentially connecting the common spatial pattern features of the eight frequency bands to construct a comprehensive feature representation containing multi-scale spatial information. This high-dimensional feature vector encompasses both the overall spatial distribution characteristics of the wide frequency band and the fine modulation information of specific rhythmic frequency bands, enabling a comprehensive characterization of neural response patterns induced by motor imagery tasks.

[0039] S4. Based on the sparse learning LASSO algorithm in the EEG decoding module, feature selection is performed on high-dimensional EEG features to retain the most discriminative feature subset. Since multi-band feature extraction results in excessively high feature dimensionality, the sparse learning LASSO algorithm is introduced to perform feature regression selection to retain the most discriminative feature subset. The sparse regression coefficients are obtained by solving an optimization problem, as shown in Equation 4 below:

[0040] In the formula: These are real category labels. These are the initial regression parameters. It is a D-dimensional eigenvector. These are hyperparameters that control sparsity. These are D-dimensional sparse regression coefficients. It is the number of training samples.

[0041] By adjusting hyperparameters The value of allows for a flexible trade-off between feature fitting accuracy and sparsity, ensuring that the selected feature subset has both good class discrimination ability and avoids the risk of overfitting. When When the value is small, the model tends to retain more features to achieve higher fitting accuracy. When the value is large, the model forces more regression coefficients to be compressed to zero, thereby obtaining a sparser feature representation.

[0042] The LASSO algorithm, through its L The regularization term generates sparse solutions, meaning that the regression coefficients of a large number of irrelevant or redundant features are precisely set to zero, retaining only the feature dimensions that substantially contribute to class prediction. This sparse selection mechanism is highly consistent with the feature distribution characteristics of EEG signals. Neural responses related to motor imagery tasks are usually concentrated in specific frequency bands and specific spatial channels, while multi-frequency band co-spatial pattern feature extraction inevitably introduces a large amount of task-irrelevant redundant information. Through LASSO sparse regression, these noisy features can be effectively filtered out, reducing the curse of dimensionality in the feature space and enhancing the interpretability of the model.

[0043] S5. The Support Vector Machine (SVM) algorithm in the EEG decoding module is used to train the corresponding categories of the selected feature set to construct a motor imagery EEG recognition model for subsequent motor imagery EEG decoding, achieving accurate classification and intent decoding of motor imagery tasks. On the low-dimensional feature subset after feature selection, the SVM algorithm effectively avoids overfitting problems in high-dimensional space while maintaining its ability to model complex nonlinear distributions. The SVM algorithm finds the optimal classification hyperplane to maximize the margin boundary between different motor imagery categories, thereby constructing a recognition model with strong generalization ability and providing a reliable decision basis for subsequent motor imagery EEG decoding.

[0044] Please refer to the following: Figure 2 An EEG decoding device, the device being applied to the above-described dynamic time-window-based motor imagery EEG decoding method, the device comprising: The EEG acquisition module involves subjects wearing EEG caps and having EEG electrodes placed in the motor cortex of their heads according to the international 10-20 standard system. This system is configured to collect EEG data in real time during the subjects' motor imagery tasks, providing complete data input for the dynamic time window module.

[0045] The dynamic time window module is configured to perform correlation analysis on EEG data to obtain the optimal time window for motor imagery. Through a bidirectional search strategy that fixes the end point of the time window and slides the start time backward, and fixes the optimal start time and slides the end point forward, the optimal time boundary that maximizes the correlation between EEG channels is dynamically determined. Then, task-related data is selected for the EEG decoding module, effectively eliminating noise interference from task-irrelevant periods and improving the accuracy and reliability of subsequent feature extraction.

[0046] The EEG decoding module is configured to analyze EEG data within the optimal motor imagery window, extract sparse spatial EEG features, and classify them. The EEG decoding module includes a multi-band filtering unit, a spatial feature extraction unit, a sparse feature selection unit, and an SVM classification unit. The multi-band filtering unit performs multi-band segmentation and filtering on the EEG data within the optimal motor imagery window, decomposing the original EEG signal into a wideband, Mu rhythm band, Beta rhythm band, and their sub-bands to capture the functional-specific information of different neural oscillation components. The spatial feature extraction unit uses a co-spatial pattern algorithm to perform spatial filtering on the filtered EEG data of each band, constructing an optimal spatial filter bank to extract discriminative spatial feature vectors with the largest variance difference, enhancing task-related neural signals and suppressing background noise. The sparse feature selection unit performs sparse regression analysis on high-dimensional feature vectors formed by multi-band combinations based on the LASSO algorithm. By adjusting the regularization hyperparameter, it generates sparse solutions, compressing the regression coefficients of a large number of redundant features to zero, and retaining only the feature dimensions that substantially contribute to category prediction, thus obtaining a low-dimensional and highly discriminative feature subset. The SVM classification and recognition unit trains a support vector machine model on the sparsely selected feature subset. By finding the optimal classification hyperplane that maximizes the margin boundary between different motor imagery categories, it constructs an EEG recognition model with strong generalization ability, achieving accurate classification and intent decoding output for motor imagery tasks, and finally feeding the results back to the human-computer interaction module.

[0047] The human-computer interaction module is configured to present prompts for motor imagery tasks and provide feedback on EEG decoding results, enabling two-way information exchange between the subject and the system. This module presents standardized motor imagery task prompts to the EEG acquisition module via visual or auditory channels, guiding the subject to perform preset motor imagery tasks such as left hand, right hand, or both feet within a specific time window. This ensures the standardization and consistency of task execution, thus forming a complete closed-loop brain-computer interaction.

[0048] This embodiment also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the aforementioned dynamic time-window-based motor imagery EEG decoding method. The computer program stored on the computer-readable storage medium contains a series of instructions that, when executed by a processor, can complete all or part of the steps in the above method embodiment, specifically including the invocation and computation of functional modules such as EEG data reading, dynamic time-window optimization, multi-band filtering, co-spatial pattern feature extraction, LASSO sparse feature selection, and support vector machine classification and recognition.

[0049] This embodiment also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the steps of the above-mentioned dynamic time window-based motor imagery EEG decoding method. Through the coordinated operation of various functional modules, it completes the entire process of motor imagery EEG signal acquisition, dynamic time window optimization, multi-band spatial feature extraction, sparse feature selection, and classification recognition, forming a complete motor imagery EEG decoding device.

[0050] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0051] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of this invention patent should be determined by the appended claims.

Claims

1. A method for decoding motor imagery EEG based on dynamic time windows, characterized in that: Includes the following steps: S1. Collect EEG data of the subject performing a motor imagery task using an EEG acquisition module, and preset an initial time window containing the complete movement cycle. , ]; S2. Based on the dynamic time window module, the initial time window is [ , Correlation analysis was performed on internal EEG data to determine the optimal time window for motor imagery. , ]; S3. Based on the EEG decoding module, perform filter bank spatial domain feature extraction on the EEG data within the optimal motor imagery time window to obtain a high-dimensional feature vector. S4. Based on the sparse learning LASSO algorithm in the EEG decoding module, feature selection is performed on high-dimensional EEG features to retain the most discriminative feature subset. S5. Use the support vector machine algorithm in the EEG decoding module to train and learn the corresponding categories of the selected feature set to build a motor imagery EEG recognition model for subsequent motor imagery EEG decoding.

2. The EEG decoding method for motor imagery based on dynamic time windows as described in claim 1, characterized in that: Determining the optimal motion visualization window in S2 involves the following steps: S21, Fixed time window endpoint, and based on preset step size Different new starting points are obtained by sliding backward from the initial time window, and the calculation formula is shown in the following formula: In the formula: The initial moment of the original motion imagination, Imagine the starting moment for a new movement. The sliding step size, It is a constant; S22. Calculate the correlation matrix and mean of the sample data at different starting points, and select the time corresponding to the maximum mean as the optimal starting time. ; S23. Fix the determined optimal start time. And based on a preset time step Slide the time window forward to adjust the endpoint; the calculation formula is as follows: In the formula: The moment when the original motion imagination ends. Imagine the end of a new sport. The sliding step size, It is a constant; S24. Calculate the correlation matrix and its mean of the sample data under different endpoints, and select the time corresponding to the maximum mean as the optimal end time. .

3. The EEG decoding method for motor imagery based on dynamic time windows as described in claim 2, characterized in that: Calculating the correlation and mean of the sample data in S22 and S24 to obtain the optimal time includes the following steps: Based on the sliding motion imagery time window and the corresponding EEG data matrix, the correlation coefficient between different channels in the matrix is ​​defined; Obtain the correlation coefficient matrix and calculate its mean; The time corresponding to the maximum mean is selected as the optimal time.

4. The EEG decoding method for motor imagery based on dynamic time windows as described in claim 3, characterized in that: The correlation coefficient of channel EEG data is defined as follows: In the formula: and The mean and standard deviation of the EEG data from each channel are represented. The number of sampling points is represented by A and B, which are the EEG channels contained in the corresponding EEG data matrix.

5. The EEG decoding method for motor imagery based on dynamic time windows as described in claim 1, characterized in that: Obtaining the high-dimensional feature vectors in S3 involves the following steps: S31. Filter bank division, including wideband, Mu rhythm band, Beta rhythm band and several sub-bands of the two rhythm band; S32. Extract cosmic pattern features from the filtered EEG data of each frequency band; S33. Combine the EEG features of each frequency band to form a high-dimensional feature vector.

6. The EEG decoding method for motor imagery based on dynamic time windows as described in claim 5, characterized in that: In S4, the LASSO algorithm for sparse learning obtains sparse regression coefficients by solving an optimization problem, as shown in the following formula: In the formula: These are real category labels. These are the initial regression parameters. It is a D-dimensional eigenvector. These are hyperparameters that control sparsity. These are D-dimensional sparse regression coefficients. It is the number of training samples.

7. An EEG decoding device, said device being applied to the motor imagery EEG decoding method based on dynamic time windows as described in any one of claims 1 to 6, characterized in that, The device includes: The EEG acquisition module is configured to collect EEG data in real time during the subject's performance of a motor imagery task; The dynamic time window module is configured to perform correlation analysis on EEG data to obtain the optimal time window for motor imagery. The EEG decoding module is configured to analyze EEG data within the optimal motor imagery window, extract sparse spatial EEG features, and identify and classify them. The human-computer interaction module is configured to provide prompts for motor imagery tasks and feedback on EEG decoding results.

8. The EEG decoding device as described in claim 7, characterized in that: The EEG decoding module includes a multi-band filtering unit, a spatial feature extraction unit, a sparse feature selection unit, and an SVM classification and recognition unit.

9. An electronic device, characterized in that, include: A processor, a memory, and a computer program; wherein the computer program is stored in the memory and configured to be executed by the processor to implement the dynamic time window-based motor imagery EEG decoding method as described in any one of claims 1 to 6.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by the processor, it implements the motion imagery EEG decoding method based on any one of claims 1 to 6.