CN115944307A - Epilepsia electroencephalogram signal monitoring system and method based on space-time converter - Google Patents

Epilepsia electroencephalogram signal monitoring system and method based on space-time converter Download PDF

Info

Publication number
CN115944307A
CN115944307A CN202310017610.1A CN202310017610A CN115944307A CN 115944307 A CN115944307 A CN 115944307A CN 202310017610 A CN202310017610 A CN 202310017610A CN 115944307 A CN115944307 A CN 115944307A
Authority
CN
China
Prior art keywords
time
electroencephalogram
spatial
channel
electroencephalogram signals
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.)
Granted
Application number
CN202310017610.1A
Other languages
Chinese (zh)
Other versions
CN115944307B (en
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.)
Shandong Normal University
Original Assignee
Shandong Normal University
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 Shandong Normal University filed Critical Shandong Normal University
Priority to CN202310017610.1A priority Critical patent/CN115944307B/en
Publication of CN115944307A publication Critical patent/CN115944307A/en
Application granted granted Critical
Publication of CN115944307B publication Critical patent/CN115944307B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

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

Abstract

The invention provides an epilepsia electroencephalogram signal monitoring system and method based on a space-time converter, and relates to the field of epilepsia electroencephalogram signal processing. The method comprises the following steps: the signal acquisition and preprocessing module is used for acquiring an original multi-channel electroencephalogram signal, preprocessing the original multi-channel electroencephalogram signal and acquiring a preprocessed multi-channel electroencephalogram signal; the spatial transformation module is used for sensing the spatial correlation of the preprocessed multi-channel electroencephalogram signals by utilizing the attention of the characteristic channels and extracting spatial characteristics to obtain the electroencephalogram signals with the spatial characteristics aggregated after spatial transformation; the time transformation module is used for sensing the time correlation of the electroencephalogram signals aggregated with the spatial features by utilizing a time attention mechanism, and extracting the time features to obtain the electroencephalogram signals after time transformation; and the classification result acquisition module is used for classifying the electroencephalogram signals after the time transformation. The invention ensures enough characteristics by extracting the characteristics of space and time twice, thereby realizing monitoring more accurately.

Description

Epilepsia electroencephalogram signal monitoring system and method based on space-time converter
Technical Field
The invention belongs to the technical field of epilepsia electroencephalogram identification, and particularly relates to an epilepsia electroencephalogram signal monitoring system and method based on a space-time converter.
Background
The statements in this section merely provide background information related to the present disclosure and may not constitute prior art.
Seizures are a recurrent neurological disorder caused by rapid and uncontrolled electrical stimulation abnormalities of a large number of neurons. Millions of people worldwide suffer from this encephalopathy. The treatment of epilepsy requires long-term medication, and if the epilepsy cannot be cured, the brain loss is recommended. Epilepsy is random and unpredictable in nature and can occur at any time, and thus a person cannot live independently. If these people are not properly monitored and treated, they may be severely injured and sometimes may die.
Electroencephalography is a painless record that monitors the brain function of an individual and has proven to be a very useful investigative method to identify a variety of neurological disorders. Electroencephalograms are widely applied to the recognition and treatment of epileptic diseases from nerve activities of patients, but are easily affected by physiological and non-physiological factors, so that signals are unstable and noisy, and the accuracy of detection results is reduced. For example, blinking eyes (open and closed), muscle relaxation, and environmental stimuli (such as power line vibration and electrode placement that is not compromised using imaging methods), and the like.
Therefore, if a monitoring system for epileptic brain electrical signals can be designed, and the monitoring system can be used for accurately predicting possible epileptic stroke in advance, a patient can take preventive measures in advance. However, the inventor finds that the existing automatic detection model has the defects:
first, machine learning requires manual feature extraction, which is time consuming.
Second, most systems use time domain features, which are simply of interest due to non-stationary brain electrical signal data, which easily lead to acute changes in seizure activity, and whose statistical characteristics differ from subject to subject and from time to time within the same subject.
Thirdly, the brain electrical signals are very susceptible to artifacts such as muscle activity, blinking and white noise. All of these artifacts change the brain electrical characteristics, significantly affecting the performance of the epilepsy detection system.
Fourthly, because the electroencephalogram signal is long-term and comprises an epileptic seizure period and an epileptic seizure interval, the problem of imbalance of positive and negative samples exists, and the data of the epileptic seizure interval can greatly influence the experimental result.
Disclosure of Invention
In order to overcome the defects of the prior art, the invention provides the epilepsy electroencephalogram signal monitoring system and method based on the space-time converter, and the characteristics are extracted twice through the Transformer to ensure enough characteristics, so that the monitoring is realized more accurately.
In order to achieve the above object, one or more embodiments of the present invention provide the following technical solutions:
the invention provides an epilepsia electroencephalogram signal monitoring system based on a space-time converter.
Epilepsy electroencephalogram signal monitoring system based on space-time converter includes:
the signal acquisition and preprocessing module is used for acquiring an original multi-channel electroencephalogram signal, preprocessing the original multi-channel electroencephalogram signal and acquiring a preprocessed multi-channel electroencephalogram signal;
the spatial transformation module is used for sensing the spatial correlation of the preprocessed multi-channel electroencephalogram signals by utilizing the attention of the characteristic channels and extracting spatial characteristics to obtain the electroencephalogram signals with the spatial characteristics aggregated after spatial transformation;
the time transformation module is used for sensing the time correlation of the electroencephalogram signals aggregated with the spatial features by utilizing a time attention mechanism, and extracting the time features to obtain the electroencephalogram signals after time transformation;
and the classification result acquisition module is used for predicting and classifying the epilepsy probability of the electroencephalogram signals after the time transformation.
The invention provides an epilepsia electroencephalogram signal monitoring method based on a space-time converter in a second aspect.
The epilepsia electroencephalogram signal monitoring method based on the space-time converter comprises the following steps:
acquiring an original multi-channel electroencephalogram signal, and preprocessing the original multi-channel electroencephalogram signal to obtain a preprocessed multi-channel electroencephalogram signal;
sensing the spatial correlation of the preprocessed multi-channel electroencephalogram signals by using the attention of the characteristic channels, and extracting spatial characteristics to obtain electroencephalogram signals with aggregated spatial characteristics after spatial transformation;
sensing the time correlation of the electroencephalogram signals aggregated with the spatial characteristics by using a time attention mechanism, and extracting time characteristics to obtain the electroencephalogram signals after time conversion;
and predicting and classifying the epileptic probability of the electroencephalogram signals after the time transformation.
A third aspect of the present invention provides a computer readable storage medium having stored thereon a program which, when executed by a processor, performs the steps in the space-time transformer based epileptic brain electrical signal monitoring system according to the first aspect of the present invention.
A fourth aspect of the present invention provides an electronic device, comprising a memory, a processor and a program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the space-time transformer-based epileptic brain electrical signal monitoring system according to the first aspect of the present invention.
The above one or more technical solutions have the following beneficial effects:
(1) The method utilizes the space-time Transformer to detect the epilepsy, relies on an attention mechanism, does not need to manually design features to classify, and solves the problem of long time consumption in manual feature extraction.
(2) The model extracts space and time characteristics twice through the Transformer, ensures enough characteristics, not only discovers the space relation among electroencephalogram signal channels, but also discovers the time relation of the same electroencephalogram signal in different time periods, and therefore more accurate detection is achieved.
(3) And during data preprocessing, filtering the original electroencephalogram signals by using a band-pass filter with the frequency range of 1-40 Hz. In order to relieve the difference of electroencephalogram signals of different patients, a normalization method is also adopted, so that the influence of artifacts on the performance of an epilepsy detection system is effectively avoided.
(4) The method combines the model with the focus loss, solves the problem of unbalanced labels, reduces the weight of negative samples by using the loss function, and improves the accuracy of the method.
Advantages of additional aspects of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, are included to provide a further understanding of the invention, and are included to illustrate an exemplary embodiment of the invention and not to limit the invention.
Fig. 1 is a system configuration diagram of the first embodiment.
FIG. 2 is a diagram illustrating the epileptic brain electrical signal pre-processing and classification of brain electrical signals by spatio-temporal transformers according to the first embodiment.
FIG. 3 is a schematic diagram of the spatial-Transformer processing of EEG signals according to the first embodiment.
FIG. 4 is a schematic diagram of a multi-head attention mechanism.
Fig. 5 is a diagram showing the electroencephalogram signal of the seizure of the first embodiment.
FIG. 6 is a flow chart of a method of the second embodiment.
Detailed Description
It is to be understood that the following detailed description is exemplary and is intended to provide further explanation of the invention as claimed. Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
It is noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of exemplary embodiments according to the invention.
The embodiments and features of the embodiments of the present invention may be combined with each other without conflict.
Example one
The embodiment discloses an epilepsia electroencephalogram signal monitoring system based on a space-time converter.
As shown in fig. 1, the epilepsia electroencephalogram signal monitoring system based on the space-time converter comprises:
the signal acquisition and preprocessing module is used for acquiring an original multi-channel electroencephalogram signal, preprocessing the original multi-channel electroencephalogram signal and acquiring a preprocessed multi-channel electroencephalogram signal;
the spatial transformation module is used for sensing the spatial correlation of the preprocessed multi-channel electroencephalogram signals by utilizing the attention of the characteristic channels and extracting spatial characteristics to obtain the electroencephalogram signals with the spatial characteristics aggregated after spatial transformation;
the time transformation module is used for sensing the time correlation of the electroencephalogram signals aggregated with the spatial features by utilizing a time attention mechanism, and extracting the time features to obtain the electroencephalogram signals after time transformation;
and the classification result acquisition module is used for predicting and classifying the epilepsy probability of the electroencephalogram signals after the time transformation.
Further, the signal acquisition and preprocessing module acquires a multi-channel electroencephalogram signal, and the specific process of preprocessing the multi-channel electroencephalogram signal is as follows:
the method comprises the steps of collecting electroencephalogram signals by adopting 16 electroencephalogram electrodes, obtaining original electroencephalogram signals of 16 channels to be detected, filtering the original electroencephalogram signals by using a band-pass filter with the frequency range of 1-40Hz, and adopting a normalization method in order to relieve the difference of electroencephalogram signals of different patients. Given an hour-long electroencephalogram signal, normalization is performed using the most common Z-score normalization to obtain a preprocessed multi-channel electroencephalogram signal.
As shown in FIG. 2, the method comprises three parts, wherein the first part (a) represents the original electroencephalogram signal of 16 channels, and the second part (b) represents the preprocessing process of the electroencephalogram signal, wherein the preprocessing process comprises the filtering process of the original electroencephalogram signal by a filter and the normalization process of the electroencephalogram signal.
The formula is as follows:
Figure BDA0004041107900000051
wherein X ∈ R C×T And x ∈ R C×T Representing the normalized and input signal. Mu and sigma 2 Representing the mean and variance of the training data. After normalization, the signal becomes normally distributed with a mean of 0 and a standard deviation of 1. The mean and variance will be used directly in the test.
A third part (c) represents an integral framework of a space-time Transformer, and is used for inputting the preprocessed electroencephalogram signals and carrying out space Transformer attention training to obtain the space correlation of 16 channels;
coding time domain position information by using a layer of convolution on a time dimension, compressing the electroencephalogram signal in the space to one dimension on the basis of the coding time domain position information, carrying out slicing processing, converting the slices into vectors, and carrying out time transform attention training;
then, averaging all the slices in the time conversion part by using a global pool, classifying the electroencephalograms of different patients based on the spatial correlation and the time correlation of the electroencephalograms, and performing probability prediction by using a Softmax function;
and finally, outputting the detection results of the epileptic seizure period and the epileptic seizure interval.
Furthermore, the spatial transformation module senses the spatial correlation of the preprocessed multi-channel electroencephalogram signals by using the attention of the characteristic channels, and the specific process is as follows:
converting each channel X into vectors Q, K and V along the spatial characteristics of each channel, and forming a trainable matrix from Q, K and V, wherein the trainable matrix is respectively marked as a Q matrix, a K matrix and a V matrix;
performing dot product calculation on the vector K of each channel and the Q matrixes of the channels except the vector K, and dividing the dot product calculation result by a scaling factor d k Scaling;
and calculating the weight fraction of the calculation result after scaling by using a Softmax function, and performing dot product calculation on the obtained weight fraction and the V matrix to obtain the spatial correlation.
As shown in fig. 3, the main working principle of the space-Transformer includes:
(a) A process for converting a signal into a trainable matrix. First, each channel X is converted into a vector Q, K, V along the spatial features of each channel, where W Q ,W K ,W V Respectively representing artificially added learnable linear transformation matrices;
(b) Is a calculation process of feature attention. Q represents each channel that will be used to match K, representing all other channels that use dot products. The result is then divided by a scaling factor d k Ensuring that the Softmax function has good perceptibility. The output weight score is assigned to V for use in the final representation of the dot product, and the overall process can be expressed as:
Figure BDA0004041107900000061
where Attention (Q, K, V) is a weighted representation, Q, K, V are matrix computations that are simultaneously filled by vectors. Furthermore, the input and output of the residual join are used to help adjust the gradient of the frame flow.
Further, the time transformation module senses the time correlation of the electroencephalogram signals with aggregated spatial features by using a time attention mechanism, and the specific process is as follows:
encoding position information in the electroencephalogram signal time domain with aggregated spatial features by using a layer of convolution on a time dimension to obtain an encoded electroencephalogram signal;
compressing the encoded electroencephalogram signals to one dimension (1 × T) to obtain one-dimensional data;
dividing the one-dimensional data into a plurality of 1X d-shaped slices, and converting T/d slices X into vectors to form a training set;
training the multi-head attention model with time transformation by using a training set, and learning the time correlation of a plurality of slices from different angles to obtain a trained multi-head attention model;
inputting the Q matrix, the K matrix and the V matrix into a trained multi-head attention model, and executing an attention mechanism from multiple angles in parallel to obtain the output of the multi-head attention model;
and splicing and linearly converting the output of the multi-head attention model to obtain the electroencephalogram signal which has the same size as the original electroencephalogram signal and is subjected to time conversion.
The main working principle of the time-Transformer and multi-head attention mechanism comprises:
since the eigen-channels are weighted in the previous step, the data is compressed into one dimension to reduce computational complexity. Through observation of the electroencephalogram signals, a section of continuous signals can reflect a trend more than a single sample point, namely, abnormal values are more likely. Therefore, we split the data into multiple slices of 1 × d shape. We use a multi-head attention Mechanism (MHA), as shown in fig. 4, to learn the time correlations from different angles. Thus, X is inputted Q ,X K ,X V Is divided into h smaller parts to obtain head i This will perform attention mechanism from multiple angles in parallel, and will output head of each part 0 —head h-1 Splicing and linear transformation are carried out to obtain the original size. X herein Q ,X K ,X V Namely Q matrix, K matrix and V matrix.
This process can be expressed as:
MHA(X Q ,X K ,X V )=[head 0 ;...;head h-1 ]W o (3)
Figure BDA0004041107900000071
<xnotran> , [ </xnotran>]Representing a join operation;
Figure BDA0004041107900000072
expressed to obtain a linear transformation of the query, key, value matrix, <' > or>
Figure BDA0004041107900000073
To obtain a linear transformation of the final output.
Connecting the activation function GeLU behind the attention mechanism, setting the feedforward block as two fully connected layers, with the same input and output size, and the internal size expanded to N f Doubling; the remaining connections are used for better training. A feedforward block (FF) comprises two full-connection layers, and an activation function GeLU is connected behind an MHA, so that the perception and nonlinear learning capability of the model are enhanced; the input and output sizes of FF blocks are the same, and the internal size is extended to N f Layer normalization is set before the MHA and FF blocks, and the remaining connections are also used for better training. The model with MHA and FF is repeated 3 times for the overall effect, and although the time transform measures the correlation between different slices well, it ignores the positional information, i.e. the sequence relation between electroencephalogram sample points. We inventively use convolutional layers in the time dimension to encode position information before compression and slicing.
Further, the classification result acquisition module classifies the electroencephalogram signals after time conversion, and the specific process is as follows: all slices of the global pool mean time transform module were applied for probability prediction of epilepsy using the Softmax function.
More specifically, the method comprises the following steps:
applying a global pool to average all slices in the time-translated portion;
setting the number of neurons as the number of categories;
the prediction results are obtained using the Softmax function.
In this embodiment, both the training set and the test set contain electroencephalographic signals of known epileptic or non-epileptic diagnostic results.
In the training process, preprocessing is carried out on the epileptic electroencephalogram signals, and then space-Transformer and time-Transformer are carried out on the preprocessed electroencephalogram signal segments, so that the correlation and the time correlation between one characteristic channel and other characteristic channels are obtained. With the help of spatial and temporal information, the data is converted into a highly differentiated representation. For the classification task, the global dependency of the signals and the importance of the different feature channels are well perceived. The invention provides a new idea for the computer-aided diagnosis of epilepsy detection.
The main working principle of the classifier comprises the following steps:
after the above process, the data is converted into a new representation by learning spatial and temporal correlations. Now we only need to apply a global pool to average all slices in the time-transformed part. The pooled results are connected to the fully connected layer after layer normalization is completed. The number of output neurons equals the number of classes. Then, the prediction probability is obtained using the Softmax function. In order to solve the problem of unbalance of positive and negative samples of data, a focus loss function is introduced, the loss function reduces the weight of the negative samples in a data set in a large proportion, and the method can be understood as difficult sample mining. During the training process, the model focuses more on a few samples by reducing the weight of most data.
The objective function is the classification loss obtained by Focal loss:
FL(p t )=-a t (1-p t ) Y log(p t ) (5)
in this equation, p t Is a probability of a certain class, α t Are coefficients that control the sample weights. Parameter gamma (gamma)>= 0) represents the focus parameter. (1-p) t ) γ represents a modulation factor.
In the training process, the weight of the negative sample in the data set is reduced by using a focus loss function, so that the aim of balancing the weight of the positive sample and the negative sample is fulfilled; inputting the multichannel electroencephalogram signals into a trained matrix, performing ten-fold cross validation, and outputting detection results of epileptic seizure periods or epileptic seizure intervals.
This forms the model architecture in this embodiment.
In this example, the data set used is shown in table 1. Firstly, obtaining an original electroencephalogram through hardware equipment and a 10-20 international electroencephalogram lead system environment, reading data formats which can be identified by a computer from original electroencephalogram data by utilizing MNE-python, and reading an attribute matrix x of electroencephalograms, wherein each row represents characteristic information of one channel, and columns represent the number of the channels. And dividing the data into training data and test data according to a proportion to obtain the characteristic vector of the signal segment.
Inputting x into a fusion network, firstly extracting spatial features through a graph attention network, inputting the signals aggregated with the spatial features into a transformer network again to extract time features, and finally finishing classification through a Softmax function.
Table 1: boston hospital children epilepsy data set
Numbering Sex Age (age) Frequency HZ Number of lead Record the Total duration (hours) Number of attacks Total duration of attack (minutes and seconds)
chb01 Woman 11 256 23 4055 7 7:10
chb02 For male 11 256 23 253 3 2:50
chb03 Woman 14 256 23 28 7 5:40
chb04 For male 22 256 23 1559 4 9:00
chb05 Woman 7 256 23 39 5 2:00
chb06 Woman 15 256 23 667 9 5:10
chb07 Woman 145 256 23 681 3 15:10
chb08 For male 35 256 23 20 5 4:00
chb09 Female 10 256 23 678 4 6:50
chb10 For male 3 256 23 50 7 13:20
chb11 Woman 12 256 23 348 3 8:10
chb12 Woman 2 256 23 23 39 25:15
chb13 Woman 3 256 23 33 12 2:30
chb14 Woman 9 256 23 26 8 27:20
chb15 For male 16 256 31 40 20 1:20
chb16 Woman 7 256 28 19 10 4:40
chb17 Woman 12 256 28 21 3 4:50
chb18 Woman 18 256 22 36 6 3:40
chb19 Woman 19 256 28 30 3 3:30
chb20 Woman 6 256 28 29 8 3:10
chb21 Woman 13 256 28 33 4 3:10
chb22 Woman 9 256 28 31 3 3:10
chb23 Woman 6 256 23 28 7 6:40
chb24 Last known of Last known of 256 23 Last known of 16 8:47
The scalp electrode electroencephalogram is now routinely used with the international 10-20 system. The 10-20 system includes 19 recording electrodes and 2 reference electrodes. Firstly, two lines are determined on the surface of the scalp, wherein one line is 100 percent of the front-back connecting line from the nasal root to the occipital tuberosity, and the other line is 100 percent of the left-right connecting line between the front caves of ears. The intersection of the two at the vertex is the position of the Cz electrode. The posterior 10% of the nasal root is FPz (frontal midline), and each 20% of the posterior from FPz is the position of one electrode, which is Fz (frontal midline), cz (central midline), pz (apical midline) and Oz (occipital midline) in sequence. The spacing between Oz and the occipital tuberosity is 10%. The position of the anterior fovea line 10% away from the left anterior fovea is the position of a T3 (left middle temporal) electrode, and one electrode is placed every 20% to the right from the back, namely C3 (left center), cz, C4 (right center) and T4 (right middle temporal) in sequence. The distance between T4 and the anterior concavity of the right ear is 10 percent. The line from FPz through T3 to Oz is the left temporal line, 10% left from FPz is FP1 (left frontal pole), one electrode is placed every 20% backward from FP1, in order F7 (left anterior temporal), T3 (left medial temporal), T5 (left posterior temporal) and O1 (left occipital), where T3 is the intersection of this line with the anterior fovea, and O1 is 10% from Oz. The right temporal connecting line corresponds to FP2 (right temporal pole), F8 (right anterior temporal), T4 (right middle temporal), T6 (right posterior temporal) and O2 (right occipital) in sequence from front to back. A connecting line is respectively made from FP1 to O1 and from FP2 to O2, which are left and right sagittal bypass lines, 20 percent of backward from FP1 and FP2 are electrode sites, the left side is F3 (left forehead), C3 (left center), P3 (left top) and O1 (left pillow) once, and the right side is F4 (right forehead), C4 (right center), P4 (right top) and O2 (right pillow) in sequence. In a 10-20 system, FPz and Oz are not included in 19 recording points.
As shown in fig. 5, an example diagram of an electroencephalogram of a seizure measured by the equipment for epilepsy detection is shown.
In this example, an epilepsy detection experiment was performed on the CHB-MIT data set (international 10-20 system). The data set was collected by Boston's Hospital for children (Boston Chil-dren's Hospital) and consisted of a total of 5 males (3-22 years old) and 17 females (1.5-19 years old). The electroencephalogram signals are sampled at 256Hz, and the total time of each electroencephalogram record is about one hour. The data set collected 958 hours of signal total, with 198 hours being the seizure time. In the channel selection for electroencephalogram: 16 double-electrode channels are selected, wherein the 16 channels are universal parts selected from electrodes with different positions during acquisition of electroencephalogram data, and uniform program operation is facilitated.
In this example, EEG recordings obtained from each subject in the CHB-MIT dataset were used to evaluate the performance of the proposed model, and electroencephalographic recordings were collected using the international 10-20 electroencephalographic electrode system. Dividing the de-noised long-term 16-channel electroencephalogram signal into 256 points as one frame, wherein the size of input data is N x 256 x 16, and N represents a total N frame data sample; 256 denotes a single channel data size of 256 points per frame; 16 indicates a total of 16 channels.
The long-term electroencephalogram signal is segmented using a sliding window, the duration of which is 1 second. Epileptic electroencephalogram samples were segmented with a 50% overlap rate. In the experiment, we set the learning rate to 0.01 empirically. The experiment used 400 seizure samples and 3600 non-seizure samples to form an unbalanced data set. The performance analysis employed ten-fold cross validation. I.e. the ratio of training set to validation set is 9:1, the final result is the average of ten experimental results.
By the method, the result of epilepsia electroencephalogram signal detection and identification is obtained, and the result obtained by the method is compared with the detection result obtained by the traditional method, as shown in table 2.
Table 2: comparison of the results of this example with conventional detection methods
Figure BDA0004041107900000121
As can be seen from Table 2, the detection and identification accuracy, sensitivity and specificity of the epilepsia electroencephalogram signals are superior to those of other advanced methods.
The method utilizes a space-time Transformer to monitor epilepsia electroencephalogram signals, relies on an attention mechanism, does not need to manually design features to classify, but applies the attention of feature channels to weight the feature channels to carry out spatial feature aggregation, uses a layer of convolution to code time domain position information, slices data, and inputs the slices with the same size into a classifier after learning global correlation with time attention, and finally obtains a result through a simple link structure; the time-space Transformer is established, so that the problem that manual feature extraction is long in time consumption is solved, the influence of artifacts on the performance of an epilepsy detection system is avoided, and the influence of data collected at different times on features is solved; the model is combined with the focus loss, the problem of label imbalance is solved, the negative sample weight is reduced by using the loss function, and the accuracy of the method is improved.
Example two
The embodiment discloses an epilepsia electroencephalogram signal monitoring method based on a space-time converter.
As shown in fig. 6, the epilepsia electroencephalogram signal monitoring method based on the space-time converter comprises the following steps:
acquiring an original multi-channel electroencephalogram signal, and preprocessing the original multi-channel electroencephalogram signal to obtain a preprocessed multi-channel electroencephalogram signal;
sensing the spatial correlation of the preprocessed multi-channel electroencephalogram signals by using the attention of the characteristic channels, and extracting spatial characteristics to obtain electroencephalogram signals with aggregated spatial characteristics after spatial transformation;
sensing the time correlation of the electroencephalogram signals with the aggregated spatial features by using a time attention mechanism, and extracting the time features to obtain the electroencephalogram signals after time conversion;
and predicting and classifying the epileptic probability of the electroencephalogram signals after the time transformation.
EXAMPLE III
An object of the present embodiment is to provide a computer-readable storage medium.
A computer readable storage medium, on which a program is stored, wherein the program, when executed by a processor, implements the functions of the epileptic brain electrical signal monitoring system based on a space-time transformer as described in the first embodiment.
Example four
An object of the present embodiment is to provide an electronic device.
The electronic device comprises a memory, a processor and a program stored on the memory and capable of running on the processor, wherein the processor executes the program to realize the function of the epileptic brain electrical signal monitoring system based on the space-time transformer in the embodiment 1 of the disclosure.
The functions related to the devices of the second, third and fourth embodiments correspond to those of the first embodiment of the system, and the detailed description thereof can be found in the relevant description part of the first embodiment. The term "computer-readable storage medium" should be taken to include a single medium or multiple media containing one or more sets of instructions; it should also be understood to include any medium that is capable of storing, encoding or carrying a set of instructions for execution by a processor and that cause the processor to perform any of the methods of the present invention.
Those skilled in the art will appreciate that the modules or steps of the present invention described above can be implemented using general purpose computer means, or alternatively, they can be implemented using program code that is executable by computing means, such that they are stored in memory means for execution by the computing means, or they are separately fabricated into individual integrated circuit modules, or multiple modules or steps of them are fabricated into a single integrated circuit module. The present invention is not limited to any specific combination of hardware and software.
Although the embodiments of the present invention have been described with reference to the accompanying drawings, it is not intended to limit the scope of the present invention, and it should be understood by those skilled in the art that various modifications and variations can be made without inventive efforts by those skilled in the art based on the technical solution of the present invention.

Claims (10)

1. Epilepsy electroencephalogram signal monitoring system based on space-time converter, which is characterized by comprising:
the signal acquisition and preprocessing module is used for acquiring an original multi-channel electroencephalogram signal, preprocessing the original multi-channel electroencephalogram signal and acquiring a preprocessed multi-channel electroencephalogram signal;
the spatial transformation module is used for sensing the spatial correlation of the preprocessed multi-channel electroencephalogram signals by utilizing the attention of the characteristic channels and extracting spatial characteristics to obtain the electroencephalogram signals with the spatial characteristics aggregated after spatial transformation;
the time transformation module is used for sensing the time correlation of the electroencephalogram signals aggregated with the spatial features by utilizing a time attention mechanism, and extracting the time features to obtain the electroencephalogram signals after time transformation;
and the classification result acquisition module is used for predicting and classifying the epilepsy probability of the electroencephalogram signals after the time transformation.
2. The epilepsy electroencephalogram signal monitoring system based on the space-time converter as claimed in claim 1, wherein the signal acquisition and preprocessing module acquires multi-channel electroencephalogram signals, and the specific process of preprocessing the multi-channel electroencephalogram signals is as follows:
acquiring electroencephalogram signals by adopting 16 electroencephalogram electrodes, obtaining original electroencephalogram signals of 16 channels to be detected, filtering the original electroencephalogram signals by using a band-pass filter with the frequency range of 1-40Hz, and normalizing the filtered electroencephalogram signals by using Z scoring standardization to obtain preprocessed multi-channel electroencephalogram signals.
3. The epilepsy electroencephalogram signal monitoring system based on the space-time transformer as claimed in claim 1, wherein the spatial transformation module senses the spatial correlation of the preprocessed multichannel electroencephalogram signal by using the attention of the characteristic channel, and the specific process is as follows:
converting each channel X into vectors Q, K and V along the spatial characteristics of each channel, and forming a trainable matrix from Q, K and V, wherein the trainable matrix is respectively marked as a Q matrix, a K matrix and a V matrix;
performing dot product calculation on the vector K of each channel and the Q matrixes of the channels except the vector K, and dividing the dot product calculation result by a scaling factor d k Scaling;
and calculating the weight fraction of the calculation result after scaling by using a Softmax function, and performing dot product calculation on the obtained weight fraction and the V matrix to obtain the spatial correlation.
4. The space-time transformer based epileptic brain electrical signal monitoring system of claim 3, wherein the process of obtaining spatial correlation is represented as:
Figure FDA0004041107890000021
where Attention (Q, K, V) is a weighted representation, Q, K, V are matrix computations simultaneously filled by vectors, d k Is a scale factor.
5. The epilepsy electroencephalogram signal monitoring system based on the space-time transformer as claimed in claim 3, wherein the time transformation module is used for sensing the time correlation of the electroencephalogram signals with aggregated spatial features by utilizing a time attention mechanism, and the specific process is as follows:
encoding position information in the electroencephalogram signal time domain with aggregated spatial features by using a layer of convolution on a time dimension to obtain an encoded electroencephalogram signal;
compressing the encoded electroencephalogram signals to one dimension to obtain one-dimensional data;
dividing the one-dimensional data into a plurality of slices, and converting the plurality of slices into vectors to form a training set;
training the multi-head attention model with time transformation by using a training set, and learning the time correlation of a plurality of slices from different angles to obtain a trained multi-head attention model;
inputting the Q matrix, the K matrix and the V matrix into a trained multi-head attention model, and executing an attention mechanism in parallel from multiple angles to obtain the output of the multi-head attention model;
and splicing and linearly converting the output of the multi-head attention model to obtain the electroencephalogram signal which has the same size as the original electroencephalogram signal and is subjected to time conversion.
6. The epilepsy electroencephalogram signal monitoring system based on the space-time transformer as claimed in claim 5, wherein the classification result acquisition module classifies the electroencephalogram signals after time transformation, and the specific process is as follows: all slices of the global pool-averaged time transform module were applied for epilepsy probability prediction using the Softmax function.
7. The spatiotemporal transducer-based epileptic electroencephalographic signal monitoring system of claim 5, wherein the loss function of the multi-head attention model is:
FL(p t )=-α t (l-p t ) γ log(p t )
wherein p is t Is a probability of a certain class of probability,α t is a coefficient controlling the weight of the sample, the parameter gamma representing the focus parameter, (1-p) t ) γ represents a modulation factor.
8. The epilepsy electroencephalogram signal monitoring method based on the space-time converter is characterized by comprising the following steps: the method comprises the following steps:
acquiring an original multi-channel electroencephalogram signal, and preprocessing the original multi-channel electroencephalogram signal to obtain a preprocessed multi-channel electroencephalogram signal;
sensing the spatial correlation of the preprocessed multi-channel electroencephalogram signals by using the attention of the characteristic channels, and extracting spatial characteristics to obtain electroencephalogram signals with aggregated spatial characteristics after spatial transformation;
sensing the time correlation of the electroencephalogram signals aggregated with the spatial characteristics by using a time attention mechanism, and extracting time characteristics to obtain the electroencephalogram signals after time conversion;
and predicting and classifying the epileptic probability of the electroencephalogram signals after the time transformation.
9. Computer readable storage medium, on which a program is stored, which program, when being executed by a processor, carries out the functions of the space-time transformer based epileptic brain electrical signal monitoring system as claimed in any one of claims 1-7.
10. Electronic device comprising a memory, a processor and a program stored on the memory and executable on the processor, wherein the processor when executing the program performs the functions of the space-time transformer based epileptic brain electrical signal monitoring system as claimed in any one of claims 1-7.
CN202310017610.1A 2023-01-06 2023-01-06 Epileptic brain electrical signal monitoring system and method based on space-time converter Active CN115944307B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310017610.1A CN115944307B (en) 2023-01-06 2023-01-06 Epileptic brain electrical signal monitoring system and method based on space-time converter

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310017610.1A CN115944307B (en) 2023-01-06 2023-01-06 Epileptic brain electrical signal monitoring system and method based on space-time converter

Publications (2)

Publication Number Publication Date
CN115944307A true CN115944307A (en) 2023-04-11
CN115944307B CN115944307B (en) 2024-06-07

Family

ID=87289290

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310017610.1A Active CN115944307B (en) 2023-01-06 2023-01-06 Epileptic brain electrical signal monitoring system and method based on space-time converter

Country Status (1)

Country Link
CN (1) CN115944307B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110160795A1 (en) * 2009-03-23 2011-06-30 Ivan Osorio System and apparatus for automated quantitative assessment, optimization and logging of the effects of a therapy
US20190246927A1 (en) * 2018-02-14 2019-08-15 Cerenion Oy Apparatus and method for electroencephalographic measurement
CN111657935A (en) * 2020-05-11 2020-09-15 浙江大学 Epilepsia electroencephalogram recognition system based on hierarchical graph convolutional neural network, terminal and storage medium
CN112294338A (en) * 2020-09-29 2021-02-02 山东师范大学 Epilepsy detection system, equipment and medium based on graph attention network
CN113180696A (en) * 2021-04-28 2021-07-30 北京邮电大学 Intracranial electroencephalogram detection method and device, electronic equipment and storage medium
CN113786204A (en) * 2021-09-03 2021-12-14 北京航空航天大学 Epilepsia intracranial electroencephalogram early warning method based on deep convolution attention network
CN115211871A (en) * 2022-08-23 2022-10-21 浙江大学 Attention mechanism-introduced time-frequency airspace CNN-LSTM neonatal convulsion electroencephalogram signal classification system
CN115359909A (en) * 2022-10-19 2022-11-18 之江实验室 Epileptic seizure detection system based on attention mechanism
CN115481695A (en) * 2022-09-26 2022-12-16 云南大学 Motor imagery classification method by utilizing multi-branch feature extraction

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110160795A1 (en) * 2009-03-23 2011-06-30 Ivan Osorio System and apparatus for automated quantitative assessment, optimization and logging of the effects of a therapy
US20190246927A1 (en) * 2018-02-14 2019-08-15 Cerenion Oy Apparatus and method for electroencephalographic measurement
CN111657935A (en) * 2020-05-11 2020-09-15 浙江大学 Epilepsia electroencephalogram recognition system based on hierarchical graph convolutional neural network, terminal and storage medium
CN112294338A (en) * 2020-09-29 2021-02-02 山东师范大学 Epilepsy detection system, equipment and medium based on graph attention network
CN113180696A (en) * 2021-04-28 2021-07-30 北京邮电大学 Intracranial electroencephalogram detection method and device, electronic equipment and storage medium
CN113786204A (en) * 2021-09-03 2021-12-14 北京航空航天大学 Epilepsia intracranial electroencephalogram early warning method based on deep convolution attention network
CN115211871A (en) * 2022-08-23 2022-10-21 浙江大学 Attention mechanism-introduced time-frequency airspace CNN-LSTM neonatal convulsion electroencephalogram signal classification system
CN115481695A (en) * 2022-09-26 2022-12-16 云南大学 Motor imagery classification method by utilizing multi-branch feature extraction
CN115359909A (en) * 2022-10-19 2022-11-18 之江实验室 Epileptic seizure detection system based on attention mechanism

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
汤立汉: "基于脑电的癫痫监测关键技术研究", 医药卫生科技, vol. 10, no. 27461, 30 September 2021 (2021-09-30) *

Also Published As

Publication number Publication date
CN115944307B (en) 2024-06-07

Similar Documents

Publication Publication Date Title
Khare et al. PDCNNet: An automatic framework for the detection of Parkinson’s disease using EEG signals
Morabito et al. Deep convolutional neural networks for classification of mild cognitive impaired and Alzheimer's disease patients from scalp EEG recordings
Hamad et al. Feature extraction of epilepsy EEG using discrete wavelet transform
CH716863A2 (en) Depression detection system based on channel selection of multi-channel electroencephalography made using training sets.
EP3217869B1 (en) Scoring method based on improved signals analysis
Ahirwal et al. Power spectrum analysis of EEG signals for estimating visual attention
Hosseini et al. Emotional stress recognition system for affective computing based on bio-signals
Fathima et al. Wavelet based features for epileptic seizure detection
Boubchir et al. A review of feature extraction for EEG epileptic seizure detection and classification
EP3241489A1 (en) Predictive neuromarkers of alzheimer&#39;s disease
WO2013063053A1 (en) Method of building classifiers for real-time classification of neurological states
CN115590529A (en) Epilepsia electroencephalogram signal monitoring method and system based on space-time attention mechanism
CN111184509A (en) Emotion-induced electroencephalogram signal classification method based on transfer entropy
Furui et al. Non-Gaussianity detection of EEG signals based on a multivariate scale mixture model for diagnosis of epileptic seizures
CN114129129A (en) Epilepsy detection system based on CNN and Transformer
CN113723557A (en) Depression electroencephalogram classification system based on multiband time-space convolution network
Chen et al. Seizure prediction using convolutional neural networks and sequence transformer networks
CN113974557A (en) Deep neural network anesthesia depth analysis method based on electroencephalogram singular spectrum analysis
Zhao et al. Epileptic focus localization based on iEEG by using positive unlabeled (PU) learning
Fathima et al. Wavelet based features for classification of normal, ictal and interictal EEG signals
CTITR Epilepsy seizure detection using wavelet support vector machine classifier
Xu et al. Lightweight eeg classification model based on eeg-sensor with few channels
CN115944307B (en) Epileptic brain electrical signal monitoring system and method based on space-time converter
Manshouri et al. Classification of 2D and 3D videos based on EEG waves
Kim et al. Deep learning model for early screening of patients with alzheimer's disease and mild cognitive impairment using EEG-SSVEP

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
GR01 Patent grant