Paper electrocardiogram digitization method and electronic device
Patent Information
- Application Number
- CN202512020783.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-30
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2045-12-30
AI Technical Summary
本发明构建了纸质心电图模板库,并通过模板分类器自动识别输入图像的模板类型,使得能够处理不同厂家、不同纸张规格、不同布局格式的心电图,大幅提升适配性与通用性,避免人工配置模板带来的不稳定性。
Smart Images

Figure CN122066610B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical image digitization technology, specifically to a method and electronic device for digitizing paper electrocardiograms. Background Technology
[0002] Electrocardiography (ECG) is a fundamental tool for assessing cardiac electrophysiological activity in clinical settings and is widely used in medical institutions at all levels. Despite the increasing prevalence of electronic ECG equipment, a large number of historical and current ECGs are still stored in paper form. While paper ECGs offer advantages such as intuitiveness, low cost, and strong compatibility, they also suffer from problems like fading, damage, and inconvenience in storage and analysis. With the development of electronic medical record systems, telemedicine, and AI-assisted diagnosis, the efficient and accurate conversion of paper ECGs into digital signals has become a crucial requirement for medical informatics.
[0003] Existing methods for digitizing paper-based electrocardiograms (ECGs) mainly include grid detection and waveform extraction methods based on traditional image processing, denoising and geometric correction methods based on statistical features, and image segmentation and reconstruction methods based on deep learning. However, these methods are often highly dependent on ECG template formats, making it difficult to adapt to the diverse operating conditions generated by different hospitals and equipment. In addition, most existing methods use simple translation and other single transformation methods, which are insufficient to eliminate rotation, scaling, perspective distortion, and local deformation of the scanned image. This results in calibration errors in the time and amplitude axes of the digitized signal, affecting subsequent analysis and diagnosis. Summary of the Invention
[0004] To overcome the shortcomings of the prior art, the present invention provides a paper electrocardiogram digitization method and electronic device, which realizes automatic adaptation and high-fidelity signal recovery of paper electrocardiograms of various formats by identifying matching templates corresponding to the input image, aligning the input image based on the matching templates, and then digitizing it.
[0005] According to one aspect of the present invention, a method for digitizing a paper electrocardiogram (ECG) is proposed, comprising the following steps: S1, based on a pre-constructed paper ECG template library, a template classifier is used to identify a template matching the input paper ECG scan image I in the paper ECG template library to obtain a matching template, wherein the template stores standard lead start points, standard grid points, lead region information, and physical scale information; S2, the image lead start points and image grid points of the paper ECG scan image I are detected, and an alignment operation is performed on the paper ECG scan image I based on the standard lead start points, standard grid points, the image lead start points, and the image grid points of the matching template to obtain an aligned image; S3, the aligned image is digitized to obtain a set of digitized signals of the paper ECG scan image I.
[0006] In accordance with the above, more specifically, the template classifier adopts a ResNet-based deep learning model and is obtained through supervised training using a training dataset containing multiple classes of paper electrocardiogram scan images and their corresponding template index annotations.
[0007] More specifically, the alignment operation in step S2 includes a coarse alignment operation and a fine alignment operation. The coarse alignment operation is based on the correspondence between the image lead start points detected in the paper electrocardiogram scan image I and the standard lead start points in the matching template, and obtains a coarsely aligned image through geometric transformation. The fine alignment operation is based on the correspondence between the image grid points detected in the coarsely aligned image and the standard grid points in the matching template, and obtains a geometrically aligned image by constructing a nonlinear geometric transformation and applying the nonlinear geometric transformation to the coarsely aligned image.
[0008] More specifically, the coarse alignment operation is performed by detecting the coordinates of the image lead start points of the paper electrocardiogram scan image I. ,in Given the number of leads; calculate the affine matrix. ,make Minimum, of which To match the standard lead start point coordinates of the template; combined with the affine matrix and affine transformation operators The paper electrocardiogram scan image I is transformed to obtain a coarsely aligned image. .
[0009] More specifically, based on the above aspects, the lead start point of the paper electrocardiogram scan image I is detected by a lead start point detector. The lead start point detector adopts a U-Net-based deep learning model and is obtained through supervised training using a training dataset containing multiple types of paper electrocardiogram scan images and their lead start point coordinates and lead category labels.
[0010] More specifically, the fine alignment operation is performed by detecting the coarse alignment image. Image grid point coordinates ,in Given the total number of grid cells; calculate the nonlinear transformation function. ,make Minimum, of which To match the standard grid point coordinates of the template; coarsely align the image. Through nonlinear transformation function Processing to obtain an aligned image .
[0011] In accordance with the above, more specifically, the grid points of the coarsely aligned image are detected by a grid point detector, which employs a U-Net-based deep learning model and is trained under supervision using a training dataset containing multiple types of paper electrocardiogram scan images and their grid point coordinate annotations.
[0012] Based on the above, more specifically, the digitization in step S3 includes: dividing the lead region information from the alignment image according to the lead region information corresponding to the matching template. An image sub-region of a lead, wherein the lead region information includes the vertex coordinates and width and height information of the lead region; the image sub-region is converted into a digital signal, and the resulting digital signal set is output.
[0013] More specifically, the step of converting the image sub-region into a digital signal includes: performing binarization processing on the image sub-region to separate the foreground ECG signal region from the background; extracting the pixel coordinate sequence of the waveform trajectory from the foreground ECG signal region; and converting the pixel coordinate sequence into a digital voltage-time signal with physical units through a linear mapping relationship between pixels and physical quantities, based on the physical scale information corresponding to the matching template, wherein the physical scale information includes the vertical voltage scale and the horizontal time scale of the template.
[0014] According to another aspect of the present invention, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein the processor, when executing the computer program, implements the paper electrocardiogram digitization method of the present invention described above.
[0015] The beneficial effects of this invention are as follows: This invention constructs a paper-based electrocardiogram (ECG) template library and automatically identifies the template type of the input image through a template classifier. This enables the processing of ECGs from different manufacturers, with different paper sizes and layout formats, greatly improving adaptability and versatility, and avoiding the instability caused by manual template configuration.
[0016] This invention employs a phased alignment strategy. By first performing a coarse alignment operation on the input image and then performing a fine alignment operation on the coarsely aligned image, it can effectively correct problems such as rotation, scaling, and perspective distortion caused by scanning, ensuring that the final grid scale is consistent and the lead position is accurate, thereby ensuring that the time axis and amplitude axis have high calibration accuracy during digital signal extraction.
[0017] This invention utilizes precisely calibrated grid information, combined with the physical properties of the lead regions, to accurately recover the absolute amplitude and time coordinates of waveform points on an electrocardiogram (ECG). Compared to traditional image pixel ratio restoration methods, it significantly reduces quantization errors, making the recovered signal closer to the actual acquired ECG. This invention can be used in professional scenarios such as diagnostic algorithms and physician image interpretation.
[0018] Traditional digitization processes often require manual specification of lead ranges, grid calibration, and template confirmation. The automatic identification, alignment, and digitization process proposed in this invention allows users to generate standardized digital electrocardiogram (ECG) data with a single click simply by inputting a scan image, significantly reducing manual intervention and improving work efficiency. Attached Figure Description
[0019] Figure 1 This is a flowchart of the paper electrocardiogram digitization method according to the present invention.
[0020] Figure 2 This is a system flowchart of the paper electrocardiogram digitization method according to the present invention.
[0021] Figure 3 This is an image alignment flowchart of the paper electrocardiogram digitization method according to the present invention.
[0022] Figure 4 This is a flowchart of the lead digitization process of the paper electrocardiogram digitization method according to the present invention.
[0023] Figure 5 It is an original damaged paper electrocardiogram scan image according to a specific embodiment of the present invention.
[0024] Figure 6 This is an image after the lead start point is marked according to a specific embodiment of the present invention.
[0025] Figure 7 This is a coarsely aligned image according to a specific embodiment of the present invention.
[0026] Figure 8 This is an intermediate image after grid point marking according to a specific embodiment of the present invention.
[0027] Figure 9 This is the final image after fine alignment according to a specific embodiment of the present invention.
[0028] Figure 10 This is a schematic diagram of the lead region division according to a specific embodiment of the present invention.
[0029] Figure 11 It is a digital signal image according to a specific embodiment of the present invention.
[0030] Figure 12This is a structural block diagram of a paper-based electrocardiogram digital electronic device according to the present invention. Detailed Implementation
[0031] like Figure 1 and Figure 2 As shown, according to the present invention, a method for digitizing paper electrocardiograms (ECGs) is provided, comprising the following steps: S1, based on a pre-constructed paper ECG template library, a template classifier identifies a template in the paper ECG template library that matches the input paper ECG scan image I, obtaining a matching template, wherein the template stores standard lead start points, standard grid points, lead region information, and physical scale information; S2, the image lead start points and image grid points of the paper ECG scan image I are detected, and an alignment operation is performed on the paper ECG scan image I based on the standard lead start points, standard grid points, the image lead start points, and the image grid points of the matching template, obtaining an aligned image; S3, the aligned image is digitized to obtain a digitized signal set of the paper ECG scan image I. According to this embodiment, the present invention solves the format adaptation problem through template matching and the geometric distortion problem through reference point alignment, enabling the present invention to adapt to paper ECGs of different formats and sources, breaking the limitation of adaptation to a single template and improving the versatility of the method.
[0032] In one embodiment of the present invention, the template classifier employs a ResNet-based deep learning model, obtained through supervised training using a training dataset containing multiple classes of paper electrocardiogram scan images and their corresponding template index annotations. Specifically, data collection is first performed, supporting N types of templates. Before formal deployment, each template image is... Multiple paper-based electrocardiogram (ECG) scans (I) were collected and augmented using data augmentation techniques to create M scans for each category. Then, N×M scans were labeled with N categories. Finally, the labeled data was fed into the deep learning model RESNET for training, resulting in a usable template classifier. .
[0033] It's worth noting that when a new template is needed, multiple paper-based electrocardiogram (ECG) scan images (I) can be acquired for the new template, and data augmentation techniques can be used to augment the category to M scan images. The new data is then mixed with the initial template training data, and the current category is labeled as category N+1. Finally, the original template classifier is fine-tuned to obtain a new version of the template classifier. When a new ECG scan image (I) is acquired, the image is fed into the template classifier. This allows us to determine the template category to which the input image I belongs. .
[0034] The RESNET network architecture used in this invention is as follows: Input Layer: Receives 3×H×W dimension image data; the data is sequentially processed through 7×7 convolutional kernels, batch normalization, and ReLU activation function; dimensionality reduction is performed through a max pooling layer with a stride of 2 to prepare for entering the deep residual network; Residual Layers: Composed of 4 stages, internally integrating a BasicBlock structure. The number of channels doubles with increasing layer depth (from 64 to 512). The residual block structure consists of parallel residual branches and shortcut branches. In the residual branch, the input data passes sequentially through the first 3x3 convolutional layer, batch normalization layer, and ReLU activation function, then enters the second 3x3 convolutional layer and batch normalization layer. In the shortcut branch, the input data is directly transmitted across the convolutional layers to the end. The outputs of the two branches are element-wise added together after the second normalization layer and before the final activation. The merged result is then output after passing through the final ReLU activation function. Output Layer (Classification Head): Global Adaptive Average Pooling is used to map the 512×H / 32×W / 32 feature map into a 512-dimensional global feature vector. The feature vector is fed into the final fully connected layer (Linear), whose output dimension is set to 10 (corresponding to 10 target categories).
[0035] According to this embodiment, the present invention uses the deep learning RESNET architecture to build a template classifier. By leveraging its powerful feature extraction and classification capabilities, it achieves fast and accurate recognition of different template types, with a recognition accuracy significantly higher than that of traditional image processing methods. The residual connection design of the RESNET architecture effectively alleviates the gradient vanishing problem of deep networks, ensuring that the classifier maintains stable performance in multi-template scenarios, and providing reliable template support for subsequent alignment and digitization steps.
[0036] like Figure 3As shown, in one embodiment of the present invention, the alignment operation in step S2 includes a coarse alignment operation and a fine alignment operation. The coarse alignment operation is based on the correspondence between the image lead start points detected in the paper ECG scan image I and the standard lead start points in the matching template, and obtains a coarsely aligned image through geometric transformation. The fine alignment operation is based on the correspondence between the image grid points detected in the coarsely aligned image and the standard grid points in the matching template, and obtains a geometrically aligned image by constructing a nonlinear geometric transformation and applying it to the coarsely aligned image. According to this embodiment, the present invention proposes a phased alignment strategy of coarse and fine alignment, using lead start points and grid points as references respectively, forming a correction logic that first corrects overall distortion and then optimizes local details. This effectively solves the problems of rotation, scaling, perspective distortion, and local non-rigid transformation of scanned images. Moreover, fine alignment performs grid point detection based on the coarsely aligned image, avoiding the influence of original image distortion on grid point detection accuracy, ensuring the correction effect of fine alignment, and laying the foundation for high-precision digitization.
[0037] In one embodiment of the present invention, the coarse alignment operation is performed by detecting the coordinates of the image lead starting points of the paper electrocardiogram scan image I. ,in Given the number of leads; calculate the affine matrix. ,make Minimum, of which To match the standard lead start point coordinates of the template; combined with the affine matrix and affine transformation operators The paper electrocardiogram scan image I is transformed to obtain a coarsely aligned image. .
[0038] According to this embodiment, calculating the affine matrix can effectively eliminate outliers in lead start point detection, ensuring the coarse alignment's corrective effect on overall distortion; affine transformation operator Transforming the original image using the optimal affine matrix can quickly correct overall geometric distortions such as rotation, translation, and scaling, ensuring precise matching between the lead start point and the template reference point; coarsely aligning the image. The acquisition of this data provides a low-distortion image basis for subsequent grid point detection, reduces the difficulty of local alignment correction, and improves the efficiency and accuracy of the overall alignment process.
[0039] In one embodiment of the present invention, the lead start point of the paper electrocardiogram scan image I is detected by a lead start point detector. The lead start point detector adopts a U-Net-based deep learning model and is obtained through supervised training using a training dataset containing multiple types of paper electrocardiogram scan images and their lead start point coordinates and lead category labels. Specifically, firstly, the N×M scan images I obtained in the template classifier stage are labeled according to their respective template categories. By marking the positions of the lead text, the lead starting points of scan image I can be obtained. The labeled data is then fed into UNeT for training, resulting in a usable lead initiation detector. To improve the lead origin classifier Its generalizability means that during the application phase, it is not necessary to use all lead initiation points; instead, a unified approach can be used. Describes the lead start point for image detection. When a new ECG scan image I is acquired, the image is sent to the lead start point to obtain the lead start point of the input image I. .
[0040] The UNet network architecture used in this invention is as follows: Input layer: Receives 3×H×W dimension image data, which is normalized by predefined mean and standard deviation before being input into the encoder for feature extraction; Encoder: The ResNet18d pre-trained model is used as the backbone network. Multi-scale features are extracted through four residual layers (Layer 1-4), and the number of output channels are [64, 128, 256, 512], respectively. The Decoder employs a symmetrical upsampling structure, comprising four decoding modules. Each module performs a 2x upsampling through nearest neighbor interpolation. Each layer receives skip connection features from the corresponding Encoder, preserving spatial details through concatenation. Each layer consists of a dual convolutional structure (3×3 Conv + BN + ReLU), with the number of channels decreasing sequentially to [256, 128, 64, 32]. Output Layer: Consists of a 1×1 convolutional layer.
[0041] Lead start point detector The 32-dimensional feature output of the Decoder is mapped to 13 channels (representing 12 lead categories + 1 background category).
[0042] According to this embodiment, the lead start point detector based on the deep learning UNet architecture of the present invention utilizes its powerful semantic segmentation capabilities to accurately locate the position of lead text, thereby accurately identifying the lead start point, with a detection accuracy higher than traditional feature matching methods. The training method using the lead text position as annotation information enables the detector to adapt to lead text of different fonts, sizes, and colors, avoiding detection failures due to differences in text style. The encoder-decoder structure and skip connection design of the UNet architecture can preserve the detailed information of the image, ensuring accurate detection of the lead start point even when the image has creases, fading, or noise interference, thus improving the robustness of the method.
[0043] In one embodiment of the present invention, the fine alignment operation is performed by detecting the coarse alignment image. Image grid point coordinates ,in Given the total number of grid cells; calculate the nonlinear transformation function. ,make Minimum, of which To match the standard grid point coordinates of the template; coarsely align the image. Through nonlinear transformation function Processing to obtain an aligned image .
[0044] According to this embodiment, the present invention employs a nonlinear transformation function. Fine alignment, compared to traditional linear transformation, can better correct local non-rigid distortions in the image, making the grid scale of the aligned image consistent and the lead position accurate. By calculating the nonlinear transformation function through the rectify_image operator, the matching error of the grid points is minimized, ensuring that the grid points of the aligned image correspond one-to-one with the template reference grid points, thus providing a guarantee for the accurate calibration of the time axis and voltage axis.
[0045] In one embodiment of the present invention, a grid point detector is used to detect the grid points of the coarsely aligned image. The grid point detector employs a U-Net-based deep learning model, trained under supervised supervision using a training dataset containing multiple classes of paper electrocardiogram scan images and their grid point coordinate annotations. Specifically, firstly, N×M scan images I obtained in the template classifier stage are labeled according to their respective template categories and grid points, thus obtaining the grid points of scan image I. The labeled data is then fed into UNeT for training, resulting in a usable grid point detector. To improve the grid point detector The generalization ability of the template cannot guarantee the detection of all grid points during the application phase, which may lead to inconsistencies between the template and the image. To ensure consistency in describing the detection points in the image, a unified approach is adopted. Describes the grid points detected in the image. When ECG scan image I is acquired, the coarsely aligned image is obtained after coarse alignment based on the lead start points. , Will The image is fed into a grid detector to obtain a coarsely aligned image. grid points Similar to the lead origin detector based on the deep learning UNet architecture. Similarly, grid point detector The 32-dimensional features of the final output of the Decoder are mapped to one channel.
[0046] According to this embodiment, the grid point detector used in this invention is based on the UNet architecture and uses the grid point positions of the coarsely aligned image as annotation information, which can accurately identify the intersections of grid lines and avoid the influence of original image distortion and noise on grid point detection. The multi-scale feature extraction capability of the UNet architecture enables the grid point detector to adapt to paper electrocardiograms with different grid densities and line thicknesses, and the detection results are stable and reliable. When the grid point detector detects coarsely aligned images, it can focus on local grid details, improve the detection density and accuracy of grid points, provide sufficient reference points for fine alignment, and ensure effective correction of local distortions.
[0047] like Figure 4 As shown, in one embodiment of the present invention, the digitization in step S3 includes: based on the lead region information corresponding to the matching template, for example using a lead region segmentation operator. From aligned images The image sub-region of the k-th lead is divided into segments. The guide region information includes vertex coordinates (x, y) and width and height information w and h. The image is described by four points (x, y) + (w, h). From (x, y) + (w, h), a bounding box can be obtained with four points (x, y), (x+w, y), (x, y+w), and (x+w, y+h), where k corresponds to the corresponding lead. This sub-region of the image... Convert to digital signal And output the resulting set of digital signals. ,in .
[0048] According to this embodiment, the present invention divides image sub-regions based on lead region information of a matching template. This ensures consistency in lead region division across different templates and ECG formats, giving the digital signal a unified dimension and range. Precise division of lead sub-regions effectively eliminates irrelevant background information and interference from other leads, ensuring that subsequent signal extraction is only targeted at the target lead, thus improving the purity and accuracy of the digital signal.
[0049] In one embodiment of the present invention, the image sub-region Convert to digital signal This includes, for example, binarizing image subregions using the Otsu binarization operator. Binarization is performed to separate the foreground ECG signal region from the background, and the foreground ECG signal region after background removal is obtained. From the foreground ECG signal region Extract the pixel coordinate sequence P of the waveform trajectory. , for The pixel domain; based on the physical scale information corresponding to the matching template, the pixel coordinate sequence is converted into a digital voltage-time signal with physical units through a linear mapping relationship between pixels and physical quantities. The physical calibration information includes the longitudinal voltage calibration of the template. and horizontal time scale . The expression is as follows:
[0050] in This represents the interpolation operator.
[0051] According to this embodiment, the binarization processing used in this invention can effectively remove interference factors such as image background noise, creases, and fading, and obtain a clean signal image. The physical scale information explicitly includes vertical voltage and horizontal time scales, ensuring that the conversion from pixel position to digital signal is based on real physical units, rather than simply pixel ratios, significantly reducing quantization errors. This physical scale-based digitization conversion ensures that the output digital signal... It can accurately reflect the real time and voltage information of cardiac electrophysiological activity, meet clinical diagnostic criteria, and can be directly used by doctors to read images, screen for diseases, and provide intelligent assisted diagnosis.
[0052] A specific embodiment of the present invention is described below.
[0053] like Figure 5 As shown, a hospital needs to digitize 12-lead paper electrocardiograms with serious quality problems such as stains, holes, and blurriness in order to incorporate them into the electronic medical record system and support subsequent clinical analysis. The paper electrocardiogram digitization method of the present invention is used to process them.
[0054] Step 1: Template Classification and Matching The input image is as follows Figure 5 The damaged paper electrocardiogram scan image shown has problems such as holes, stains, and blurred leads. Template library access: The template library contains commonly used 12-lead electrocardiogram templates for this hospital; Classifier matching: A template classifier based on the ResNet architecture extracts features from the input image and matches the corresponding 12-lead template (template index). Simultaneously acquire the standard lead start point set, standard grid point set, and physical scale information of the template.
[0055] Step 2: Multi-stage image alignment Phase 2.1: Coarse Alignment Lead start point detection: A lead start point detector based on the UNet architecture is used to detect key points in the input image and extract the actual start points of 12 leads, such as... Figure 6 The starting positions of leads such as aVR and V1 are marked in the middle; Affine transformation solution: Calculate the affine matrix, perform an affine transformation on the input image, correct distortions such as scan skew and overall scaling, and obtain a coarsely aligned image, such as... Figure 7 As shown.
[0056] Phase 2.2: Fine Alignment Grid point detection: such as Figure 8 As shown, for a coarsely aligned image, the actual grid points are extracted using a grid point detector; Nonlinear transformation optimization: Calculate a nonlinear transformation function to perform a transformation on the coarsely aligned image, eliminating local deformations caused by holes and stains, resulting in a high-precision aligned image, such as... Figure 9 As shown.
[0057] Step 3: Lead Region Division Based on the pre-defined lead region information (vertex coordinates, width and height) in the matching template, and combined with the geometric calibration results of the aligned image, image sub-regions for 12 leads are divided from the aligned image, such as... Figure 10 As shown.
[0058] Step 4: Lead digitization Preprocessing and segmentation: Denoising and contrast enhancement are performed on each lead sub-region, followed by binarization segmentation to separate the foreground ECG signal from the background; continuous pixel coordinate sequences of the waveform are extracted. Physical scale conversion: Recall the physical scale information of the template (vertical voltage scale) =10mm / mv), horizontal time scale ( =25mm / s), converting the pixel coordinate sequence into a standardized digital voltage-time signal, such as Figure 11 As shown.
[0059] The implementation effects of the method of the present invention are as follows: damaged paper electrocardiograms with severe stains and holes are successfully converted into digital electrocardiogram signals that meet clinical standards, with a signal-to-noise ratio (SNR) of 11.359; the digitization process is fully automated, with a single image processing time of ≤1 second, which is suitable for the batch processing needs of hospital electronic medical record systems.
[0060] According to another aspect of the present invention, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein the processor implements the paper electrocardiogram digitization method of the present invention when executing the computer program.
[0061] Figure 12 A schematic diagram of the physical structure of an electronic device for implementing the paper electrocardiogram digitization method of the present invention is shown, as follows: Figure 12 As shown, the electronic device may include: a processor 110, a communication interface 120, a memory 130, and a communication bus 110, wherein the processor 110, the communication interface 120, and the memory 130 communicate with each other through the communication bus 110. The processor 110 can call the computer program in the memory 130 to execute the paper electrocardiogram digitization method of the present invention. The method includes the following steps: S1, based on a pre-constructed paper electrocardiogram template library, a template classifier identifies a template in the paper electrocardiogram template library that matches the input paper electrocardiogram scan image I to obtain a matching template, wherein the template stores standard lead start points, standard grid points, lead region information, and physical scale information; S2, the image lead start points and image grid points of the paper electrocardiogram scan image I are detected, and an alignment operation is performed on the paper electrocardiogram scan image I based on the standard lead start points, standard grid points, the image lead start points, and the image grid points of the matching template to obtain an aligned image; S3, the aligned image is digitized to obtain a digitized signal set of the paper electrocardiogram scan image I.
[0062] The above description is merely a selection of preferred embodiments of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in the embodiments of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features with similar functions disclosed in the embodiments of this disclosure.
Claims
1. A method for digitizing paper electrocardiograms, characterized in that, Includes the following steps: S1. Based on the pre-built paper ECG template library, the template classifier identifies the template that matches the input paper ECG scan image I in the paper ECG template library to obtain the matching template. The template stores the standard lead start point, standard grid points, lead area information and physical scale information. S2. Detect the lead start points and grid points of the paper ECG scan image I, and perform an alignment operation on the paper ECG scan image I based on the standard lead start points, standard grid points, the lead start points, and the grid points of the matching template to obtain an aligned image. The alignment operation includes a coarse alignment operation and a fine alignment operation. The coarse alignment operation is based on the correspondence between the lead start points detected in the paper ECG scan image I and the standard lead start points in the matching template, and transforms the paper ECG scan image I using an affine matrix and an affine transformation operator to obtain a coarsely aligned image. The fine alignment operation is based on the correspondence between the image grid points detected in the coarse alignment image and the standard grid points in the matching template. By constructing a nonlinear geometric transformation and applying the nonlinear geometric transformation to the coarse alignment image, a geometrically aligned image is finally obtained. S3. Digitize the aligned image to obtain the digitized signal set of the paper electrocardiogram scan image I; the digitization includes: dividing the aligned image into segments based on the lead region information corresponding to the matching template. The image sub-region of a single lead, wherein the lead region information includes the vertex coordinates and width and height information of the lead region; the image sub-region is binarized to separate the foreground ECG signal region from the background; the pixel coordinate sequence of the waveform trajectory is extracted from the foreground ECG signal region; according to the physical scale information corresponding to the matching template, the pixel coordinate sequence is converted into a digital voltage-time signal with physical units through a linear mapping relationship between pixels and physical quantities, wherein the physical scale information includes the vertical voltage scale and the horizontal time scale of the template.
2. The method for digitizing paper electrocardiograms according to claim 1, characterized in that, The template classifier is a ResNet-based deep learning model, which is trained under supervision using a training dataset containing multiple types of paper electrocardiogram scan images and their corresponding template index annotations.
3. The method for digitizing paper electrocardiograms according to claim 1, characterized in that, The coarse alignment operation is performed in the following manner: Detect the coordinates of the starting point of the image leads in the paper electrocardiogram scan image I. ,in Number of leads; Calculate the affine matrix ,make Minimum, of which The coordinates of the standard lead start point for matching the template; Combined with affine matrix and affine transformation operators The paper electrocardiogram scan image I is transformed to obtain a coarsely aligned image. .
4. The method for digitizing paper electrocardiograms according to claim 3, characterized in that, The lead start point detector is used to detect the image lead start point of the paper electrocardiogram scan image I. The lead start point detector adopts a U-Net-based deep learning model and is obtained through supervised training using a training dataset containing multiple types of paper electrocardiogram scan images and their image lead start point coordinates and lead category labels.
5. The method for digitizing paper electrocardiograms according to claim 3, characterized in that, The fine alignment operation is performed in the following manner: Detect the coarsely aligned image Image grid point coordinates ,in Total number of grid cells; Calculate the nonlinear transformation function ,make Minimum, of which The coordinates of the standard grid points for matching the template; Coarsely aligned image Through nonlinear transformation function Processing to obtain an aligned image .
6. The method for digitizing paper electrocardiograms according to claim 5, characterized in that, The grid points of the coarsely aligned image are detected by a grid point detector, which is a U-Net-based deep learning model trained under supervision using a training dataset containing multiple types of paper electrocardiogram scan images and their grid point coordinate annotations.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable by the processor, characterized in that, The processor, when executing the computer program, implements the paper electrocardiogram digitization method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Intelligent detection method and device for fusing medical image learning image
CN121033490A
Systems and methods for signal digitization
US20250342921A1