Introduction

Bipolar disorder (BD) and major depressive disorder (MDD) are common mood disorders. Depressive episodes in both disorders have similar clinical manifestations, such as depressive symptoms and the duration of affective episodes during the course of illness1. When MDD occurs in an individual with a history of manic or hypomanic episodes, it is referred to as bipolar disorder type I or II, respectively. These two mood disorders are very different, but they share some features2. Therefore, the similarities and differences between these mood conditions are of interest to clinicians.

Most patients with BD first experience a depressive episode, and the transition from unipolar depression to BD is more likely to occur within five years of the onset of the first depressive episode3. A study that followed patients with Major Depressive Disorder (MDD) for 8 years found that 7.6–12.1% of these patients were later diagnosed with BD4. The discovery of biomarkers for distinguishing between BD and MDD holds significant clinical importance, as patients with BD require distinct treatments compared to those with MDD5. Furthermore, most studies exploring the distinctions between BD and MDD have been conducted in patients who have already been diagnosed with BD or MDD3.

Previous studies have proposed phenotypic models for distinguishing MDD, BD, and healthy controls (HCs) using electroencephalography (EEG) network indices in the frontal regions. These studies concluded EEG biomarkers for detecting BD are less well defined than those for MDD6,7. A resting-state EEG-based network study reported that both MDD and BD patients exhibited similar changes at the global level but demonstrated distinct nodal-level network alterations compared to HCs in the high-beta band8. Gamma activity induced by emotional faces differentiates patients with MDD from with BD9. Patients with bipolar affective disorder show increased delta, theta, alpha, and beta power compared to HCs10. Patients with depression show increased resting-state beta and gamma activity compared to HCs11. However, effective diagnostic models discriminating between MDD and BD are scarce, and further studies are needed to identify the neural mechanisms of these disorders using EEG.

Classification models using machine learning techniques have been increasingly applied in psychiatry. Several studies have revealed that EEG network features can be used to distinguish between BD and MDD6,7,12. A study revealed that EEG features from delta, theta, and alpha bands achieved an accuracy of 80.19% for classification between BD and MDD patients13. These studies recruited patients diagnosed with BD or MDD without a history of transition from MDD to BD6,7,12,13. Deciphering the disparity between BD and MDD in EEG phenotypes would provide a clearer perspective. Further studies are necessary to understand the clinical transitions in individuals with MDD and BD, encompassing both shared and distinct pathologies. This study represents the first attempt to investigate EEG changes in the diagnostic transition from MDD to BD and to differentiate between MDD and BD converted from MDD based on EEG features.

Reliably diagnosing BD and MDD has been regarded as a major challenge for clinicians, particularly when recurring episodes of depression are the primary common affective symptoms of both conditions14. Therefore, there is an urgent need for prospective studies investigating the pathological progression from MDD to BD to enhance the efficiency of clinical diagnosis. The current study aimed to compare resting-state EEG activity between patients with MDD and those whose diagnosis changed from MDD to BD. In addition, we attempted to classify patients based on their EEG features. The correlations between EEG features and psychological measures were also examined. Our hypothesis was centered on the variance in resting-state EEG activity between patients initially diagnosed with MDD and those who experienced diagnostic conversion from MDD to BD. Furthermore, we anticipated that the EEG features would exhibit reasonable classification accuracy in distinguishing between the two groups.

Results

Demographic and psychological characteristics

Comparisons of demographic and psychological characteristics between patients with BD and those with MDD are presented in Table 1. There was a significant difference in the age between the two groups. Patients with BD were significantly younger than those with MDD (P = 0.022). There were no significant group differences in sex or years of formal education. In addition, there were no differences in the psychological measures between patients with MDD and those with BD.

Table 1 Demographic characteristics of study participants.

Classification results based on spectral power and source analyses

Table 2 presents the best classification performance with the spectral power and source-activity features for patients with BD and MDD. For sensor-level features, patients with BD showed greater theta-band power at the AF3 electrode (P = 0.036) and low-alpha band power at the FC5 electrode (P = 0.014) than those with MDD. Regarding source-level features, theta band activity in the right anterior cingulate cortex (P = 0.011) and low-alpha band activity in the left parahippocampal gyrus (P = 0.035) were higher in patients with BD than in those with MDD (Table 2 and Fig. 1). With the four features (two sensor-level and two source-level), the best classification performance for the patients with BD and MDD showed an 80.88% accuracy, 76.47% sensitivity, and 82.35% specificity. In addition, we included age along with resting-state EEG features in the machine learning analyses and discovered that age was not selected for the best-performing feature set, suggesting that age did not significantly impact the classification of the two groups. In addition, the other variables that showed no significance were presented in supplementary tables.

Table 2 Mean and standard deviation values of sensor-level (power) and source-level (activity) features showing the best classification performances (%) between major depressive disorder and bipolar disorder.
Fig. 1
figure 1

Difference of cortical source activity between patients with MDD and BD. Patients with BD showed increased source activity. BD bipolar disorder, MDD major depressive disorder.

Correlation between EEG measures and psychological measures

Significant correlations were found among the four selected EEG features and clinical and cognitive measures. Trail Making Test A (TA) (r = 0.358, P = 0.010, Fig. 2a) and Trail Making Test B (TB) (r = 0.343, P = 0.014, Fig. 2b) scores positively correlated with the low-alpha power of FC5 in patients with MDD. In patients with BD, the theta power of AF3 was negatively correlated with motor impulsivity (r = − 0.514, P = 0.025; Fig. 2c) and total Barratt Impulsivity Scale (BIS) score (r = − 0.555, P = 0.021; Fig. 2d). In addition, the low-alpha power of FC5 correlated with TA (r = 0.519, P = 0.033; Fig. 2e). For all patients with BD and MDD, the theta power of AF3 was negatively correlated with motor impulsivity (r = − 0.267, P = 0.029, Fig. 2f). The low-alpha power of FC5 was negatively correlated with total TAI (r = − 0.279, P = 0.022, Fig. 2g) and Difficulties in Emotion Regulation Scale (DERS) (r = − 0.261, P = 0.033, Fig. 2h) scores. The source activity of the theta band in the right anterior cingulate correlated with the total Beck Depression Inventory (BDI) score (r = 0.251, P = 0.041).

Fig. 2
figure 2

Significant correlations between EEG and cognitive/symptom measurements. BD bipolar disorder, BDI Beck Depression Inventory, BIS Barratt Impulsivity Scale, DERS Difficulties in Emotion Regulation Scale, EEG electroencephalography, MDD major depressive disorder, MI motor impulsivity, TA & TB Trail Making Test A and B, TAI Trait Anxiety Inventory.

Discussion

This study investigated and compared sensor-level power and source-level activities from resting-state EEG in patients with MDD and those with BD converted from MDD. We observed that patients with BD showed increased theta power of the AF3 channel and low-alpha power of FC5 at the sensor level, and higher theta activity of the right anterior cingulate and low-alpha activity of the left parahippocampal gyrus at the source level than those with MDD. These four features were selected using machine learning techniques. The best classification performance for the four EEG features distinguishing MDD and BD patients had 80.88% accuracy, 76.47% sensitivity, and 82.35% specificity. We utilized statistical findings as potential candidate features for applying machine learning techniques. This study focused on identifying potential biomarkers through machine learning techniques, rather than relying on statistically derived results. While employing the multiple corrections is crucial in conventional statistical analyses, our study prioritized building a classification model instead. In addition, cognitive and clinical symptoms (TA, TB, impulsivity, emotion regulation, depression, and anxiety) correlated with the four EEG features in each patient group and all patients.

According to previous research, in patients with BD, EEG theta power increases while alpha power increases and decreases15,16,17. When comparing manic and depressive states in patients with BD, reduced resting-state theta activity in the prefrontal lobe was observed during manic episodes18. Patients with BD and MDD show similar metabolic activation in response to emotional cues19.

The anterior cingulate cortex plays a fundamental role in cognitive attention and regulation20,21. Reduced theta activity in the frontal area during the Go/No-go task suggests cognitive deficits and dysfunctional behavior in patients with BD type I22. The anterior cingulate cortex and parahippocampal gyrus serve as hub regions within the default mode network (DMN), reflecting the resting-state network23,24. In patients with psychosis, elevated resting-state theta and alpha activity in the DMN could signify pathophysiological attributes25. The spontaneous fluctuations in EEG activity pose a challenge for explanation, especially considering the contradictory findings that have been highlighted earlier26. These inconsistencies suggest that EEG biomarkers may reflect both transient and enduring characteristics of the pathophysiology of BD. Furthermore, the intricate nature of BD and MDD hinders precise elucidation of their neurophysiological mechanisms. Understanding the complexity of BD involves acknowledging that decreased theta activity during auditory stimulation is associated with cognitive impairment27. However, these findings lack conclusive evidence due to the incomplete clarification of coherent links between cognitive and affective symptoms and EEG activity, compounded by inconsistent results. Nonetheless, it is noteworthy that an acute increase in resting-state theta frequency was correlated with suicidal tendencies in patients with MDD and HCs28,29. Following the administration of antidepressants, patients with MDD display a prolonged reduction in theta activity30. The significance of the theta frequency appears to be influenced by the transition from a depressed state to a manic state in individuals with mood disorders. As our BD group was mainly BD II, there are limitations in directly applying the research results. However, considering the lack of a separate study on the BD II group and the fact that BD II is also a subgroup of BD, the above results can be used as a reference when interpreting our results.

