Unsupervised epilepsy detection system based on denoising diffusion probability model

By combining a denoised diffusion probability model and a VQ-VAE network, unsupervised epilepsy detection was achieved, solving the problem of supervised learning relying on labeled data and improving the accuracy and efficiency of epilepsy detection.

CN117338314BActive Publication Date: 2026-01-06SHANDONG NORMAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311353334.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-18
Publication Date
2026-01-06
Estimated Expiration
2043-10-18

AI Technical Summary

Technical Problem

In existing technologies, epilepsy detection based on supervised learning relies on a large amount of labeled data, which is subject to subjective bias and prone to overfitting, resulting in suboptimal generalization performance on unseen data.

Method used

A denoised diffusion probability model is adopted, and unsupervised learning is performed using the variational lower bound of Markov chains. EEG signals are encoded into latent variables through a VQ-VAE network, abnormal signals are identified and restored to pixel space, and epilepsy detection is achieved.

Benefits of technology

No manual data annotation is required, which improves the accuracy and generalization performance of epilepsy EEG signal recognition, assists doctors in diagnosing epilepsy, and enhances detection efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117338314B_ABST
    Figure CN117338314B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on denoising diffusion probability model Unsupervised Epilepsy Detection System, belong to epilepsy detection technical field.The brain electrical signal acquisition module and the unsupervised epilepsy detection module are included, brain electrical signal acquisition module is used to obtain the brain electrical signal to be detected and is pretreated, then the brain electrical signal to be detected is converted into brain electrical signal reconstruction diagram;Unsupervised epilepsy detection module is used to input brain electrical signal reconstruction diagram in the denoising diffusion probability model trained and handled, obtains epilepsy detection result;Specifically include: to brain electrical signal reconstruction diagram is diffused forward, obtain the noise value on Markov chain and compare with preset threshold, according to threshold in reverse diffusion process restores abnormal signal in brain electrical signal reconstruction diagram, obtains latent variable and decoding;Compare brain electrical signal reconstruction diagram and decoded latent variable, obtain epilepsy detection result.Improve epilepsy brain electrical signal recognition accuracy, solve the problem of low epilepsy detection efficiency and accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of epilepsy detection technology, and in particular to an unsupervised epilepsy detection system based on a denoised diffusion probability model. Background Technology

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

[0003] Epilepsy is a persistent, recurrent neurological disorder that is not contagious. It is caused by sudden abnormal electrical discharges in brain nerve cells, which can lead to loss of consciousness and damage to the motor, emotional, perceptual, and mental systems.

[0004] Electroencephalography (EEG) is a very important diagnostic tool for epileptic seizures. EEG is created using electrodes on the scalp of the head or intracranial electrodes in the brain. EEG signals can depict the electrical activity of the brain. Therefore, in preoperative examinations, EEG signals are crucial for distinguishing between epileptic seizure signals and non-epileptic seizure signals, as well as for locating epileptic areas.

[0005] Neurologists typically diagnose epilepsy by visually examining lengthy electroencephalogram (EEG) recordings. However, the accuracy of visual assessment largely depends on the neurologist's knowledge and experience, making it highly subjective. Furthermore, as the amount of EEG data increases, visual examination becomes time-consuming and labor-intensive, leading to a decline in diagnostic accuracy. Therefore, achieving more efficient, objective, and accurate automated epilepsy detection is of great significance.

[0006] In recent years, machine learning-based methods have been widely used in automated epilepsy classification based on electroencephalogram (EEG) signals. Currently, supervised learning (SL) is the most popular machine learning method for automated epilepsy diagnosis based on EEG. Although research has demonstrated the potential of using machine learning techniques for epilepsy detection, they all rely on supervised learning, which requires large amounts of labeled data, especially for deep learning techniques that require extensive parameter tuning. The core concept of supervised learning involves training a model based on the correspondence between input samples and their corresponding labels to make predictions on unseen data.

[0007] However, this method faces some challenges in practical applications:

