Epilepsy prediction method and system based on Optuna-CNN and BiLSTM

By classifying and preprocessing epileptic states in EEG channel signal data, and combining Optuna-CNN and BiLSTM models, and selecting appropriate prediction methods based on different patient data volumes, the problem of low accuracy in practical applications of existing epilepsy prediction methods is solved, achieving higher prediction accuracy and stability.

CN120895239APending Publication Date: 2025-11-04THE 940TH HOSPITAL OF THE CHINESE PEOPLES LIBERATION ARMY JOINT LOGISTICS SUPPORT FORCE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511011327.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-22
Publication Date
2025-11-04

AI Technical Summary

Technical Problem

Existing epilepsy prediction methods suffer from low prediction accuracy in practical applications, and due to large differences in experimental data, they cannot be effectively generalized to new data, posing a risk of overfitting.

Method used

Optuna-CNN and BiLSTM models were used to segment and preprocess EEG channel signal data for epileptic states. Different models were used for epilepsy prediction depending on the amount of patient data. For patients with limited data, a CNN-BiLSTM model with the Cox-Stuart early arrest mechanism was used, while a CNN model with the Optuna optimization algorithm was used for patients with abundant data.

Benefits of technology

It improves the model's generalization ability, reduces the impact of sample data differences, and enhances the accuracy and stability of predictions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120895239A_ABST
    Figure CN120895239A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of epilepsy prediction, in particular to an epilepsy prediction method and system based on Optuna-CNN and BiLSTM, and the method comprises the steps: obtaining a plurality of electroencephalogram channel signal data of a patient; performing epilepsy state division on each electroencephalogram channel signal data to obtain all epilepsy states; each piece of electroencephalogram channel signal data is preprocessed, and each piece of preprocessed electroencephalogram channel signal data is obtained; dividing the patient into a multi-data patient and a less-data patient according to the duration of the electroencephalogram channel signal data of the patient; through electroencephalogram channel signal data after preprocessing and epilepsy state division, epilepsy prediction is performed on a multi-data patient and a less-data patient by using different models. According to the invention, the influence of sample data difference on the model is reduced.
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 prediction, and in particular to an epilepsy prediction method and system based on Optuna-CNN and BiLSTM. BACKGROUND

[0002] The epilepsy prediction model based on Optuna-CNN (Convolutional Neural Network) and BiLSTM (Bidirectional Long Short-Term Memory) combines automatic hyperparameter optimization, powerful feature extraction capability, and time series modeling capability, and can effectively extract important information from EEG (Electroencephalogram) signals to predict the occurrence of seizures. This method has important significance in the early prediction of seizures, disease management, and treatment, especially in helping to alert patients for appropriate intervention in a timely manner in clinical practice.

[0003] In the existing epilepsy prediction technology, there is a problem of low prediction accuracy. However, there are also methods with high prediction accuracy. Although the accuracy of some methods is very high, due to the large difference in the number of experimental data and the lack of independent test set for verification, it is impossible to confirm whether the model can effectively generalize to new, unseen data in actual application. The high accuracy of the model may be because it only performs well on training data, and there may be a risk of overfitting. SUMMARY

[0004] The present application provides an epilepsy prediction method and system based on Optuna-CNN and BiLSTM to solve the existing problems.

[0005] The purpose of the present application can be achieved by the following technical solutions: The first aspect of the present application provides an epilepsy prediction method based on Optuna-CNN and BiLSTM, comprising: Obtaining a plurality of EEG channel signal data of a patient; Dividing the epilepsy state of each EEG channel signal data to obtain all epilepsy states; preprocessing each EEG channel signal data to obtain preprocessed each EEG channel signal data; Dividing the patient into a multi-data patient and a few-data patient according to the length of the patient's EEG channel signal data; using different models for the multi-data patient and the few-data patient to predict epilepsy based on the preprocessed and epilepsy state divided EEG channel signal data.

[0006] Further, the several brain electrical channel of the patient includes: FP1-F7, F7-T7, T7-P7, P7-O1, FP1-F3, F3-C3, C3-P3, P3-O1, FP2-F4, F4-C4, C4-P4, P4-O2, FP2-F8, F8-T8, T8-P8-O, P8-O2, FZ-CZ, CZ-PZ, P7-T7, T7-FT9, FT9-FT10, FT10-T8.

[0007] Further, the epilepsy state division of each brain electrical channel signal data is obtained, and all epilepsy states include: The pre-ictal stage is defined as the period from 1 hour to 1 minute before the onset of epilepsy The post-ictal stage is defined as the period from 1 minute to 1 hour after the end of epilepsy The post-ictal stage is defined as the period from 1 minute to 1 hour after the end of epilepsy The inter-ictal stage is defined as the period from 1 hour to 1 hour after the end of epilepsy The inter-ictal stage is defined as the period from 1 hour to 1 hour after the end of epilepsy The inter-ictal stage is defined as the period from 1 hour to 1 hour after the end of epilepsy; wherein , , , are preset parameters.

[0008] Further, the pre-processing of each brain electrical channel signal data includes: The standard normalization processing and interference frequency screening of each brain electrical channel signal data are obtained.

[0009] Further, the standard normalization processing of each brain electrical channel signal data includes: The formula for standard normalization is:

[0010] In the formula, each raw data value in each brain electrical channel signal, and respectively represent the maximum value and the minimum value of the raw data in each brain electrical channel signal, and represent the upper limit and the lower limit of the target scaling range, represent the data value of the data standardization in each brain electrical channel signal.

[0011] Further, the interference frequency screening includes: All frequencies in each electroencephalogram channel signal that are the preset environmental reference frequency and less than the preset low threshold frequency are screened out by a notch filter function and a high-pass filter function, and the remaining frequencies after screening are reserved as the data frequency after filtering.

[0012] Further, the patients are divided into a large data patient and a small data patient according to the length of the electroencephalogram channel signal data of the patient; different models are used for the large data patient and the small data patient to predict epilepsy according to the preprocessed electroencephalogram channel signal data and the epilepsy state, including: First, all patients are divided according to the length of the electroencephalogram signal monitoring time, and the length of the electroencephalogram channel signal data of each patient is greater than a preset time parameter Patients with a length of more than one hour are recorded as large data patients, and all patients other than the large data patients are recorded as small data patients; Two models are used to predict epilepsy according to the amount of patient data; The first prediction method is to use the data of all other large data patients to predict epilepsy when predicting epilepsy for each patient as a small data patient; wherein the first prediction method is a CNN-BiLSTM model based on Cox-Stuart early stopping mechanism, specifically: The electroencephalogram channel signal data in the training set and the validation set after preprocessing and epilepsy state division is put into the designed CNN-BiLSTM model for training and verification, the loss function of the validation set is tested by Cox-Stuart, whether there is an upward trend is determined and early stopping is performed, and the model is evaluated in combination with the accuracy, sensitivity and specificity; The second prediction method is to directly use the data of the patient itself to predict epilepsy when predicting epilepsy for each patient as a large data patient; wherein the second prediction method is a CNN model based on an optuna optimization algorithm, specifically: The CNN model is used to train all electroencephalogram channel signal data of a single patient after preprocessing and epilepsy state division, and the loss value of the validation set obtained each time is fed back to the optuna optimization algorithm, and the optuna optimization algorithm adjusts the hyperparameters to minimize the loss value of the validation set; when the number of training reaches a preset maximum number of training, the training and optimization of the model are stopped, and the model parameters corresponding to the minimum loss value of the validation set in the preset maximum number of training are selected as the final model parameters; finally, the optimal model parameters after training are saved, and the model performance is tested using the test set data to obtain the sensitivity, specificity and accuracy of the test set, and the sensitivity, specificity and accuracy are used for evaluation; The epilepsy of the few-data patient is predicted through the trained CNN-BiLSTM model; and the epilepsy of the many-data patient is predicted through the trained CNN model.

[0013] The second aspect of the present application provides an epilepsy prediction system based on Optuna-CNN and BiLSTM, comprising: A data acquisition module is configured to acquire a plurality of electroencephalogram channel signal data of a patient. A preprocessing and state division module is configured to divide the epilepsy state of each electroencephalogram channel signal data to obtain all epilepsy states, and to preprocess each electroencephalogram channel signal data to obtain preprocessed electroencephalogram channel signal data. A model training and prediction module is configured to divide the patient into a many-data patient and a few-data patient according to the length of the electroencephalogram channel signal data of the patient, and to use different models to predict the epilepsy of the many-data patient and the few-data patient respectively according to the preprocessed and epilepsy state divided electroencephalogram channel signal data.

[0014] The third aspect of the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the epilepsy prediction method based on Optuna-CNN and BiLSTM.

[0015] The fourth aspect of the present application provides a computer readable storage medium storing a computer program, wherein the computer program is executed by a processor to implement the epilepsy prediction method based on Optuna-CNN and BiLSTM.

[0016] Compared with the prior art, the epilepsy state of each electroencephalogram channel signal data is divided to obtain all epilepsy states, and each electroencephalogram channel signal data is preprocessed to obtain preprocessed electroencephalogram channel signal data, thereby reducing the noise interference degree in the sample data; the patient is divided into a many-data patient and a few-data patient according to the length of the electroencephalogram channel signal data of the patient; the epilepsy of the many-data patient and the few-data patient is predicted using different models respectively according to the preprocessed and epilepsy state divided electroencephalogram channel signal data; the influence of the difference of the sample data on the model is reduced, and the generalization of the model is improved. BRIEF DESCRIPTION OF DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description only constitute some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of these drawings.

[0018] Figure 1 A step flow chart of an epilepsy prediction method based on Optuna-CNN and BiLSTM is provided for the present application. Figure 2 A module flow chart of an epilepsy prediction system based on Optuna-CNN and BiLSTM is provided for the present application. DETAILED DESCRIPTION

[0019] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments only constitute some of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should fall within the scope of protection of the present application.

[0020] It should be noted that the terms "first", "second" and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0021] In view of the problems in the background art, the present application is designed to provide an epilepsy prediction method and system based on Optuna-CNN and BiLSTM, which has important practical significance.

[0022] As shown in Figure 1 The first aspect of the present application is to provide an epilepsy prediction method based on Optuna-CNN and BiLSTM, comprising the following steps: Step S001: Collecting the brain electrical channel signal data of the patient.

[0023] It should be noted that in order to analyze and predict the condition of epilepsy patients and avoid affecting the results due to data problems, the data collection method conforms to the international standard and the data of epilepsy patients in well-known hospitals are selected for analysis.

[0024] Specifically, a refractory epilepsy scalp EEG dataset CHB-MIT collected by Boston Children's Hospital is acquired, and the dataset is collected by an international standard guide system; wherein the sampling frequency is 256HZ. A folder is constructed for each patient, and the data of each patient is stored in the corresponding folder. Each patient's folder contains several.edf files of EEG channels. The.edf files of several EEG channels contain one EEG channel signal data.

[0025] It should be further pointed out that since the number of EEG channels and electrode names of some patient.edf files are slightly different, and there are repeated electrode names, in order to ensure good prediction results, it is finally decided to use the EEG channels that most subjects have for analysis.

[0026] The EEG channels that most subjects have include: FP1-F7, F7-T7, T7-P7, P7-O1, FP1-F3, F3-C3, C3-P3, P3-O1, FP2-F4, F4-C4, C4-P4, P4-O2, FP2-F8, F8-T8, T8-P8-0, P8-O2, FZ-CZ, CZ-PZ, P7-T7, T7-FT9, FT9-FT10, FT10-T8.

[0027] Since the time annotation of the seizure is not clear, it will have a certain impact on the training and prediction of the model, therefore, the folders with unclear seizure time annotation are removed, and the data of the folders with clear annotation are retained.

[0028] Step S002: dividing the epilepsy state in different time periods.

[0029] It should be noted that in order to better capture the timing characteristics of seizures and improve the classification accuracy of the model, the epilepsy state in time sequence is divided; and dividing the different time periods of epilepsy helps to improve the accuracy and robustness of the model, and provides earlier seizure warning and personalized treatment plan. Through detailed analysis of the signals in different periods of seizures, the network can be trained to better understand and predict seizures, thereby improving the level of disease management.

[0030] It should be further pointed out that since the public dataset CHB-MIT only annotates the start and end time of the seizure, it is necessary to manually define the pre-seizure, interictal and postictal data segments.

[0031] Specifically, the preictal stage is defined as the period from 1 minute to 30 minutes before the onset of a seizure Specifically, the postictal stage is defined as the period from 1 minute to 30 minutes after the end of a seizure Specifically, the interictal stage is defined as the period from 1 hour to 30 hours after the end of a seizure to the onset of the next seizure , , , are preset parameters, in the embodiment , , , ; wherein in the embodiment , , , are not specifically limited, and can be determined according to specific conditions.

[0032] Since the preictal stage and the interictal stage are unevenly distributed and have a small amount of data, the preictal stage and the interictal stage will overlap when the preictal stage and the interictal stage overlap, which will reduce the data length of the two stages, and thus affect the learning effect of the model. Therefore, the preictal stage and the interictal stage are overlapped to increase the data samples.

[0033] Specifically, the preset overlap time length is used to increase the data samples; that is, the middle time length in the overlapping period of the preictal stage and the interictal stage is respectively included in the preictal stage and the interictal stage. For example, the first window is from 0 seconds to 10 seconds, and the second window is from 5 seconds to 15 seconds, that is, the middle 5 seconds are respectively included in the two time periods.

[0034] In the embodiment, the preset overlap time length seconds, wherein is not specifically limited, and can be determined according to specific conditions.

[0035] Step S003: data preprocessing.

[0036] It should be noted that the signal amplitude of the same brain electrical channel in different seizure states may have certain differences, and the signal amplitudes of different brain electrical channels also have differences. In order to better distinguish the interictal stage and the preictal stage of epilepsy, it is very necessary to perform normalization processing on the original data.

[0037] ​​​Specifically, the embodiment uses the MinMaxScaler (min-max normalization) standardization method in the Scikit-learn library to standardize each electroencephalogram channel signal data. Scikit-learn is an open-source Python library for machine learning.

[0038] The specific formula of the MinMaxScaler standardization is as follows:

[0039] In the formula, x represents each raw data value in each electroencephalogram channel signal, and x max and x min represent the maximum and minimum values of the raw data in each electroencephalogram channel signal, and x upper and x lower represent the upper and lower limits of the target scaling range, x norm represents the data value of the data after standardization in each electroencephalogram channel signal. In the embodiment, the upper and lower limits of the target scaling range are 1 and 0, respectively. The upper and lower limits of the target scaling range are not specifically limited and can be determined by the implementer according to the specific circumstances.

[0040] It should be noted that, during the collection of electroencephalogram channel signal data, electromagnetic interference in the environment and thermal noise existing in the device itself can cause great noise interference to the relatively weak electroencephalogram signal. Therefore, it is necessary to remove the interference of environmental and device noise.

[0041] Further, since the interference frequency of the device during the collection process is generally small, a low threshold frequency is selected to screen out the interference of the device frequency. Since there is also some noise interference in the actual environment, the interference of environmental noise also needs to be excluded.

[0042] Specifically, the notch filter function and the high-pass filter function provided by the mne library (MNE-Python, MEG processing and analysis Python library) are used to screen out all frequencies in each electroencephalogram channel signal that are the preset environmental reference frequency and less than the preset low threshold frequency , and the remaining frequencies after screening are retained as the data frequencies after filtering. The notch filter function and the high-pass filter function are both well-known techniques, and will not be described in detail here.

[0043] In the formula, the preset low threshold frequency is , and the preset environmental reference frequency is In the embodiment, the preset low threshold frequency and the preset environmental reference frequency are not specifically limited and can be determined by the implementer according to the specific environmental interference.​​​

[0044] After the above standardization and filtering processes, preprocessed EEG channel signal data are obtained.

[0045] Step S004: Determine the two predictive models for epilepsy.

[0046] It should be noted that when predicting the condition of epilepsy based on patient data, the amount of data collected from different patients varies. When the amount of data collected from a patient is small, there are problems such as overfitting, underfitting, and unstable training when predicting the patient's epilepsy condition, which leads to a decrease in prediction accuracy. Therefore, two prediction methods are proposed depending on the amount of data collected from the patient.

[0047] Specifically, two prediction methods are given based on the amount of patient data; First, all patients were divided based on the duration of EEG signal monitoring, with each patient's EEG channel signal data acquisition time exceeding a preset parameter. Patients who have been in contact with patients for an hour are classified as having "multiple data points," while all other patients are classified as having "few data points." The preset time parameter... In this embodiment, the preset time parameter is not specifically limited, and the implementer can determine it according to the specific situation.

[0048] The first prediction method is to use the data of all other patients with multiple data when predicting epilepsy for each patient who is a patient with few data. The second prediction method is to directly use the patient's own data when predicting epilepsy for each patient who is a multi-data patient.

[0049] It should be noted that when patients with a smaller amount of data use data from other patients with a larger amount of data for epilepsy prediction, the training time for the neural network model may be slightly longer due to the larger amount of data. This is because the data provides more learning samples, the model needs more training cycles to optimize parameters, and the training results may result in overfitting. Therefore, using a method to prevent the influence of this factor and prevent overfitting can improve the generalization ability of the model and save computational resources.

[0050] It should be further noted that multi-patient data involves a large amount of data and high time complexity. This model reduces the time complexity and effectively extracts the temporal and spatial features of the data.

[0051] Specifically, the first prediction method is a CNN-BiLSTM model based on the Cox-Stuart early stopping mechanism. The EEG channel signal data after preprocessing and epilepsy state division in the training set and the validation set are put into the designed CNN-BiLSTM model for training and verification, the loss function of the validation set is subjected to Cox-Stuart test, it is judged whether there is an upward trend and early stopping, and the model is evaluated in combination with the accuracy, sensitivity and specificity. The process of evaluating the model by accuracy, sensitivity and specificity is a known technology, which will not be described in detail here.

[0052] In the Cox-Stuart early stopping mechanism, the probability function threshold is set to 0.1, and the early stopping threshold is set to 20. In this embodiment, the probability function threshold and the early stopping threshold are not specifically limited, and the implementer can determine them according to the specific situation.

[0053] It should be noted that when the amount of self data is large, only the neural network model needs to be trained according to the self data, but the amount and type of self data of different patients are different, that is, there are differences between patients. When training the CNN model, there are great differences between the various hyperparameters in the CNN model, so an optimization algorithm is used to determine the optimal hyperparameters in the CNN model corresponding to each patient.

[0054] Specifically, the second prediction method is a CNN model based on the optuna optimization algorithm.

[0055] First, the preset maximum number of trials trials of the optuna optimization algorithm is determined. In this embodiment, the preset maximum number of trials trials = 50, and in this embodiment, trials is not specifically limited, and the implementer can determine it according to the specific situation. The search range of the learning rate, batch size, epoch and regularization coefficient of the CNN model is determined by using the optuna optimization algorithm. In this embodiment, the range of the learning rate is ; the batch size is selected from 64 and 128; the range of epoch is [50, 200]; and the range of the regularization coefficient is [0.5, 1], but none of them is specifically limited in this embodiment.

[0056] According to the optuna optimization algorithm, the learning rate, the batch size, the epoch, and the regularization coefficient of each trial are adaptively determined; Specifically: using the CNN model to train, verify all the electroencephalogram channel signal data of a single patient after preprocessing and epilepsy state division, the validation set loss value obtained by each training is fed back to the optuna optimization algorithm, and the optuna optimization algorithm adjusts the hyperparameters to minimize the validation set loss value; when the number of training reaches the preset maximum number of training, stop the training and optimization of the model, and select the model parameters corresponding to the minimum validation set loss value in the preset maximum number of training as the final model parameters; finally, save the optimal model parameters after training, and test the model performance using the test set data, obtain the sensitivity, specificity and accuracy of the test set, and evaluate through the sensitivity, specificity and accuracy.

[0057] Among them, Cox-Stuart early stopping mechanism and optuna optimization algorithm are known technologies, which will not be described in detail here. Among them, CNN-BiLSTM model and CNN model are known technologies, which will not be described in detail here. Among them, in this embodiment, the ratio between the training set, the validation set and the test set is 6:2:2.

[0058] It should be further pointed out that the structure of the CNN model in this embodiment is determined by experience and experiment: 3 two-dimensional convolution layers, 2 batch normalization layers, 2 maximum pooling layers, and 2 activation function sets.

[0059] Step S005: epilepsy prediction of the patient.

[0060] The trained CNN-BiLSTM model is used to predict epilepsy of the few-data patient, and the trained CNN model is used to predict epilepsy of the many-data patient.

[0061] As shown in Figure 2 The second aspect of the present application is to provide an epilepsy prediction system based on Optuna-CNN and BiLSTM, comprising the following modules: The data acquisition module 101 is used to acquire a plurality of electroencephalogram channel signal data of a patient; The preprocessing and state division module 102 is used to divide the epilepsy state of each electroencephalogram channel signal data to obtain all the epilepsy states; and to preprocess each electroencephalogram channel signal data to obtain each preprocessed electroencephalogram channel signal data; The model training and prediction module 103 is used to divide the patient into a many-data patient and a few-data patient according to the length of the electroencephalogram channel signal data of the patient; and to use different models for epilepsy prediction of the many-data patient and the few-data patient respectively by using the electroencephalogram channel signal data after preprocessing and epilepsy state division.

[0062] The third aspect of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements an epilepsy prediction method based on Optuna-CNN and BiLSTM when executing the computer program.

[0063] The fourth aspect of the present application provides a computer readable storage medium, which stores a computer program, and the computer program implements an epilepsy prediction method based on Optuna-CNN and BiLSTM when executed by a processor.

[0064] Those skilled in the art will understand that embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage, etc.) containing computer-usable program code.

[0065] The present application is described with reference to flowcharts and / or block diagrams of methods, systems, and computer program products according to embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, as well as combinations of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing apparatus to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing apparatus produce an apparatus that implements the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions specified in a flow or multiple flows and / or blocks Figure 1 The functions specified in a flow or multiple flows and / or blocks

[0066] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including instruction apparatus, which implements the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions specified in a flow or multiple flows and / or blocks Figure 1 The functions specified in a flow or multiple flows and / or blocks

[0067] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus, so that a series of operation steps are performed on the computer or other programmable data processing apparatus to produce a computer-implemented process, so that the instructions executed on the computer or other programmable data processing apparatus provide a process for implementing the functions specified in the flowcharts and / or block diagrams. Figure 1a process or processes and / or blocks Figure 1 steps of the functions specified in the block or blocks.

[0068] Finally, it should be noted that the above examples are merely intended to illustrate the technical solutions of the present application but not to limit the same. Although the present application has been described in detail with reference to the above examples, those of ordinary skill in the art should understand that the specific implementation of the present application can be modified or equivalently replaced without departing from the spirit and scope of the present application, and any modification or equivalent replacement without departing from the spirit and scope of the present application should be covered in the protection scope of the claims of the present application.

Claims

1. An epilepsy prediction method based on Optuna-CNN and BiLSTM, characterized in that, include: Acquire signal data from several brainwave channels of the patient; Epilepsy states were classified for each EEG channel signal data to obtain all epilepsy states; Preprocessing of signal data for each EEG channel yields preprocessed signal data for each EEG channel. Patients are categorized into those with high data volume and those with low data volume based on the duration of their EEG signal data. By using preprocessed and epileptic state-segregated EEG channel signal data, different models were used to predict epilepsy in patients with large and small datasets.

2. The epilepsy prediction method based on Optuna-CNN and BiLSTM according to claim 1, characterized in that, The patient's several EEG channels include: FP1-F7, F7-T7, T7-P7, P7-O1, FP1-F3, F3-C3, C3-P3, P3-O1, FP2-F4, F4-C4, C4-P4, P4-O2, FP2-F8, F8-T8, T8-P8-0, P8-O2, FZ-CZ, CZ-PZ, P7-T7, T7-FT9, FT9-FT10, FT10-T8.

3. The epilepsy prediction method based on Optuna-CNN and BiLSTM according to claim 1, characterized in that, The process of classifying the epileptic states for each EEG channel signal data yields all epileptic states, including: Pre-ictal phase is defined as the period before an epileptic seizure. Minutes before a seizure Within minutes, the postictal phase is defined as after the end of a seizure. Within minutes, the interictal period is defined as the period following this epileptic seizure. Hours until the next seizure Within an hour; among them, , , , All are preset parameters.

4. The epilepsy prediction method based on Optuna-CNN and BiLSTM according to claim 1, characterized in that, The preprocessing of the signal data for each EEG channel to obtain preprocessed signal data for each EEG channel includes: The signal data of each EEG channel were subjected to standard normalization and interference frequency filtering to obtain preprocessed signal data of each EEG channel.

5. The epilepsy prediction method based on Optuna-CNN and BiLSTM according to claim 4, characterized in that, The standardization process for the signal data of each EEG channel includes: The formula for standard normalization is: In the formula, This represents each raw data value in the signal of each EEG channel. and These represent the maximum and minimum values ​​of the raw data in each EEG channel signal, respectively. and Indicates the upper and lower limits of the target scaling range. This represents the standardized data value of the data in each EEG channel signal.

6. The epilepsy prediction method based on Optuna-CNN and BiLSTM according to claim 4, characterized in that, The filtering of the interference frequencies includes: The notch filter and high-pass filter functions are used to filter out all frequencies in each EEG channel signal that are the preset environmental reference frequency and frequencies that are lower than the preset low threshold frequency. The remaining frequencies after filtering are retained as the data frequencies after filtering.

7. The epilepsy prediction method based on Optuna-CNN and BiLSTM according to claim 1, characterized in that, The patient is categorized into patients with high data volume and patients with low data volume based on the duration of the patient's EEG channel signal data. Using preprocessed EEG channel signal data and epileptic state, different models were used to predict epilepsy in patients with abundant and scarce data, including: First, all patients were divided according to the duration of EEG signal monitoring, with the data acquisition time for all EEG channels of each patient exceeding a preset time parameter. Patients who had been in contact with patients for an hour were classified as having multiple data points, and all other patients were classified as having fewer data points. Two models were used to predict epilepsy based on patient data. The first prediction method involves using data from all other patients with abundant data when predicting epilepsy for each patient who has limited data. This method is based on a CNN-BiLSTM model using the Cox-Stuart early arrest mechanism. The preprocessed and epileptic state-classified EEG channel signal data from the training and validation sets are fed into the designed CNN-BiLSTM model for training and validation. The Cox-Stuart test is performed on the loss function of the validation set to determine if there is an upward trend and stop early. The model is evaluated by combining accuracy, sensitivity, and specificity. The second prediction method involves using the patient's own data directly when predicting epilepsy for each patient, especially when each patient has multiple data points. This second prediction method is based on a CNN model using the Optuna optimization algorithm, specifically: A CNN model was used to train and validate all EEG channel signal data of a single patient after preprocessing and epileptic state segmentation. The validation set loss value obtained from each training session was fed back to the optuna optimization algorithm. The optuna optimization algorithm adjusted the hyperparameters by minimizing the validation set loss value. When the number of training iterations reached the preset maximum number of training iterations, the model training and optimization were stopped, and the model parameters corresponding to the minimum validation set loss value among the preset maximum number of training iterations were selected as the final model parameters. Finally, the optimal model parameters after training were saved, and the model performance was tested using test set data to obtain the sensitivity, specificity, and accuracy of the test set, which were then used for evaluation. Predicting epilepsy in patients with limited data using a trained CNN-BiLSTM model; predicting epilepsy in patients with abundant data using a trained CNN model.

8. An epilepsy prediction system based on Optuna-CNN and BiLSTM, characterized in that, include: Data acquisition module: used to acquire signal data from several EEG channels of the patient; Preprocessing and state segmentation module: used to segment the epileptic states of each EEG channel signal data to obtain all epileptic states; Preprocessing of signal data for each EEG channel yields preprocessed signal data for each EEG channel. Model training and prediction module: used to classify patients into those with more data and those with less data based on the duration of their EEG signal data; By using preprocessed and epileptic state-segregated EEG channel signal data, different models were used to predict epilepsy in patients with large and small datasets.

9. An electronic device, characterized in that, The method includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the epilepsy prediction method based on Optuna-CNN and BiLSTM as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the epilepsy prediction method based on Optuna-CNN and BiLSTM as described in any one of claims 1-7.