Next Article in Journal
Functionalized Metal–Organic Frameworks Integrated with Plasmonic Nanoparticles: From Synthesis to Applications
Previous Article in Journal
A Portable Dual-Mode Microfluidic Device Integrating RT-qPCR and RT-LAMP for Rapid Nucleic Acid Detection in Point-of-Care Testing
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Hybrid CNN-SVM Approach for ECG-Based Multi-Class Differential Diagnosis of PTSD, Depression, and Panic Attack

by
Parisa Ebrahimpour Moghaddam Tasouj
1,*,
Gökhan Soysal
2,*,
Osman Eroğul
3 and
Sinan Yetkin
4
1
Biomedical Device Technology, Vocational School of Health Services, Ankara Medipol University, Ankara 06050, Türkiye
2
Department of Electrical and Electronics Engineering, Ankara University, Ankara 06830, Türkiye
3
Department of Biomedical Engineering, TOBB University of Economics and Technology, Ankara 06510, Türkiye
4
Department of Psychiatry, Ankara Gülhane Health Application and Research Hospital, University of Health Sciences, Ankara 06010, Türkiye
*
Authors to whom correspondence should be addressed.
Biosensors 2026, 16(1), 52; https://doi.org/10.3390/bios16010052
Submission received: 2 November 2025 / Revised: 28 December 2025 / Accepted: 5 January 2026 / Published: 10 January 2026
(This article belongs to the Section Biosensors and Healthcare)

Abstract

Background: PTSD diagnosis is challenging. Symptoms overlap with depression and panic attacks. This causes misdiagnosis and delayed treatment. Current methods lack objective biomarkers. This study presents a hybrid AI framework. It combines CNNs and SVMs. The system detects PTSD from ECG signals. Methods: ECG data from 79 participants were analyzed. Four groups were included. PTSD patients numbered 20. Depression patients numbered 20. Panic attack patients numbered 19. Healthy controls numbered 20. Wavelet transform created scalograms. Three CNN models were tested. AlexNet, GoogLeNet, and ResNet50 were used. Deep features were extracted. SVMs classified the features. Five-fold validation was performed. Statistical tests confirmed significance. Results: Hybrid models performed robustly. ResNet50 + SVM and AlexNet + SVM achieved statistically equivalent results with accuracies of 97.05% and 97.26%, respectively. AUC reached 1.00 for multi-class tasks. PTSD detection was highly accurate. The system distinguished PTSD from other disorders. Hybrid models beat standalone CNNs. SVM integration improved results significantly. Conclusions: This is the first ECG-based AI for PTSD diagnosis. The hybrid approach achieves clinical-level accuracy. PTSD is distinguished from depression and panic attacks. Objective biomarkers support psychiatric assessment. Early intervention becomes possible.

1. Introduction

Post-traumatic stress disorder (PTSD) represents one of the most debilitating psychiatric conditions, characterized by intrusive re-experiencing, avoidance behaviors, negative alterations in cognition and mood, and hyperarousal symptoms [1]. Recent studies show that about 3.6% of adults in the U.S. experience PTSD each year, while lifetime prevalence is estimated at 6.8% in the U.S. and 3.9% across the world population [2]. Women are disproportionately affected by PTSD, with lifetime prevalence nearly twice as high in women (10–12%) as in men (5–6%). A similar disparity is evident in adolescence, where prevalence is 8.0% for females compared to 2.3% for males [3]. PTSD imposes a substantial economic burden, with annual costs reaching 232.2 billion in the United States [4], while European data demonstrates healthcare expenditures three times higher than controls, with lifetime costs approximating €43,000 per patient [5].
The clinical differentiation of PTSD presents significant diagnostic challenges due to substantial symptom overlap with panic attacks and major depressive disorder [6]. Post-traumatic stress disorder (PTSD) and panic attacks are pretty similar in terms of autonomic symptoms; panic attacks are reported as a secondary symptom in approximately 30–60% of PTSD patients [7]. The diagnostic complexity is further amplified by PTSD’s substantial comorbidity with major depressive disorder, as approximately 52% of individuals with PTSD meet criteria for comorbid depression, while 36–61% of patients presenting with primary depression harbor undiagnosed PTSD [8,9,10]. The diagnostic confusion stems from shared symptom clusters including anhedonia, emotional numbing, sleep disturbances, concentration difficulties, and social withdrawal [11]. Patients with dual PTSD-depression diagnoses exhibit reduced treatment response rates and longer recovery trajectories [12]. This diagnostic overlap necessitates sophisticated approaches to differential diagnosis, as misclassification can lead to suboptimal treatment selection [13].
The diagnostic confusion stems from convergent effects on shared cardiovascular pathways, particularly through dysregulation of the hypothalamic-pituitary-adrenal (HPA) axis and sympathoadrenal system [14]. Meta-analytic evidence demonstrates that PTSD confers a 55–61% increased risk of coronary heart disease [15], with all three disorders triggering excessive catecholamine release, resulting in identical acute cardiovascular manifestations including elevated heart rate, blood pressure fluctuations, and altered heart rate variability [16]. While anxiety states activate both HPA and sympathoadrenal axes simultaneously, panic attacks demonstrate predominant sympathetic activation with minimal HPA involvement [17]. The chronic dysregulation leads to sustained cardiovascular risk through endothelial dysfunction, accelerated atherosclerosis, increased inflammatory marker expression, and altered autonomic nervous system balance [18]. Recent research utilizing the Trier Social Stress Test reveals that PTSD patients exhibit blunted acute stress responses with slower cardiovascular recovery and reduced heart rate variability [19]. These shared pathophysiological mechanisms underscore the need for objective, signal-based diagnostic approaches [20].
The emergence of deep learning (DL) technologies has revolutionized psychiatric disorder classification by providing unprecedented capabilities to extract complex patterns from neuroimaging and physiological signals [21]. Recent studies have demonstrated the effectiveness of deep learning techniques in detecting cardiovascular diseases, identifying ECG arrhythmias, and performing automated health classification [22,23,24,25,26].
Recent bibliometric analyses reveal rapid growth in DL applications for mental health disorders, with over 2811 research publications demonstrating CNN accuracies exceeding 98% for depression, schizophrenia, and anxiety disorders [27,28]. Neuroimaging-based DL approaches utilizing EEG, fMRI, and structural MRI have demonstrated remarkable success, with CNN-LSTM hybrid architectures showing superior performance in capturing both spatial and temporal features [29,30]. Multimodal deep learning algorithms analyzing EEG, fNIRS, and neuroimaging data yielded significant results, achieving 97.26% classification accuracy for schizophrenia detection and 94.34% for generalized anxiety disorder [31,32]. However, current DL approaches face significant limitations, including small heterogeneous datasets, lack of external validation, and the inability to effectively differentiate between disorders with overlapping symptomologies such as PTSD, depression, and panic attacks [33]. This technological gap highlights the urgent need for innovative DL methodologies [34].
Despite remarkable achievements in psychiatric disorder classification through neuroimaging, ECG-based DL for PTSD detection remains largely unexplored [35]. While existing research has successfully utilized DL for cardiac pathology detection, psychiatric applications remain predominantly confined to binary PTSD versus control classification [36,37]. CWT emerges as the optimal solution, generating scalogram representations that simultaneously preserve time localization and frequency decomposition, creating rich visual patterns that CNNs can effectively process [38]. The scalogram representation maintains non-stationary characteristics of cardiac signals, captures transient events crucial for psychiatric state identification, and provides multi-resolution analysis across different time scales [39]. Recent methodological advances demonstrate that CWT-based scalograms enable CNNs to achieve superior performance in cardiac signal classification tasks [40]. However, current ECG-based psychiatric classification research faces significant limitations, including a focus on binary classification and the absence of comprehensive frameworks for distinguishing between overlapping psychiatric conditions [41].
Despite recent advances in artificial intelligence applications for mental health diagnostics, prior studies have predominantly focused on binary classification tasks (e.g., PTSD vs. control) and have not fully leveraged ECG-based features for multi-class differentiation. In addition, no comprehensive framework currently integrates time–frequency representations with hybrid deep and machine learning architectures to address overlapping psychiatric conditions.
To address these critical research gaps, this study introduces the first comprehensive framework for ECG-based multi-class psychiatric disorder classification through two key innovations. First, we develop a deep learning system capable of simultaneously differentiating PTSD, depression, panic attacks, and healthy control states from ECG signals, advancing beyond existing binary classification approaches to clinically relevant differential diagnosis. Second, we propose a novel hybrid CNN-SVM architecture that combines ResNet50’s automatic feature extraction with SVM’s robust classification performance, enhanced through PCA for optimal dimensionality reduction. This hybrid approach transforms CWT-derived scalograms into discriminative features that outperform individual CNN or traditional machine learning methods. Our framework employs rigorous 5-fold cross-validation and explores multiple ECG segment lengths to optimize diagnostic accuracy.
The main contributions of this study are summarised as follows:
  • A novel multi-class ECG-based diagnostic framework is introduced for differentiating PTSD, major depression, panic disorder, and healthy controls, addressing a gap left by prior binary classification studies.
  • Time–frequency representations (CWT-based scalograms) are used to capture patterns of autonomic dysregulation relevant to psychiatric conditions.
  • Multiple deep learning architectures (AlexNet, GoogLeNet, ResNet50) are systematically compared for the multi-class psychiatric ECG classification task.
  • A hybrid CNN–SVM pipeline enhanced by PCA is proposed to combine automatic deep feature extraction with robust machine-learning discrimination.
  • Four ECG segment durations (5 s, 10 s, 15 s, 20 s) are evaluated to investigate the effect of temporal resolution on diagnostic accuracy.
  • A comprehensive evaluation is conducted using accuracy, precision, recall, F1-score, AUC, and confusion-matrix analyses to identify the best classifier and window length.

2. Materials and Methods

This dual-stage framework leverages direct CNN classification and CNN-based feature extraction combined with SVM classification to maximize diagnostic accuracy. Figure 1 depicts the framework, which consists of: first, raw ECG signals undergo normalization and baseline wander correction to eliminate low-frequency artifacts. Subsequently, the signals are segmented into fixed lengths suitable for time-frequency analysis. In the next stage, the CWT is applied to each segment to generate scalogram images that encode both temporal and spectral characteristics. These scalograms are fed into pre-trained convolutional neural networks (AlexNet, GoogLeNet, and ResNet50) for direct multi-class classification. In parallel, the CNN architectures are employed as feature extractors within a hybrid classification approach. Extracted features are standardized using Z-score normalization and reduced via Principal Component Analysis (PCA) before classification with a Support Vector Machine (SVM).

2.1. Dataset and Participants

ECG recordings were obtained from Gülhane Education and Research Hospital (2017–2022) under ethics approval (2024/25). All participants were psychiatrically evaluated and classified into PTSD (n = 20), depression (n = 20), panic attack (n = 19), and healthy control (n = 20) groups.
All ECG recordings were reviewed by a cardiologist to verify technical signal quality (baseline stability, adequate signal-to-noise ratio, minimal artifacts). All 79 recordings met quality standards. This technical validation was independent of psychiatric diagnosis confirmation by psychiatrists. Data were sampled at 200 Hz with electrode impedance 10 kΩ. The dataset is based on 5-min ECG recordings. Each recording contains approximately 60,000 samples. The signals were divided into segments of 5, 10, 15, and 20 s to generate scalogram images. This segmentation process resulted in a significant increase in the total number of images. The number of samples and scalograms for each segment duration are provided in Table 1. For clarity, throughout the manuscript and figures, group labels are abbreviated as follows: PTSD = Post-Traumatic Stress Disorder, DEPR = Major Depression, PANIK = Panic Disorder, and KONT = Healthy Control.
ECG signals are non-stationary signals, with high correlation between consecutive 5-s segments taken from the same person, not expected. 5-s intersegment correlation was calculated from a representative subject. As shown in Figure 2, the 60 × 60 correlation matrix shows that the average correlation is very low (−0.0038, std: 0.0943) and the segments can be evaluated independently.

2.2. Preprocessing

2.2.1. Artifact Removal

Baseline Wander represents a low-frequency interference component in ECG recordings that originates from external factors, physiological influences, and environmental noise sources. To address this issue, a finite impulse response (FIR) based high-pass zero-phase filter was implemented with a cutoff frequency set at 0.5 Hz. This filtering approach effectively eliminated low-frequency noise components from the acquired signals. Subsequently, the filtered data underwent Z-score standardization for amplitude normalization. Z-score standardization serves as a crucial preprocessing technique that harmonizes signal magnitudes across different recordings. This normalization strategy facilitates the analysis of heterogeneous signals within a consistent analytical framework by eliminating inter-signal amplitude discrepancies. The implementation of this preprocessing pipeline ensures signal homogeneity and enhances the reliability of subsequent analytical procedures.

2.2.2. Continuous Wavelet Transform (CWT)

CWT helps us to use time-frequency features together by converting one-dimensional ECG signals into two-dimensional scalogram images. CWT effectively extracts non-stationary signal features by providing simultaneous time-frequency analysis of the signal. The resulting scalogram analyzes both low-frequency components (P and T waves) and high-frequency features (QRS complexes) by visualizing temporal frequency changes. CWT is [42]. Mathematically defined as follows:
C a , b = 1 a x ( t ) ψ * t b a d t
where a represents the scale parameter and b denotes the translation parameter. Various wavelet functions, including Bump, Morse, and Morlet wavelets, were evaluated for signal transformation. The Morlet wavelet demonstrated superior performance and was selected for this study due to its optimal frequency resolution characteristics. This transformation preserves both temporal and spectral information, making it particularly suitable for analyzing the dynamic characteristics of ECG signals.

2.3. CNN Training and Optimization

2.3.1. Stochastic Gradient Descent (SGD) Optimization

Stochastic Gradient Descent (SGD) is a widely used optimization algorithm in deep learning models. Unlike traditional gradient descent algorithms, SGD calculates gradient values using randomly selected mini-batch samples instead of the entire dataset in each iteration. This method significantly reduces computational cost for large datasets and lowers the risk of getting stuck in local minima due to its stochastic nature. SGD’s basic update rule allows movement in the direction of the cost function gradient in the parameter space. Momentum-enhanced SGD (SGDM) uses weighted averages of previous updates to reduce oscillations in the optimization process and provide more reliable convergence.In this study, the momentum coefficient β = 0.9 and learning rate α = 0.0001 was set:
v t = β v t 1 + α θ J ( θ )
θ = θ v t
where v t is the momentum vector, β is the momentum coefficient (e.g., 0.9), α is the learning rate (e.g., 0.0001), θ J ( θ ) is the gradient of the cost function, and θ is the parameter being updated [43].

2.3.2. Hyperparameters

In binary and multi-class classification, CNNs were carefully selected with hyperparameters during the training process to ensure optimum performance. A mini-batch size of 20 samples was used to balance computational efficiency with gradient estimation accuracy; this maintained stable convergence while providing sufficient stochastic noise to prevent overfitting.The maximum epoch limit was set to 8 iterations over the entire dataset to prevent excessive memorization of training patterns and ensure good generalization capability. Stochastic Gradient Descent with Momentum (SGDM) was selected as the optimization algorithm due to its ability to accelerate convergence and reduce oscillations in the loss landscape through the incorporation of previous gradient information. The learning rate was conservatively set to 0.0001 to ensure stable weight updates without overshooting optimal solutions, particularly important given the sensitivity of deep networks to parameter changes. Validation frequency was configured to evaluate model performance every 10 training steps, enabling early detection of overfitting and providing regular monitoring of generalization performance throughout the training process. Hyperparameters were selected empirically based on validation performance in preliminary experiments. Hyperparameters were tuned using 20-s segments with AlexNet, then applied to all other configurations without further tuning. Table 2 presents the hyperparameters employed during model training.
All experiments were conducted on a MacBook (Apple Inc., Cupertino, CA, USA) Pro (2019) with Intel Core i5 processor (1.4 GHz), 8 GB RAM, and Intel Iris Plus Graphics 645, using MATLAB R2023a. Table 3 summarizes the training and inference performance across all architectures and segment lengths. Training times decreased substantially with longer segments due to reduced sample counts, while all models achieved real-time inference capability (<0.5 s per 5-min ECG) on consumer-grade hardware without requiring GPU acceleration.

2.3.3. Cross-Validation

Cross-validation is a technique used to evaluate a model’s generalization performance by dividing the dataset into k equal parts. In each iteration, one part is reserved as the test set while the remaining k − 1 parts are used for training. This process is repeated k times to ensure each part is tested. The final accuracy is calculated as the average of all k fold accuracies, providing a more reliable estimate than a single train-test split [44]. The selection of k value is based on the bias-variance trade-off, and selecting the optimal k value by testing different values is a standard practice. In this study, k = 5 was selected for cross-validation.
Cross-validation helps evaluate how well a model performs. The dataset is divided into k equal parts. Each time, one part becomes the test set. The other k − 1 parts are for training. This repeats k times so every part gets tested once. We calculate the final accuracy by averaging all k results. This gives better estimates than splitting data only once. Choosing k depends on balancing bias and variance. Testing different k values is common practice. We used k = 5 in our study.
To prevent data leakage, cross-validation was performed at the participant level. In each fold, all segments from a given participant were assigned exclusively to either the training or the test set, ensuring no participant’s data appeared in both sets within any fold.

