An epilepsy electroencephalogram signal detection system and method based on a diffusion attention model

By combining a diffusion model with an adaptive attention mechanism, the EEG signal is gradually denoised and reconstructed, and an adaptive gradient correction term is introduced. This solves the accuracy and robustness problems of existing technologies for detecting epilepsy EEG signals, and achieves efficient detection of epileptic seizures.

CN119279521BActive Publication Date: 2025-11-21SHANDONG UNIV SHENZHEN RES INST
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411674927.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-21
Publication Date
2025-11-21
Estimated Expiration
2044-11-21

AI Technical Summary

Technical Problem

Existing machine learning methods struggle to effectively handle high-dimensional, highly redundant, and complex EEG data in epilepsy EEG signal detection, especially when faced with different epilepsy types and complex spatial distributions. Their detection performance is poor, and diffusion models have difficulty focusing on key segments, limiting the accuracy of epilepsy seizure detection.

Method used

By combining a diffusion model with an adaptive attention mechanism, EEG signals are reconstructed through stepwise denoising. An adaptive gradient correction term and dynamic weighting coefficients are introduced to enhance the extraction of epileptic seizure-related features. Furthermore, a multi-layer fully connected classifier is used to improve detection accuracy.

Benefits of technology

It significantly improves the accuracy and robustness of epileptic seizure detection, especially under conditions of high-dimensional noise EEG signals and complex spatial distribution, where the detection performance is significantly improved, with an accuracy rate of 99.02%.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119279521B_ABST
    Figure CN119279521B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of electroencephalogram signal detection, and specifically discloses an epilepsy electroencephalogram signal detection system and method based on a diffusion attention model. The system comprises: an acquisition unit configured to acquire an electroencephalogram signal to be detected and perform preprocessing; a reconstruction unit configured to input the preprocessed electroencephalogram signal into a diffusion attention model to perform denoising and simultaneously extract epilepsy seizure-related features; wherein the diffusion attention model uses a diffusion model to reconstruct the signal by gradually denoising and introduces an adaptive gradient correction term to iteratively optimize the signal; in the reconstruction process at each stage, the adaptive attention mechanism is used to enhance the extraction of epilepsy seizure-related features; and a detection unit configured to use a classifier to classify the epilepsy seizure-related features to obtain an epilepsy seizure detection result. The application improves the feature extraction capability of high-dimensional noisy electroencephalogram signals and significantly improves the accuracy of epilepsy seizure detection.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of electroencephalogram detection, and particularly relates to an epilepsy electroencephalogram signal detection system and method based on a diffusion attention model. BACKGROUND

[0002] The statements in this section merely provide background information related to the present application and do not necessarily constitute the prior art.

[0003] Epilepsy is a neurological disorder affecting hundreds of millions of people worldwide, characterized by unpredictable seizures that greatly impact the quality of life of patients. Therefore, it is necessary to detect seizures in a timely and accurate manner.

[0004] Electroencephalogram (EEG) can reflect the electrical activity of the brain and is an extremely important tool for analyzing epilepsy. Doctors can detect epilepsy based on multi-channel electroencephalogram; however, due to the uncertainty of seizures, doctors need to monitor the lengthy electroencephalogram records of patients for a long time, which not only consumes time and effort, but also easily leads to missed diagnosis or misdiagnosis.

[0005] Currently, machine learning techniques are widely used in automated seizure detection, showing encouraging results. Common machine learning methods include support vector machines (SVM), random forests (RF), decision trees (DT), and naive Bayes models. Although these methods provide convenience for automatic seizure detection, their scalability is often limited when dealing with large-scale data sets. In addition, the feature extraction of traditional machine learning relies on manually designed algorithms, which often requires rich domain knowledge.