[0008] First, acquiring a sufficient quantity of high-quality labeled data is a challenging task. Manual annotation of labeled data requires expertise from medical professionals or domain specialists, making it time-consuming and prone to subjective bias. For deep learning techniques, complex neural networks typically require vast amounts of labeled data to effectively learn complex features within that data.

[0009] Secondly, supervised learning algorithms are prone to overfitting during training. When training data or noisy samples are limited, deep learning models may become overly reliant on noise or local features present in the training set, leading to suboptimal generalization performance on unseen data. Therefore, the practical application of these models may be limited. Summary of the Invention

[0010] To address the shortcomings of existing technologies, this invention provides an unsupervised epilepsy detection system, electronic device, and computer-readable storage medium based on a denoised diffusion probability model, which improves the accuracy of epilepsy EEG signal recognition and thus assists doctors in diagnosing epilepsy.

[0011] In a first aspect, the present invention provides an unsupervised epilepsy detection system based on a denoised diffusion probability model;

[0012] An unsupervised epilepsy detection system based on a denoised diffusion probability model includes:

[0013] The EEG signal acquisition module is configured to: acquire the EEG signal to be detected and preprocess it, and convert the preprocessed EEG signal to be detected into a latent variable in the latent variable space;

[0014] The unsupervised epilepsy detection module is configured to: input latent variables into a trained denoised diffusion probability model for processing, and obtain epilepsy detection results;

[0015] The process of inputting the latent variables into the trained denoising diffusion probability model for processing is as follows:

[0016] The latent variables are forward diffused to obtain noise values ​​on the Markov chain and compared with a preset threshold. Based on the threshold, abnormal signals in the latent variables are recovered during the back diffuse process and decoded to pixel space to obtain a reconstructed EEG signal map.

[0017] Epilepsy detection results are obtained based on the reconstructed EEG signal map.

[0018] Furthermore, the implementation process of training the denoising diffusion probability model is as follows:

[0019] Normal non-epileptic EEG signals were acquired and preprocessed. Two-dimensional spectrograms of non-epileptic EEG signals were acquired and encoded into the latent variable space. Latent variables for non-epileptic EEG were then obtained.

[0020] By inputting the epilepsy-free latent variables into the denoising diffusion probability model, and learning the latent representation distribution of the epilepsy-free data based on the quantized latent representation during the forward diffusion process, a completely noisy image is obtained.

[0021] The image with noisy conditions is back-diffused using the intermediate steps of the forward diffusion as the starting point of the back diffusion process. The average value of the intermediate samples during the back diffusion process is calculated and used as a threshold.

[0022] Preferably, the denoising diffusion probability model is trained with the goal of ensuring that the predicted noise matches the actual noise.

[0023] Furthermore, the preprocessing process for the EEG signals to be detected is as follows:

[0024] The EEG signal to be detected is subjected to bandpass filtering, and the time interval of the bandpass filtered EEG signal is divided.

[0025] The EEG signals to be detected in each time interval are regularized.

[0026] Furthermore, the process of converting the preprocessed EEG signal to be detected into latent variables in the hidden variable space is as follows:

[0027] Short-time Fourier transform is performed on the preprocessed EEG signal to be detected to obtain a two-dimensional spectrogram;

[0028] The two-dimensional spectrogram is input into a vector quantization variational autoencoder for encoding to obtain latent variables.

[0029] Preferably, the process of inputting the two-dimensional spectrogram into a vector quantization variational autoencoder for encoding is as follows:

[0030] The two-dimensional spectrogram is input into the encoder to create a feature map. The nearest discrete codebook is located using the nearest neighbor principle, and the corresponding feature map is replaced to obtain the reconstructed feature map.

[0031] Furthermore, the process of recovering anomalous signals in latent variables and decoding them to pixel space based on a threshold during back-diffusion is as follows:

[0032] The visual feature values ​​of each pixel in the threshold and latent variables are compared. Based on the comparison results, the visual feature values ​​of each pixel are binarized to mark the masked area.

