Search

CN-122004904-A - Epileptic brain electrical signal detection method based on multi-scale TCN-BiLSTM

CN122004904ACN 122004904 ACN122004904 ACN 122004904ACN-122004904-A

Abstract

The invention relates to an epileptic brain electrical signal detection method based on multi-scale TCN-BiLSTM, which comprises the following steps of (1) collecting EEG signals, (2) carrying out band-pass filtering, segmentation and Z-score normalization on the EEG signals, (3) dividing the processed signals into a training set, a verification set and a test set by a leave-out method, (4) inputting TCN networks with a plurality of different expansion factors to extract multi-scale characteristics, (5) fusing the multi-scale characteristics, (6) inputting BiLSTM networks to carry out forward/reverse time sequence modeling, (7) introducing a channel attention mechanism to weight BiLSTM output characteristics, and (8) outputting detection results by a full-connection layer and a Softmax. The invention combines multi-scale feature extraction, bidirectional time sequence modeling and channel attention mechanism to realize automatic and efficient extraction of electroencephalogram space-time features and improve detection precision. The method solves the problems that the existing method is insufficient in multi-scale time sequence feature capture, the time sequence information is not fully utilized, the importance of the feature channels is not sufficiently distinguished, and the detection precision does not meet the clinical accurate diagnosis requirement.

Inventors

  • ZHOU MENGRAN
  • HE XIAOYA
  • BIAN KAI
  • HU FENG
  • GAO LIPENG
  • WANG QIAOLONG
  • TAO YE
  • LI XIN
  • Chan Zhuhong

Assignees

  • 安徽理工大学

Dates

Publication Date
20260512
Application Date
20260414

