ECGLight: Compute-Light Framework For Paper ECG Digitization and Myocardial Infarction Screening
summary
The gist
The gist The proposed framework presents an end-to-end lightweight on-device digitization-todiagnosis pipeline that converts a smartphone photo or scan of a paper ECG into a calibrated 12-lead signal
In short
The framework converts smartphone photos or scans of paper ECGs into calibrated 12-lead digital signals using a lightweight, on-device pipeline running on CPU-only resources. It uses YOLO models for segmentation and layout detection, followed by classification for Myocardial Infarction (MI) screening. This allows legacy paper records to be used for decision support in areas lacking high connectivity or powerful computers.
Key concepts
- End-to-end lightweight pipeline
- A complete workflow designed to take a paper ECG image and turn it into a usable digital signal without needing strong internet or expensive hardware. It handles everything from recognizing the paper trace to producing a calibrated 12-lead signal, ensuring it runs quickly on basic mobile devices.
- YOLO-Based Patched Segmentation
- A method using YOLO models to accurately cut out ECG waveforms from noisy paper images. It uses specific techniques like anchorfree heads to preserve the shape of the traces even when they are obscured by grid lines or shadows, allowing for precise tracing extraction.
- SHapley Additive exPlanations (SHAP)
- A tool used to explain *why* the AI made a specific diagnosis. It shows which parts of the ECG signal—like specific time points or segments—most influenced the final decision (e.g., detecting an MI). This provides crucial transparency for clinicians.
Terminology used across episodes
This episode discusses
- ECGLight: Compute-Light Framework For Paper ECG Digitization and Myocardial Infarction Screening · Paper Radio
- ECGtizer: a fully automated digitizing and signal recovery pipeline for electrocardiograms
- Combining Hough Transform and Deep Learning Approaches to Reconstruct ECG Signals From Printouts
- MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications
- MLPerf Tiny Benchmark
- Decoupled Weight Decay Regularization
- SGDR: Stochastic Gradient Descent with Warm Restarts
- Mixed Precision Training
- Albumentations: fast and flexible image augmentations
- sktime: A Unified Interface for Machine Learning with Time Series
The paper
ECGLight: Compute-Light Framework For Paper ECG Digitization and Myocardial Infarction Screening · Read on arXiv
Shreyasvi Natraj, Cyrus Achtari, Felice Gragnano, Andrea Milzi, Marco Valgimigli, Diego Paez-Granados
ETH Zurich · Swiss Paraplegic Research Institute of Nottwil Switzerland Department of Translational Medical Sciences University of Campania Luigi Vanvitelli Department of Biomedical Sciences University of Italian Switzerland Cardiocentro Ticino Institute Lugano Switzerland
Electrocardiography (ECG) is one of the most widely used tests for diagnosing cardiovascular disease. Yet several remote clinics still utilize paper ECG printouts for their analysis due to limited connectivity and computational capacity. As a result, vast numbers of physical ECGs obtained in remote areas still remain incapable of being accessed by contemporary artificial-intelligence (AI)-based decision support as they require high computational resources or strong high-speed internet connectivity. This causes several cases where conditions like acute coronary occlusion (ACS) is overlooked and reperfusion therapy delayed. Although prior work has tackled digitization and diagnosis separately, and utilized advanced AI models for them, there still remains a lack of a compute-light, on-device framework that reconstructs paper ECGs at high fidelity, while accurately supporting multiple clinically relevant endpoints. We address this need with an end-to-end lightweight on-device digitization-to-diagnosis pipeline that converts a smartphone photo or scan of a paper ECG into a calibrated 12-lead signal and screens for Myocardial Infarction (MI) pathologies, with SHapley Additive exPlanations (SHAP) to support interpretability. Trained and evaluated on 21,799 ECGs from the PTB-XL dataset and further validated on hospital-acquired ECG-Matrix dataset, the complete system runs in <30 s per ECG on CPU-only resources, achieving 95.51% accuracy (F1 = 0.9519) for MI detection on PTB-XL and 88.89% accuracy (F1 = 0.8862) for OMI detection on ECG-Matrix. This work showcases that legacy paper records can be reliably democratized in any part of the world, providing a scalable decision support when digital ECG export, connectivity, or high-end compute are unavailable. Github: https://github.com/nshreyasvi/ECGLight
Transcript
Introduction to the show: ident: AI Radio. Generated commentary on the latest Artificial Intelligence papers.
Tom: I'm Tom.
Jane: And I'm Jane, here with Lu, Meng and our in-house large language model, Lalam.
Tom: Today's paper: "ECGLight: Compute-Light Framework For Paper ECG Digitization and Myocardial Infarction Screening".
Jane: The gist The proposed framework presents an end-to-end lightweight on-device digitization-todiagnosis pipeline that converts a smartphone photo or scan of a paper ECG into a calibrated 12-lead signal and screens…
Tom: First, who's behind it and why it matters.
Title and authors: Tom: So, we're talking about this paper called ECGLight: Compute-Light Framework For Paper ECG Digitization and Myocardial Infarction Screening. It's tackling the problem of remote clinics still relying on paper ECG printouts because they lack the high computational power or strong internet needed for modern AI analysis.
Jane: That’s the core issue, right? So it’s about making this whole process, from scanning a paper to getting a diagnosis, really lightweight and something that can run on regular hardware without needing massive resources.
Lu: Basically, they propose an end-to-end pipeline where you take a photo or scan of a paper ECG and turn it into a calibrated twelve-lead signal ready for analysis <ref:2607.07683#pg2>. This is important because most prior work treated digitization and diagnosis as separate problems, which isn't practical in the real world one <ref:2607.07683#pg1>.
Meng: I mean, if this can do it on just a CPU-only laptop in around twenty-five to thirty seconds per ECG, that’s a big deal for deployment <ref:2607.07683#pg2>. That's what I care about—running something reliably where connectivity is zero.
Lalam: The paper describes an end-to-end workflow starting with preprocessing the photo or scan to suppress shadows and noise, and then using a YOLOv11-based module to segment the actual ECG waveforms and detect lead labels two <ref:2607.07683#pg2,a YOLOv11-based module to segment the>.
Tom: Exactly. They use this YOLOv11 model for several key steps: segmenting the waveforms, detecting lead labels, finding reference pulses, and figuring out the page layout. It’s a whole sequence of steps happening in one go.
Jane: And they mention they're using two different preprocessing regimes: a full-image one to maintain continuity between leads and a patched one for finer local detail five. That sounds like they're trying to handle both the big picture context and the small details of each lead trace.
Lu: The segmentation part is where things get technical. They fine-tuned YOLOv11x-seg, which has around sixty-two point one million parameters, for one hundred epochs five. They used a hybrid approach combining geometric preprocessing with deep learning mask prediction to handle the noise and artifacts on those paper sheets better than just using the full image five.
Meng: If that segmentation is fast enough, it could actually make this viable. How fast are we talking about for the actual segmentation step?
Tom: For the patched YOLOv11x model, they achieved a speed of around zero point three seconds per image six <ref:2607.07683#pg2>. That’s pretty quick when you think about running inference on a CPU without needing specialized hardware.
Jane: Okay, so after they segment and detect the leads, what’s the next part? How do they get those raw pixels into something measurable and calibrated?
Lu: They have a specific step for reference pulse detection to handle scale calibration. They use a YOLOv11-based model for this, which achieved box precision and recall of one point zero zero zero five. Then they estimate pulse height relative to the baseline to get a pixel-to-millivolt conversion, typically one millivolt per ten millimeters six <ref:2607.07683#pg2>.
Title and authors: Tom: And then they use probabilistic Hough or LSD line detection to measure the pulse dimensions. They calculate final scaling factors, SV for seconds and SH for millivolts—one millivolt per hpixels and two hundred milliseconds per hpixels six <ref:2607.07683#pg2>. That’s how they turn pixels into a real time series.
Meng: So they are relying on physical markers, like calibration pulses, instead of just guessing where the grid lines are? That sounds robust against image quality issues.
Jane: Exactly. They state that this approach leverages the inherent geometric stability of calibration pulses, which keeps the scaling factors consistent even if the grid lines are faint or missing six <ref:2607.07683#pg2>. It’s a clever way to keep things stable across different scans.
Lu: Once they have these scaled leads, for diagnostic experiments, they convert those record-level signals into heartbeat windows using R-peak detection six <ref:2607.07683#pg2>. They extract fixed segments of one hundred fifty milliseconds before the R peak and three hundred milliseconds after it.
Tom: That's where the temporal alignment happens. They normalize each lead independently, per-lead, to reduce gain variability so that what you see in the data reflects the actual heart morphology rather than just how bright a specific pixel was six <ref:2607.07683#pg2>.
Jane: This normalization is key because it means when we look at the final classification, like for Myocardial Infarction detection, we aren't just looking at absolute voltage numbers.
Lu: Right. They resample all these signals to the canonical PTB-XL sampling rate of five hundred Hertz and map them back to the standard twelve-lead ordering six <ref:2607.07683#pg2>. It makes everything comparable.
Meng: So they are setting up the data for a classifier that expects clean, standardized input, even though it starts from a messy paper scan? That’s the hard part.
Tom: The system is trained and evaluated on PTB-XL dataset with twenty-one thousand seven hundred ninety nine ECGs <ref:2607.07683#pg2>. They also validated it on the hospital-acquired ECG-Matrix dataset for OMI detection, achieving an accuracy of eighty-eight point eighty-nine percent F1 score <ref:2607.07683#pg2>.
Jane: So we have accuracy numbers here, but what’s the naive question a listener would ask? Does this work well on real-world hospital scans versus just the synthetic PTB-XL data they used for training?
Lu: The paper explicitly tests generalization by generating digitized time series using the same pipeline but without re-training to real hospital paper ECG images, like ECG-Matrix six <ref:2607.07683#pg2>. They benchmarked their classifier performance across four blocks: MI vs. Normal on PTB-XL, Pre vs. Post-procedural MI on ECG-Matrix, and OMI vs. non-OMI on ECG-Matrix six <ref:2607.07683#pg2>.
Meng: That’s smart testing against real data, but what about interpretability? If the AI flags a patient as having an issue, how do we know why?
Title and authors: Tom: They use an MLP plus SHAP interpretability workflow for all three binary endpoints. They reconstruct recordings, trim them down to R-peak aligned heartbeat windows, and then z-score normalize per lead six <ref:2607.07683#pg2>.
Jane: And the SHAP values are computed using a background of fifty training beats and evaluated on one hundred randomly selected test beats to pinpoint which lead and time contributes most to the prediction. That gives clinicians a way to see the evidence.
Lu: The strongest SHAP attributions for MI detection on PTB-XL concentrate around the QRS complex and early ST segment, which makes sense because that's where depolarization and early ischemia-sensitive morphology are shown six <ref:2607.07683#pg2>.
Meng: How does that compare to other approaches? If I’m deploying this in a production environment, what are the practical limitations we should be worried about?
Tom: The paper notes they have limited methodological details for multiple layouts, but the overall pipeline aims for low resource use. They say the complete system runs in roughly twenty-five to thirty seconds per ECG on a CPU-only Intel Core i9-13900H laptop six <ref:2607.07683#pg2,on a CPU-only Intel Core i9-13900H laptop>.
Jane: So it’s designed specifically to be low resource, which is a huge win for accessibility. But they are also clear about what they can't do in terms of layout recovery complexity.
Lu: They acknowledge that lead name detection has been advanced using Optical Character Recognition or deep learning models three <ref:2607.07683#pg2>. But the layout inference process itself reached an overall accuracy of ninety-three point five percent six.
Meng: A ninety-three point five percent layout classification sounds okay, but in a high-stakes clinical setting, we need near perfection. What about the data availability? Is this something we can actually use outside of a research lab?
Lalam: The PTB-XL dataset is publicly available on PhysioNet at https://physionet.org/content/ptb-xl/one point zero.three/six <ref:2607.07683#pg2>. And the code for the end-to-end paper ECG workflow is available at https://github.com/SCAI-Lab/ECGLight six <ref:2607.07683#pg2>.
Tom: So to wrap up, ECGLight provides an end-to-end framework that handles everything from digitization to MI screening, all while being compute light and on device. It transforms physical paper ECGs into actionable digital biomarkers through this resource efficient workflow six <ref:2607.07683#pg2>.
Jane: It really does expand access to automated cardiovascular screening in remote or under-resourced clinical settings by making it possible to do the heavy lifting locally.
Lu: The framework’s defining feature is its suitability for low-resource, offline deployment where both digitization and downstream inference can be performed on CPU-only hardware six <ref:2607.07683#pg2>.
Meng: It’s a tool that aims to expand access to lightweight AI-enabled cardiovascular screening by transforming legacy paper ECGs into digital time series through this end-to-end workflow.
Lalam: The entire system is designed to handle the complexity of waveform extraction, reference pulse calibration, layout recovery, and downstream MI classification all in one pipeline six <ref:2607.07683#pg2>.
The paper's summary: Tom: So we're looking at ECGLight, and the core idea is taking a physical paper ECG, scanning it, and getting you a calibrated twelve-lead signal ready to check for heart problems.
Jane: That's right. The authors are trying to build an end-to-end pipeline that does all of that—from the scan all the way to the final diagnosis—but they're focusing on making it super lightweight, something you could actually run on a regular CPU without needing a massive server farm.
Lu: They’re using this combination of models, starting with YOLO for segmentation and then using lead name detection to figure out where each lead is on the page. It’s like building a whole digital map of the paper ECG in one go.
Meng: I'm interested in how fast it is, because if it takes too long to process a scan, it doesn't matter how accurate you are if you can't deploy it quickly in a clinic.
Tom: And they claim that the entire system runs under thirty seconds per ECG on just CPU resources. That’s pretty aggressive for something doing all that complex image processing.
Jane: But what they really care about is the accuracy numbers. They tested it on two different types of data, PTB-XL synthetic ones and a hospital-acquired set called ECG-Matrix.
Lu: On PTB-XL, they hit ninety-five point five one percent accuracy for MI detection. That's solid for a synthetic dataset comparison.
Tom: And on the real ECG-Matrix data, they get eighty-eight point eight nine percent F1 score just for detecting OMI—acute myocardial infarction—which is a good result when you move from synthetic to something closer to reality.
Jane: The big thing they add is interpretability using SHAP values. This means if the AI says there's a problem, you can look at why it made that decision.
Lu: They use an MLP with SHAP to show which parts of the waveform—like the QRS complex or early ST segment—are driving the prediction for MI versus Normal. It gives a visual reason for the output.
Meng: That’s useful because in production, you can't just deploy a black box. You need to know if it’s looking at the right part of the signal or if it’s getting confused by some artifact on the paper itself.
Tom: And they also addressed scaling issues by using physical reference pulses for calibration instead of relying solely on grid lines, which keeps the measurements consistent even if the scan quality is low.
Jane: So, to sum up, ECGLight isn't just a classifier; it’s a complete system that turns a physical paper ECG into an actionable digital biomarker in an offline setting.
Lu: It’s designed specifically for low-resource deployment where connectivity isn't guaranteed, which is its main practical selling point.
Meng: I still see the challenge being the complexity of handling every possible paper layout, but if they can keep that pipeline under thirty seconds and provide those clear SHAP explanations, it could genuinely change how you screen patients remotely.
The paper's improvements: Tom: So, moving past just saying they have an end-to-end pipeline, what are the actual improvements they suggest in this ECGLight framework?
Jane: Well, one of the big takeaways is how they handle that segmentation. They introduce a hybrid strategy that combines geometric preprocessing with deep learning mask prediction.
Lu: They found that this hybrid approach is much better at preserving fine trace structure on those high-resolution and noisy paper sheets compared to just using the full image upsampling.
Meng: So they're saying combining the two methods—the grid-based context and the pixel-level learning—tames those artifacts way better than relying on one method alone.
Tom: And then there's their scaling mechanism for amplitude. They’ve moved away from using grid lines for calibration and are using a reference pulse detection method instead.
Jane: That’s important because it means the scaling factors, like the pixel-to-millivolt conversion, remain consistent even when the grid lines on the paper are faint or missing entirely.
Lu: They use this physical grounding to ensure that they get consistent amplitude and time scaling across all different layouts and various scan qualities.
Meng: That's a huge win for deployability because it means you don't need perfect image quality for the calibration step to work reliably.
Tom: For the diagnostic part, they improved how they prepare the data by normalizing each lead independently on a per-lead basis.
Jane: That normalization is key because it reduces gain variability, meaning when you feed that data into your classifier, you're looking at actual heart morphology instead of just how bright one specific pixel was.
Lu: They then resample everything to the canonical PTB-XL sampling rate of five hundred Hertz and map it back to the standard twelve-lead ordering for consistency.
Meng: So they’ve made sure the final input is in a standardized format, which means their downstream classifiers should perform better across different scans than if you just fed them raw pixel data.
Tom: The authors also explicitly tested how this whole pipeline generalizes to real hospital ECG images like ECG-Matrix, not just the synthetic PTB-XL data they trained on.
Jane: That testing showed that the system still works reasonably well when applied to those more complex, real-world clinical scans without needing to retrain it from scratch.
Lu: They benchmarked their classifier performance across four different scenarios: MI versus Normal, pre-procedural versus post-procedural MI, and OMI versus non-OMI on that hospital data.
Meng: That validation against real, messy data is what I need to see before I'd even think about putting this in a production environment where things are unpredictable.
Tom: And for the interpretability side, they refined the SHAP workflow by evaluating it on randomly selected test beats rather than just a few training beats.
Jane: That gives you a better idea of how the model behaves across different cardiac cycles, which helps clinicians localize exactly what feature is driving that prediction.
Lu: They found that the strongest evidence for MI detection consistently concentrates around the QRS complex and early ST segment, which confirms what we expected from cardiology.
Meng: So they’ve built a framework that is not just accurate on paper but also robust enough to be explained in a way doctors can actually use.
Conclusion: Tom: So to wrap up, ECGLight is an end-to-end framework that handles everything from scanning paper ECGs to screening for myocardial infarction pathologies all while being compute light and on device.
Jane: It’s really about taking something that was traditionally slow and expensive—paper ECG analysis—and making it accessible by putting the heavy lifting right onto a CPU-only machine.
Lu: The core implication here is making automated cardiovascular screening viable in remote or under-resourced clinical settings where high connectivity isn't an option.
Meng: I agree, because the fact that you can get a calibrated digital time series from just a smartphone photo means you could potentially have diagnostic decision support right at the point of care.
Tom: And it does that by combining robust segmentation with physical pulse calibration, which keeps the measurements stable regardless of scan quality.
Jane: Plus, with SHAP values providing interpretability, clinicians can actually see *why* the AI flagged a specific area as problematic in the waveform.
Lu: The paper shows that this single pipeline addresses waveform extraction and diagnosis together in a very integrated way.
Meng: It’s resource-efficient enough to run on standard hardware, which is what matters when you think about deployment cost and scale.
Tom: So for anyone interested in how we turn legacy paper ECGs into actionable digital biomarkers through this end-to-end workflow, ECGLight is a solid example.
Jane: It definitely opens the door for automated screening where access to high-end compute isn't guaranteed.
Lu: It’s a solid foundation for making these kinds of tasks practical in the field.
Meng: We need to see how this scales when we start dealing with highly variable, real hospital data sets, though that’s the next hurdle.
Tom: Right, so we'll keep an eye on how this framework performs as we look at more complex clinical scenarios.
More episodes
- 2610.07475-Adapting to Changes in Agent Behavior via Finite-Depth Policy Sensitivity
- 2610.07458-Interpretable Hypergraph Learning via Neural Additive Models
- 2610.07485-Robust Importance Sampling for Rare Events via Constrained Gaussian Mixtures
- 2610.07499-Source-Learned Reliance for Selective Test-Time Adaptation of Multimodal Time Series
- 2610.07602-A Neural JKO Scheme for Hellinger-Kantorovich Gradient Flows via Monge-Growth Pairs
- 2610.07662-MS-ECG-FM: Towards a More Universal Electrocardiogram Foundation Model for Health Monitoring using Multi-source Contrastive Learning
- 2610.07610-Hub for Outliers, Spokes for Inliers: Uniform Latent Space Construction for Dual-Mismatched Semi-Supervised Learning
- 2610.07825-Forecast Accuracy Is Not Trading Profit: Evolving Small Recurrent Networks for Stock Return Prediction
- 2610.07529-Targeted search shows that random-device testing underestimates worst-case error in a simulated wave-based neural operator
- 2610.07559-TAFFY: A Task-Adaptive Tabular Foundation Model with In-Context Diversity