[0033] Using the area outside the masked region as context, the masked region is repaired through backdiffusion. After repair, the data is input into the decoder to obtain a reconstructed EEG signal map.

[0034] Furthermore, the specific process of obtaining epilepsy detection results based on the reconstructed EEG signal map is as follows:

[0035] By comparing the reconstructed EEG signal with the two-dimensional spectrogram converted from the EEG signal to be detected, it is determined whether there is a pixel-level residual. If so, it is an epileptic EEG signal; if not, it is a normal non-epilepsy EEG signal.

[0036] Secondly, the present invention provides an electronic device;

[0037] An electronic device includes a memory and a processor, as well as computer instructions stored in the memory and running on the processor, wherein the computer instructions, when executed by the processor, perform the following steps:

[0038] The EEG signal to be detected is acquired and preprocessed, and the preprocessed EEG signal to be detected is converted into a latent variable in the latent variable space.

[0039] The latent variables are input into a trained denoised diffusion probability model for processing to obtain epilepsy detection results.

[0040] The process of inputting the latent variables into the trained denoising diffusion probability model for processing is as follows:

[0041] The latent variables are forward diffused to obtain noise values ​​on the Markov chain and compared with a preset threshold. Based on the threshold, abnormal signals in the latent variables are recovered during the back diffuse process and decoded to pixel space to obtain a reconstructed EEG signal map.

[0042] Epilepsy detection results are obtained based on the reconstructed EEG signal map.

[0043] Thirdly, the present invention provides a computer-readable storage medium;

[0044] A computer-readable storage medium for storing computer instructions, which, when executed by a processor, perform the following steps:

[0045] The EEG signal to be detected is acquired and preprocessed, and the preprocessed EEG signal to be detected is converted into a latent variable in the latent variable space.

[0046] The latent variables are input into a trained denoised diffusion probability model for processing to obtain epilepsy detection results.

[0047] The process of inputting the latent variables into the trained denoising diffusion probability model for processing is as follows:

[0048] The latent variables are forward diffused to obtain noise values ​​on the Markov chain and compared with a preset threshold. Based on the threshold, abnormal signals in the latent variables are recovered during the back diffuse process and decoded to pixel space to obtain a reconstructed EEG signal map.

[0049] Epilepsy detection results are obtained based on the reconstructed EEG signal map.

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

[0051] 1. The technical solution provided by this invention integrates the diffusion probability model into the detection of epileptic seizures for the first time, which helps to improve the accuracy of epileptic EEG signal recognition and assists doctors in diagnosing epilepsy.

[0052] 2. The technical solution provided by this invention treats the epilepsy detection problem as an anomaly detection problem, uses unsupervised learning, and utilizes the variational lower bound of Markov chains to identify abnormalities in EEG signals. Abnormal data is resampled and converted into normal data. By comparing the data before and after, it can be determined whether there is epilepsy. No manual annotation of the data is required, which improves the generalization performance of the data.

[0053] 3. The technical solution provided by this invention introduces a VQ-VAE network, in which the input data is encoded into a vector quantization representation, thereby realizing a powerful and efficient diffusion probability model while maintaining its quality, which helps to detect epilepsy quickly and efficiently. Attached Figure Description

[0054] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.

[0055] Figure 1 This is a schematic diagram of the system architecture provided in an embodiment of the present invention;

[0056] Figure 2 A schematic diagram of the architecture of a VQ-VAE network provided in an embodiment of the present invention;

[0057] Figure 3 This is an electroencephalogram of epilepsy without seizures provided in an embodiment of the present invention;

[0058] Figure 4 Electroencephalogram (EEG) for epileptic seizures provided in an embodiment of the present invention;

[0059] Figure 5 An example diagram of the final detection result provided in an embodiment of the present invention. Detailed Implementation

[0060] It should be noted that the following detailed descriptions are exemplary and intended to provide further illustration of the invention. 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 invention pertains.

[0061] 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 of the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. Furthermore, it should be understood that the terms “comprising” and “having”, and any variations thereof, are intended to cover non-exclusive inclusion, for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0062] Where there is no conflict, the embodiments and features in the embodiments of the present invention can be combined with each other.

[0063] Example 1

[0064] In existing technologies, automated epilepsy diagnosis based on supervised learning relies on high-quality and large-volume data labels, which depend on expertise and are subject to subjective bias. Furthermore, it is prone to overfitting during training and exhibits suboptimal generalization performance on unseen data.

[0065] Another common approach to automated epilepsy diagnosis is electroencephalography (EEG) machine analysis, which is essentially a problem of detecting abnormal patterns in images. Humans can easily accomplish this task by recognizing normal patterns, but it is more challenging for machines. In recent years, deep generative models have emerged as a method for identifying anomalies in data without the need for expensive labeling. These models discover the probability density function of normal data and identify deviations from the norm of disease-related features.

[0066] Therefore, this invention provides an unsupervised epilepsy detection system based on a denoised diffusion probability model. The epilepsy detection problem is treated as anomaly identification. A VQ-VAE network is introduced to integrate the diffusion probability model into epilepsy seizure detection, thereby improving the accuracy and efficiency of epilepsy detection.

[0067] Next, combined Figures 1-5 This embodiment discloses a detailed description of an unsupervised epilepsy detection system based on a denoised diffusion probability model. The system includes an EEG signal acquisition module and an unsupervised epilepsy detection module. The EEG signal acquisition module acquires the EEG signal to be detected and preprocesses it, converting the preprocessed EEG signal into a reconstructed EEG image. The unsupervised epilepsy detection module inputs the reconstructed EEG image into a trained denoised diffusion probability model for processing to obtain the epilepsy detection result.

[0068] Furthermore, the EEG signal acquisition module includes an acquisition submodule, a preprocessing submodule, and a conversion submodule. The acquisition submodule is used to acquire the EEG signal to be detected, the preprocessing submodule is used to preprocess the EEG signal to be detected, and the conversion submodule is used to convert the preprocessed EEG signal to be detected into latent variables in the latent variable space.

[0069] (1) The implementation of obtaining the submodule is as follows:

[0070] To acquire the EEG signal to be detected, in this embodiment, the EEG signal is acquired using multi-channel electrodes. For example, channel selection is performed on the EEG, choosing the 16 most commonly used dual-electrode channels, while other dual-electrode and single-electrode channels are not considered. Here, the 16 dual-electrode channels refer to the 16 dual-electrode channels in the international 10-20 system: 'FP1-F7', 'F7-T7', 'T7-P7', 'P7-O1', 'FP1-F3', 'F3-C3', 'C3-P3', 'P3-O1', 'FP2-F4', 'F4-C4', 'C4-P4', 'P4-O2', 'FP2-F8', 'F8-T8', 'FZ-CZ', and 'CZ-PZ'.

[0071] Electroencephalography (EEG) acquires EEG data by placing electrodes on the cerebral cortex, requiring zero resistance at each electrode site on the scalp. The final acquired EEG signal is a common portion selected from 16 dual-electrode channels, facilitating a unified process. Combined with... Figure 3 The electroencephalogram (EEG) shown during the epileptic seizure and Figure 4 The EEG image shown is for epilepsy without seizures. It is clear from the image that the EEG signal fluctuations are different for epilepsy and seizures, which further confirms the reliability of this embodiment in identifying and detecting epilepsy based on EEG signals.

[0072] (2) The preprocessing module is implemented as follows:

[0073] The preprocessing of the EEG signals to be detected is specifically implemented as follows:

[0074] First, the EEG signal to be detected is bandpass filtered.

[0075] Then, the bandpass-filtered EEG signal is divided into time intervals. Specifically, the bandpass-filtered EEG signal is divided into test samples every 5 seconds, thus obtaining several test samples. In this field, a 5-second EEG signal is sufficient to detect whether an epileptic seizure has occurred.

