top of page

Lepakshi ECG Annotator: A Complete Pipeline for Labeling, Digitizing and Validating ECG Leads

Intuitus has released the Lepakshi-ECG Annotator Beta, a compact windows application designed for fast, accurate annotation of 12-lead ECG images. While the current version focuses on interactive bounding-box creation and JSON export, we are excited to preview a major breakthrough in our upcoming, yet-to-be-released version: the ability to use the software not just for annotation, but as high-fidelity grid removal engine for downstream Deep Learning models.

The Lepakshi Workflow: From Manual Effort to Automated Precision

The power of Lepakshi software lies in its ability to support the entire lifecycle of an ECG digitization project. The process follows a structured path from human oversight to machine driven cleaning:

  1. Launch & Manual annotation: start the Lepakshi Annotator to mark Regions-of-Interest (ROI) on a sufficient number of images using "rubber-band" mouse technique.

  2. Yolo Training: Export these annotations as JSON files to train a YOLO (You only Look Once) algorithm for object detection.

  3. Model Validation: Once the YOLO model achieves sufficient quality in accurately drawing bounding boxes during the training phase, the model is saved.

  4. Automated Inference: Utilize the saved YOLO model in inference mode to process large sets of ECG images automatically, drawing bounding boxes on regions of interest (ROI) that were not included in the initial training set.

  5. Targeted Grid Removal: After all images are properly annotated (either manually or via YOLO), the same Lepakshi software is used to process these ROIs. It surgically removes gridlines within those boxes or ROIs, preparing the clean signals for ingestion into downstream ML/DL models.

Why ROI-Based Cleaning Wins

To understand the value of this update, we can compare the processing states:

  • Global Processing: Attempting to clean an entire page often leaves "dotted" artifacts or inconsistent textures because the filter is applied blindly. Refer Figure 2.0.

  • Targeted ROI Processing: By isolating the leads after the YOLO algorithm or a human has drawn the bounding boxes, Lepakshi focuses its computational power only on the signal. The result is a high-contrast black signal on a pure white background. Refer Figure 3.0.

    Figure 1.0 ROI marked using Lepakshi

    Figure 2.0 Applying the filter to an entire page indiscriminately leads to "dotted" artifacts or uneven textures.

Figure 3.0: Focused ROI Processing Targeted ROI Processing: Once the bounding boxes are defined by either the YOLO algorithm or a human, Lepakshi directs its computational power exclusively towards the signal. This approach yields a high-contrast black signal set against a pure white background.

The Science Behind the Score: QualityScoreDebug

In the upcoming version of Lepakshi-ECGAnnotator, the QualityScoreDebug system provides a rigorous mathematical framework for validating digital signal integrity. Every time a lead is processed, the software calculates a fidelity score (0.0 to 1.0) based on several technical metrics:


  • Grid Suppression Efficiency (grid_score): This metric is inversely proportional to the grid_density found within the ROI. The algorithm calculates horizontal and vertical pixel densities h_density and v_density to ensure the red/pink grid pattern has been successfully neutralized.


  • Background Cleanliness (background_score): This score assesses brightness_score (mean pixel value) and uniformity_score (standard deviation). A high score means the background is a pure, consistent digital white.


  • Signal Clarity & Fidelity (clarity_score): Derived from edge_density using Canny edge detection. This ensures that the morphology of the ECG signal—the P, QRS, and T waves—remains sharp and has not been eroded or thinned by filtering.


  • Artifact & Noise Detection (noise_score): Measures the noise_level to identify high-frequency "salt-and-pepper" distortions. This prevents downstream models from training on random digital noise introduced during digitization.

Sample Lead Quality Report

Based on a sample run of 13 regions of interest, the software provides precise feedback per lead:

Lead

Final Score

Grid Removal

Background

Clarity

Noise


aVR 



0.9212 



0.9708



1.0000



0.8315



0.8254



III 



0.9189 



0.9570


1.0000



0.8452



0.8247



II 



0.9159 



0.8917



1.0000



1.0000



0.7689



V3 



0.8607 



0.7558



1.0000



0.9480



0.7828



aVL 



0.7983 



0.9660



0.5976



1.0000



0.5539

One Tool One Workflow

The most Significant advantage is that same Lepakshi Annotator Software serves as both labeling interface and grid removal engine. This level of flexibility allows one to build "validated-only" datasets by filtering for leads with high "final_score" values, moving ECG digitization to a validated, high-fidelity data pipeline.

Explore the current tool here:

Stay tuned for the official release of the integrated ROI-Grid Removal version!


Recent Posts

See All
bottom of page