2.4. Principal Component Analysis (PCA)

Principal Component Analysis (PCA) is a statistical technique used for dimensionality reduction of high-dimensional data. PCA creates a hierarchical coordinate system by finding directions that capture the maximum variance in the data. The algorithm first obtains mean-centred data by subtracting the mean of the data matrix, then performs eigenvalue decomposition of the covariance matrix.
In this study, PCA was applied to high-dimensional feature vectors extracted from CNN fully connected layers, retaining 95% cumulative explained variance to ensure minimal information loss while reducing computational complexity and overfitting risk. For AlexNet, GoogLeNet, and ResNet50 models, dimensionality reduction rates of 72%, 66%, and 61% were achieved, respectively. The PCA is mathematically defined as:
X ¯ = 1 n i = 1 n X i
B = X X ¯
C = 1 n 1 B T B
C V = V D
T = B × V
where X ¯ is the mean of the data matrix X, B is the mean-centered data matrix, C is the covariance matrix, D is the diagonal matrix of eigenvalues, V contains the corresponding eigenvectors obtained from the eigendecomposition of C, and T represents the transformed data in the principal component space [45]. Table 4 presents the original feature dimensions and the reduced dimensions after PCA for various CNN models and segment lengths.

2.5. Evaluation Metrics for Multi-Class Classification

In multi-class classification problems, performance evaluation employs micro and macro averaging approaches, which offer different computational methods and perspectives. The micro averaging approach aggregates the TP, TN, FP, and FN values across all classes to compute a single metric. In this approach, class sizes (sample counts) influence the results, with larger classes carrying greater weight. The macro averaging approach, conversely, calculates metrics separately for each class and then takes the arithmetic mean of these metrics. Grandini et al. [46] provided a comprehensive examination of multi-class classification metrics. This method is independent of class sizes and provides a balanced evaluation by assigning equal weight to each class.

3. Results

3.1. Multi-Class Classification Performance

Three different CNN architectures were evaluated for PTSD, depression, panic attacks, and multi-class classification of healthy control groups at varying segment lengths. The AlexNet model achieved an overall accuracy of 94.85% with an MCC value of 0.93 (Table 5). The GoogLeNet model showed improved performance, yielding an accuracy of 96.14% and an MCC of 0.95 (Table 6). The ResNet50 model achieved the highest performance on 5-s segments, with an overall accuracy of 96.65%, an MCC value of 0.96, and a micro-AUC of 0.998 (Table 7). In PTSD classification, ResNet50 provided the best metrics, achieving an accuracy of 95.70%, a sensitivity of 94.67%, and a false positive rate of 4.30%.
Three CNN architectures were tested. These classified individuals with PTSD, depression, panic attacks, and healthy individuals. Different segment lengths were tried. ResNet50 yielded the best results. This model worked with 5-s segments. Overall accuracy was 96.65%. The MCC value was 0.96, and the micro-AUC value was 0.998. GoogLeNet showed different results. This model had an accuracy of 96.14% and an MCC value of 0.95. AlexNet performed worse, with an accuracy of 94.85% and an MCC value of 0.93. In PTSD classification, ResNet50 stood out. Accuracy was 95.70%, sensitivity was 94.67%, and the false positive rate was 4.30%. Clinically significant FOR values remained low in all models, ranging from 1.49% to 1.94%. This indicates a very low risk of missing PTSD cases. In all models, MCC values were above 0.92, indicating the strong correlation required for a psychiatric diagnosis. All models yielded the best results in 5-s segments. Performance decreased as segment duration increased. This finding is consistent with the acute cardiovascular features of PTSD attacks and supports the clinical significance of short ECG analysis windows.

3.2. Hybrid CNNs-SVM Multi-Class Classification

To further strengthen classification robustness, features extracted by CNN architectures were integrated with SVM classifiers following PCA dimensionality reduction. This hybrid approach combines the deep feature learning capacity of convolutional neural networks with the discriminative power of support vector machines, demonstrating superior performance in multi-class psychiatric disorder discrimination tasks.
SVM Configuration: Multi-class classification employed Error-Correcting Output Codes (ECOC) with linear kernel binary learners (MATLAB fitcecoc). Linear kernel was selected for its computational efficiency and appropriateness for PCA-transformed feature space. Features were standardized using Z-score normalization before PCA dimensionality reduction (95% variance retention), then classified via SVM.
The hybrid models consistently improved performance compared to CNN-only configurations across all segment lengths, with particularly pronounced advantages for shorter temporal segments. Notably, 5-s segments showed the most distinct class separations in PCA space, with each psychiatric condition forming well-defined clusters. As segment length increased to 20 s, class boundaries became increasingly diffuse, highlighting the critical impact of temporal resolution on feature extraction quality from ECG scalograms.
Figure 3 illustrates the PCA visualization of ResNet50 features across different ECG segment lengths, revealing the critical impact of temporal resolution on classification performance. In 5-s segments (a), the four psychiatric classes form remarkably distinct clusters in PCA space, with depression (blue) creating a compact cluster in the lower right, control group (red) concentrated in the lower left, panic attack (yellow) positioned in the middle right, and PTSD (purple) clearly separated in the upper left region. As segment length increases to 10 s (b), class separations remain preserved but cluster boundaries begin to soften slightly. At 15 s (c), inter-class distinctions show more pronounced degradation, particularly between control and depression groups, while PTSD maintains its characteristic position. In 20-s segments (d), inter-class overlaps reach maximum levels with all groups exhibiting more diffuse distributions, though general class tendencies are still preserved. This progressive degradation emphasizes that cardiovascular manifestations of psychiatric disorders require short-duration, high-resolution analysis for optimal discrimination.
For AlexNet + SVM, the best performance was obtained with 5 s segments, achieving 97.26% overall accuracy, 0.96 MCC, and a micro-AUC of 1.00 (Table 8). PTSD classification reached 95.95% precision and 96.91% recall, with a low FDR of 4.04%, highlighting the model’s ability to minimize false negatives. Performance gradually decreased with longer durations, with accuracy dropping to 90.97% and MCC to 0.88 at 20 s.
Similarly, GoogleNet + SVM achieved its peak performance at 5 s with 96.35% accuracy, 0.95 MCC, and 0.99 micro-AUC (Table 9). Precision and recall for PTSD were 94.20% and 94.83%, respectively. Despite robust results, a noticeable decline was observed for 15 s and 20 s, where accuracy fell to 91.33% and 90.31%, confirming the importance of short-segment ECG windows.
The ResNet50 + SVM hybrid achieved the best overall performance. With 5 s segments, it reached 97.05% accuracy, 0.97 MCC, and a nearly perfect micro-AUC of 1.00 (Table 10). PTSD classification yielded 95.98% precision and 95.50% recall, with the lowest FDR (1.29%) among all models. Although performance slightly declined at longer durations (overall accuracy 91.48% at 20 s), the hybrid ResNet50 maintained consistently higher MCC values compared to AlexNet and GoogleNet.
The confusion matrices in Figure 4 illustrate that ResNet50 + SVM provided the clearest class separation with 5 s segments, while misclassifications increased at 10–20 s. Corresponding ROC curves in Figure 5 confirmed near-perfect separability at 5 s, with only minor reductions at longer durations. In summary, the CNNs-SVM hybrids demonstrated superior stability and generalization over CNN-only models. Among them, ResNet50 + SVM emerged as the most reliable, combining strong precision–recall balance with minimal false discovery rates. These findings highlight the potential of hybrid frameworks as clinically meaningful diagnostic tools for psychiatric ECG analysis, especially in minimizing the risk of missing PTSD cases.

3.3. Statistical Analysis

3.3.1. Statistical Significance Analysis of Resnet + SVM vs. CNN Models

The statistical significance of the observed performance differences was evaluated in Table 11. Paired t-tests and Wilcoxon tests were applied to the 5-fold cross-validation results. When the effect of SVM integration was examined, a 0.49% improvement (p = 0.009) for ResNet50 and a 2.41% improvement (p = 0.007) for AlexNet were found to be statistically significant, while no significant improvement was observed for GoogLeNet (p = 0.548). In comparing the hybrid models, AlexNet + SVM achieved the highest accuracy (97.26%) and performed marginally better than ResNet50 + SVM (97.05%) (p = 0.037). The difference between ResNet50 + SVM and GoogLeNet + SVM was not statistically significant (p = 0.086). These results confirm that SVM integration provides real performance gains, especially for ResNet50 and AlexNet architectures.