[0076] Finally, the EEG signals to be detected in each time interval are regularized. Specifically, the EEG signals are regularized based on the maximum, minimum, mean and variance of all EEG signals to keep the data input to the network model in the same distribution, which is more conducive to the convergence of the network model.

[0077] For example, the regularization method used is Z-score normalization, specifically:

[0078]

[0079] Where X represents the electroencephalogram (EEG) signal. Let X be the mean, and std(X) be the standard deviation of X.

[0080] By preprocessing the raw EEG signals, the contamination of EEG signals collected from the scalp by physiological and non-physiological artifacts is removed, thereby improving the performance of the network model and making it better suited for detection tasks. Furthermore, Z-score normalization is used to reduce the differences in EEG signals among different patients.

[0081] (3) The implementation of the conversion submodule is as follows:

[0082] The preprocessed EEG signal to be detected is converted into latent variables in the latent variable space. The specific implementation process is as follows:

[0083] (301) Perform a short-time Fourier transform on the preprocessed EEG signal to be detected to obtain a two-dimensional spectrogram; the process of short-time Fourier transform is expressed as:

[0084]

[0085] Where S is the short-time Fourier transform function, g(nm) is the window function, usually a Han window or a Gaussian window, the window width is specified by m, k is the time exponent, m is the frequency exponent, n is a constant, and x(n) represents the EEG signal of the nth segment.

[0086] (302) The two-dimensional spectrogram is input into the encoder of VQ-VAE (vector quantization variational autoencoder) for processing, the input image is encoded into a compact latent representation, and the codebook is used to provide the quantized latent representation from the input image.

[0087] This embodiment utilizes a vector quantization model to compress the input image into a highly compressed form and uses an information-rich codebook. Specifically, it leverages the VQ-VAE encoder-decoder structure for efficient image compression to obtain the latent space of the data. VQ-VAE is a widely used and effective compression model that includes an encoder, a decoder, and a discrete codebook e.

[0088] Specifically, the implementation process is as follows:

[0089] First, the two-dimensional spectrogram is input into the encoder to create the feature map z. e It then uses the nearest neighbor principle to locate the nearest discrete codebook e and replaces the corresponding feature map z. e Obtain the reconstructed feature map z q .

[0090] In other words, before reconstructing the latent code through decoding, VQ-VAE first learns the latent code by encoding and then uses nearest neighbor search to map it to one of K vectors in the codebook.

[0091] Furthermore, the unsupervised epilepsy detection module is implemented as follows:

[0092] The latent variables are input into the trained denoised diffusion probability model for processing to obtain epilepsy detection results.

[0093] The process of training the denoising diffusion probability model is as follows:

[0094] Normal non-epileptic EEG signals are acquired and preprocessed. The preprocessed normal non-epileptic EEG signals are then input into VQ-VAE. The input images are encoded into compact latent representations, and a codebook is used to provide quantized latent representations from the input images to obtain non-epileptic latent variables.

[0095] The latent variable for non-epileptic conditions is input into the denoising diffusion probability model, and the model is trained with the optimization objective of ensuring consistency between predicted and actual noise. During forward diffusion, the latent representation distribution of the non-epileptic data is learned based on the quantized latent representation to obtain a completely noisy image. The intermediate step of the forward diffusion is used as the starting point for the back diffusion process to perform back diffusion on the completely noisy image, and the average value of the intermediate samples during the back diffusion process is calculated as a threshold.

[0096] For example, a denoising diffusion probability model typically uses two Markov chains, divided into two phases: a forward diffusion phase and a backward diffusion phase. The denoising diffusion probability model is primarily trained on training data with a time step of T. In the forward diffusion phase, Gaussian noise is gradually added to the input image until the image is completely corrupted, becoming a completely noisy image with a Gaussian distribution. A component of the denoising diffusion probability model is a chain called p... θ (z t-1 |z t The learning inverse process of ) creates samples by transforming noise from q(z0) into samples, and a term called q(z) t |z t-1The forward diffusion process gradually disrupts data from a target distribution into a normal distribution. Since the forward process is a non-homogeneous Markov chain, its dynamics can be simulated using the one-step transition density.

[0097]

[0098] The ultimate optimization objective of the diffusion model is to make the noise predicted by the model consistent with the actual noise. The training process can be viewed as follows:

[0099] (1) Obtain input x0, and randomly sample a t from 1…T;

[0100] (2) Sample a noise from a standard Gaussian distribution.

[0101] (3) Minimize

[0102] The selection of the threshold will be further explained below.

[0103] Furthermore, the process of inputting the latent variables into the trained denoised diffusion probability model for processing to obtain epilepsy detection results includes:

[0104] (1) Perform forward diffusion on the latent variables to obtain the noise value on the Markov chain and compare it with the preset threshold, so as to recover the abnormal signal in the latent variables in the reverse diffusion process according to the threshold and decode it into the pixel space.

[0105] In other words, by training a denoised diffusion probability model using data without seizures, a generative model can be obtained to guide the recovery of seizure data. The denoised diffusion probability model learns a threshold to detect the presence of seizures in the latent space, and then uses the model to recover these abnormal signals.

[0106] Specifically, the forward step size of the denoising diffusion probability model is used to perform forward diffusion on the latent variables, resulting in noise on the Markov chain. To determine the relationship between each backstep during the backdiffusion process and the desired Gaussian transition q(z),... t-1 |z t How close is z0 to L using the following equation? t-1 The value is used for representation.

[0107] L t-1 =D KL (q(z t-1 |z t ,z0)||p θ (z t-1 |z t ))

[0108] Where t represents the step, the t-th step, and D KL This represents the KL divergence.

[0109] In the reverse process of the diffusion model, only additional Gaussian noise from the input image from a healthy patient is eliminated, resulting in L t-1 The KL divergence is low. However, if the image contains abnormal EEG signals, the reverse operation will eliminate some of the signal in the initial abnormal region. This signal is not reduced after the predicted Gaussian transition, resulting in a large L divergence in the abnormal region. t-1 .

[0110] Therefore, a threshold can be used to generate a binary mask that reveals the location of anomalies, which can then be used to guide the recovery process. To determine an appropriate threshold, during training, L is first found for each image in the dataset that did not experience a seizure. t-1 The value of t. Different t-values ​​are responsible for modeling various visual features; larger values ​​are associated with large-scale features, while smaller values ​​are associated with small details. Through extensive experimental analysis, it was found that a step size of 400 to 600 is more advantageous for identifying anomalies. Therefore, using L with t-values ​​between 400 and 600... t-1 The average value is used to determine the appropriate threshold.

[0111] Similarly, the L of the test image can be observed. t-1 The value is binarized using a mask = 1 if it is greater than the threshold, otherwise it is binarized using a mask = 0.

[0112] Next comes the recovery process for the anomalous data. In this step, the remaining portion of the image that does not need to be recovered is used as context to repair the masked region. For example, recovery begins at t=500, in which way the masked region is gradually denoised in each step, while the rest of the image remains unchanged. The latent variable z0 that remains after the anomalous data is removed is the output of this process, which is fed into the encoder of a variational autoencoder to obtain a reconstructed EEG signal map.

[0113] (2) Compare the reconstructed EEG signal map with the original two-dimensional spectrogram to obtain the epilepsy detection results.

[0114] Specifically, the reconstructed EEG signal is compared with the original two-dimensional spectrogram to determine whether there is a pixel-level residual. If so, it is an epileptic EEG signal; if not, it is a normal non-epilepsy EEG signal.

[0115] Example 2

[0116] Embodiment 3 of the present invention provides an electronic device, including a memory and a processor, and computer instructions stored in the memory and running on the processor. When the computer instructions are executed by the processor, they perform the following steps:

