Epilepsy electroencephalogram signal detection system and method based on distraction 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 problem of detecting EEG signals in epilepsy in existing technologies and achieves efficient and accurate detection of epileptic seizures.

CN119279521AActive Publication Date: 2025-01-10SHANDONG UNIV SHENZHEN RES INST

Patent Information

Application Number
CN202411674927.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-21
Publication Date
2025-01-10
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 in the input data, limiting the effective extraction of epileptic seizure-related features.

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 sensitivity and feature extraction capabilities of epileptic seizure-related features. A 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 CN119279521A_ABST
    Figure CN119279521A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of electroencephalogram signal detection, and particularly discloses an epilepsy electroencephalogram signal detection system and method based on a diffusive attention model.The system comprises an acquisition unit, a signal processing unit, a signal processing unit and a signal processing unit, the reconstruction unit is configured to be used for inputting the preprocessed electroencephalogram signals into a distraction attention model for denoising and extracting features related to epileptic seizure at the same time; wherein the distraction attention model reconstructs a signal by using a diffusion model through step-by-step 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 a self-adaptive attention mechanism; and the detection unit is configured to use a classifier to classify the epileptic seizure related features to obtain an epileptic seizure detection result. According to the method, the feature extraction capability of the high-dimensional noise electroencephalogram signals is improved, and the accuracy of epileptic seizure detection is remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electroencephalogram (EEG) detection, and in particular to an epileptic EEG signal detection system and method based on a diffuse attention model. Background Art

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

[0003] Epilepsy is a neurological disease that affects tens of millions of people worldwide and is characterized by unpredictable seizures that greatly affect patients' quality of life. Therefore, timely and accurate detection of epileptic seizures is extremely necessary.

[0004] Electroencephalogram (EEG) can reflect the electrical activity of the brain and is an extremely important tool for epilepsy analysis. Doctors can detect epilepsy based on multi-channel EEG; however, due to the uncertainty of epileptic seizures, doctors need to monitor the patient's lengthy EEG signal records for a long time, which is not only time-consuming and labor-intensive, but also prone to missed diagnoses and misdiagnoses.

[0005] Currently, machine learning techniques are widely used in automated epileptic seizure detection, showing encouraging results. Commonly used 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 epileptic seizure detection, their scalability is often limited when dealing with large-scale datasets. In addition, feature extraction in traditional machine learning relies on manually designed algorithms, which usually require extensive domain knowledge.

[0006] In recent years, the rise of deep learning algorithms has greatly improved the feature extraction process. These algorithms are able to automatically learn and extract features from data, eliminating the need for manual intervention and showing excellent performance when processing large-scale data. For example, many researchers have used convolutional neural networks (CNNs) to extract features from EEG data; in addition, recurrent neural networks (RNNs) have also been widely used for EEG signal feature extraction and epileptic seizure detection, with remarkable results. Despite the many successes of these deep learning methods, they still face some challenges when dealing with high-dimensional, high-redundancy, and complex EEG data. A major limitation is that these models have difficulty in effectively processing complex EEG signals, especially when faced with EEG data of different epilepsy types and complex spatial distributions, the detection performance may be poor.

[0007] As a generative model, diffusion models have shown unique advantages in processing complex high-dimensional data. In recent years, they have been increasingly used in tasks such as classification, object detection, and semantic segmentation. Although diffusion models perform well in processing complex data, they often find it difficult to focus on key segments in the input data, limiting the effective extraction of key features. Since the duration of an epileptic seizure is usually much shorter than that of a non-epileptic seizure, there is often less data during the epileptic seizure period in the EEG signal, which greatly limits the application of diffusion models in epileptic EEG signal detection. In addition, most of the existing diffusion models are designed for generative tasks, making it difficult to implement epileptic seizure detection based on multi-channel EEG signals. Summary of the invention

[0008] In order to solve the above problems, the present invention proposes an epileptic EEG signal detection system and method based on a diffuse attention model, which applies the attention mechanism to the diffuse model to perform epileptic seizure detection based on EEG signals, thereby enhancing the model's sensitivity to epileptic seizure-related features and improving the feature extraction capability of high-dimensional noisy EEG signals; through the adaptive correction of the reconstructed signal, the signal details during the epileptic seizure can be better captured, thereby improving the accuracy of epileptic seizure detection.

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

[0010] An epileptic EEG signal detection system based on a diffuse attention model, comprising:

[0011] An acquisition unit is configured to acquire the EEG signal to be detected through the electrodes, EEG amplifier and A / D converter connected in sequence, and perform preprocessing;

[0012] A reconstruction unit is configured to input the preprocessed EEG signal into a diffuse attention model for denoising and extract features related to epileptic seizures; wherein the diffuse attention model uses a diffuse model to reconstruct the signal by stepwise denoising and introduces an adaptive gradient correction term to iteratively optimize the signal; in each stage of the reconstruction process, the extraction of features related to epileptic seizures is enhanced by an adaptive attention mechanism;

[0013] The detection unit is configured to classify epileptic seizure-related features using a classifier to obtain an epileptic seizure detection result.

[0014] As a further solution, 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 the EEG data; and gradually removes noise through a reverse diffusion process to reconstruct the EEG signal.

[0015] As a further solution, the diffusion model reconstructs the signal by stepwise denoising and introduces an adaptive gradient correction term to iteratively optimize the signal. Specifically:

[0016]

[0017] in, is the reconstructed signal at the current time step, is the reconstructed signal of the previous time step; α t is the step size parameter, is the logarithmic probability density gradient of the noise data; is the adaptive gradient correction term, where β t is a regulatory parameter related to epileptic seizures, is the difference between adjacent time step data.

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

[0019]

[0020] in, is the reconstruction loss function, T is the total number of steps, is the preprocessed EEG signal, is the reconstructed signal of the current time step; t is the dynamic weighting coefficient, and the specific calculation formula is:

[0021]

[0022] in, is the reconstructed signal of the previous time step.

[0023] As a further solution, after reconstructing the signal using the diffusion model, the method further includes: adding position coding to the reconstructed signal to preserve the time series order of the EEG signal.

[0024] As a further solution, the extraction of epileptic seizure-related features is enhanced through an adaptive attention mechanism, specifically:

[0025]

[0026] in, is the reconstructed signal after adding position coding, W Q ,W K ,W V Based on The learned query matrix, key matrix and value matrix, d k Indicates the size of the last dimension of the key matrix.

[0027] As a further solution, the classifier includes three fully connected layers, between the first fully connected layer and the second fully connected layer, a normalization layer, a ReLU activation function and a Dropout layer are connected in sequence; between the second fully connected layer and the third fully connected layer, a ReLU activation function is connected; and the third fully connected layer outputs the classification result.

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

[0029]

[0030] Among them, y i is the label category, is the corresponding prediction category, including epileptic seizures and non-epileptic seizures, i is the i-th data, N batch is 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, 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 obtained through the electrodes, EEG amplifier and A / D converter connected in sequence, and pre-processed;

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

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

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

[0037] An epileptic EEG signal detection and classification device, which implements the above-mentioned epileptic EEG signal detection method based on the diffuse attention model, comprises: electrodes, an EEG amplifier, an A / D converter and a control host connected in sequence; the control host is provided with:

[0038] A preprocessing unit, used for preprocessing the collected EEG signals;

[0039] A reconstruction unit is configured to input the preprocessed EEG signal into a diffuse attention model for denoising and extract features related to epileptic seizures; wherein the diffuse attention model uses a diffuse model to reconstruct the signal by stepwise denoising and introduces an adaptive gradient correction term to iteratively optimize the signal; in each stage of the reconstruction process, the extraction of features related to epileptic seizures is enhanced by an adaptive attention mechanism;

[0040] A classification unit, used for classifying epileptic seizure-related features to obtain epileptic seizure detection results;

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

[0042] Compared with the prior art, the present invention has the following beneficial effects:

[0043] (1) The present invention combines the diffusion model with the adaptive attention mechanism to perform automatic detection of epileptic seizures based on EEG signals. The diffusion model is used to denoise and reconstruct EEG signals, and the original data is reconstructed from the noisy data. Hierarchical features can be gradually extracted from multi-channel EEG signals to achieve efficient feature extraction. The adaptive attention mechanism is used to enhance the extraction of features related to epileptic seizures, so that the model can focus on analyzing time segments and frequency band signals related to epileptic seizures, which 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 the present invention utilizes the diffusion model to reconstruct the signal, an adaptive gradient correction term is introduced. The correction term changes with the change of data between two adjacent time steps. When the data changes greatly, the adaptive gradient correction term becomes larger accordingly, which can help the model better capture the signal details during the epileptic seizure, improve the sensitivity to the mutation points before and after the seizure, enhance the accuracy of the reconstruction process, and especially improve the accuracy of signal reconstruction at the moment of epileptic seizure.

[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 period.

[0046] (4) The present invention increases the weights of the epileptic seizure category and the non-epileptic seizure category in the loss function of the classifier, and sets the weight of the epileptic seizure category to be greater than the weight of the non-epileptic seizure category. This can increase the model's attention to epileptic seizure samples, improve the detection capability of a minority of epileptic seizure data, and avoid inaccurate detection results due to the small amount of epileptic seizure data.

[0047] Other features and advantages of additional aspects of the present invention will be given in part in the following description, and in part will become obvious from the following description, or will be learned through the practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0049] Figure 2 Schematic diagram of the signal reconstruction process in an embodiment of the present invention;

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

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

[0052] FIG4( b ) is a schematic diagram of the original signal of a non-epileptic seizure EEG signal according to an embodiment of the present invention;

[0053] FIG5( a ) is a characteristic diagram of an electroencephalogram signal of an epileptic seizure in an embodiment of the present invention;

[0054] FIG5( b ) is a characteristic diagram of an EEG signal of a non-epileptic seizure in an embodiment of the present invention;

[0055] Figure 6 Schematic diagram of the process of the epileptic EEG signal detection method based on the diffuse attention model in an embodiment of the present invention;

[0056] Figure 7 Schematic diagram of the hardware structure of the EEG detection device in an embodiment of the present invention. DETAILED DESCRIPTION

[0057] It should be noted that the following detailed descriptions are illustrative and are intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used in the present invention have the same meanings as those commonly understood by those skilled in the art to which the present application belongs.

[0058] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.

[0059] Embodiment 1

[0060] In one or more embodiments, a system for detecting epileptic EEG signals based on a diffuse attention model is disclosed. Figure 1 , specifically including:

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

[0062] As a specific implementation method, the EEG signal of the user to be tested is collected through electrodes, a multi-channel EEG amplifier and A / D conversion, and the sampling frequency can be 256Hz; multiple electrodes are distributed on the surface of the scalp to capture electrical signals from different areas of the brain, thereby providing rich spatiotemporal information.

[0063] The collected raw EEG signals were preprocessed, including segmentation, filtering, and normalization, as follows: First, the signal was divided into segments with a duration of 1 second and an overlap rate of 50%; then, a bandpass filter was applied in the frequency range of 1-40 Hz to remove irrelevant noise and artifacts and retain the main frequency components required for subsequent analysis. Since the EEG amplitudes of patients vary greatly, in order to reduce this difference, the EEG signals were normalized by Z-score so that the signal amplitude falls within a fixed range, providing a more stable signal basis for subsequent analysis.

[0064] Given the original EEG signal Where C represents the number of channels of EEG signal, T n Represents the number of time steps. The Z-score normalization process is processed by subtracting the mean and dividing by the standard deviation. The specific formula is as follows:

[0065]

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

[0067] (2) A reconstruction unit configured to input the preprocessed EEG signal into a diffuse attention model for denoising and extract features related to epileptic seizures; wherein the diffuse attention model uses a diffuse model to reconstruct the signal by stepwise denoising and introduces an adaptive gradient correction term to iteratively optimize the signal; in each stage of the reconstruction process, 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, wherein, 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 features related to epilepsy during the reconstruction process; then, the model is gradually denoised through a reverse diffusion process to obtain a reconstructed EEG signal.

[0069] Combination Figure 2 , random Gaussian noise is added to the preprocessed EEG signal in the diffusion encoder. 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 the EEG data, helping the model to learn effective features in the subsequent denoising process. The data with added noise is input into the diffusion decoder for denoising. The diffusion decoder gradually removes the noise according to the reconstruction algorithm guided by the adaptive attention mechanism and recovers the noise-free signal.

[0070] Among them, the forward diffusion process q gradually adds noise to the input data, as follows:

[0071]

[0072] in, represents the EEG signal at time step t, β t is the variance parameter that controls the noise intensity, is a normal distribution, and I is the unit matrix. In this process, the noise is gradually superimposed on the signal, and by adjusting β t , ensuring that each step gradually destroys the structure of the signal.

[0073] After the forward diffusion is completed, the diffusion decoder is used to perform the backward diffusion process to gradually denoise and restore the original noise-free signal. This process uses the diffusion decoder combined with the attention mechanism to reconstruct the signal.

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

[0075]

[0076] in, is the reconstructed signal at the current time step t, is the reconstructed signal of the previous time step; α t is the step size parameter, is the logarithmic probability density gradient of the noise data; is the adaptive gradient correction term, where β tis a regulation parameter related to epileptic seizures. Since there is a large difference between epileptic seizure signals and non-epileptic seizure signals, when the signal changes greatly between two adjacent time steps, there is a high probability that an epileptic seizure has occurred (i.e. larger), then β t will increase, reflecting the need for higher reconstruction accuracy during epileptic seizures. is the difference between adjacent time step data,

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

[0078]

[0079] in, Indicates that at the current time step t, the reconstructed signal estimate The probability density of express The gradient of the reconstructed signal The rate of change of the probability density at . The gradient represents the current reconstructed signal estimate The direction of the probability density change under .

[0080] This embodiment of the diffusion decoder uses The gradient of the signal is refined and reconstructed, and the iterative refinement promotes the extraction of features that are crucial for accurate detection of epileptic seizures. At the same time, the reconstructed signal is corrected by adding an adaptive gradient correction term Optimization can help the model better capture signal details during epileptic seizures, improve sensitivity to mutation points before and after the seizure, enhance the accuracy of the reconstruction process, and especially improve the accuracy of signal reconstruction at the moment of epileptic seizure.

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

[0082]

[0083] in, is the reconstruction loss function, T is the total number of steps, is the preprocessed EEG signal, is the reconstructed signal of the current time step; t is a dynamic weighting coefficient, which adjusts the weight according to whether the current time point is close to the epileptic seizure period. The specific calculation formula is:

[0084]

[0085] When the signal changes dramatically during an epileptic seizure, |X t -Xt-1 | is relatively large, λ t will increase accordingly. During the signal stability period, λ t is close to 1, so that more attention can be paid to signal reconstruction during epileptic seizures.

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

[0087] In this embodiment, in order to enable the model to preserve the time series order of the EEG signal, a position code P is introduced into the reconstructed EEG signal, as follows:

[0088]

[0089] Among them, F diffusion To diffuse the features extracted by the model, the positional encoding P enables the model to pay attention to the temporal structure of the EEG data.

[0090] In the reconstruction process of each stage, this embodiment enhances the extraction of epileptic seizure features through the adaptive attention mechanism, further extracts features from the EEG signal, and enhances the data representation generated by the diffusion model. The calculation formula of the adaptive attention mechanism is as follows:

[0091]

[0092] in, To add the reconstructed signal after position encoding, the time series order of the EEG signal can be retained during attention calculation; W Q ,W K ,W V Based on The learned query matrix, key matrix and value matrix, d k Indicates the size of the last dimension of the key matrix.

[0093] The adaptive attention mechanism of this embodiment dynamically calculates weights at each time step, so the model can adjust the focus in real time as the input signal changes. When the signal shows an epileptic seizure, the model will automatically increase its attention to these features and be more sensitive to the dependencies between different time steps, thereby improving the detection accuracy and robustness of epileptic seizure abnormalities.

[0094] (3) A detection unit configured to classify epileptic seizure-related features using a classifier to obtain an epileptic seizure detection result.

[0095] In this embodiment, after the EEG signal is reconstructed by multi-stage denoising, the extracted features are input into a classifier for final detection of epileptic seizures, and a classification result of epileptic seizure or non-epileptic seizure 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 fully connected layer and the second fully connected layer, the normalization layer, the ReLU activation function and the Dropout layer are connected in sequence; between the second fully connected layer and the third fully connected layer, the ReLU activation function is connected; and the third fully connected layer outputs the classification result.

[0097] The classifier combines features through fully connected layers, uses normalization to accelerate training and improve generalization, and introduces nonlinearity through the ReLU activation function to help the model learn the complex patterns of epileptic seizures. The Dropout layer further prevents overfitting and improves the robustness of the model. Compared with traditional classifiers with only one fully connected layer or one softmax, this multi-layer network has stronger feature representation and nonlinear expression capabilities, thereby 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, and the loss function of the classifier is defined as follows:

[0099]

[0100] Among them, y i is the label category, is the corresponding prediction category, including epileptic seizures and non-epileptic seizures, i is the i-th data, N batch is 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, w1>w2.

[0101] Since the duration of an epileptic seizure is usually much shorter than that of a non-epileptic seizure, epileptic seizures are relatively rare in the data. Therefore, this example sets the ratio of w1 to w2 to 5:1 in order to increase the model's attention to epileptic seizure samples, thereby improving the 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 signal of the EEG signal of an epileptic attack; Figure 4(b) is a schematic diagram of the original signal of the EEG signal of a non-epileptic attack; Figure 5(a) is a schematic diagram of the characteristic graph of the EEG signal of an epileptic attack in different time periods; Figure 5(b) is a schematic diagram of the characteristic graph of the EEG signal of a non-epileptic attack in different time periods.

[0103] Through the design of the above-mentioned multi-stage noise addition and reconstruction process, the method of this embodiment can effectively process high-dimensional multi-channel EEG signals and gradually extract important features related to epileptic seizures. The method of this embodiment was used to detect the EEG of 24 patients, and the detection accuracy of epileptic events reached 99.02%, with 0.41 false detections per hour. Experiments show that the accuracy of epileptic seizure detection using the method of this embodiment is significantly higher than that of traditional methods, especially when dealing with complex spatial distribution and high-dimensional EEG signals, the detection performance is significantly improved.

[0104] This embodiment combines the diffusion model with the attention mechanism for the first time and applies it to epileptic seizure detection based on EEG signals, which enhances the model's sensitivity to epileptic seizure-related features, reduces noise interference and data redundancy, and has important innovation and application prospects.

[0105] Embodiment 2

[0106] In one or more embodiments, a method for detecting epileptic EEG signals based on a diffuse attention model is disclosed, combined with Figure 6 , specifically including the following process:

[0107] S101: acquiring the EEG signal to be detected through the electrodes, EEG amplifier and A / D converter connected in sequence, and performing preprocessing;

[0108] S102: inputting the preprocessed EEG signal into a diffuse attention model for denoising, and extracting features related to epileptic seizures; wherein the diffuse attention model uses a diffuse model to reconstruct the signal by stepwise denoising, and introduces an adaptive gradient correction term to iteratively optimize the signal; in each stage of the reconstruction process, the extraction of features related to epileptic seizures is enhanced by an adaptive attention mechanism;

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

[0110] The specific implementation process of the above steps S101-S103 is the same as that in the first embodiment and will not be described in detail.

[0111] Embodiment 3

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

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

[0114] The control host is equipped with:

[0115] A preprocessing unit, used for preprocessing the collected EEG signals;

[0116] A reconstruction unit is configured to input the preprocessed EEG signal into a diffuse attention model for denoising and extract features related to epileptic seizures; wherein the diffuse attention model uses a diffuse model to reconstruct the signal by stepwise denoising and introduces an adaptive gradient correction term to iteratively optimize the signal; in each stage of the reconstruction process, the extraction of features related to epileptic seizures is enhanced by an adaptive attention mechanism;

[0117] A classification unit, used for classifying epileptic seizure-related features to obtain epileptic seizure detection results;

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

[0119] The specific implementation method of each of the above units is the same as that of the first embodiment, and finally outputs the detection result of epileptic seizure.

[0120] Although the above describes the specific implementation mode of the present invention in conjunction with the accompanying drawings, it 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 on the basis of the technical solution of the present invention without creative work are still within the scope of protection of the present invention.

Claims

1. An epileptic EEG signal detection system based on a diffuse attention model, characterized in that: include: An acquisition unit is configured to acquire the EEG signal to be detected through the electrodes, EEG amplifier and A / D converter connected in sequence, and perform preprocessing; A reconstruction unit is configured to input the preprocessed EEG signal into a diffuse attention model for denoising and extract features related to epileptic seizures; wherein the diffuse attention model uses a diffuse model to reconstruct the signal by stepwise denoising and introduces an adaptive gradient correction term to iteratively optimize the signal; in each stage of the reconstruction process, the extraction of features related to epileptic seizures is enhanced by an adaptive attention mechanism; The detection unit is configured to classify epileptic seizure-related features using a classifier to obtain an epileptic seizure detection result.

2. The epilepsy EEG signal detection system based on the diffuse attention model as claimed 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 the EEG data; The EEG signal is gradually denoised and reconstructed through the back diffusion process.

