A method for extracting heartbeat cycle and numerical signals from ECG captured images
Higher Education Press
image: Processing flow of ECG-I2S
Credit: HIGHER EDUCATON PRESS
Heart disease remains the leading cause of death worldwide, and although electrocardiography (ECG) is critical for diagnosis, interpreting ECG signals requires extensive training. Current machine learning methods for ECG interpretation rely on raw numerical data, but ECGs are often only available in printed form in real clinical settings, posing challenges for signal extraction.
To solve the problems, a research team led by Xiongjun Zhao published their new research on 15 August 2025 in Frontiers of Computer Science co-published by Higher Education Press and Springer Nature.
The team proposed an open-source Python toolkit for transforming ECG captured images into numerical signals. ECG-I2S provides a method for extracting heartbeat cycles and numerical signals from ECG captured images and allows diagnosis of cardiac problems based on the extracted signals with a complete ECG processing framework.
The overview of ECG-I2S is shown in Figure, which encompasses five steps: ECG Image Input, Image Pre-processing, Signal Pre-processing, Extracting Heartbeat Cycles and Signal Downscaling.
ECG-I2S uses streamlit to create a front-end interface that allows users to directly upload photos to be processed and manually crop them for ECG signal recognition and prediction. ECG-I2S uses some libraries such as opencv, PIL, etc. to process the images of each stage in detail, and users can clearly view the extraction process and prediction process of ECG signals in the front-end interface. In accordance with the heartbeat cycle law, ECG-I2S identifies and extracts the valid regions within the current ECG, accurately delineating the complete heartbeat cycle through the identification of peaks and troughs. Furthermore, the P, QRS, and T waves are fully extracted and utilized.
The source code is available at https://pypi.org/project/i2s-ecg/ , along with extensive documentation and examples. For convenient installation, users can directly install it from PyPI by executing the command pip install i2s-ecg.
Disclaimer: AAAS and EurekAlert! are not responsible for the accuracy of news releases posted to EurekAlert! by contributing institutions or for the use of any information through the EurekAlert system.