[0117] The EEG signal to be detected is acquired and preprocessed, and the preprocessed EEG signal to be detected is converted into a latent variable in the latent variable space.

[0118] The latent variables are input into a trained denoised diffusion probability model for processing to obtain epilepsy detection results.

[0119] The process of inputting the latent variables into the trained denoising diffusion probability model for processing is as follows:

[0120] The latent variables are forward diffused to obtain noise values ​​on the Markov chain and compared with a preset threshold. Based on the threshold, abnormal signals in the latent variables are recovered during the back diffuse process and decoded to pixel space to obtain a reconstructed EEG signal map.

[0121] Epilepsy detection results are obtained based on the reconstructed EEG signal map.

[0122] Example 3

[0123] Embodiment 3 of the present invention provides a computer-readable storage medium for storing computer instructions, which, when executed by a processor, perform the following steps:

[0124] The EEG signal to be detected is acquired and preprocessed, and the preprocessed EEG signal to be detected is converted into a latent variable in the latent variable space.

[0125] The latent variables are input into a trained denoised diffusion probability model for processing to obtain epilepsy detection results.

[0126] The process of inputting the latent variables into the trained denoising diffusion probability model for processing is as follows:

[0127] The latent variables are forward diffused to obtain noise values ​​on the Markov chain and compared with a preset threshold. Based on the threshold, abnormal signals in the latent variables are recovered during the back diffuse process and decoded to pixel space to obtain a reconstructed EEG signal map.

[0128] Epilepsy detection results are obtained based on the reconstructed EEG signal map.

[0129] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0130] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0131] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment, whereby a series of operational steps are performed to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0132] The descriptions of each embodiment in the above embodiments have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0133] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. An unsupervised seizure detection system based on denoising diffusion probability model, characterized in that, The method comprises the following steps: An electroencephalogram signal acquisition module is configured to acquire and preprocess the electroencephalogram signal to be detected, and convert the preprocessed electroencephalogram signal to be detected into latent variables in a latent variable space; An unsupervised epilepsy detection module is configured to input the latent variables into a trained denoising diffusion probability model for processing to obtain an epilepsy detection result; The implementation process of inputting the latent variables into the trained denoising diffusion probability model for processing is as follows: Forward diffusion is performed on the latent variables to obtain noise values on a Markov chain and compare them with a preset threshold value, so as to recover abnormal signals in the latent variables in a reverse diffusion process according to the threshold value, and decode them to a pixel space to obtain an electroencephalogram signal reconstruction image; An epilepsy detection result is obtained according to the electroencephalogram signal reconstruction image.

2. The unsupervised seizure detection system based on denoising diffusion probability model of claim 1, wherein, The implementation process of training the denoising diffusion probability model is as follows: Normal non-epilepsy electroencephalogram signals are acquired and preprocessed, two-dimensional spectrum images of the non-epilepsy electroencephalogram signals are obtained and encoded into a latent variable space, and non-epilepsy latent variables are obtained; The non-epilepsy latent variables are input into the denoising diffusion probability model, and the latent representation of the non-epilepsy data is learned in a forward diffusion process according to the quantized latent representation to obtain a complete noise image; The complete noise image is reverse diffused with the intermediate step of the forward diffusion as the starting point of the reverse diffusion process, and the average value of the intermediate samples in the reverse diffusion process is calculated as a threshold value.

3. The unsupervised seizure detection system based on denoising diffusion probability model of claim 2, wherein, The denoising diffusion probability model is trained with the consistency of the predicted noise and the real noise as the optimization target.

4. The unsupervised seizure detection system based on denoising diffusion probability model of claim 1, wherein, The implementation process of preprocessing the electroencephalogram signal to be detected is as follows: The electroencephalogram signal to be detected is subjected to band-pass filtering processing, and the electroencephalogram signal after the band-pass filtering processing is divided into time intervals; The electroencephalogram signal to be detected in each time interval is subjected to regularization processing.

5. The unsupervised seizure detection system based on denoising diffusion probability model of claim 1, wherein, The implementation process of converting the preprocessed electroencephalogram signal to be detected into latent variables in a latent variable space is as follows: The preprocessed electroencephalogram signal to be detected is subjected to short-time Fourier transform to obtain a two-dimensional spectrum image; The two-dimensional spectrum image is input into a vector quantization variational autoencoder for encoding processing to obtain latent variables.

6. The unsupervised seizure detection system based on denoising diffusion probability model of claim 5, wherein, The implementation process of inputting the two-dimensional spectrum image into the vector quantization variational autoencoder for encoding processing is as follows: The two-dimensional spectrum image is input into an encoder to create a feature map, and the nearest discrete codebook is located by the nearest neighbor principle to replace the corresponding feature map to obtain a reconstructed feature map.

7. The unsupervised seizure detection system based on denoising diffusion probability model of claim 1, wherein, The implementation process of recovering abnormal signals in the latent variables in a reverse diffusion process according to the threshold value and decoding them to a pixel space is as follows: The threshold value and the visual feature values of each pixel in the latent variables are compared, and the visual feature values of each pixel are binarized according to the comparison result to mark a masking area; The remaining part outside the masking area is taken as a context to repair the masking area through reverse diffusion, and the electroencephalogram signal reconstruction image is obtained after the repair is completed.

8. The unsupervised seizure detection system based on denoising diffusion probability model of claim 1, wherein, The implementation process of obtaining an epilepsy detection result according to the electroencephalogram signal reconstruction image is as follows: The electroencephalogram signal reconstruction image and the two-dimensional spectrum image converted from the electroencephalogram signal to be detected are compared to determine whether there is a pixel-level residual error, and if yes, the electroencephalogram signal is an epilepsy electroencephalogram signal; if no, the electroencephalogram signal is a normal non-epilepsy electroencephalogram signal.

9. An electronic device, comprising: The computer program product comprises a memory and a processor, and computer instructions stored on the memory and run on the processor, and when the computer instructions are run by the processor, the following steps are implemented: Obtaining an electroencephalogram signal to be detected and preprocessing, converting the preprocessed electroencephalogram signal to be detected into a latent variable in a hidden variable space; Inputting the latent variable into a trained denoising diffusion probability model for processing to obtain an epilepsy detection result; The implementation process of inputting the latent variable into the trained denoising diffusion probability model for processing is as follows: Forward diffusion is performed on the latent variable, noise values on a Markov chain are obtained and compared with a preset threshold, and according to the threshold, abnormal signals in the latent variable are recovered in a reverse diffusion process and decoded to a pixel space to obtain an electroencephalogram signal reconstruction graph; According to the electroencephalogram signal reconstruction graph, an epilepsy detection result is obtained.

10. A computer-readable storage medium, characterized in that, The computer program product comprises a memory and a processor, and computer instructions stored on the memory and run on the processor, and when the computer instructions are run by the processor, the following steps are implemented: Obtaining an electroencephalogram signal to be detected and preprocessing, converting the preprocessed electroencephalogram signal to be detected into a latent variable in a hidden variable space; Inputting the latent variable into a trained denoising diffusion probability model for processing to obtain an epilepsy detection result; The implementation process of inputting the latent variable into the trained denoising diffusion probability model for processing is as follows: Forward diffusion is performed on the latent variable, noise values on a Markov chain are obtained and compared with a preset threshold, and according to the threshold, abnormal signals in the latent variable are recovered in a reverse diffusion process and decoded to a pixel space to obtain an electroencephalogram signal reconstruction graph; According to the electroencephalogram signal reconstruction graph, an epilepsy detection result is obtained.

Citation Information

Patent Citations

  • Magnetoencephalogram source locating device based on sensor array decomposition and beam forming

    CN107518898A

  • Pulse signal generating method and system based on generative adversarial network

    CN109998500A