3. The epileptic EEG signal detection system based on the diffuse attention model as claimed in claim 1, characterized in that: The diffusion model reconstructs the signal by gradually removing noise and introduces an adaptive gradient correction term to iteratively optimize the signal. Specifically: in, is the reconstructed signal at the current time step, is the reconstructed signal of the previous time step; α t is the step size parameter, is the logarithmic probability density gradient of the noise data; is the adaptive gradient correction term, where β t is a regulatory parameter related to epileptic seizures, is the difference between adjacent time step data.

4. The epilepsy EEG signal detection system based on the diffuse attention model as claimed in claim 1, characterized in that: The reconstruction loss function of the diffusion model is specifically: in, is the reconstruction loss function, T is the total number of steps, is the preprocessed EEG signal, is the reconstructed signal of the current time step; t is the dynamic weighting coefficient, and the specific calculation formula is: in, is the reconstructed signal of the previous time step.

5. The epileptic EEG signal detection system based on the diffuse attention model as claimed in claim 1, characterized in that: After reconstructing the signal using the diffusion model, the method further includes: adding position coding to the reconstructed signal to retain the time series order of the EEG signal.

6. The epilepsy EEG signal detection system based on the diffuse attention model as claimed in claim 1, characterized in that: The extraction of epileptic seizure-related features is enhanced through an adaptive attention mechanism, specifically: in, is the reconstructed signal after adding position coding, W Q ,W K ,W V Based on The learned query matrix, key matrix and value matrix, d k Indicates the size of the last dimension of the key matrix.

7. The epileptic EEG signal detection system based on the diffuse attention model as claimed in claim 1, characterized in that: The classifier includes three fully connected layers. Between the first fully connected layer and the second fully connected layer, a normalization layer, a ReLU activation function and a Dropout layer are connected in sequence; between the second fully connected layer and the third fully connected layer, a ReLU activation function is connected; and the third fully connected layer outputs a classification result.

8. The epileptic EEG signal detection system based on the diffuse attention model as claimed in claim 1, characterized in that: The loss function of the classifier Specifically: Among them, y i is the label category, is the corresponding prediction category, including epileptic seizures and non-epileptic seizures, i is the i-th data, N batch is 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, w1>w2.

9. A method for detecting epileptic EEG signals based on a diffuse attention model, characterized in that: include: The electroencephalogram signal to be detected is obtained by sequentially connecting electrodes, electroencephalogram amplifiers and A / D converters, and preprocessing is performed; The preprocessed EEG signal is input into the diffuse attention model for denoising, and features related to epileptic seizures are extracted at the same time; wherein the diffuse attention model uses the diffuse model to reconstruct the signal by stepwise denoising, and introduces an adaptive gradient correction term to iteratively optimize the signal; in each stage of the reconstruction process, the extraction of features related to epileptic seizures is enhanced by the adaptive attention mechanism; The classifier is used to classify the epileptic seizure-related features to obtain the epileptic seizure detection results.

10. An epileptic EEG signal detection and classification device, the device executing the epileptic EEG signal detection method based on the diffuse attention model as claimed in claim 9, characterized in that: The device comprises: electrodes, an electroencephalogram amplifier, an A / D converter and a control host connected in sequence; the control host is provided with: A preprocessing unit, used for preprocessing the collected EEG signals; A reconstruction unit is configured to input the preprocessed EEG signal into a diffuse attention model for denoising and extract features related to epileptic seizures; wherein the diffuse attention model uses a diffuse model to reconstruct the signal by stepwise denoising and introduces an adaptive gradient correction term to iteratively optimize the signal; in each stage of the reconstruction process, the extraction of features related to epileptic seizures is enhanced by an adaptive attention mechanism; A classification unit, used for classifying epileptic seizure-related features to obtain epileptic seizure detection results; The output unit is used to output and display the epileptic seizure detection result.

Citation Information

Patent Citations

  • Electroencephalogram emotion recognition method based on hierarchical multi-dimensional space, medium and equipment

    CN115659259A

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

    CN117338314A

  • Method and system for generating audio by text based on video alignment of diffusive attention model

    CN118840997A

  • Real-time epileptic seizure monitoring method

    CN118902388A

  • Trajectory prediction using diffusion models

    US20240157979A1

Cited By

  • Epilepsy electroencephalogram data expansion method and device based on exponential power diffusion model

    CN120260962A

  • Epileptic seizure prediction method and device based on diffusion model and computer equipment

    CN120319483A

  • Seizure prediction method and device based on diffusion model and computer equipment

    CN120319483B

  • Epilepsy detection method combining double variational graph auto-encoder and adversarial learning

    CN121075686A