Electroencephalogram signal continuous learning classification method and system based on similarity perception playback
Through the combination of time series cross-validation and similarity perception mechanism, the EEGNet model is constructed, which solves the problem of data distribution offset in long-term applications of the EEG signal classification model, and realizes personalized EEG signal adaptation that maintains efficient and accurate in a dynamic environment.
Patent Information
- Application Number
- CN202510254258.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-05
- Publication Date
- 2025-07-04
AI Technical Summary
The existing EEG signal classification model faces data distribution offset problems in long-term applications, resulting in a decrease in model accuracy. The computing resources of traditional solutions are expensive and cumbersome, making it difficult to maintain high efficiency and accuracy in dynamic environments.
Time series cross-validation strategy is used to build a time-step-driven incremental learning framework, combine deep convolution and separable convolution to build an EEGNet model, and update the experience pool through a similarity perception mechanism to achieve dynamic adaptation of personalized EEG signals, and store and update historical data samples using local continuity characteristics.
It effectively avoids the destruction of old knowledge by new data, enhances the stability and accuracy of the model in long-term learning, improves the ability to adapt to new data, reduces redundant information, and maintains the memory of historical data.
Smart Images

Figure CN120257119A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the cross - technical field of artificial intelligence and neuroengineering, and particularly to an electroencephalogram (EEG) signal continuous learning classification method and system based on similarity - aware replay. Background Art
[0002] Electroencephalogram (EEG), as a physiological signal recording technology with high temporal resolution, can monitor the changes in the electrical activities of brain neurons in real - time, providing a valuable tool for neuroscience, clinical medicine, and brain - computer interface (BCI) research. With the rapid development of machine learning, especially deep learning techniques, significant progress has been made in the automatic classification and analysis of EEG signals, particularly in the fields of emotion recognition, movement control, and cognitive monitoring. EEG shows great potential in these applications and also plays a crucial role in the early diagnosis and treatment of neurological diseases such as epilepsy and cognitive dysfunction. However, with the growing demand for personalized intelligent systems, how to more effectively apply EEG technology to the personalized needs of long - term monitoring and dynamic adjustment has become the key research direction.
[0003] Despite the continuous improvement of EEG signal classification accuracy, existing models face significant challenges in long - term applications, especially the problem of data distribution shift. Changes in an individual's physiological state, differences in drug treatment responses, and external environmental interferences can all lead to dynamic changes in EEG data characteristics, thereby affecting the accuracy of the model. As Figure 2 shown, traditional solutions usually require collecting new EEG data, merging it with historical data, and re - updating the model through full - scale training. However, with the continuous increase in data volume, this process becomes increasingly cumbersome and consumes a large amount of computing resources. Therefore, how to cope with the changes in data distribution and ensure the model remains efficient and accurate in a changing clinical environment has become the main challenge faced by current personalized systems. Summary of the Invention
[0004] Based on the technical problems existing in the background art, the present invention proposes an EEG signal continuous learning classification method and system based on similarity - aware replay, which significantly enhances the dynamic adaptation ability of the EEG classification model to new data and maintains high efficiency and accuracy in a changing clinical environment.
[0005] An EEG signal continuous learning classification method based on similarity - aware replay proposed by the present invention continuously inputs EEG data stream segments into a trained EEG classification model in an incremental manner to achieve dynamic adaptation of personalized EEG signals;
[0006] The training process of the EEG classification model is as follows:
[0007] A time - series cross - validation strategy is adopted to construct a time - step - driven incremental learning framework, and a training sample set for each time step is constructed.
[0008] A deep - learning model EEGNet is constructed using depth - wise convolution and separable convolution. The deep - learning model is trained based on the training sample set for each time step. After the training of each time step is completed, the experience pool is updated based on the similarity - aware mechanism, and the experience pool is used to store historical data samples.
[0009] When the deep - learning model is trained based on the training sample sets from time step 2 to time step T, the training sample set of each time step is jointly trained with the samples randomly retrieved from the experience pool.
[0010] A loss function for batch training is constructed to optimize the trainable parameters in the classification model.
[0011] Furthermore, in the process of constructing a time - step - driven incremental learning framework using a time - series cross - validation strategy and constructing a training sample set for each time step, specifically:
[0012] At time step 1, at least A hours of historical EEG data are selected as the training sample set for time step 1, the subsequent newly arrived batches of EEG data are used as the validation sample set for time step 1, and another subsequent newly arrived batch of EEG data is used as the test sample set.
[0013] At time steps 2 to T, the currently newly arrived batch of EEG data is divided into corresponding training, validation, and test sample sets.
[0014] At time steps 1 to T, a data pre - processing pipeline is set up to pre - process the original EEG data, and the pre - processed data is used as the corresponding training, validation, and test sample sets.
[0015] Furthermore, in the training of the classification model through each time step, the trainable parameters of the classification model are adjusted using the training sample set of the current time step, and the classification model is verified using the validation sample set of the current time step to screen out the optimal classification model to update the model parameters.
[0016] The performance of the optimal classification model is evaluated using the test sample set.
[0017] Early - stopping technology is applied to the validation sample set. When the validation error does not decrease for a continuously set tr training epochs, the training of the classification model stops, and the final classification model is obtained.
[0018] Furthermore, in time steps 1 to T, setting up a data pre - processing pipeline to pre - process the original EEG data, specifically:
[0019] Extract the original EEG signals of C channels from the original EEG data, and perform high-pass, low-pass, and notch filtering on the extracted original EEG signals;
[0020] Use the sliding window operation to slice the filtered original EEG signals, and perform sliding window upsampling with a fixed stride of S on the EEG samples of different categories annotated by experts to balance the sample categories.
[0021] Furthermore, the deep learning model EEGNet includes a temporal convolutional layer, a depth convolutional module, and a separable convolutional module connected in sequence;
[0022] The temporal convolutional layer is used to perform preliminary feature extraction on the input EEG data;
[0023] The depth convolutional module is used to perform depth convolution operations on the output of the temporal convolutional layer, thereby enhancing the receptive field of the deep learning model for the input EEG data;
[0024] The separable convolutional module is used to perform feature extraction on the output of the depth convolutional module to obtain the prediction result.
[0025] Furthermore, the construction and update process of the experience pool is as follows:
[0026] When the experience pool is not full, set both the size and stride of the fixed window to L. In each window with a length of L, select the sample located at the center of the window and add it to the experience pool;
[0027] When the experience pool is full, use the similarity matching method for sample replacement and update.
[0028] Furthermore, when the experience pool is full, using the similarity matching method for sample replacement and update is specifically as follows:
[0029] When a new sample arrives, use the local sampling strategy to randomly extract a batch of sample sets from the experience pool;
[0030] Calculate the similarity between the new sample and each sample in the extracted sample set, and sort them in descending order. Replace the sample ranked first with the new sample to achieve the update of the sample pool at different time steps.
[0031] Furthermore, the loss function for batch training is constructed as follows:
[0032]
[0033] where B is the sample batch size at the current time step, B M is the sample batch size retrieved from the experience pool, and the true label corresponding to the i-th sample x i is y i∈ {0, 1}, y i Take 1 to represent the positive class sample, y i Take 0 to represent the negative class sample, is the predicted probability of the classification model for the sample x i and γ is the focusing parameter.
[0034] A similarity-aware replay EEG signal continual learning classification system that continuously inputs EEG data stream segments into a trained EEG classification model in an incremental manner to achieve dynamic adaptation of personalized EEG signals;
[0035] The training process of the EEG classification model includes a dataset construction module, a model construction module, a batch training module, a replay mechanism module, and a loss construction module;
[0036] The dataset construction module is used to construct a time-step-driven incremental learning framework using a time series cross-validation strategy and construct a training sample set for each time step;
[0037] The model construction module is used to construct the deep learning model EEGNet using depthwise convolution and separable convolution;
[0038] The batch training module trains the deep learning model based on the training sample set for each time step. After the training of each time step, the experience pool is updated based on a similarity-aware mechanism, and the experience pool is used to store historical data samples;
[0039] The replay mechanism module is used to jointly train the training sample set for each time step with samples randomly retrieved from the experience pool when training the deep learning model based on the training sample sets from time step 2 to time step T;
[0040] The loss construction module is used to construct a loss function for batch training and optimize the trainable parameters in the classification model.
[0041] Furthermore, the dataset construction module is specifically:
[0042] At time step 1, select at least A hours of historical EEG data as the training sample set for time step 1, the subsequent newly arrived batch of EEG data as the validation sample set for time step 1, and another subsequent newly arrived batch of EEG data as the test sample set;
[0043] At time steps 2 to T, divide the currently newly arrived batch of EEG data into corresponding training sample sets, validation sample sets, and test sample sets;
[0044] In time steps 1 to T, set up a data preprocessing pipeline to preprocess the original EEG data and use the preprocessed data as the corresponding training sample sets, validation sample sets, and test sample sets.
[0045] The advantages of the EEG signal continuous learning classification method and system based on similarity-aware replay provided by the present invention are as follows: A continuous learning framework with an experience replay mechanism is set up. By storing historical experience samples and repeatedly replaying these samples during the training process, this framework effectively avoids the destruction of old knowledge by new data, thus overcoming catastrophic forgetting in the continuous learning process. In this embodiment, combined with the experience pool technology, an efficient solution is proposed for the dynamic change of data distribution during the long-term application of EEG signals. This solution can not only ensure that the classification model maintains its memory of historical data while adapting to new data, but also enhances the stability and accuracy of the model in long-term learning; by utilizing the local continuity characteristics of EEG data, an experience pool update mechanism based on temporal similarity awareness is further proposed. Brain activities usually show significant coherence and stability on a relatively short time scale, which makes adjacent samples of EEG signals have high similarity. Based on this characteristic, the proposed mechanism extracts the most representative intermediate sample from each time window with a fixed length of L and stores it in the experience pool. Through targeted storage and update of samples, this mechanism can minimize redundant information while ensuring the model's memory of historical data, and improve the model's adaptability to new data. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 It is a schematic diagram of a personalized continuous learning framework;
[0047] Figure 2 It is a schematic diagram of continuous learning training settings;
[0048] Figure 3 It is a schematic diagram of the architecture of a classification model;
[0049] Figure 4 It is a schematic diagram of temporal local similarity sampling; DETAILED DESCRIPTION OF THE EMBODIMENTS
[0050] Next, the technical solutions of the present invention will be described in detail through specific embodiments. Many specific details are set forth in the following description in order to fully understand the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without departing from the connotation of the present invention. Therefore, the present invention is not limited by the specific embodiments disclosed below.
[0051] To address the problem of performance degradation caused by data distribution shift in the EEG model during long-term applications, the continual learning method has emerged. This method allows the model to be fine-tuned when receiving new data, avoiding the high computational cost of traditional full-scale retraining. It can quickly adapt to the new data distribution without completely retraining. However, the standard continual learning method faces an important challenge - catastrophic forgetting. When the model learns new tasks or receives new data, the previously learned old knowledge may be covered or forgotten by the new information, leading to a significant decline in performance.
[0052] As Figures 1 to 4 shown, a continual learning classification method for EEG signals based on similarity-aware replay proposed by the present invention continuously inputs EEG data stream segments into a trained EEG classification model in an incremental manner to achieve dynamic adaptation of personalized EEG signals;
[0053] The training process of the classification model is as follows:
[0054] Adopt a time series cross-validation strategy to construct a time-step-driven incremental learning framework and construct the training sample set for each time step;
[0055] Use depth convolution and separable convolution to construct a deep learning model, train the deep learning model based on the training sample set of each time step, and update the experience pool based on the similarity-aware mechanism after each time step of training. The experience pool is used to store historical data samples;
[0056] When training the deep learning model based on the training sample sets from time step 2 to time step T, jointly train the training sample set of each time step with the samples randomly retrieved from the experience pool;
[0057] Construct a loss function for batch training to optimize the trainable parameters in the classification model.
[0058] In this embodiment, a continual learning framework with an experience replay mechanism is set up, as Figure 1 shown. This framework stores historical experience samples and replays these samples repeatedly during the training process, effectively avoiding the destruction of old knowledge by new data, thereby overcoming catastrophic forgetting in the continual learning process. This embodiment combines the experience pool technology and proposes an efficient solution for the dynamic change of data distribution during the long-term application of EEG signals. This solution can not only ensure that the classification model maintains the memory of historical data while adapting to new data, but also enhances the stability and accuracy of the model in long-term learning.
[0059] Meanwhile, by leveraging the local continuity characteristics of electroencephalogram (EEG) data, an experience pool update mechanism based on temporal similarity perception is further proposed. Brain activities usually exhibit significant coherence and stability on a short time scale, which makes adjacent samples of EEG signals highly similar. Based on this characteristic, the proposed mechanism extracts the most representative intermediate samples from each time window with a fixed length of L and stores them in the experience pool. Through targeted storage and update of samples, this mechanism can minimize redundant information while ensuring the model's memory of historical data, thus enhancing the model's adaptability to new data.
[0060] The EEG signal continuous learning classification method in this embodiment mainly includes a similarity perception mechanism and a replay mechanism. By introducing the temporal similarity perception mechanism, it can effectively capture the time series features in EEG signals, identify and utilize the potential similarities between signals, thereby improving the model's adaptability and classification accuracy in long time series data. At the same time, combined with the introduction of the replay mechanism, on the basis of avoiding catastrophic forgetting, the model can maintain sensitivity to historical knowledge during the process of receiving new data, thus continuously optimizing the classification effect.
[0061] In one embodiment, the construction processes of the training sample set, validation sample set, and test sample set are as follows (a1) to (a3):
[0062] (a1) Construction of the personalized continuous learning framework;
[0063] In the initial stage of model training (time step 1), at least A hours of historical EEG data are selected as the initial training data set, the subsequent D hours of EEG data are used as the validation sample set, and then E hours of EEG data are selected as the test sample set for performance evaluation of classification prediction, where D hours and E hours can be equal or not equal. This embodiment uses two publicly available EEG data sets: CHB-MIT and Siena; in the CHB-MIT data set, the average EEG recording duration of each individual exceeds 40 hours, among which at least 5 hours of historical EEG data are selected as the initial training sample set, the subsequent 1 hour of EEG data is used as the validation sample set, and 1 hour of EEG data is used as the test sample set. The Siena data set contains EEG records with shorter durations, and the average recording duration of each individual is about 10 hours. At least 1 hour of historical EEG data is selected as the initial training set, the subsequent 0.5 hour of EEG data is used as the validation sample set, and then 0.5 hour of EEG data is used as the test sample set.
[0064] (a2) At time steps 2 to T, the currently newly arrived batch of EEG data is divided into corresponding training sample sets, validation sample sets, and test sample sets, as Figure 2 shown.
[0065] (a3) Establishment of data preprocessing pipeline;
[0066] Preferably, in time steps 1 to T, a data preprocessing pipeline is set up to preprocess the original EEG data, and the preprocessed data is used as the corresponding training sample set, validation sample set, and test sample set.
[0067] Establish a data preprocessing pipeline for continual learning to preprocess the original EEG data, covering data extraction, filtering, time window slicing, and class balancing. Specifically, for the original EEG data of training, validation, and testing, first select specific channels and extract the original EEG signals of C channels. Then, perform high-pass, low-pass, and notch filtering on the extracted original EEG signals. Next, use the sliding window technique to slice the filtered original EEG signals, and upsample the EEG samples of different categories labeled by a few experts with a fixed stride of S. Taking time step 1 as an example, after the above operations, the training sample set in the initial stage is formed Validation sample set And test sample set And the corresponding label set And Among them, represents the i, v, e-th EEG signal sample as input, C represents the number of channels of the EEG signal, Q represents the time series length of the signal collected by each channel, Q = W × S, W represents the slice length of the sliding window, and S represents the sampling rate of the EEG signal per second; y i 1 is the label corresponding to the i-th EEG signal sample x i at time step 1. Similarly, is the label corresponding to the v-th EEG signal sample x v at time step 1, is the label corresponding to the e-th EEG signal sample x e at time step 1; in this example, the number of channels C is taken as 18, the sliding window length W is 1 s, and the sampling rate S of the EEG signal per second is 256 Hz. The original EEG signal is subjected to 60 Hz high-pass filtering, 0.5 Hz low-pass filtering, and 50 Hz notch filtering, and the EEG samples of different categories labeled by a few experts are upsampled with a fixed stride of 0.05 s.
[0068] Similarly, in time step 2, the training sample set Validation sample set Test sample set The corresponding label is And so on, in time step T, the training sample set Validation sample set Test sample set The corresponding label is Therefore, using the training sample set X i , the validation sample set X v , and the test sample set X e to represent the samples at all time steps, and the corresponding labels are Y i , Y v , Y e .
[0069] In this embodiment, the classification model is trained at each time step. The trainable parameters of the classification model are adjusted using the training sample set at the current time step, and the classification model is verified using the validation sample set at the current time step to screen out the optimal classification model to update the model parameters; the performance of the optimal classification model is evaluated using the test sample set; the early stopping technique is applied to the validation sample set. When the validation error does not decrease for a set number of training cycles (preferably 8 training cycles in this embodiment), the training of the classification model stops, and the final classification model is obtained. The training, verification, and testing processes of the classification model at one time step are regarded as one cycle, and the classification model is iteratively trained through T time steps.
[0070] Through (a1) to (a3), for the classification scenario of the long-term EEG data stream of personalized patients, this embodiment adopts a time series cross-validation strategy to construct a time step-driven incremental learning framework (t = 1, 2, … T). Each time step corresponds to a newly arrived EEG data stream segment, and the classification model continuously and dynamically learns new data in an incremental manner to adapt to the continuously changing EEG signal characteristics.
[0071] In one of the embodiments, a deep learning model based on EEGNet is constructed. EEGNet is a lightweight convolutional neural network suitable for the classification task of EEG signals. As Figure 3 shown, EEGNet includes a temporal convolutional layer, a depth convolutional module, and a separable convolutional module connected in sequence;
[0072] The temporal convolutional layer is mainly used for preliminary feature extraction of the input EEG signal (EEG data), including: a convolutional operation with a stride of 1 and a convolutional kernel size of 1 × kernel, and batch normalization; in this example, kernel = 63.
[0073] The depth convolutional module performs a depth convolutional operation on the output of the temporal convolutional layer to enhance the receptive field of the model for the input signal. This module includes: a depth convolution with a stride of 1 and a convolutional kernel size of n channels × 1, and applying grouped convolution (groups = 16). The number of channels in this example is 18; the ELU activation function is used to enhance the non-linear feature expression ability; an average pooling operation with a stride of 4 is used for dimensionality reduction; Dropout discards redundant features with a probability of 0.5 to avoid overfitting.
[0074] The separable convolution module further enhances the model's feature extraction ability, including: a separable convolution with a stride of 1 and a convolution kernel size of 1×16 for extracting feature information across time steps; an ELU activation function for non-linear mapping; an average pooling operation with a stride of 8 to further reduce the dimension of the features; and a Dropout=0.5 operation to enhance the robustness of the model.
[0075] After the above feature extraction and dimensionality reduction, the obtained features are classified through a fully connected layer to output the final prediction result.
[0076] The deep learning model constructed in this embodiment can effectively extract the spatio-temporal features of EEG signals and has good generalization ability.
[0077] In one embodiment, an experience pool update strategy based on temporal similarity perception is used to construct an experience pool with a storage capacity of M for storing historical data samples. In this example, the experience pool sizes P are set to 300 (storing 300 1-second samples, i.e., 5 minutes), 900, and 1800 respectively. After the classification model training is completed at each time step, the experience pool is updated in combination with the temporal similarity perception mechanism of this embodiment. The specific experience pool update is as follows:
[0078] When the experience pool is not full, a temporal local similarity sampling method is adopted. Specifically, the size and stride of a fixed window are both set to L, and then in each window with a length of L, the sample located at the center of the window is selected and added to the experience pool, as Figure 4 shown.
[0079] When the experience pool is full, a similarity matching method is used for sample replacement and update. The specific operation is as follows: when a new sample arrives, first randomly extract a batch of samples from the experience pool using an efficient local sampling strategy Then calculate the similarity (such as cosine similarity) between the new sample x i and these samples . The similarity matching uses cosine similarity to calculate the similarity score sim, and the calculation formula is as follows:
[0080]
[0081] Next, sort according to the similarity, select the sample with the highest similarity to the new sample and replace it with the new sample; to achieve the update of the experience pool.
[0082] Since the experience pool is used to store historical data samples, in time step 1, the experience pool is empty and there are no current historical data samples, as Figure 1As shown. At time step 2, the experience pool stores the data samples of time step 1 that have been experienced as historical data samples. At time step 3, the experience pool stores the data samples of time steps 1 and 2 as historical data samples, and so on. At time step T, the experience pool stores the data samples of time steps 1 to T - 1 as historical data samples. Since the capacity of the experience pool is limited, as the time steps increase, the data in the experience pool changes from empty to full. After the experience pool is full, the new data as historical data samples will calculate the similarity with the sample data already stored in the experience pool and replace the historical data sample closest to the new sample, completing the update of the experience pool with the iteration of time steps. This can not only ensure that the classification model adapts to new data while maintaining the memory of historical data, but also enhance the stability and accuracy of the classification model in long-term learning.
[0083] In one embodiment, the classification model is trained through an incremental training and replay mechanism;
[0084] In the initial training stage (time step is 1), end-to-end training is performed on the first batch of EEG data to establish a basic classification model. Based on the training sample set X i and its corresponding label set Y t , the Focal loss is used as the loss function for batch training
[0085]
[0086] where B is the sample batch size at the current time step, B M is the sample batch size retrieved from the experience pool, the true label corresponding to the i-th sample x i is y i ∈{0,1}, y i taking 1 represents a positive class sample, y i taking 0 represents a negative class sample, is the predicted probability of the classification model for the sample x i , γ is the focusing parameter used to adjust the weight of difficult samples. The larger the value of γ, the smaller the penalty for easy-to-classify samples and the larger the penalty for difficult-to-classify samples. In this example, γ is set to 2. The expression formula is as follows:
[0087]
[0088] where σ represents the Softmax function, z i represents the original predicted value (logits) of the deep learning model for the sample x i .
[0089] Such as Figure 1As shown, during the continuous learning stage (time step t > 1), the newly arrived EEG data is divided into three parts: the training sample set and its corresponding label set for training the model, the validation sample set and its label set for validating the model, and the optimal model is selected to update the model parameters. The test sample set and its label set are used for testing to evaluate the performance of the model. Specifically, F hours of EEG data are used for training, another D hours of EEG data are used for validation to update the model parameters, and then E hours of EEG data are used for testing. This process is executed in a loop. At the same time, a replay mechanism is introduced, that is, at each time step, the current batch of samples B is jointly trained with the samples randomly retrieved from the experience pool B M . CHB-MIT selects 1 hour of EEG data as the validation set and 1 hour of EEG data as the test set. Siena selects 0.5 hour of EEG data as the validation set and 0.5 hour of EEG data as the test set. In this example, the current time step and the batch size retrieved from the experience pool are both set to 64, and the initial learning rate of the AdamW optimizer is set to 0.0001. In addition, early stopping technology is applied in the validation set. When the validation error does not decrease for tr training cycles, the model training stops, and the final classification model is obtained. In this embodiment, tr is preferably taken as 8.
[0090] The continuous learning method for EEG signal classification proposed in this embodiment is experimentally verified on two public datasets, CHB-MIT and Siena. In the experiment, EEGNet is used as the baseline model (baseline) to evaluate the performance and effectiveness of the proposed method on different datasets. To comprehensively evaluate the model prediction performance, four widely used sample-based evaluation metrics are selected in this embodiment. Specifically, these metrics include: Sensitivity (Sn), defined as the proportion of true positive samples correctly predicted as positive samples, which can reflect the model's ability to identify positive class samples; Precision, defined as the proportion of actual positive samples among all instances predicted as positive samples by the model; F1-score is the harmonic mean of Sensitivity and Precision, which can comprehensively measure the overall performance of the model, especially in the context of sample imbalance. Its value ranges from 0 to 1, and the closer it is to 1, the better the model performance; FP / 24h is defined as the number of times the model mispredicts negative samples as positive samples per day (24h).
[0091] Table 1 Comparison of average performance of common continuous learning methods in EEG signal classification tasks on CHB-MIT and Siena datasets
[0092]
[0093]
[0094] Table 2 Influence of different window sizes on the average prediction performance of the classification model in this embodiment when M = 300
[0095]
[0096] Table 3 Influence of different window sizes on the average prediction performance of the classification model in this embodiment when M = 900
[0097]
[0098] Table 4 Influence of different window sizes on the average prediction performance of the model when M = 1800
[0099]
[0100] In Tables 2 to 4, Window Length is the slice length W of the sliding window. Table 1 and Table 2 respectively show the average performance of this embodiment on the CHB-MIT dataset and the Siena dataset. The experimental results show that compared with other common continual methods, such as LWF (Learning without Forgetting) and ER (Experience Replay), the proposed temporal similarity awareness mechanism in this embodiment significantly improves the classification prediction performance of the classification model during the continual learning process, indicating that the proposed method can effectively cope with the changes in data distribution and the problem of memory decay.
[0101] In similarity-aware updates, the window size has an important influence on the prediction performance of the model during the continual learning process. Tables 2, 3, and 4 respectively show the comparison of the average prediction performance of the model with different window sizes in this embodiment when M = 300, 900, and 1800. According to the experimental results, the window size of 60 is adopted in this example.
[0102] As mentioned above, the above are only the preferred specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention, according to the technical solution of the present invention and its inventive concept, makes equivalent substitutions or changes, and all should be covered by the protection scope of the present invention.
Claims
1. A continuous learning classification method for electroencephalogram signals based on similarity-aware replay, characterized in that, Continuously input EEG data stream segments in an incremental manner into the trained EEG classification model to achieve dynamic adaptation of personalized EEG signals; The training process of the EEG classification model is as follows: Adopt a time series cross-validation strategy to construct a time step-driven incremental learning framework, and construct a training sample set for each time step; Use depth convolution and separable convolution to construct the deep learning model EEGNet, train the deep learning model based on the training sample set of each time step, and update the experience pool based on the similarity perception mechanism after the training of each time step. The experience pool is used to store historical data samples; When training the deep learning model based on the training sample sets from time step 2 to time step T, jointly train the training sample set of each time step with the samples randomly retrieved from the experience pool; Construct a loss function for batch training to optimize the trainable parameters in the classification model.
2. The electroencephalogram signal continuous learning classification method according to claim 1, wherein In constructing a time step-driven incremental learning framework by adopting a time series cross-validation strategy and constructing a training sample set for each time step, specifically: At time step 1, select at least A hours of historical EEG data as the training sample set for time step 1, the subsequent newly arrived batches of EEG data as the validation sample set for time step 1, and another subsequent newly arrived batch of EEG data as the test sample set; At time steps 2 to time step T, divide the currently newly arrived batch of EEG data into corresponding training sample sets, validation sample sets, and test sample sets; In time steps 1 to time step T, set up a data preprocessing pipeline to preprocess the original EEG data, and use the preprocessed data as the corresponding training sample sets, validation sample sets, and test sample sets.
3. The electroencephalogram signal continuous learning classification method according to claim 2, characterized in that, In the training of the classification model through each time step, use the training sample set of the current time step to adjust the trainable parameters of the classification model, and use the validation sample set of the current time step to verify the classification model to screen out the optimal classification model to update the model parameters; Use the test sample set to evaluate the performance of the optimal classification model; Apply the early stopping technique to the validation sample set. When the validation error does not decrease for a continuously set tr training cycles, the training of the classification model stops to obtain the final classification model.
4. The electroencephalogram signal continuous learning classification method according to claim 2, characterized in that In time steps 1 to time step T, setting up a data preprocessing pipeline to preprocess the original EEG data, specifically: Extract the original EEG signals of C channels from the original EEG data, and perform high-pass, low-pass, and notch filtering on the extracted original EEG signals; Use the sliding window operation to slice the filtered original EEG signals, and perform sliding window upsampling with a fixed step size of S on the EEG samples of different categories annotated by experts to balance the sample categories.
5. The electroencephalogram signal continuous learning classification method according to claim 1, characterized in that The deep learning model EEGNet includes a temporal convolutional layer, a depth convolution module, and a separable convolution module connected in sequence; The temporal convolutional layer is used to perform preliminary feature extraction on the input EEG data; The depth convolution module is used to perform depth convolution operations on the output of the temporal convolutional layer, thereby enhancing the receptive field of the deep learning model for the input EEG data; The separable convolution module is used to perform feature extraction on the output of the depth convolution module to obtain the prediction result.
6. The continuous learning classification method for electroencephalogram signals according to claim 1, wherein The construction and update process of the experience pool is as follows: When the experience pool is not full, set both the size and stride of the fixed window to L. In each window of length L, select the sample located at the center of the window and add it to the experience pool; When the experience pool is full, use the similarity matching method for sample replacement and update.
7. The continuous learning classification method for electroencephalogram signals according to claim 6, characterized in that The specific method for using the similarity matching method for sample replacement and update when the experience pool is full is as follows: When a new sample arrives, use the local sampling strategy to randomly draw a batch of sample sets from the experience pool; Calculate the similarity between the new sample and each sample in the drawn sample set, and sort them in descending order. Replace the sample ranked first with the new sample to achieve the update of the sample pool at different time steps.
8. The electroencephalogram signal continuous learning and classification method according to claim 1, characterized in that Loss function for batch training Constructed as follows: Among them, B is the sample batch size at the current time step, B M is the sample batch size retrieved from the experience pool, and the true label corresponding to the i-th sample x i is y i ∈{0, 1}, and y i taking 1 indicates a positive class sample, and y i taking 0 indicates a negative class sample, is the predicted probability of the classification model for the sample x i and γ is the focusing parameter.
9. A continuous learning classification system for electroencephalogram signals based on similarity-aware replay, characterized in that, Continuously input EEG data stream segments in an incremental manner into the trained EEG classification model to achieve dynamic adaptation of personalized EEG signals; The training process of the EEG classification model includes a dataset construction module, a model construction module, a batch training module, a replay mechanism module, and a loss construction module; The dataset construction module is used to construct a time-step-driven incremental learning framework using the time series cross-validation strategy and construct the training sample set for each time step; The model construction module is used to construct the deep learning model EEGNet using depthwise convolution and separable convolution; The batch training module trains the deep learning model based on the training sample set for each time step. After the training of each time step, the experience pool is updated based on the similarity perception mechanism. The experience pool is used to store historical data samples; The replay mechanism module is used to jointly train the training sample set for each time step with the samples randomly retrieved from the experience pool when training the deep learning model based on the training sample sets from time step 2 to time step T; The loss construction module is used to construct the loss function for batch training and optimize the trainable parameters in the classification model.
10. The electroencephalogram signal continuous learning and classification system according to claim 9, wherein The dataset construction module is specifically as follows: At time step 1, select at least A hours of historical EEG data as the training sample set for time step 1, the subsequent newly arrived batch of EEG data as the validation sample set for time step 1, and another subsequent newly arrived batch of EEG data as the test sample set; At time steps 2 to T, divide the currently newly arrived batch of EEG data into corresponding training sample sets, validation sample sets, and test sample sets; In time steps 1 to T, set up a data preprocessing pipeline to preprocess the original EEG data, and use the preprocessed data as the corresponding training sample sets, validation sample sets, and test sample sets.