[0006] In recent years, the rise of deep learning algorithms has greatly improved the feature extraction process. These algorithms can automatically learn and extract features from data, eliminating the need for human intervention and performing outstandingly when dealing with large-scale data. For example, many researchers use convolutional neural networks (CNN) to extract features from electroencephalogram data; in addition, recurrent neural networks (RNN) are also widely used for electroencephalogram signal feature extraction and seizure detection, and have achieved remarkable results. Although these deep learning methods have achieved many successes, they still face some challenges when dealing with high-dimensional, high-redundancy, and complex electroencephalogram data. One major limitation is that these models have difficulty effectively processing complex electroencephalogram signals, especially when facing different types of epilepsy and complex spatial distribution of electroencephalogram data, the detection performance may be poor.

[0007] Diffusion models, as a kind of generative model, have shown unique advantages in dealing with complex high-dimensional data. In recent years, they have been increasingly applied to tasks such as classification, object detection and semantic segmentation. Although diffusion models perform well in dealing with complex data, they often have difficulty in focusing on key segments in the input data, limiting the effective extraction of key features. Since the duration of a seizure is usually much shorter than that of a non-seizure, the data of the seizure period in electroencephalogram (EEG) is often less, which greatly limits the application of diffusion models in the detection of epileptic EEG signals. In addition, most existing diffusion models are designed for generative tasks, making it difficult to implement seizure detection based on multi-channel EEG signals. SUMMARY

[0008] To solve the above problems, the present application proposes a seizure EEG signal detection system and method based on a diffusion attention model, which applies attention mechanisms to diffusion models for seizure detection based on EEG signals, enhances the sensitivity of the model to seizure-related features, and improves the feature extraction capability of high-dimensional noisy EEG signals. Through adaptive correction of the reconstructed signal, the signal details during the seizure can be better captured, and the accuracy of seizure detection is improved.

[0009] In some embodiments, the following technical solutions are adopted:

[0010] A seizure EEG signal detection system based on a diffusion attention model, comprising:

[0011] An acquisition unit configured to acquire the EEG signal to be detected through sequentially connected electrodes, EEG amplifiers and A / D converters, and to perform preprocessing;

[0012] A reconstruction unit configured to input the preprocessed EEG signal into a diffusion attention model for denoising and extracting seizure-related features; wherein the diffusion attention model uses a diffusion model to reconstruct the signal by gradually denoising, and introduces an adaptive gradient correction term to iteratively optimize the signal; in each stage of the reconstruction process, the adaptive attention mechanism is used to enhance the extraction of seizure-related features;

[0013] A detection unit configured to classify the seizure-related features using a classifier to obtain a seizure detection result.

[0014] As a further solution, the diffusion model, in the training stage, gradually introduces random noise to the EEG signal through a forward diffusion process to simulate the noise complexity in the EEG data; through a backward diffusion process, the EEG signal is gradually denoised and reconstructed.

[0015] As a further approach, the diffusion model reconstructs the signal through stepwise denoising and introduces an adaptive gradient correction term to iteratively optimize the signal, specifically as follows:

[0016]

[0017] in, This is the reconstruction signal for the current time step. The reconstructed signal from the previous time step; α t For step size parameters, The logarithmic probability density gradient of the noisy data; For the adaptive gradient correction term, β t These are regulatory parameters associated with epileptic seizures. This represents the difference between data from adjacent time steps.

[0018] As a further solution, the reconstruction loss function of the diffusion model is specifically as follows:

[0019]

[0020] in, The reconstruction loss function is given, where T is the total number of steps. This is the preprocessed EEG signal. The reconstructed signal at the current time step; λ t The dynamic weighting coefficients are calculated using the following formula:

[0021]

[0022] in, This is the reconstruction signal from the previous time step.

[0023] As a further step, after reconstructing the signal using a diffusion model, the method also includes adding location coding to the reconstructed signal to preserve the temporal sequence of the EEG signal.

[0024] As a further approach, an adaptive attention mechanism is used to enhance the extraction of features related to epileptic seizures, specifically:

[0025]

[0026] in, For the reconstructed signal after adding position encoding, W Q W K W V They are based on The learned query matrix, key matrix, and value matrix, d k This indicates the size of the last dimension of the key matrix.

