Paper electrocardiogram analysis method, device, electronic device and storage medium
By binarizing and digitizing paper electrocardiogram images and combining with machine learning models, the problem of difficult to determine the origin of idiopathic ventricular arrhythmia is solved, more accurate and efficient diagnosis is achieved, and the success rate of surgery is improved.
Patent Information
- Application Number
- CN202311049205.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-18
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2043-08-18
AI Technical Summary
The prior art is difficult to accurately and efficiently determine the origin of idiopathic ventricular arrhythmias, especially in the left and right ventricular outflow tracts, resulting in large differences in surgical success rates and requires expertise and time.
By performing binarization and digitization on paper electrocardiogram images, pre-trained machine learning models are used to extract ventricular arrhythmia-related features, and combined with two model inputs, the origin of ventricular arrhythmia is determined.
It improves the accuracy and interpretability of the determination of the origin of ventricular arrhythmia, simplifies the diagnostic process, reduces the dependence on professional knowledge, and improves the success rate of surgery.
Smart Images

Figure CN117078628B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the technical field of paper electrocardiogram analysis, and specifically to a method, device, electronic device, and storage medium for paper electrocardiogram analysis. Background Art
[0002] Idiopathic ventricular arrhythmias (IVAs) mostly originate from a focal area, most commonly in the right ventricular outflow tract (RVOT) and the left ventricular outflow tract (LVOT). At present, it has been clearly established that catheter radiofrequency ablation is the first-line method for treating outflow tract ventricular arrhythmias (OT-VAs). However, in actual operation, the vascular accesses of the left and right ventricles are significantly different, and the success rates of surgeries for IVAs from different sources vary greatly. Moreover, the adjacent relationship between the left and right ventricular outflow tracts is relatively complex, and it is difficult to accurately locate only by visually observing the electrocardiogram features. The various judgment methods proposed in previous studies have the following defects: First, these methods only focus on the discriminative role of the precordial leads of the surface electrocardiogram. Second, these methods require professional cardiology knowledge, which will consume a lot of manpower and time, and their clinical applications are relatively limited. Summary of the Invention
[0003] Embodiments of the present disclosure provide a method, device, electronic device, and storage medium for paper electrocardiogram analysis.
[0004] In a first aspect, embodiments of the present disclosure provide a method for paper electrocardiogram analysis, the method comprising:
[0005] Obtaining a target paper electrocardiogram image obtained by performing an electrocardiogram examination on a target user who is diagnosed with ventricular arrhythmia;
[0006] Performing binarization processing on the target paper electrocardiogram image to obtain a target paper electrocardiogram binarized image;
[0007] Inputting the target paper electrocardiogram binarized image into a pre-trained first ventricular arrhythmia origin location determination model to obtain a first origin location determination result for indicating the origin location of ventricular arrhythmia;
[0008] Performing electrocardiogram digitization processing on the target paper electrocardiogram image to obtain a target digital electrocardiogram;
[0009] Based on the target digital electrocardiogram, extracting the feature value of each relevant feature in a preset set of ventricular arrhythmia-related features;
[0010] Input the eigenvalue of each of the extracted ventricular arrhythmia-related features and the determination result of the first origin site into a pre-trained second ventricular arrhythmia origin site determination model to obtain a second origin site determination result of the origin site of the ventricular arrhythmia suffered by the target user.
[0011] In some alternative embodiments, the performing electrocardiogram digitization processing on the target paper electrocardiogram image to obtain a target digital electrocardiogram includes:
[0012] Intercept an image of a preset central region in the target paper electrocardiogram image to obtain a target paper electrocardiogram central region image;
[0013] For each row where the ordinate is located and each column where the abscissa is located in the target paper electrocardiogram central region image, calculate the corresponding row pixel mean value and column pixel mean value respectively;
[0014] According to a preset paper electrocardiogram grid distribution rule, based on each of the row pixel mean values and column pixel mean values, determine the number of horizontal pixels and the number of vertical pixels of a unit grid in the corresponding background grid line of the target paper electrocardiogram image;
[0015] For each lead identifier in a preset electrocardiogram lead identifier set, perform the following lead signal generation operation: intercept a binary image of the electrocardiogram waveform of the lead corresponding to the lead identifier in the binary image of the target paper electrocardiogram; for each foreground pixel point in the binary image of the electrocardiogram waveform of the lead corresponding to the lead identifier, according to the order of the acquisition time corresponding to the abscissa from early to late, generate the electrocardiogram signal time and voltage corresponding to the corresponding foreground pixel point in the electrocardiogram signal sequence of the lead corresponding to the lead identifier according to the horizontal and vertical coordinates, the number of horizontal pixels and the number of vertical pixels of the unit grid in the corresponding background grid line of the target paper electrocardiogram image, and the horizontal unit grid duration and vertical unit grid voltage corresponding to the preset paper electrocardiogram unit grid.
[0016] In some alternative embodiments, the preset set of ventricular arrhythmia-related features includes at least one of the following: R wave duration index of lead V1, R wave duration index of lead V2, R wave amplitude index of lead V1, R wave amplitude index of lead V2, transition ratio of lead V2, TZ index of lead V1, TZ index of lead V2, TZ index of lead V3, TZ index of lead V4, TZ index of lead V5, TZ index of lead V6, and SV2 / RV3 index of leads V2 and V3.
[0017] In some alternative embodiments, before performing binary processing on the target paper electrocardiogram image to obtain a binary image of the target paper electrocardiogram, the method further includes:
[0018] Perform angle correction processing on the target paper electrocardiogram image.
[0019] In some alternative embodiments, the binarization processing of the target paper electrocardiogram image to obtain a binarized target paper electrocardiogram image includes:
[0020] Perform grayscale processing on the target paper electrocardiogram image to obtain a grayscale target paper electrocardiogram image;
[0021] Use an adaptive threshold algorithm to calculate the binarization grayscale value threshold corresponding to the grayscale target paper electrocardiogram image in the preset grayscale value threshold set;
[0022] Perform binarization processing on the grayscale target paper electrocardiogram image according to the determined binarization grayscale value threshold to obtain the binarized target paper electrocardiogram image.
[0023] In some alternative embodiments, before inputting the binarized target paper electrocardiogram image into a pre-trained first ventricular arrhythmia origin site determination model, the method further includes:
[0024] Perform noise reduction processing on the binarized target paper electrocardiogram image.
[0025] In some alternative embodiments, the noise reduction processing of the binarized target paper electrocardiogram image includes:
[0026] Perform erosion and dilation processing on the binarized target paper electrocardiogram image.
[0027] In some alternative embodiments, the first ventricular arrhythmia origin site determination model and the second ventricular arrhythmia origin site determination model are pre-trained through the following training steps:
[0028] Obtain a set of sample paper electrocardiogram images and the ventricular arrhythmia origin site label corresponding to each sample paper electrocardiogram image, where the sample paper electrocardiogram image is a paper electrocardiogram image obtained by performing an electrocardiogram examination on a patient diagnosed with ventricular arrhythmia;
[0029] Perform binarization processing on each sample paper electrocardiogram image to obtain a corresponding binarized sample paper electrocardiogram image;
[0030] Perform electrocardiogram digitization processing on each sample paper electrocardiogram image to obtain a corresponding sample digital electrocardiogram, and based on the obtained sample digital electrocardiogram, extract the feature value of each relevant feature in the preset ventricular arrhythmia related feature set to obtain the feature values of each of the preset ventricular arrhythmia related features corresponding to the corresponding sample paper electrocardiogram image;
[0031] Generate each training data in the training data set by using the sample paper electrocardiogram binary image corresponding to each sample paper electrocardiogram image, the eigenvalue of each of the preset ventricular arrhythmia related features, and the ventricular arrhythmia origin site label.
[0032] Obtain the model structures and model parameter information of the first initial ventricular arrhythmia origin site determination model and the second initial ventricular arrhythmia origin site determination model.
[0033] For the training data in the training data set, perform the following model parameter adjustment operations until the preset training end condition is met: input the sample paper electrocardiogram binary image in the training data into the first initial ventricular arrhythmia origin site determination model to obtain the first actual ventricular arrhythmia origin site determination result; input the eigenvalue of each of the ventricular arrhythmia related features in the training data and the first actual origin site determination result into the second initial ventricular arrhythmia origin site determination model to obtain the second actual origin site determination result; adjust the model parameters of the first initial ventricular arrhythmia origin site determination model and the second initial ventricular arrhythmia origin site determination model based on the difference between the ventricular arrhythmia origin site label in the training data and the second actual origin site determination result.
[0034] Respectively determine the first initial ventricular arrhythmia origin site determination model and the second initial ventricular arrhythmia origin site determination model with adjusted parameters as the pre-trained first ventricular arrhythmia origin site determination model and the second ventricular arrhythmia origin site determination model.
[0035] In some alternative embodiments, based on the target digital electrocardiogram, extract the eigenvalue of each relevant feature in the preset ventricular arrhythmia related feature set, including:
[0036] Extract the eigenvalue of each relevant feature in the preset ventricular arrhythmia related feature set by a signal detection method based on the target digital electrocardiogram.
[0037] In a second aspect, an embodiment of the present disclosure provides a paper electrocardiogram analysis device, the device comprising: an electrocardiogram acquisition unit, configured to acquire a target paper electrocardiogram image obtained by performing an electrocardiogram examination on a target user, wherein the target user is diagnosed with ventricular arrhythmia; a binarization unit, configured to perform binarization processing on the target paper electrocardiogram image to obtain a target paper electrocardiogram binarized image; a first analysis unit, configured to input the target paper electrocardiogram binarization image into a pre-trained first ventricular arrhythmia origin site determination model to obtain a first origin site for indicating the origin site of the ventricular arrhythmia. a location determination result; a digitization unit configured to perform electrocardiogram digitization processing on the target paper electrocardiogram image to obtain a target digital electrocardiogram; a feature extraction unit configured to extract the feature value of each relevant feature in a preset ventricular arrhythmia-related feature set based on the target digital electrocardiogram; a second analysis unit configured to input the extracted feature values of each ventricular arrhythmia-related feature and the first origin location determination result into a pre-trained second ventricular arrhythmia origin location determination model to obtain a second origin location determination result of the origin location of the ventricular arrhythmia suffered by the target user.
[0038] In some optional implementations, the digitizing unit is further configured to:
[0039] intercepting an image of a preset central area of the target paper electrocardiogram image to obtain an image of the central area of the target paper electrocardiogram;
[0040] For each row where the ordinate is located and the column where the abscissa is located in the central area image of the target paper electrocardiogram, respectively, calculating the corresponding row pixel mean and column pixel mean;
[0041] According to a preset paper electrocardiogram grid distribution rule, based on the row pixel mean and the column pixel mean, determining the horizontal pixel number and the vertical pixel number of the unit grid in the background grid line corresponding to the target paper electrocardiogram image;
[0042] For each lead identifier in a preset electrocardiogram lead identifier set, the following lead signal generation operation is performed: the electrocardiogram waveform binarization image of the lead corresponding to the lead identifier is intercepted in the target paper electrocardiogram binarization image; for each foreground pixel point in the electrocardiogram waveform binarization image of the lead corresponding to the lead identifier, in the order from early to late of the acquisition time corresponding to the horizontal coordinate, according to the horizontal and vertical coordinates, the horizontal pixel point number and the vertical pixel point number of the unit grid in the background grid line corresponding to the target paper electrocardiogram image, and the horizontal unit grid time length and the vertical unit grid voltage corresponding to the preset paper electrocardiogram unit grid, the electrocardiogram signal time and voltage corresponding to the corresponding foreground pixel point in the electrocardiogram signal sequence of the lead corresponding to the lead identifier are generated.
[0043] In some alternative embodiments, the preset collection of ventricular arrhythmia-related features includes at least one of the following: R-wave duration index of lead V1, R-wave duration index of lead V2, R-wave amplitude index of lead V1, R-wave amplitude index of lead V2, transition ratio of lead V2, TZ index of lead V1, TZ index of lead V2, TZ index of lead V3, TZ index of lead V4, TZ index of lead V5, TZ index of lead V6, and SV2 / RV3 index of leads V2 and V3.
[0044] In some alternative embodiments, the device further includes: an angle correction unit configured to perform angle correction processing on the target paper electrocardiogram image before performing binarization processing on the target paper electrocardiogram image to obtain a target paper electrocardiogram binarized image.
[0045] In some alternative embodiments, the binarization unit is further configured to:
[0046] Perform grayscale processing on the target paper electrocardiogram image to obtain a target paper electrocardiogram grayscale image;
[0047] Calculate a binarization grayscale value threshold corresponding to the target paper electrocardiogram grayscale image in the preset set of grayscale value thresholds using an adaptive threshold algorithm;
[0048] Perform binarization processing on the target paper electrocardiogram grayscale image according to the determined binarization grayscale value threshold to obtain the target paper electrocardiogram binarized image.
[0049] In some alternative embodiments, the device further includes: a noise reduction unit configured to perform noise reduction processing on the target paper electrocardiogram binarized image before inputting the target paper electrocardiogram binarized image into a pre-trained first ventricular arrhythmia origin site determination model.
[0050] In some alternative embodiments, the noise reduction unit is further configured to: perform erosion and dilation processing on the target paper electrocardiogram binarized image.
[0051] In some alternative embodiments, the first ventricular arrhythmia origin site determination model and the second ventricular arrhythmia origin site determination model are pre-trained through the following training steps:
[0052] Obtain a set of sample paper electrocardiogram images and the ventricular arrhythmia origin site label corresponding to each sample paper electrocardiogram image, where the sample paper electrocardiogram image is a paper electrocardiogram image obtained by performing an electrocardiogram examination on a patient diagnosed with ventricular arrhythmia;
[0053] Binarize each sample paper electrocardiogram image to obtain the corresponding binarized sample paper electrocardiogram image;
[0054] Perform electrocardiogram digitization processing on each sample paper electrocardiogram image to obtain the corresponding sample digital electrocardiogram, and based on the obtained sample digital electrocardiogram, extract the eigenvalue of each relevant feature in the preset ventricular arrhythmia related feature set to obtain the eigenvalues of each of the preset ventricular arrhythmia related features corresponding to the corresponding sample paper electrocardiogram image;
[0055] Generate each training data in the training data set using the binarized sample paper electrocardiogram image corresponding to each sample paper electrocardiogram image, the eigenvalues of each of the preset ventricular arrhythmia related features, and the ventricular arrhythmia origin site label;
[0056] Obtain the model structure and model parameter information of the first initial ventricular arrhythmia origin site determination model and the second initial ventricular arrhythmia origin site determination model;
[0057] For the training data in the training data set, perform the following model parameter adjustment operations until the preset training end condition is met: input the binarized sample paper electrocardiogram image in the training data into the first initial ventricular arrhythmia origin site determination model to obtain the first actual ventricular arrhythmia origin site determination result; input the eigenvalues of each of the ventricular arrhythmia related features in the training data and the first actual origin site determination result into the second initial ventricular arrhythmia origin site determination model to obtain the second actual origin site determination result; adjust the model parameters of the first initial ventricular arrhythmia origin site determination model and the second initial ventricular arrhythmia origin site determination model based on the difference between the ventricular arrhythmia origin site label in the training data and the second actual origin site determination result;
[0058] Respectively determine the first initial ventricular arrhythmia origin site determination model and the second initial ventricular arrhythmia origin site determination model with adjusted parameters as the pre-trained first ventricular arrhythmia origin site determination model and second ventricular arrhythmia origin site determination model.
[0059] In some alternative embodiments, the feature extraction unit is further configured to: based on the target digital electrocardiogram, extract the eigenvalue of each relevant feature in the preset ventricular arrhythmia related feature set by a signal detection method.
[0060] In a third aspect, embodiments of the present disclosure provide an electronic device, including: one or more processors; a storage device storing one or more programs thereon, and when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method described in any implementation manner of the first aspect.
[0061] In a fourth aspect, embodiments of the present disclosure provide a computer-readable storage medium storing a computer program thereon, wherein when the computer program is executed by one or more processors, the method described in any implementation manner of the first aspect is implemented.
[0062] Electrocardiograms are widely used in different medical scenarios due to their convenient and fast detection method, low detection price, and accurate detection effect. After an electrocardiogram examination, the most common storage method is to print the electrocardiogram signals obtained by the electrocardiograph on thermal paper to form a paper electrocardiogram, and the waveform data of the electrocardiogram can often only be obtained by hospitals or institutions equipped with an electronic electrocardiogram management system. For patients, it is difficult to obtain the waveform data of the electrocardiogram, and it is easier to obtain the paper electrocardiogram. Therefore, determining the origin site of ventricular arrhythmia based on the paper electrocardiogram helps to improve the surgical success rate of idiopathic ventricular arrhythmia.
[0063] The paper electrocardiogram analysis method, device, electronic device, and storage medium provided by the embodiments of the present disclosure first obtain a target paper electrocardiogram image obtained by performing an electrocardiogram examination on a target user diagnosed with ventricular arrhythmia. Then, perform binarization processing on the target paper electrocardiogram image to obtain a target binarized paper electrocardiogram image. Next, input the target binarized paper electrocardiogram image into a pre-trained first ventricular arrhythmia origin location determination model to obtain a first origin location determination result indicating the origin location of ventricular arrhythmia. Then, perform electrocardiogram digitization processing on the target paper electrocardiogram image to obtain a target digital electrocardiogram. Then, based on the target digital electrocardiogram, extract the feature values of each relevant feature in a preset set of ventricular arrhythmia-related features. Finally, input the feature values of the extracted ventricular arrhythmia-related features and the first origin location determination result into a pre-trained second ventricular arrhythmia origin location determination model to obtain a second origin location determination result of the origin location of the ventricular arrhythmia suffered by the target user. That is, through two inputs of machine learning models for paper electrocardiogram analysis, the first time is to input the binarized image of the paper electrocardiogram into the first origin location determination model, and the second time is to input the feature values of each relevant feature in the preset set of ventricular arrhythmia-related features extracted based on the target digital electrocardiogram after digitization processing and the output result of the first origin location determination model into the second origin location determination model for further analysis. This is because the model input of the first origin location determination model is only a binarized image, and the model interpretability is not strong. Each relevant feature in the preset set of ventricular arrhythmia-related features has been medically proven to be related to ventricular arrhythmia, which can increase the interpretability of the second origin location determination model. In addition, through two classifications, the accuracy of the finally obtained origin location determination result can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] Other features, objects, and advantages of the present disclosure will become more apparent by reading the detailed description of non-limiting embodiments with reference to the following drawings. The drawings are only for the purpose of illustrating the specific embodiments and are not considered to be a limitation of the present disclosure. In the drawings:
[0065] Figure 1 is an exemplary system architecture diagram to which an embodiment of the present disclosure can be applied;
[0066] Figure 2A is a flowchart of an embodiment of the paper electrocardiogram analysis method according to the present disclosure;
[0067] Figure 2B is a decomposed flowchart of an embodiment of step 202 according to the present disclosure;
[0068] Figure 2C is a decomposed flowchart of an embodiment of step 204 according to the present disclosure;
[0069] Figure 3A is a flowchart of an embodiment of the training steps according to the present disclosure;
[0070] Figure 3B is a flowchart of an embodiment of the model parameter adjustment operation according to the present disclosure;
[0071] Figure 4 is a schematic structural diagram of an embodiment of the paper electrocardiogram analysis device according to the present disclosure;
[0072] Figure 5 is a schematic structural diagram of a computer system of an embodiment of the electronic device according to the present disclosure. Detailed implementation manners
[0073] The present disclosure will be further described in detail below with reference to the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the related invention, rather than limiting the invention. In addition, it should be noted that, for the sake of convenience of description, only parts related to the relevant invention are shown in the drawings.
[0074] It should be noted that, without conflict, the embodiments in the present disclosure and the features in the embodiments can be combined with each other. The present disclosure will be described in detail below with reference to the drawings and embodiments.
[0075] Figure 1 An exemplary system architecture 100 of an embodiment in which the paper electrocardiogram analysis method or the paper electrocardiogram analysis device according to the present disclosure can be applied is shown.
[0076] As Figure 1 shown, the system architecture 100 may include clients 101, 102, 103, a network 104, and a server 105. The network 104 is used to provide a medium for communication links between the clients 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.
[0077] Users can use the clients 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications may be installed on the clients 101, 102, 103, such as image processing applications, paper electrocardiogram analysis applications, remote consultation applications, medical information consultation applications, health status monitoring applications, web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0078] The clients 101, 102, and 103 can be hardware or software. When the clients 101, 102, and 103 are hardware, they can be various electronic devices with a display screen, including but not limited to smartphones, tablets, e-book readers, laptop computers, desktop computers, and so on. When the clients 101, 102, and 103 are software, they can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules (for example, used to provide services for paper electrocardiogram analysis), or it can be implemented as a single software or software module. Specific limitations are not made here.
[0079] In some cases, the paper electrocardiogram analysis method provided by the present disclosure can be executed by the clients 101, 102, and 103. Correspondingly, the paper electrocardiogram analysis device can be set in the clients 101, 102, and 103. At this time, the system architecture 100 may not include the server 105 either.
[0080] In some cases, the paper electrocardiogram analysis method provided by the present disclosure can be jointly executed by the clients 101, 102, and 103 and the server 105. For example, the step of "obtaining the target paper electrocardiogram image obtained by performing an electrocardiogram examination on the target user" can be executed by the clients 101, 102, and 103, and steps such as "inputting the binary image of the target paper electrocardiogram into a pre-trained first ventricular arrhythmia origin site determination model to obtain a first origin site determination result for indicating the origin site of ventricular arrhythmia" can be executed by the server 105. The present disclosure does not make a limitation on this. Correspondingly, the paper electrocardiogram analysis device can also be respectively set in the clients 101, 102, and 103 and the server 105.
[0081] In some cases, the paper electrocardiogram analysis method provided by the present disclosure can be executed by the server 105. Correspondingly, the paper electrocardiogram analysis device can also be set in the server 105. At this time, the system architecture 100 may not include the clients 101, 102, and 103 either.
[0082] The server 105 can be a server that provides various services, such as a background server that supports paper electrocardiogram analysis applications displayed on the clients 101, 102, and 103 or web pages that provide paper electrocardiogram analysis services. The background server can analyze and process data such as the paper electrocardiogram images of the target user received, and feedback the processing results (for example, a second origin site determination result for indicating the origin site of ventricular arrhythmia suffered by the target user) to the client.
[0083] It should be noted that the server 105 can be hardware or software. When the server 105 is hardware, it can be implemented as a distributed server cluster composed of multiple servers or as a single server. When the server 105 is software, it can be implemented as multiple software or software modules (e.g., for providing distributed services) or as a single software or software module. Specific limitations are not made here.
[0084] It should be understood that Figure 1 the numbers of clients, networks, and servers in
[0085] Continuing to refer to Figure 2A which shows a flow 200 of an embodiment of the paper electrocardiogram analysis method according to the present disclosure. The paper electrocardiogram analysis method includes the following steps:
[0086] Step 201, obtain a target paper electrocardiogram image.
[0087] In this embodiment, the execution subject of the paper electrocardiogram analysis method (e.g., Figure 1 the client shown) can obtain the target paper electrocardiogram image locally or from other electronic devices network-connected to the above execution subject.
[0088] Here, the target paper electrocardiogram image is the paper electrocardiogram image of the target user for electrocardiogram examination. And the target user is diagnosed with ventricular arrhythmia.
[0089] In practice, the target paper electrocardiogram image can be obtained by taking a photo with a camera or by scanning with a scanner.
[0090] Step 202, perform binarization processing on the target paper electrocardiogram image to obtain a target paper electrocardiogram binarized image.
[0091] Here, various image binarization processing methods can be used to perform binarization processing on the target paper electrocardiogram image to obtain a target paper electrocardiogram binarized image.
[0092] The target paper electrocardiogram binarized image can include two types of pixel points: foreground pixel points and background pixel points. Among them, the pixel values of the foreground pixel points and the background pixel points are different. The foreground pixel points are used to represent, including but not limited to: patient information, lead names, acquisition time, electrocardiogram waveforms, etc. printed on the thermal paper, while the background pixel points are used to represent the background part of the electrocardiogram paper before any information and data are printed, such as the background board and background grid lines of the paper electrocardiogram before printing.
[0093] In some alternative embodiments, step 202 may include asFigure 2B Steps 2021 to 2023 shown as follows:
[0094] In step 2021, perform grayscale processing on the target paper electrocardiogram image to obtain a target paper electrocardiogram grayscale image.
[0095] In step 2022, use an adaptive threshold algorithm to calculate the binary grayscale value threshold corresponding to the target paper electrocardiogram grayscale image in a preset set of grayscale value thresholds.
[0096] Here, the preset set of grayscale value thresholds may include, for example, pixel values between 50 and 255. By using an adaptive threshold algorithm, the binary grayscale value threshold corresponding to the target paper electrocardiogram grayscale image can be found.
[0097] In step 2023, perform binary processing on the target paper electrocardiogram grayscale image according to the determined binary grayscale value threshold to obtain a target paper electrocardiogram binary image.
[0098] Here, for example, the pixel value of a pixel point in the target paper electrocardiogram grayscale image with a grayscale value greater than the binary grayscale value threshold can be set as the pixel value of the foreground pixel point, and the pixel value of a pixel point with a grayscale value not greater than the binary grayscale value threshold can be set as the pixel value of the background pixel point, so that a target paper electrocardiogram binary image can be obtained.
[0099] In the above optional implementation manner of step 202, by using an adaptive threshold algorithm to set the binary threshold for the target paper electrocardiogram grayscale image, the problem of inaccurate binarization that may be caused by using the same binary threshold for all images can be avoided.
[0100] In some optional implementation manners, before step 202, the following step 202' may also be performed:
[0101] In step 202', perform angle correction processing on the target paper electrocardiogram image.
[0102] Here, various image tilt angle correction processing methods can be used to perform angle correction processing on the target paper electrocardiogram image.
[0103] In some optional implementation manners, step 202' can be performed as follows:
[0104] First, for each tilt angle in a preset set of tilt angles, calculate the sum of the pixel values of each row of pixel points in the image obtained by rotating the target paper electrocardiogram image by that tilt angle, and determine the minimum value among the calculated sums of the pixel values of each row of pixel points as the sum of the lead baseline pixel values corresponding to that tilt angle.
[0105] Then, determine the correction angle as the tilt angle corresponding to the minimum sum of the lead baseline pixel values in the preset tilt angle set.
[0106] Finally, rotate the target paper electrocardiogram image by the above correction angle to perform angle correction processing on the target paper electrocardiogram image.
[0107] Here, considering that in practice, during the process of photographing or scanning a paper electrocardiogram to obtain a paper electrocardiogram image, there may be an angular tilt between the coordinate system of the electrocardiogram and the coordinate system of the image itself. Therefore, by using the method of first performing angle correction and then binarization processing, a target paper electrocardiogram binarized image is obtained by binarizing the target paper electrocardiogram image, which can improve the accuracy of subsequent analysis based on the target paper electrocardiogram binarized image and finally obtain the determination result of the second origin site.
[0108] Step 203: Input the target paper electrocardiogram binarized image into a pre-trained first ventricular arrhythmia origin site determination model to obtain a first origin site determination result for indicating the origin site of ventricular arrhythmia.
[0109] Here, the first ventricular arrhythmia origin site determination model is used to represent the correspondence between the binarized image and the determination result of the ventricular arrhythmia origin site.
[0110] The determination result of the ventricular arrhythmia origin site can be a left ventricular outflow tract determination result for indicating that the origin site of ventricular arrhythmia is the left ventricular outflow tract, or a right ventricular outflow tract determination result for indicating that the origin site of ventricular arrhythmia is the right ventricular outflow tract.
[0111] The first ventricular arrhythmia origin site determination model can be trained using a supervised learning training method. The training samples used in the training process, for example, can be sample paper electrocardiogram binarized images obtained based on paper electrocardiogram images of different ventricular arrhythmia patients during electrocardiogram examinations. The labels for the training samples can be manually marked to obtain the ventricular arrhythmia origin site labels corresponding to each sample paper electrocardiogram binarized image. The ventricular arrhythmia origin site labels can be left ventricular outflow tract labels for indicating that the origin site of ventricular arrhythmia is the left ventricular outflow tract, or right ventricular outflow tract labels for indicating that the origin site of ventricular arrhythmia is the right ventricular outflow tract.
[0112] The first ventricular arrhythmia origin site determination model can adopt various machine learning models, for example, it can be a deep learning model.
[0113] The first ventricular arrhythmia origin site determination result obtained through step 203 can be used as a preliminary ventricular arrhythmia origin site determination result.
[0114] In some optional implementations, the execution entity may further perform the following steps 203' before performing step 203:
[0115] Step 203 ′: performing noise reduction processing on the target paper electrocardiogram binary image.
[0116] Considering that in practice, after the target paper ECG image is binarized, the obtained target paper ECG binary image may have some pixel points with segmentation errors, various image denoising methods can be used to perform denoising on the target paper ECG binary image. For example, various morphological transformation methods can be used.
[0117] Optionally, the denoising process can be performed on the target paper electrocardiogram binary image by performing erosion and dilation processes on the target paper electrocardiogram binary image.
[0118] By performing the optional implementation of step 203 ′ and then performing preliminary analysis using the target paper electrocardiogram binary image in the subsequent step 205 , the accuracy of the first origin location determination result obtained is higher.
[0119] Step 204 : Perform electrocardiogram digitization processing on the target paper electrocardiogram image to obtain a target digital electrocardiogram.
[0120] Here, various paper ECG digitization processing methods can be used to perform ECG digitization processing on a target paper ECG image to obtain a target digital ECG. The target digital ECG may include an ECG signal sequence of at least two leads. Here, the ECG signal is used to represent the ECG signal acquisition time and the corresponding ECG signal voltage.
[0121] In some optional embodiments, step 204 may include: Figure 2C Steps 2041 to 2044 are shown:
[0122] Step 2041 , intercepting an image of a preset central area in the target paper electrocardiogram image to obtain an image of the central area of the target paper electrocardiogram.
[0123] Here, in practice, most people tend to place the useful portion (e.g., the electrocardiogram portion) in a relatively central area when taking an image. In other words, it can be assumed that the image in the preset central area of the target paper electrocardiogram image will include the electrocardiogram waveform portion.
[0124] As an example, the preset central area may be an X*Y image block, where X and Y are positive integers, that is, the central area image of the target paper electrocardiogram includes X pixels horizontally and Y pixels vertically.
[0125] Step 2042: For each row corresponding to the vertical coordinates and each column corresponding to the horizontal coordinates in the target central region image of the paper electrocardiogram, calculate the corresponding row pixel mean and column pixel mean respectively.
[0126] Continuing with the above example, that is, the target central region image of the paper electrocardiogram includes X pixel points horizontally and Y pixel points vertically.
[0127] Here, for each vertical coordinate y between 0 and Y - 1, the row pixel mean corresponding to the vertical coordinate y can be calculated. The row pixel mean corresponding to the vertical coordinate y is the sum of the pixels of each pixel point with the vertical coordinate y in the target central region image of the paper electrocardiogram.
[0128] Here, for each horizontal coordinate x between 0 and X - 1, the column pixel mean corresponding to the horizontal coordinate x can be calculated. The column pixel mean corresponding to the horizontal coordinate x is the sum of the pixels of each pixel point with the horizontal coordinate x in the target central region image of the paper electrocardiogram.
[0129] Step 2043: According to the preset grid distribution rule of the paper electrocardiogram, based on the row pixel means and column pixel means, determine the number of horizontal pixels and the number of vertical pixels of the unit grid in the background grid lines corresponding to the target paper electrocardiogram image.
[0130] In practice, background grid lines are often drawn on paper electrocardiograms.
[0131] For example, the background grid lines can include square grids of the same size formed by vertically and horizontally intersecting identical grid lines.
[0132] For another example, in addition to the small square grids of the same size, the background grid lines can also include large square grids composed of N small square grids. Among them, the small square grids are separated by the first grid lines, and the large square grids are separated by the second grid lines. The first grid lines and the second grid lines are different. For example, the second grid lines are thicker than the first grid lines, or the second grid lines have a different color from the first grid lines.
[0133] Here, the above execution subject can, according to the preset grid distribution rule of the paper electrocardiogram, based on the row pixel means and column pixel means, determine the number of horizontal pixels and the number of vertical pixels of the unit grid in the background grid lines corresponding to the target paper electrocardiogram image.
[0134] For example, when the background grid lines include square grids of the same size formed by vertically and horizontally intersecting identical grid lines, the preset grid distribution rule of the paper electrocardiogram can be:
[0135] Among the row pixel means in the central region image of the target paper electrocardiogram, for the ordinate where the horizontal grid line is located, since the colors of the horizontal grid lines are basically the same, the row pixel mean corresponding to this ordinate should be within the preset grid line pixel mean range (for example, for the red grid line, the row pixel mean of the ordinate where the horizontal grid line is located should be near the red pixel value). For the ordinate where the non-horizontal grid line is located, since the colors of the non-horizontal grid lines mainly include the background board color (although there may also be electrocardiogram waveforms, mainly the background board color), the background board colors are also basically the same, and there is a large difference between the background board color and the grid line color, the row pixel mean corresponding to this ordinate should be within the preset background pixel mean range (for example, for the white background, the row pixel mean of the ordinate where the non-horizontal grid line is located should be near the white pixel value).
[0136] According to the above preset paper electrocardiogram grid distribution rule, based on the row pixel means corresponding to each ordinate in the central region image of the target paper electrocardiogram obtained in step 2042, the ordinate corresponding to the horizontal background grid line of the target paper electrocardiogram image can be determined. Then, based on the difference between the ordinates where two adjacent horizontal background grid lines are located, the number of vertical pixels corresponding to the horizontal unit grid in the background grid line can be calculated. For example, N horizontal background grid line ordinates are calculated and arranged in ascending order, and the mean value of the differences between N - 1 adjacent ordinates among the above N horizontal background grid line ordinates is determined as the number of vertical pixels of the unit grid in the background grid line.
[0137] The method for determining the number of horizontal pixels of the unit grid in the background grid line corresponding to the target paper electrocardiogram image can be analogous to the method for determining the number of vertical pixels described above, and will not be elaborated here.
[0138] Step 2044, for each lead identifier in the preset electrocardiogram lead identifier set, perform a lead signal generation operation.
[0139] Among them, the lead signal generation operation can be specifically performed as follows:
[0140] First, intercept the binary image of the electrocardiogram waveform corresponding to the lead of this lead identifier in the binary image of the target paper electrocardiogram.
[0141] In practice, the electrocardiogram waveform regions corresponding to different leads in the electrocardiogram are different and relatively fixed. Therefore, optionally, in the binary image of the target paper electrocardiogram, the binary image of the electrocardiogram waveform corresponding to the lead of this lead identifier can be intercepted according to the region where the electrocardiogram waveform corresponding to this lead identifier is located.
[0142] In practice, corresponding lead names can also be displayed in the electrocardiogram waveform regions corresponding to different leads in the electrocardiogram. Therefore, optionally, in the target binary image of the paper electrocardiogram, the lead name corresponding to the lead identifier can be identified first. Then, according to the position where the recognized lead name is located, the region where the electrocardiogram waveform corresponding to the lead identifier is located can be determined. Finally, the binary image of the electrocardiogram waveform of the lead corresponding to the lead identifier can be obtained by intercepting in the target binary image of the paper electrocardiogram according to the determined region.
[0143] Specifically, assuming there are 12 leads in total, for the i-th (i is a positive integer between 1 and 12) lead, a binary image IMG of the electrocardiogram waveform corresponding to the i-th lead identifier can be obtained. i . IMG i can include two types of pixel points, background pixel points and foreground pixel points. Generally speaking, since IMG i is an image of the electrocardiogram waveform region corresponding to the i-th lead, it should only include the foreground pixel points corresponding to the electrocardiogram signal of the i-th lead, and not include the electrocardiogram signals corresponding to other leads.
[0144] Secondly, for each foreground pixel point in the binary image of the electrocardiogram waveform of the lead corresponding to the lead identifier, according to the order of the abscissa corresponding to the acquisition time from early to late, based on the abscissa and ordinate, the number of horizontal pixels and vertical pixels of the unit grid in the corresponding background grid line of the target paper electrocardiogram image, and the preset horizontal unit grid duration and vertical unit grid voltage of the paper electrocardiogram unit grid, the electrocardiogram signal time and voltage corresponding to the corresponding foreground pixel point in the electrocardiogram signal sequence of the lead corresponding to the lead identifier are generated.
[0145] Specifically, first, for each foreground pixel point in the binary image IMG i of the electrocardiogram waveform corresponding to the i-th lead identifier, they are sorted according to the order of the corresponding abscissa corresponding to the acquisition time from early to late, and then the sorting result PIX i of the foreground pixel points is obtained. Assuming PIX i is arranged by the coordinates of M foreground pixel points, which are: (x1, y1), (x2, y2), …, (x M , y M ). It should be noted that among them, the abscissas of two adjacent foreground pixel points may be the same. In this case, the above two foreground pixel points can be arranged arbitrarily.
[0146] Then, assume that the number of horizontal pixels and vertical pixels of the unit grid in the background grid line corresponding to the target paper electrocardiogram image are W and H respectively, and both W and H are positive integers. Also assume that the horizontal unit grid duration corresponding to the preset paper electrocardiogram unit grid is T milliseconds (for example, T can be 40), and the vertical unit grid voltage is V millivolts (for example, V can be 0.1).
[0147] Then, here, for the j-th foreground pixel point (x i , y j ) in PIX j , where j is a positive integer greater than 1, the time t j and voltage v j in the electrocardiogram signal corresponding to the foreground pixel point (x j , y j ) in the electrocardiogram signal sequence of the i-th lead can be generated according to the following formula:
[0148]
[0149] Thus, an electrocardiogram signal sequence corresponding to the i-th lead and consisting of (M - 1) electrocardiogram signals (t j , v j ) can be obtained. Furthermore, electrocardiogram signal sequences of M leads can be obtained, and finally, the target digital electrocardiogram can be obtained.
[0150] Step 205: Based on the target digital electrocardiogram, extract the eigenvalue of each relevant feature in the preset set of ventricular arrhythmia-related features.
[0151] Here, the features in the preset set of ventricular arrhythmia-related features are features that have been medically proven to be related to ventricular arrhythmia. For example, features pointed out in authoritative medical literature related to ventricular arrhythmia.
[0152] Optionally, the preset set of ventricular arrhythmia-related features may include at least one of the following: R-wave duration index of V1 lead, R-wave duration index of V2 lead, R-wave amplitude index of V1 lead, R-wave amplitude index of V2 lead, transition ratio of V2 lead, TZ index of V1 lead, TZ index of V2 lead, TZ index of V3 lead, TZ index of V4 lead, TZ index of V5 lead, TZ index of V6 lead, SV2 / RV3 index of V2 and V3 leads.
[0153] Here, V1 lead, V2 lead, V3 lead, V4 lead, V5 lead, and V6 lead are chest leads. V1 lead and V2 lead correspond to the electrocardiogram of the right ventricle, V5 lead and V6 correspond to the electrocardiogram of the left ventricle, and V3 lead and V4 lead correspond to the electrocardiogram of the transition zone between the left and right ventricles.
[0154] Optionally, here, through a signal detection method, based on the target digital electrocardiogram, the eigenvalue of each relevant feature in the preset ventricular arrhythmia-related feature set can be extracted.
[0155] Step 206: Input the eigenvalues of the extracted ventricular arrhythmia-related features and the first origin site determination result into a pre-trained second ventricular arrhythmia origin site determination model to obtain a second origin site determination result of the ventricular arrhythmia suffered by the target user.
[0156] Here, the second ventricular arrhythmia origin site determination model is used to represent the corresponding relationship between the eigenvalues of the relevant features in the preset ventricular arrhythmia-related feature set and the initial origin site determination result and the final origin site determination result.
[0157] Since the first ventricular arrhythmia determination result obtained through step 203 only uses the binary image of the target paper electrocardiogram, and since the first ventricular arrhythmia origin site determination model is not interpretable. Therefore, in order to improve the accuracy and interpretability of the determination result of the ventricular arrhythmia origin site, in step 206, on the basis of the first ventricular arrhythmia determination result obtained in step 203, further comprehensively consider the eigenvalues of each relevant feature in the preset ventricular arrhythmia-related feature set that is medically proven to be related to ventricular arrhythmia obtained in step 205. By inputting the above two results into the second ventricular arrhythmia origin site determination model, among them, the eigenvalues of each relevant feature in the preset ventricular arrhythmia-related feature set that is medically proven to be related to ventricular arrhythmia can further improve the accuracy and interpretability of the second ventricular arrhythmia origin site determination result output by the second ventricular arrhythmia origin site determination model.
[0158] In some alternative embodiments, the first ventricular arrhythmia origin site determination model and the second ventricular arrhythmia origin site determination model can be pre-trained through the training step 300 as shown in Figure 3A The training step 300 includes the following steps 301 to 307:
[0159] Step 301: Obtain a set of sample paper electrocardiogram images and the ventricular arrhythmia origin site label corresponding to each sample paper electrocardiogram image.
[0160] Here, the sample paper electrocardiogram image is a paper electrocardiogram image obtained by performing an electrocardiogram examination on a patient diagnosed with ventricular arrhythmia. The ventricular arrhythmia origin site label corresponding to the sample paper electrocardiogram image is used to represent the origin site of the ventricular arrhythmia suffered by the patient corresponding to the sample paper electrocardiogram image.
[0161] Step 302: Binarize each sample paper electrocardiogram image to obtain the corresponding binarized sample paper electrocardiogram image.
[0162] Here, the same or a similar method as the image binarization method described in step 202 of the paper electrocardiogram analysis method shown in Figure 2A can be used to binarize each sample paper electrocardiogram image to obtain the corresponding binarized sample paper electrocardiogram image.
[0163] Step 303: Digitize each sample paper electrocardiogram image to obtain the corresponding sample digital electrocardiogram, and based on the obtained sample digital electrocardiogram, extract the eigenvalue of each relevant feature in the preset ventricular arrhythmia-related feature set to obtain the eigenvalues of each preset ventricular arrhythmia-related feature corresponding to the corresponding sample paper electrocardiogram image.
[0164] Here, the same or a similar method as the paper electrocardiogram digitization method described in step 204 of the paper electrocardiogram analysis method shown in Figure 2A can be used to digitize each sample paper electrocardiogram image to obtain the corresponding sample digital electrocardiogram.
[0165] Then, the same or a similar method as the digital electrocardiogram feature extraction method described in step 205 of the paper electrocardiogram analysis method shown in Figure 2A can be used to extract the eigenvalue of each relevant feature in the preset ventricular arrhythmia-related feature set based on the obtained sample digital electrocardiogram to obtain the eigenvalues of each preset ventricular arrhythmia-related feature corresponding to the corresponding sample paper electrocardiogram image.
[0166] Step 304: Generate each training data in the training data set using the binarized sample paper electrocardiogram image corresponding to each sample paper electrocardiogram image, the eigenvalues of each preset ventricular arrhythmia-related feature, and the ventricular arrhythmia origin site label.
[0167] Step 305: Obtain the model structure and model parameter information of the first initial ventricular arrhythmia origin site determination model and the second initial ventricular arrhythmia origin site determination model.
[0168] Here, the first initial ventricular arrhythmia origin site determination model and the second initial ventricular arrhythmia origin site determination model can be, for example, various deep neural network models.
[0169] Step 306: Perform a model parameter adjustment operation on the training data in the training data set until the preset training end condition is met.
[0170] Among them, the model parameter adjustment operation includes, for example, as Figure 3BSteps 3061 to 3063 shown below:
[0171] Step 3061: Input the sample paper electrocardiogram binary image in the training data into the first initial ventricular arrhythmia origin site determination model to obtain the first actual ventricular arrhythmia origin site determination result.
[0172] Step 3062: Input the eigenvalue of each ventricular arrhythmia-related feature in the training data and the first actual origin site determination result into the second initial ventricular arrhythmia origin site determination model to obtain the second actual origin site determination result.
[0173] Step 3063: Based on the difference between the ventricular arrhythmia origin site label in the training data and the second actual origin site determination result, adjust the model parameters of the first initial ventricular arrhythmia origin site determination model and the second initial ventricular arrhythmia origin site determination model.
[0174] The preset training end condition can be various conditions designed according to the actual training situation, and no specific limitation is made here. As an example, the preset training end condition may include at least one of the following conditions 1, 2, and 3:
[0175] Condition 1: The number of times of executing step 306 is greater than or equal to the preset number of times.
[0176] Condition 2: The time of executing step 306 exceeds the preset training duration.
[0177] Condition 3: The difference obtained in step 3063 is less than the preset difference threshold.
[0178] Condition 4: Before step 306, a validation data set is obtained in advance. The validation data in the validation data set includes a validated paper electrocardiogram binary image corresponding to the validated paper electrocardiogram image, the eigenvalue of each preset ventricular arrhythmia-related feature, and the corresponding ventricular arrhythmia origin site label. The subject corresponding to the validation data set is also a patient diagnosed with ventricular arrhythmia, and the subject corresponding to the validation data set is completely different from the subject corresponding to the training data set. The acquisition and generation method of the validated paper electrocardiogram binary image in the validation data set can be the same as or similar to the method described in step 302, and the generation method of the eigenvalue of each preset ventricular arrhythmia-related feature in the validation data set can be the same as or similar to the method described in step 303, which will not be elaborated here. Then, calculate the difference between the difference obtained in this step 3063 based on the validation data in the validation data set and the difference obtained when calculating the model parameters of the first initial ventricular arrhythmia origin site determination model and the second initial ventricular arrhythmia origin site determination model last time. Condition 4 is that the difference obtained by the above calculation is less than the preset loss function difference threshold. That is, the loss functions of the first initial ventricular arrhythmia origin site determination model and the second initial ventricular arrhythmia origin site determination model no longer decrease or decrease very little on the validation data set.
[0179] After step 306, the model parameters of the first initial ventricular arrhythmia origin site determination model and the second initial ventricular arrhythmia origin site determination model are optimized.
[0180] Step 307: Respectively determine the first initial ventricular arrhythmia origin site determination model and the second initial ventricular arrhythmia origin site determination model with adjusted parameters as the pre-trained first ventricular arrhythmia origin site determination model and the second ventricular arrhythmia origin site determination model.
[0181] In the paper electrocardiogram analysis method provided by the above embodiments of the present disclosure, by first inputting the target paper electrocardiogram binary image into the first origin site determination model, and then inputting the eigenvalue of each relevant feature in the preset ventricular arrhythmia-related feature set and the output result of the first origin site determination model into the second origin site determination model together for the second time. This is because the model input of the first origin site determination model is only the binary image, and the model interpretability is not strong. Each relevant feature in the preset ventricular arrhythmia-related feature set has been medically proven to be related to ventricular arrhythmia, which can increase the interpretability of the second origin site determination model. In addition, through two classifications, the accuracy of the finally obtained origin site determination result can be improved.
[0182] Further referring to Figure 4 As an implementation of the methods shown in the above figures, an embodiment of a paper electrocardiogram analysis device is provided in the present disclosure. This device embodiment is related toFigure 2A Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0183] like Figure 4 As shown, the paper electrocardiogram analysis device 400 of this embodiment includes: an electrocardiogram acquisition unit 401, a binarization unit 402, a first analysis unit 403, a digitization unit 404, a feature extraction unit 405, and a second analysis unit 406. Among them, the electrocardiogram acquisition unit 401 is configured to acquire a target paper electrocardiogram image obtained by performing an electrocardiogram examination on a target user, and the target user is diagnosed with ventricular arrhythmia; the binarization unit 402 is configured to perform binarization processing on the target paper electrocardiogram image to obtain a target paper electrocardiogram binarization image; the first analysis unit 403 is configured to input the target electrocardiogram binarization image into a pre-trained first ventricular arrhythmia origin site determination model to obtain a first origin site determination result for indicating the origin site of the ventricular arrhythmia; the digitization unit 404 , configured to perform electrocardiogram digitization processing on the target paper electrocardiogram image to obtain a target digital electrocardiogram; a feature extraction unit 405 is configured to extract the feature value of each relevant feature in the preset ventricular arrhythmia-related feature set based on the target digital electrocardiogram; a second analysis unit 406 is configured to input the extracted feature values of each ventricular arrhythmia-related feature and the first origin site determination result into a pre-trained second ventricular arrhythmia origin site determination model to obtain a second origin site determination result of the ventricular arrhythmia origin site of the target user
[0184] In this embodiment, the specific processing of the electrocardiogram acquisition unit 401, the binarization unit 402, the first analysis unit 403, the digitization unit 404, the feature extraction unit 405 and the second analysis unit 406 of the paper electrocardiogram analysis device 400 and the technical effects thereof can be referred to respectively. Figure 2A The relevant descriptions of step 201, step 202, step 203, step 204, step 205 and step 206 in the corresponding embodiment are not repeated here.
[0185] In some optional implementations, the digitizing unit 404 may be further configured to:
[0186] intercepting an image of a preset central area of the target paper electrocardiogram image to obtain an image of the central area of the target paper electrocardiogram;
[0187] For each row where the ordinate is located and the column where the abscissa is located in the central area image of the target paper electrocardiogram, respectively, calculating the corresponding row pixel mean and column pixel mean;
[0188] According to the preset paper electrocardiogram grid distribution rule, based on the mean value of each row pixel and the mean value of each column pixel, determine the number of horizontal pixels and the number of vertical pixels of the unit grid in the background grid line corresponding to the target paper electrocardiogram image;
[0189] For each lead identifier in the preset electrocardiogram lead identifier set, perform the following lead signal generation operations: intercept the binary image of the electrocardiogram waveform corresponding to the lead of the lead identifier in the binary image of the target paper electrocardiogram; for each foreground pixel point in the binary image of the electrocardiogram waveform corresponding to the lead of the lead identifier, according to the order of the abscissa corresponding acquisition time from early to late, generate the electrocardiogram signal time and voltage corresponding to the corresponding foreground pixel point in the electrocardiogram signal sequence of the lead corresponding to the lead identifier according to the horizontal and vertical coordinates, the number of horizontal pixels and the number of vertical pixels of the unit grid in the background grid line corresponding to the target paper electrocardiogram image, and the horizontal unit grid duration and the vertical unit grid voltage corresponding to the preset paper electrocardiogram unit grid.
[0190] In some alternative embodiments, the preset set of ventricular arrhythmia related features may include at least one of the following: R wave duration index of lead V1, R wave duration index of lead V2, R wave amplitude index of lead V1, R wave amplitude index of lead V2, transition ratio of lead V2, TZ index of lead V1, TZ index of lead V2, TZ index of lead V3, TZ index of lead V4, TZ index of lead V5, TZ index of lead V6, and SV2 / RV3 index of leads V2 and V3.
[0191] In some alternative embodiments, the apparatus 400 may further include: an angle correction unit ( Figure 4 not shown in the figure), configured to perform angle correction processing on the target paper electrocardiogram image before performing binary processing on the target paper electrocardiogram image to obtain a binary image of the target paper electrocardiogram.
[0192] In some alternative embodiments, the binary unit 402 may be further configured to:
[0193] Perform grayscale processing on the target paper electrocardiogram image to obtain a grayscale image of the target paper electrocardiogram;
[0194] Use an adaptive threshold algorithm to calculate the binary grayscale value threshold corresponding to the grayscale image of the target paper electrocardiogram in the preset set of grayscale value thresholds;
[0195] Perform binary processing on the grayscale image of the target paper electrocardiogram according to the determined binary grayscale value threshold to obtain the binary image of the target paper electrocardiogram.
[0196] In some alternative embodiments, the device 400 may further include: a noise reduction unit ( Figure 4 not shown in the figure), configured to perform noise reduction processing on the target binary electrocardiogram image of the paper electrocardiogram before inputting the target binary electrocardiogram image of the paper electrocardiogram into a pre-trained first ventricular arrhythmia origin site determination model.
[0197] In some alternative embodiments, the noise reduction unit may be further configured to: perform erosion and dilation processing on the target binary electrocardiogram image of the paper electrocardiogram.
[0198] In some alternative embodiments, the first ventricular arrhythmia origin site determination model and the second ventricular arrhythmia origin site determination model may be pre-trained through the following training steps:
[0199] Obtain a set of sample paper electrocardiogram images and the ventricular arrhythmia origin site labels corresponding to each sample paper electrocardiogram image, where the sample paper electrocardiogram image is a paper electrocardiogram image obtained by performing an electrocardiogram examination on a patient diagnosed with ventricular arrhythmia;
[0200] Perform binary processing on each sample paper electrocardiogram image to obtain the corresponding sample binary electrocardiogram image of the paper electrocardiogram;
[0201] Perform electrocardiogram digitization processing on each sample paper electrocardiogram image to obtain the corresponding sample digital electrocardiogram, and based on the obtained sample digital electrocardiogram, extract the eigenvalue of each relevant feature in the preset ventricular arrhythmia related feature set to obtain the eigenvalues of each of the preset ventricular arrhythmia related features corresponding to the corresponding sample paper electrocardiogram image;
[0202] Generate each training data in the training data set with the sample binary electrocardiogram image corresponding to each sample paper electrocardiogram image, the eigenvalues of each of the preset ventricular arrhythmia related features, and the ventricular arrhythmia origin site label;
[0203] Obtain the model structures and model parameter information of the first initial ventricular arrhythmia origin site determination model and the second initial ventricular arrhythmia origin site determination model;
[0204] For the training data in the training dataset, perform the following model parameter adjustment operations until the preset training end condition is met: Input the binary image of the sample paper electrocardiogram in the training data into the first initial ventricular arrhythmia origin site determination model to obtain the first actual ventricular arrhythmia origin site determination result; Input the eigenvalue of each ventricular arrhythmia-related feature in the training data and the first actual origin site determination result into the second initial ventricular arrhythmia origin site determination model to obtain the second actual origin site determination result; Adjust the model parameters of the first initial ventricular arrhythmia origin site determination model and the second initial ventricular arrhythmia origin site determination model based on the difference between the ventricular arrhythmia origin site label in the training data and the second actual origin site determination result.
[0205] Respectively, determine the first initial ventricular arrhythmia origin site determination model and the second initial ventricular arrhythmia origin site determination model with adjusted parameters as the pre-trained first ventricular arrhythmia origin site determination model and the second ventricular arrhythmia origin site determination model.
[0206] In some alternative embodiments, the feature extraction unit 405 may be further configured to: Based on the target digital electrocardiogram, extract the eigenvalue of each relevant feature in the preset set of ventricular arrhythmia-related features by a signal detection method.
[0207] It should be noted that the implementation details and technical effects of each unit in the paper electrocardiogram analysis device provided in the present disclosure can be referred to the descriptions of other embodiments in the present disclosure, and will not be elaborated here.
[0208] Next, refer to Figure 5 , which shows a schematic structural diagram of a computer system 500 of an electronic device suitable for implementing the embodiments of the present disclosure. Figure 5 The shown computer system 500 is merely an example and should not impose any limitation on the functions and usage scope of the embodiments of the present disclosure.
[0209] As Figure 5 shown, the computer system 500 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 502 or the program loaded from the storage device 508 into the random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. The input / output (I / O) interface 505 is also connected to the bus 504.
[0210] Typically, the following devices can be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509. The communication device 509 can allow the computer system 500 to communicate with other devices wirelessly or wiredly to exchange data. Although Figure 5 a computer system 500 with various devices is shown, it should be understood that it is not required to implement or have all the shown devices. Instead, more or fewer devices can be implemented or had.
[0211] In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, an embodiment of the present disclosure includes a computer program product that includes a computer program carried on a computer-readable medium, and the computer program contains program codes for performing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from a network through the communication device 509, or installed from the storage device 508, or installed from the ROM 502. When the computer program is executed by the processing device 501, the above functions defined in the methods of the embodiments of the present disclosure are performed.
[0212] It should be noted that the above-mentioned computer-readable medium in the present disclosure can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, the computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, apparatus, or device. In the present disclosure, the computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, in which computer-readable program code is carried. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, and this computer-readable signal medium can send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted by any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0213] The above-mentioned computer-readable medium can be included in the above-mentioned electronic device; it can also exist separately and not be assembled into the electronic device.
[0214] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device is caused to implement Figure 2A the paper electrocardiogram analysis method shown in the embodiments and their optional implementation manners as shown.
[0215] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, executed as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., connected through the Internet using an Internet service provider).
[0216] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, may be implemented by a dedicated hardware-based system for performing the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.
[0217] The units involved in the embodiments described in the present disclosure may be implemented in software or in hardware. Among them, the name of the unit does not constitute a limitation to the unit itself in some cases. For example, the acquisition unit may also be described as "the unit for acquiring the target paper electrocardiogram image obtained by performing an electrocardiogram examination on the target user".
[0218] The above description is only the preferred embodiments of the present disclosure and the explanation of the applied technical principles. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosure concept. For example, the technical solutions formed by mutually replacing the above features with the technical features (but not limited to) having similar functions disclosed in the present disclosure.
Claims
1. A method for analyzing paper electrocardiograms, the method comprising: Obtaining a target paper electrocardiogram image obtained from an electrocardiogram examination of a target user, where the target user is diagnosed with ventricular arrhythmia; Performing grayscale processing on the target paper electrocardiogram image to obtain a target paper electrocardiogram grayscale image; Calculating a binarization grayscale value threshold corresponding to the target paper electrocardiogram grayscale image in a preset set of grayscale value thresholds using an adaptive threshold algorithm; Performing binarization processing on the target paper electrocardiogram grayscale image according to the determined binarization grayscale value threshold to obtain a target paper electrocardiogram binarized image; Inputting the target paper electrocardiogram binarized image into a pre-trained first ventricular arrhythmia origin location determination model to obtain a first origin location determination result for indicating the origin location of ventricular arrhythmia; Performing electrocardiogram digitization processing on the target paper electrocardiogram image to obtain a target digital electrocardiogram, specifically including: intercepting an image of a preset central region in the target paper electrocardiogram image to obtain a target paper electrocardiogram central region image; for each row corresponding to a vertical coordinate and each column corresponding to a horizontal coordinate in the target paper electrocardiogram central region image, respectively calculating the corresponding row pixel mean and column pixel mean; according to a preset paper electrocardiogram grid distribution rule, based on each of the row pixel means and column pixel means, determining the number of horizontal pixels and the number of vertical pixels of a unit grid in the background grid lines corresponding to the target paper electrocardiogram image; for each lead identifier in a preset electrocardiogram lead identifier set, performing the following lead signal generation operation: intercepting a binarized electrocardiogram waveform image of the lead corresponding to the lead identifier in the target paper electrocardiogram binarized image; for each foreground pixel point in the binarized electrocardiogram waveform image of the lead corresponding to the lead identifier, in the order of the acquisition time corresponding to the horizontal coordinate from early to late, according to the horizontal and vertical coordinates, the number of horizontal pixels and the number of vertical pixels of the unit grid in the background grid lines corresponding to the target paper electrocardiogram image, and the horizontal unit grid duration and vertical unit grid voltage corresponding to the preset paper electrocardiogram unit grid, generating the electrocardiogram signal time and voltage corresponding to the corresponding foreground pixel point in the electrocardiogram signal sequence of the lead corresponding to the lead identifier; Based on the target digital electrocardiogram, extracting the feature value of each relevant feature in a preset set of ventricular arrhythmia-related features; Inputting the feature values of the extracted ventricular arrhythmia-related features and the first origin location determination result into a pre-trained second ventricular arrhythmia origin location determination model to obtain a second origin location determination result for the origin location of the ventricular arrhythmia suffered by the target user.
2. The method according to claim 1, wherein The preset collection of ventricular arrhythmia-related features includes at least one of the following: R-wave duration index of lead V1, R-wave duration index of lead V2, R-wave amplitude index of lead V1, R-wave amplitude index of lead V2, transition ratio of lead V2, TZ index of lead V1, TZ index of lead V2, TZ index of lead V3, TZ index of lead V4, TZ index of lead V5, TZ index of lead V6, and SV2 / RV3 index of leads V2 and V3.
3. The method according to claim 1, wherein Before performing the binarization process on the target paper electrocardiogram image to obtain a binarized target paper electrocardiogram image, the method further includes: Performing an angle correction process on the target paper electrocardiogram image.
4. The method according to claim 1, wherein Before inputting the binarized target paper electrocardiogram image into a pre-trained first ventricular arrhythmia origin site determination model, the method further includes: Performing a noise reduction process on the binarized target paper electrocardiogram image.
5. The method according to claim 4, wherein The performing the noise reduction process on the binarized target paper electrocardiogram image includes: Performing erosion and dilation processes on the binarized target paper electrocardiogram image.
6. The method according to claim 1, wherein, The first ventricular arrhythmia origin site determination model and the second ventricular arrhythmia origin site determination model are pre-trained through the following training steps: Obtaining a set of sample paper electrocardiogram images and the ventricular arrhythmia origin site labels corresponding to each sample paper electrocardiogram image, where the sample paper electrocardiogram images are paper electrocardiogram images obtained by performing electrocardiogram examinations on patients diagnosed with ventricular arrhythmia; Performing a binarization process on each sample paper electrocardiogram image to obtain a corresponding binarized sample paper electrocardiogram image; Performing electrocardiogram digitization processing on each sample paper electrocardiogram image to obtain a corresponding sample digital electrocardiogram, and based on the obtained sample digital electrocardiogram, extracting the feature values of each relevant feature in the preset collection of ventricular arrhythmia-related features to obtain the feature values of each of the preset ventricular arrhythmia-related features corresponding to the respective sample paper electrocardiogram images; Generating each training data in the training data set using the corresponding binarized sample paper electrocardiogram image of each sample paper electrocardiogram image, the feature values of each of the preset ventricular arrhythmia-related features, and the ventricular arrhythmia origin site labels; Obtaining the model structures and model parameter information of a first initial ventricular arrhythmia origin site determination model and a second initial ventricular arrhythmia origin site determination model; For the training data in the training dataset, perform the following model parameter adjustment operations until the preset training end condition is met: input the sample paper electrocardiogram binary image in the training data into the first initial ventricular arrhythmia origin site determination model to obtain the first actual ventricular arrhythmia origin site determination result; input the eigenvalue of each ventricular arrhythmia related feature and the first actual origin site determination result in the training data into the second initial ventricular arrhythmia origin site determination model to obtain the second actual origin site determination result; adjust the model parameters of the first initial ventricular arrhythmia origin site determination model and the second initial ventricular arrhythmia origin site determination model based on the difference between the ventricular arrhythmia origin site label in the training data and the second actual origin site determination result; Respectively determine the first initial ventricular arrhythmia origin site determination model and the second initial ventricular arrhythmia origin site determination model with adjusted parameters as the pre-trained first ventricular arrhythmia origin site determination model and the second ventricular arrhythmia origin site determination model.
7. The method according to claim 1, wherein The extraction of the eigenvalue of each related feature in the preset ventricular arrhythmia related feature set based on the target digital electrocardiogram includes: Based on the target digital electrocardiogram, extract the eigenvalue of each related feature in the preset ventricular arrhythmia related feature set through a signal detection method.
8. A paper electrocardiogram analysis device, the device includes: An electrocardiogram acquisition unit configured to acquire a target paper electrocardiogram image obtained by performing an electrocardiogram examination on a target user who is diagnosed with ventricular arrhythmia; A binarization unit configured to perform grayscale processing on the target paper electrocardiogram image to obtain a target paper electrocardiogram grayscale image; Calculate the binarization grayscale value threshold corresponding to the target paper electrocardiogram grayscale image in the preset grayscale value threshold set by using an adaptive threshold algorithm; Perform binarization processing on the target paper electrocardiogram grayscale image according to the determined binarization grayscale value threshold to obtain a target paper electrocardiogram binarized image; A first analysis unit configured to input the target paper electrocardiogram binarized image into a pre-trained first ventricular arrhythmia origin site determination model to obtain a first origin site determination result for indicating the origin site of ventricular arrhythmia; The digitalization unit is configured to perform electrocardiogram digitalization processing on the target paper electrocardiogram image to obtain a target digital electrocardiogram, specifically including: intercepting an image of a preset central area in the target paper electrocardiogram image to obtain a target paper electrocardiogram central area image; for each row where the ordinate is located and each column where the abscissa is located in the target paper electrocardiogram central area image, calculating the corresponding row pixel mean value and column pixel mean value respectively; according to the preset paper electrocardiogram grid distribution rule, based on each of the row pixel mean values and column pixel mean values, determining the number of horizontal pixels and the number of vertical pixels of the unit grid in the background grid line corresponding to the target paper electrocardiogram image; for each lead identification in the preset electrocardiogram lead identification set, performing the following lead signal generation operation: intercepting a binary image of the electrocardiogram waveform of the lead corresponding to the lead identification in the binary image of the target paper electrocardiogram; for each foreground pixel point in the binary image of the electrocardiogram waveform of the lead corresponding to the lead identification, according to the order of the abscissa corresponding to the acquisition time from early to late, generating the electrocardiogram signal time and voltage corresponding to the foreground pixel point in the electrocardiogram signal sequence of the lead corresponding to the lead identification according to the horizontal and vertical coordinates, the number of horizontal pixels and the number of vertical pixels of the unit grid in the background grid line corresponding to the target paper electrocardiogram image, and the horizontal unit grid duration and vertical unit grid voltage corresponding to the preset paper electrocardiogram unit grid. The feature extraction unit is configured to extract the feature value of each relevant feature in the preset set of ventricular arrhythmia-related features based on the target digital electrocardiogram. The second analysis unit is configured to input the feature values of the various ventricular arrhythmia-related features obtained by extraction and the first origin site determination result into a pre-trained second ventricular arrhythmia origin site determination model to obtain a second origin site determination result of the origin site of the ventricular arrhythmia suffered by the target user.
9. An electronic device, comprising: One or more processors; A storage device having one or more programs stored thereon, When the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method according to any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, wherein, The computer program, when executed by one or more processors, implements the method according to any one of claims 1-7.
Citation Information
Patent Citations
System for predicting ventricular arrhythmia origin position, electronic device and storage medium
CN113598782A
Paper electrocardiogram digitization method and device
CN115272112A