Check the photograph
Validate the upload, inspect image quality, and detect the ECG paper.
From an ECG photograph to a traceable research result.
An experimental workflow for printed ECG photographs, connecting image checks and crop correction to classification, visual explanations, and saved results.
A model is one part of the complete workflow.
The problem
A photograph of a printed ECG is a different input from a clean training image. Paper boundaries, perspective, lighting, and preprocessing all affect the path from an upload to a meaningful research result.
The workflow
Validate the upload, inspect image quality, and detect the ECG paper.
Adjust detected corners and straighten the sheet before preparing the model input.
Review classifier scores and Grad-CAM explanations, then revisit saved prediction records.
The intelligent system
The image classifier combines a ConvNeXt Tiny backbone with residual feature-pyramid fusion. Independent label thresholds support multi-label output, and Grad-CAM provides a label-specific view of model attention.
Engineering decisions
OpenCV paper detection is paired with an editable corner selection. The backend validates the quadrilateral before perspective correction.
A model descriptor records checkpoint identity, label order, preprocessing, thresholds, and explanation configuration. Strict loading detects incompatible weights.
Saved runs include a descriptor snapshot, input digest, logits, scores, thresholds, and timing information. PostgreSQL stores capture and run records.
Local training materials include patient-level partitioning, validation-only threshold selection, and evaluation code. Test artifacts cover API behavior and preprocessing consistency.
Reliable AI integration includes the input pipeline, the serving configuration, the review experience, and the record of what was run.