3.3.2. McNemar’s Test for Prediction-Level Comparison on Hybrid CNN + SVM Models

To complement fold-level paired tests, we performed McNemar’s tests comparing prediction-level disagreements between models. Table 12 presents the results.
McNemar’s test revealed no significant difference between ResNet50 + SVM and AlexNet + SVM (p = 0.502), indicating statistically equivalent performance despite the 0.21% mean accuracy difference. Both models significantly outperformed GoogLeNet + SVM (p < 0.05).

3.4. Error Analysis and Misclassification Patterns

Error analysis was performed on hybrid CNN + SVM models with 5-s segments. These results are shown in Table 13. PTSD-Control confusion was most pronounced, while PTSD-Depression and PTSD-Panic confusions were minimal. AlexNet + SVM and Resnet50 + SVM showed the best overall discrimination. This confirms the specificity of ECG biomarkers in differentiating PTSD from other psychiatric disorders. Based on these results, PTSD is confused with the control group, and depression and panic attacks are also confused with each other.

3.5. Performance of Traditional Machine Learning Approaches

Table 14 presents the performance of conventional machine learning approaches using handcrafted statistical features extracted from ECG signals. These features include amplitude-based parameters (peak value, RMS, mean), variation measures (standard deviation, skewness, kurtosis), signal geometry descriptors (shape factor, crest factor, clearance factor, impulse factor), and signal quality metrics (SNR, SINAD, THD). All features were computed in MATLAB and selected based on their established effectiveness in biomedical signal processing for distinguishing pathological and healthy ECG patterns [35].
Traditional machine learning approaches achieved overall accuracies ranging from 32–44%, barely exceeding chance performance (25% for 4-class classification). The best-performing traditional method, Linear SVM, achieved 44.30% accuracy, while the worst-performing method, Neural Network, achieved only 31.65%.
The ROC analysis in Figure 6 clearly demonstrates the performance differences between classes. AUC values range from 0.405 to 0.791. The highest performance was obtained for the control class in the ensemble model with an AUC of 0.791. The lowest performance was observed for the PTSD class in the Three-Layer Neural Network with an AUC of 0.405. This wide performance range reflects the complexity of multiple classifications. These results demonstrate the necessity of deep learning for this complex multi-class psychiatric classification task, as our proposed hybrid CNN-SVM approach achieves approximately twice the accuracy compared to conventional methods.

4. Discussion

This study is based on ECG recordings from 79 participants in a single center. Collecting psychiatric ECG datasets is challenging, even for retrospective data, due to ethical constraints, expert requirements, and multicenter validation processes. Despite this limitation, the model demonstrated stable performance in layered cross-validation. To address potential data leakage concerns, we employed strict subject-wise cross-validation ensuring no participant’s segments appeared in both training and validation sets. However, our study lacks an independent test set, representing an inherent trade-off given our limited sample size. The reported performance reflects internal validation rather than true external generalization. Future studies will focus on multicenter external validation to establish clinical generalizability and assess model robustness across diverse populations.
Hyperparameters were tuned on one configuration (20 s-AlexNet) and applied to others. Nested cross-validation would provide more conservative estimates, but was computationally prohibitive. However, our best performance came from an untested configuration (5 s-ResNet50: 97.05% vs. 20 s-AlexNet: 91.48%), mitigating concerns about overfitting.
The second important aspect is longitudinal ECG monitoring. Repeated recordings or wearable measuring devices make it possible to assess temporal symptom dynamics and treatment response. This addresses the limitation of the single-session 5-min recordings used in this study. However, our approach partially compensates for this deficiency by dividing the 5-min ECG into shorter segments. These shorter windows capture more subtle autonomous changes and allow CNN models to extract deeper time-frequency features.
Explainability remains an open problem in deep learning. Current attribution methods do not provide fully reliable physiological interpretations for clinical decision-making. Future studies will integrate SHAP-based feature attribution and waveform-level analyses to better understand the cardiac dynamics driving model decisions. Recent studies have explored multimodal physiological fusion combining ECG with phonocardiogram (PCG), electrodermal activity (EDA), respiration, or accelerometry. The reference BSPC study [47] demonstrates that integrating complementary modalities increases feature diversity. However, these approaches require multiple synchronous physiological signals that are not routinely accessible in standard psychiatric clinics. Our study deliberately focused on a single-modality ECG framework to assess whether autonomous signatures alone carry sufficient discriminatory information for multiclass psychiatric discrimination. This design is consistent with the practical limitations of real-world psychiatric assessment, where ECG is often the only routine physiological signal collected. However, multimodal fusion represents a valuable future direction, particularly for capturing complementary autonomous and behavioral markers.
In terms of computational feasibility, the model was trained and tested on a standard CPU-based workstation (Intel Core i5, 8 GB RAM) without GPU acceleration. Despite the modest hardware, inference per scalogram required only tens of milliseconds, demonstrating suitability for real-time or near-real-time deployment in future devices. This system is not designed as a standalone diagnostic tool, but rather as a decision support tool that can complement existing scales such as PCL-5, HAM-D, and clinical interviews.

5. Conclusions

This study presents, for the first time, a hybrid CNN-SVM approach based on ECG signals for differentiating PTSD, depression, and panic attacks. The method yielded diagnostic accuracy exceeding 97%. ResNet50+SVM and AlexNet+SVM models showed similar performance. Scalogram representations enabled simultaneous time-frequency analysis. CNN architectures extracted complex physiological features that couıd be found manually. Five-second ECG segments were found to be optimal for capturing abrupt cardiovascular changes associated with psychiatric symptoms. Multiclass classification successfully differentiated PTSD from depression and panic attacks. Error analysis showed minimal confusion between PTSD and other psychiatric disorders. PTSD-Control interference was the main error pattern, confirming that these ECG biomarkers are objective diagnostic indicators. The hybrid CNN-SVM framework goes beyond existing binary classification approaches and offers a clinically ready diagnostic support system. This study lays a methodological foundation for future psychiatric disorder detection using cardiovascular biomarkers, enabling early intervention and reducing misdiagnosis rates.

6. Future Work

Future research will focus on enhancing the interpretability of the proposed hybrid CNN–SVM framework through explainable artificial intelligence (XAI) methods such as SHAP (SHapley Additive exPlanations) analysis. This will allow the identification of the most discriminative ECG-derived features contributing to PTSD, depression, and panic attack classification, providing physiological insight into disorder-specific cardiac dynamics. Additionally, extending the dataset to include larger and more diverse populations, as well as testing model generalizability across multi-center ECG databases, will further validate its clinical applicability. Integrating real-time analysis modules into portable ECG monitoring systems may also facilitate early detection and continuous psychiatric assessment in clinical settings. Longitudinal ECG datasets will also be incorporated in future research to enable monitoring of symptom evolution and clinical recovery trajectories. Future studies may also examine multimodal fusion (e.g., ECG + EDA or ECG + respiration), particularly in settings where additional physiological channels can be acquired reliably. Finally, future studies will explore nested cross-validation frameworks with separate inner and outer loops to enable more robust hyperparameter optimization and unbiased performance estimation, particularly in larger and more diverse datasets.

Author Contributions

Conceptualization, P.E.M.T. and G.S.; methodology, G.S. and O.E.; software, P.E.M.T.; validation, P.E.M.T. and S.Y.; writing—original draft, P.E.M.T.; writing—review and editing, G.S. and O.E.; supervision, G.S. All authors have read and agreed to the published version of the manuscript.

Funding

This research was conducted without any external funding sources.

Institutional Review Board Statement

The research was carried out in compliance with the Declaration of Helsinki and received approval from the Non-Interventional Scientific Research Ethics Committee of Gülhane Education and Research Hospital (protocol number 2024/25) on 12 September 2024.

Informed Consent Statement

Due to the retrospective design of this study, obtaining informed consent from all subjects was not mandatory.

Data Availability Statement

The dataset analyzed in this study is unavailable for public release owing to ethical and privacy constraints.

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
ECGElectrocardiogram
CWTContinuous Wavelet Transform
CNNConvolutional Neural Network
SGDStochastic Gradient Descent
SGDMStochastic Gradient Descent with Momentum
PCAPrincipal Component Analysis
MCCMatthews Correlation Coefficient
AUCArea Under the Curve
FDRFalse Discovery Rate
FORFalse Omission Rate
PTSDPost-Traumatic Stress Disorder
HzHertz
FCFully Connected

