Skip to content

Metrics Explained

Each page below explains one ECGEN-Eval metric with an interactive visualization: move the sliders or click a preset to change the synthetic data and watch the score respond. Every page also covers how the metric is computed, the maths, how to read the score, and how to run it with ECGEN-Eval.

How the demos work

The demos run in your browser on small simulated data sets (a few hundred points or a handful of simulated ECG beats). They use the same formulas as ECGEN-Eval, so the scores behave the same way. The absolute numbers will differ from scores on your own recordings.

  • Fréchet ECG Distance (FED) · fed · ↓


    Compares Gaussians fitted to embeddings from a pre-trained ECG foundation model, like FID for images.

  • Fréchet Distance (FD) · fd · ↓


    The same Fréchet distance on 11 handcrafted signal features per lead. No GPU needed.

  • Maximum Mean Discrepancy · mmd · ↓


    A kernel two-sample test that detects any difference in distribution shape, not just in mean and variance.

  • Sliced Wasserstein Distance · swd · ↓


    Projects the data onto many random lines and averages the 1-D transport distances.

  • Precision & Recall · pr_dist · ↑


    Splits quality into realism (precision) and coverage (recall) using k-NN manifolds.

  • Dynamic Time Warping · dtw · ↓


    A waveform distance that tolerates small timing differences by aligning the signals first.

  • Percent RMS Difference · prd · ↓


    Point-wise error relative to the energy of the real signal, the classic ECG compression metric.

  • Mean Absolute Error · mae · ↓


    Average absolute amplitude difference to the nearest synthetic signal (RMSE alongside).

  • Peak Signal-to-Noise Ratio · psnr · ↑


    Point-wise error expressed in decibels relative to the signal's peak-to-peak range.

  • Structural Similarity · ssim · ↑


    Compares mean, variance and correlation (shape) instead of raw sample differences.

  • Signal Quality Index · sqi · ↑


    Correlation of each synthetic ECG with a morphology template built from the real data.

  • PSD divergence · psd · ↓


    Compares the average frequency content (power spectra) of the two sets.

  • Spectral Entropy · spectral_entropy · ↓


    Compares how concentrated or spread out each recording's spectrum is.

  • Heart Rate · heart_rate · ↓


    Detects R peaks and compares the heart-rate distributions.

  • Heart-Rate Variability · hrv · ↓


    Compares SDNN, RMSSD and pNN50: how much and how irregularly the beat timing varies.

  • Nearest-Neighbour Distance · nn_dist · ↓


    Checks for memorisation: are synthetic ECGs near-copies of real training recordings?

↓ lower is better · ↑ higher is better.

Which metrics should I use?

No single metric captures everything. A balanced evaluation covers several of these questions:

Question Metrics
Does the synthetic population match the real one? FED, FD, MMD, SWD
Are samples realistic, and is the real diversity covered? Precision & Recall
Does each real ECG have a close synthetic look-alike? PRD, MAE, PSNR, SSIM, DTW
Do beats have the right shape? SQI
Is the frequency content right? PSD, Spectral entropy
Is the rhythm physiological? Heart rate, HRV
Is the model copying its training data? Nearest-neighbour distance

Always compare against a real-vs-real baseline: score two disjoint halves of your real data with the same metric. That shows what "as good as real data" looks like for your data set. The Metric Reference lists every parameter, and the Paper Database shows how the literature uses each metric family.