ecg-robustness-eval
ECG-ATK-GAN: Robustness against Adversarial Attacks on ECGs using Conditional Generative Adversarial Networks — Hossain et al. (2021) (arXiv:2110.09983, 2021)
What this evaluates
Evaluates the robustness of ECG classification models against six adversarial attack types (FGSM, BIM, PGD, CW, DBB, HSJ) compared to clean data. It measures classification performance and signal generation quality on two public ECG datasets.
Datasets
- PhysioNet MIT-BIH Arrhythmia — total ?; splits: train (-1), test (-1)
- PTB Diagnostic ECG Database — total ?; splits: train (-1), test (-1)
Metrics
Accuracy (primary) — range: [0, 1]
- Proportion of correctly classified instances (clean or attacked) out of the total test set instances.
Sensitivity — range: [0, 1]
- True positive rate: proportion of actual positive instances correctly identified.
Specificity — range: [0, 1]
- True negative rate: proportion of actual negative instances correctly identified.
Structural Similarity (SSIM) — range: [0, 1]
- Perceptual similarity metric between generated and real ECG signals, ranging from 0 to 1.
Mean-Squared-Error (MSE) — range: other
- Average squared difference between generated and real signal amplitudes.
Normalized Mean Squared Error (NRMSE) — range: [0, 1]
- MSE normalized by the range or mean of the signal to provide scale-invariant error measurement.
Cross-correlation Coefficient — range: other
- Measures linear correlation between generated and real signals across time lags.
Input / output format
Input: ECG signal segments centered on R-peaks, sampled at 280 Hz, normalized to [0,1]. Inputs include both clean beats and adversarially perturbed versions (FGSM, BIM, PGD, CW, DBB, HSJ).
Output: Predicted class labels (N, S, V, F for MIT-BIH; Normal, Myocardial Infarction for PTB) and attack type classification (clean vs. specific attack).
Scoring recipe
def compute_metrics(preds, labels):
tp = sum(1 for p, l in zip(preds, labels) if p == l and l == 1)
tn = sum(1 for p, l in zip(preds, labels) if p == l and l == 0)
fp = sum(1 for p, l in zip(preds, labels) if p == 1 and l == 0)
fn = sum(1 for p, l in zip(preds, labels) if p == 0 and l == 1)
accuracy = (tp + tn) / (tp + tn + fp + fn)
sensitivity = tp / (tp + fn) if (tp + fn) > 0 else 0
specificity = tn / (tn + fp) if (tn + fp) > 0 else 0
return accuracy, sensitivity, specificity
Common pitfalls
- SMOTE oversampling is applied only to the training set, not the test set, meaning test performance reflects the original imbalanced distribution.
- HSJ attacks introduce high-frequency noise that obscures signal patterns, causing disproportionate performance drops across all models and potentially skewing average robustness scores.
- Models are trained on a combined dataset of clean and attacked signals, but evaluated separately on clean vs. attacked test splits, requiring strict separation to avoid data leakage.
Evidence (verbatim from paper)
For metrics, we use Accuracy, Sensitivity, and Specificity. We can see that for ‘No Attack’, all models achieve comparatively good results. However, for each distinct attack, the results worsen for other models compared to ours.
Citation
@misc{hossain2021ecgatk,
title={ECG-ATK-GAN: Robustness against Adversarial Attacks on ECGs using Conditional Generative Adversarial Networks},
author={Hossain et al. (2021)},
year={2021},
note={arXiv:2110.09983}
}
1---2name: ecg-robustness-eval3description: Evaluates the robustness of ECG classification models against six adversarial attack types (FGSM, BIM, PGD, CW, DBB, HSJ) compared to clean data. It measures classification performance and signal generation quality on two public ECG datasets. Use when the user wants to benchmark on PhysioNet MIT-BIH Arrhythmia, PTB Diagnostic ECG Database, or asks about evaluating this task. Reports Accuracy.4metadata:5 source: https://skillmd.com/skills/qhjqhj00/ecg-robustness-eval6 skill_kind: dataset_eval7 source_arxiv: 2110.099838 bibtex_key: hossain2021ecgatk9 confidence: high10---1112# ecg-robustness-eval1314> ECG-ATK-GAN: Robustness against Adversarial Attacks on ECGs using Conditional Generative Adversarial Networks — Hossain et al. (2021) (arXiv:2110.09983, 2021)1516## What this evaluates1718Evaluates the robustness of ECG classification models against six adversarial attack types (FGSM, BIM, PGD, CW, DBB, HSJ) compared to clean data. It measures classification performance and signal generation quality on two public ECG datasets.1920## Datasets2122- **PhysioNet MIT-BIH Arrhythmia** — total ?; splits: train (-1), test (-1)23- **PTB Diagnostic ECG Database** — total ?; splits: train (-1), test (-1)2425## Metrics2627- `Accuracy` **(primary)** — range: [0, 1]28 - Proportion of correctly classified instances (clean or attacked) out of the total test set instances.29- `Sensitivity` — range: [0, 1]30 - True positive rate: proportion of actual positive instances correctly identified.31- `Specificity` — range: [0, 1]32 - True negative rate: proportion of actual negative instances correctly identified.33- `Structural Similarity (SSIM)` — range: [0, 1]34 - Perceptual similarity metric between generated and real ECG signals, ranging from 0 to 1.35- `Mean-Squared-Error (MSE)` — range: other36 - Average squared difference between generated and real signal amplitudes.37- `Normalized Mean Squared Error (NRMSE)` — range: [0, 1]38 - MSE normalized by the range or mean of the signal to provide scale-invariant error measurement.39- `Cross-correlation Coefficient` — range: other40 - Measures linear correlation between generated and real signals across time lags.4142## Input / output format4344**Input**: ECG signal segments centered on R-peaks, sampled at 280 Hz, normalized to [0,1]. Inputs include both clean beats and adversarially perturbed versions (FGSM, BIM, PGD, CW, DBB, HSJ).4546**Output**: Predicted class labels (N, S, V, F for MIT-BIH; Normal, Myocardial Infarction for PTB) and attack type classification (clean vs. specific attack).4748## Scoring recipe4950```python51def compute_metrics(preds, labels):52 tp = sum(1 for p, l in zip(preds, labels) if p == l and l == 1)53 tn = sum(1 for p, l in zip(preds, labels) if p == l and l == 0)54 fp = sum(1 for p, l in zip(preds, labels) if p == 1 and l == 0)55 fn = sum(1 for p, l in zip(preds, labels) if p == 0 and l == 1)56 accuracy = (tp + tn) / (tp + tn + fp + fn)57 sensitivity = tp / (tp + fn) if (tp + fn) > 0 else 058 specificity = tn / (tn + fp) if (tn + fp) > 0 else 059 return accuracy, sensitivity, specificity60```6162## Common pitfalls6364- SMOTE oversampling is applied only to the training set, not the test set, meaning test performance reflects the original imbalanced distribution.65- HSJ attacks introduce high-frequency noise that obscures signal patterns, causing disproportionate performance drops across all models and potentially skewing average robustness scores.66- Models are trained on a combined dataset of clean and attacked signals, but evaluated separately on clean vs. attacked test splits, requiring strict separation to avoid data leakage.6768## Evidence (verbatim from paper)6970> For metrics, we use Accuracy, Sensitivity, and Specificity. We can see that for ‘No Attack’, all models achieve comparatively good results. However, for each distinct attack, the results worsen for other models compared to ours.7172## Citation7374```bibtex75@misc{hossain2021ecgatk,76 title={ECG-ATK-GAN: Robustness against Adversarial Attacks on ECGs using Conditional Generative Adversarial Networks},77 author={Hossain et al. (2021)},78 year={2021},79 note={arXiv:2110.09983}80}81```8283- arXiv: 2110.09983