Epilepsy recognition method and device based on electroencephalogram characteristics, medium and product
Through multi-lead EEG signal acquisition and preprocessing technology, combined with high-quality lead selection and time-frequency domain feature extraction for brain functional regions, the neural network model is used to identify epilepsy, solving the problem of inaccurate identification in the existing technology and achieving higher recognition accuracy and reliability.
Patent Information
- Application Number
- CN202510166167.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-14
- Publication Date
- 2025-05-27
AI Technical Summary
In the prior art, epilepsy recognition based on scalp EEG is not accurate enough, mainly due to the highly nonlinear and non-stationary characteristics of the EEG signal and the susceptibility to various noise interference, making it difficult for a single time domain or frequency domain feature to fully reflect the characteristics of epilepsy.
Multi-lead EEG signal acquisition and preprocessing technology is adopted, combined with high-quality lead selection method for brain functional area division, time frequency domain feature extraction is performed and trained through neural network models to achieve accurate recognition of epilepsy.
Through multi-lead signal acquisition and high-quality lead selection, combined with time-frequency feature extraction and neural network model training, more accurate and stable recognition of epilepsy seizures is achieved, significantly improving the clinical practicality and reliability of epilepsy recognition.
Smart Images

Figure CN120036727A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of epilepsy detection and identification, and in particular to an epilepsy identification method, device, medium and product based on electroencephalogram characteristics. Background Art
[0002] With the development of neuroscience and medical technology, electroencephalogram (EEG) testing plays an increasingly important role in the diagnosis of epilepsy. As a common neurological disease, epilepsy has a variety of attack characteristics, which are often related to damage to the patient's brain functional areas. Different brain functional areas will show different symptoms during epileptic seizures. There are mainly central epilepsy, parietal lobe epilepsy, frontal lobe epilepsy, and temporal lobe epilepsy. There are about 70 million epilepsy patients in the world. Timely and accurate identification of epileptic seizures is of great significance to the treatment and prognosis of patients.
[0003] Among them, scalp EEG is a commonly used method for non-invasive collection of EEG, but the collected signals are easily interfered with. Epilepsy EEG signals are usually scalp EEG signals, which are divided into non-ictal period and ictal period, and epilepsy detection and identification are performed by distinguishing the difference between non-ictal period and ictal period.
[0004] Since EEG signals are highly nonlinear and non-stationary and are easily affected by various noise interferences, a single time domain or frequency domain feature is difficult to fully reflect the characteristics of epileptic seizures. The epilepsy identification based on scalp EEG in related technologies is not accurate enough. Summary of the invention
[0005] The present application provides an epilepsy identification method, device, medium and product based on EEG features, which are used to accurately identify epileptic seizures based on EEG features.
[0006] In the first aspect, the present application provides an epilepsy identification method based on EEG features, which is applied to an epilepsy identification device, the method comprising: collecting original EEG signals of multiple leads, preprocessing the original EEG signals, and calculating the signal-to-noise ratio of the preprocessed signals; based on a preset brain functional area division, selecting multiple lead signals with the highest signal-to-noise ratio from each brain functional area to obtain high-quality lead signals; performing time-frequency domain conversion on the high-quality lead signals, extracting time domain features and frequency domain features, and combining the time domain features and the frequency domain features to generate a feature vector; segmenting the feature vector at preset time intervals, and marking the segmented data for seizure periods and non-seizure periods to obtain model training samples; constructing a neural network model, and using the model training samples to perform model training to obtain an epilepsy identification model; determining the feature vector to be tested of the EEG signal to be tested, and inputting the feature vector to be tested into the epilepsy identification model to obtain an epilepsy identification result.
[0007] In the above embodiments, the epilepsy recognition device realizes the accurate recognition of epileptic seizures through a complete process of collecting multi-channel electroencephalogram (EEG) signals, preprocessing, selecting high-quality leads, extracting time-frequency features, segment annotation, model training, and recognition. It makes full use of the time-domain and frequency-domain features of EEG signals and improves the accuracy and practicality of epilepsy recognition through the deep learning ability of the neural network model.
[0008] Combined with some embodiments of the first aspect, in some embodiments, the steps of collecting raw EEG signals of multiple leads and preprocessing the raw EEG signals and calculating the signal-to-noise ratio of the preprocessed signals specifically include: collecting raw EEG signals of multiple leads, performing wavelet decomposition on the raw EEG signals to obtain multi-layer wavelet coefficients; performing threshold denoising processing on the wavelet coefficients, and reconstructing the denoised wavelet coefficients to obtain a preprocessed signal; calculating the ratio of the power spectral density of the preprocessed signal in the effective frequency band to the power spectral density of the high-frequency noise band to obtain the signal-to-noise ratio; performing quality evaluation on the preprocessed signal based on the signal-to-noise ratio, and marking the lead signals with a signal-to-noise ratio lower than a preset threshold as noise leads.
[0009] In the above embodiments, the epilepsy recognition device adopts a preprocessing method of wavelet decomposition and threshold denoising, combines the calculation of the signal-to-noise ratio by the power spectral density ratio, effectively improves the quality of the raw EEG signals, and provides a reliable data basis for subsequent feature extraction through the evaluation and screening of signal quality.
[0010] Combined with some embodiments of the first aspect, in some embodiments, after the steps of determining the feature vector to be measured of the EEG signal to be measured and inputting the feature vector to be measured into the epilepsy recognition model to obtain the epilepsy recognition result, the method further includes: calculating the confidence level of the epilepsy recognition result; when the confidence level is lower than a preset confidence threshold, marking the corresponding data sample as a pending sample; determining the misrecognized samples and correctly recognized samples in the pending samples based on user settings; and performing incremental optimization on the epilepsy recognition model based on the misrecognized samples and correctly recognized samples.
[0011] In the above embodiments, the epilepsy recognition device introduces a confidence evaluation mechanism and an incremental optimization strategy, establishes a model optimization process that can be continuously improved, and continuously improves the recognition performance and robustness of the model through the analysis of misrecognized samples and the dynamic update of the model.
[0012] Combined with some embodiments of the first aspect, in some embodiments, after the step of determining the misrecognized samples and correctly recognized samples in the pending samples based on user settings, the method further includes: performing feature analysis on the misrecognized samples, and classifying the misrecognized samples with similar feature patterns based on a clustering algorithm to obtain multiple misrecognized categories; determining the occurrence probability of the misrecognized categories, and performing feature enhancement processing on the newly added samples to be measured based on the occurrence probability.
[0013] In the above embodiments, the epilepsy recognition device identifies common error patterns through feature analysis and clustering of mis-identified samples, and performs feature enhancement accordingly. This method can effectively reduce the recurrence of similar errors and improve the generalization ability of the model.
[0014] Combined with some embodiments of the first aspect, in some embodiments, the steps of performing time-frequency domain conversion on high-quality lead signals, extracting time-domain features and frequency-domain features, and combining the time-domain features and frequency-domain features to generate feature vectors specifically include: performing time-frequency domain conversion on high-quality lead signals to obtain time-domain features and frequency-domain features; performing normalization processing on the time-domain features and frequency-domain features respectively to obtain normalized features; constructing a multi-branch attention mechanism network including a time-domain feature branch and a frequency-domain feature branch; inputting the normalized features into the corresponding feature branches to obtain time-domain feature weights and frequency-domain feature weights respectively; and performing weighted fusion on the time-domain features and frequency-domain features based on the time-domain feature weights and frequency-domain feature weights to obtain feature vectors.
[0015] In the above embodiments, the epilepsy recognition device adopts a multi-branch attention mechanism network to achieve intelligent fusion of time-domain and frequency-domain features, and improves the effectiveness of feature combination and the accuracy of recognition through adaptive adjustment of feature weights.
[0016] Combined with some embodiments of the first aspect, in some embodiments, before the step of segmenting the feature vectors at preset time intervals, labeling the segmented data as seizure periods and non-seizure periods to obtain model training samples, the method further includes: constructing an epilepsy seizure feature library according to the typical EEG feature patterns of various types of epilepsy seizures; matching the feature vectors with the typical patterns in the epilepsy seizure feature library to identify the epilepsy seizure onset points; based on the epilepsy seizure onset points, extracting the change trend of EEG activities within a preset time range before and after to determine the key time nodes in the epilepsy seizure evolution process; dividing the feature vectors into pre-seizure periods, seizure periods, and post-seizure periods according to the key time nodes; and performing time-frequency analysis on the feature vectors in the pre-seizure periods, seizure periods, and post-seizure periods respectively to determine the seizure feature sequences.
[0017] In the above embodiments, the epilepsy recognition device establishes an epilepsy seizure feature library and performs pattern matching, achieving an accurate division of the epilepsy seizure process, and providing a more comprehensive seizure feature sequence through temporal analysis of the seizure evolution process.
[0018] In some embodiments in combination with some embodiments of the first aspect, after the step of performing time-frequency analysis on the eigenvectors of the pre-ictal, ictal, and post-ictal periods respectively to determine the seizure feature sequence, the method further includes: calculating the phase synchronization coefficient between each lead, constructing a functional connectivity network; extracting the topological structure change features of the functional connectivity network during the seizure process; calculating the centrality index of each brain functional area based on graph theory algorithms, and determining the origin area, propagation pathway, and diffusion range of the epileptic seizure.
[0019] In the above embodiments, the epilepsy recognition device realizes an in-depth understanding of the epileptic seizure propagation mechanism through functional connectivity network analysis and graph theory algorithms, and accurately locates the origin and propagation path of the epileptic seizure by calculating the centrality index of each brain area.
[0020] In a second aspect, an embodiment of the present application provides an epilepsy recognition device, which includes: one or more processors and a memory; the memory is coupled to the one or more processors, and the memory is used to store computer program code, and the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the epilepsy recognition device to execute the method described in the first aspect and any possible implementation manner in the first aspect.
[0021] In a third aspect, an embodiment of the present application provides a computer program product containing instructions, which, when the computer program product runs on the epilepsy recognition device, enables the epilepsy recognition device to execute the method described in the first aspect and any possible implementation manner in the first aspect.
[0022] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, including instructions, which, when the instructions run on the epilepsy recognition device, enable the epilepsy recognition device to execute the method described in the first aspect and any possible implementation manner in the first aspect.
[0023] It can be understood that the epilepsy recognition device provided in the second aspect, the computer program product provided in the third aspect, and the computer storage medium provided in the fourth aspect are all used to execute the method provided in the embodiments of the present application. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method, and will not be elaborated here.
[0024] One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: 1. Due to the adoption of multi-lead electroencephalogram (EEG) signal acquisition and preprocessing techniques, combined with a high-quality lead selection method based on the division of brain functional areas, as well as an overall framework for time-frequency domain feature extraction and neural network model training, it is able to effectively capture the characteristic EEG activity patterns during epileptic seizures, comprehensively extract and analyze the features of the original signals. It effectively solves the problems of insufficient recognition accuracy and poor anti-interference ability caused by a single feature dimension in related technologies, and thus achieves a more accurate and stable epileptic seizure recognition effect, significantly improving the clinical practicability and reliability of epilepsy recognition.
[0025] 2. Due to the adoption of a method for feature analysis and clustering classification of misidentified samples, and an innovative mechanism for feature enhancement processing based on occurrence probability, it is able to systematically summarize and improve the recognition errors of the model, and specifically optimize the misidentification situations with similar feature patterns. It effectively solves the problems in related technologies that it is difficult to improve the model for specific types of misidentifications and the optimization direction is not clear, and thus realizes the continuous improvement and optimization of the model performance, significantly enhancing the system's recognition ability for various complex epileptic seizure patterns.
[0026] 3. Due to the adoption of a pattern matching and key time node recognition method based on an epileptic seizure feature library, combined with refined time-frequency analysis of the pre-seizure, seizure, and post-seizure periods, it is able to accurately grasp the complete evolution process of epileptic seizures and comprehensively depict the seizure feature sequence. It effectively solves the problems in related technologies that the understanding of the epileptic seizure process is not deep enough and the extraction of temporal sequence features is insufficient, and thus realizes the precise capture of the dynamic features of epileptic seizures, providing an important basis for clinical diagnosis and treatment plan formulation. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 is a flowchart of an epileptic seizure recognition method based on EEG features in an embodiment of the present application; Figure 2 is another flowchart of an epileptic seizure recognition method based on EEG features in an embodiment of the present application; Figure 3 is a schematic structural diagram of a physical device of an epileptic seizure recognition device in an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0028] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in the specification of the present application, the singular forms "a", "an", "the above", "the", and "this" are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in the present application refers to any or all possible combinations including one or more of the listed items.
[0029] Hereinafter, the terms "first" and "second" are for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the embodiments of the present application, unless otherwise specified, the meaning of "a plurality" is two or more.
[0030] For ease of understanding, the application scenarios of the embodiments of the present application are introduced below.
[0031] In the diagnosis and treatment of approximately 70 million epilepsy patients globally, electroencephalogram (EEG) detection plays a crucial role. The neurology department of a hospital has to process a large amount of continuous EEG data of patients every day. Doctors need to spend a great deal of time carefully observing and analyzing these complex EEG waveforms to identify possible epileptic seizures. For example, the neurology department of a certain top - tier hospital receives approximately 50 epilepsy patients every day, and each patient needs to record EEG data for an average of 4 - 8 hours. These data contain 16 - 32 lead channels, forming a vast amount of multi - dimensional signals. Doctors need to check these signals frame by frame to find the characteristic waveforms of epileptic seizures. This process is extremely time - consuming and prone to fatigue, and some subtle seizure signs may be missed. Timely and accurate identification of epileptic seizures is crucial for the treatment and prognosis of patients, but the current manual interpretation method is difficult to meet the clinical needs.
[0032] In related technologies, the automatic identification of epileptic seizures can be achieved by adopting a machine learning method based on a single feature. For example, by extracting the time - domain features or frequency - domain features of EEG signals and inputting them into a classifier such as a support vector machine for training and identification. The scenario of using the epileptic seizure recognition method based on EEG features in related technologies is introduced below.
[0033] Currently, hospitals mainly use traditional machine learning methods to assist in epileptic seizure recognition. For example, a certain hospital uses a support vector machine (SVM) to classify EEG signals and analyzes them by extracting time - domain features (such as root - mean - square value) or frequency - domain features (such as power spectral density) of the signals. However, this method has obvious problems: First, it is difficult to comprehensively capture the complex patterns of epileptic seizures due to the use of a single feature; second, the quality of lead signals is not considered, and the data of lead channels with severe noise pollution will reduce the recognition accuracy; third, the analysis of the functional connections between different brain regions is lacking, and the propagation law of epileptic seizures cannot be revealed. The case of a certain patient shows that the traditional method misjudges myoelectric artifacts as epileptiform discharges, resulting in false - positive judgments and causing troubles in clinical diagnosis and treatment.
[0034] By adopting the epilepsy recognition method based on EEG features in the embodiments of the present application, through signal-to-noise ratio evaluation and functional area lead selection, the priority extraction of high-quality signals is realized, which not only improves the reliability of feature extraction, but also realizes the adaptive fusion of time-frequency features through the multi-branch attention mechanism.
[0035] After adopting the method proposed in the present application, the epilepsy automatic recognition system of a certain hospital has achieved remarkable improvement. The system first evaluates the signal-to-noise ratio of 32-lead EEG signals and automatically screens out the lead signals with better quality. Then, based on the division of the brain functional area, the most high-quality lead signals are selected from important brain regions such as the frontal lobe and temporal lobe for analysis. Through the multi-branch attention network, the system can adaptively fuse the time-domain and frequency-domain features to comprehensively characterize the seizure characteristics. In the long-term monitoring of a refractory epilepsy patient, the system not only accurately identified the clinical seizures, but also detected multiple subclinical seizures, providing an important basis for the adjustment of the clinical treatment plan.
[0036] It can be seen that by adopting the epilepsy recognition method based on EEG features in the embodiments of the present application, while realizing the automatic recognition of epileptic seizures, it can also effectively solve the problems of single features and poor anti-noise ability in traditional methods, and thus achieve more accurate and reliable epileptic seizure recognition.
[0037] For the sake of easy understanding, the method provided in this embodiment will be described in terms of its process in combination with the above scenario. Please refer to Figure 1 , which is a schematic flowchart of the epilepsy recognition method based on EEG features in the embodiments of the present application.
[0038] S101. Collect the original EEG signals of multiple leads, preprocess the original EEG signals, and calculate the signal-to-noise ratio of the preprocessed signals.
[0039] Among them, a lead refers to an electrode placed on the scalp surface for recording EEG activities, and multiple leads refer to 16 - 256 electrode point positions arranged according to the international 10 - 20 system; the original EEG signal refers to the unprocessed electrophysiological signal directly collected by an electroencephalograph, usually containing useful signals and various interference signals; preprocessing refers to the process of performing basic processing such as noise reduction and filtering on the original signal; the signal-to-noise ratio refers to the ratio of the effective component to the noise component in the signal, which is an important indicator for measuring the signal quality.
[0040] After receiving the start instruction, the epilepsy recognition device needs to first obtain high-quality electroencephalogram (EEG) signal data for subsequent analysis. Specifically, the epilepsy recognition device continuously collects the patient's EEG signals through a multi-lead EEG acquisition device. The sampling frequency is usually set between 250 Hz and 1000 Hz, and the acquisition time can last for several hours to several days according to clinical needs. After obtaining the original signals, power frequency interference and baseline drift are removed through a digital filter, and physiological artifacts such as electrooculogram (EOG) and electromyogram (EMG) are identified and removed using specialized algorithms. Then, the ratio of the signal power within the clinically relevant frequency band (usually 0.5 - 30 Hz) to the power of high-frequency noise (usually greater than 100 Hz) for each lead signal is calculated to obtain the signal-to-noise ratio (SNR) index for each lead.
[0041] In specific implementation, the data preprocessing includes the following steps: First, the dataset containing epilepsy is processed to rearrange the signals in different files to the same lead order. Second, the data is resampled to unify the sampling rate to ensure that all data has the same time resolution. Finally, the signals are detrended and band-pass filtered, and the data is normalized to eliminate the amplitude differences between different leads.
[0042] In addition, the epilepsy recognition device quantitatively evaluates the quality of each lead signal by calculating the signal-to-noise ratio (SNR). The SNR calculation uses the power spectral density ratio method, considering the 1 - 45 Hz frequency band as the effective signal frequency band and the frequency band above 45 Hz as the noise frequency band. For each lead channel, the average power spectral density value Psignal within the effective signal frequency band and the average power spectral density value Pnoise of the noise frequency band are calculated respectively, and the ratio of the two is the SNR of the lead. This signal quality evaluation method based on the frequency band energy distribution can effectively identify lead signals contaminated by high-frequency interferences such as EMG and power frequency. For example, for a certain lead signal, if the average power spectral density of its 1 - 45 Hz frequency band is 100 μV² / Hz, and the average power spectral density of the frequency band above 45 Hz is 20 μV² / Hz, then the SNR of this lead is 5, indicating relatively good signal quality.
[0043] S102. Based on the preset division of brain functional regions, select multiple lead signals with the highest signal-to-noise ratio from each brain functional region to obtain high-quality lead signals.
[0044] Among them, the division of brain functional regions refers to dividing the cerebral cortex into different functional regions according to neuroscience research, such as the frontal lobe, parietal lobe, occipital lobe and other regions; high-quality lead signals refer to EEG signals with relatively high signal-to-noise ratio and good signal quality within a specific functional region; the highest signal-to-noise ratio means the signals with the top-ranked signal-to-noise ratio values among the lead signals within the same functional region.
[0045] After the epilepsy recognition device completes signal preprocessing, it is necessary to screen out the most representative signals from numerous leads. Specifically, first, according to the electrode positions of the international 10-20 system for positioning, all leads are mapped to the corresponding brain functional areas according to their anatomical locations. Then, within each functional area, the signal-to-noise ratio (SNR) indicators of each lead are calculated and sorted from high to low SNR. According to the size and importance of each functional area, a fixed number (usually 2-4) of leads with the highest SNR are selected as the representative leads for that area. The signals of these selected leads together constitute a high-quality lead signal set.
[0046] In some embodiments, the selection of functional area leads can be achieved in various ways: Optionally, a lead connection network is constructed based on graph theory algorithms, the centrality and connection strength of lead nodes within each functional area are calculated, and combined with the SNR indicator, the most representative lead combination is selected through a multi-objective optimization algorithm; Optionally, a clustering analysis method is adopted, the leads within the same functional area are grouped according to signal similarity, and the signal with the highest SNR and lower correlation with other leads is selected from each group to ensure the representativeness and complementarity of the selected leads. It can be understood that other mathematical models and selection strategies can also be used to screen high-quality leads in the functional area, which is not limited here.
[0047] In specific implementation, based on the distribution characteristics of the functional areas of the human brain, the electroencephalogram (EEG) leads are divided into five main areas: the central area, the parietal area, the frontal area, the temporal area, and other areas. The leads within each functional area are sorted according to the SNR, and the two leads with the highest SNR are selected as the representative leads for that area. This selection strategy of multi-area high-quality leads ensures that the selected leads can comprehensively cover all important brain functional areas while ensuring signal quality. In this way, 10 of the most representative lead signals are screened out from the original multi-lead signals for subsequent analysis. For example, when there are 4 leads in the temporal area and their SNRs are 6.5, 5.8, 4.2, and 3.9 respectively, the two leads with SNRs of 6.5 and 5.8 are selected as the representative leads for that area. This lead selection method that combines anatomical location and signal quality not only reduces data redundancy but also improves the efficiency and reliability of feature extraction.
[0048] S103. Perform time-frequency domain conversion on the high-quality lead signals, extract time-domain features and frequency-domain features, and combine the time-domain features and frequency-domain features to generate feature vectors.
[0049] Among them, time-frequency domain conversion refers to a mathematical transformation method that converts time-domain signals to the frequency domain or the time-frequency joint domain; time-domain features represent the statistical features of signals in the time dimension; frequency-domain features refer to the feature manifestations of signals in the frequency dimension; feature vectors refer to the vectorized representations composed of multiple features.
[0050] After obtaining high-quality lead signals, the epilepsy recognition device needs to extract mathematical features that can effectively characterize epilepsy features. Specifically, first, perform time-frequency analysis on the high-quality lead signals, and use methods such as short-time Fourier transform or wavelet transform to obtain the time-frequency distribution of the signals. Then, extract features from two dimensions: time domain and frequency domain respectively. The time domain features include statistics such as mean, variance, and kurtosis, and the frequency domain features include indicators such as energy in each frequency band and spectral entropy. Finally, splice these features into a feature vector according to a predefined combination method for subsequent classification and recognition.
[0051] In some embodiments, feature extraction and combination can be achieved in various ways: Optionally, use empirical mode decomposition to decompose the signal into multiple intrinsic mode functions, extract the statistical features and spectral features of each mode respectively, and select the most discriminative feature subset for combination through feature importance analysis; Optionally, use continuous wavelet transform to obtain the time-frequency diagram of the signal, calculate the texture features and energy distribution features of the time-frequency diagram, and combine the traditional time-domain statistical features to obtain the final feature vector through feature normalization and dimensionality reduction processing. It can be understood that other signal processing methods and feature engineering techniques can also be used to achieve feature extraction and combination, which are not limited here.
[0052] In the feature extraction stage, the epilepsy recognition device adopts a multi-dimensional feature extraction strategy to comprehensively analyze the selected 10 high-quality lead signals. First, perform time-frequency analysis of the signal through wavelet transform to obtain the time-frequency joint distribution features. Secondly, decompose the signal into frequency bands, and extract the power spectral density features of four frequency bands: delta wave (0.5 - 4Hz), theta wave (4 - 8Hz), alpha wave (8 - 13Hz), and beta wave (13 - 30Hz). These features reflect the energy distribution of different frequency components. At the same time, calculate the 95% spectral edge frequency (SEF95) as a measure of spectral concentration. In terms of time domain analysis, calculate the root mean square value (RMS) of the signal to characterize the change characteristics of the signal intensity. The extraction process of these multi-dimensional features takes into account the non-stationary characteristics of the EEG signal. Through the combination of features in different domains, the dynamic change law of EEG activity during epileptic seizures can be more comprehensively characterized. For example, a certain lead signal may show a characteristic pattern of a significant increase in theta band energy and an increase in RMS value during an epileptic seizure. The combination of these multi-dimensional features can provide richer epileptic seizure feature information.
[0053] S104. Segment the feature vector at preset time intervals, and label the segmented data as seizure period and non-seizure period to obtain model training samples.
[0054] Among them, the preset time interval represents the fixed time length for segmenting the signal; the seizure period refers to the time period during an epileptic seizure; the non-seizure period refers to the time period of normal electroencephalogram activity; and the model training sample refers to the labeled data set used to train the machine learning model.
[0055] The time span of electroencephalogram data is relatively long, and it is necessary to perform reasonable segmentation and add annotation information. Specifically, the obtained feature vectors are segmented at fixed time intervals (usually 2 - 10 seconds). For the data in each time period, according to clinical records and expert annotations, it is identified whether it belongs to the epileptic seizure period. This annotation divides the data into two categories: the seizure period and the non-seizure period, forming a training sample set with class labels. The process of segmentation and annotation needs to ensure the reasonable distribution of seizure period and non-seizure period samples to avoid the problem of sample imbalance.
[0056] In specific implementation, the processing of the epilepsy recognition device for data includes the following steps: First, the data labeled as the seizure period and the non-seizure period are respectively segmented into data segments with a duration of 2 seconds, and classification labels are made for each 2-second data. Second, to solve the problem of data imbalance, when the number of seizure period labels is insufficient, noise addition processing is performed on the seizure period data to expand the data set and increase the generalization ability of the model, so that the number of seizure period and non-seizure period labels reaches equilibrium. Another solution is to adjust the class weights during the model training process to balance the class imbalance problem and improve the classification performance of the model. Finally, an FFT transform is performed on each data segment to divide the electroencephalogram signal into four different frequency bands: delta wave, theta wave, alpha wave, and beta wave, extract the power spectral density of each frequency band, and the value of the boundary frequency SEF. At the same time, the root mean square value RMS of the amplitude in the time domain features is calculated to complete the comprehensive extraction of time domain and frequency domain features.
[0057] S105. Construct a neural network model and use the model training samples to train the model to obtain an epilepsy recognition model.
[0058] Among them, the neural network model refers to a deep learning model composed of multiple layers of neurons; the epilepsy recognition model refers to the final model that can be used to recognize epileptic seizures after training.
[0059] After obtaining the labeled samples, it is necessary to construct and train a deep learning model for epilepsy recognition. That is, design a neural network structure including multiple convolutional layers and fully connected layers. The dimension of the input layer matches the dimension of the feature vector, and the output layer corresponds to two categories: the seizure period and the non-seizure period. The backpropagation algorithm is used for model training, and the model parameters are optimized by minimizing the cross-entropy loss function. The batch normalization technique is used during the training process to improve the generalization ability of the model, and the early stopping strategy is adopted to avoid overfitting.
[0060] In the model construction stage, the epilepsy recognition device adopts a multi-layer convolutional neural network structure.
[0061] Specifically, it includes the following hierarchical construction: 1. Convolutional layer: Used to extract features from the input data. All convolutional layers use a 3×3 convolutional kernel and select RELU as the activation function. The convolutional layer performs local calculations on the input data through a series of filters (convolutional kernels) that slide over the data to generate feature maps. The formula for calculating the width of the feature map after convolution is: W2 = (W1 - F + 2P) / S + 1; where W1 is the width of the feature data before convolution, W2 is the width of the feature map after convolution, F is the size of the convolutional kernel, P is the padding size (adding zero values at the edges of the input data to control the output size), and S is the stride, i.e., the distance moved each time.
[0062] The convolution operation itself is a process of element-wise multiplication and summation. For the overlapping part between the convolutional kernel and the input data at each position, the following formula is used for the convolution calculation at each position: Output(i, j) = ∑(m = 0, k - 1)∑(n = 0, k - 1) Input(i + m, j + m) • W(m, n) + b; where Input is the input data (such as a region of an image), W is the convolutional kernel weight, b is the convolutional bias, i, j are the position coordinates of the convolutional kernel relative to the input data, m, n are the indices inside the convolutional kernel used to traverse all elements inside the convolutional kernel, and k is the size of the convolutional kernel.
[0063] 2. Pooling layer: Mainly used to reduce the data dimension while retaining the main features. A 2×2 maximum pooling window is used. The main purpose of the pooling layer is to reduce the data dimension, thereby reducing the computational amount and the number of parameters, improving the efficiency and performance of the model, and helping to extract more abstract features. The pooling layer does not change the input depth (number of channels), but reduces the width and height. The formula for calculating the output size of the pooling layer is: OutputSize = (InputSize - F) / S + 1; where InputSize is the width and height of the input feature map, F is the size of the pooling window (also called the filter or kernel), and S is the stride, i.e., the number of pixels the window moves each time. In the maximum pooling layer, the operation in each pooling window is to take the maximum value of all elements in the window as the value at the corresponding position of the output feature map.
[0064] 3. Flatten layer: The role of this layer is to convert the multi-dimensional input data into a one-dimensional vector for connection to the fully connected layer.
[0065] 4. Fully connected layer (Dense): Uses RELU as the activation function, and the calculation formula is as follows: Output = Relu(Input * W + b); When Input * W + b > 0, the output is Input * W + b; when Input * W + b ≤ 0, the output is 0. Here, W is the weight of the Dense layer and b is the bias of the Dense layer.
[0066] 5. Dropout layer: It is used to randomly select nodes to participate in model prediction, and the set ratio is 0.4. During network training, the Dropout technique is used to randomly discard some neurons to prevent overfitting and improve the generalization ability of the model.
[0067] 6. Output layer: A fully connected layer using the softmax activation function, which converts multi-dimensional features into a probability distribution for binary classification. The sum of probability values is 1 and the value range of each element is [0, 1].
[0068] The Softmax function is defined as follows: Softmax(Zi) = e^Zi / ∑(j = 1, C) e^Zj; where Zi is the i-th element in the logits vector and C is the total number of categories. The output A can be expressed as: A = softmax(Z); each element in the output A represents the prediction probability of the corresponding category.
[0069] For model training, the backpropagation algorithm is used for parameter optimization. Adam is used as the optimizer, the learning rate is set to 0.01, the categorical cross-entropy function is selected as the loss function, and the batch size and the number of training epochs are set to 500 and 2000 respectively. This multi-level network structure design can effectively extract and learn the characteristic patterns of epileptic EEG signals and achieve accurate seizure recognition.
[0070] S106. Determine the feature vector to be measured of the EEG signal to be measured, and input the feature vector to be measured into the epilepsy recognition model to obtain the epilepsy recognition result.
[0071] Among them, the EEG signal to be measured refers to new data that needs to be recognized for epilepsy; the feature vector to be measured is the feature representation extracted from the signal to be measured; the epilepsy recognition result refers to the classification and judgment result of the model for the data to be measured.
[0072] After completing model training, epilepsy recognition can be performed on new EEG data. Specifically, the same preprocessing and feature extraction processes as the training data are performed on the EEG signal to be measured to obtain a normalized feature vector to be measured. Input this feature vector into the trained epilepsy recognition model, and the model outputs the probability value indicating that the data to be measured belongs to the seizure period. By setting an appropriate probability threshold, the model output is converted into the final recognition result.
[0073] In some embodiments, epilepsy recognition can be achieved in various ways: Optionally, an ensemble learning method is adopted to combine multiple trained models and comprehensively integrate the prediction results of multiple models through voting or weighted averaging to improve the reliability of recognition; Optionally, a probability output calibration mechanism is constructed to dynamically adjust the probability threshold according to the recognition effect on the validation set and continuously optimize the recognition criteria in combination with the feedback from clinical experts. It can be understood that other decision fusion and post-processing methods can also be used to achieve the final epilepsy recognition, which is not limited here.
[0074] In the above embodiments, through a multi-level signal quality assessment and feature extraction strategy, the quality of the input data of the recognition model is ensured. In practical applications, this method can adaptively process EEG data under different patients and different recording conditions and has strong generalization ability. The scenarios of this embodiment are supplemented below.
[0075] After continuous optimization, the system has also achieved more advanced functions. By constructing an epilepsy seizure feature library, the system can identify different types of epilepsy seizure patterns. For a patient with multiple seizure types, the system clearly shows the evolution process of different seizure types by analyzing the seizure origin area, propagation pathway, and diffusion range. The system also has self-learning ability. By analyzing misrecognized samples and optimizing the model, the recognition accuracy is gradually improved. In the promotion and application in a medical consortium, this system has significantly improved the epilepsy diagnosis ability of primary hospitals and provided strong support for hierarchical diagnosis and treatment.
[0076] After combining the above scenarios, the following further describes the more specific process of the method provided in this embodiment in detail. Please refer to Figure 2 , which is another process schematic diagram of the epilepsy recognition method based on EEG features in the embodiments of this application.
[0077] S201. Collect the original EEG signals of multiple leads, preprocess the original EEG signals, and calculate the signal-to-noise ratio of the preprocessed signals.
[0078] Referring to step S101, the epilepsy recognition device will collect the original EEG signals and calculate the signal-to-noise ratio.
[0079] In some embodiments, the epilepsy recognition device will collect the original EEG signals of multiple leads, perform wavelet decomposition on the original EEG signals to obtain multi-layer wavelet coefficients; perform threshold denoising processing on the wavelet coefficients, reconstruct the denoised wavelet coefficients to obtain preprocessed signals; calculate the ratio of the power spectral density of the preprocessed signals in the effective frequency band to the power spectral density of the high-frequency noise frequency band to obtain the signal-to-noise ratio; perform quality assessment on the preprocessed signals based on the signal-to-noise ratio, and mark the lead signals with a signal-to-noise ratio lower than the preset threshold as noise leads.
[0080] Among them, the lead signal refers to the potential signal collected from different parts of the brain; wavelet decomposition refers to a mathematical transformation method that decomposes a signal into different frequency components; wavelet coefficients represent the characteristic representation of a signal at different scales; threshold denoising refers to a processing method that eliminates noise in a signal by setting a threshold; power spectral density refers to a measure of the energy distribution of a signal in the frequency domain; signal-to-noise ratio is used to represent the ratio of the effective signal to the noise intensity; the preset threshold is the standard value for determining the signal quality; and the noisy lead refers to the lead channel with poor signal quality.
[0081] Preprocess and evaluate the quality of the collected original EEG signals. Specifically, first collect multi-lead EEG signals, and decompose the signals into wavelet coefficients at multiple frequency levels through wavelet decomposition. Perform threshold denoising on these coefficients to eliminate interference, and then reconstruct to obtain the preprocessed signals. Calculate the ratio of the power spectral density of the preprocessed signal in the key frequency band (usually 0.5 - 30 Hz) to the high-frequency noise frequency band (usually greater than 100 Hz) to obtain the signal-to-noise ratio index. Evaluate the signal quality based on the signal-to-noise ratio, and mark the leads below the preset quality standard as noisy leads.
[0082] In some embodiments, signal preprocessing and quality evaluation can be achieved in various ways: Optionally, use the db4 wavelet basis function for 5-layer wavelet decomposition, use the soft threshold method to denoise the wavelet coefficients, and smooth the reconstructed signal through Wiener filtering; Optionally, extract the intrinsic mode functions based on empirical mode decomposition, combine with an adaptive filter to remove power frequency and EMG artifacts, and use Hilbert-Huang transform to analyze the instantaneous frequency characteristics. It can be understood that other signal processing and quality evaluation methods can also be used to achieve preprocessing, which is not limited here.
[0083] S202. Based on the preset brain functional area division, select multiple lead signals with the highest signal-to-noise ratio from each brain functional area to obtain high-quality lead signals.
[0084] Referring to step S102, the epilepsy recognition device will extract the high-quality lead signals.
[0085] S203. Perform time-frequency domain conversion on the high-quality lead signals, extract time-domain features and frequency-domain features, and combine the time-domain features and frequency-domain features to generate a feature vector.
[0086] Referring to step S103, the epilepsy recognition device will generate a feature vector.
[0087] In some embodiments, the epilepsy recognition device performs time-frequency domain conversion on the high-quality lead signals, extracts time-domain features and frequency-domain features; performs normalization processing on the time-domain features and frequency-domain features respectively to obtain normalized features; constructs a multi-branch attention mechanism network including a time-domain feature branch and a frequency-domain feature branch; inputs the normalized features into the corresponding feature branches to obtain time-domain feature weights and frequency-domain feature weights respectively; based on the time-domain feature weights and frequency-domain feature weights, performs weighted fusion on the time-domain features and frequency-domain features to obtain a feature vector.
[0088] Among them, time-frequency domain conversion refers to a mathematical transformation method for converting a signal from the time domain to the frequency domain; time-domain features represent the characteristics of a signal changing with time; frequency-domain features refer to the feature representation of a signal in the frequency dimension; normalization processing is used to unify the feature values to the same numerical range; a feature branch refers to a sub-network in a neural network for processing different types of features; the attention mechanism refers to a network structure for automatically learning the importance of features; feature weights are used to represent the importance degrees of different features; feature fusion refers to the process of comprehensively combining multiple features.
[0089] After obtaining the high-quality lead signals, feature extraction and fusion need to be performed. Specifically, first perform time-frequency transformation on the signals, and extract time-domain features such as amplitude, variance, entropy value, etc. and frequency-domain features such as power spectrum, frequency band energy, etc. respectively. Perform normalization processing on the extracted features to eliminate the dimension difference. Construct an attention network including two branches of time domain and frequency domain, and each branch includes multiple layers of convolution and self-attention modules. Input the normalized features into the corresponding branches, and calculate the weight coefficients of each feature through the attention mechanism. Finally, perform weighted summation on the time-domain and frequency-domain features based on the weights to obtain the fused feature vector.
[0090] In some embodiments, feature extraction and fusion can be implemented in various ways: Optionally, use the short-time Fourier transform to obtain the time-frequency spectrum, calculate statistical features and non-linear features, and perform feature standardization using batch normalization; Optionally, extract time-frequency joint features based on wavelet packet transform, combine with an autoencoder for feature dimensionality reduction, and implement feature selection through a gated attention mechanism. It can be understood that other feature engineering methods can also be used to implement feature extraction and fusion, which are not limited herein.
[0091] S204. Segment the feature vector at a preset time interval, and perform seizure period and non-seizure period annotation on the segmented data to obtain model training samples.
[0092] Referring to step S104, the epilepsy recognition device determines model training samples.
[0093] S205. Construct an epilepsy seizure feature library according to the typical EEG feature patterns of various types of epilepsy seizures.
[0094] Among them, the typical EEG feature pattern refers to the characteristic electroencephalogram manifestations during different types of epileptic seizures; the epileptic seizure feature library refers to the database storing various epileptic seizure feature patterns; the feature pattern includes the feature descriptions of stages such as seizure onset, development, and termination.
[0095] Before model training, a complete epileptic seizure feature knowledge base needs to be established. Specifically, collect and organize the typical electroencephalogram data of different types of epilepsy (such as focal seizures, generalized seizures, etc.), and extract the characteristic waveforms, frequency components, and spatial distribution characteristics of each type of seizure. For each seizure type, record the characteristic change rules of its onset, development, and termination stages, form a standardized feature description, and construct a structured feature library.
[0096] In some embodiments, the construction of the feature library can be achieved in various ways: Optionally, based on expert knowledge and clinical experience, establish a hierarchical feature classification system, use machine learning methods to extract common features from a large amount of clinical data, determine the typical feature patterns through cluster analysis, and establish a feature similarity calculation method; Optionally, adopt a deep learning model to automatically learn feature representations, use the intermediate layer feature mapping of the pre-trained model as the representation of the feature pattern, and assist experts in annotation and verification through feature visualization technology. It can be understood that other feature extraction and knowledge representation methods can also be used to construct the feature library, which is not limited here.
[0097] S206. Match the feature vector with the typical pattern in the epileptic seizure feature library to identify the epileptic seizure onset point.
[0098] Among them, the feature vector refers to the multi-dimensional feature representation extracted from the EEG signal; the typical pattern refers to the standard epileptic seizure feature pattern stored in the feature library; the match refers to calculating the similarity between the feature vector and the typical pattern; the seizure onset point represents the time position where the epileptic seizure first appears.
[0099] After the feature vector is obtained, it needs to be compared with the standard pattern to determine the seizure location. Specifically, calculate the similarity between the extracted feature vector and the typical patterns of various types of epileptic seizures in the feature library. By setting a similarity threshold, find the time point with the highest matching degree with the typical pattern and determine it as the onset location of the epileptic seizure, providing a time positioning basis for subsequent analysis.
[0100] In some embodiments, pattern matching can be achieved in multiple ways: Optionally, the dynamic time warping algorithm is used to calculate the alignment distance between the feature sequence and the typical pattern, and the multiple similarity measurement methods are combined to comprehensively evaluate the matching degree, and the optimal matching position is determined through an adaptive threshold; Optionally, a matching network based on the attention mechanism is constructed to learn the correlation between the feature vector and the typical pattern, and the matching probability distribution at each time point is obtained through a soft matching strategy. It can be understood that other sequence matching and similarity calculation methods can also be used to identify the seizure onset point, which is not limited here.
[0101] S207. Based on the seizure onset point, extract the changing trend of electroencephalogram (EEG) activities within a preset time range before and after, and determine the key time nodes in the evolution process of epileptic seizures.
[0102] Among them, the preset time range refers to the time window for analysis before and after the onset point; the changing trend of EEG activities represents the variation law of signal features over time; the key time nodes refer to the time points at which the features change significantly.
[0103] Based on the identified seizure onset position, a detailed analysis is carried out. Specifically, centered on the seizure onset point, extend a preset time (usually 3 - 5 minutes) forward and backward respectively, and extract the changing trend of EEG activity features within this time range. By analyzing the dynamic changes of features such as signal energy, frequency components, and spatial distribution, the key time nodes at which the features change significantly are identified.
[0104] In some embodiments, the key node identification can be achieved in multiple ways: Optionally, a multi-scale change point detection algorithm is used to automatically identify the mutation points of the feature sequence; Optionally, the statistical significance change of the feature is calculated based on a sliding window. It can be understood that other time series analysis methods can also be used to determine the key time nodes, which is not limited here.
[0105] S208. Divide the feature vectors into the pre-seizure period, seizure period, and post-seizure period according to the key time nodes.
[0106] Among them, the pre-seizure period refers to the preparatory stage before the seizure onset; the seizure period refers to the continuous process of epileptic seizures; the post-seizure period refers to the recovery stage after the seizure ends; the division of feature vectors refers to segmenting the complete feature sequence according to time stages.
[0107] Based on the identified key time nodes, the entire feature sequence is divided into different seizure stages. Specifically, the feature vectors before the seizure onset point are marked as the pre-seizure period, the feature vectors during the seizure duration are marked as the seizure period, and the feature vectors after the seizure ends are marked as the post-seizure period. This division helps to analyze the variation laws of features in each stage separately.
[0108] In some embodiments, the stage division can be achieved in various ways: Optionally, the typical duration of each stage is set based on clinical experience and dynamically adjusted in combination with key time nodes; Optionally, an unsupervised learning method is used to automatically cluster the feature patterns of different stages. It can be understood that other time series segmentation methods can also be used to achieve the division of seizure stages, which is not limited here.
[0109] S209. Perform time-frequency analysis on the feature vectors of the pre-seizure period, seizure period, and post-seizure period respectively to determine the seizure feature sequence.
[0110] Among them, time-frequency analysis refers to studying the signal features in both the time and frequency dimensions; the seizure feature sequence refers to the time series describing the characteristic changes in the complete seizure process.
[0111] Conduct in-depth analysis on the feature vectors of each divided stage. Specifically, perform time-frequency analysis on the feature vectors of the pre-seizure period, seizure period, and post-seizure period respectively, extract indicators such as the spectral features, energy distribution, and spatial synchrony of each stage, and form a feature sequence reflecting the dynamic changes of the entire seizure process.
[0112] In some embodiments, time-frequency analysis can be achieved in various ways: Optionally, wavelet transform is used to obtain the time-frequency joint distribution and calculate the energy changes in each frequency band; Optionally, empirical mode decomposition is used to extract the intrinsic mode functions and analyze the instantaneous frequency characteristics. It can be understood that other signal analysis methods can also be used to construct the seizure feature sequence, which is not limited here.
[0113] In some embodiments, the epilepsy recognition device calculates the phase synchronization coefficient between each lead, constructs a functional connection network; extracts the topological structure change features of the functional connection network during the seizure process; calculates the centrality index of each brain functional area based on graph theory algorithms to determine the origin area, propagation path, and diffusion range of the epileptic seizure.
[0114] Among them, the phase synchronization coefficient refers to the degree of synchronization between EEG signals; the functional connection network represents the functional association relationship between brain regions; the topological structure refers to the connection pattern between network nodes; the centrality index is used to represent the importance of network nodes; the origin area refers to the starting site of the epileptic seizure; the propagation path refers to the diffusion path of epileptic activity; the diffusion range represents the range of brain regions affected by the epileptic seizure.
[0115] After obtaining the features of the lead signals, it is necessary to analyze the spatial features of the epileptic seizure. Specifically, calculate the phase synchrony between different lead signals, construct a network model reflecting the functional connection of brain regions. Analyze the dynamic change features of the network connection strength and structure during the seizure process. Use graph theory methods to calculate indicators such as the node centrality and clustering coefficient of each brain region in the network, so as to determine the starting position, propagation path, and the range of brain regions affected by the epileptic seizure.
[0116] In some embodiments, network analysis can be implemented in a variety of ways: optionally, using mutual correlation coefficients to construct a functional connection matrix, using complex network theory to analyze network characteristics, and identifying functional modules through community detection algorithms; optionally, building a directed connection network based on Granger causality analysis, combining a dynamic causal model to track information flow, and determining the propagation mode through graph matching. It is understandable that other network analysis methods can also be used to identify epilepsy propagation characteristics, which are not limited here.
[0117] S210, constructing a neural network model, and using model training samples to perform model training to obtain an epilepsy recognition model.
[0118] Referring to step S105 , the epilepsy identification device trains an epilepsy identification model.
[0119] S211, determining a feature vector to be measured of the electroencephalogram signal to be measured, and inputting the feature vector to be measured into an epilepsy recognition model to obtain an epilepsy recognition result.
[0120] Referring to step S106 , the epilepsy identification device determines an epilepsy identification result.
[0121] S212: Calculate the confidence level of the epilepsy recognition result.
[0122] Among them, confidence refers to the credibility of the recognition results; the purpose of calculating confidence is to evaluate the reliability of the model's prediction results.
[0123] The credibility of the recognition results output by the model is evaluated. Specifically, based on the probability output value of the model, a comprehensive confidence score is calculated in combination with multiple evaluation indicators. This score reflects the degree of confidence of the model in the current prediction result and provides a basis for subsequent result screening.
[0124] S213: When the confidence level is lower than a preset confidence threshold, the corresponding data sample is marked as a pending sample.
[0125] Among them, the preset confidence threshold refers to the standard value for determining whether the recognition result is reliable; the pending sample refers to the data sample that needs further confirmation.
[0126] Mark the recognition results with low confidence. Specifically, compare the confidence score with a preset threshold. When the confidence score is lower than the threshold, the data sample is marked as pending, indicating that manual review or further analysis is required.
[0127] S214: Based on user settings, determine misidentified samples and correctly identified samples in pending samples.
[0128] Among them, user settings refer to the review opinions of clinical experts; mis-identified samples refer to the samples that the model predicts incorrectly; correctly identified samples refer to the samples that the model predicts correctly.
[0129] Perform professional judgment on the samples to be determined. Specifically, clinical experts review the samples marked as to be determined, and based on professional knowledge and clinical experience, determine whether the model prediction result is correct, and classify the samples into two categories: mis-identified and correctly identified.
[0130] In some embodiments, sample confirmation can be achieved in multiple ways: Optionally, establish an expert consensus mechanism to synthesize the judgment results of multiple experts; Optionally, combine the patient's clinical data and seizure records for auxiliary judgment. It can be understood that other professional review methods can also be used to determine the sample category, which is not limited here.
[0131] In some embodiments, the epilepsy recognition device will perform feature analysis on mis-identified samples, and classify the mis-identified samples with similar feature patterns based on the clustering algorithm to obtain multiple mis-identified categories; determine the occurrence probability of the mis-identified categories, and perform feature enhancement processing on the new samples to be tested based on the occurrence probability.
[0132] Among them, mis-identified samples refer to the data samples that the model misclassifies; feature analysis refers to the in-depth study of sample features; the clustering algorithm is used to automatically group similar samples; the feature pattern represents the feature distribution law of the samples; mis-identified categories refer to the types of incorrect identifications with common features; the occurrence probability refers to the frequency of each category; feature enhancement refers to the process of strengthening the sample feature representation.
[0133] When the model recognition makes a mistake, it is necessary to analyze the error pattern and improve it. Specifically, extract and analyze the features of the mis-identified samples, and use the clustering method to classify the samples with similar features into the same category to obtain multiple typical mis-identified patterns. Statistically calculate the occurrence frequency of each category to obtain the occurrence probability, and perform targeted feature enhancement processing on the new samples to be tested according to the mis-identified categories they may belong to, so as to improve the recognition accuracy.
[0134] In some embodiments, error analysis and feature enhancement can be achieved in multiple ways: Optionally, use the hierarchical clustering algorithm to group mis-identified samples, extract the category feature center, and strengthen the feature representation through contrast learning; Optionally, identify mis-identified patterns based on the density clustering method, construct an error probability model, and generate enhanced samples through adversarial training. It can be understood that other error analysis and feature enhancement methods can also be used to improve the model, which is not limited here.
[0135] S215. Based on mis-identified samples and correctly identified samples, perform incremental optimization on the epilepsy recognition model.
[0136] Among them, incremental optimization refers to the process of continuously improving the model performance based on new samples.
[0137] Use the confirmed samples to improve the model performance. Specifically, add the mis-identified samples and correctly identified samples to the training set, and adopt the incremental learning method to update the model parameters, so that the model can learn from new samples and improve the recognition ability.
[0138] In some embodiments, the epilepsy recognition device comprehensively evaluates the model performance using standard confusion matrix evaluation metrics, specifically including three core metrics: precision (PR), sensitivity or recall rate (RE), and accuracy (ACC), which are defined as follows: PR = TP / (TP + FR), RE = TP / (TP + FN), ACC = (TP + TN) / (TP + TN + FP + FN); where the specific meanings of each parameter are: TP (True Positive) represents the number of positive samples correctly identified as positive by the model, that is, the number of epileptic seizure period samples correctly identified; FP (False Positive) represents the number of negative samples mis-identified as positive by the model, that is, the number of non-seizure period samples misjudged as seizure period; TN (True Negative) represents the number of negative samples correctly identified as negative by the model, that is, the number of non-seizure period samples correctly identified; FN (False Negative) represents the number of positive samples mis-identified as negative by the model, that is, the number of seizure period samples misjudged as non-seizure period.
[0139] These evaluation metrics reflect the performance of the model from different perspectives: 1. Precision (PR) reflects the proportion of truly seizure periods among all samples determined by the model to be in the epileptic seizure period, reflecting the accuracy of the model's recognition; 2. Recall rate (RE) reflects the proportion of correctly identified samples among all true epileptic seizure period samples, reflecting the detection ability of the model; 3. Accuracy (ACC) reflects the overall correct recognition proportion of the model on all samples, reflecting the comprehensive performance of the model.
[0140] In practical applications, the epilepsy recognition device will weigh these indicators according to specific clinical needs. For example, in some cases, more emphasis may be placed on improving the recall rate to ensure that epileptic seizures are not missed; while in other cases, more emphasis may be placed on improving the precision to reduce false alarms. Through this comprehensive evaluation system of multiple indicators, the recognition performance of the model can be comprehensively evaluated, and clear direction guidance can be provided for model optimization. In addition, the epilepsy recognition device will also verify the stability and generalization ability of the model performance through methods such as cross-validation to ensure that the model can maintain good recognition results in practical applications.
[0141] To comprehensively evaluate the performance of the epilepsy recognition model, the epilepsy recognition device uses multiple evaluation indicators for comprehensive consideration. By counting the number of true positive (TP), false positive (FP), true negative (TN), and false negative (FN) samples in the confusion matrix, three core indicators of the model, namely precision, recall rate, and accuracy, are calculated. Among them, precision reflects the correct recognition ratio of the model among all samples predicted as the seizure period, the recall rate represents the detection ability of the model for all actual seizure period samples, and the accuracy reflects the overall recognition accuracy of the model for all samples. The calculation of these indicators uses standard statistical formulas and measures the performance of the model in different aspects through the combination of TP, FP, TN, and FN. For example, if the model identifies 100 seizure period samples in the test set and 90 of them are correctly judged, the precision is 90%; if the total number of actual seizure period samples is 120, the recall rate is 75%. This multi-indicator evaluation system can comprehensively reflect the recognition performance of the model and facilitate model optimization.
[0142] When the epilepsy recognition device performs incremental optimization, an incremental learning strategy based on elastic weight update is adopted. Specifically, for the newly added misidentified sample set Em and correctly identified sample set Ec, the loss weights of these samples in the current model are first calculated.
[0143] For misidentified samples, the weight coefficient αm is calculated through the sample difficulty measurement function: αm = exp(-γ·L(ym, f(xm))); where L(ym, f(xm)) represents the cross-entropy loss between the predicted result f(xm) of the sample xm and the true label ym, and γ is an adjustable temperature parameter. This way of calculating weights enables the model to pay more attention to samples with larger prediction errors. When updating the model parameters, a knowledge distillation mechanism is used to balance old and new knowledge. Let the current model parameters be θt, and the updated parameters θt+1 are obtained through the following optimization objective: L = λ1·Lnew + λ2·Lold + λ3·Ldistill; where Lnew represents the classification loss on the newly added samples, Lold represents the classification loss on the retained samples, and Ldistill represents the KL divergence loss between the output distributions of the old and new models. λ1, λ2, and λ3 are weight coefficients for balancing each loss item.
[0144] Specifically, Ldistill is calculated as follows: Ldistill = KL(pt(x) || pt+1(x)); where pt(x) and pt+1(x) respectively represent the predicted probability distributions of the model for the input x before and after the update.
[0145] During the parameter update process, an adaptive learning rate strategy is adopted. For the k-th iteration, the learning rate ηk is adjusted as follows: ηk = η0 / (1 + β·k); where η0 is the initial learning rate and β is the decay coefficient. This learning rate adjustment mechanism can quickly adjust the parameters in the initial stage of optimization, and be more stable in the later stage, avoiding over-adjustment from damaging the existing good feature representations.
[0146] For example, when the model misidentifies a sample that is actually in the seizure period as non-seizure period during a certain recognition, the system will calculate the loss weight of this sample. Assuming the cross-entropy loss of this sample is 0.8 and the temperature parameter γ is set to 1.0, then its weight coefficient αm = exp(-0.8) ≈ 0.45.
[0147] In subsequent parameter updates, this sample will obtain the corresponding attention weight, prompting the model to specifically improve such misidentification situations. At the same time, through the knowledge distillation mechanism, it is ensured that while the model improves the misidentification performance, it will not significantly reduce the recognition accuracy for other samples.
[0148] Through this incremental optimization mechanism, the epilepsy recognition device can continuously learn and improve from new recognition results, and continuously improve the recognition accuracy and generalization ability of the model. The system will regularly evaluate the optimization effect, and when the model performance reaches a stable state or meets the preset optimization goal, this round of incremental optimization process is completed.
[0149] In the embodiments of this application, due to the adoption of innovative technologies such as lead selection based on signal-to-noise ratio, feature fusion of the multi-branch attention mechanism, and incremental learning optimization, it is possible to effectively extract high-quality EEG signals and achieve adaptive fusion of time-frequency features, effectively solving problems such as single feature extraction, poor anti-noise ability, and low recognition accuracy in traditional methods, and thus achieving more accurate and reliable epilepsy seizure recognition.
[0150] The following describes the epilepsy recognition device in the embodiments of this invention application from the perspective of hardware processing. Please refer to Figure 3, which is a schematic structural diagram of an entity device of the epilepsy recognition device in the embodiments of the present application.
[0151] It should be noted that Figure 3 The structure of the epilepsy recognition device shown is only an example and should not impose any limitations on the functions and usage scope of the embodiments of the present invention.
[0152] As Figure 3 shown, the epilepsy recognition device includes a central processing unit (CPU) 301, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 302 or the program loaded from the storage section 308 into the random access memory (RAM) 303, such as executing the method described in the above embodiments. In the RAM 303, various programs and data required for system operation are also stored. The CPU 301, ROM 302, and RAM 303 are connected to each other via a bus 304. The input / output (I / O) interface 305 is also connected to the bus 304.
[0153] The following components are connected to the I / O interface 305: an input section 306 including an audio input device, a button switch, etc.; an output section 307 including a liquid crystal display (LCD), an audio output device, an indicator light, etc.; a storage section 308 including a hard disk, etc.; and a communication section 309 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 309 performs communication processing via a network such as the Internet. The drive 310 is also connected to the I / O interface 305 as needed. A removable medium 311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 310 as needed so that the computer program read from it can be installed into the storage section 308 as needed.
[0154] Specifically, according to the embodiments of the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments of the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication section 309, and / or installed from the removable medium 311. When the computer program is executed by the central processing unit (CPU) 301, various functions defined in the present invention are executed.
[0155] It should be noted that specific examples of computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fibers, portable compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In the present invention, a computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0156] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present invention. Among them, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the above-mentioned module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order from that marked in the accompanying drawings.
[0157] Specifically, the epilepsy recognition device of this embodiment includes a processor and a memory, and a computer program is stored on the memory. When the computer program is executed by the processor, the epilepsy recognition method based on EEG features provided in the above embodiment is implemented.
[0158] On the other hand, the present invention also provides a computer-readable storage medium, which may be included in the epilepsy recognition device described in the above embodiment; or it may exist separately and not be assembled into the epilepsy recognition device. The above storage medium carries one or more computer programs. When the one or more computer programs are executed by a processor of the epilepsy recognition device, the epilepsy recognition device is enabled to implement the epilepsy recognition method based on EEG features provided in the above embodiment.
[0159] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the various embodiments of the present application.
[0160] As used in the foregoing embodiments, depending on the context, the term "when" may be construed to mean "if", "after", "in response to determining", or "in response to detecting". Similarly, depending on the context, the phrase "upon determining" or "if (the stated condition or event) is detected" may be construed to mean "if determined", "in response to determining", "when (the stated condition or event) is detected", or "in response to detecting (the stated condition or event)".
[0161] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the foregoing embodiments can be implemented by a computer program instructing relevant hardware. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the foregoing method embodiments. The foregoing storage medium includes various media that can store program codes, such as ROM, random access memory (RAM), magnetic disks, or optical discs.
Claims
1. A method for epilepsy identification based on EEG features, characterized in that: Applied to an epilepsy identification device, the method comprises: Collecting raw EEG signals from multiple leads, preprocessing the raw EEG signals, and calculating the signal-to-noise ratio of the preprocessed signals; Based on the preset brain functional area division, multiple lead signals with the highest signal-to-noise ratio are selected from each brain functional area to obtain high-quality lead signals; Performing time-frequency domain conversion on the high-quality lead signal, extracting time-domain features and frequency-domain features, and combining the time-domain features and the frequency-domain features to generate a feature vector; Segmenting the feature vector according to preset time intervals, marking the segmented data as seizure period and non-seizure period, and obtaining model training samples; Constructing a neural network model, and using the model training samples to perform model training to obtain an epilepsy recognition model; Determine a feature vector to be measured of the electroencephalogram signal to be measured, and input the feature vector to be measured into the epilepsy recognition model to obtain an epilepsy recognition result.
2. The method according to claim 1, characterized in that The steps of collecting original EEG signals of multiple leads, preprocessing the original EEG signals, and calculating the signal-to-noise ratio of the preprocessed signals specifically include: Collecting original EEG signals of multiple leads, and performing wavelet decomposition on the original EEG signals to obtain multi-layer wavelet coefficients; Performing threshold denoising on the wavelet coefficients, and reconstructing the denoised wavelet coefficients to obtain a preprocessed signal; Calculating the ratio of the power spectral density of the preprocessed signal in the effective frequency band to the power spectral density of the high-frequency noise frequency band to obtain a signal-to-noise ratio; The quality of the preprocessed signal is evaluated based on the signal-to-noise ratio, and a lead signal with a signal-to-noise ratio lower than a preset threshold is marked as a noise lead.
3. The method according to claim 1, characterized in that After the step of determining the feature vector to be tested of the electroencephalogram signal to be tested, and inputting the feature vector to be tested into the epilepsy recognition model to obtain the epilepsy recognition result, the method further includes: Calculating the confidence of the epilepsy identification result; When the confidence level is lower than a preset confidence threshold, marking the corresponding data sample as a pending sample; Based on user settings, determining misidentified samples and correctly identified samples among the pending samples; The epilepsy recognition model is incrementally optimized based on the misidentified samples and the correctly identified samples.
4. The method according to claim 3, characterized in that After the step of determining misidentified samples and correctly identified samples in the pending samples based on user settings, the method further includes: Performing feature analysis on the misidentified samples, and classifying the misidentified samples with similar feature patterns based on a clustering algorithm to obtain a plurality of misidentified categories; The occurrence probability of the misidentification category is determined, and feature enhancement processing is performed on the newly added samples to be tested based on the occurrence probability.
5. The method according to claim 1, characterized in that The step of performing time-frequency domain conversion on the high-quality lead signal, extracting time domain features and frequency domain features, and combining the time domain features and the frequency domain features to generate a feature vector specifically includes: Performing time-frequency domain conversion on the high-quality lead signal to extract time-domain features and frequency-domain features; Normalizing the time domain features and the frequency domain features respectively to obtain normalized features; Construct a multi-branch attention mechanism network containing time domain feature branches and frequency domain feature branches; Input the normalized features into the corresponding feature branches to obtain time domain feature weights and frequency domain feature weights respectively; Based on the time domain feature weight and the frequency domain feature weight, the time domain feature and the frequency domain feature are weightedly fused to obtain a feature vector.
6. The method according to claim 1, characterized in that Before the step of segmenting the feature vector at preset time intervals, marking the segmented data with the attack period and the non-attack period, and obtaining the model training samples, the method further includes: According to the typical EEG characteristic patterns of various types of epileptic seizures, an epileptic seizure feature library is constructed; Matching the feature vector with a typical pattern in the epileptic seizure feature library to identify the starting point of the epileptic seizure; Based on the epileptic seizure starting point, extract the trend of EEG activity changes within a preset time range before and after, and determine the key time nodes in the evolution of the epileptic seizure; Dividing the feature vector into pre-ictal period, ictal period and post-ictal period according to the key time nodes; Time-frequency analysis is performed on the characteristic vectors of the pre-ictal period, the ictal period and the post-ictal period respectively to determine the ictal characteristic sequence.
7. The method according to claim 6, characterized in that After the step of performing time-frequency analysis on the feature vectors of the pre-ictal period, the ictal period and the post-ictal period to determine the ictal feature sequence, the method further includes: Calculate the phase synchronization coefficient between leads and construct a functional connection network; Extracting the topological structure change characteristics of the functional connection network during the attack process; Based on the graph theory algorithm, the centrality index of each brain functional area is calculated to determine the origin area, propagation pathway and diffusion range of the epileptic seizure.
8. An epilepsy identification device, characterized in that: The epilepsy identification device comprises: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code comprises computer instructions, and the one or more processors call the computer instructions to enable the epilepsy identification device to perform the method according to any one of claims 1 to 7.
9. A computer-readable storage medium comprising instructions, characterized in that: When the instructions are executed on an epilepsy identification device, the epilepsy identification device is caused to perform the method according to any one of claims 1 to 7.
10. A computer program product, characterized in that When the computer program product is run on an epilepsy identification device, the epilepsy identification device is enabled to perform the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Electroencephalogram monitoring device and method with epileptic seizure predicting function
CN107616793A
Epileptogenic location and potential epileptogenic area prediction method based on phase-amplitude coupling network
CN109875507A
Sleep staging method based on attention mechanism and ensemble learning
CN114398932A
Epilepsy electroencephalogram signal recognition method based on time-frequency attention mixed deep network
CN116842361A
Automatic positioning method, system and equipment for epilepsy region and storage medium
CN116849609A
Cited By
Electroencephalogram signal processing method and related device thereof
CN120616459A
Epilepsy prediction method and related device
CN120678392A
Electroencephalogram abnormal signal detection method based on step-by-step identification and multi-agent decision
CN120694664A
Brain wave detection data processing method and system based on AI
CN120713538A
Detection device for high-frequency oscillation of electroencephalogram signals of intrusive brain machine
CN120938467A