# Ecg Arrhythmia Eval

> Evaluates a CNN's ability to reconstruct missing QRS complexes in ECG signals via self-supervised regression and to classify cardiac arrhythmias. It probes signal reconstruction fidelity and multi-class rhythm recognition under imbalanced conditions. Use when the user wants to benchmark on DS0 dataset (MIT-BIH Arrhythmia), or asks about evaluating this task. Reports NRMSE.

- Skill: `qhjqhj00/ecg-arrhythmia-eval` (Agent Skill)
- Install (CLI): `npx skillmds add qhjqhj00/ecg-arrhythmia-eval`
- Raw SKILL.md: https://api.skillmd.com/api/skills/qhjqhj00/ecg-arrhythmia-eval/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: qhjqhj00 (https://skillmd.com/u/qhjqhj00)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/qhjqhj00/ecg-arrhythmia-eval

---


# ecg-arrhythmia-eval

> Classification and Self-Supervised Regression of Arrhythmic ECG Signals Using Convolutional Neural Networks — Grabowski et al. (2022) (arXiv:2210.14253, 2022)

## What this evaluates

Evaluates a CNN's ability to reconstruct missing QRS complexes in ECG signals via self-supervised regression and to classify cardiac arrhythmias. It probes signal reconstruction fidelity and multi-class rhythm recognition under imbalanced conditions.

## Datasets

- **DS0 dataset (MIT-BIH Arrhythmia)** — total ?; splits: train (-1), test (-1)

## Metrics

- `NRMSE` **(primary)** — range: [0, 1]
  - Normalized Root Mean Square Error: sqrt(mean((y - y_hat)^2)) / (max(y) - min(y)). Measures reconstruction error relative to the signal's amplitude range.
- `Overall accuracy` — range: percent
  - Percentage of correctly classified instances, averaged over multiple independent train-validation-test splits.
- `Balanced accuracy` — range: percent
  - Average of recall obtained on each class to account for dataset imbalance.
- `Cohen's Kappa` — range: [0, 1]
  - Agreement between predicted and actual labels corrected for chance agreement.

## Input / output format

**Input**: 10-second ECG segment (3,600 sampled datapoints) with a 100-sample window zeroed out at a random position (shifted ±10% from the annotated R peak).

**Output**: Regression: 100-sample predicted signal vector. Classification: discrete arrhythmia class label.

## Scoring recipe

```python
def compute_nrmse(y_true, y_pred):
    return np.sqrt(np.mean((y_true - y_pred)**2)) / (np.max(y_true) - np.min(y_true))

def compute_balanced_accuracy(y_true, y_pred):
    recalls = [np.mean(y_pred[y_true == c] == c) for c in np.unique(y_true)]
    return np.mean(recalls)
```

## Common pitfalls

- Shifting the zeroing window by ±10% significantly impacts NRMSE; failing to align predictions temporally inflates error.
- Rescaling signals to [0,1] before error computation does not improve NRMSE, as amplitude variations reflect cardiac disorders rather than rhythm.
- Test vectors are selected independently of training/validation splits, risking data overlap between train and test sets.

## Evidence (verbatim from paper)

> Normalized root mean square error (NRMSE) distance between the original y = [y_1, \dots, y_{n_o}] and the predicted \hat{y} = [\hat{y}_1, \dots, \hat{y}_{n_o}] signals was used as an error measure, which is given by: e_{\text{nmse}} = \frac{\sqrt{\frac{1}{n_o}\sum_{i=1}^{n_o}(y_i - \hat{y}_i)^2}}{\max(\boldsymbol{y}) - \min(\boldsymbol{y})}

## Citation

```bibtex
@misc{grabowski2022ecg,
  title={Classification and Self-Supervised Regression of Arrhythmic ECG Signals Using Convolutional Neural Networks},
  author={Grabowski et al. (2022)},
  year={2022},
  note={arXiv:2210.14253}
}
```

- arXiv: 2210.14253

