Major Depressive Disorder Diagnosis Using Time–Frequency Embeddings Based on Deep Metric Learning and Neuro-Fuzzy from EEG Signals
Abstract
1. Introduction
2. Materials and Methods
2.1. Time–Frequency Feature Extraction Method from EEG Signals
2.1.1. Short-Time Fourier Transform
2.1.2. Continuous Wavelet Transform
2.2. Deep Metric Learning
2.3. Adaptive Neuro-Fuzzy Inference System
- Layer 1 (Fuzzification Layer): In the first layer, input data is converted into linguistic variables, and the corresponding membership degrees are computed using the premise parameters, as defined in Equation (5).The membership function uses a generalized bell-shaped membership function, as shown in Equation (6).where {} represent the premise parameters, is the width of the membership function, controls its slope or tail shape, and indicates the center of the function.
- Layer 2 (Rule Layer): In the second layer, the firing strength of each fuzzy rule is computed by multiplying the membership values obtained from Layer 1. The resulting rule activations are mathematically expressed in Equation (7).
- Layer 3 (Normalization Layer): In the third layer, the firing strengths of each rule are normalized by dividing them by the sum of all firing strengths, as in Equation (8).
- Layer 4 (Defuzzification Layer): The fourth layer receives the normalized firing strengths and the consequent parameter set {, , , } as input and calculates the conclusion output of each rule as in Equation (9).
- Layer 5 (Output Layer): In the fifth layer, the outputs of all rules are integrated using the weighted average method, as shown in Equation (10), to derive the final result.
3. Experimental Results and Analysis
3.1. EEG Dataset of MDD Patients and Healthy Controls
3.2. Data Preprocessing
3.3. Experimental Results and Performance Analysis
3.3.1. Analysis of DML + ANFIS Model Performance with STFT Time–Frequency Features
3.3.2. Analysis of DML + ANFIS Model Performance with CWT Time–Frequency Features
4. Discussion
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- WHO Depression. Other Common Mental Disorders: Global Health Estimates; World Health Organization: Geneva, Switzerland, 2017; Volume 24. [Google Scholar]
- Otte, C.; Gold, S.M.; Penninx, B.W.; Pariante, C.M.; Etkin, A.; Fava, M.; Mohr, D.C.; Schatzberg, A.F. Major depressive disorder. Nat. Rev. Dis. Primers 2016, 2, 16065. [Google Scholar] [CrossRef]
- Hasin, D.S.; Sarvet, A.L.; Meyers, J.L.; Saha, T.D.; Ruan, W.J.; Stohl, M.; Grant, B.F. Epidemiology of adult DSM-5 major depressive disorder and its specifiers in the United States. JAMA Psychiatry 2018, 75, 336–346. [Google Scholar] [CrossRef]
- Howard, D.M.; Adams, M.J.; Shirali, M.; Clarke, T.-K.; Marioni, R.E.; Davies, G.; Coleman, J.R.I.; Alloza, C.; Shen, X.; Barbu, M.C.; et al. Genome-wide association study of depression phenotypes in UK Biobank identifies variants in excitatory synaptic pathways. Nat. Commun. 2018, 9, 1470. [Google Scholar] [CrossRef]
- Remes, O.; Mendes, J.F.; Templeton, P. Biological, psychological, and social determinants of depression: A review of re-cent literature. Brain Sci. 2021, 11, 1633. [Google Scholar] [CrossRef]
- Cui, L.; Li, S.; Wang, S.; Wu, X.; Liu, Y.; Yu, W.; Wang, Y.; Tang, Y.; Xia, M.; Li, B. Major depressive disorder: Hypothesis, mechanism, prevention and treatment. Signal Transduct. Target. Ther. 2024, 9, 30. [Google Scholar] [CrossRef]
- Beck, A.T.; Steer, R.A.; Brown, G.K. Beck Depression Inventory; Springer: Berlin/Heidelberg, Germany, 1996. [Google Scholar]
- Kroenke, K.; Spitzer, R.L.; Williams, J.B. The PHQ-9: Validity of a brief depression severity measure. J. Gen. Intern. Med. 2001, 16, 606–613. [Google Scholar] [CrossRef] [PubMed]
- Watts, D.; Pulice, R.F.; Reilly, J.; Brunoni, A.R.; Kapczinski, F.; Passos, I.C. Predicting treatment response using EEG in major depressive disorder: A machine-learning meta-analysis. Transl. Psychiatry 2022, 12, 332. [Google Scholar] [CrossRef] [PubMed]
- Rafiei, A.; Zahedifar, R.; Sitaula, C.; Marzbanrad, F. Automated Detection of Major Depressive Disorder With EEG Signals: A Time Series Classification Using Deep Learning. IEEE Access 2022, 10, 73804–73817. [Google Scholar] [CrossRef]
- Hashempour, S.; Boostani, R.; Mohammadi, M.; Sanei, S. Continuous Scoring of Depression From EEG Signals via a Hybrid of Convolutional Neural Networks. IEEE Trans. Neural Syst. Rehabil. Eng. 2022, 30, 176–183. [Google Scholar] [CrossRef]
- Bagherzadeh, S.; Maghooli, K.; Shalbaf, A.; Maghsoudi, A. A hybrid EEG-based emotion recognition approach using wavelet convolutional neural networks and support vector machine. Basic Clin. Neurosci. J. 2023, 14, 87–102. [Google Scholar] [CrossRef]
- Xia, M.; Zhang, Y.; Wu, Y.; Wang, X. An End-to-End Deep Learning Model for EEG-Based Major Depressive Disorder Classification. IEEE Access 2023, 11, 41337–41347. [Google Scholar] [CrossRef]
- Wang, Y.; Zhao, S.; Jiang, H.; Li, S.; Luo, B.; Li, T.; Pan, G. DiffMDD: A Diffusion-Based Deep Learning Framework for MDD Diagnosis Using EEG. IEEE Trans. Neural Syst. Rehabil. Eng. 2024, 32, 728–738. [Google Scholar] [CrossRef]
- Cui, W.; Sun, M.; Dong, Q.; Guo, Y.; Liao, X.-F.; Li, Y. A Multiview Sparse Dynamic Graph Convolution-Based Region-Attention Feature Fusion Network for Major Depressive Disorder Detection. IEEE Trans. Comput. Soc. Syst. 2024, 11, 2691–2702. [Google Scholar] [CrossRef]
- Kowli, V.P.; Padole, H.P. Detection of Major Depressive Disorder Using EEG Multifeature Fusion. IEEE Sens. J. 2025, 25, 1068–1075. [Google Scholar] [CrossRef]
- Umair, M.; Ahmad, J.; Alasbali, N.; Saidani, O.; Hanif, M.; Khattak, A.A.; Khan, M.S. Decentralized EEG-based detection of major depressive disorder via transformer architectures and split learning. Front. Comput. Neurosci. 2025, 19, 1569828. [Google Scholar] [CrossRef]
- Singh, A.K.; Krishnan, S. Trends in EEG signal feature extraction applications. Front. Artif. Intell. 2023, 5, 1072801. [Google Scholar] [CrossRef]
- Gabor, D. Theory of communication. Part 1: The analysis of information. J. Inst. Electr. Eng.-Part III Radio Commun. Eng. 1946, 93, 429–441. [Google Scholar] [CrossRef]
- Grossmann, A.; Morlet, J. Decomposition of Hardy functions into square integrable wavelets of constant shape. SIAM J. Math. Anal. 1984, 15, 723–736. [Google Scholar] [CrossRef]
- Ali, O.; Saif-Ur-Rehman, M.; Dyck, S.; Glasmachers, T.; Iossifidis, I.; Klaes, C. Enhancing the decoding accuracy of EEG signals by the introduction of anchored-STFT and adversarial data augmentation method. Sci. Rep. 2022, 12, 4245. [Google Scholar] [CrossRef]
- Lee, J.A.; Kwak, K.C. Personal identification using an ensemble approach of 1D-LSTM and 2D-CNN with electrocardiogram signals. Appl. Sci. 2022, 12, 2692. [Google Scholar] [CrossRef]
- Zhang, R.; Jiang, R.; Hu, H.; Gao, Y.; Xia, W.; Song, B. Automatic Sleep Staging Method Using EEG Based on STFT and Residual Network. IEEE Access 2025, 13, 1778–1789. [Google Scholar] [CrossRef]
- Dişli, F.; Gedikpınar, M.; Fırat, H.; Şengür, A.; Güldemir, H.; Koundal, D. Epilepsy diagnosis from EEG signals using continuous wavelet Transform-Based depthwise convolutional neural network model. Diagnostics 2025, 15, 84. [Google Scholar] [CrossRef] [PubMed]
- Lilly, J.M.; Olhede, S.C. Higher-Order Properties of Analytic Wavelets. IEEE Trans. Signal Process. 2009, 57, 146–160. [Google Scholar] [CrossRef]
- Mammone, N.; Ieracitano, C.; Morabito, F.C. A deep CNN approach to decode motor preparation of upper limbs from time–frequency maps of EEG signals at source level. Neural Netw. 2020, 124, 357–372. [Google Scholar] [CrossRef] [PubMed]
- Daubechies, I. Ten Lectures on Wavelets; Society for Industrial and Applied Mathematics: Philadelphia, PA, USA, 1992. [Google Scholar]
- Merchan, F.; Contreras, K.; Gittens, R.A.; Loaiza, J.R.; Sanchez-Galan, J.E. Deep metric learning for the classification of MALDI-TOF spectral signatures from multiple species of neotropical disease vectors. Artif. Intell. Life Sci. 2023, 3, 100071. [Google Scholar] [CrossRef]
- Mohan, D.D.; Jawade, B.; Setlur, S.; Govindaraju, V. Deep metric learning for computer vision: A brief overview. Handb. Stat. 2023, 48, 59–79. [Google Scholar]
- Chen, T.; Kornblith, S.; Norouzi, M.; Hinton, G. A simple framework for contrastive learning of visual representations. In Proceedings of the 37th International Conference on Machine Learning (ICML), Vienna, Austria, 13–18 July 2020; PmLR: Vienna, Austria, 2020; Volume 119, pp. 1597–1607. [Google Scholar]
- Jang, J.-S.R. ANFIS: Adaptive–network–based fuzzy inference systems. IEEE Trans. Syst. Man Cybern. 1993, 23, 665–685. [Google Scholar] [CrossRef]
- Yeom, C.U.; Kwak, K.C. Performance comparison of ANFIS models by input space partitioning methods. Symmetry 2018, 10, 700. [Google Scholar] [CrossRef]
- Kim, T.W.; Kwak, K.C. Hybrid Deep-ANFN Model for Dimensionality Reduction and Classification. IEEE Access 2024, 12, 171743–171752. [Google Scholar] [CrossRef]
- Kim, S.H.; Kim, T.W.; Kwak, K.C. Speaker Recognition Based on the Combination of SincNet and Neuro-Fuzzy for Intelligent Home Service Robots. Electronics 2025, 14, 3581. [Google Scholar] [CrossRef]
- Mumtaz, W. MDD Patients and Healthy Controls EEG Data (New); Dataset; Figshare: London, UK, 2016. [Google Scholar] [CrossRef]
- Mumtaz, W.; Xia, L.; Yasin, M.A.M.; Ali, S.S.A.; Malik, A.S. A wavelet-based technique to predict treatment outcome for major depressive disorder. PLoS ONE 2017, 12, e0171409. [Google Scholar] [CrossRef] [PubMed]