References

  1. American Psychiatric Association. Diagnostic and Statistical Manual of Mental Disorders, 5th ed.Text Revision; American Psychiatric Association: Washington, DC, USA, 2022. [Google Scholar]
  2. Kessler, R.C.; Ratanatharathorn, A.; Ng, L.; McLaughlin, K.A.; Bromet, E.J.; Stein, D.J.; Karam, E.G.; Meron Ruscio, A.; Benjet, C.; Scott, K.; et al. Posttraumatic stress disorder in the World Mental Health Surveys. Psychol. Med. 2017, 47, 2260–2274. [Google Scholar] [CrossRef] [PubMed]
  3. Merikangas, K.R.; He, J.P.; Burstein, M.; Swanson, S.A.; Avenevoli, S.; Cui, L.; Benjet, C.; Georgiades, K.; Swendsen, J. Lifetime prevalence of mental disorders in U.S. adolescents: Results from the National Comorbidity Survey Replication–Adolescent Supplement (NCS-A). J. Am. Acad. Child Adolesc. Psychiatry 2010, 49, 980–989. [Google Scholar] [CrossRef] [PubMed]
  4. Davis, L.L.; Schein, J.; Cloutier, M.; Gagnon-Sanschagrin, P.; Maitland, J.; Urganus, A.; Guerin, A.; Lefebvre, P.; Houle, C.R. The economic burden of posttraumatic stress disorder in the United States from a societal perspective. J. Clin. Psychiatry 2022, 83, 21m14116. [Google Scholar] [CrossRef] [PubMed]
  5. Bothe, T.; Jacob, J.; Kröger, C.; Walker, J. How expensive are post-traumatic stress disorders? Estimating incremental health care and economic costs on anonymised claims data. Eur. J. Health Econ. 2020, 21, 917–930. [Google Scholar] [CrossRef]
  6. Tunnell, N.C.; Corner, S.E.; Roque, A.D.; Kroll, J.L.; Ritz, T.; Meuret, A.E. Biobehavioral approach to distinguishing panic symptoms from medical illness. Front. Psychiatry 2024, 15, 1296569. [Google Scholar] [CrossRef]
  7. Cackovic, C.; Nazir, S.; Marwaha, R. Panic disorder. In StatPearls; StatPearls Publishing: Treasure Island, FL, USA, 2023. [Google Scholar]
  8. Xu, W.; Yuan, H.; Wu, X.; Wang, W. Comorbidity patterns of posttraumatic stress disorder and depression symptoms: Cross-validation in two postearthquake child and adolescent samples. Depress. Anxiety 2023, 1, 4453663. [Google Scholar] [CrossRef]
  9. Fung, H.W.; Chien, W.; Lam, S.K.K.; Ross, C.A. Investigating post-traumatic stress disorder (PTSD) and complex PTSD among people with self-reported depressive symptoms. Front. Psychiatry 2022, 13, 953001. [Google Scholar] [CrossRef]
  10. Rytwinski, N.K.; Scur, M.D.; Feeny, N.C.; Youngstrom, E.A. The co-occurrence of major depressive disorder among individuals with posttraumatic stress disorder: A meta-analysis. J. Trauma Stress 2013, 26, 299–309. [Google Scholar] [CrossRef]
  11. Flory, J.D.; Yehuda, R. Comorbidity between post-traumatic stress disorder and major depressive disorder: Alternative explanations and treatment considerations. Dialogues Clin. Neurosci. 2015, 17, 141–150. [Google Scholar] [CrossRef]
  12. Dedert, E.A.; Calhoun, P.S.; Watkins, L.L.; Sherwood, A.; Beckham, J.C. Posttraumatic stress disorder, cardiovascular, and metabolic disease: A review of the evidence. Ann. Behav. Med. 2010, 39, 61–78. [Google Scholar] [CrossRef]
  13. Sripada, R.K.; Fassbinder, E.; Schaich, A.; Lee, C.W.; Boterhoven de Haan, K.; Rijkeboer, M.; Arntz, A. Differential effects of comorbid psychiatric disorders on treatment outcome in posttraumatic stress disorder from childhood trauma. J. Clin. Med. 2021, 10, 3708. [Google Scholar] [CrossRef] [PubMed]
  14. Sumner, J.A.; Cleveland, S.; Chen, T.; Gradus, J.L. Psychological and biological mechanisms linking trauma with cardiovascular disease risk. Transl. Psychiatry 2023, 13, 25. [Google Scholar] [CrossRef]
  15. Edmondson, D.; Kronish, I.M.; Shaffer, J.A.; Falzon, L.; Burg, M.M. Posttraumatic stress disorder and risk for coronary heart disease: A meta-analytic review. Am. Heart J. 2013, 166, 806–814. [Google Scholar] [CrossRef]
  16. Coughlin, S.S. Post-traumatic stress disorder and cardiovascular disease. Open Cardiovasc. Med. J. 2011, 5, 164–170. [Google Scholar] [CrossRef]
  17. Graeff, F.G. Anxiety, panic and the hypothalamic-pituitary-adrenal axis. Rev. Bras. Psiquiatr. 2007, 29, S3–S6. [Google Scholar] [CrossRef] [PubMed]
  18. Brudey, C.; Park, J.; Wiaderkiewicz, J.; Kobayashi, I.; Mellman, T.A.; Marvar, P.J. Autonomic and inflammatory consequences of posttraumatic stress disorder and the link to cardiovascular disease. Am. J. Physiol. Regul. Integr. Comp. Physiol. 2015, 309, R315–R321. [Google Scholar] [CrossRef]
  19. Renna, M.E.; Shrout, M.R.; Madison, A.A.; Bennett, J.M.; Malarkey, W.B.; Emery, C.F.; Kiecolt-Glaser, J.K. Distress disorder histories predict HRV trajectories during and after stress. Psychoneuroendocrinology 2022, 26, 775–778. [Google Scholar] [CrossRef]
  20. Niyas, A.M.; Haseefa, F.; Movahed, M.R.; Hashemzadeh, M. The occurrence of ST elevation myocardial infarction and non-STEMI in patients with post traumatic stress disorder using the large nationwide inpatient sample. Am. J. Cardiovasc. Dis. 2024, 14, 172–179. [Google Scholar] [CrossRef] [PubMed]
  21. Chen, L.; Xia, C.; Sun, H. Recent advances of deep learning in psychiatric disorders. Precis. Clin. Med. 2020, 3, 202–213. [Google Scholar] [CrossRef]
  22. Chen, Y.; Ye, J.; Li, Y.; Luo, Z.; Luo, J.; Wan, X. A Multi-Domain Feature Fusion CNN for Myocardial Infarction Detection and Localization. Biosensors 2025, 15, 392. [Google Scholar] [CrossRef]
  23. Cosoli, G.; Antognoli, L.; Scalise, L. Wearable Electrocardiography for Physical Activity Monitoring: Definition of Validation Protocol and Automatic Classification. Biosensors 2023, 13, 154. [Google Scholar] [CrossRef]
  24. Ghosh, S.; Kim, S.; Ijaz, M.F.; Singh, P.K.; Mahmud, M. Classification of Mental Stress from Wearable Physiological Sensors Using Image-Encoding-Based Deep Neural Network. Biosensors 2022, 12, 1153. [Google Scholar] [CrossRef] [PubMed]
  25. Liu, Y.; Li, Q.; Wang, K.; Liu, J.; He, R.; Yuan, Y.; Zhang, H. Automatic Multi-Label ECG Classification with Category Imbalance and Cost-Sensitive Thresholding. Biosensors 2021, 11, 453. [Google Scholar] [CrossRef] [PubMed]
  26. Yu, J.; Wang, X.; Chen, X.; Guo, J. Automatic Premature Ventricular Contraction Detection Using Deep Metric Learning and KNN. Biosensors 2021, 11, 69. [Google Scholar] [CrossRef]
  27. Sharma, C.M.; Chariar, V.M. Diagnosis of mental disorders using machine learning: Literature review and bibliometric mapping from 2012 to 2023. Heliyon 2024, 10, e32548. [Google Scholar] [CrossRef] [PubMed]
  28. Haley, F.; Andrews, J.; Moghaddam, N. Advancements and limitations: A systematic review of remote-based deep learning predictive algorithms for depression. J. Technol. Behav. Sci. 2024, 10, 514–527. [Google Scholar] [CrossRef]
  29. Shoeibi, A.; Sadeghi, D.; Moridian, P.; Ghassemi, N.; Heras, J.; Alizadehsani, R.; Khadem, A.; Kong, Y.; Nahavandi, S.; Zhang, Y.; et al. Automatic diagnosis of schizophrenia in EEG signals using CNN-LSTM models. Front. Neuroinform. 2021, 15, 777977. [Google Scholar] [CrossRef]
  30. Mughal, N.E.; Khan, M.J.; Khalil, K.; Javed, K.; Sajid, H.; Naseer, N.; Ghafoor, U.; Hong, K.S. EEG-fNIRS-based hybrid image construction and classification using CNN-LSTM. Front. Neurorobot. 2022, 16, 873239. [Google Scholar] [CrossRef]
  31. Liu, W.; Li, G.; Huang, Z.; Jiang, W.; Luo, X.; Xu, X. Enhancing generalized anxiety disorder diagnosis precision: MSTCNN model utilizing high-frequency EEG signals. Front. Psychiatry 2023, 14, 1310323. [Google Scholar] [CrossRef]
  32. Omar, A.; Kimwele, M.; Olowolayemo, A.; Kaburu, D.M. Enhancing EEG signals classification using LSTM-CNN architecture. Eng. Rep. 2024, 6, e12827. [Google Scholar] [CrossRef]
  33. Uyanik, H.; Sengur, A.; Salvi, M.; Tan, R.S.; Tan, J.H.; Acharya, U.R. Automated detection of neurological and mental health disorders using EEG signals and artificial intelligence: A systematic review. WIREs Data Min. Knowl. Discov. 2025, 15, e70002. [Google Scholar] [CrossRef]
  34. Abd-Alrazaq, A.; Alhuwail, D.; Schneider, J.; Toro, C.T.; Ahmed, A.; Alzubaidi, M.; Alajlani, M.; Househ, M. The performance of artificial intelligence-driven technologies in diagnosing mental disorders: An umbrella review. NPJ Digit. Med. 2022, 5, 87. [Google Scholar] [CrossRef] [PubMed]
  35. Ebrahimpour Moghaddam Tasouj, P.; Soysal, G.; Eroğul, O.; Yetkin, S. ECG signal analysis for detection and diagnosis of post-traumatic stress disorder: Leveraging deep learning and machine learning techniques. Diagnostics 2025, 15, 1414. [Google Scholar] [CrossRef] [PubMed]
  36. Anbalagan, T.; Nath, M.K. AF identification from time–frequency analysis of ECG signal using deep neural networks. IEEE Sens. Lett. 2024, 8, 6010604. [Google Scholar] [CrossRef]
  37. Qiu, C.; Li, H.; Qi, C.; Li, B. Enhancing ECG classification with continuous wavelet transform and multi-branch transformer. Heliyon 2024, 10, e26147. [Google Scholar] [CrossRef]
  38. Mashrur, F.; Islam, M.S.; Saha, D.K.; Islam, S.M.R.; Moni, M.A. SCNN: Scalogram-based convolutional neural network to detect obstructive sleep apnea using single-lead electrocardiogram signals. Comput. Biol. Med. 2021, 134, 104532. [Google Scholar] [CrossRef]
  39. Torres, M.E.; Colominas, M.A.; Schlotthauer, G.; Flandrin, P. A complete ensemble empirical mode decomposition with adaptive noise. In Proceedings of the IEEE International Conference on Acoustics, Speech and Signal Processing, Prague, Czech Republic, 22–27 May 2011; pp. 4144–4147. [Google Scholar] [CrossRef]
  40. Acharya, U.R.; Fujita, H.; Oh, S.L.; Hagiwara, Y.; Tan, J.H.; Adam, M. Application of deep convolutional neural network for automated detection of myocardial infarction using ECG signals. Inf. Sci. 2017, 415, 190–198. [Google Scholar] [CrossRef]
  41. Hannun, A.Y.; Rajpurkar, P.; Haghpanahi, M.; Tison, G.H.; Bourn, C.; Turakhia, M.P.; Ng, A.Y. Cardiologist-level arrhythmia detection and classification in ambulatory electrocardiograms using a deep neural network. Nat. Med. 2019, 25, 65–69. [Google Scholar] [CrossRef]
  42. Burrus, C.S.; Gopinath, R.A.; Guo, H. Wavelets and Wavelet Transforms; Prentice Hall Publications: Houston, TX, USA, 1998. [Google Scholar]
  43. Fjellström, C.; Nyström, K. Deep learning, stochastic gradient descent and diffusion maps. J. Comput. Math. Data Sci. 2022, 4, 100054. [Google Scholar] [CrossRef]
  44. Wong, T.-T.; Yeh, P.-Y. Reliable accuracy estimates from k-fold cross validation. IEEE Trans. Knowl. Data Eng. 2020, 32, 1586–1594. [Google Scholar] [CrossRef]
  45. Brunton, S.L.; Kutz, J.N. Data-Driven Science and Engineering: Machine Learning, Dynamical Systems, and Control; Cambridge University Press: Cambridge, UK, 2019. [Google Scholar]
  46. Grandini, M.; Bagli, E.; Visani, G. Metrics for multi-class classification: An overview. arXiv 2020, arXiv:2008.05756. [Google Scholar] [CrossRef]
  47. Li, P.; Huang, Y.; Liu, Z.P. Prediction of cardiovascular diseases by integrating multi-modal features with machine learning methods. Biomed. Signal Process. Control 2021, 66, 102474. [Google Scholar] [CrossRef]