This study demonstrated that low-alpha activity was increased in patients with BD compared to patients with MDD. A previous study found that patients with BD exhibited increased resting-state alpha activity compared to HCs, with the most significant changes observed in the frontocentral regions17. In healthy individuals, physiological relaxation following the administration of gamma-aminobutyric acid increased alpha activity31. This heightened alpha activity could be attributed to lower neural activity and reduced communication between different brain regions. It can be hypothesized that the overt pathological behavior of patients with BD becomes apparent when brain activity decreases. However, further research is required to establish a clear understanding of the relationship between alpha activity and BD. Furthermore, alpha activity could potentially serve as a significant biomarker for the diagnosis of both MDD and BD. Changes in EEG theta and alpha frequencies should be considered when detecting pathological characteristics that distinguish patients with BD from those with MDD.

Machine intelligence is necessary for identifying the mental status in psychiatry. Research on the classification of diseases and health status has grown rapidly32,33,34,35. Very few studies have classified resting-state EEG data into bipolar and depressive disorders7,12,13. To date, no study has investigated the classification of MDD and BD converted from MDD using EEG. Effective resting-state connectivity features were revealed to discriminate between patients with MDD and those with BD, with a classification accuracy of 84.9%7. Another study showed that a classification accuracy of 80.19% was achieved based on the features from delta, theta, and alpha frequencies13. Task-related theta activity was used to distinguish unipolar and bipolar depression with a classification accuracy of 83%36. Increased theta power could indicate abnormal activity such as a hippocampal theta spike in BD37. In this study, we found an increase in low-alpha source activity in the parahippocampal gyrus of patients with BD compared with those with MDD. Neurocognitive deficits related to increased alpha activity have been found in patients with BD compared with HCs10. Therefore, increased resting-state theta and low-alpha activities may indicate brain abnormalities and cognitive impairment in patients with BD. Specifically, elevated theta and alpha activities during resting-state could suggest disruptions in neural oscillations and cognitive processing. These disruptions could serve as pathological biomarkers to distinguish between patients with MDD and those whose diagnosis has transitioned from MDD to BD. These findings underscore the importance of investigating spectral abnormalities to better understand the neurobiological mechanisms underlying BD derived from MDD.

In this study, we found a positive correlation between low-alpha activity and performance in the trail-making task in patients with MDD and BD. According to validated reports, the normal average times for trail-making tasks A and B are 29 and 75 s, respectively38,39,40,41. The scores of the participants were within the normal range. However, the increase in low-alpha activity alongside delayed task performance might suggest a potential cognitive deficit, given the well-established association between mood disorders and cognitive impairments42. Furthermore, we found that a decrease in theta power was associated with impulsivity in all patients. Patients with BD exhibit greater impulsivity symptoms during manic episodes43. Reduced theta power is also indicative of impaired inhibitory control in individuals with a history of suicide attempts44. Our results showed a correlation between low-alpha activity and cognitive/symptomatic domains. In the context of anxiety and depression, alpha activity has emerged as a distinguishable biomarker, showing symptomatic correlation45,46. Patients with high anxiety levels displayed increased slow-alpha activity46. Specifically, in patients with MDD, cognitive ability may be reflected in resting-state low-alpha activity, while resting-state theta power could serve as an indicator of impulsivity in patients with BD. Consequently, both theta and alpha activities demonstrated correlations with cognitive and symptomatic measures, supporting previous research findings.