| Hardware | Software | ||
|---|---|---|---|
| CPU | Intel Core i9 10900 K @ 3.70 GHz | Operating System | Windows 11 Pro |
| GPU | NVIDIA GeForce RTX 2080 SUPER | Programming Language | MATLAB 2025a |
| RAM | 128 GB | ||
| Options | Epochs | L2 Regularization | Learn Rate | Mini-Batch | |
|---|---|---|---|---|---|
| Parameter | |||||
| Parameter values | 30 | 1 × 10−4 | 1 × 10−3 | 64 | |
| Model | K | Accuracy | F1-Score | Specificity | Sensitivity | AUC-ROC |
|---|---|---|---|---|---|---|
| DML + ANFIS (10 dimension) | 2 | 91.54% | 91.53% | 91.50% | 91.50% | 97.31% |
| 3 | 90.66% | 90.65% | 90.66% | 90.66% | 96.93% | |
| 4 | 90.48% | 90.48% | 90.50% | 90.50% | 96.34% | |
| 5 | 92.07% | 92.07% | 92.09% | 92.09% | 97.28% | |
| 6 | 91.37% | 91.35% | 91.31% | 91.31% | 97.09% |
| Model | Accuracy | F1-Score | Specificity | Sensitivity | AUC-ROC |
|---|---|---|---|---|---|
| Bi-LSTM | 72.09% | 71.83% | 71.92% | 71.92% | 80.79% |
| 2D CNN | 84.21% | 84.01% | 84.49% | 84.49% | 93.12% |
| DML + NN (256 dimensions) | 90.40% | 90.38% | 90.34% | 90.34% | 95.98% |
| DML + NN (10 dimensions) | 88.63% | 88.62% | 88.60% | 88.60% | 90.15% |
| DML + ANFIS | 91.51% | 91.32% | 91.51% | 91.52% | 96.26% |
| DML + ANFIS | 92.07% | 92.07% | 92.09% | 92.09% | 97.28% |
| Model | K | Accuracy | F1-Score | Specificity | Sensitivity | AUC-ROC |
|---|---|---|---|---|---|---|
| DML + ANFIS (10 dimensions) | 2 | 98.15% | 98.15%% | 98.14% | 98.14% | 99.38% |
| 3 | 98.41% | 98.41 | 98.40% | 98.40% | 99.50% | |
| 4 | 97.62% | 97.62% | 97.60% | 97.60% | 99.52% | |
| 5 | 97.97% | 97.97% | 97.98% | 97.98% | 99.54% | |
| 6 | 97.97% | 97.97% | 97.96% | 97.96% | 99.68% |
| Model | Accuracy | F1-Score | Specificity | Sensitivity | AUC-ROC |
|---|---|---|---|---|---|
| Bi-LSTM | 85.87% | 85.87% | 85.88% | 85.88% | 93.70% |
| 2D CNN | 92.14% | 92.12% | 92.29% | 92.29% | 97.82% |
| DML + NN (256 dimensions) | 97.71% | 97.71% | 97.71% | 97.71% | 98.93% |
| DML + NN (10 dimensions) | 95.86% | 95.86% | 95.86% | 95.86% | 96.03% |
| DML + ANFIS ) | 97.27% | 97.41% | 97.93% | 96.68% | 98.54% |
| DML + ANFIS ) | 98.41% | 98.41% | 98.40% | 98.40% | 99.50% |
| Model | K | Accuracy (%) | F1-Score (%) | Specificity (%) | Sensitivity (%) | AUC-ROC (%) |
|---|---|---|---|---|---|---|
| DML + ANFIS (10 dimensions) | 2 | 82.25 ± 0.70 | 81.52 ± 0.47 | 85.29 ± 5.29 | 79.14 ± 4.18 | 89.41 ± 0.33 |
| 3 | 82.79 ± 0.33 | 82.01 ± 0.34 | 86.21 ± 1.76 | 79.29 ± 1.50 | 89.37 ± 0.55 | |
| 4 | 82.41 ± 0.52 | 81.77 ± 0.30 | 85.12 ± 1.99 | 79.65 ± 1.06 | 89.28 ± 0.14 | |
| 5 | 82.35 ± 0.56 | 81.99 ± 0.14 | 83.47 ± 3.55 | 81.20 ± 2.52 | 89.31 ± 0.06 | |
| 6 | 82.58 ± 0.33 | 81.83 ± 0.36 | 85.83 ± 2.57 | 79.27 ± 2.20 | 89.24 ± 0.18 |
| Model | Accuracy (%) | F1-Score (%) | Specificity (%) | Sensitivity (%) | AUC-ROC (%) |
|---|---|---|---|---|---|
| Bi-LSTM | 61.37 ± 0.16 | 64.90 ± 0.31 | 50.80 ± 1.26 | 72.15 ± 1.09 | 66.41 ± 0.38 |
| 2D CNN | 75.88 ± 0.94 | 73.94 ± 2.44 | 81.83 ± 10.07 | 69.80 ± 9.61 | 83.08 ± 1.68 |
| DML + NN (256 dimensions) | 74.78 ± 0.39 | 75.62 ± 0.41 | 75.24 ± 1.21 | 76.18 ± 0.31 | 79.60 ± 0.57 |
| DML + NN (10 dimensions) | 79.49 ± 0.60 | 78.36 ± 0.63 | 83.87 ± 0.82 | 75.03 ± 0.72 | 83.83 ± 1.60 |
| DML + ANFIS | 79.48 ± 0.17 | 77.34 ± 0.23 | 88.07 ± 0.23 | 70.72 ± 0.40 | 86.38 ± 0.11 |
| DML + ANFIS | 82.79 ± 0.33 | 82.01 ± 0.34 | 86.21 ± 1.76 | 79.29 ± 1.50 | 89.37 ± 0.55 |
| Model | Bi-LSTM | 2D CNN | DML + NN-256 | DML + NN-10 | DML + ANFIS-10 |
|---|---|---|---|---|---|
| Learnable parameters | ~2,100,000 | ~163,800 | ~297,000 | ~68,400 | ~62,656 |
| Parameter memory | ~8.011 MB | ~0.625 MB | ~1.133 MB | ~0.261 MB | ~0.239 MB |
| Model | K | Accuracy (%) | F1-Score (%) | Specificity (%) | Sensitivity (%) | AUC-ROC (%) |
|---|---|---|---|---|---|---|
| DML + ANFIS (10 dimensions) | 2 | 79.15 ± 0.61 | 77.84 ± 1.26 | 84.12 ± 2.53 | 74.08 ± 3.47 | 89.28 ± 0.57 |
| 3 | 78.36 ± 1.55 | 76.86 ± 1.97 | 83.88 ± 2.08 | 72.72 ± 3.24 | 88.07 ± 0.87 | |
| 4 | 78.75 ± 1.70 | 76.88 ± 2.25 | 85.87 ± 0.86 | 71.49 ± 3.34 | 89.08 ± 1.36 | |
| 5 | 80.21 ± 1.34 | 79.19± 1.56 | 84.19 ± 1.40 | 76.14 ± 2.20 | 89.97 ± 1.26 | |
| 6 | 78.78 ± 1.17 | 77.73 ± 1.24 | 82.67 ± 1.35 | 74.81 ± 1.40 | 88.98 ± 0.90 |
| Model | Accuracy (%) | F1-Score (%) | Specificity (%) | Sensitivity (%) | AUC-ROC (%) |
|---|---|---|---|---|---|
| Bi-LSTM | 66.68 ± 1.39 | 69.36 ± 0.46 | 57.36 ± 4.65 | 76.19 ± 2.07 | 72.45 ± 2.00 |
| 2D CNN | 75.41 ± 0.66 | 76.41 ± 0.62 | 70.48 ± 2.79 | 80.45 ± 2.23 | 83.38 ± 0.54 |
| DML + NN (256 dimensions) | 75.17 ± 0.52 | 76.25 ± 0.63 | 69.11 ± 1.44 | 80.83 ± 0.80 | 76.68 ± 0.74 |
| DML + NN (10 dimensions) | 76.96 ± 0.97 | 77.09 ± 0.79 | 75.68 ± 1.86 | 78.27 ± 0.64 | 78.45 ± 0.87 |
| DML + ANFIS | 77.70 ± 0.94 | 78.48 ± 0.28 | 73.35 ± 4.34 | 82.13 ± 2.60 | 85.24 ± 1.01 |
| DML + ANFIS | 80.21 ± 1.34 | 79.19 ± 1.56 | 84.19 ± 1.40 | 76.14 ± 2.20 | 89.97 ± 1.26 |
| Model | Bi-LSTM | 2D CNN | DML + NN-256 | DML + NN-10 | DML + ANFIS-10 |
|---|---|---|---|---|---|
| Learnable parameters | ~4,700,000 | ~368,700 | ~714,000 | ~82,000 | ~76,360 |
| Parameter memory | ~17.9 MB | ~1.407 MB | ~2.724 MB | ~0.313 MB | ~0.291 MB |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Jo, A.-H.; Kwak, K.-C. Major Depressive Disorder Diagnosis Using Time–Frequency Embeddings Based on Deep Metric Learning and Neuro-Fuzzy from EEG Signals. Appl. Sci. 2026, 16, 324. https://doi.org/10.3390/app16010324
Jo A-H, Kwak K-C. Major Depressive Disorder Diagnosis Using Time–Frequency Embeddings Based on Deep Metric Learning and Neuro-Fuzzy from EEG Signals. Applied Sciences. 2026; 16(1):324. https://doi.org/10.3390/app16010324
Chicago/Turabian StyleJo, A-Hyeon, and Keun-Chang Kwak. 2026. "Major Depressive Disorder Diagnosis Using Time–Frequency Embeddings Based on Deep Metric Learning and Neuro-Fuzzy from EEG Signals" Applied Sciences 16, no. 1: 324. https://doi.org/10.3390/app16010324
APA StyleJo, A.-H., & Kwak, K.-C. (2026). Major Depressive Disorder Diagnosis Using Time–Frequency Embeddings Based on Deep Metric Learning and Neuro-Fuzzy from EEG Signals. Applied Sciences, 16(1), 324. https://doi.org/10.3390/app16010324

