Epileptic seizure prediction method and device, electronic equipment and storage medium

By optimizing the channel combination and combining residual networks and long and short-term memory networks, the accuracy of epilepsy prediction is improved, and the problems of low prediction accuracy and large number of electrodes in the prior art are solved, which improves the patient's wearing experience.

CN120284200APending Publication Date: 2025-07-11SOUTH CHINA NORMAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510176459.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-18
Publication Date
2025-07-11

AI Technical Summary

Technical Problem

In the prior art, epilepsy prediction methods are not very accurate when facing large-scale, nonlinear or complex EEG signals, and epilepsy patients need to wear EEG caps with a large number of electrodes, which affects the wearing experience.

Method used

By obtaining the EEG signals of multiple channels to be selected, using iterative training of epilepsy prediction models, combining residual networks and long and short-term memory networks for feature extraction and timing analysis, optimizing channel combinations, reducing electrode counts and improving prediction accuracy.

Benefits of technology

It improves the accuracy of prediction of epilepsy, reduces the number of electrodes in the EEG cap, and improves the patient's wearing experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120284200A_ABST
    Figure CN120284200A_ABST
Patent Text Reader

Abstract

The invention discloses an epileptic seizure prediction method and device, electronic equipment and a storage medium, and can be applied to the technical field of epileptic data processing. According to the method, after to-be-selected electroencephalogram signals corresponding to a plurality of to-be-selected channels are obtained, the to-be-selected channels are combined according to a channel number optimization target to obtain a to-be-processed channel combination; then preprocessing the to-be-selected electroencephalogram signals corresponding to the to-be-processed channel combination to obtain a spectrogram; inputting the spectrogram into a preset residual network for feature extraction to obtain a spectrum feature map, inputting the spectrum feature map into a preset long short-term memory network for time sequence analysis to obtain a time sequence classification result, and determining target model parameters according to the time sequence classification result, and performing epileptic seizure prediction on the target object through an epileptic seizure prediction model corresponding to the target model parameter, thereby effectively improving the prediction accuracy of the epileptic seizure, reducing the number of electrodes of the electroencephalogram cap, and further improving the wearing experience effect of an epileptic.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of epilepsy data processing, and particularly to a method and device for predicting epileptic seizures, an electronic device, and a storage medium. Background Art

[0002] In the related art, epilepsy is a chronic disease, and epileptic seizures are the typical clinical manifestations of epilepsy, which are characterized by sudden and transient neurobehavioral symptoms caused by abnormal hypersynchronous discharge of overexcited neurons in the brain. Except for a few special cases, epileptic seizures are irregular, the prodromal symptoms of patients are uncertain, and the exact onset time cannot be estimated. The onset time and frequency of each person are different. Due to this unpredictability, the social activities of epilepsy patients are restricted and they are exposed to trauma and danger. The prediction of epileptic seizures can help patients take measures in advance to avoid accidental injuries during seizures. In the prior art, the methods for predicting epileptic seizures have low prediction accuracy when facing large-scale, non-linear or complex electroencephalogram (EEG) signals, and epilepsy patients need to wear an EEG cap with many electrodes for EEG signal detection, which seriously affects the wearing experience of epilepsy patients.

[0003] In summary, the technical problems existing in the related art need to be improved. Summary of the Invention

[0004] The main purpose of the embodiments of the present application is to propose a method and device for predicting epileptic seizures, an electronic device, and a storage medium, which can improve the prediction accuracy of epileptic seizures and reduce the number of electrodes of the EEG cap.

[0005] To achieve the above object, on the one hand, an embodiment of the present application proposes a method for predicting epileptic seizures, and the method includes the following steps:

[0006] Obtain candidate EEG signals corresponding to a plurality of candidate channels;

[0007] Iteratively train an epileptic seizure prediction model based on the candidate EEG signals to obtain target model parameters, where the target model parameters include a target channel type;

[0008] Perform epileptic seizure prediction of a target object through the epileptic seizure prediction model corresponding to the target model parameters;

[0009] Wherein, the iteratively training the epileptic seizure prediction model based on the candidate EEG signals to obtain target model parameters includes:

[0010] Combine the candidate channels according to the channel number optimization target to obtain a to-be-processed channel combination;

[0011] Preprocess the to-be-selected EEG signals corresponding to the to-be-processed channel combination to obtain a spectrogram;

[0012] Input the spectrogram into a preset residual network for feature extraction to obtain a spectral feature map;

[0013] Input the spectral feature map into a preset long short-term memory network for time series analysis to obtain a time series classification result, where the time series classification result includes the pre-epileptic seizure period and the inter-ictal period;

[0014] Determine the target model parameters according to the time series classification result.

[0015] In some embodiments, the combining the to-be-selected channels to obtain a to-be-processed channel combination according to the channel number optimization target includes:

[0016] Randomly generate an initial population according to the to-be-selected channels, each individual in the initial population corresponds to one of the to-be-selected channels, and the number of individuals in the initial population is equal to the channel number optimization target;

[0017] After performing non-dominated sorting, selection, crossover, and mutation processing on the individuals in the initial population, obtain an offspring population;

[0018] Merge the initial population and the offspring population to obtain a merged population;

