Paper electrocardiogram image digitization method based on denoising neural network
Through a method based on denoising convolutional neural network, combined with image registration and text artifact removal, a paper ECG image digital model including a residual module and convolution kernel cascade was established to solve the problem of the decline in paper ECG image clarity and It achieves efficient digitization of ECG images and improves the accuracy of digitization results and the robustness of the model by solving undigitized problems.
Patent Information
- Application Number
- CN202410850918.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-10-08
AI Technical Summary
Traditional paper ECG images have reduced clarity due to ink fading and physical damage, and a large number of them have not been digitized, making it difficult to protect and utilize ECG record information, affecting the establishment of telemedicine and cardiovascular disease databases.
Using a method based on denoising convolutional neural networks, through image registration and text artifact removal, a paper ECG image digital model including a residual module and convolution kernel cascade was established, and deep learning was used to automatically convert the paper ECG image It is the digital ECG signal waveform.
It improves the accuracy and efficiency of image processing, reduces the number of iterations, reduces the loss error, enhances the robustness and generalization ability of the model, avoids overfitting, and achieves efficient digitization of paper ECG images.
Smart Images

Figure CN118748065A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of image processing and deep learning, and specifically designs a method for digitizing paper electrocardiogram images based on a denoising convolutional neural network. Background Art
[0002] The heart is the most critical organ in the human circulatory system, and its beating rhythm reflects the physiological state of the human body. The function of the heart is to provide sufficient power for blood circulation, so that blood can be transported to various organs and tissues of the body to provide oxygen and various nutrients, and take away metabolic waste in the body, so that cells can maintain normal metabolism and function. Heart disease has the characteristics of being difficult for patients to detect, rapid onset, and high mortality after onset, becoming the number one threat to human health in the world. According to statistics, up to 17.7 million people die from cardiovascular diseases each year, accounting for 31% of the total global deaths. In China, the current number of people suffering from cardiovascular diseases has reached 290 million, and the morbidity and mortality rates are still rising, which has become an important public health issue in my country. Electrocardiograms, as one of the important means of examining cardiovascular diseases, are still stored in paper most of the time. Traditional paper electrocardiograms are made of thermal paper. Due to the material, the ink printed on the paper is easy to fade, resulting in a decrease in the clarity of the electrocardiogram record. And due to improper storage by the patient himself, the paper is often damaged by folding, rubbing, etc. In addition, there are a large number of paper ECG archives in hospitals that have not been digitized. These ECG data are valuable experience resources for the diagnosis and treatment of cardiovascular diseases. In order to protect patients' ECG record information, facilitate the development of telemedicine, smart medicine, and the establishment of a cardiovascular disease case database, paper ECG image digitization technology is particularly important.
[0003] Since Kunihiko Fukushima et al. proposed the convolutional neural network (CNN) model, it has become an important research direction in the field of medical imaging, and many related network models have been derived. In the denoising task of electrocardiogram images, CNN performs better. CNN is a deep learning model that is particularly good at processing image data. By simulating the structure and function of the biological visual system, CNN can automatically extract spatial hierarchical features from image data. However, the traditional CNN image denoising method has the disadvantages of large data requirements, high computational complexity, and high risk of overfitting. In addition, since paper electrocardiogram images are greatly affected by factors such as paper placement, camera angle, and light intensity, the imaging quality of the electrocardiogram varies. Therefore, it is necessary to preprocess paper electrocardiogram images. It can enhance the model's learning ability for paper electrocardiogram images to further improve the accuracy of digitized results. Summary of the invention
[0004] In response to the above-mentioned needs, the present invention designs a method for digitizing paper ECG images based on a denoising neural network (DnCNN). The method establishes a paper ECG image digitization model based on deep learning that includes a residual module and a convolution kernel cascade on the basis of the structure of DnCNN. The method can automatically and efficiently convert the ECG recording curve recorded on the paper picture into digitized ECG data information and store it in the form of an ECG signal waveform.
[0005] In order to solve the above technical problems, the technical solution of the present invention is as follows:
[0006] A method for digitizing paper electrocardiogram images based on a denoising convolutional neural network comprises the following steps:
[0007] Step 1: Obtain the paper ECG image dataset and preprocess it. First, perform image registration on the paper ECG image. Combine the ORB algorithm with the Radon transform to detect the key points of the input image ECG waveform and the reference image ECG waveform at each position, calculate the direction of different key points and convert them into binary feature vectors, and then use the greedy algorithm to compare the correspondence between the key points of the input image and the reference image. According to the most matching key points, the rotation matrix is determined to align the input image with the reference axis to complete the rotation compensation. Then, remove the text artifacts, use the OCR algorithm to detect the text area in the input image, generate a bounding box around the expected area, and then use the CRNN model to detect the characters in the area. After obtaining the characters, they are hidden by the image restoration method. During the restoration process, the missing parts of the text are filled with nearby pixels first.
[0008] Step 2: For the preprocessed data set, divide it into a test set and a training set according to the ratio. The holdout method is used to divide the data set, and the preprocessed paper electrocardiogram image data set is randomly divided into two mutually exclusive sets at a ratio of 8:2. Among them, the image set accounting for 80% is the training set, and the other image set accounting for 20% is the test set.
[0009] Step 3: Establish a paper ECG image digitization model based on a denoising neural network, which includes a residual module and a convolution kernel cascade. An improved paper ECG image digitization network model is designed based on the denoising neural network. The DnCNN model consists of 17 layers. The first layer consists of a Conv2D+ReLU layer with 64 7×7 filters. The rectified linear unit is used to solve the nonlinear problem in the system. By combining two-dimensional convolution with the ReLU layer, DnCNN uses hidden layers to gradually separate the image structure from the correlated noise. The second to the 16th layers consist of Conv2D+BN+ReLU layers with 64 7×7×64 filters. The BN module is added to accelerate training and denoising performance. The 17th layer consists of a 7×7×64 filter to produce the final output image.
[0010] Step 4: Input the training set in the preprocessed paper ECG image dataset into the paper ECG image digitization model based on the denoising neural network. The RGB image is divided into 3 channels, because the model will be trained on a single-channel image, and each channel will be further divided into a small block image of 30×30 pixels and an overlapping image of 5 pixels. These small block image datasets are then shuffled and cross-validated 5 times to evaluate the model. After that, the neural network will be iteratively optimized on the training set until the loss function converges and the training process is completed.
[0011] Step 5: Input the test set in the preprocessed paper electrocardiogram image data set into the paper electrocardiogram image digitization model trained in step 4 to obtain the result of image digitization.
[0012] Compared with the prior art, the advantages of the present invention are as follows:
[0013] The present invention proposes a method for digitizing paper electrocardiogram images based on a denoising convolutional neural network. First, the paper electrocardiogram image data set is preprocessed for rotation compensation and text artifact removal, and then a paper electrocardiogram image digitization model based on deep learning including a residual module and a convolution kernel cascade is established. The preprocessed image data is input into the model for iterative training to obtain a fully trained model. Finally, the paper electrocardiogram image to be digitized is input into the trained model to complete the paper electrocardiogram image digitization task.
[0014] The present invention combines image processing and deep learning. In the image registration stage, the ORB algorithm, Radon transform and greedy algorithm are used to perform key point positioning, key point matching and directional feature vector calculation, which greatly improves the accuracy of image registration and the efficiency of subsequent model training. In the text artifact removal stage, the OCR algorithm and CRNN model are used to detect the text area and then hide it. Different from the operation of hiding all text, the present invention retains useful information such as the patient's age, height, weight and physical health status. Additional pixel repair is performed on the deleted area, and the restored image result is better. In the denoising neural network model, convolution kernels, Conv2D, ReLU and BN modules are introduced to suppress the gradient vanishing phenomenon caused by the increase of network depth, thereby increasing the depth of the network and making the digitized results more accurate. In addition, the digitized model has undergone 30 iterations to achieve mean square error loss saturation and reduce the loss to 10 -5 To verify the above results, the model was run for an additional 500 iterations without early stopping, and the loss remained at 10 -5 A relatively small number of iterations can effectively improve the robustness and generalization ability of the model and avoid the risk of overfitting. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 Schematic diagram of the process of digitizing paper electrocardiogram images based on denoising convolutional neural network.
[0016] Figure 2 Schematic diagram of key point matching in image registration.
[0017] Figure 3 This is a graph showing the effect of removing text artifacts.
[0018] Figure 4 Schematic diagram of the structure of the denoising convolutional neural network.
[0019] Figure 5 Display of the results of digitizing paper ECG images DETAILED DESCRIPTION
[0020] The present invention will be further described below in conjunction with the accompanying drawings and embodiments, but the present invention is not limited thereto.
[0021] In order to more clearly illustrate the objectives, technical solutions and advantages of the present invention, the present invention will be further described in detail below through specific embodiments in conjunction with the accompanying drawings.
[0022] Figure 1 The implementation process of the present invention is shown, which includes the following steps:
[0023] 1) Preprocess the paper ECG image, including image registration and text artifact removal. In the image registration part, the key points of the ECG waveform of the input image and the ECG waveform of the reference image are first located and the eigenvectors corresponding to the directions of each key point are calculated. Then, the rotation matrix is determined through the most matching key points to align the input image with the reference axis to complete the rotation compensation. In the text artifact removal part, the target area containing characters is first detected and a bounding box is generated around it, and then the characters in the box are hidden and pixel repaired.
[0024] 2) Divide the training set and the test set. According to the holdout method, the paper electrocardiogram image dataset is randomly divided into two mutually exclusive sets according to the set ratio, where 80% of the image set is the training set and 20% of the image set is the test set.
[0025] 3) Establish a paper ECG image digitization model based on a denoising neural network. The model is based on a denoising neural network and contains a cascaded residual module and a convolution kernel module. The neural network has 17 layers in total, and the first layer consists of a Conv2D+ReLU layer with 64 7×7 filters. Rectified linear units are used to solve nonlinear problems in the system. By combining two-dimensional convolution with the ReLU layer, DnCNN uses hidden layers to gradually separate the image structure from the correlated noise. The second to the 16th layers consist of Conv2D+BN+ReLU layers with 64 7×7×64 filters. The BN module is added to accelerate training and denoising performance. The 17th layer is a 7×7×64 filter that can output clear ECG waveform images.
[0026] 4) Use the training set to train the paper ECG image digitization model. The preprocessed paper ECG image training set is input into the model. The RGB image will be divided into 3 channels, and the model will be trained on single-channel images. The ECG images will be divided into small blocks and overlapping images. The model will then shuffle and cross-validate the small block image data set to complete the model evaluation. After that, the neural network model will be iteratively optimized on the training set until the loss function converges, completing the training process.
[0027] 5) Input the test set into the trained paper electrocardiogram image digitization model to obtain the digitized result of the electrocardiogram waveform record on the paper image.
[0028] Figure 2 What is shown is a schematic diagram of the registration operation of the input image and the reference image in the present invention. The image registration operation in the present invention involves key point detection, key point matching and image reconstruction based on key points.
[0029] For the input ECG image waveform and the reference ECG image waveform, the ORB algorithm can effectively determine the position of the key points and convert their directions into binary feature vectors. The greedy algorithm can efficiently find the key points with the highest matching degree. Then, the Radon transform is used to calculate the angle of rotation compensation. The specific process is:
[0030]
[0031] In the formula, (x, y) is the position parameter of the key point, ρ is the distance parameter, θ is the angle parameter, δ(·) is the Dirac increment function, and I(·) is the Radon transform function of the 2D signal.
[0032] According to the rotation angle calculated by Radon transform, the input image is reversely rotated and aligned with the reference axis to restore the original ECG image.
[0033] Figure 3 What is shown is a comparison display diagram of the effects before and after the removal of text artifacts in the present invention. The first step of text artifact removal is to detect the area containing characters, use the OCR algorithm to identify the target area, and generate a bounding box around the expected area. The next step is to hide and repair the characters in the area, and use the CRNN model to detect the text in the positioning area. After acquiring the characters, they are deleted using the fast marching method. The fast marching method uses a distance map, which is the distance from the known pixel to the missing area. This map guides the repair process, giving priority to pixels near the missing text area. For each missing pixel, the nearby pixels and the image values and gradient values corresponding to these pixels are preferentially used to calculate the first-order approximation result to complete the missing part. The calculation formula is:
[0034]
[0035] In the formula, I(q) is the image value at pixel q, is the gradient value at pixel q.
[0036] Utilizing the distance map and taking into account the local image structure and gradient, the fast marching method effectively embeds the compensated pixels into the region for text artifact removal in the ECG image.
[0037] Figure 4The figure shows the structure of the denoising convolutional neural network model, which is based on the denoising neural network to design an improved paper ECG image digitization network model. The model consists of 17 layers. The first layer consists of Conv2D+ReLU layers with 64 7×7 filters. Rectified linear units are used to solve nonlinear problems in the system. By combining two-dimensional convolution with ReLU layers, DnCNN uses hidden layers to gradually separate image structures from correlated noise. Layers 2 to 16 consist of Conv2D+BN+ReLU layers with 64 7×7×64 filters. The BN module is added to accelerate training and denoising performance. The 17th layer consists of 1 7×7×64 filter to output clear ECG waveform images.
[0038] The residual network module directly inputs the output of the previous convolutional layer into the next convolutional layer, which improves the efficiency of model information transmission. The combination of convolution kernel, Conv2D, ReLU and BN modules suppresses the gradient vanishing phenomenon caused by the increase of network depth, thereby increasing the depth of the network and making the digitized results more accurate. According to tests, the network can achieve convergence of the loss function with a relatively small number of iterations, and has good robustness and generalization ability.
[0039] Figure 5 What is shown is a display diagram of the digitization result of a paper electrocardiogram image, which includes the original paper electrocardiogram image and the electrocardiogram signal waveform image extracted after digitization.
Claims
1. A method for digitizing paper electrocardiogram images based on a denoising neural network, characterized in that: The following steps are involved: (1) Obtain paper electrocardiogram image dataset and perform preprocessing; (2) The preprocessed data set is divided into a training set and a test set according to a set ratio; (3) Establish a paper ECG image digitization model based on a denoising neural network, which includes a residual module and a convolution kernel cascade; (4) inputting the training set in the paper electrocardiogram image data set into the paper electrocardiogram image digitization model based on the denoising neural network to obtain a trained model; (5) Input the test set in the paper electrocardiogram image dataset into the trained paper electrocardiogram image digitization model to obtain the image digitization result.
2. A method for digitizing paper electrocardiogram images based on a denoising neural network according to claim 1, characterized in that In step (1), a paper electrocardiogram image dataset is obtained and preprocessed, wherein the specific method of image registration is as follows: For the input ECG image waveform and the reference ECG image waveform, the ORB algorithm can effectively determine the position of the key points and convert their directions into binary feature vectors. The greedy algorithm can efficiently find the key points with the highest matching degree. Then, the Radon transform is used to calculate the angle of image rotation compensation. The specific process is as follows: In the formula, (x, y) is the position parameter of the key point, ρ is the distance parameter, θ is the angle parameter, δ(·) is the Dirac increment function, and I(·) is the Radon transform function of the 2D signal. According to the rotation angle calculated by Radon transform, the input image is reversely rotated and aligned with the reference axis to restore the original ECG image.
3. The method for digitizing paper electrocardiogram images based on a denoising neural network according to claim 1, characterized in that In step (1), a paper electrocardiogram image dataset is obtained and preprocessed, wherein the specific method for removing text artifacts is as follows: The first step is to detect the area containing characters, use the OCR algorithm to identify the target area, and generate a bounding box around the expected area. The next step is to hide and inpaint the characters in the area, and use the CRNN model to detect the text in the positioning area. After obtaining the characters, they are deleted using the fast marching method. The fast marching method uses a distance map, which is the distance from the known pixel to the missing area. This map guides the repair process and prioritizes pixels near the missing text area. For each missing pixel, the nearby pixels and the image values and gradient values corresponding to these pixels are used to calculate the first-order approximation result to complete the missing part. The calculation formula is as follows: In the formula, I(q) is the image value at pixel q, is the gradient value at pixel q. By utilizing the distance map and taking into account the local image structure and gradient, the fast marching method effectively inpaints the regions in the ECG images for text artifact removal.
4. The method for digitizing paper electrocardiogram images based on a denoising neural network according to claim 1, characterized in that In step (2), the specific method for dividing the processed data set into a training set and a test set according to a set ratio is: According to the holdout method, the preprocessed paper ECG image dataset is randomly divided into two mutually exclusive image sets in a ratio of 8:
2. The image set accounting for 80% is the training set, and the other image set accounting for 20% is the test set.
5. The method for digitizing paper electrocardiogram images based on a denoising neural network according to claim 1, characterized in that In step (3), the specific method of establishing a paper electrocardiogram image digitization model based on a denoising neural network including a residual module and a convolution kernel cascade is as follows: The denoising neural network model (DnCNN) consists of 17 layers. The first layer consists of Conv2D+ReLU layers with 64 7×7 filters; rectified linear units are used to solve nonlinear problems in the system. By combining two-dimensional convolution with ReLU layers, DnCNN uses hidden layers to gradually separate image structure from correlated noise. Layers 2 to 16 consist of Conv2D+BN+ReLU layers with 64 7×7×64 filters. The BN module is added to accelerate training and denoising performance. The 17th layer consists of 1 7×7×64 filter to produce the final output image. The residual network module directly inputs the output of the previous convolution layer into the next convolution layer, which improves the efficiency of model information transmission.
6. The method for digitizing paper electrocardiogram images based on a denoising neural network according to claim 1, characterized in that In step (4), the specific process of training the model is as follows: The training set in the preprocessed paper ECG image dataset is input into the paper ECG image digitization model based on the denoising neural network. The RGB image is divided into 3 channels, because the model will be trained on a single channel image, and each channel will be further divided into a small block image of 30×30 pixels and an overlapping image of 5 pixels. These small block image datasets are then shuffled and cross-validated 5 times to evaluate the model. After that, the neural network will be iteratively optimized on the training set until the loss function converges and the training process is completed.
7. The method for digitizing paper electrocardiogram images based on a denoising neural network according to claim 1, characterized in that Step (5) includes: The test set is input into the trained paper electrocardiogram image digitization model to obtain the digitized result of the electrocardiogram waveform record on the paper image.
Citation Information
Cited By
System and method for electrocardiogram digitization
TWI934670B
