Machine Learning

  • Yiheng Tu


Machine learning and pattern recognition have been widely applied in EEG analysis. They provide new approaches to decode and characterize task-related brain states and extract them from non-informative high-dimensional EEG data. Given the growth in the interest and breadth of application, we introduce how to apply machine learning techniques in EEG analysis. First, we give an overview of machine learning analysis and introduce several basic concepts. Then, we propose a scientific question of discriminating EEG data under eyes-open and eyes-closed resting-state conditions, and provide a step-by-step tutorial including extracting features, training features, feature selection and dimension reduction, selecting a classifier, testing the classifier, evaluating results, and pattern expression. We also discuss perspective, particularly the deep learning algorithms, for future study. In the last section of this chapter, we give detailed MATLAB codes for implementing machine learning analysis for classifying eyes-open and eyes-closed EEG data.


Machine learning Classification Feature Training Testing 

Supplementary material (2.6 mb)
Chapter 15_codes (2646 kb)


  1. Blankertz B, Lemm S, Treder M, Haufe S, Müller KR. Single-trial analysis and classification of ERP components – a tutorial. Neuroimage. 2011;56:814–25.CrossRefGoogle Scholar
  2. Cecotti H, Graeser A. Convolutional neural network with embedded Fourier transform for EEG classification. In: 19th international conference on pattern recognition. 2008. pp. 1–4.Google Scholar
  3. Gajraj RJ, Doi M, Mantzaridis H, Kenny GN. Analysis of the EEG bispectrum, auditory evoked potentials and the EEG power spectrum during repeated transitions from consciousness to unconsciousness. Br J Anaesth. 1998;80:46–52.CrossRefGoogle Scholar
  4. Gysels E, Renevey P, Celka P. SVM-based recursive feature elimination to compare phase synchronization computed from broadband and narrowband EEG signals in brain-computer interfaces. Signal Process. 2005;85:2178–89.CrossRefGoogle Scholar
  5. Hu L, et al. Single-trial detection of somatosensory evoked potentials by probabilistic independent component analysis and wavelet filtering. Clin Neurophysiol. 2011;122:1429–39.CrossRefGoogle Scholar
  6. Hu L, Xiao P, Zhang ZG, Mouraux A, Iannetti GD. Single-trial time-frequency analysis of electrocortical signals: baseline correction and beyond. Neuroimage. 2014;84:876–87.CrossRefGoogle Scholar
  7. Hu L, Zhang ZG, Mouraux A, Iannetti GD. Multiple linear regression to estimate time-frequency electrophysiological responses in single trials. Neuroimage. 2015;111:442–53.CrossRefGoogle Scholar
  8. Huang G, et al. A novel approach to predict subjective pain perception from single-trial laser-evoked potentials. Neuroimage. 2013;81:283–93.CrossRefGoogle Scholar
  9. Jolliffe I. International encyclopedia of statistical science 1094–1096. Berlin Heidelberg: Springer; 2011.Google Scholar
  10. Li K, Li X, Zhang Y, Zhang A Affective state recognition from EEG with deep belief networks. In: IEEE international conference on bioinformatics and biomedicine. 2013. pp. 305–310.Google Scholar
  11. Lotte F, Congedo M, Lécuyer A, Lamarche F, Arnaldi B. A review of classification algorithms for EEG-based brain–computer interfaces. J Neural Eng. 2007;4:R1–R13.CrossRefGoogle Scholar
  12. Makeig S, et al. Evolving signal processing for brain-computer interfaces. Proc IEEE. 2012;100:1567–84.CrossRefGoogle Scholar
  13. Maris E, Oostenveld R. Nonparametric statistical testing of EEG- and MEG-data. J Neurosci Methods. 2007;164:177–90.CrossRefGoogle Scholar
  14. Mirowski P, Madhavan D, LeCun Y, Kuzniecky R. Classification of patterns of EEG synchronization for seizure prediction. Clin Neurophysiol. 2009;120:1927–40.CrossRefGoogle Scholar
  15. Müller KR, et al. Machine learning for real-time single-trial EEG-analysis: from brain–computer interfacing to mental state monitoring. J Neurosci Methods. 2008;167:82–90.CrossRefGoogle Scholar
  16. Mwangi B, Tian TS, Soares JC. A review of feature reduction techniques in Neuroimaging. Neuroinformatics. 2014;12:229–44.CrossRefGoogle Scholar
  17. Schoffelen JM, Gross J. Source connectivity analysis with MEG and EEG. Hum Brain Mapp. 2009;30:1857–65.CrossRefGoogle Scholar
  18. Shen KQ, Ong CJ, Li XP, Zheng H, Wilder-Smith EP. Feature selection method for multilevel mental fatigue EEG classification. IEEE Trans Biomed Eng. 2007;54:1231–7.CrossRefGoogle Scholar
  19. Srinivasan R, Winter WR, Ding J, Nunez PL. EEG and MEG coherence: measures of functional connectivity at distinct spatial scales of neocortical dynamics. J Neurosci Methods. 2007;166:41–52.CrossRefGoogle Scholar
  20. Subasi A, Ismail Gursoy M. EEG signal classification using PCA, ICA, LDA and support vector machines. Expert Syst Appl. 2010;37:8659–66.CrossRefGoogle Scholar
  21. Tabar YR, Halici U. A novel deep learning approach for classification of EEG motor imagery signals. J Neural Eng. 2017;14:016003.CrossRefGoogle Scholar
  22. Tibshirani R. Regression Shrinkage and Selection via the Lasso. J R Stat Soc Ser B (Methodological). 1996;58:267–88.Google Scholar
  23. Tu Y, et al. An automated and fast approach to detect single-trial visual evoked potentials with application to brain–computer interface. Clin Neurophysiol. 2014;125:2372–83.CrossRefGoogle Scholar
  24. Tu Y, Hung YS, Hu L, Zhang Z. PCA-SIR: a new nonlinear supervised dimension reduction method with application to pain prediction from EEG. In: 7th International IEEE/EMBS Conference on Neural Engineering (NER). 2015. pp. 1004–1007.Google Scholar
  25. Tu Y, et al. Alpha and gamma oscillation amplitudes synergistically predict the perception of forthcoming nociceptive stimuli. Hum Brain Mapp. 2016;37:501–14.CrossRefGoogle Scholar
  26. Van de Ville D, Britz J, Michel CM. EEG microstate sequences in healthy humans at rest reveal scale-free dynamics. Proc Natl Acad Sci U S A. 2010;107:18179–84.CrossRefGoogle Scholar
  27. Wang XW, Nie D, Lu BL. Emotional state classification from EEG data using machine learning approach. Neurocomputing. 2014;129:94–106.CrossRefGoogle Scholar
  28. Zhang ZG, Hu L, Hung YS, Mouraux A, Iannetti GD. Gamma-band oscillations in the primary somatosensory cortex – a direct and obligatory correlate of subjective pain intensity. J Neurosci. 2012;32:7429–38.CrossRefGoogle Scholar
  29. Zheng W-L, Zhu J-Y, Peng Y, Lu B-L EEG-based emotion classification using deep belief networks. In: IEEE International Conference on Multimedia and Expo (ICME). 2014. pp. 1–6.Google Scholar
  30. Zou H, Hastie T. Regularization and variable selection via the elastic net. J R Stat Soc Ser B (Statistical Methodology). 2005;67:301–20.CrossRefGoogle Scholar

Copyright information

© Springer Nature Singapore Pte Ltd. 2019

Authors and Affiliations

  • Yiheng Tu
    • 1
  1. 1.Department of PsychiatryMassachusetts General Hospital and Harvard Medical SchoolCharlestownUSA

Personalised recommendations