Skip to content
Learning

ECG anomaly detection with a heartbeat autoencoder

Inspect unusual patterns in one ECG recording

A 140-input autoencoder models standardized heartbeats derived from PhysioNet record chf07 in the BIDMC Congestive Heart Failure Database. The current project contains 5,000 beats and reports anomaly ROC AUC 0.955.

5,000Source records
140Encoded input values
3,355Testing-role records
140Model outputs

1. Clinical question and intended use

This physiological-signal example studies reconstruction-error ranking against the supplied normal/non-normal annotation. It is a recording-specific research benchmark, not a diagnostic or monitoring-alarm system.

Heartbeat representation

Retain the same 140-point transformation.

Error ranking

Inspect the native anomaly ROC and reconstructions.

Recording boundary

Avoid treating a single recording as a clinical cohort.

Biomedical signal analysisPhysiological researchModel validation
Research use only. Unusual reconstruction error does not establish an arrhythmia or a clinical diagnosis.

2. Cohort, measurements and endpoint

The first ECG channel of chf07 was decoded, segmented at annotation midpoints, interpolated to 140 values and standardized per beat. The final CSV column is 1 for normal and 0 for non-normal. The saved model assigns 1,234 rows to training, 411 to validation and 3,355 to testing. These roles differ from the separate 1,000-row OpenNN test_indices.csv file; results on this page use the .nd roles.

Source: BIDMC Congestive Heart Failure Database, record chf07. Dataset license: ODC-By-1.0. The downloadable ZIP includes the adapted data and attribution notices.

Dataset measureSaved value
Analysis unitheartbeat segment
Records5,000
Raw variables141
Encoded model inputs140
Model outputs140
Training roles1234
Validation / selection roles411
Testing roles3355
Unused roles0
Inspect the complete saved variable schema
FieldRoleTypeCategories
variable_1InputTargetNumeric
variable_2InputTargetNumeric
variable_3InputTargetNumeric
variable_4InputTargetNumeric
variable_5InputTargetNumeric
variable_6InputTargetNumeric
variable_7InputTargetNumeric
variable_8InputTargetNumeric
variable_9InputTargetNumeric
variable_10InputTargetNumeric
variable_11InputTargetNumeric
variable_12InputTargetNumeric
variable_13InputTargetNumeric
variable_14InputTargetNumeric
variable_15InputTargetNumeric
variable_16InputTargetNumeric
variable_17InputTargetNumeric
variable_18InputTargetNumeric
variable_19InputTargetNumeric
variable_20InputTargetNumeric
variable_21InputTargetNumeric
variable_22InputTargetNumeric
variable_23InputTargetNumeric
variable_24InputTargetNumeric
variable_25InputTargetNumeric
variable_26InputTargetNumeric
variable_27InputTargetNumeric
variable_28InputTargetNumeric
variable_29InputTargetNumeric
variable_30InputTargetNumeric
variable_31InputTargetNumeric
variable_32InputTargetNumeric
variable_33InputTargetNumeric
variable_34InputTargetNumeric
variable_35InputTargetNumeric
variable_36InputTargetNumeric
variable_37InputTargetNumeric
variable_38InputTargetNumeric
variable_39InputTargetNumeric
variable_40InputTargetNumeric
variable_41InputTargetNumeric
variable_42InputTargetNumeric
variable_43InputTargetNumeric
variable_44InputTargetNumeric
variable_45InputTargetNumeric
variable_46InputTargetNumeric
variable_47InputTargetNumeric
variable_48InputTargetNumeric
variable_49InputTargetNumeric
variable_50InputTargetNumeric
variable_51InputTargetNumeric
variable_52InputTargetNumeric
variable_53InputTargetNumeric
variable_54InputTargetNumeric
variable_55InputTargetNumeric
variable_56InputTargetNumeric
variable_57InputTargetNumeric
variable_58InputTargetNumeric
variable_59InputTargetNumeric
variable_60InputTargetNumeric
variable_61InputTargetNumeric
variable_62InputTargetNumeric
variable_63InputTargetNumeric
variable_64InputTargetNumeric
variable_65InputTargetNumeric
variable_66InputTargetNumeric
variable_67InputTargetNumeric
variable_68InputTargetNumeric
variable_69InputTargetNumeric
variable_70InputTargetNumeric
variable_71InputTargetNumeric
variable_72InputTargetNumeric
variable_73InputTargetNumeric
variable_74InputTargetNumeric
variable_75InputTargetNumeric
variable_76InputTargetNumeric
variable_77InputTargetNumeric
variable_78InputTargetNumeric
variable_79InputTargetNumeric
variable_80InputTargetNumeric
variable_81InputTargetNumeric
variable_82InputTargetNumeric
variable_83InputTargetNumeric
variable_84InputTargetNumeric
variable_85InputTargetNumeric
variable_86InputTargetNumeric
variable_87InputTargetNumeric
variable_88InputTargetNumeric
variable_89InputTargetNumeric
variable_90InputTargetNumeric
variable_91InputTargetNumeric
variable_92InputTargetNumeric
variable_93InputTargetNumeric
variable_94InputTargetNumeric
variable_95InputTargetNumeric
variable_96InputTargetNumeric
variable_97InputTargetNumeric
variable_98InputTargetNumeric
variable_99InputTargetNumeric
variable_100InputTargetNumeric
variable_101InputTargetNumeric
variable_102InputTargetNumeric
variable_103InputTargetNumeric
variable_104InputTargetNumeric
variable_105InputTargetNumeric
variable_106InputTargetNumeric
variable_107InputTargetNumeric
variable_108InputTargetNumeric
variable_109InputTargetNumeric
variable_110InputTargetNumeric
variable_111InputTargetNumeric
variable_112InputTargetNumeric
variable_113InputTargetNumeric
variable_114InputTargetNumeric
variable_115InputTargetNumeric
variable_116InputTargetNumeric
variable_117InputTargetNumeric
variable_118InputTargetNumeric
variable_119InputTargetNumeric
variable_120InputTargetNumeric
variable_121InputTargetNumeric
variable_122InputTargetNumeric
variable_123InputTargetNumeric
variable_124InputTargetNumeric
variable_125InputTargetNumeric
variable_126InputTargetNumeric
variable_127InputTargetNumeric
variable_128InputTargetNumeric
variable_129InputTargetNumeric
variable_130InputTargetNumeric
variable_131InputTargetNumeric
variable_132InputTargetNumeric
variable_133InputTargetNumeric
variable_134InputTargetNumeric
variable_135InputTargetNumeric
variable_136InputTargetNumeric
variable_137InputTargetNumeric
variable_138InputTargetNumeric
variable_139InputTargetNumeric
variable_140InputTargetNumeric
variable_141EvaluationBinary0, 1
The saved roles are retained exactly. Training and validation use the selected normal records, while testing includes both label types. These are record-level internal results; source recordings or acquisition windows can remain dependent.

3. Model

The model has 140 encoded inputs and 140 outputs. No architecture-selection experiment is recorded in this project. The diagram shows the topology used by the saved model.

LayerInput shapeOutput shapeActivation
Scaling140140
Dense14035ReLU
Dense3517ReLU
Dense178ReLU
Dense817ReLU
Dense1735ReLU
Dense35140Identity
Unscaling140140
ECG anomaly detection with a heartbeat autoencoder — initial network architecture
Topology of the saved current model; no architecture selection is recorded.

4. Training strategy

The saved training configuration uses Adam with MeanAbsoluteError.

Adaptive moment estimation results

MeasureValue
Epochs number100
Elapsed time00:00:02
Stopping criterionMaximum epochs number
Training error0.18
Validation error0.172
Adaptive moment estimation error history
Adaptive moment estimation error history. Native Neural Designer report for this project.

5. Model selection and baseline

No model selection experiment is recorded for this version. The validation subset guides fitting where a training report is present; it is distinct from the held-out test rows.

6. Clinical validation

The figures and tables below refer to the current project’s saved testing analysis. The subset uses testing role 2; it contains 3355 source records.

ROC AUC describes ranking on this testing subset. Any optimal threshold shown in the saved ROC report was selected descriptively on that same subset; it is not an independently validated operating policy.

The report does not include a fixed-threshold confusion table. Sensitivity, specificity, precision and operating-point counts are therefore not claimed. The normal/non-normal prevalence belongs to this selected recording, not a clinical population.

Area under curve

MeasureValue
Area under curve0.955
Anomaly ROC chart
Anomaly ROC chart. Native Neural Designer report for this project.
Input and reconstruction
Input and reconstruction. Native Neural Designer report for this project.
Reconstruction error
Reconstruction error. Native Neural Designer report for this project.
Input and reconstruction
Input and reconstruction. Native Neural Designer report for this project.
Reconstruction error
Reconstruction error. Native Neural Designer report for this project.
Research use only. Unusual reconstruction error does not establish an arrhythmia or a clinical diagnosis.

7. Workflow and reproducibility

Open the downloaded project in Neural Designer, inspect the dataset roles and preprocessing, then review the saved task report. Use the same input schema and category order when calculating outputs. The ZIP contains the exact current .nd, its source data and the applicable dataset notices.

Research workflow: eligible record or image → measurement and schema checks → model score → expert review → confirmatory clinical method where appropriate. No model output should be used as an autonomous diagnosis or treatment instruction.

8. Safety, generalizability and governance

All beats come from one recording, so temporally correlated segments cannot establish patient-level transfer. No external validation, calibrated risk or clinical operating threshold is established. The supplied report contains ROC ranking and sample reconstructions but no confusion counts at a fixed operating threshold; clinician or signal-specialist review remains necessary.

Research use only. Unusual reconstruction error does not establish an arrhythmia or a clinical diagnosis.

References