# Ecg Arrhythmia Detection Eval

> Evaluates a deep learning model's ability to classify cardiac arrhythmias from ECG signals, testing both intra-dataset performance and cross-dataset generalization using demographic attributes. Use when the user wants to benchmark on MITDB, INCARTDB, EDB, or asks about evaluating this task. Reports F1-score.

- Skill: `qhjqhj00/ecg-arrhythmia-detection-eval` (Agent Skill)
- Install (CLI): `npx skillmds add qhjqhj00/ecg-arrhythmia-detection-eval`
- Raw SKILL.md: https://api.skillmd.com/api/skills/qhjqhj00/ecg-arrhythmia-detection-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-detection-eval

---


# ecg-arrhythmia-detection-eval

> rECGnition_v1.0: Arrhythmia detection using cardiologist-inspired multi-modal architecture incorporating demographic attributes in ECG — Shreya Srivastava et al. (2024) (arXiv:2410.18985, 2024)

## What this evaluates

Evaluates a deep learning model's ability to classify cardiac arrhythmias from ECG signals, testing both intra-dataset performance and cross-dataset generalization using demographic attributes.

## Datasets

- **MITDB** — total ?; splits: train (-1), test (-1)
- **INCARTDB** — total ?; splits: train (-1), test (-1)
- **EDB** — total ?; splits: train (-1), test (-1)

## Metrics

- `F1-score` **(primary)** — range: [0, 1]
  - Harmonic mean of Precision and Sensitivity: 2 * (Precision * Sensitivity) / (Precision + Sensitivity). Reported per-class and macro-averaged.
- `Accuracy` — range: [0, 1]
  - Ratio of correctly classified instances to total instances.
- `Precision` — range: [0, 1]
  - Ratio of true positive predictions to all positive predictions (TP / (TP + FP)).
- `Sensitivity` — range: [0, 1]
  - Ratio of true positive predictions to all actual positives (TP / (TP + FN)).

## Input / output format

**Input**: 2D image representations of ECG beats concatenated with patient demographic attributes (age, gender, height, weight, BMI).

**Output**: Predicted class label for each heartbeat (e.g., N, L, R, V, /, A, f, F, j, a, AB) or demographic category.

## Scoring recipe

```python
def compute_f1(predictions, gold, classes):
    precisions = []
    recalls = []
    for cls in classes:
        tp = sum(1 for p, g in zip(predictions, gold) if p == cls and g == cls)
        fp = sum(1 for p, g in zip(predictions, gold) if p == cls and g != cls)
        fn = sum(1 for p, g in zip(predictions, gold) if p != cls and g == cls)
        prec = tp / (tp + fp) if (tp + fp) > 0 else 0
        rec = tp / (tp + fn) if (tp + fn) > 0 else 0
        precisions.append(prec)
        recalls.append(rec)
    f1s = [2 * p * r / (p + r) if (p + r) > 0 else 0 for p, r in zip(precisions, recalls)]
    return sum(f1s) / len(f1s)
```

## Common pitfalls

- Class imbalance significantly impacts F1-scores for rare beats (e.g., Fusion beats f/F, Nodal escape j).
- Transferability tests vary ECG leads (V1 vs II), causing minor performance shifts that must be accounted for.
- Demographic prediction tasks (UCIDB) use a separate XGBoost classifier, not the main rECGnition_v1.0 architecture.

## Evidence (verbatim from paper)

> rECGnition_v1.0 achieved an overall F1-score of 0.9855 with a prediction accuracy of 98.56% (Table 5).

## Citation

```bibtex
@misc{srivastava2024recgnition,
  title={rECGnition_v1.0: Arrhythmia detection using cardiologist-inspired multi-modal architecture incorporating demographic attributes in ECG},
  author={Shreya Srivastava et al. (2024)},
  year={2024},
  note={arXiv:2410.18985}
}
```

- arXiv: 2410.18985

