# Ecg Reconstruction Eval

> Evaluates the ability of generative models to reconstruct standard 12-lead ECG signals from arbitrary single-lead ECG inputs. It probes signal fidelity, physiological feature preservation (heart rate statistics), and downstream diagnostic accuracy for arrhythmia classification. Use when the user wants to benchmark on PTB-XL, CPSC2018, or asks about evaluating this task. Reports MSE, PCC.

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

---


# ecg-reconstruction-eval

> Multi-Channel Masked Autoencoder and Comprehensive Evaluations for Reconstructing 12-Lead ECG from Arbitrary Single-Lead ECG — Chen et al. (2024) (arXiv:2407.11481, 2024)

## What this evaluates

Evaluates the ability of generative models to reconstruct standard 12-lead ECG signals from arbitrary single-lead ECG inputs. It probes signal fidelity, physiological feature preservation (heart rate statistics), and downstream diagnostic accuracy for arrhythmia classification.

## Datasets

- **PTB-XL** — total ?; splits: test (-1)
- **CPSC2018** — total ?; splits: test (-1)

## Metrics

- `MSE` **(primary)** — range: other
  - Mean Square Error between generated and real 12-lead ECG signals, averaged across all 12 leads.
- `PCC` **(primary)** — range: [0, 1]
  - Pearson Correlation Coefficient between generated and real 12-lead ECG signals, averaged across all 12 leads.
- `MHR_SD` — range: other
  - Standard deviation of the mean heart rate (MHR) across the dataset.
- `MHR_CV` — range: percent
  - Coefficient of variation of the mean heart rate (MHR).
- `MHR_Range` — range: other
  - Range of the mean heart rate (MHR) across the dataset.
- `F1` — range: [0, 1]
  - F1 score for arrhythmia classification using a pre-trained classifier on the generated 12-lead ECGs.

## Input / output format

**Input**: Single-lead ECG time-series signal (arbitrary lead: I, II, III, aVR, aVL, aVF, V1-V6)

**Output**: 12-lead ECG time-series signal (leads I, II, III, aVR, aVL, aVF, V1-V6)

## Scoring recipe

```python
def compute_metrics(pred_ecg, gold_ecg, gold_labels):
    # pred_ecg, gold_ecg: shape (batch, 12, time)
    mse = np.mean((pred_ecg - gold_ecg) ** 2, axis=(1, 2))
    pcc = np.corrcoef(pred_ecg.flatten(), gold_ecg.flatten())[0, 1]
    # HR features extracted via R-peak detection algorithm [45]
    hr_sd = np.std(mean_heart_rates)
    hr_cv = np.std(mean_heart_rates) / np.mean(mean_heart_rates)
    hr_range = np.max(mean_heart_rates) - np.min(mean_heart_rates)
    # Diagnostic F1 from external classifier
    f1 = f1_score(gold_labels, classifier.predict(pred_ecg))
    return {'MSE': np.mean(mse), 'PCC': pcc, 'MHR_SD': hr_sd, 'MHR_CV': hr_cv, 'MHR_Range': hr_range, 'F1': f1}
```

## Common pitfalls

- Evaluating on arbitrary single-lead inputs requires averaging or reporting per-lead performance, not just a single fixed lead.
- Feature-level metrics (HR statistics) depend on R-peak detection algorithms, which can introduce variability if not standardized.
- Diagnostic-level evaluation relies on an external classifier (Ribeiro et al.), so performance reflects both reconstruction quality and classifier robustness.

## Evidence (verbatim from paper)

> First of all, the signal-level evaluation is the primary evaluation metric, such as  $MSE$  and  $PCC$ . In contrast to conventional approaches, this scheme offers a distinct advantage: it enables the conversion of an arbitrary single-lead ECG to a 12-lead ECG without the necessity of training multiple generative models.

## Citation

```bibtex
@misc{chen2024mcma,
  title={Multi-Channel Masked Autoencoder and Comprehensive Evaluations for Reconstructing 12-Lead ECG from Arbitrary Single-Lead ECG},
  author={Chen et al. (2024)},
  year={2024},
  note={arXiv:2407.11481}
}
```

- arXiv: 2407.11481