Figure 1. CNNs-SVM framework. (Group abbreviations: PTSD = Post-Traumatic Stress Disorder, DEPR = Depression, PANIK = Panic Disorder, KONT = Healthy Control).
Figure 1. CNNs-SVM framework. (Group abbreviations: PTSD = Post-Traumatic Stress Disorder, DEPR = Depression, PANIK = Panic Disorder, KONT = Healthy Control).
Biosensors 16 00052 g001
Figure 2. Cross-segment correlation analysis between 5-s segments of the same person ECG signal.
Figure 2. Cross-segment correlation analysis between 5-s segments of the same person ECG signal.
Biosensors 16 00052 g002
Figure 3. ResNet50 + SVM hybrid model PCA visualization across different segment lengths ((a) 5 s, (b) 10 s, (c) 15 s, (d) 20 s).
Figure 3. ResNet50 + SVM hybrid model PCA visualization across different segment lengths ((a) 5 s, (b) 10 s, (c) 15 s, (d) 20 s).
Biosensors 16 00052 g003
Figure 4. ResNet50 + SVM hybrid model confusion matrices across different segment lengths ((a) 5 s, (b) 10 s, (c) 15 s, (d) 20 s).
Figure 4. ResNet50 + SVM hybrid model confusion matrices across different segment lengths ((a) 5 s, (b) 10 s, (c) 15 s, (d) 20 s).
Biosensors 16 00052 g004
Figure 5. ResNet50 + SVM hybrid model ROC curves and AUC values across different segment lengths. ((a) 5 s, (b) 10 s, (c) 15 s, (d) 20 s).
Figure 5. ResNet50 + SVM hybrid model ROC curves and AUC values across different segment lengths. ((a) 5 s, (b) 10 s, (c) 15 s, (d) 20 s).
Biosensors 16 00052 g005
Figure 6. ROC analysis examines the class-based performance of machine learning models in the multiple classification problem.
Figure 6. ROC analysis examines the class-based performance of machine learning models in the multiple classification problem.
Biosensors 16 00052 g006
Table 1. Scalogram counts by segment duration.
Table 1. Scalogram counts by segment duration.
Dur.SamplesScal./Rec.RecordsTotal
5 s100060794740
10 s200030792370
15 s300020791580
20 s400015791185
Table 2. Summary of hyperparameters used in neural network training.
Table 2. Summary of hyperparameters used in neural network training.
HyperparameterValueDescription
Mini-batch size20Balances gradient stability with computational efficiency.
Maximum epochs8Prevents overfitting and excessive memorization of training patterns.
OptimizerSGDMProvides stable convergence by incorporating momentum into gradient updates.
Learning rate0.0001Ensures stable and controlled weight updates for sensitive deep networks.
Momentum0.9 (default)Accelerates SGD updates and reduces oscillations.
Validation frequency10 iterationsEnables frequent monitoring of generalization performance.
Table 3. Computational Performance Summary.
Table 3. Computational Performance Summary.
Hardware: MacBook Pro (2019), Intel Core i5 1.4 GHz, 8 GB RAM, MATLAB R2023a
Training Performance (minutes per fold)
ModelTypeParams (M)5 s10 s15 s20 sTotal (5 s)
AlexNetCNN only60.9312216112.6 h
AlexNet + SVMHybrid *60.9 + SVM312216112.6 h
GoogLeNetCNN only6.9514629214.3 h
GoogLeNet + SVMHybrid *6.9 + SVM514629214.3 h
ResNet50CNN only25.5269121714922.4 h
ResNet50 + SVMHybrid *25.5 + SVM269121714922.4 h
ModelTypePer SegmentPer 5-min ECGReal-time
AlexNetCNN only11–13 ms∼0.7 s (60 seg)Yes
AlexNet + SVMHybrid11–13 ms∼0.7 s (60 seg)Yes
GoogLeNetCNN only18–21 ms∼1.2 s (60 seg)Yes
GoogLeNet + SVMHybrid18–21 ms∼1.2 s (60 seg)Yes
ResNet50CNN only24–28 ms∼1.5 s (60 seg)Yes
ResNet50 + SVMHybrid25–29 ms∼1.6 s (60 seg)Yes
Clinical Deployment Feasibility
Training: One-time cost of 2.6–22.4 h (5 s segments); pre-trained models deployable
Inference: Real-time capable (<2 s per 5-min ECG); CPU-only sufficient
Hardware: Consumer-grade laptop; no GPU required; model size: 98–240 MB
* Includes SVM training (<1 min), negligible compared to CNN time. 5 s segments used in this study (optimal accuracy); longer segments reduce training time. SVM classification adds ∼1 ms overhead per segment (negligible). 60 segments per 5-min ECG (300 s ÷ 5 s = 60 segments).
Table 4. Feature dimensions before and after PCA for CNN models.
Table 4. Feature dimensions before and after PCA for CNN models.
ModelFC Feature DimensionPCA Reduced Dimension
Training Set Test Set Training Set Test Set
AlexNet_5s3792 × 4096948 × 40963792 × 1149948 × 1149
AlexNet_10s1896 × 4096474 × 40961896 × 738474 × 738
AlexNet_15s1264 × 4096316 × 40961264 × 518316 × 518
AlexNet_20s948 × 4096237 × 4096948 × 436237 × 436
GoogleNet_5s3792 × 1024948 × 10243792 × 352948 × 352
GoogleNet_10s1896 × 1024474 × 10241896 × 306474 × 306
GoogleNet_15s1264 × 1024316 × 10241264 × 273316 × 273
GoogleNet_20s948 × 1024237 × 1024948 × 238237 × 238
Resnet50_5s3792 × 2048948 × 20483792 × 802948 × 802
Resnet50_10s1896 × 2048474 × 20481896 × 638474 × 638
Resnet50_15s1264 × 2048316 × 20481264 × 531316 × 531
Resnet50_20s948 × 2048237 × 2048948 × 448237 × 448
Table 5. AlexNet Multi-class Classification Performance Across Different Segment Lengths.
Table 5. AlexNet Multi-class Classification Performance Across Different Segment Lengths.
Segment LengthClassPrec. (%)Recall (%)Spec. (%)F1 (%)FDR (%)FOR (%)MCCAUCClass Acc. (%)Overall Acc. (%)Overall MCCMicro-AUC
5 sdepr96.2092.9198.7594.533.802.370.9270.99492.9194.850.930.994
kontrol95.0395.6698.3095.344.961.470.9380.99495.66
panik98.8195.2697.6694.027.171.510.9210.99395.26
ptsd92.8295.5898.4195.464.651.490.9390.99595.58
10 sdepr94.3393.8697.9694.105.672.220.9200.99293.8691.750.890.998
kontrol89.3391.6296.1990.4610.672.930.8710.98791.62
panik91.4492.4297.7891.938.571.940.8980.98992.42
ptsd91.8389.3097.0390.558.173.960.8710.98589.30
15 sdepr84.9894.7594.3289.6015.021.850.8600.98594.7589.430.860.967
kontrol87.4193.7595.4290.4712.592.170.8720.97493.75
panik93.9681.8498.3387.486.045.520.8420.96781.84
ptsd93.0587.0097.8089.926.954.310.8670.95487.00
20 sdepr88.2993.0095.8290.5811.712.420.8730.98493.0088.520.850.970
kontrol86.3288.3395.2587.3113.683.990.8300.96388.33
panik91.8286.6797.5689.178.184.150.8590.97386.67
ptsd88.0686.0096.0587.0211.954.710.8270.95886.00
Table 6. GoogleNet Multi-class Classification Performance Across Different Segment Lengths.
Table 6. GoogleNet Multi-class Classification Performance Across Different Segment Lengths.
Segment LengthClassPrec. (%)Recall (%)Spec. (%)F1 (%)FDR (%)FOR (%)MCCAUCClass Acc. (%)Overall Acc. (%)Overall MCCMicro-AUC
5 sdepr97.2298.9299.0498.062.780.370.9740.99898.9296.140.950.996
kontrol94.0195.4297.9494.715.991.560.9290.99595.42
panik98.6595.9799.5897.291.351.270.9650.99795.97
ptsd94.8894.2598.2894.575.121.940.9270.99594.25
10 sdepr86.6298.1794.8692.0313.380.650.8940.99298.1791.220.880.985
kontrol91.0992.0096.9591.548.912.720.8870.99092.00
panik97.7684.0499.3990.382.244.840.8800.97984.04
ptsd91.2590.3397.0690.798.753.270.8770.98790.33
15 sdepr90.0094.5096.4492.209.791.900.8970.98894.5090.820.880.982
kontrol87.7192.7595.5990.1612.292.490.8680.98292.75
panik93.6188.6898.0891.086.393.500.8840.98488.68
ptsd92.5787.2597.6389.837.434.210.8660.97587.25
20 sdepr87.8291.3395.7189.5412.182.980.8590.98691.3386.840.820.977
kontrol85.8683.0095.3784.4114.145.700.7930.97183.00
panik91.1186.3297.3388.658.894.260.8520.97786.32
ptsd83.0786.6794.0184.8316.934.590.7960.97386.67
Table 7. ResNet50 Multi-class Classification Performance Across Different Segment Lengths.
Table 7. ResNet50 Multi-class Classification Performance Across Different Segment Lengths.
Segment LengthClassPrec. (%)Recall (%)Spec. (%)F1 (%)FDR (%)FOR (%)MCCAUCClass Acc. (%)Overall Acc. (%)Overall MCCMicro-AUC
5 sdepr98.5898.0099.5298.291.420.680.9770.99898.0096.650.960.998
kontrol94.4295.8398.0895.125.581.420.9350.99695.83
panik97.9998.1699.3698.072.010.580.9750.99998.16
ptsd95.7094.6798.5695.184.301.800.9360.99694.67
10 sdepr94.7596.1798.1995.455.251.310.9390.99596.1794.770.930.994
kontrol92.9096.0097.5194.427.101.800.9230.99396.00
panik96.3395.3398.8395.833.671.580.9390.99495.33
ptsd94.5892.0098.3093.275.422.710.9110.99292.00
15 sdepr94.0095.0098.1094.506.001.500.9330.99395.0092.500.900.991
kontrol89.6092.0096.0090.7810.402.500.8900.98992.00
panik95.6792.6798.6794.144.332.330.9260.99292.67
ptsd90.8088.0097.0089.389.204.000.8760.98788.00
20 sdepr92.3393.0097.6792.667.673.000.9090.99193.0089.500.870.989
kontrol87.3389.0095.6788.1612.673.670.8610.98589.00
panik93.3390.6798.0091.986.673.330.9030.98790.67
ptsd87.6785.0096.6786.3112.335.000.8490.98385.00
Table 8. AlexNet + SVM Multi-class Classification Performance Across Different Segment Lengths.
Table 8. AlexNet + SVM Multi-class Classification Performance Across Different Segment Lengths.
Segment LengthClassPrec. (%)Recall (%)Spec. (%)F1 (%)FDR (%)FOR (%)MCCAUCClass Acc. (%)Overall Acc. (%)Overall MCCMicro-AUC
5 sdepr98.2598.4199.4098.331.750.540.9781.0098.4197.260.961.00
kontrol96.5696.0098.8496.283.441.350.9501.0096.00
panik98.3297.7199.4798.021.680.720.9741.0097.71
ptsd95.9596.9198.6196.434.041.050.9521.0096.91
10 sdepr96.4896.1698.7496.323.511.370.9501.0096.1695.060.930.99
kontrol93.1895.6697.4894.406.821.570.9240.9995.66
panik95.0895.2898.7295.184.911.770.9270.9995.28
ptsd95.5593.1698.4494.346.052.440.9130.9993.16
15 sdepr94.5495.2598.1394.895.461.610.9320.9995.2593.160.910.99
kontrol90.1493.7596.5291.899.862.150.8910.9993.75
panik95.1893.6898.5094.434.811.990.9270.9993.68
ptsd93.0290.0097.7191.486.983.350.8870.9990.00
20 sdepr92.7393.6697.5193.207.262.150.9090.9993.6690.970.880.98
kontrol87.0291.6695.3689.2812.982.880.8560.9891.66
panik93.5992.2898.0092.936.412.430.9070.9892.28
ptsd90.8786.3397.0688.549.124.560.8490.9886.33
Table 9. GoogleNet + SVM Multi-class Classification Performance Across Different Segment Lengths.
Table 9. GoogleNet + SVM Multi-class Classification Performance Across Different Segment Lengths.
Segment LengthClassPrec. (%)Recall (%)Spec. (%)F1 (%)FDR (%)FOR (%)MCCAUCClass Acc. (%)Overall Acc. (%)Overall MCCMicro-AUC
5 sdepr98.4198.4199.4698.411.580.540.9791.0098.4196.350.950.99
kontrol94.5694.2598.1694.485.431.950.9250.9994.25
panik98.3297.9899.4798.151.670.640.9761.0097.98
ptsd94.2094.8398.0294.515.791.760.9270.9994.83
10 sdepr94.5695.6698.1395.115.441.470.9350.9995.6693.710.920.99
kontrol93.2692.3397.7492.796.732.590.9040.9992.33
panik95.1993.8698.5094.954.801.940.9280.9993.33
ptsd91.9293.0097.2392.468.072.380.8990.9993.00
15 sdepr92.2892.7597.3792.517.712.460.9000.9992.7591.330.880.98
kontrol88.3893.2595.8490.7511.612.330.8760.9893.25
panik91.8291.5797.4191.708.182.660.8910.9891.57
ptsd93.1087.7597.7990.346.904.070.8730.9887.75
20 sdepr91.0091.0096.9491.0010.233.050.8670.9991.0090.310.860.98
kontrol89.9389.3396.6189.6310.073.760.8600.9889.33
panik89.8990.5296.7190.2110.113.130.8700.9890.52
ptsd89.6689.6696.4989.6610.333.650.8600.9889.66
Table 10. ResNet50 + SVM Multi-class Classification Performance Across Different Segment Lengths.
Table 10. ResNet50 + SVM Multi-class Classification Performance Across Different Segment Lengths.
Segment LengthClassPrec. (%)Recall (%)Spec. (%)F1 (%)FDR (%)FOR (%)MCCAUCClass Acc. (%)Overall Acc. (%)Overall MCCMicro-AUC
5 sdepr98.7498.2599.5898.501.260.600.9801.0098.2597.050.971.00
kontrol95.2895.9298.3995.604.720.430.9601.0095.91
panik98.2598.6099.4498.421.660.450.9801.0098.59
ptsd95.9895.5098.6495.741.291.520.9611.0095.50
10 sdepr95.7296.8398.5396.274.281.080.9501.0096.8395.240.940.99
kontrol94.0594.8397.9794.445.951.760.9260.9994.83
panik96.7894.9199.0095.843.221.600.9450.9994.91
ptsd94.6694.5098.1994.585.341.860.9270.9994.50
15 sdepr96.0096.0098.6496.004.001.360.9461.0096.0093.290.910.99
kontrol89.8192.5096.4491.1310.192.570.8810.9992.50
panik96.0094.7498.7595.364.001.660.9390.9994.73
ptsd91.6090.0097.2090.798.403.370.8770.9990.00
20 sdepr94.0494.6797.9794.355.961.810.9240.9994.6691.480.890.99
kontrol89.0489.3396.2789.1910.963.620.8550.9892.00
panik94.3593.6898.2294.015.652.000.9210.9993.68
ptsd88.6388.3396.1688.4811.373.950.8460.9888.33
Table 11. Statistical Significance Analysis of Model Comparisons.
Table 11. Statistical Significance Analysis of Model Comparisons.
Impact of SVM Integration
Comparison Δ Acc (%)t-Test pWilcoxon pSignificant
ResNet50 + SVM vs. ResNet50+0.490.009 **0.063Yes **
GoogLeNet + SVM vs. GoogLeNet+0.200.5480.625No
AlexNet + SVM vs. AlexNet+2.410.007 **0.063Yes **
Comparison of Hybrid Models
ResNet50 + SVM vs. GoogLeNet + SVM+0.700.0860.125No
ResNet50 + SVM vs. AlexNet + SVM−0.210.037 *0.063Marginal *
GoogLeNet + SVM vs. AlexNet + SVM−0.910.0540.125No
* p < 0.05, ** p < 0.01.
Table 12. McNemar’s Test Results for Hybrid Model Comparisons.
Table 12. McNemar’s Test Results for Hybrid Model Comparisons.
ComparisonDiscordant χ 2 p-ValueWinner Δ Samples
ResNet50 + SVM vs. AlexNet + SVM1800.450.502+10
ResNet50 SVM vs. GoogLeNet + SVM2074.950.026 *ResNet50+33
AlexNet + SVM vs. GoogLeNet + SVM1998.860.003 **AlexNet+43
* p < 0.05, ** p < 0.01.
Table 13. Error Analysis Summary for 5-s Segments.
Table 13. Error Analysis Summary for 5-s Segments.
ResNet50 + SVMGoogLeNet + SVMAlexNet + SVM
Overall Accuracy97.05%96.35%97.26%
Total Errors140173130
Primary Confusion Patterns:
 PTSD ↔ Control101 (72.1%)130 (75.1%)83 (63.8%)
 Depression ↔ Panic33 (23.6%)37 (21.4%)38 (29.2%)
 PTSD ↔ Other Disorders1 (0.7%)2 (1.2%)3 (2.3%)
Individual Error Breakdown:
 PTSD → Control546135
 Control → PTSD476948
 Depression → Panic181817
 Panic → Depression151921
 Other errors669
Note: Percentages indicate proportion of total errors. PTSD-Control confusion dominates (64–75%) across all models. PTSD differentiation from depression and panic remains highly accurate (<3% confusion combined).
Table 14. Performance comparison of traditional machine learning approaches with handcrafted statistical features.
Table 14. Performance comparison of traditional machine learning approaches with handcrafted statistical features.
ML ModelClassPrec. (%)Recall (%)Spec. (%)F1 (%)AUCClass Acc. (%)Overall Acc. (%)
SVM (Linear)depr43.4850.0077.9746.510.77050.0044.30
kontrol43.4850.0077.9746.510.69150.00
panik47.0642.1185.0044.440.71742.11
ptsd43.7535.0084.7538.890.62535.00
KNN (Cubic)depr34.3855.0064.4142.310.60955.0032.91
kontrol41.1835.0083.0537.840.72535.00
panik26.6721.0581.6723.530.58221.05
ptsd26.6720.0081.3622.860.58720.00
Ensemble (Bagged Tree)depr50.0060.0079.6654.550.73860.0040.51
kontrol45.4650.0079.6647.620.79150.00
panik37.5031.5883.3334.290.62331.58
ptsd23.5320.0077.9721.620.50720.00
NN (Trilayered)depr36.8435.0079.6635.900.59735.0031.65
kontrol31.2525.0081.3627.780.50025.00
panik42.1142.1181.6742.110.66142.11
ptsd20.0025.0066.1022.220.40525.00
Linear Discriminantdepr44.4440.0083.0542.110.73540.0034.18
kontrol16.6710.0083.0512.500.45910.00
panik42.3157.9075.0048.890.71857.90
ptsd26.0930.0071.1927.910.50030.00
Naive Bayes (Gaussian)depr46.1530.0088.1436.360.72530.0037.97
kontrol38.4625.0086.4430.300.54125.00
panik34.4852.6368.3341.670.67552.63
ptsd37.5045.0074.5840.910.59445.00
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.

Share and Cite

MDPI and ACS Style

Ebrahimpour Moghaddam Tasouj, P.; Soysal, G.; Eroğul, O.; Yetkin, S. A Hybrid CNN-SVM Approach for ECG-Based Multi-Class Differential Diagnosis of PTSD, Depression, and Panic Attack. Biosensors 2026, 16, 52. https://doi.org/10.3390/bios16010052

AMA Style

Ebrahimpour Moghaddam Tasouj P, Soysal G, Eroğul O, Yetkin S. A Hybrid CNN-SVM Approach for ECG-Based Multi-Class Differential Diagnosis of PTSD, Depression, and Panic Attack. Biosensors. 2026; 16(1):52. https://doi.org/10.3390/bios16010052

Chicago/Turabian Style

Ebrahimpour Moghaddam Tasouj, Parisa, Gökhan Soysal, Osman Eroğul, and Sinan Yetkin. 2026. "A Hybrid CNN-SVM Approach for ECG-Based Multi-Class Differential Diagnosis of PTSD, Depression, and Panic Attack" Biosensors 16, no. 1: 52. https://doi.org/10.3390/bios16010052

APA Style

Ebrahimpour Moghaddam Tasouj, P., Soysal, G., Eroğul, O., & Yetkin, S. (2026). A Hybrid CNN-SVM Approach for ECG-Based Multi-Class Differential Diagnosis of PTSD, Depression, and Panic Attack. Biosensors, 16(1), 52. https://doi.org/10.3390/bios16010052

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop