Transformers for autonomous recognition of psychiatric dysfunction via raw and imbalanced EEG signals

Research output: Contribution to journalArticlepeer-review

1 Scopus citations


Early identification of mental disorders, based on subjective interviews, is extremely challenging in the clinical setting. There is a growing interest in developing automated screening tools for potential mental health problems based on biological markers. Here, we demonstrate the feasibility of an AI-powered diagnosis of different mental disorders using EEG data. Specifically, this work aims to classify different mental disorders in the following ecological context accurately: (1) using raw EEG data, (2) collected during rest, (3) during both eye open, and eye closed conditions, (4) at short 2-min duration, (5) on participants with different psychiatric conditions, (6) with some overlapping symptoms, and (7) with strongly imbalanced classes. To tackle this challenge, we designed and optimized a transformer-based architecture, where class imbalance is addressed through focal loss and class weight balancing. Using the recently released TDBRAIN dataset (n= 1274 participants), our method classifies each participant as either a neurotypical or suffering from major depressive disorder (MDD), attention deficit hyperactivity disorder (ADHD), subjective memory complaints (SMC), or obsessive–compulsive disorder (OCD). We evaluate the performance of the proposed architecture on both the window-level and the patient-level. The classification of the 2-min raw EEG data into five classes achieved a window-level accuracy of 63.2% and 65.8% for open and closed eye conditions, respectively. When the classification is limited to three main classes (MDD, ADHD, SMC), window level accuracy improved to 75.1% and 69.9% for eye open and eye closed conditions, respectively. Our work paves the way for developing novel AI-based methods for accurately diagnosing mental disorders using raw resting-state EEG data. © 2023, Springer-Verlag GmbH Germany, part of Springer Nature.
Original languageBritish English
JournalBrain Informatics
Issue number1
StatePublished - 2023


  • Class Imbalance
  • EEG Classification
  • Multivariate Time-series Classification
  • Psychiatric Dysfunction
  • Transformer Networks
  • biological marker
  • Attention deficit hyperactivity disorder
  • Class imbalance
  • Closed condition
  • EEG classification
  • EEG signals
  • Mental disorders
  • Multivariate time series classifications
  • Psychiatric dysfunction
  • Transformer network
  • Window level
  • accuracy
  • Article
  • artificial intelligence
  • attention deficit hyperactivity disorder
  • autonomous recognition
  • burnout
  • chronic pain
  • depression
  • dyslexia
  • electroencephalogram
  • entropy
  • feasibility study
  • human
  • insomnia
  • interview
  • learning algorithm
  • machine learning
  • major clinical study
  • major depression
  • mental disease
  • mental health
  • natural language processing
  • neurophysiology
  • obsessive compulsive disorder
  • Parkinson disease
  • recognition
  • signal processing
  • support vector machine
  • time series analysis
  • tinnitus
  • Network architecture


Dive into the research topics of 'Transformers for autonomous recognition of psychiatric dysfunction via raw and imbalanced EEG signals'. Together they form a unique fingerprint.

Cite this