Claims (9)

  1. 1. A multi-scale TCN-BiLSTM-based epileptic brain electrical signal detection method is characterized by comprising the following steps: (1) Data preparation, namely collecting normal brain electrical signals of epileptic patients in a seizure period, a seizure interval and a healthy person in a ratio of 1:1:2, and ensuring sample balance; (2) The signal preprocessing, filtering the EEG signal by adopting a band-pass filter, and then dividing the data, and performing Z-score normalization operation; (3) Sample set distribution, namely dividing the processed brain wave signals into a training set, a verification set and a test set by adopting a set aside method; (4) The multi-scale feature extraction module is used for inputting the preprocessed electroencephalogram signals into a plurality of time sequence convolution networks with different expansion factors to realize extraction of multi-scale features of the electroencephalogram signals; (5) Feature fusion, namely fusing the multi-scale features extracted by a plurality of TCNs to obtain fusion features containing rich time scale information; (6) Inputting the fusion characteristics into BiLSTM network, and carrying out time sequence modeling on the fusion characteristics from the forward direction and the reverse direction by BiLSTM; (7) Channel attention mechanism-introducing channel attention mechanism after BiLSTM's output, weighting the features of BiLSTM's output by learning the importance weights of different EEG signal channels; (8) The classification detection module consists of a full-connection layer and a Softmax function and is used for carrying out classification prediction on the characteristics processed by the channel attention mechanism, outputting the detection result of the epileptic brain electrical signals and judging whether the signals are epileptic seizure period, epileptic seizure interval or normal state of healthy people.
  2. 2. The method for detecting epileptic electroencephalogram signals based on multi-scale TCN-BiLSTM as claimed in claim 1, wherein in the step (1), signals are three different signals, the first signal is epileptic seizure period signal, the second signal is epileptic seizure period signal, the third signal is normal electroencephalogram signal of a healthy person, and the ratio of the signals is 1:1:2.
  3. 3. The method for detecting epileptic electroencephalogram signals based on multi-scale TCN-BiLSTM as claimed in claim 1, wherein in the step (2), a band-pass filter is selected to filter the original electroencephalogram signals, the electroencephalogram signals are mapped to a specific interval by adopting a Z-score normalization method, finally the electroencephalogram signals are segmented according to the length of a preprocessed time window, the seizure period signals are segmented in a sliding mode by adopting a 50% overlapping rate to increase the sample size, and the normal period signals are segmented in a non-overlapping mode to obtain a plurality of electroencephalogram signal segments.
  4. 4. The method for detecting epileptic brain electrical signals based on multi-scale TCN-BiLSTM according to claim 1, wherein in the step (3), a set-aside method is adopted to divide sample data into 70% of training set and 30% of test set.
  5. 5. The method for detecting epileptic electroencephalogram signals based on the multi-scale TCN-BiLSTM as claimed in claim 1, wherein in the step (4), the preprocessed EEG signals are input into a multi-scale feature extraction module, the module comprises three TCNs with different expansion factors, wherein the expansion factors are respectively 1,2 and 4, and the three TCNs extract the characteristics of the electroencephalogram signals to obtain the characteristics with different scales.
  6. 6. The method for detecting epileptic electroencephalogram signals based on multi-scale TCN-BiLSTM as claimed in claim 1, wherein in the step (5), multi-scale features extracted from a plurality of TCNs are fused, features outputted by different TCNs are spliced in channel dimension by adopting a feature splicing mode, and the three TCNs are assumed to be outputted respectively 、 、 The number of the channels is respectively 、 、 The feature images are the same in size Features after fusion The number of channels of the fused feature F can be calculated as follows: (1) and obtaining fusion characteristics containing rich time scale information.
  7. 7. The method for detecting epileptic electroencephalogram signals based on multi-scale TCN-BiLSTM according to claim 1, wherein in the step (6), the fusion characteristics are input into a BiLSTM network, biLSTM comprises two layers, 128 neurons are arranged on each layer, biLSTM time sequence modeling is carried out on the fusion characteristics from two directions of forward direction and reverse direction, forward direction LSTM is processed gradually from the beginning to the end of the sequence, reverse direction LSTM is processed reversely from the end to the beginning of the sequence, and BiLSTM network structures formed by connecting and combining the two directions are as follows: (2) representing the hidden state vector of the forward LSTM at time step t, Representing the hidden state vector of the reverse LSTM at time step t, Is the hidden state vector of the forward LSTM at time t-1 steps, Is the hidden state vector of the reverse LSTM at time step t-1, Representing a forward long and short term memory network, Representing a reverse long-short term memory network, attFeat representing the input characteristics of time step t; In the forward processing, the output at the current moment is not only dependent on the current input and the current hiding state, but also is related to the hiding state at the previous moment, and the reverse processing is the same, so that the past and future context information is fully utilized, the time sequence characteristics of the electroencephalogram signals are further extracted, and the model has more accurate grasp on the time dynamic change of the signals.
  8. 8. The method for detecting epileptic electroencephalogram signals based on multi-scale TCN-BiLSTM according to claim 1, wherein in the step (7), a channel attention mechanism is introduced after BiLSTM is output, and firstly global average pooling and global maximum pooling are carried out on the characteristics output by BiLSTM, through the formula: (3) Wherein, the To provide BiLSTM output features, whose size is C x H x W, C is the number of channels, H is the height, W is the width, within each channel, all elements in the height H and width W dimensions are averaged, Wherein c represents a channel index, i represents a height direction index, j represents a width direction index, and any element in the feature map can be accurately positioned through the three dimensions; Global average pooled results The size is Cx1×1, and the result after global maximum pooling The size is also Cx1×1, and the calculation formula is as follows: (4) Then will And The method comprises the steps of inputting the spliced signals into a multi-layer perceptron (MLP), wherein the MLP comprises two full-connection layers, the number of neurons of the first full-connection layer is C/16, the number of neurons of the second full-connection layer is C, learning importance weights of different channels through the MLP, mapping weight values between 0 and 1 through a Sigmoid function, weighting the features output by BiLSTM, highlighting the features of important channels, and inhibiting the features of non-important channels, so that the extraction capability of effective features is enhanced.
  9. 9. The method for detecting epileptic brain electrical signals based on multi-scale TCN-BiLSTM according to claim 1, wherein in the step (8), the characteristics processed by the channel attention mechanism are input into a full-connection layer, the full-connection layer comprises 64 neurons, the characteristics are mapped, and then classified by using a Softmax function, wherein the Softmax function formula is: (5) wherein x is the input characteristic of the input device, And outputting a value of a corresponding category k for the full-connection layer, wherein k is the total number of categories (the method is three categories, namely, epileptic seizure period, epileptic seizure interval and normal brain electrical signals of healthy people), outputting a detection result of the epileptic brain electrical signals, and judging whether the signals are epileptic seizure period, epileptic seizure interval or normal states of the healthy people.

Description

Epileptic brain electrical signal detection method based on multi-scale TCN-BiLSTM Technical Field The invention relates to the field of medical engineering combination, in particular to an epileptic brain electrical signal detection method based on multi-scale TCN-BiLSTM. Background Epilepsy is a common neurological disorder whose diagnosis is highly dependent on accurate analysis of brain electrical signals. At present, the epileptic signal detection field has various technical means, such as traditional methods, such as time domain analysis, frequency domain analysis, wavelet transformation and the like, which can be used for describing the basic characteristics of the EEG signal, but have the limitations that the characteristic extraction depends on manual experience, the multiscale information fusion capability is insufficient and the like, and the method based on machine learning, such as a support vector machine, a random forest and the like, improves the detection automation level, but is difficult to adaptively capture nonlinear and non-stable dynamic characteristics in the epileptic signal. The deep learning model can automatically extract features from the original data without manual intervention, so that the time and cost of a preprocessing stage are reduced. The time sequence convolution network is a convolution neural network specially used for processing long-time sequence data, and the two-way long-short-term memory network is used as a special cyclic neural network, so that the problems of gradient disappearance, gradient explosion and the like existing in the application process of the traditional RNN model are effectively solved. The epileptic electroencephalogram signal detection method based on the multi-scale TCN-BiLSTM is provided, automatic and efficient extraction of the space-time characteristics of the electroencephalogram signal is realized through multi-scale characteristic extraction, bidirectional time sequence modeling and a channel attention mechanism, and detection accuracy is improved. Disclosure of Invention The invention aims to provide an epileptic brain electrical signal detection method based on multi-scale TCN-BiLSTM. The method has the advantages of rapidness and accuracy; The invention realizes the aim by adopting the following technical scheme: the invention relates to an epileptic brain electrical signal detection method based on multi-scale TCN-BiLSTM, which comprises the following steps: (1) Data preparation, namely collecting normal brain electrical signals of epileptic patients in a period of onset, a period of onset and a healthy person in a ratio of 1:1:2, and ensuring sample equalization. (2) And (3) signal preprocessing, namely filtering the EEG signal by adopting a band-pass filter, dividing the data, and carrying out Z-score normalization on each channel signal. (3) Sample set distribution, namely dividing the processed brain wave signals into a training set, a verification set and a test set by adopting a leave-out method. (4) And the multi-scale feature extraction module is used for inputting the preprocessed electroencephalogram signals into a plurality of time sequence convolution networks with different expansion factors to realize extraction of the multi-scale features of the electroencephalogram signals. (5) And (3) feature fusion, namely fusing the multi-scale features extracted by the TCNs to obtain fusion features containing rich time scale information. (6) Two-way timing modeling, namely inputting the fusion characteristics into BiLSTM network, and timing modeling the fusion characteristics from the forward direction and the reverse direction by BiLSTM. (7) Channel attention mechanism-channel attention mechanism is introduced after BiLSTM's output, weighting the features of BiLSTM's output by learning the importance weights of the different EEG signal channels. (8) The classification detection module consists of a full connection layer and a Softmax function and is used for carrying out classification prediction on the characteristics processed by the channel attention mechanism. Outputting the detection result of the epileptic brain electrical signals, and judging whether the signals are epileptic seizure period, epileptic seizure interval or normal state of healthy people. Preferably, in the step (1), three signals are adopted, wherein the first signal is a seizure period signal of an epileptic patient, the second signal is a seizure interval of the epileptic patient, and the third signal is a normal brain electrical signal of a healthy person. The proportion is 1:1:2. Preferably, in the step (2), a 0.5-45Hz band-pass filter is selected to filter the original electroencephalogram, the electroencephalogram is mapped to a specific interval by adopting a Z-score normalization method, finally the electroencephalogram is segmented according to the length of a preprocessed time window, the seizure period signal is segmented by adopting a 50% ove