CN117158997A - Deep learning-based epileptic electroencephalogram signal classification model building method and classification method - Google Patents

Deep learning-based epileptic electroencephalogram signal classification model building method and classification method Download PDF

Info

Publication number
CN117158997A
CN117158997A CN202311319106.3A CN202311319106A CN117158997A CN 117158997 A CN117158997 A CN 117158997A CN 202311319106 A CN202311319106 A CN 202311319106A CN 117158997 A CN117158997 A CN 117158997A
Authority
CN
China
Prior art keywords
classification
features
abilstm
epileptic
detection method
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311319106.3A
Other languages
Chinese (zh)
Inventor
刘侠
桂桑榆
李冰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Harbin University of Science and Technology
Original Assignee
Harbin University of Science and Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Harbin University of Science and Technology filed Critical Harbin University of Science and Technology
Priority to CN202311319106.3A priority Critical patent/CN117158997A/en
Publication of CN117158997A publication Critical patent/CN117158997A/en
Pending legal-status Critical Current

Links

Landscapes

  • Measurement And Recording Of Electrical Phenomena And Electrical Characteristics Of The Living Body (AREA)

Abstract

An epileptic brain electrical signal automatic detection method based on deep learning. Epilepsy is a life-threatening and challenging neurological disorder that occurs suddenly without any symptoms before onset. Electroencephalogram is a clinically usual detection method, but manual examination of electroencephalogram brain signals is a time-consuming and laborious process, which places a heavy burden on doctors and its detection effect is not good. Based on the method, an epileptic brain electrical signal automatic detection method based on improved ResNet+ABiLSTM is provided. The automatic electroencephalogram signal classification detection method comprises the following steps of: A. signal preprocessing, and extracting signal characteristics by the improved ResNet; B. the shallow features highlight key features and complete classification by using a one-dimensional spatial attention mechanism; C. features are further extracted and classification is done using bi-directional LSTM with attention mechanism (ABiLSTM); D. the classification results are summarized and a probability distribution is obtained using an activation function. The application can realize accurate classification detection of epileptic brain electrical signals and has important significance for diagnosis of epileptic seizures.

Description

Deep learning-based epileptic electroencephalogram signal classification model building method and classification method
Technical Field
The application belongs to the field of medical treatment, and particularly relates to a method capable of automatically classifying epileptic brain electrical signals for diagnosis, treatment and research of epileptic subjects.
Background
And because seizures are not predictive, if the patient is not cared, the continuous convulsion during the onset of the disease can lead to multiple organ failure and possibly sudden death of the patient. In order to make a diagnosis on epileptic seizures rapidly and effectively, timely treatment is carried out to reduce harm of epileptic seizures to patients.
The use of deep learning can greatly improve classification accuracy, and has been widely used in biomedicine. They can automatically detect the characteristics of the input data, thereby improving the difficulty of characteristic detection inherent in the conventional pattern analysis technique. In the field of electroencephalogram signal analysis, convolutional neural networks and long-term and short-term memory networks have achieved good effects and are widely used. The attention mechanism can enable the model to further acquire more key information, so that the efficiency and performance of the model are improved to a certain extent.
The epileptic electroencephalogram signal detection method based on deep learning does not need manual intervention, so that the speed and the accuracy of epileptic seizure detection are improved to a great extent, but the training of a network is very dependent on the data quantity, the phenomenon of unbalance and overfitting can be generated due to insufficient data of epileptic seizure or insufficient data and the deepening of the network layer number, so that whether the epileptic seizure is or not can not be effectively detected, and the conditions of misidentification and missing identification occur.
The existing deep learning model needs to be improved and combined with the training of the electroencephalogram signals during epileptic seizure, the seizure of epileptic diseases is automatically detected, and the method is particularly important for obtaining the detection result faster and more accurately due to less training data.
Disclosure of Invention
The application aims to solve the problems that the classification accuracy is low, the model is too dependent on data and the traditional manual feature extraction method is time-consuming and labor-consuming due to the influence of noise on the electroencephalogram signal classification of the existing epileptic seizure, and provides a deep learning-based epileptic electroencephalogram signal classification model building method and a classification method so as to solve the problems in the background technology.
In order to achieve the above purpose, the present application provides the following technical solutions:
in one aspect of the present application, a method for establishing an epileptic electroencephalogram classification model based on deep learning is provided, the epileptic electroencephalogram classification model uses an improved res net18 of one-dimensional cavity convolution (1D-Di-Conv) as a backbone network frame, and classification branch networks are a Spatial Attention Module (SAM) and a bidirectional long-short-term memory network (a-Bi-LSTM) with an attention mechanism, respectively. The method comprises the following steps:
the improved ResNet18 performs standardization and convolution operation on the input brain electrical signals, extracts preliminary features of different scales, and obtains an output feature tensor of the improved ResNet 18;
inputting the output characteristic tensor of the improved ResNet18 into the SAM and A-Bi-LSTM classification branch networks, respectively;
the SAM is based on a spatial attention mechanism, the output tensor of the improved ResNet18 is adjusted to be consistent with the number of required classes through one-dimensional convolution, preliminary classification features are obtained, the preliminary classification features are respectively subjected to maximum pooling and average pooling to obtain feature maximum values and average values, the feature maximum values are multiplied by a weight and then added to the feature average values, and finally a Relu activation function is used for activating the addition results to obtain preliminary classification results.
The A-Bi-LSTM further acquires time sequence characteristics through a forward LSTM and a backward LSTM based on an attention mechanism and the LSTM, acquires classified key information for the time sequence characteristics through the attention mechanism, and finally acquires a preliminary classification result for the key information through a full connection layer.
And adding the primary classification result of the SAM and the primary classification result of the A-Bi-LSTM, and activating the addition result through a Relu activation function to obtain a final classification result.
And training the epileptic electroencephalogram signal classification models based on the deep learning respectively to obtain a loss function of the epileptic electroencephalogram signal classification models based on the deep learning.
And training the preset iteration times according to the loss function to obtain an optimal epileptic electroencephalogram signal classification model, and completing model establishment.
In a second aspect, the application provides a method for classifying epileptic brain electrical signals based on deep learning, wherein brain electrical signals are input into an epileptic brain electrical signal classification model based on deep learning, and epileptic brain electrical signal classification results are obtained.
The application has the beneficial effects that:
first, the method of the present application uses a modified (ResNet) backbone to share a Network, and uses SAM and A-Bi-LSTM as classified branch networks. The trunk sharing network performs preliminary extraction on the characteristics of different scales by adopting a parameter hard sharing mode on the input electroencephalogram signals, and shares the extracted characteristics to the two classification branch networks. In the two classified branch networks, the attention mechanism highlights the primary characteristics extracted by the trunk, so that the primary classification is finished, and finally, the results of the two classified branch networks are summarized and the final result is obtained. The SAM outputs four preliminary classification results based on different scale features, and the A-Bi-LSTM outputs one preliminary classification result according to the time sequence features.
Secondly, the application merges attention mechanisms in the two classification branch networks, can automatically acquire key characteristics, does not need to carry out excessive preprocessing on the electroencephalogram signal data, and can carry out more accurate classification when the data quantity is small.
Compared with the traditional classification method and the deep learning network classification method, the method provided by the application has better classification performance through comparison experiments. And the method for automatically extracting the characteristics reduces manpower, improves the rapidity and practicality of detection, and has higher efficiency.
Input data can be fully utilized by utilizing different scale characteristics and time sequence characteristics, and the problem of unbalanced data is solved. And the epileptic electroencephalogram signals have fewer data in the seizure period, so that the problem of unbalanced positive and negative samples exists. Therefore, the application has important research significance for realizing the classification of the epileptic brain electrical signals.
The application is suitable for classification of epileptic brain electrical signals.
Drawings
In order to more clearly illustrate the technical solution of the present application, the drawings that are needed in the embodiments will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a schematic diagram of an epileptic electroencephalogram classification model based on deep learning;
FIG. 2 is a schematic diagram of a Spatial Attention Module (SAM) of the present application;
FIG. 3 is a schematic diagram of a two-way long and short term memory network (A-Bi-LSTM) with an attention mechanism according to the present application;
the specific embodiment is as follows:
embodiments of the present application are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the drawings are exemplary and intended to illustrate the present application and should not be construed as limiting the application.
In a first embodiment, a method for establishing an epileptic electroencephalogram classification model based on deep learning, where the epileptic electroencephalogram classification model uses an improved res net18 as a backbone network, and branch networks are SAM and a-Bi-LSTM, respectively, and the method includes:
the improved ResNet18 performs standardization and convolution operation on the input brain electrical signals, extracts preliminary features of different scales, and obtains an output feature tensor of the improved ResNet 18;
inputting the output characteristic tensor of the improved ResNet18 into the SAM and A-Bi-LSTM classification branch networks, respectively;
the SAM is based on a spatial attention mechanism, the output tensor of the improved ResNet18 is adjusted to be consistent with the number of required classes through one-dimensional convolution, preliminary classification features are obtained, the preliminary classification features are respectively subjected to maximum pooling and average pooling to obtain feature maximum values and average values, the feature maximum values are multiplied by a weight and then added to the feature average values, and finally a Relu activation function is used for activating the addition results to obtain preliminary classification results.
The A-Bi-LSTM further acquires time sequence characteristics through a forward LSTM and a backward LSTM based on an attention mechanism and the LSTM, acquires classified key information for the time sequence characteristics through the attention mechanism, and finally acquires a preliminary classification result for the key information through a full connection layer.
And adding the primary classification result of the SAM and the primary classification result of the A-Bi-LSTM, and activating the addition result through a Relu activation function to obtain a final classification result.
And training the epileptic electroencephalogram signal classification models based on the deep learning respectively to obtain a loss function of the epileptic electroencephalogram signal classification models based on the deep learning.
And training the preset iteration times according to the loss function to obtain an optimal epileptic electroencephalogram signal classification model, and completing model establishment.
It should be noted that, according to the loss functions of the two classification branch networks, the two classification networks train simultaneously, and the backbone networks are the same, so there are a lot of shared parameters in the backbone network part. For example, the input signal size, batch size, learning rate, iteration number, and convolution kernel size, number of convolution kernels in the backbone network are all one of the shared parameters, and the probability of overfitting is smaller as more shared parameters are used.
And training for a certain iteration number by setting the iteration number, storing a result model after one training is completed, starting the next training, comparing the results of each training, and storing an optimal model (the epileptic electroencephalogram classification model).
In the initial training stage, in order to avoid gradient explosion, we use the learning rate arm up, that is, in the first five rounds of training, the learning rate is linearly increased from 0.001 to 0.002, and in the subsequent training, the learning rate is reduced as a cosin function, so that the sharing parameters reach the optimal value, the capability of learning features of the two can be enhanced, the respective losses are reduced, and thus the total loss is reduced, and the specific expression of the multiplying factor for adjusting the learning rate is as follows:
where i is the current training round number, f is the norm up factor, which is set to 0.001, e is the total training round number, 500, λ is the ending factor, and 10 -6
In this embodiment, first, the method of this embodiment uses a modified (Residual Network, res net) as a backbone shared Network, and uses SAM and a-Bi-LSTM as a class branch Network. The trunk sharing network performs preliminary extraction on the characteristics of different scales by adopting a parameter hard sharing mode on the input electroencephalogram signals, and shares the extracted characteristics to the two classification branch networks. In the two classified branch networks, the attention mechanism highlights the primary characteristics extracted by the trunk, so that the primary classification is finished, and finally, the results of the two classified branch networks are summarized and the final result is obtained. The SAM outputs four preliminary classification results based on different scale features, and the A-Bi-LSTM outputs one preliminary classification result according to the time sequence features.
Secondly, the application merges attention mechanisms in the two classification branch networks, can automatically acquire key characteristics, does not need to carry out excessive preprocessing on the electroencephalogram signal data, and can carry out more accurate classification when the data quantity is small.
Finally, the embodiment utilizes the learning force arm up and cosine function adjustment method to enable the sharing parameter to reach an optimal value, can enhance the capability of learning features of two classification branch networks, reduces respective loss, reduces total loss, and further improves the classification precision of the model on epileptic brain electrical signals.
In a second embodiment, the method for establishing an epileptic electroencephalogram classification model based on deep learning according to the first embodiment is further defined, and in the method for implementing the method, the executing step of the SAM is further defined, and specifically includes:
the SAM comprises a one-dimensional convolution, a maximum pooling and an average pooling and a Relu activation function.
The one-dimensional convolution is to convert the preliminary features of different scales into the same number of classifications in the channel dimension through a convolution kernel of 1 multiplied by 1 to obtain feature scores in classifications, and then to pass through the maximum pooling and average pooling respectively.
And the maximum pooling is to obtain the maximum value of the characteristic score in the channel dimension, and then multiply the maximum value with a weight to obtain the maximum pooling output.
The average pooling is to take the feature score as an average over the channel dimension and then add the maximum pooled output to obtain the inactive output.
And obtaining SAM preliminary classification results from the unactivated output through a Relu activation function.
The following formula is SAM:
Output=λ·Max(Convolution(x))+Mean(Convolution(x))#(2)
where x is the output tensor of the modified ResNet18, λ is the weight, which is experimentally set to 0.2, max is the maximum pooling, and Mean is the average pooling.
In order to make full use of the different scale features, a SAM classification branch network is used after each residual block in the backbone shared network for a total of four. The SAM classification branch network structure is shown in fig. 2.
According to the method and the device, key information of the preliminary features with different scales can be extracted, information loss is avoided, and classification accuracy is improved.
The third method is carried out in such a way that,
the present embodiment further defines the method for establishing an epileptic electroencephalogram classification model based on deep learning according to the first embodiment, and in the method for implementing the present embodiment, the executing step of the a-Bi-LSTM further defines the method specifically includes:
the A-Bi-LSTM comprises a forward LSTM and a backward LSTM, and an attention layer;
at each time t, the largest scale preliminary feature is provided to the forward LSTM and backward LSTM;
the forward LSTM is calculated forward from time 1 to time t to obtain the output tensor h of the forward hidden layer at each time f
The backward LSTM obtains the output tensor h of the backward hidden layer at each time from the time t to the time 1 b
And (3) carrying out the process of h f And h b Obtaining the output tensor h of the Bi-LSTM after adding;
the output h is subjected to a concentration mechanism to obtain key information, and then a preliminary classification result is output through a full-connection layer;
the implementation method of the A-Bi-LSTM implementation step is provided in the embodiment.
In this embodiment, the number of layers of the forward LSTM and the backward LSTM hidden layers is set to 128, and dropout with a drop rate of 50% is used to avoid the over-fitting problem.
Fourth embodiment
The method for establishing an epileptic electroencephalogram classification model based on deep learning according to the second embodiment is further defined, and in the method for establishing an epileptic electroencephalogram classification model based on deep learning, the attention mechanism of the a-Bi-LSTM is further defined, which specifically includes:
the attention mechanism execution steps of the A-Bi-LSTM specifically comprise:
adding the states of each hidden layer of the Bi-LSTM one by one, and activating the states through a Relu activation function to obtain an attention score alpha;
computing a query vector α and an input h to the attention layer using dot products t Similarity between the output data segments, and determining the importance of the output data segments by comparing the similarity, thereby obtaining a attention score s (h t ,q);
Converting the attention score into a probability distribution between 0 and 1 by using the tanh function and the softmax function, and obtaining the attention weight w t
According to the attention weight, input h t A weighted summation is performed to obtain the output O of the attention layer. The following formula is the attention mechanism formula of A-Bi-LSTM:
where the function f is the activation function Relu,for the final hidden state of the ith element, α is the query vector initialized from each original final hidden state, h t For input of the attention mechanism, a point product is used to calculate a attention score s (h t ,α),w t Is the attention weight.
Fifth embodiment
The present embodiment is further defined on the method for establishing an epileptic electroencephalogram signal classification model based on deep learning in the first embodiment, where the step of performing the final classification is further defined, and specifically includes:
adding the shallow feature classification results and the deep feature classification results output by the 4 SAMs;
activating the added result by using a relu activation function;
the probability distribution of the classification result is obtained using a softmax activation function.
The following formula is the formula for obtaining the final classification result:
Result=Softmax(f(∑Out Sam ))#(8)
wherein Result is the final output Result and function f is the activation function Relu.
The foregoing description clearly illustrates the technical solution, flow and advantages of the present application, and it is obvious to those skilled in the art that the present application is not limited by the foregoing embodiments, but the above embodiments and descriptions are merely not representative of the technical solution and principles of the present application, and the present application makes improvements of the corresponding algorithm without departing from the spirit and content of the present application, and all the improvements fall within the scope of the present application claimed, and the experimental results of the present application are realized in the specific form, and the scope of the present application is defined by the appended claims and equivalents.

Claims (6)

1. The method for establishing the epileptic electroencephalogram classification model based on deep learning is characterized by comprising the following steps of:
A. a signal preprocessing section that performs filtering, enhancement, and normalization processing on the signal;
B. improving the ResNet network to refer to the ResNet-18 network, amplifying the input feature map by reducing step size and introducing hole convolution for feature extraction of the enhanced signal;
C. adding an attribute mechanism to the shallow features for improving classification performance and completing classification of the shallow features;
the ABiLSTM part is used for further extracting the features and completing classification of deep features;
E. the shallow feature classification result and the deep feature classification result are added together and then activated by using an activation function.
2. The automatic epileptic electroencephalogram detection method based on the improved ResNet+ABiLSTM as claimed in claim 1, wherein the signal preprocessing in the step A comprises the following steps:
(1) And the signal preprocessing part is used for filtering, enhancing and standardizing the original electroencephalogram signals, wherein the filtering selects 0.53-40Hz band-pass filtering, so that irrelevant information is reduced, and the network can be better identified.
(2) The enhancement of the original electroencephalogram signals is carried out by selecting a window with the length of 1024 and the step length of 128, so that the number of data sets is increased, and the network is fully trained.
3. The automatic epileptic electroencephalogram detection method based on the improved ResNet+ABiLSTM as claimed in claim 1, wherein the feature extraction of the improved ResNet in the step B comprises the following steps:
(1) With reference to the ResNet-18 residual network, the input feature map is enlarged by reducing the step size and introducing a hole convolution, wherein four output features 32×114, 64× 38,128 × 14,256 ×7 are input as shallow features to the attention mechanism to highlight key features;
(2) The lower-level detail information and the higher-level semantic information of corners and the like are captured using skip connection (skip connection).
4. The automatic epileptic brain signal detection method based on the improved ResNet+ABiLSTM as claimed in claim 1, wherein the method for constructing the attention mechanism attention module in the step C comprises the following steps:
(1) The one-dimensional convolution operation adjusts the channel to be consistent with the classification number;
(2) Acquiring the maximum value and the average value of data on each channel by using a one-dimensional space attention mechanism;
(3) And adjusting the weight of the maximum value and the average value according to the model performance and weighting and summing.
5. The automatic epileptic electroencephalogram detection method based on the improved ResNet+ABiLSTM according to claim 1, wherein the step D of adopting ABiLSTM to further extract the features and complete the classification of the deep features comprises the following steps:
(1) The number of the BiLSTM hidden layers is 2, the number of neurons of the hidden layers is 128, and the dropout coefficient is 0.5;
(2) Adding an attribute mechanism after BiLSTM to form ABiLSTM;
(3) The ABiLSTM further extracts the features and then uses a Linear function to complete the classification operation of the deep features.
6. The automatic epileptic electroencephalogram detection method based on the improved ResNet+ABiLSTM according to claim 1, wherein the step E of activating the result obtained by adding the shallow feature classification result and the deep feature classification result together by adopting an activation function comprises the following steps:
(1) Adding the shallow feature classification result and the deep feature classification result;
(2) Activating the added result by using a relu activation function;
(3) The probability distribution of the classification result is obtained using a softmax activation function.
CN202311319106.3A 2023-10-12 2023-10-12 Deep learning-based epileptic electroencephalogram signal classification model building method and classification method Pending CN117158997A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311319106.3A CN117158997A (en) 2023-10-12 2023-10-12 Deep learning-based epileptic electroencephalogram signal classification model building method and classification method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311319106.3A CN117158997A (en) 2023-10-12 2023-10-12 Deep learning-based epileptic electroencephalogram signal classification model building method and classification method

Publications (1)

Publication Number Publication Date
CN117158997A true CN117158997A (en) 2023-12-05

Family

ID=88936133

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311319106.3A Pending CN117158997A (en) 2023-10-12 2023-10-12 Deep learning-based epileptic electroencephalogram signal classification model building method and classification method

Country Status (1)

Country Link
CN (1) CN117158997A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117393153A (en) * 2023-12-11 2024-01-12 中国人民解放军总医院 Shock real-time risk early warning and monitoring method and system based on medical internet of things time sequence data and deep learning algorithm

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117393153A (en) * 2023-12-11 2024-01-12 中国人民解放军总医院 Shock real-time risk early warning and monitoring method and system based on medical internet of things time sequence data and deep learning algorithm
CN117393153B (en) * 2023-12-11 2024-03-08 中国人民解放军总医院 Shock real-time risk early warning and monitoring method and system based on medical internet of things time sequence data and deep learning algorithm

Similar Documents

Publication Publication Date Title
CN111160139B (en) Electrocardiosignal processing method and device and terminal equipment
Toğaçar et al. BreastNet: A novel convolutional neural network model through histopathological images for the diagnosis of breast cancer
CN109472194B (en) Motor imagery electroencephalogram signal feature identification method based on CBLSTM algorithm model
Wu et al. A study on arrhythmia via ECG signal classification using the convolutional neural network
Abdelhameed et al. A deep learning approach for automatic seizure detection in children with epilepsy
Kilicarslan et al. Diagnosis and classification of cancer using hybrid model based on ReliefF and convolutional neural network
CN109998525B (en) Arrhythmia automatic classification method based on discriminant deep belief network
Wang An intelligent computer-aided approach for atrial fibrillation and atrial flutter signals classification using modified bidirectional LSTM network
Jamil et al. An efficient and robust phonocardiography (pcg)-based valvular heart diseases (vhd) detection framework using vision transformer (vit)
CN112766355B (en) Electroencephalogram signal emotion recognition method under label noise
CN108090509B (en) Data length self-adaptive electrocardiogram classification method
CN113749657B (en) Brain electricity emotion recognition method based on multi-task capsule
CN114176607B (en) Electroencephalogram signal classification method based on vision transducer
CN117158997A (en) Deep learning-based epileptic electroencephalogram signal classification model building method and classification method
CN112450885B (en) Epileptic electroencephalogram-oriented identification method
Gao et al. Convolutional neural network and riemannian geometry hybrid approach for motor imagery classification
Barın et al. An automatic skin lesion segmentation system with hybrid FCN-ResAlexNet
CN114595725B (en) Electroencephalogram signal classification method based on addition network and supervised contrast learning
Deepthi et al. An intelligent Alzheimer’s disease prediction using convolutional neural network (CNN)
Yang et al. A study on automatic sleep stage classification based on CNN-LSTM
Lu et al. Rice disease identification method based on improved CNN-BiGRU
Lee et al. Emotion recognition with short-period physiological signals using bimodal sparse autoencoders.
CN113011330B (en) Electroencephalogram signal classification method based on multi-scale neural network and cavity convolution
Peng et al. A survey: Image classification models based on convolutional neural networks
CN112053320A (en) Intelligent diagnosis model construction method for rectal cancer lymph node metastasis

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination