Epileptic seizure automatic identification method and device based on electroencephalogram data enhancement
By combining a conditional diffusion model and a multi-scale temporal discriminant network, the problems of data scarcity and type heterogeneity in epilepsy EEG recognition are solved, enabling accurate identification and real-time output of multiple types of epileptic seizures, and improving the robustness and applicability of the model.
Patent Information
- Application Number
- CN202510778758.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-11
- Publication Date
- 2025-11-04
AI Technical Summary
Existing EEG recognition technologies for epilepsy face challenges such as data scarcity, heterogeneity of seizure types, and complex time-series dependencies, making it difficult to accurately identify multiple types of epileptic seizures, especially rare seizure types and complex seizures. Furthermore, existing methods lack real-time performance and interpretability.
An EEG-based augmentation method was employed to generate epilepsy samples with seizure characteristics using a conditional diffusion model. A multi-scale temporal discriminant network was then used to extract epileptic fluctuations and spectral features. Information fusion was performed in conjunction with attention mechanisms to achieve accurate identification of seizure types and output of time periods.
It improves the robustness and classification accuracy of identifying few sample seizure types, enhances the model's generalization ability and real-time performance, and is suitable for clinical applications, with good transferability and applicability.
Smart Images

Figure CN120884243A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of biomedical engineering and artificial intelligence, and particularly relates to an automatic seizure identification method and device based on electroencephalogram data enhancement. BACKGROUND
[0002] Epilepsy is a common neurological disease, and clinically, identifying different types of seizures through electroencephalogram (EEG) is of great significance for the diagnosis and treatment of patients. The current classification of seizures includes tonic seizures (TP), generalized seizures (GP), tonic-clonic seizures (TP-GP), and other types. Among them, tonic seizures and clonic seizures are basic seizure forms, and generalized tonic-clonic seizures are a combination of the two. Different seizure types have significant differences in EEG waveform characteristics, starting position, duration, and other aspects. Accurate identification of seizure types is one of the core tasks of epilepsy diagnosis.
[0003] Currently, epilepsy EEG recognition technology mainly relies on deep learning models trained on large-scale EEG data, and the accuracy of seizure classification is limited by data quality and sample distribution. Currently available epilepsy datasets such as CHB-MIT and TUH provide basic support for model training, but there is a problem of sample imbalance, especially some rare seizure types (such as short tonic seizures and isolated clonic seizures) are rare in the data, resulting in low recognition rate of these seizure types by the trained model.
[0004] Due to the high cost of collecting epilepsy seizure data, current research generally relies on data augmentation methods to improve model performance, such as noise disturbance, sliding window segmentation, signal transformation, etc. However, these methods cannot generate new data with clinical characteristics in essence, and only perform "surface expansion" on existing samples, which has limited effect on improving the recognition ability of the model on the edge class.
[0005] In the recognition of seizure types, current recognition methods mostly treat each seizure type as an independent class, lacking the ability to model the combination relationship of seizure types. For example, tonic seizures and clonic seizures often appear alternately or continuously, forming typical generalized tonic-clonic seizures, but existing methods cannot accurately distinguish whether the seizure is a complex or mixed type, and can only give single-label classification results, which cannot reflect the complex process of the seizure.
[0006] The discriminative features of the epileptic brain electrical signal are often manifested as weak changes such as short-time burst spike waves, rhythm mutation, etc. The existing model still has the problems of misjudgment and omission in extracting these local features, especially in the scene of unmarked data or low-quality data. In addition, most researches focus on the performance evaluation of offline models, and the generalization ability, real-time performance and interpretability of the models are not paid enough attention to, which is difficult to meet the needs of clinicians for identifying "why to judge as this type of seizure". Although some complex models have good performance in the laboratory conditions, they are strongly dependent on hardware and are difficult to migrate to actual application scenarios.
[0007] Based on the above analysis, the problems and defects of the prior art are that the brain electrical data is difficult to obtain and the enhancement effect is limited, the multi-type seizure recognition strategy is insufficient, and there is a lack of new paradigm for seizure classification facing clinical practice. SUMMARY
[0008] The present application provides an automatic seizure recognition method and device based on brain electrical data enhancement to solve the problems of data scarcity, seizure type heterogeneity and complex time sequence dependence faced by existing seizure detection methods.
[0009] The first aspect of the present application provides an automatic seizure recognition method based on brain electrical data enhancement, comprising the following steps: obtaining an original electroencephalogram signal and extracting features from the original electroencephalogram signal to obtain key epilepsy features; using a pre-constructed conditional diffusion model to synthesize the key epilepsy features to obtain epilepsy samples with seizure characteristics; using a pre-constructed multi-scale time sequence discrimination network to extract epilepsy fluctuation features and epilepsy spectrum features from the epilepsy samples with seizure characteristics, and fusing the epilepsy fluctuation features and the epilepsy spectrum features to obtain a fused feature vector; classifying the fused feature vector to obtain the seizure type and its probability distribution, and outputting the occurrence time range of each seizure type in combination with the time window.
[0010] Optionally, the step of obtaining the original electroencephalogram signal and extracting features from the original electroencephalogram signal to obtain the key epilepsy features comprises:
[0011] The original electroencephalogram signal is obtained, and the original electroencephalogram signal is subjected to denoising filtering to obtain a filtered electroencephalogram signal; the filtered electroencephalogram signal is subjected to signal separation to obtain a plurality of independent component electroencephalogram signals; the plurality of independent component electroencephalogram signals are subjected to artifact rejection to obtain a purified electroencephalogram signal, and the purified electroencephalogram signal is subjected to time-frequency transformation and short-time Fourier transformation to obtain a two-dimensional time-frequency graph as the key epilepsy features.
[0012] Optionally, the key epilepsy features are synthesized by using the pre-constructed conditional diffusion model to obtain the epilepsy sample with seizure features, including:
[0013] Based on the pre-constructed conditional diffusion model, Gaussian noise is added to the key epilepsy features to form a noise distribution; and the noise distribution is input into a pre-constructed time-aware U-Net structure to gradually remove the noise in the noise distribution to obtain the epilepsy sample with seizure features.
[0014] Optionally, the multi-scale time sequence discriminant network includes a time domain stream network layer, a frequency domain stream network layer and a fusion network layer, wherein,
[0015] The time domain stream network layer is used to capture the dynamic mode and local waveform features of the epilepsy sample with seizure features on the time axis to obtain epilepsy wave features with different time granularities; the frequency domain stream network layer is used to perform multi-layer convolution, batch normalization and pooling on the epilepsy sample with seizure features to obtain epilepsy spectrum features; and the fusion network layer is used to complementarily fuse the epilepsy wave features with different time granularities and the epilepsy spectrum features through attention mechanism and gating mechanism to obtain the fused feature vector.
[0016] Optionally, the fused feature vector is classified to obtain the seizure type and its probability distribution, and the time window is combined to output the occurrence time range of each seizure type, including:
[0017] The fused feature vector is input into a pre-constructed fully connected multi-layer perceptron for seizure classification to obtain the seizure type and its probability distribution; and a time sequence post-processing mechanism is used to perform window slicing and independent classification on the seizure type probability distribution according to a pre-set step length to obtain the occurrence time range of each seizure type.
[0018] Optionally, the fully connected multi-layer perceptron includes a first fully connected layer, a random inactivation layer, a second fully connected layer and an output layer, wherein the dimensions of the first fully connected layer and the second fully connected layer are different.
[0019] The second aspect embodiment of the present application provides an epilepsy seizure automatic recognition device based on electroencephalogram data enhancement, including:
[0020] The signal preprocessing and enhancement module is used to obtain an original electroencephalogram signal and perform feature extraction on the original electroencephalogram signal to obtain key epilepsy features; the conditional diffusion data synthesis module is used to synthesize the key epilepsy features by using a pre-constructed conditional diffusion model to obtain epilepsy samples with seizure characteristics; the multi-scale dual-flow feature extraction module is used to extract epilepsy fluctuation features and epilepsy spectrum features in the epilepsy samples with seizure characteristics by using a pre-constructed multi-scale time sequence discriminant network, and the epilepsy fluctuation features and the epilepsy spectrum features are fused to obtain a fused feature vector; and the classification output and post-processing module is used to perform seizure classification on the fused feature vector to obtain a seizure type and a probability distribution thereof, and output a time period range of each seizure type in combination with a time window.
[0021] The third aspect of the present application provides an electronic device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the automatic epilepsy seizure recognition method based on electroencephalogram data enhancement as described in the above embodiments.
[0022] The fourth aspect of the present application provides a computer program product, wherein the computer program / instructions are executed by a processor to implement the automatic epilepsy seizure recognition method based on electroencephalogram data enhancement as described above.
[0023] The fifth aspect of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the program is executed by a processor to implement the automatic epilepsy seizure recognition method based on electroencephalogram data enhancement as described above.
[0024] The automatic epilepsy seizure recognition method and device based on electroencephalogram data enhancement provided by the embodiments of the present application use a diffusion model to enhance electroencephalogram data, first introduce a diffusion generation model into an epilepsy signal recognition task, can effectively generate high-quality synthetic data with seizure characteristics, and enhance the recognition robustness of the model for few-sample seizure types; a dual-flow attention fusion feature extraction framework (CD-DASTNet) is proposed, a time-frequency dual-flow structure is innovatively designed, CNN processes spectrum features, LSTM processes time dependence, and an attention mechanism is introduced to extract significant areas and fuse multi-source features; high-dimensional spatiotemporal information fusion and end-to-end discriminant optimization are implemented through multi-scale feature extraction, attention weighting and label smoothing, etc. to realize fine spatiotemporal modeling, while maintaining a lightweight structure, the classification accuracy and generalization ability are greatly improved; a discriminant paradigm suitable for multiple epilepsy seizures is constructed, a neural classification paradigm with migration and expansion is proposed, which can be extended to more seizure types and even other electroencephalogram abnormality detection scenarios, and has wide application value.
[0025] Additional aspects and advantages of the present application will be set forth in part in the description that follows, and in part will become apparent to those having ordinary skill in the art upon examination of the following or can be learned from practice of the present application. BRIEF DESCRIPTION OF DRAWINGS
[0026] The above and / or additional aspects and advantages of the present application will become apparent and be readily appreciated from the following description, taken in conjunction with the accompanying drawings, in which:
[0027] Figure 1 A flowchart of an automatic seizure recognition method based on electroencephalogram data enhancement provided by an embodiment of the present application;
[0028] Figure 2 An execution schematic diagram of a conditional diffusion model provided by an embodiment of the present application;
[0029] Figure 3 An execution schematic diagram of a multi-scale time sequence discriminative network provided by an embodiment of the present application;
[0030] Figure 4 A block schematic diagram of an automatic seizure recognition device based on electroencephalogram data enhancement provided by an embodiment of the present application;
[0031] Figure 5 A structural schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0032] Embodiments of the present application are described in detail below with reference to the accompanying drawings, in which the same or similar components have the same or similar designations and functions throughout. The embodiments described below are exemplary and are intended to explain the present application, and are not to be understood as limiting the present application.
[0033] An automatic seizure recognition method based on electroencephalogram data enhancement and a device thereof are described below with reference to the accompanying drawings for embodiments of the present application.
[0034] Figure 1 A flowchart of an automatic seizure recognition method based on electroencephalogram data enhancement provided by an embodiment of the present application.
[0035] As Figure 1 shown, the automatic seizure recognition method based on electroencephalogram data enhancement includes the following steps:
[0036] In step S101, an original electroencephalogram signal is acquired, and a representation extraction is performed on the original electroencephalogram signal to obtain key epilepsy features.
[0037] In some embodiments, the original electroencephalogram signal is acquired, and a representation extraction is performed on the original electroencephalogram signal to obtain key epilepsy features, including:
[0038] An original electroencephalogram signal is acquired, and the original electroencephalogram signal is subjected to denoising filtering processing to obtain a filtered electroencephalogram signal.
[0039] The filtered electroencephalogram signal is subjected to signal separation to obtain a plurality of independent component electroencephalogram signals.
[0040] The plurality of independent component electroencephalogram signals are subjected to artifact rejection to obtain a purified electroencephalogram signal, and the purified electroencephalogram signal is subjected to time-frequency transformation and short-time Fourier transformation to obtain a two-dimensional time-frequency graph as a key epilepsy feature.
[0041] In actual execution, first, a finite impulse response (FIR) filter is used to realize a 0.5-45 Hz passband limitation to retain delta (0.5-4 Hz), theta (4-8 Hz), alpha (8-13 Hz), beta (13-30 Hz), and gamma (30-45 Hz) band features related to epilepsy, while filtering out low-frequency drift and high-frequency electromyographic interference. In addition, an IIR filter is used to strongly suppress 50 Hz (power interference band) to avoid the mixing of non-brain-derived periodic interference signals.
[0042] Further, an independent component analysis (ICA) algorithm is used to separate signals of a multi-channel EEG, decompose mixed electroencephalogram signals into a plurality of independent components, and then reject artifacts in the independent components. The following three methods are used to determine whether a decomposed component is an artifact component: 1. Spatial distribution anomaly, for example, concentrated in the frontal region, which may be an eye movement artifact; 2. Time waveform anomaly (such as high-amplitude spikes + low-frequency fluctuations); 3. Abnormal power characteristics in the corresponding frequency band, for example, high-frequency noise components typically exhibit electromyographic signal contamination. Finally, the components determined to be artifacts are set to zero, and the purified electroencephalogram signal is reconstructed by inverse transformation.
[0043] Further, each input signal (usually 1-2 seconds long) in the purified electroencephalogram signal is subjected to z-score standardization processing to make its mean value 0 and standard deviation 1, so as to eliminate amplitude differences between different subjects or channels, and obtain a standardized purified electroencephalogram signal.
[0044] In order to make the model perceive time domain waveform features and capture frequency domain dynamic energy distribution, two complementary time-frequency transformation methods are used.
[0045] Firstly, the signal is decomposed by a multi-scale wavelet base (such as Daubechies 4) for 5 layers of wavelet packet decomposition (WPD), and after obtaining a plurality of sub-band coefficients, a time-frequency spectrum with rich frequency band division can be constructed; this decomposition method is particularly suitable for capturing specific frequency band mutation patterns in seizures, such as sharp waves, spiky waves, sharp slow complex waves, etc.
[0046] Further, a short-time Fourier transform (STFT) is performed, the sliding window width is set to 256 sampling points (about 1 second), the window overlap rate is 50%, and the Hamming window is selected as the window function; further, the frequency spectrum of each window segment is calculated, and a two-dimensional time-frequency map is formed by stacking, which can effectively reflect the dynamic frequency spectrum changes in the pre-seizure, seizure and post-seizure stages.
[0047] Finally, the results of wavelet packet decomposition WPD and short-time Fourier transform STFT can be used as image encoding paths for the subsequent CNN-LSTM network after multi-channel feeding, and the fusion information of "spectrum map + original signal waveform" is input.
[0048] In addition, after the original signal is preprocessed, if the data amount is extremely small or the classification is unbalanced, a light enhancement operation can be performed on the preprocessed segments at this stage, for example, a small amount of white noise addition, amplitude scaling, time distortion, etc. Time domain disturbance method, or random mask 1-2 channel to model channel loss, or time shift enhancement can be realized by adjacent frame sliding window expansion. These operations can improve the generalization ability of the model without destroying the original epilepsy characteristics, and form a data diversity supplement mechanism with the subsequent step S102.
[0049] In step S102, a pre-constructed conditional diffusion model is used to synthesize key epilepsy features to obtain epilepsy samples with seizure characteristics.
[0050] In some embodiments, the pre-constructed conditional diffusion model is used to synthesize key epilepsy features to obtain epilepsy samples with seizure characteristics, including:
[0051] Based on the pre-constructed conditional diffusion model, Gaussian noise is added to the key epilepsy features to form a noise distribution;
[0052] The noise distribution is input into the pre-constructed time-aware U-Net structure to gradually remove the noise in the noise distribution, and epilepsy samples with seizure characteristics are obtained.
[0053] In actual implementation, the embodiment of the application adopts a two-stage framework of forward noise adding-reverse noise removing of the conditional diffusion model. In the forward process, the original seizure segment is gradually added with Gaussian noise to form a noise distribution; in the reverse process, a neural network is trained to gradually remove noise, and finally recover a sample similar to the real seizure segment. This process meets the Markov chain assumption and performs conditional sampling at each time t, ensuring that the sample distribution converges to the target distribution.
[0054] Specifically, as shown in Figure 2 The conditional diffusion model used in the embodiment of the application is different from the general unconditional diffusion model. The conditional diffusion model used in the embodiment of the application introduces a condition label as prior information to control the seizure type (such as TP, GP, TP-GP) of the generated sample. The specific implementation includes three steps: first, label embedding, which maps the category label to a vector and then concatenates it to the noise input or injects it into each layer of UNet; second, conditional normalization, which introduces label information using conditional instance normalization; and finally, calculation of category-guided loss, which adds a category consistency loss term to enhance the consistency of the synthesized sample with the target category to form a noise distribution.
[0055] Further, the reverse denoising network adopts a time-aware U-Net structure, which integrates time step embedding into the conventional U-Net to support cross-step prediction. The main structure is a symmetric down-sampling-up-sampling framework, each layer uses a residual convolution block to increase training stability, and position encoding and attention modules are added to improve cross-time scale modeling capability. This network structure supports multi-channel electroencephalogram signal input and joint modeling, maintaining the correlation between channels.
[0056] Considering that seizures have different durations and manifestations, the reverse denoising network adopts a multi-scale diffusion strategy, including long-term and short-term sequences. The long-term diffusion model is used to generate complete seizure segments lasting more than a few seconds, and the short-term diffusion model is used to synthesize local details and feature mutations, such as sharp wave and spike wave segments. The two are trained separately in the training phase and fused to generate samples in proportion (e.g., 2:1 mixture) in the test phase.
[0057] To avoid overfitting of the reverse denoising network during training, the embodiment of the application adopts a curriculum sampling strategy. This strategy mainly trains with real samples in the initial stage; gradually introduces synthetic samples in the middle stage, with a mixing ratio increasing from 10% to 50%; and dynamically adjusts the ratio in the later stage based on the performance of the validation set to ensure that the generalization ability does not decrease.
[0058] In addition, the embodiment of the present application also performs quality evaluation screening on the generated sample, removes abnormal fragments based on spectral entropy, kurtosis and other indicators, and ensures that the synthesized sample does not introduce pseudo-differences.
[0059] In step S103, the pre-constructed multi-scale time sequence discriminant network is used to extract the epilepsy fluctuation features and epilepsy spectrum features in the epilepsy sample with seizure characteristics, and the epilepsy fluctuation features and the epilepsy spectrum features are fused to obtain a fused feature vector.
[0060] In some embodiments, the multi-scale time sequence discriminant network includes a time domain stream network layer, a frequency domain stream network layer, and a fusion network layer, wherein,
[0061] The time domain stream network layer is used to capture the dynamic mode and local waveform features of the epilepsy sample with seizure characteristics on the time axis to obtain epilepsy fluctuation features of different time granularities;
[0062] The frequency domain stream network layer is used to perform multi-layer convolution, batch normalization and pooling on the epilepsy sample with seizure characteristics to obtain epilepsy spectrum features;
[0063] The fusion network layer is used to complementarily fuse the epilepsy fluctuation features of different time granularities and the epilepsy spectrum features through attention mechanism and gating mechanism to obtain a fused feature vector.
[0064] In actual execution process, the embodiment of the present application uses the pre-constructed multi-scale time sequence discriminant network to deeply mine the multi-scale feature expression of the epilepsy seizure EEG signal from the two perspectives of time domain and frequency domain, and improves the recognition accuracy and robustness of the model for different types of seizures (such as typical seizures TP and generalized seizures GP). The multi-scale time sequence discriminant network is designed based on a double-stream structure, which respectively processes the original time domain waveform and time-frequency spectrum data, and realizes the final discrimination through a fusion strategy.
[0065] As shown in Figure 3 The multi-scale time sequence discriminant network (MSDTNet) is composed of the following three parts:
[0066] (1) Temporal Stream: the input is a multi-channel pre-processed waveform sequence, which mainly captures the dynamic mode and local waveform features (such as sharp wave, spike wave sequence) of the epilepsy seizure on the time axis;
[0067] (2) Spectral Stream: the input is a 2D time-frequency graph constructed by STFT or wavelet spectrum, which extracts frequency migration, energy concentration and other spectrum features;
[0068] (3) Fusion Layer: Cascade the time domain stream and frequency domain stream in the feature space, extract key epilepsy-related patterns through attention mechanism and gating mechanism, and realize information complementation.
[0069] Specifically, the time domain stream network layer in the embodiment of the present application adopts a multi-scale convolution block (MSC Block) to extract features from the original EEG waveform. Each convolution block contains three different size convolution kernels (such as 3, 5, and 7) to extract epilepsy wave feature of different time granularity. After that, a bidirectional LSTM (BiLSTM) structure is used to model the time dependence of EEG, enhancing the network's ability to perceive the pre-seizure signs and evolution process. The LSTM output is focused on the high correlation period, such as the spike occurrence position, through the time attention mechanism.
[0070] The frequency domain stream network layer in the embodiment of the present application uses a lightweight CNN (such as EfficientNet or ResNet18) to perform multi-layer convolution, batch normalization, and pooling on the time-frequency graph to extract epilepsy spectrum features; adopts an atrous convolution to expand the receptive field to perceive the long-time span spectrum evolution trend; in addition, a frequency band attention mechanism is specially introduced to automatically identify the frequency band specific to different seizure types (such as theta wave concentration or gamma wave burst) and give it a higher weight.
[0071] The fusion network layer in the embodiment of the present application concatenates the two features after flattening to form a unified representation vector. Then, a gated feature fusion module is connected to control the passing strength of different modal features and enhance the response to important feature channels. Finally, a multi-layer fully connected neural network is connected, and the classification probability of the seizure is output.
[0072] In addition, in order to improve the model's sensitivity to the discrimination of different types of epilepsy, the embodiment of the present application also introduces a multi-task learning strategy. The main task in the multi-task learning strategy is seizure type classification (multi-class cross-entropy loss), and the auxiliary tasks include waveform peak detection (for locating the spike time) and spectrum energy change prediction (for measuring the severity of the seizure). The model is trained through a weighted joint loss function to realize structural regularization and improve the generalization performance.
[0073] In step S104, the fused feature vector is classified for seizures to obtain the seizure type and its probability distribution, and the time window is combined to output the occurrence time range of each seizure type.
[0074] In some embodiments, the fused feature vector is classified for seizures to obtain the seizure type and its probability distribution, and the time window is combined to output the occurrence time range of each seizure type, including:
[0075] The fused feature vector is input into a pre-constructed fully connected multilayer perceptron for seizure classification to obtain a seizure type and a probability distribution thereof.
[0076] The seizure type probability distribution is sliced and independently classified according to a preset step length by using a time sequence post-processing mechanism to obtain a time period range of each seizure type.
[0077] The fully connected multilayer perceptron includes a first fully connected layer, a random inactivation layer, a second fully connected layer and an output layer, wherein the dimensions of the first fully connected layer and the second fully connected layer are different.
[0078] In actual execution, the pre-constructed fully connected multilayer perceptron (MLP) of the embodiment includes a first fully connected layer, a random inactivation layer, a second fully connected layer and an output layer, wherein the first fully connected layer is a 512-dimensional fully connected layer, the activation function is ReLU, the random inactivation Dropout layer (p=0.5) prevents overfitting, the second fully connected layer is a 256-dimensional fully connected layer, followed by a BN layer and ReLU, the output layer has an output dimension set according to the number of seizure categories (such as 3 categories: TP, GP and TP-GP), the activation function is Softmax, the classification probability is output, and if there is a multi-label situation (such as a composite seizure type), the output layer can be replaced with a Sigmoid multi-label classifier.
[0079] Considering that some types (such as generalized seizures) have fewer samples in actual epilepsy data, the following strategies are used in the training phase of the MLP to improve the recognition accuracy of small classes:
[0080] (1) Class Weighted Loss Function: Set a weight inversely proportional to the frequency of each class of samples in the cross-entropy;
[0081] (2) Improved Focal Loss: Further improve the loss gradient of difficult-to-classify samples (such as TP-GP ambiguous boundary);
[0082] (3) Dynamic Resampling: Dynamically adjust the sampling frequency of small classes according to the accuracy of each class during training.
[0083] Further, since the classification window is short (such as a 2s segment), the MLP output may have short-term fluctuations and class switching, and therefore the following post-processing mechanism is designed:
[0084] (1) Sliding Window Voting: The signal is sliced into segments with a certain step length (such as 0.5s), and each segment is independently classified; a sliding aggregation window (such as 5s) is set, and the highest probability category in the period is taken as the final output to smooth short-term misjudgments.
[0085] (2) Category persistence determination rule, a minimum duration threshold (such as 2.5s) is introduced, and if the duration of a category is insufficient, it is determined as "non-seizure" or merged into the last stage category; reduce the false alarm in the early stage of seizure, and improve the clinical practicability.
[0086] In addition, the final output not only includes the seizure type (TP, GP, TP-GP), the corresponding probability distribution and the seizure starting and ending period, but also provides visual atlas including time domain waveform + classification heat map (different colors represent classification results), frequency spectrum + energy change trend line and key feature highlight (such as sharp wave position label) of suspicious seizure period. These visual atlas can help medical staff to assist in diagnosis and abnormal segment review, and improve the algorithm transparency.
[0087] The epileptic seizure automatic recognition method based on electroencephalogram data enhancement provided by the embodiment of the application has the following beneficial effects:
[0088] (1) In the process of cleaning, standardizing and representing the original EEG signal, the sensitivity to key epilepsy features in the subsequent steps can be improved, and the robustness and recognition accuracy of the overall system can be improved;
[0089] (2) By using the diffusion model to enhance sample diversity and combining double-flow feature extraction, the average recognition accuracy is improved by about 3%-7% compared with existing methods (such as CNN, LSTM and Transformer) in multiple public epilepsy databases;
[0090] (3) The training set enhanced by the diffusion model can effectively alleviate the problems of class imbalance and data scarcity, improve the recognition ability of the classifier to edge samples and small-class seizures, and improve the recognition stability of the minority class, showing strong robustness;
[0091] (4) The multi-scale feature expression of the epileptic seizure EEG signal is deeply mined from the time domain and the frequency domain, which improves the recognition accuracy and robustness of the model to different types of seizures (such as typical seizures TP and generalized seizures GP);
[0092] (5) The attention mechanism locates the key frequency band and time window, and can output the time period range of the seizure occurrence, so as to have certain explanation ability in clinical visualization application, support auxiliary diagnosis, and facilitate doctor review and pathological analysis;
[0093] (6) The whole Diff-DASTNet structure is light, the reasoning time is less than 100ms, is suitable for edge deployment or mobile diagnosis and treatment equipment, has good real-time performance and migratability, and has low calculation cost.
[0094] Secondly, the epileptic seizure automatic recognition device based on electroencephalogram data enhancement provided by the embodiment of the application is described with reference to the accompanying drawings.
[0095] Figure 4 A block schematic diagram of an automatic seizure recognition device based on electroencephalogram data enhancement provided by an embodiment of the present application.
[0096] As shown in Figure 4 The automatic seizure recognition device 40 based on electroencephalogram data enhancement includes a signal preprocessing and enhancement module 401, a conditional diffusion data synthesis module 402, a multi-scale dual-flow feature extraction module 403, and a classification output and post-processing module 404.
[0097] The signal preprocessing and enhancement module 401 is configured to obtain an original electroencephalogram signal and extract features from the original electroencephalogram signal to obtain key epilepsy features. The conditional diffusion data synthesis module 402 is configured to synthesize the key epilepsy features using a pre-constructed conditional diffusion model to obtain epilepsy samples with seizure characteristics. The multi-scale dual-flow feature extraction module 403 is configured to extract epilepsy fluctuation features and epilepsy spectrum features from the epilepsy samples with seizure characteristics using a pre-constructed multi-scale time series discriminant network, and fuse the epilepsy fluctuation features and the epilepsy spectrum features to obtain a fused feature vector. The classification output and post-processing module 404 is configured to classify the fused feature vector to obtain the seizure type and its probability distribution, and output the time window of each seizure type.
[0098] In some embodiments, the signal preprocessing and enhancement module 401 includes:
[0099] A signal denoising unit is configured to obtain an original electroencephalogram signal and perform denoising filtering on the original electroencephalogram signal to obtain a filtered electroencephalogram signal.
[0100] A signal separation unit is configured to perform signal separation on the filtered electroencephalogram signal to obtain a plurality of independent component electroencephalogram signals.
[0101] A signal enhancement unit is configured to remove artifacts from the plurality of independent component electroencephalogram signals to obtain purified electroencephalogram signals, and perform time-frequency transformation and short-time Fourier transformation on the purified electroencephalogram signals to obtain a two-dimensional time-frequency graph as key epilepsy features.
[0102] In some embodiments, the conditional diffusion data synthesis module 402 includes:
[0103] A forward noise adding unit is configured to add Gaussian noise to the key epilepsy features based on a pre-constructed conditional diffusion model to form a noise distribution.
[0104] A reverse denoising unit is configured to input the noise distribution into a pre-constructed time-aware U-Net structure to gradually remove noise in the noise distribution to obtain epilepsy samples with seizure characteristics.
[0105] In some embodiments, the multi-scale time sequence discriminant network comprises a time domain stream network layer, a frequency domain stream network layer and a fusion network layer, wherein,
[0106] The time domain stream network layer is configured to capture dynamic patterns and local waveform features of the epilepsy samples with seizure characteristics on a time axis to obtain epilepsy wave features with different time granularities;
[0107] The frequency domain stream network layer is configured to perform multi-layer convolution, batch normalization and pooling on the epilepsy samples with seizure characteristics to obtain epilepsy spectrum features;
[0108] The fusion network layer is configured to perform information complementary fusion on the epilepsy wave features with different time granularities and the epilepsy spectrum features through attention mechanism and gating mechanism to obtain a fused feature vector.
[0109] In some embodiments, the classification output and post-processing module 404 comprises:
[0110] a classification unit, the fused feature vector is input into a pre-constructed fully connected multi-layer perceptron for seizure classification to obtain a seizure type and a probability distribution thereof;
[0111] a post-processing unit configured to utilize a time sequence post-processing mechanism to perform sliding window slicing and independent classification on the seizure type and the probability distribution thereof according to a preset step size to obtain a time range of occurrence of each seizure type.
[0112] In some embodiments, the fully connected multi-layer perceptron comprises a first fully connected layer, a random deactivation layer, a second fully connected layer and an output layer, wherein the dimensions of the first fully connected layer and the second fully connected layer are different.
[0113] It should be noted that the foregoing explanation and description of the epilepsy seizure automatic identification method based on EEG data enhancement embodiment also applies to the epilepsy seizure automatic identification device based on EEG data enhancement of this embodiment, which will not be described here.
[0114] The epilepsy seizure automatic identification device based on EEG data enhancement according to the embodiment of the present application has the following beneficial effects:
[0115] (1) After cleaning, standardizing and feature extraction of the original EEG signal, the sensitivity to key epilepsy features in the subsequent steps can be improved, and the robustness and recognition accuracy of the overall system can be improved;
[0116] (2) By enhancing sample diversity through a diffusion model and combining with double stream feature extraction, an average recognition accuracy improvement of about 3%-7% higher than existing methods (such as CNN, LSTM, Transformer) is achieved in multiple epilepsy public databases;
[0117] (3) The training set enhanced by the diffusion model can effectively alleviate the class imbalance and data scarcity problems, improve the recognition ability of the classifier for edge samples and small class seizures, and the recognition stability of the minority class, and show strong robustness;
[0118] (4) The multi-scale feature expression of the seizure EEG signal is deeply mined from the time domain and the frequency domain, and the recognition accuracy and robustness of the model for different types of seizures (such as typical seizures TP and generalized seizures GP) are improved;
[0119] (5) The attention mechanism locates the key frequency band and time window, can output the time range of the seizure occurrence, has certain explanation ability in the clinical visualization application, supports auxiliary diagnosis, and is convenient for doctors to review and pathological analysis;
[0120] (6) The whole Diff-DASTNet structure is light, the reasoning time is less than 100ms, is suitable for edge deployment or mobile diagnosis and treatment equipment, has good real-time performance and migration performance, and has low calculation cost.
[0121] Figure 5 The structure schematic diagram of the electronic equipment provided by the embodiment of the application is provided. The electronic equipment can include:
[0122] The memory 501, the processor 502 and the computer program stored in the memory 501 and executable on the processor 502.
[0123] The processor 502 implements the automatic seizure recognition method based on the EEG data enhancement provided in the above embodiment when executing the program.
[0124] Further, the electronic equipment further includes:
[0125] The communication interface 503 is used for communication between the memory 501 and the processor 502.
[0126] The memory 501 is used to store the computer program executable on the processor 502.
[0127] The memory 501 can include a high-speed RAM memory, and can also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0128] If the memory 501, the processor 502 and the communication interface 503 are implemented independently, the communication interface 503, the memory 501 and the processor 502 can be connected with each other through a bus and complete communication between each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For convenience of representation, Figure 5 Only one thick line is used in the figure to represent the bus, but it does not mean that there is only one bus or only one type of bus.
[0129] Optionally, in a specific implementation, if the memory 501, the processor 502 and the communication interface 503 are integrated on a chip, the memory 501, the processor 502 and the communication interface 503 can complete communication between each other through an internal interface.
[0130] The processor 502 can be a Central Processing Unit (CPU), or an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present application.
[0131] The embodiment of the present application further provides a computer program product, and the computer program / instruction is executed by the processor to realize the automatic seizure identification method based on electroencephalogram data enhancement as above.
[0132] The embodiment of the present application further provides a computer readable storage medium, and the computer program is stored on the computer readable storage medium, and the program is executed by the processor to realize the automatic seizure identification method based on electroencephalogram data enhancement as above.
[0133] In the description of the application, reference to "one embodiment", "some embodiments", "an example", "a specific example", or "some examples" means that a particular feature, structure, material, or characteristic being described is included in at least one embodiment or example of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment or example. Furthermore, the described specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples. In addition, the usage of "first", "second" and the like does not indicate any order but rather serves merely to name various components. Moreover, the usage of "top", "bottom", and the like is made for the purpose of illustration only and does not indicate any orientation. The terms "coupled" and "connected", along with their derivatives, can be used. It should be understood that these terms are not intended as synonyms for each other. Rather, particular features are described as being coupled or connected where the feature is in some way present, for example through shared use of one or more components, and can be communicatively, electrically, structurally, and / or mechanically connected, for example. Similarly, "coupled" or "connected" can be used to indicate that two or more members are either directly in contact or indirectly in contact through one or more intermediate members.
[0134] Furthermore, the terms "first", "second", and the like, merely denote different categories, and do not imply a relative importance or a specific order. Thus, features defined with "first", "second" and the like can include at least one of the features, either explicitly or implicitly. In the description of the application, the term "N" means at least two, for example two, three, etc., unless explicitly specified otherwise.
[0135] Any process or method descriptions or blocks in flow charts or otherwise described herein represent embodiments of modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps, and alternate implementations are possible. In some embodiments, the processes or methods described can be accomplished with one or more hardware items, for example, hardwired circuits, memory, logic circuits, look-up tables, microcode or the like, software programs, firmware programs, microcode routines, embedded logic, embedded software, or any combination thereof, which work together to cause a general purpose computer, a special purpose computer, or both, to perform the processes or methods described. The various embodiments further can interact with a user through one or more computer programs, software applications, firmware applications, operating systems, or the like, which interact with a user. Such software can be written in any of a variety of suitable programming languages and can be executed using a variety of suitable hardware and software configurations. It will be appreciated that computer programs, software applications, firmware applications, operating systems, or the like, can be written in any combination of one or more suitable programming languages, and that such software can be executed using one or more computing devices capable of netlist generation as described herein.
[0136] The logic and / or steps represented in the flowcharts and / or described herein, for example, can be considered as a sequence of instructions to implement logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, apparatus, or device, such as a computer-based system, processor- based system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For purposes of this specification, a "computer-readable medium" can be any apparatus that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. The computer-readable medium can be a computer- readable storage medium or a computer-readable signal medium. The computer- readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium include the following: an electrical connection having one or more wires (electrical connections), a portable computer diskette (a magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, and a portable compact disc read-only memory (CDROM). In addition, the computer-readable medium can even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via, for example, optical scanning of the paper or other medium, then compiled, interpreted, or otherwise processed in a suitable manner, if necessary, and then stored in a computer memory.
[0137] It should be understood that aspects of the application can be implemented in hardware, software, firmware or combinations thereof. In the above embodiments, the N steps or methods can be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. If implemented in hardware and in another embodiment, any of the following technologies, known in the art, or their combinations can be used: discrete logic circuitry having logic gates for implementing logic functions on data signals, application specific integrated circuits having appropriate combinational logic gates, programmable gate arrays (PGA), field programmable gate arrays (FPGA), etc.
[0138] Those skilled in the art can understand that all or part of the steps carried out by the above-mentioned embodiment method can be completed by a program instructing related hardware, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes one of the steps of the method embodiment or a combination thereof.
[0139] In addition, each function unit in each embodiment of the present application can be integrated in one processing module, or each unit can be physically present separately, or two or more units can be integrated in one module. The integrated module can be realized in the form of hardware or in the form of a software function module. When the integrated module is realized in the form of a software function module and sold or used as an independent product, it can also be stored in a computer readable storage medium.
[0140] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it should be understood that the above embodiments are exemplary and should not be construed as limiting the present application, and those skilled in the art can make changes, modifications, replacements and variations to the above embodiments within the scope of the present application.
Claims
1. An automatic method for recognizing epileptic seizures based on EEG data augmentation, characterized in that, Includes the following steps: The raw electroencephalogram (EEG) signal was acquired, and the raw EEG signal was characterized and extracted to obtain key epilepsy features; The key epilepsy features are synthesized using a pre-constructed conditional diffusion model to obtain epilepsy samples with seizure characteristics. The epileptic fluctuation features and epileptic spectrum features in the epileptic samples with seizure characteristics are extracted using a pre-constructed multi-scale temporal discriminant network, and the epileptic fluctuation features and epileptic spectrum features are fused to obtain a fused feature vector. The fused feature vectors are used to classify seizures, resulting in seizure types and their probability distributions. The time range of each seizure type is then output in conjunction with a time window.
2. The automatic seizure recognition method based on EEG data enhancement according to claim 1, characterized in that, The process of acquiring raw electroencephalogram (EEG) signals and performing characterization and extraction on these signals to obtain key epilepsy features includes: The original electroencephalogram (EEG) signal is acquired, and the original EEG signal is subjected to noise reduction filtering to obtain a filtered EEG signal. The filtered EEG signal is then separated to obtain EEG signals with multiple independent components; Artifact removal is performed on the EEG signals of the multiple independent components to obtain purified EEG signals. Time-frequency transformation and short-time Fourier transform are then performed on the purified EEG signals to obtain a two-dimensional time-frequency map as the key epileptic feature.
3. The automatic seizure recognition method based on EEG data enhancement according to claim 1, characterized in that, The process of synthesizing the key epilepsy features using a pre-built conditional diffusion model to obtain epilepsy samples with seizure characteristics includes: Based on the pre-constructed conditional diffusion model, Gaussian noise is added to the key epilepsy features to form a noise distribution; The noise distribution is input into a pre-constructed time-aware U-Net structure to gradually remove noise from the noise distribution, thereby obtaining the epilepsy sample with seizure characteristics.
4. The automatic seizure recognition method based on EEG data enhancement according to claim 1, characterized in that, The multi-scale temporal discrimination network includes a temporal stream network layer, a frequency stream network layer, and a fusion network layer, wherein... The temporal flow network layer is used to capture the dynamic patterns and local waveform features of the epilepsy samples with seizure characteristics on the time axis, so as to obtain epilepsy fluctuation features at different time granularities. The frequency domain flow network layer is used to perform multi-layer convolution, batch normalization, and pooling on the epilepsy samples with seizure characteristics to obtain the epilepsy spectral features. The fusion network layer is used to perform information complementarity fusion on the epilepsy fluctuation features and epilepsy spectrum features at different time granularities through attention and gating mechanisms to obtain the fused feature vector.
5. The automatic seizure recognition method based on EEG data enhancement according to claim 1, characterized in that, The process of classifying the fused feature vectors to obtain seizure types and their probability distributions, and outputting the time range of occurrence for each seizure type in conjunction with a time window, includes: The fused feature vector is input into a pre-built fully connected multilayer perceptron for seizure classification to obtain the seizure type and its probability distribution. Using a time-series post-processing mechanism, the probability distribution of the attack types is sliced by sliding window and independently classified according to a preset step size to obtain the occurrence time range of each attack type.
6. The automatic seizure recognition method based on EEG data enhancement according to claim 5, characterized in that, The fully connected multilayer perceptron includes a first fully connected layer, a random deactivation layer, a second fully connected layer, and an output layer, wherein the first fully connected layer and the second fully connected layer have different dimensions.
7. An automatic seizure recognition device based on EEG data enhancement, characterized in that, include: The signal preprocessing and enhancement module is used to acquire raw EEG signals and perform characterization and extraction on the raw EEG signals to obtain key epilepsy features; The conditional diffusion data synthesis module is used to synthesize the key epilepsy features using a pre-built conditional diffusion model to obtain epilepsy samples with seizure characteristics. The multi-scale dual-stream feature extraction module is used to extract the epileptic fluctuation features and epileptic spectrum features from the epileptic samples with seizure characteristics using a pre-constructed multi-scale temporal discriminant network, and to fuse the epileptic fluctuation features and the epileptic spectrum features to obtain the fused feature vector. The classification output and post-processing module is used to classify the fused feature vectors into seizure types and their probability distributions, and output the occurrence time range of each seizure type in combination with a time window.
8. An electronic device, characterized in that, include: The memory, the processor, and the computer program stored in the memory and executable on the processor, the processor executing the program to implement the automatic seizure identification method based on EEG data enhancement as described in any one of claims 1-6.
9. A computer program product, characterized in that, When the computer program / instruction is executed by the processor, it implements the automatic seizure recognition method based on EEG data enhancement as described in any one of claims 1-6.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, The program is executed by a processor to implement the automatic seizure identification method based on EEG data enhancement as described in any one of claims 1-6.