What I Built
Built a CNN-based classifier for the ECG Fragments dataset that distinguishes between fragments containing Ventricular Flutter or Fibrillation (VFL/VF) and those that do not. The model achieves 94.48% accuracy on test data using early stopping to save the best model during training.
Additionally, implemented K-Fold Cross Validation (K=5) to find the best-performing model, addressing overfitting and providing a robust performance assessment.
What I Learned
Early stopping prevents overfitting while preserving peak performance. By monitoring validation loss and saving the best model checkpoint, the CNN achieved 94.48% test accuracy โ a significant improvement over training without regularization.
K-Fold Cross Validation provides a more reliable estimate of model generalization. The 5-fold approach yielded accuracies of [0.866, 0.945, 0.898, 0.913, 0.921], with the variance across folds highlighting how data splits affect performance. The mean accuracy of 90.87% confirms the model generalizes well across different subsets.
Key Results
Best Model (Early Stopping)
| Metric | Value |
|---|---|
| Accuracy | 94.49% |
| Precision | 0.9038 |
| Recall | 0.9592 |
| F1-score | 0.9307 |
| ROC-AUC | 0.9728 |
Classification Report (Test Data)
| Class | Precision | Recall | F1-score | Support |
|---|---|---|---|---|
| 0 (Not VFL/VF) | 0.97 | 0.94 | 0.95 | 78 |
| 1 (VFL/VF) | 0.90 | 0.96 | 0.93 | 49 |
| Weighted Avg | 0.95 | 0.94 | 0.95 | 127 |
K-Fold Cross Validation (K=5)
| Fold | Test Accuracy |
|---|---|
| 1 | 86.61% |
| 2 | 94.49% |
| 3 | 89.76% |
| 4 | 91.34% |
| 5 | 92.13% |
| Mean | 90.87% |
Project
๐ GitHub Repository ยท ๐ Notebook
Tech Stack: Python, PyTorch/TensorFlow, CNN, K-Fold Cross Validation | Data: ECG Fragments Dataset
Citation
@online{prasanna_koppolu,
author = {Prasanna Koppolu, Bhanu},
title = {ECG {Fragments} {Classification}},
url = {https://bhanuprasanna2001.github.io/projects/ecg_classification.html},
langid = {en}
}