This study had several limitations. First, the relatively small sample size should be considered when interpreting our results. Further studies with larger sample sizes are required to validate these findings. Second, the patient groups were not age-matched. However, the difference in age between the groups was due to the prospective cohort study design. Moreover, the patients with BD were significantly younger than those with MDD, which may reflect an earlier onset of BD47. The potential small population size of BD patients due to diagnostic transition from MDD is a natural clinical phenomenon48. We identified the pathological characteristics associated with this transition through 3-year follow-up period. Initially, we recruited patients diagnosed with MDD and followed them for three years, categorizing them into those who remained with MDD and those who transitioned to BD. By comparing the EEGs recorded at the time of initial recruitment, we achieved a classification accuracy of 80.88%. These findings underscore the importance of understanding how the pathology shifts from MDD to BD. We controlled for the variables as covariates in the statistical analyses. Third, although our study may have the advantage of being a cohort design that followed the transition from MDD to BD, we cannot exclude the possibility that a subset of patients with MDD would have transitioned to BD if a longer-term follow-up of 3 years or more had been possible. However, this may be a limitation of this cohort study, which had a fixed follow-up period. Fourth, our BD population is a group that all satisfies the BD II diagnostic criteria and cannot be generalized to the BD I group. However, it may be appropriate to study BD I and BD II separately in groups with different clinical manifestations and prognoses. Finally, we did not implement individual head models for the EEG source imaging. Despite the above limitations, this study is noteworthy, as it is the first attempt to investigate the differences in resting-state activities in patients with MDD and patients with BD converted from MDD. This study suggests that resting-state EEG theta and low-alpha frequencies serve as candidate neuromarkers for distinguishing between MDD and BD converted from MDD, with acceptable classification performance. In a future study, we will attempt to discover other neuromarkers and improve classification performance with larger sample sizes.

Materials and methods

Participants

Sixty-eight patients with MDD were recruited from the Department of Psychiatry at Soonchunhyang University Cheonan Hospital between December 2018 and August 2021. At the first outpatient visit, all patients met the criteria for an MDD diagnosis, and over a period of approximately three years of follow-up, some maintained their MDD diagnosis, and the diagnosis of some patients changed to BD. Patients whose diagnoses changed to BD were defined as the BD group. The BD population satisfied the BD II diagnostic criteria. The mean age of the 51 patients with MDD (m/f, 14/37) was 27.82 years, and that of the 17 patients with BD (m/f, 5/12) was 24.29 years. The mean years of formal education for patients with MDD and BD were 13.53 and 13.18, respectively. All the patients were native Koreans. Patients with MDD and BD were diagnosed using the Diagnostic and Statistical Manual of Mental Disorders, 5th Edition (DSM-V), using a common psychiatric interview49. Patients with neuropsychiatric diseases, traumatic brain injury, or alcohol abuse were excluded. This study and all experimental protocols were approved by the Institutional Review Board and Ethics Committee of Soonchunhyang University Cheonan Hospital (approval number: 2018-10-032). Written informed consent was obtained from all participants. Our study conformed to the ethical guidelines of the World Medical Association Declaration of Helsinki.

Psychological measures

The psychological measure scores are shown in Table 1. The measurements were as follows: BIS50, DERS51, BDI52, State and Trait Anxiety Inventory (STAI)53, Mood Disorder Questionnaire (MDQ)54, Verbal Fluency (VF), and TA and TB. The BIS includes a three-factor model consisting of attentional, motor, and non-planned impulsivity55.

EEG recording and preprocessing

All patients were seated in a comfortable chair in a room with attenuated sound. Resting-state EEG data were recorded for five minutes while patients’ eyes were open. EEG data were recorded using a NeuroScan SynAmps2 amplifier (Compumedics USA, Charlotte, NC, USA) based on an extended 10–20 placement scheme using 62 Ag–AgCl electrodes mounted on a Quik-Cap. The physically linked reference electrode was attached to both mastoids and the ground electrode was placed on the forehead. Horizontal electrooculogram (EOG) electrodes were placed on the outer canthus of each eye, and vertical EOG electrodes were placed above and below the left eye. The impedance was maintained below 5 kΩ. EEG signals were bandpass filtered from 0.1 to 100 Hz with a 1000 Hz sampling rate. All preprocessing procedures were performed using the CURRY 8 (Compumedics, Charlotte, NC, USA) and MATLAB R2021b (MathWorks, Natick, MA, USA) software. EEG data were referenced to an average reference. A high-pass filter of 1 Hz was applied to the EEG data to remove DC components. Visual inspection of movement artifacts was performed by a skilled researcher without prior information regarding the origin of the data. Eye movement-related artifacts were corrected using a covariance- and regression-based mathematical procedure in CURRY 856. Then, the preprocessed EEG data were divided into 2.048 s (2048 points) epochs, and all the epochs including significant physiological artifacts (amplitude exceeding ± 100 μV) at any of the 62 electrodes were rejected. Among the remaining artifact-free epochs, 30 were randomly extracted for each participant, considering the bias over time. This was determined based on the different numbers of remaining epochs from each participant after artifact rejection. In addition, a previous study demonstrated acceptable reliability of resting-state EEG data longer than 40 s57.

Quantitative EEG analysis

The fast Fourier transformation is to decompose a signal in the time domain into multiple frequency components. This enables rapid analysis of frequency characteristics in time series data and facilitates transformations in the frequency domain. Spectral power analysis was performed using fast Fourier transformation for 62 electrodes divided into seven frequency bands: delta (1–4 Hz), theta (4–8 Hz), low-alpha (8–10 Hz), high-alpha (10–12 Hz), low-beta (12–18 Hz), high-beta (18–30 Hz), and gamma (30–55 Hz). The absolute power of each electrode is calculated for each frequency band. In addition, the global band powers were calculated over 62 electrodes and averaged.

Source imaging

The cortical distribution of the standardized source current density of brain sources in the resting state for the frequency domain was calculated using standardized low-resolution brain electromagnetic tomography (sLORETA). sLORETA has been widely used as a representative source imaging method for solving the EEG inverse problem58. It assumes that the source activity of a voxel is similar to that of the neighboring voxels when computing a particular solution and applies proper standardization for the current density. The lead field matrix was calculated using a realistic head model that was segmented according to the Montreal Neurological Institute (MNI) 152 standard template, wherein the three-dimensional solution space was confined to the cortical gray matter and hippocampus59. The three-dimensional solution space consisted of 6239 voxels with 5-mm resolution. Anatomical labels, including the Brodmann areas, were provided with a proper transformation from the MNI to the Talairach space60. The source activities of the 66 ROIs in the seven frequency bands (delta, theta, low-alpha, high-alpha, low-beta, high-beta, and gamma) were extracted. We selected 66 ROIs based on the information of each voxel provided by sLORETA.

Statistical analysis

Independent t-tests and chi-square tests were used to examine differences in demographic characteristics and psychological measures between patients with BD and MDD. A multivariate analysis of variance (MANOVA) was performed to evaluate the differences in spectral powers and source activities for each frequency band between the two groups, with age as a covariate. Effect sizes were calculated based on the partial eta squared (η2). The results of MANOVA were used to preliminarily identify candidate features for machine learning in the current study, without applying strict multiple corrections. The relationship between the EEG signals and psychological measures was analyzed using Spearman’s correlation analysis for each patient group. Partial Pearson correlation analyses were performed using age as a covariate for all patients with MDD and BD. All correlation analyses were corrected using the 5000 bootstrap resampling technique for multiple comparisons. Statistical analyses were conducted using SPSS 21 (SPSS Inc., Chicago, IL, USA) with a two-tailed significance level at P < 0.05. A power analysis was performed for a comparison between two groups with sample sizes of 51 and 17, assuming a medium effect size (Cohen's d = 0.5) and a significance level (alpha) of 0.05. The statistical power is approximately 0.421.

Feature selection and classification

We discriminated between patients with MDD and patients with BD converted from MDD using sensor-level powers and source-level activities calculated from resting-state EEG data recorded when all patients had MDD. To find the optimal features for discriminating the two groups, resting-state features from the sensor and source levels were used, including 65 features from sensor-level powers and 21 features from source-level activities, showing significant differences between the two groups (Supplementary Tables 1 and 2). In addition, the age variable, which was significantly different between patients with MDD and BD, was added to the feature set to check the effect of age on machine learning performance.

Machine learning analyses were conducted using Python 3.9.13 and the scikit-learn 1.1.2 package. The classification was performed using a radial basis function support vector machine classifier with the regularization parameter set as 1 and the gamma value of the kernel coefficient set as the 'scale' option. Due to the MDD group having three times the sample size of the BD group, we implemented balanced class weights to mitigate classification bias stemming from the rate of diagnostic transition from MDD to BD. Furthermore, to mitigate the risk of overfitting caused by the number of features, we restricted the feature selection to examine only 1–20 features.

In addition, we used a leave-one-out cross-validation method to evaluate classification performance. Many studies have used the leave-one-out cross-validation method claiming that it is more appropriate for small data because more data can be trained for a classification model, and it imitates the clinical setting where clinicians can learn from large data and apply the findings to new each case61,62,63. To find the best features for discriminating between the two patient groups, the sequential forward selection-based wrapper method was employed by adding features individually, with a range of 1–20 features. We selected balanced accuracy (average of sensitivity and specificity) as the feature selection criterion to avoid bias caused by the disparity in the number of subjects between the two groups. Finally, the classification performances, including accuracy, sensitivity, and specificity, were averaged in leave-one-out cross-validation.