Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2024 Jun 1;23(1):50.
doi: 10.1186/s12938-024-01244-w.

Automatic detection of epilepsy from EEGs using a temporal convolutional network with a self-attention layer

Affiliations

Automatic detection of epilepsy from EEGs using a temporal convolutional network with a self-attention layer

Leen Huang et al. Biomed Eng Online. .

Abstract

Background: Over 60% of epilepsy patients globally are children, whose early diagnosis and treatment are critical for their development and can substantially reduce the disease's burden on both families and society. Numerous algorithms for automated epilepsy detection from EEGs have been proposed. Yet, the occurrence of epileptic seizures during an EEG exam cannot always be guaranteed in clinical practice. Models that exclusively use seizure EEGs for detection risk artificially enhanced performance metrics. Therefore, there is a pressing need for a universally applicable model that can perform automatic epilepsy detection in a variety of complex real-world scenarios.

Method: To address this problem, we have devised a novel technique employing a temporal convolutional neural network with self-attention (TCN-SA). Our model comprises two primary components: a TCN for extracting time-variant features from EEG signals, followed by a self-attention (SA) layer that assigns importance to these features. By focusing on key features, our model achieves heightened classification accuracy for epilepsy detection.

Results: The efficacy of our model was validated on a pediatric epilepsy dataset we collected and on the Bonn dataset, attaining accuracies of 95.50% on our dataset, and 97.37% (A v. E), and 93.50% (B vs E), respectively. When compared with other deep learning architectures (temporal convolutional neural network, self-attention network, and standardized convolutional neural network) using the same datasets, our TCN-SA model demonstrated superior performance in the automated detection of epilepsy.

Conclusion: The proven effectiveness of the TCN-SA approach substantiates its potential as a valuable tool for the automated detection of epilepsy, offering significant benefits in diverse and complex real-world clinical settings.

Keywords: Attention mechanism; Convolutional neural network; EEG; Epileptic seizure; Pediatric epilepsy.

PubMed Disclaimer

Conflict of interest statement

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

Figures

Fig. 1
Fig. 1
Accuracy and loss of the training, valid, test results of the four models. a, b TCN-SA model; c, d TCN model; e, f CNN model; and g, h SA model
Fig. 2
Fig. 2
Average ROC curve, confidence interval, and average AUC of the four models in the fivefold cross-validation
Fig. 3
Fig. 3
The best and worst confusion matrices for the fivefold cross-validations of the model
Fig. 4
Fig. 4
Accuracy of the TCN-SA model for participants following segment-based evaluation criteria
Fig. 5
Fig. 5
Average ROC curve, confidence interval, and average AUC of the four models in the threefold cross-validation for A-E
Fig. 6
Fig. 6
Average ROC curve, confidence interval, and average AUC of the four models in the threefold cross-validation for B-E
Fig. 7
Fig. 7
The best and worst confusion matrices for the threefold cross-validation of the TCN-SA model with the A-E subset
Fig. 8
Fig. 8
The best and worst confusion matrices for the threefold cross-validation of the TCN-SA model with the B-E subset
Fig. 9
Fig. 9
Overview of the proposed TCN-SA model
Fig. 10
Fig. 10
Causal and dilated convolution: a represents the causal convolution with a convolution kernel size of 2, b represents the dilated convolution with a convolution kernel size of 3, and (c) represents the causal convolution with a dilated value of 3 and convolution kernel size of 2
Fig. 11
Fig. 11
Accuracy and loss of the best and worst effects of the four models in the fivefold cross-validation. a Accuracy; b loss
Fig. 12
Fig. 12
Accuracy and losses of the best and worst performances of the four models in the threefold cross-validation for A-E. a Accuracy, b loss
Fig. 13
Fig. 13
Accuracy and losses of the best and worst performances of the four models in the threefold cross-validation for B-E. a Accuracy, b loss
Fig. 14
Fig. 14
Accuracy of the CNN model for participants following segment-based evaluation criteria
Fig. 15
Fig. 15
Accuracy of the TCN model for participants following segment-based evaluation criteria
Fig. 16
Fig. 16
Accuracy of the SA model for participants following segment-based evaluation criteria

Similar articles

Cited by

References

    1. Paul F, David H, Abir H, Dhiya AJ, Khaled AA. Automatic epileptic seizure detection using scalp EEG and advanced artificial intelligence techniques. J Biomed Biotechnol. 2015 doi: 10.1155/2015/986736. - DOI - PMC - PubMed
    1. Ngugi AK, Bottomley C, Kleinschmidt I, Sander JW, Newton CR. Estimation of the burden of active and life-time epilepsy: a meta-analytic approach. Epilepsia. 2010;51(5):883–890. doi: 10.1111/j.1528-1167.2009.02481.x. - DOI - PMC - PubMed
    1. Fiest KM, Sauro KM, Wiebe S, Patten SB, Kwon C-S, Dykeman J, Pringsheim T, Lorenzetti DL, Jetté N. Prevalence and incidence of epilepsy: a systematic review and meta-analysis of international studies. Neurology. 2017;88(3):296–303. doi: 10.1212/WNL.0000000000003509. - DOI - PMC - PubMed
    1. Asadi-Pooya AA, Sperling MR. Strategies for surgical treatment of epilepsies in developing countries. Epilepsia. 2008;49(3):381–385. doi: 10.1111/j.1528-1167.2007.01383.x. - DOI - PubMed
    1. Mac TL, Tran DS, Quet F, Odermatt P, Preux PM, Tan CT. Epidemiology, aetiology, and clinical management of epilepsy in Asia: a systematic review. Lancet Neurol. 2007;6(6):533–543. doi: 10.1016/S1474-4422(07)70127-8. - DOI - PubMed