[0027] As a further embodiment, the classifier includes three fully connected layers. Between the first and second fully connected layers, a normalization layer, a ReLU activation function, and a Dropout layer are connected sequentially. A ReLU activation function is connected between the second and third fully connected layers. The third fully connected layer outputs the classification result.

[0028] As a further solution, the loss function of the classifier Specifically:

[0029]

[0030] Among them, y i For tag categories, For the corresponding prediction category, i represents the i-th data point, and N represents the non-epileptic seizure category. batch w1 represents the batch size of the input network; w1 and w2 are the weights of the epileptic seizure category and the non-epileptic seizure category, respectively, with w1 > w2.

[0031] In other embodiments, the following technical solutions are adopted:

[0032] A method for detecting epileptic EEG signals based on a diffuse attention model, comprising:

[0033] The EEG signal to be detected is acquired by connecting electrodes, an EEG amplifier, and an A / D converter in sequence, and then preprocessed.

[0034] The preprocessed EEG signal is input into a diffusion attention model for denoising, while features related to epileptic seizures are extracted. The diffusion attention model reconstructs the signal by progressive denoising using a diffusion model and introduces an adaptive gradient correction term to iteratively optimize the signal. In each stage of reconstruction, an adaptive attention mechanism is used to enhance the extraction of features related to epileptic seizures.

[0035] A classifier is used to classify features related to epileptic seizures to obtain epileptic seizure detection results.

[0036] In other embodiments, the following technical solutions are adopted:

[0037] An epilepsy EEG signal detection and classification device, which performs the aforementioned epilepsy EEG signal detection method based on a diffuse attention model, includes: electrodes, an EEG amplifier, an A / D converter, and a control host connected in sequence; the control host contains:

[0038] The preprocessing unit is used to preprocess the acquired EEG signals;

[0039] The reconstruction unit is configured to input preprocessed EEG signals into a diffusion attention model for denoising, while extracting features related to epileptic seizures; wherein the diffusion attention model reconstructs the signal by progressive denoising using a diffusion model and introduces an adaptive gradient correction term to iteratively optimize the signal; during each stage of reconstruction, the extraction of epileptic seizure-related features is enhanced through an adaptive attention mechanism.

[0040] The classification unit is used to classify the characteristics related to epileptic seizures to obtain the epileptic seizure detection results;

[0041] The output unit is used to output and display the results of epileptic seizure detection.

[0042] Compared with the prior art, the beneficial effects of the present invention are:

[0043] (1) This invention combines a diffusion model and an adaptive attention mechanism to perform automatic detection of epileptic seizures based on EEG signals. The diffusion model is used to denoise and reconstruct the EEG signals, reconstructing the original data from the noisy data. It can gradually extract hierarchical features from multi-channel EEG signals to achieve efficient feature extraction. The adaptive attention mechanism enhances the extraction of features related to epileptic seizures, enabling the model to focus on analyzing time segments and frequency bands of signals related to epileptic seizures. This not only improves the feature extraction capability of high-dimensional noisy EEG signals, but also significantly improves the accuracy of epileptic seizure detection.

[0044] (2) When using the diffusion model for signal reconstruction, the present invention introduces an adaptive gradient correction term. This correction term changes with the data changes between two adjacent time steps. When the data changes significantly, the adaptive gradient correction term increases accordingly, which can help the model better capture signal details during epileptic seizures, improve the sensitivity to abrupt change points before and after seizures, enhance the accuracy of the reconstruction process, and especially improve the accuracy of signal reconstruction at the moment of epileptic seizures.

[0045] (3) The present invention adds a dynamic weighting coefficient to the reconstruction loss function of the diffusion model, which can adjust the weight according to whether the current time point is close to the epileptic seizure period, so that the model can pay more attention to the signal reconstruction during the epileptic seizure.

[0046] (4) In this invention, the weights of epileptic seizure category and non-epilepsy seizure category are added to the loss function of the classifier, and the weight of epileptic seizure category is set to be greater than that of non-epilepsy seizure category. This can increase the model’s attention to epileptic seizure samples, improve the detection ability of minority epileptic seizure data, and avoid inaccurate detection results due to the lack of epileptic seizure data.

[0047] Other features and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0048] Figure 1 This is a schematic diagram of an epilepsy EEG signal detection system based on a diffuse attention model in an embodiment of the present invention;

[0049] Figure 2 This is a schematic diagram of the signal reconstruction process in an embodiment of the present invention;

[0050] Figure 3 This is a schematic diagram of the classifier structure in an embodiment of the present invention;

[0051] Figure 4(a) is a schematic diagram of the original EEG signal of epileptic seizure in an embodiment of the present invention;

[0052] Figure 4(b) is a schematic diagram of the original signals of non-epileptic seizure EEG signals in an embodiment of the present invention;

[0053] Figure 5(a) is a diagram of the electroencephalogram (EEG) characteristics of epileptic seizures in an embodiment of the present invention;

[0054] Figure 5(b) is a diagram of the electroencephalogram (EEG) characteristics of non-epileptic seizures in an embodiment of the present invention;

[0055] Figure 6 This is a schematic diagram of the process of the epilepsy EEG signal detection method based on the diffuse attention model in an embodiment of the present invention;

[0056] Figure 7 This is a schematic diagram of the hardware structure of the electroencephalogram (EEG) detection device in an embodiment of the present invention. Detailed Implementation

[0057] It should be noted that the following detailed descriptions are illustrative and intended to provide further explanation of this application. Unless otherwise specified, all technical and scientific terms used in this invention have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains.

[0058] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments according to this application. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.

[0059] Example 1

[0060] In one or more embodiments, an epilepsy EEG signal detection system based on a diffuse attention model is disclosed, combined with Figure 1 Specifically, it includes:

[0061] (1) The acquisition unit is configured to acquire the EEG signal to be detected through electrodes, an EEG amplifier and an A / D converter connected in sequence, and to perform preprocessing.

[0062] As a specific implementation method, the EEG signals of the user under test are acquired through electrodes, a multi-channel EEG amplifier and an A / D converter, with a sampling frequency of 256Hz; multiple electrodes are distributed on the scalp surface to capture electrical signals from different areas of the brain, thereby providing rich spatiotemporal information.

[0063] The acquired raw EEG signals underwent preprocessing, including segmentation, filtering, and normalization, as follows: First, the signal was divided into segments of 1 second each with a 50% overlap. Then, a bandpass filter was applied within the 1-40Hz frequency range to remove irrelevant noise and artifacts, retaining the main frequency components required for subsequent analysis. Because patients exhibit significant variations in EEG amplitude, Z-score normalization was performed to reduce these differences, ensuring the signal amplitude falls within a fixed range and providing a more stable signal basis for subsequent analysis.

[0064] Given raw EEG signals Where C represents the number of channels in the EEG signal, T n This represents the number of time steps. The Z-score normalization process involves subtracting the mean and dividing by the standard deviation, as shown in the following formula:

[0065]

[0066] Where μ and σ are the mean and standard deviation of the EEG data for each channel, This is the normalized EEG signal.

[0067] (2) The reconstruction unit is configured to input the preprocessed EEG signal into the diffusion attention model for denoising and extract features related to epileptic seizures. The diffusion attention model uses a diffusion model to reconstruct the signal by progressive denoising and introduces an adaptive gradient correction term to iteratively optimize the signal. In each stage of reconstruction, the extraction of features related to epileptic seizures is enhanced by an adaptive attention mechanism.

[0068] In this embodiment, the diffusion attention model includes a diffusion model and an adaptive attention mechanism. During the training phase, the diffusion model gradually introduces random noise into the EEG signal through a forward diffusion process. The purpose of the forward diffusion process is to simulate the noise and complexity in the EEG data, so that the model can extract important epilepsy-related features during the reconstruction process. Then, the model gradually removes noise through a reverse diffusion process to obtain the reconstructed EEG signal.

[0069] Combination Figure 2 In the diffusion encoder, random Gaussian noise is added to the preprocessed EEG signal. This is achieved through the forward diffusion process of the diffusion model, gradually introducing noise into the data. The purpose of adding noise is to simulate the randomness and uncertainty in EEG data, helping the model learn effective features in the subsequent denoising process. The data with added noise is then input into the diffusion decoder for denoising. The diffusion decoder gradually removes noise using a reconstruction algorithm guided by an adaptive attention mechanism, recovering the noise-free signal.

[0070] In the forward diffusion process q, noise is gradually introduced into the input data, as detailed below:

[0071]

[0072] in, The EEG signal representing time step t, β t To control the variance parameter of noise intensity, The signal follows a normal distribution, and I is the identity matrix. During this process, noise is gradually added to the signal; this is addressed by adjusting β. t The value of is used to ensure that the signal structure is gradually destroyed at each step.

[0073] After forward diffusion is completed, a backward diffusion process is performed using a diffusion decoder to gradually denoise and restore the original noise-free signal. This process utilizes a diffusion decoder combined with an attention mechanism to reconstruct the signal.

[0074] In this embodiment, the diffusion decoder calculates the reconstructed signal as follows:

[0075]

[0076] in, The reconstructed signal at the current time step t. The reconstructed signal from the previous time step; α t For step size parameters, The logarithmic probability density gradient of the noisy data; For the adaptive gradient correction term, β tThese are regulatory parameters related to epileptic seizures. Because there are significant differences between seizure and non-seizure signals, a large change in the signal between two adjacent time steps strongly suggests that a seizure has occurred (i.e.,...). (larger), at this time β t The increase reflects the need for higher reconstruction accuracy during epileptic seizures. It represents the difference between data from adjacent time steps.

[0077] In this embodiment, for The specific calculation is as follows:

[0078]

[0079] in, This indicates the reconstructed signal estimation at the current time step t. The probability density, express The gradient, i.e., in the reconstruction signal estimation The rate of change of the probability density at a given point. This gradient represents the rate of change of the probability density at the current reconstructed signal estimation point. The direction of the change in probability density.

[0080] This embodiment utilizes a diffusion decoder. The gradient is used to refine and reconstruct the signal, and iterative refinement facilitates the extraction of features crucial for accurate seizure detection. Simultaneously, the reconstructed signal is modified by incorporating an adaptive gradient correction term. Optimization can help the model better capture signal details during a seizure, improve sensitivity to abrupt changes before and after a seizure, and enhance the accuracy of the reconstruction process, especially improving the accuracy of signal reconstruction at the moment a seizure occurs.

[0081] In this embodiment, the reconstruction loss function of the diffusion model is... recon The calculation is as follows:

[0082]

[0083] in, The reconstruction loss function is given, where T is the total number of steps. This is the preprocessed EEG signal. The reconstructed signal at the current time step; λ t The weighting coefficients are dynamic, and the weights are adjusted based on whether the current time point is close to the epileptic seizure period. The specific calculation formula is as follows:

[0084]

[0085] During an epileptic seizure, when the signal changes drastically, |X t -Xt-1 | Relatively large, λ t This will increase accordingly. During periods of signal stability, λ t The value is close to 1, which allows for greater attention to signal reconstruction during epileptic seizures.

[0086] It should be noted that when detecting actual EEG signals, there is no need to add noise to the forward diffusion process. Instead, the pre-trained diffusion model is used to denoise and reconstruct the pre-processed EEG signals.

[0087] In this embodiment, in order to preserve the temporal sequence of the EEG signals, a position code P is introduced into the reconstructed EEG signals, as follows:

[0088]

[0089] Among them, F diffusion For features extracted by the diffusion model, the location encoding P enables the model to notice the temporal structure of the EEG data.

[0090] In this embodiment, during each stage of reconstruction, an adaptive attention mechanism is used to enhance the extraction of epileptic seizure features, further extracting features from the EEG signals and enhancing the data representation generated by the diffusion model. The calculation formula for the adaptive attention mechanism is as follows:

[0091]

[0092] in, To incorporate the reconstructed signal after location encoding, the temporal sequence of the EEG signal can be preserved during attention calculation; W Q W K W V They are based on The learned query matrix, key matrix, and value matrix, d k This represents the size of the last dimension of the key matrix.

[0093] In this embodiment, the adaptive attention mechanism dynamically calculates weights at each time step, allowing the model to adjust its focus in real time as the input signal changes. When a seizure is detected, the model automatically increases its attention to these features, becoming more sensitive to dependencies between different time steps, thereby improving the accuracy and robustness of detecting seizure abnormalities.

[0094] (3) The detection unit is configured to classify epileptic seizure-related features using a classifier to obtain epileptic seizure detection results.

[0095] In this embodiment, after the EEG signal is denoised and reconstructed in multiple stages, the extracted features are input into a classifier for the final detection of epileptic seizures, and the classification result of epileptic seizures or non-epileptic seizures is output.

[0096] Specifically, the structure of the classifier is as follows: Figure 3 As shown, it includes three fully connected layers. Between the first and second fully connected layers, a normalization layer, a ReLU activation function, and a Dropout layer are connected sequentially. Between the second and third fully connected layers, a ReLU activation function is connected. The third fully connected layer outputs the classification result.

[0097] This classifier combines features through fully connected layers, utilizes normalization to accelerate training and improve generalization ability, and introduces non-linearity through the ReLU activation function to help the model learn the complex patterns of epileptic seizures. Dropout layers further prevent overfitting and improve the model's robustness. Compared to traditional classifiers with only one fully connected layer or one softmax layer, this multi-layer network has stronger feature representation and non-linear expression capabilities, thus more accurately identifying epileptic seizures and effectively preventing overfitting. While extracting epileptic seizure features, it maintains good stability and noise resistance, improving the accuracy and reliability of detection.

[0098] The goal of training the classifier in this embodiment is to minimize the cross-entropy loss. The loss function of the classifier is defined as follows:

[0099]

[0100] Among them, y i For tag categories, For the corresponding prediction category, i represents the i-th data point, and N represents the non-epileptic seizure category. batch w1 represents the batch size of the input network; w1 and w2 are the weights of the epileptic seizure category and the non-epileptic seizure category, respectively, with w1 > w2.

[0101] Because epileptic seizures are typically much shorter than non-epileptic seizures, they are relatively rare in the data. Therefore, this embodiment sets the ratio of w1 to w2 to 5:1 to increase the model's focus on epileptic seizure samples, thereby improving its ability to detect a minority of epileptic seizures. The goal of the fine-tuning process is to optimize the epileptic seizure detection model by further distinguishing between epileptic and non-epileptic events.

[0102] As an example, Figure 4(a) is a schematic diagram of the original EEG signal during a seizure; Figure 4(b) is a schematic diagram of the original EEG signal during a non-seizure; Figure 5(a) is a schematic diagram of the characteristics of the EEG signal during a seizure at different time periods; Figure 5(b) is a schematic diagram of the characteristics of the EEG signal during a non-seizure at different time periods.

[0103] Through the design of the multi-stage noise addition and reconstruction process described above, the method in this embodiment can effectively process high-dimensional, multi-channel EEG signals and gradually extract important features related to epileptic seizures. Using this method, EEG data from 24 patients were tested, achieving a detection accuracy of 99.02% for epileptic events, with only 0.41 false detections per hour. Experiments show that the accuracy of epileptic seizure detection using this method is significantly higher than that of traditional methods, especially when dealing with complex spatial distributions and high-dimensional EEG signals, where detection performance is significantly improved.

[0104] This embodiment is the first to combine a diffusion model with an attention mechanism for the detection of epileptic seizures based on EEG signals. It enhances the model’s sensitivity to epileptic seizure-related features, reduces noise interference and data redundancy, and has significant innovation and application prospects.

[0105] Example 2

[0106] In one or more embodiments, a method for detecting epileptic electroencephalogram (EEG) signals based on a diffuse attention model is disclosed, combined with... Figure 6 Specifically, it includes the following process:

[0107] S101: The EEG signal to be detected is acquired through electrodes, an EEG amplifier, and an A / D converter connected in sequence, and then preprocessed.

[0108] S102: The preprocessed EEG signal is input into the diffusion attention model for denoising, and features related to epileptic seizures are extracted at the same time; wherein, the diffusion attention model uses a diffusion model to reconstruct the signal through stepwise denoising, and introduces an adaptive gradient correction term to iteratively optimize the signal; in the reconstruction process of each stage, the extraction of epileptic seizure-related features is enhanced through an adaptive attention mechanism.

[0109] S103: Use a classifier to classify the features related to epileptic seizures to obtain the epileptic seizure detection results.

[0110] The specific implementation process of each step S101-S103 is the same as that in Example 1, and will not be described in detail again.

[0111] Example 3

[0112] In one or more embodiments, an epilepsy EEG signal detection and classification device is disclosed. The device performs the epilepsy EEG signal detection method based on the diffusion attention model in Embodiment 2. The device includes: electrodes, an EEG amplifier, an A / D converter, and a control host connected in sequence.

[0113] As a concrete example, Figure 7A schematic diagram of the hardware structure of the EEG detection device is given, combined with Figure 7 First, multiple electrodes distributed on the scalp surface are used to capture brain signals from different areas of the brain. The acquired brain signals are then transmitted to the control host for processing after passing through an EEG amplifier and an A / D converter.

[0114] The control host is equipped with:

[0115] The preprocessing unit is used to preprocess the acquired EEG signals;

[0116] The reconstruction unit is configured to input preprocessed EEG signals into a diffusion attention model for denoising, while extracting features related to epileptic seizures; wherein the diffusion attention model reconstructs the signal by progressive denoising using a diffusion model and introduces an adaptive gradient correction term to iteratively optimize the signal; during each stage of reconstruction, the extraction of epileptic seizure-related features is enhanced through an adaptive attention mechanism.

[0117] The classification unit is used to classify the characteristics related to epileptic seizures to obtain the epileptic seizure detection results;

[0118] The output unit is used to output and display the results of epileptic seizure detection.

[0119] The specific implementation of each of the above units is the same as in Embodiment 1, and the final output is the detection result of epileptic seizure.

[0120] While the specific embodiments of the present invention have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solutions of the present invention are still within the scope of protection of the present invention.

Claims

1. A system for detecting epilepsy EEG signals based on a diffuse attention model, characterized in that, include: The acquisition unit is configured to acquire the EEG signal to be detected via electrodes, an EEG amplifier, and an A / D converter connected in sequence, and to perform preprocessing. The reconstruction unit is configured to input preprocessed EEG signals into a diffusion attention model for denoising, while extracting features related to epileptic seizures; wherein the diffusion attention model reconstructs the signal by progressive denoising using a diffusion model and introduces an adaptive gradient correction term to iteratively optimize the signal; during each stage of reconstruction, the extraction of epileptic seizure-related features is enhanced through an adaptive attention mechanism. The diffusion model reconstructs the signal through stepwise denoising and introduces an adaptive gradient correction term to iteratively optimize the signal, specifically as follows: ; ; in, This is the reconstruction signal for the current time step. This is the reconstruction signal from the previous time step; For step size parameters, The logarithmic probability density gradient of the noisy data; Here, is the adaptive gradient correction term, These are regulatory parameters associated with epileptic seizures. This represents the difference between data from adjacent time steps. The detection unit is configured to classify epileptic seizure-related features using a classifier to obtain epileptic seizure detection results.

2. The epilepsy EEG signal detection system based on the diffuse attention model as described in claim 1, characterized in that, During the training phase, the diffusion model gradually introduces random noise into the EEG signal through a forward diffusion process to simulate the noise complexity in EEG data. Noise is gradually reduced and EEG signals are reconstructed through a reverse diffusion process.

3. The epilepsy EEG signal detection system based on the diffuse attention model as described in claim 1, characterized in that, The reconstruction loss function of the diffusion model is specifically as follows: ; in, To reconstruct the loss function, T The total number of steps. This is the preprocessed EEG signal. This is the reconstruction signal for the current time step; The dynamic weighting coefficients are calculated using the following formula: ; in, This is the reconstruction signal from the previous time step.

4. The epilepsy EEG signal detection system based on the diffuse attention model as described in claim 1, characterized in that, After reconstructing the signal using a diffusion model, the process also includes adding positional coding to the reconstructed signal to preserve the temporal sequence of the EEG signal.

5. The epilepsy EEG signal detection system based on the diffuse attention model as described in claim 1, characterized in that, The extraction of features related to epileptic seizures is enhanced through an adaptive attention mechanism, specifically: ; in, For the reconstructed signal after adding position encoding, , , They are based on The learned query matrix, key matrix, and value matrix This indicates the size of the last dimension of the key matrix.

6. The epilepsy EEG signal detection system based on the diffuse attention model as described in claim 1, characterized in that, The classifier comprises three fully connected layers. Between the first and second fully connected layers, a normalization layer, a ReLU activation function, and a Dropout layer are connected sequentially. A ReLU activation function is connected between the second and third fully connected layers. The third fully connected layer outputs the classification result.

7. The epilepsy EEG signal detection system based on the diffuse attention model as described in claim 1, characterized in that, The loss function of the classifier Specifically: ; in, For tag categories, For the corresponding prediction categories, including epileptic seizures and non-epileptic seizures, For the first One data point, The batch size for the input network; and The weights are for the epileptic seizure category and the non-epilepsy seizure category, respectively. .

8. A method for detecting epileptic EEG signals based on a diffuse attention model, characterized in that, include: The EEG signal to be detected is acquired by connecting electrodes, an EEG amplifier, and an A / D converter in sequence, and then preprocessed. The preprocessed EEG signal is input into a diffusion attention model for denoising, while features related to epileptic seizures are extracted. The diffusion attention model reconstructs the signal by progressive denoising using a diffusion model and introduces an adaptive gradient correction term to iteratively optimize the signal. In each stage of reconstruction, an adaptive attention mechanism is used to enhance the extraction of features related to epileptic seizures. The epileptic seizure-related features are classified using a classifier to obtain the epileptic seizure detection results; Specifically, the diffusion model reconstructs the signal through stepwise denoising and introduces an adaptive gradient correction term to iteratively optimize the signal. ; ; in, This is the reconstruction signal for the current time step. This is the reconstruction signal from the previous time step; For step size parameters, The logarithmic probability density gradient of the noisy data; Here, is the adaptive gradient correction term, These are regulatory parameters associated with epileptic seizures. This represents the difference between data from adjacent time steps.

9. A device for detecting and classifying epilepsy EEG signals, wherein the device performs the epilepsy EEG signal detection method based on the diffuse attention model as described in claim 8, characterized in that, The device includes: electrodes, an EEG amplifier, an A / D converter, and a control unit connected in sequence; the control unit contains: The preprocessing unit is used to preprocess the acquired EEG signals; The reconstruction unit is configured to input preprocessed EEG signals into a diffusion attention model for denoising, while extracting features related to epileptic seizures; wherein the diffusion attention model reconstructs the signal by progressive denoising using a diffusion model and introduces an adaptive gradient correction term to iteratively optimize the signal; during each stage of reconstruction, the extraction of epileptic seizure-related features is enhanced through an adaptive attention mechanism. The diffusion model reconstructs the signal through stepwise denoising and introduces an adaptive gradient correction term to iteratively optimize the signal, specifically as follows: ; ; in, This is the reconstruction signal for the current time step. This is the reconstruction signal from the previous time step; For step size parameters, The logarithmic probability density gradient of the noisy data; Here, is the adaptive gradient correction term, These are regulatory parameters associated with epileptic seizures. This represents the difference between data from adjacent time steps. The classification unit is used to classify the characteristics related to epileptic seizures to obtain the epileptic seizure detection results; The output unit is used to output and display the results of epileptic seizure detection.

Citation Information

Patent Citations

  • Unsupervised epilepsy detection system based on de-noising diffusion probability model

    CN117338314A

  • Trajectory prediction using diffusion models

    US20240157979A1