[0019] After performing non-dominated sorting, crowding degree calculation, and elite strategy selection on the individuals in the merged population, obtain a new parent population;

[0020] After performing selection, crossover, and mutation processing on the individuals in the new parent population, obtain a new offspring population;

[0021] Judge whether the generation of the new parent population is greater than or equal to a preset generation. If not, merge the new parent population and the new offspring population to obtain a new merged population, and then process the new merged population; otherwise, generate the to-be-processed channel combination with the optimal ratio.

[0022] In some embodiments, the processing process of the non-dominated sorting includes:

[0023] Divide all individuals in the population into different ranks for sorting according to the dominance relationship.

[0024] In some embodiments, the obtaining a new parent population after performing non-dominated sorting, crowding degree calculation, and elite strategy selection on the individuals in the merged population includes:

[0025] After performing non-dominated sorting and crowding degree calculation on the individuals in the merged population, obtain an individual rank division result;

[0026] Select individuals within the merged population according to the individual level division result to obtain the new parental population, and the number of individuals in the new parental population is equal to the channel number optimization target.

[0027] In some embodiments, preprocessing the candidate EEG signals corresponding to the to-be-processed channel combination to obtain a spectrogram, including:

[0028] Perform short-time Fourier transform on the candidate EEG signals corresponding to the to-be-processed channel combination based on a preset window to obtain the spectrogram.

[0029] In some embodiments, the preset residual network includes a first convolutional unit, a second convolutional unit, a third convolutional unit, a fourth convolutional unit, and a fifth convolutional unit;

[0030] The first convolutional unit is used to extract features from the spectrogram and then output a first feature map with a first preset size;

[0031] The second convolutional unit is used to extract features from the first feature map and then output a second feature map with a first preset size;

[0032] The third convolutional unit is used to extract features from the second feature map, perform dimension increase and downsampling, and then output a third feature map with a second preset size;

[0033] The fourth convolutional unit is used to extract features from the third feature map, perform dimension increase and downsampling, and then output a fourth feature map with a third preset size;

[0034] The fifth convolutional unit is used to extract features from the fourth feature map, perform dimension increase and downsampling, and then output a fifth feature map with a fourth preset size as the spectral feature map.

[0035] In some embodiments, obtaining the candidate EEG signals corresponding to multiple candidate channels includes:

[0036] Obtain the candidate EEG signals of multiple candidate channels corresponding to epilepsy subjects in a preset age range.

[0037] To achieve the above object, another aspect of the embodiments of the present application proposes an epilepsy seizure prediction device, and the device includes:

[0038] A first module, configured to obtain candidate EEG signals corresponding to multiple candidate channels;

[0039] A second module, configured to iteratively train an epilepsy seizure prediction model based on the candidate EEG signals to obtain target model parameters, where the target model parameters include a target channel type;

[0040] A third module, configured to perform epilepsy seizure prediction on a target object through an epilepsy seizure prediction model corresponding to the target model parameters;

[0041] Wherein, iteratively training the epilepsy seizure prediction model based on the to-be-selected electroencephalogram signals to obtain target model parameters includes:

[0042] Optimizing the target according to the number of channels to combine the to-be-selected channels, obtaining a to-be-processed channel combination;

[0043] Preprocessing the to-be-selected electroencephalogram signals corresponding to the to-be-processed channel combination to obtain a spectrogram;

[0044] Inputting the spectrogram into a preset residual network for feature extraction to obtain a spectral feature map;

[0045] Inputting the spectral feature map into a preset long short-term memory network for time series analysis to obtain a time series classification result, where the time series classification result includes the pre-epileptic seizure period and the inter-epileptic seizure period;

[0046] Determining the target model parameters according to the time series classification result.

[0047] To achieve the above object, another aspect of the embodiments of the present application proposes an electronic device, including:

[0048] At least one processor;

[0049] At least one memory, configured to store at least one program;

[0050] When the at least one program is executed by the at least one processor, the at least one processor implements the above method.

[0051] To achieve the above object, another aspect of the embodiments of the present application proposes a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above method is implemented.

[0052] The embodiments of the present application at least include the following beneficial effects: The present application provides a method and device for predicting epileptic seizures, an electronic device, and a storage medium. After obtaining the candidate EEG signals corresponding to multiple candidate channels, the scheme iteratively trains an epileptic seizure prediction model based on the candidate EEG signals to obtain target model parameters including target channel types. During the iterative training process, the candidate channels are combined according to the optimized target based on the number of channels to obtain a channel combination to be processed. Then, the candidate EEG signals corresponding to the channel combination to be processed are preprocessed to obtain a spectrogram. After the spectrogram is input into a preset residual network for feature extraction to obtain a spectral feature map, the spectral feature map is input into a preset long short-term memory network for time series analysis to obtain a time series classification result, and the target model parameters are determined according to the time series classification result. Then, the epileptic seizure prediction of the target object is performed through the epileptic seizure prediction model corresponding to the target model parameters, so as to effectively improve the prediction accuracy of epileptic seizures and reduce the number of electrodes of the EEG cap, thereby improving the wearing experience effect of epileptic patients. Description of the Drawings

[0053] Figure 1 is a flowchart of the epileptic seizure prediction method provided by the embodiments of the present application;

[0054] Figure 2 is a training flowchart of the epileptic seizure prediction model provided by the embodiments of the present application;

[0055] Figure 3 is a schematic diagram of a segment of EEG signal in the CHB-MIT dataset provided by the embodiments of the present application;

[0056] Figure 4 is a schematic diagram of the period division of the EEG signal provided by the embodiments of the present application;

[0057] Figure 5 is a flowchart of processing candidate channels by the genetic algorithm for the multi-objective optimization problem provided by the embodiments of the present application;

[0058] Figure 6 is a schematic diagram of the elite strategy provided by the embodiments of the present application;

[0059] Figure 7 is a schematic diagram of the structure of the preset residual network provided by the embodiments of the present application;

[0060] Figure 8 is a schematic diagram of the structure of the preset long short-term memory network provided by the embodiments of the present application;

[0061] Figure 9 is a complete flowchart of the epileptic seizure prediction method provided by the embodiments of the present application;

[0062] Figure 10 is a schematic diagram of the experimental results provided by the embodiments of the present application;

[0063] Figure 11 It is a schematic structural diagram of an epilepsy seizure prediction device provided by an embodiment of the present application;

[0064] Figure 12 It is a schematic hardware structure diagram of an electronic device provided by an embodiment of the present application. Specific Embodiments

[0065] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present application. They are only examples of devices and methods that are consistent with some aspects of the embodiments of the present application.

[0066] It can be understood that the terms "first", "second", etc. used in the present application may be used in this document to describe various concepts, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of the embodiments of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, as used herein, the words "if", "when" can be interpreted as "when...", "when...", or "in response to determining".

[0067] The terms "at least one", "a plurality", "each", "any one", etc. used in the present application, at least one includes one, two or more than two, a plurality includes two or more than two, each refers to each of the corresponding plurality, and any one refers to any one of the plurality.

[0068] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field to which the present application belongs. The terms used herein are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.

[0069] Before the embodiments of the present application are described in detail, some nouns and terms involved in the embodiments of the present application are first explained. The nouns and terms involved in the embodiments of the present application are applicable to the following explanations:

[0070] Residual Network (ResNet-18): The Residual Network (ResNet) is a deep convolutional neural network that solves the vanishing gradient problem in deep networks using skip connections. ResNet-18 refers to the ResNet structure with 18 layers of depth.

[0071] Long Short-Term Memory Network (LSTM): LSTM is a special type of Recurrent Neural Network (RNN) used to process and predict time series data. It solves the long-term dependence problem in traditional RNNs by introducing "cell state" and is suitable for processing data with temporal dependencies.

[0072] Short-Time Fourier Transform (STFT): The Short-Time Fourier Transform is a technique for converting a signal from the time domain to the frequency domain. It analyzes the spectrum of the signal through a sliding window and is suitable for analyzing non-stationary signals such as EEG (electroencephalogram) signals.

[0073] Pre-ictal phase: The pre-ictal phase refers to the period before a seizure in epilepsy patients, usually ranging from a few minutes to several hours. In this study, the focus was on identifying signal changes 15 minutes before a seizure.

[0074] Inter-ictal period: The inter-ictal period of epilepsy refers to the period before and after a seizure, usually referring to the recovery period after a seizure, the interval between the seizure period and the pre-ictal phase.

[0075] CHB-MIT dataset: The CHB-MIT dataset is a publicly available electroencephalogram (EEG) dataset designed for the detection and prediction of epileptic seizures. It contains EEG data from pediatric epilepsy patients and is a commonly used dataset in epilepsy research.

[0076] Accuracy: Accuracy is a common metric for evaluating the performance of a classification model, representing the ratio of the number of correctly classified samples to the total number of samples.

[0077] Sensitivity: Sensitivity, also known as recall, is a metric for measuring the ability of a model to identify positive class samples, representing the ratio of the number of samples correctly identified as positive by the model to the total number of actual positive class samples.

[0078] Non-dominated Sorting Genetic Algorithm II (NSGA-II): NSGA-II (Non-dominated Sorting Genetic Algorithm II) is a multi-objective optimization algorithm widely used in solving complex problems, especially when there are multiple conflicting optimization objectives. The algorithm selects the optimal solutions through non-dominated sorting and crowding distance calculation.

[0079] Multi-objective optimization: Multi-objective optimization refers to considering multiple objective functions simultaneously in a problem and finding a solution that can achieve a compromise optimization among multiple objectives through an algorithm. NSGA-II is a commonly used multi-objective optimization algorithm.

[0080] Binary classification problem: A binary classification problem refers to a classification task of dividing data into two categories. For example, determining whether an epileptic seizure occurs and classifying it into two categories: "seizure" and "non-seizure".

[0081] In related technologies, epilepsy is a chronic neurological disease. Epileptic seizures are the typical clinical manifestations of epilepsy, which are characterized by sudden and temporary neurobehavioral symptoms caused by abnormal hypersynchronous discharges of overexcited neurons in the brain. Except for a few special cases, epileptic seizures are irregular, the prodromal symptoms of patients are uncertain, and the exact onset time cannot be estimated. The onset time and frequency vary for each individual. Due to this unpredictability, the social activities of epilepsy patients are restricted and they are exposed to trauma and danger. The prediction of epileptic seizures can help patients take measures in advance to avoid accidental injuries during seizures. Early warning and timely intervention (such as drug treatment or emergency treatment) can significantly improve the quality of life of patients and reduce the damage of epilepsy to the body. The prediction of epilepsy usually relies on electroencephalogram (EEG) signals. EEG signals reflect the electrical activities of brain neurons and have significant temporal characteristics and complex non-linear features.

[0082] In the prior art, the prediction of epileptic seizures mainly relies on the following types of technologies:

[0083] 1. Traditional statistical and signal processing methods: Early epilepsy prediction methods mainly based on traditional statistical analysis and signal processing technologies, such as spectral analysis, time-frequency analysis, wavelet transform, etc. The prediction of epileptic seizures is carried out by extracting the statistical features or frequency domain features of EEG signals. These methods are difficult to comprehensively and accurately capture all key information when facing non-linear and complex EEG signals, resulting in low prediction accuracy.

[0084] 2. Machine learning methods: Usually rely on the combination of feature extraction and classifiers, such as support vector machine (SVM), decision tree, k-nearest neighbor (KNN), etc. Machine learning methods can automatically learn the features in the data, but have limited ability to model non-linear features, and different feature selections result in different outcomes, facing problems of feature selection and classifier selection.

[0085] 3. Deep learning methods: Convolutional neural networks (CNNs) and recurrent neural networks (RNNs) in deep learning have been widely used in seizure prediction. CNNs can automatically learn the spatial features of images or signals, and RNNs (especially long short-term memory networks, LSTMs) are good at building models for long-term dependencies in time series data. Deep learning methods can achieve good performance in seizure prediction and have significant advantages in feature extraction and building complex models. However, there are some problems in processing large-scale data with deep learning methods. Gradient vanishing or gradient explosion is likely to occur when training deep networks. When dealing with long time series data, RNNs and LSTMs may have difficulties in model training, affecting the prediction accuracy.

[0086] As can be seen from the above, the existing methods for seizure prediction have low prediction accuracy when facing large-scale, non-linear or complex electroencephalogram (EEG) signals, and epilepsy patients need to wear an EEG cap with many electrodes for EEG signal detection, which seriously affects the wearing experience of epilepsy patients.

[0087] In view of this, embodiments of the present application provide a seizure prediction method, device, electronic device and storage medium, which can improve the prediction accuracy of seizures and reduce the number of electrodes of the EEG cap.

[0088] The seizure prediction method provided by the embodiments of the present application relates to the technical field of epilepsy data processing. The seizure prediction method provided by the embodiments of the present application can be applied to a terminal, a server, or software running on a terminal or a server. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, a vehicle-mounted terminal, etc., but is not limited thereto; the server side can be configured as an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The server can also be a node server in a blockchain network; the software can be an application implementing the seizure prediction method, etc., but is not limited to the above forms.

[0089] This application can be used in numerous general or specific computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multi-processor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, and so on. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This application can also be practiced in a distributed computing environment, where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0090] It should be noted that in each specific embodiment of this application, when it comes to relevant processing based on data related to the user's identity or characteristics, such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first. Moreover, the collection, use, and processing of these data will comply with relevant laws, regulations, and standards. In addition, when this application embodiment needs to obtain the user's sensitive personal information, the user's separate permission or separate consent will be obtained through methods such as pop-up windows or jumping to a confirmation page. After clearly obtaining the user's separate permission or separate consent, the necessary user-related data for this application embodiment to operate normally will be obtained.

[0091] The following specifically elaborates on the embodiments of this application in conjunction with the accompanying drawings:

[0092] Figure 1 is an alternative flowchart of the seizure prediction method provided by the embodiments of this application. Figure 1 The method in may include but is not limited to steps S110 to S130:

[0093] Step S110, obtain candidate EEG signals corresponding to multiple candidate channels;

[0094] Step S120, iteratively train a seizure prediction model based on the candidate EEG signals to obtain target model parameters, where the target model parameters include target channel types;

[0095] Step S130, perform seizure prediction on a target object through the seizure prediction model corresponding to the target model parameters.

[0096] Specifically, as Figure 2As shown, the process of iteratively training an epilepsy seizure prediction model based on candidate EEG signals to obtain target model parameters includes, but is not limited to, the following steps:

[0097] Step S121: Optimize the target according to the number of channels to combine the candidate channels, obtaining a to-be-processed channel combination;

[0098] Step S122: Preprocess the candidate EEG signals corresponding to the to-be-processed channel combination to obtain a spectrogram;

[0099] Step S123: Input the spectrogram into a preset residual network for feature extraction to obtain a spectral feature map;

[0100] Step S124: Input the spectral feature map into a preset long short-term memory network for time series analysis to obtain a time series classification result, where the time series classification result includes the pre-epileptic seizure period and the inter-ictal period;

[0101] Step S125: Determine the target model parameters according to the time series classification result.

[0102] It can be understood that in epileptic diseases, the incidence rate in children is higher than that in adults. With the increase of age, the epilepsy incidence rate decreases. Therefore, this embodiment can obtain candidate EEG signals of multiple candidate channels corresponding to epilepsy subjects in a preset age range. Exemplarily, the CHB-MIT dataset with child epilepsy patients as experimental subjects is obtained as the candidate EEG signals. There is epileptic EEG data of twenty-four patients in this dataset. As Figure 3 shown is a schematic diagram of a segment of EEG signal in the CHB-MIT dataset. Perform period division on the EEG signal in this figure. As Figure 4 shown, consider the 15 minutes before the epileptic seizure to the start of the epileptic seizure as the pre-epileptic seizure period, that is, Figure 3 and Figure 4 the orange part in; consider the time more than 30 minutes before the epileptic seizure and more than 30 minutes after the epileptic seizure as the inter-ictal period, that is, Figure 4 the green part in. This embodiment mainly identifies the pre-epileptic seizure period and the inter-ictal period.

[0103] It can be understood that this embodiment can use the genetic algorithm for multi-objective optimization problems (NSGA-II) to randomly combine the candidate channels. Among them, the genetic algorithm for multi-objective optimization problems is applicable to complex problems with multiple conflicting objectives that cannot be solved by traditional single-objective optimization methods. Specifically, the process of combining the candidate channels according to the channel number optimization target to obtain a to-be-processed channel combination includes, but is not limited to, the following steps:

[0104] Randomly generate an initial population P according to the candidate channels t, where each individual in the initialized population corresponds to one of the candidate channels, and the number of individuals in the initialized population is equal to the channel number optimization target N;

[0105] After performing non-dominated sorting, selection, crossover, and mutation operations on the individuals in the initialized population, an offspring population Q is obtained t ;

[0106] The initialized population and the offspring population are merged to obtain a merged population P t ;

[0107] After performing non-dominated sorting, crowding degree calculation, and elite strategy selection on the individuals in the merged population, a new parental population P is obtained t+1 ;

[0108] After performing selection, crossover, and mutation operations on the new parental population, a new offspring population Q is obtained t+1 ;

[0109] Judge whether the generation number of the new parental population is greater than or equal to the preset generation number. If not, the new parental population and the new offspring population are merged to obtain a new merged population, and then the new merged population is processed; otherwise, the optimal ratio combination of the to-be-processed channel is generated.

[0110] As Figure 5 shown, the process of the genetic algorithm for the multi-objective optimization problem to randomly combine the candidate channels can be to first randomly generate an initial population P with a size of N t , generating multiple random channel combinations, each combination containing different channels. Through non-dominated sorting, selection, crossover, and mutation, an offspring population Q is generated t , performing fast non-dominated sorting, and at the same time calculating the crowding degree of the individuals in each non-dominated layer, and combining the two populations together to form a population R with a size of 2N t . And based on the elite strategy, appropriate individuals are selected according to the non-dominated relationship and the crowding degree of the individuals to form a new parental population P t +1. Then, a new offspring population Q is generated through the basic operations of the genetic algorithm t +1, and P t +1 and Q t +1 are merged to form a new population R t . Repeat the above operations until the preset number of iterations or output conditions are reached, and then determine the final combination of the to-be-processed channels.

[0111] In the embodiments of the present application, non-dominated sorting is to divide all individuals in the population into different ranks according to the domination relationship for sorting. Specifically, it means sorting the individuals in the population according to the non-dominated sorting rule and dividing them into multiple fronts (Pareto Front). If an individual is better than another individual in all objectives, it is said to dominate that individual. Otherwise, the individual is said to be non-dominated. Since there is usually a solution set for the optimization problem, these solutions cannot be compared in terms of all objective functions, and the characteristic is that it is impossible to improve any objective function without weakening at least one other objective function. Such a solution is called a non-dominated solution or a Pareto optimal solution. The purpose of non-dominated sorting is to divide the individuals in the population into different ranks (Fronts) according to the domination relationship. The optimal individuals are in the first Front, the sub-optimal individuals are in the second Front, and so on.

[0112] Crowding degree calculation refers to calculating the crowding distance for individuals in each rank. The crowding distance reflects the distance of an individual from its neighboring individuals in the solution set. The computational complexity is O(MN) 2 , where M is the number of objectives and N is the population size. The formula for calculating the crowding distance is: In the formula, f m (i) is the sorting function value of the i-th individual under m objectives. Crowding degree calculation ensures the diversity of individuals in the population, which is beneficial for individuals to perform selection, crossover, and mutation within the entire interval.

[0113] After obtaining the individual rank division result by performing non-dominated sorting and crowding degree calculation on the individuals in the combined population in this embodiment, the individuals in the combined population are selected according to the individual rank division result to obtain a new parent population, and the number of individuals in the new parent population is equal to the channel number optimization target. Specifically, the elitist strategy means jointly constructing a population from the parent generation and the new offspring generated by selection, crossover, and mutation, then performing non-dominated selection operation and rank division, and finally performing rank-priority selection until the population size is equal to the original population size. Among them, the operating principle of the population size changing from 2N to N is as Figure 6 shown.

[0114] It can be understood that after determining the candidate EEG signals corresponding to the channel combination to be processed, the short-time Fourier transform (STFT) can be performed on the candidate EEG signals corresponding to the channel combination to be processed based on a preset window to obtain a spectrogram. Specifically, STFT can be used to cut the candidate EEG signals into short-window spectrograms, and the data from 0 to 50 Hz can be retained for the next feature extraction. Specifically, in this embodiment, the STFT is performed on the original signal x(t). First, the window is moved to the starting position of the signal. At this time, the center position of the window function is at t = τ0, and the signal is windowed y(t) = x(t) · w(t - τ0), and then the Fourier transform is performed:

[0115]

[0116] Repeat the above operations, continuously slide the window for Fourier transform. The window length can be set to 10 s this time, and the sliding step size is 1 s. Finally, the spectral results of all segments from τ0 to τ N form a spectrogram.

[0117] In the embodiment of the present application, the preset residual network of this embodiment includes a first convolutional unit, a second convolutional unit, a third convolutional unit, a fourth convolutional unit, and a fifth convolutional unit; the first convolutional unit is used to extract features from the spectrogram and output a first feature map with a first preset size; the second convolutional unit is used to extract features from the first feature map and output a second feature map with a first preset size; the third convolutional unit is used to perform feature extraction, dimension increase, and downsampling on the second feature map and then output a third feature map with a second preset size; the fourth convolutional unit is used to perform feature extraction, dimension increase, and downsampling on the third feature map and then output a fourth feature map with a third preset size; the fifth convolutional unit is used to perform feature extraction, dimension increase, and downsampling on the fourth feature map and then output a fifth feature map with a fourth preset size as the spectral feature map. Exemplarily, taking ResNet-18 as the preset residual network as an example, the basic architecture of the network is ResNet, and the network depth is 18 layers. Among them, the network depth refers to the weight layer of the network, including pooling, activation, and linear layers. Such as Figure 7As shown, the preset residual network of this embodiment uses an 18-layer residual network (ResNet-18) model, and its structure includes five parts, each part containing batch normalization, a non-linear activation function, and a max pooling layer. The electroencephalogram signal data is converted into a spectrogram through short-time Fourier transform. For the dataset, the input dimension is (10×21×50), that is, 10 electrode channels, and the frequency component ranges from 0 to 50 Hz. Each part of the ResNet-18 model outputs feature maps with the first preset size of (64×21×50), the first preset size of (64×21×50), the second preset size of (128×11×25), the third preset size of (256×6×13), and the fourth preset size of (512×3×7). The final feature map (spectral feature map) is converted into a 512-dimensional vector through adaptive average pooling and a flattening layer to be input into the next LSTM for binary classification.

[0118] It can be understood that the preset long short-term memory network adopted in this embodiment is a recurrent neural network used to process and predict time series data. As Figure 8 shown, the preset long short-term memory network of this embodiment can effectively solve the problem of gradient disappearance or explosion in traditional RNNs in the long-term dependence problem by introducing a memory cell, an input gate, a forget gate, and an output gate. Among them, the main task of the LSTM in this embodiment is to perform time series modeling on the sequence of feature vectors output by ResNet-18 and further realize the classification prediction of epileptic seizures. The input of the LSTM is the sequence of feature vectors, and the output is the hidden state of the last memory cell.

[0119] The role of the forget gate is to determine which information in a memory cell needs to be retained and which information needs to be discarded. It receives the current input and the hidden state of the previous moment as inputs and maps them to values between 0 and 1 through a Sigmoid activation function. Among them, a value close to 0 indicates that the corresponding state information will be forgotten, and a value close to 1 indicates that the information will be retained. The calculation formula of the forget gate is: where W f and b f are the weight matrix and bias vector of the forget gate respectively.

[0120] The input gate is responsible for controlling how much information in the current input will be updated into the memory state. It also receives the current input and the hidden state of the previous moment as inputs, calculates an update ratio through the Sigmoid function, and at the same time transforms the current input through a Tanh activation function, and then multiplies the two to obtain the information that needs to be updated into the memory state. The calculation formula of the input gate is: Among them, W i , b i , W C , b C are the relevant weight matrix and bias vector of the input gate respectively.

[0121] Update the memory state according to the results of the forget gate and the input gate. The specific formula is: Among them, ⊙ represents element-wise multiplication. The output gate determines which information in the memory state will be output as the hidden state at the current moment. The calculation formula of the output gate is: h t = o t ⊙ tanh(C t ); Among them, W o and b o are the weight matrix and bias vector of the output gate respectively.

[0122] The LSTM network of this embodiment captures the feature changes in the time dimension by modeling the input sequence of feature vectors, so as to more effectively distinguish epileptic seizures from normal states. The final classification result is realized through the output layer, providing an accurate prediction basis for the entire epileptic seizure prediction process. The final output result is the classification result of epileptic seizure prediction. For example, there will be no seizure during the interictal period, and there is a high probability of seizure during the pre-ictal period.

[0123] As can be seen from the above, as Figure 9 shown, the EEG data in the embodiments of the present application is cut into spectrograms with a 10-second window through short-time Fourier transform. Then the spectrograms are input into a hybrid model constructed by combining a residual network (ResNet-18) and a long short-term memory network (LSTM). The ResNet-18 is used to extract the image features of the spectrograms, and the LSTM performs time series analysis on the extracted features, thereby completing the classification prediction of the epileptic seizure period and effectively improving the prediction accuracy. At the same time, the second-generation non-dominated sorting genetic algorithm (NSGA-II) is used to streamline the number of EEG signal channels, which can effectively reduce the number of electrodes during application and effectively improve the wearing experience of patients.

[0124] In some embodiments, a 15-minute pre-ictal prediction experiment comparison is carried out between the method (proposed) of the embodiments of the present application and other epileptic seizure prediction methods. Among them, the channel number optimization target of the method of the embodiments of the present application is 10, and the experimental results are as Figure 10 shown. As can be seen from Figure 10 , the method of the embodiments of the present application is effectively streamlined in terms of the number of channels and has a relatively high prediction accuracy.

[0125] Refer to Figure 11, an embodiment of the present application provides a device for predicting epileptic seizures, the device comprising:

[0126] A first module 1110, configured to obtain candidate electroencephalogram signals corresponding to a plurality of candidate channels;

[0127] A second module 1120, configured to iteratively train an epileptic seizure prediction model based on the candidate electroencephalogram signals to obtain target model parameters, the target model parameters including a target channel type;

[0128] A third module 1130, configured to perform epileptic seizure prediction on a target object through the epileptic seizure prediction model corresponding to the target model parameters;

[0129] Wherein, iteratively training the epileptic seizure prediction model based on the candidate electroencephalogram signals to obtain target model parameters includes:

[0130] Combining the candidate channels according to the optimization target of the number of channels to obtain a to-be-processed channel combination;

[0131] Preprocessing the candidate electroencephalogram signals corresponding to the to-be-processed channel combination to obtain a spectrogram;

[0132] Inputting the spectrogram into a preset residual network for feature extraction to obtain a spectral feature map;

[0133] Inputting the spectral feature map into a preset long short-term memory network for time series analysis to obtain a time series classification result, the time series classification result including the pre-epileptic seizure period and the inter-epileptic seizure period;

[0134] Determining the target model parameters according to the time series classification result.

[0135] It can be understood that the content in the above method embodiments is applicable to the device embodiments of the present application. The functions specifically implemented by the device embodiments of the present application are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those in the above method embodiments.

[0136] An embodiment of the present application further provides an electronic device, the electronic device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the above method when executing the computer program. The electronic device may be any intelligent terminal including a tablet computer, a vehicle-mounted computer, etc.

[0137] It can be understood that the content in the above method embodiments is applicable to the device embodiments of the present application. The functions specifically implemented by the device embodiments of the present application are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those in the above method embodiments.

[0138] Please refer to Figure 12 , Figure 12Schematically shows the hardware structure of an electronic device according to another embodiment. The electronic device includes:

[0139] A processor 1210, which can be implemented in ways such as a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;

[0140] A memory 1220, which can be implemented in forms such as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1220 can store an operating system and other application programs. When implementing the technical solutions provided in the embodiments of this specification through software or firmware, the relevant program codes are stored in the memory 1220 and are called by the processor 1210 to execute the above methods of the embodiments of the present application;

[0141] An input / output interface 1230, which is used to implement information input and output;

[0142] A communication interface 1240, which is used to implement communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or through wireless means (such as mobile network, WIFI, Bluetooth, etc.);

[0143] A bus 1250, which transmits information between various components of the device (such as the processor 1210, the memory 1220, the input / output interface 1230, and the communication interface 1240);

[0144] Among them, the processor 1210, the memory 1220, the input / output interface 1230, and the communication interface 1240 achieve communication connections with each other inside the device through the bus 1250.

[0145] The embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above methods are implemented.

[0146] It can be understood that the content in the above method embodiments is applicable to the embodiments of this storage medium. The functions specifically implemented by the embodiments of this storage medium are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those of the above method embodiments.

[0147] As a non-transitory computer-readable storage medium, the memory can be used to store non-transitory software programs and non-transitory computer-executable programs. In addition, the memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some embodiments, the memory may optionally include memories remotely located relative to the processor, and these remote memories can be connected to the processor through a network. Examples of the above networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0148] The embodiments described in the embodiments of the present application are for more clearly illustrating the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those skilled in the art will know that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of the present application are equally applicable to similar technical problems.

[0149] Those skilled in the art can understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than those shown in the figures, or combine certain steps, or different steps.

[0150] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0151] Those of ordinary skill in the art can understand that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, and appropriate combinations thereof.

[0152] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not have to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances, so that the embodiments of the present application described here can be implemented in an order other than those illustrated or described here. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.

[0153] It should be understood that in this application, "at least one (item)" means one or more, and "a plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that there can be three relationships. For example, "A and / or B" can mean: only A exists, only B exists, and both A and B exist at the same time. Among them, A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are in an "or" relationship. "At least one (one) of the following" or a similar expression refers to any combination of these items, including any combination of single items (ones) or plural items (ones). For example, at least one (one) of a, b, or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0154] In several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the above division of units is only a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection to each other can be through some interfaces. The indirect coupling or communication connection of devices or units can be in an electrical, mechanical or other form.

[0155] The units described above as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they can be located in one place, or they can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0156] In addition, each functional unit in various embodiments of this application can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.

[0157] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods of various embodiments of this application. The aforementioned storage medium includes: various media that can store programs, such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs.

[0158] The preferred embodiments of the embodiments of this application have been described above with reference to the accompanying drawings, and thus do not limit the scope of the rights of the embodiments of this application. Any modifications, equivalent replacements, and improvements made by those skilled in the art without departing from the scope and essence of the embodiments of this application shall be within the scope of the rights of the embodiments of this application.

Claims

1. A method for predicting epileptic seizures, characterized in that, The method includes the following steps: Obtain candidate EEG signals corresponding to multiple candidate channels; Iteratively train an epilepsy seizure prediction model based on the candidate EEG signals to obtain target model parameters, where the target model parameters include target channel types; Perform epilepsy seizure prediction on a target object through the epilepsy seizure prediction model corresponding to the target model parameters; Among them, the iteratively training the epilepsy seizure prediction model based on the candidate EEG signals to obtain target model parameters includes: Combine the candidate channels according to the channel number optimization target to obtain a to-be-processed channel combination; Preprocess the candidate EEG signals corresponding to the to-be-processed channel combination to obtain a spectrogram; Input the spectrogram into a preset residual network for feature extraction to obtain a spectral feature map; Input the spectral feature map into a preset long short-term memory network for time series analysis to obtain a time series classification result, where the time series classification result includes the pre-epileptic seizure period and the inter-epileptic seizure period; Determine the target model parameters according to the time series classification result.

2. The method according to claim 1, wherein The combining the candidate channels according to the channel number optimization target to obtain a to-be-processed channel combination includes: Randomly generate an initial population according to the candidate channels, each individual in the initial population corresponds to one of the candidate channels, and the number of individuals in the initial population is equal to the channel number optimization target; Perform non-dominated sorting, selection, crossover, and mutation processing on the individuals in the initial population to obtain an offspring population; Merge the initial population and the offspring population to obtain a merged population; Perform non-dominated sorting, crowding degree calculation, and elite strategy selection on the individuals in the merged population to obtain a new parental population; Perform selection, crossover, and mutation processing on the individuals in the new parental population to obtain a new offspring population; Judge whether the generation number of the new parental population is greater than or equal to a preset generation number. If not, merge the new parental population and the new offspring population to obtain a new merged population, and then process the new merged population; otherwise, generate the to-be-processed channel combination with the optimal ratio.

3. The method according to claim 2, wherein The processing process of the non-dominated sorting includes: Sort all individuals in the population into different levels according to the domination relationship.

4. The method according to claim 2, wherein The performing non-dominated sorting, crowding degree calculation, and elite strategy selection on the individuals in the merged population to obtain a new parental population includes: Perform non-dominated sorting and crowding degree calculation on the individuals in the merged population to obtain an individual level division result; Select the individuals in the merged population according to the individual level division result to obtain the new parental population, and the number of individuals in the new parental population is equal to the channel number optimization target.

5. The method according to claim 1, wherein The preprocessing the candidate EEG signals corresponding to the to-be-processed channel combination to obtain a spectrogram includes: Perform short-time Fourier transform on the candidate EEG signals corresponding to the to-be-processed channel combination based on a preset window to obtain the spectrogram.

6. The method according to claim 1, wherein The preset residual network includes a first convolutional unit, a second convolutional unit, a third convolutional unit, a fourth convolutional unit, and a fifth convolutional unit; The first convolutional unit is configured to extract features from the spectrogram and then output a first feature map with a first preset size; The second convolutional unit is configured to extract features from the first feature map and then output a second feature map with a first preset size; The third convolutional unit is configured to perform feature extraction, dimension elevation, and downsampling on the second feature map, and then output a third feature map with a second preset size; The fourth convolutional unit is configured to perform feature extraction, dimension elevation, and downsampling on the third feature map, and then output a fourth feature map with a third preset size; The fifth convolutional unit is configured to perform feature extraction, dimension elevation, and downsampling on the fourth feature map, and then output a fifth feature map with a fourth preset size as the spectral feature map.

7. The method according to claim 1, wherein The obtaining of the candidate EEG signals corresponding to multiple candidate channels includes: Obtaining the candidate EEG signals of multiple candidate channels corresponding to an epilepsy subject in a preset age range.

8. An epileptic seizure prediction device, characterized in that, The device includes: A first module, configured to obtain the candidate EEG signals corresponding to multiple candidate channels; A second module, configured to iteratively train an epilepsy seizure prediction model based on the candidate EEG signals to obtain target model parameters, where the target model parameters include a target channel type; A third module, configured to perform epilepsy seizure prediction on a target object through the epilepsy seizure prediction model corresponding to the target model parameters; Wherein, the iteratively training the epilepsy seizure prediction model based on the candidate EEG signals to obtain target model parameters includes: Combining the candidate channels according to the objective of optimizing the number of channels to obtain a to-be-processed channel combination; Performing preprocessing on the candidate EEG signals corresponding to the to-be-processed channel combination to obtain a spectrogram; Inputting the spectrogram into a preset residual network for feature extraction to obtain a spectral feature map; Inputting the spectral feature map into a preset long short-term memory network for time series analysis to obtain a time series classification result, where the time series classification result includes the pre-epileptic seizure period and the inter-epileptic seizure period; Determining the target model parameters according to the time series classification result.

9. An electronic device, characterized in that, Includes: At least one processor; At least one memory, configured to store at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method according to any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, The computer program, when executed by a processor, implements the method according to any one of claims 1 to 7.