WO2021147866A1 - Ecg信号的获取方法及装置、存储介质、电子装置 - Google Patents

Ecg信号的获取方法及装置、存储介质、电子装置 Download PDF

Info

Publication number
WO2021147866A1
WO2021147866A1 PCT/CN2021/072748 CN2021072748W WO2021147866A1 WO 2021147866 A1 WO2021147866 A1 WO 2021147866A1 CN 2021072748 W CN2021072748 W CN 2021072748W WO 2021147866 A1 WO2021147866 A1 WO 2021147866A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
ecg
target
binarized
area
Prior art date
Application number
PCT/CN2021/072748
Other languages
English (en)
French (fr)
Inventor
王健
沈凌浩
屈奇勋
Original Assignee
深圳数字生命研究院
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳数字生命研究院 filed Critical 深圳数字生命研究院
Publication of WO2021147866A1 publication Critical patent/WO2021147866A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/155Segmentation; Edge detection involving morphological operators
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/194Segmentation; Edge detection involving foreground-background segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2218/00Aspects of pattern recognition specially adapted for signal processing
    • G06F2218/02Preprocessing

Definitions

  • the present disclosure relates to the field of image processing technology, and in particular, to an ECG signal acquisition method and device, storage medium, and electronic device.
  • ECG electrocardiograph
  • Paper ECG data is convenient for doctors to read images, but it is inconvenient to save and process.
  • paper ECG data is scanned and the ECG signal is saved as an image.
  • the ECG signal is converted into a two-dimensional image from multi-lead one-dimensional data. Due to the particularity of the ECG signal itself, the timing change of the ECG signal in the image cannot be directly analyzed in the image, and the details of the ECG signal are not significant in the entire image, so the ECG signal needs to be extracted and converted from the two-dimensional image. For one-dimensional data, subsequent analysis is carried out. This process is called the digitization of ECG.
  • the ECG digitization process is generally divided into two steps: 1 preprocessing of the ECG signal image, removing noise, and retaining the ECG part; 2 converting the ECG signal into one-dimensional data.
  • the prior art method for processing ECG images is to separate the ECG part from other parts by color or gray value.
  • ECG images especially the binarized ECG images, the pixel values of the ECG part and other noisy pixels The values are the same. Therefore, in the existing method, it is impossible to obtain the ECG part from the ECG image, especially the binary ECG image.
  • the embodiments of the present disclosure provide an ECG signal acquisition method and device, storage medium, and electronic device, so as to at least solve the problems in the related art, such as the inability of the prior art technical solutions to extract the ECG part of the binarized ECG image. .
  • an ECG signal acquisition method including: performing morphological operations on a binarized ECG image to obtain a target image area in the binarized ECG image, wherein the The pixel values of the binarized ECG image include: two different values, the target image area includes: a target ECG signal; the target image area or target sub-area is input into the first model to output the The target ECG signal in the binarized ECG image, wherein the first model is a model trained by machine learning using multiple sets of data to identify the target ECG signal, and each set of data in the multiple sets of data is Including: a binarized ECG image processed by a target ECG image simulation process and an ECG signal in the binarized ECG image processed by the simulation process, the target sub-region includes: the target ECG signal and the target ECG signal The distance of the ECG signal is in the surrounding area within the preset range.
  • an ECG signal acquisition device including: a processing module configured to perform morphological operations on the binarized ECG image to obtain the target in the binarized ECG image Image area, wherein the pixel values of the binarized ECG image include: two different values, the target image area includes: a target ECG signal; a determining module is configured to set the target image area or target sub The region is input into the first model to output the target ECG signal in the binarized ECG image, where the first model is a model for identifying the target ECG signal trained through machine learning using multiple sets of data
  • Each of the multiple sets of data includes: a binarized ECG image processed by a target ECG image simulation process and an ECG signal in the binarized ECG image processed by the simulation process, the target sub-region It includes: the target ECG signal and a surrounding area whose distance from the target ECG signal is within a preset range.
  • a storage medium in which a computer program is stored, wherein the computer program is configured to execute any of the above ECG signal acquisition methods when running.
  • an electronic device including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute any of the above ECG signal acquisition method.
  • morphological operations are performed on the binarized ECG image to obtain the target image area in the binarized ECG image, and then the target image area or target sub-area is input to the first model
  • the target sub-region includes: the target ECG signal and a surrounding area whose distance from the target ECG signal is within a preset range;
  • the ECG part can be effectively extracted from ECG images, especially binary ECG images, and during the extraction process, the technical solution of the present disclosure overcomes the use of deep learning-based training deep learning models, ECG images, especially binary ECG images, have a lot of noise, thin lines representing the ECG signal part, a small proportion of the image, and unclear details, which leads to problems that are difficult to manually label the ECG part.
  • the technical solution of the present disclosure can use less manual labor. Annotate, effectively complete the ECG image, especially the extraction of the ECG part of the binary ECG image.
  • Fig. 1 is a block diagram of the hardware structure of a computer terminal according to an ECG signal acquisition method according to an embodiment of the present disclosure
  • Fig. 2 is a flowchart of an ECG signal acquisition method according to an embodiment of the present disclosure
  • FIG. 3 is a flowchart of an ECG signal acquisition method according to an optional embodiment of the present disclosure
  • Fig. 4 is a schematic diagram of a preprocessing process according to an optional embodiment of the present disclosure.
  • FIG. 5 is a schematic diagram of a surrounding area of an ECG signal according to an optional embodiment of the present disclosure
  • Fig. 6 is a schematic diagram of an ECG image derived according to an optional embodiment of the present disclosure.
  • FIG. 7 is a schematic diagram of deriving an ECG label according to an optional embodiment of the present disclosure.
  • FIG. 8 is a schematic diagram of details of images before and after simulation according to an optional embodiment of the present disclosure.
  • Fig. 9 is a schematic diagram of a region of interest in an ECG image according to an optional embodiment of the present disclosure.
  • Fig. 10 is a schematic diagram of a segmentation result of an ECG image according to an optional embodiment of the present disclosure
  • Fig. 11 is a structural block diagram of an ECG signal acquisition device according to an embodiment of the present disclosure.
  • FIG. 1 is a hardware structure block diagram of a computer terminal of an ECG signal acquisition method according to an embodiment of the present disclosure.
  • the computer terminal may include one or more (only one is shown in FIG. 1) processor 102 (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) And the memory 104 configured to store data.
  • the above-mentioned computer terminal may also include a transmission device 106 and an input/output device 108 configured as a communication function.
  • a mobile phone running on a mobile phone as an example, it includes an input device, an output device, a processor 102, a memory 104, and a transmission device 106.
  • the input device may be a camera
  • the output device may be a mobile phone display.
  • the computer terminal can also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a palmtop computer, and a mobile Internet device (MID), PAD, and other terminal devices.
  • Fig. 1 does not limit the structure of the above-mentioned electronic device.
  • the electronic device may also include more or fewer components (such as a network interface, etc.) than shown in FIG. 1, or have a different configuration from that shown in FIG.
  • the memory 104 may be configured to store computer programs, for example, software programs and modules of application software, such as the computer programs corresponding to the ECG signal acquisition method in the embodiments of the present disclosure.
  • the processor 102 runs the computer programs stored in the memory 104, Thereby, various functional applications and data processing are executed, that is, the above-mentioned method is realized.
  • the memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.
  • the memory 104 may further include a memory remotely provided with respect to the processor 102, and these remote memories may be connected to the computer terminal through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
  • the transmission device 106 is configured to receive or transmit data via a network.
  • the above-mentioned specific examples of the network may include a wireless network provided by a communication provider of a computer terminal.
  • the transmission device 106 includes a network adapter (Network Interface Controller, NIC for short), which can be connected to other network devices through a base station to communicate with the Internet.
  • the transmission device 106 may be a radio frequency (Radio Frequency, referred to as RF) module, which is configured to communicate with the Internet in a wireless manner.
  • RF Radio Frequency
  • the above-mentioned electronic device further includes: a display 110 configured to display the target ECG signal; and a connection bus 112 configured to connect to various module components in the above-mentioned electronic device.
  • FIG. 2 is a flowchart of the method for acquiring an ECG signal according to an embodiment of the present disclosure. As shown in FIG. 2, the method includes the following steps:
  • Step S202 Perform a morphological operation on the binarized ECG image to obtain a target image area in the binarized ECG image, where the pixel values of the binarized ECG image include: two different values,
  • the target image area includes: a target ECG signal;
  • Step S204 Input the target image area or target sub-area into a first model to output the target ECG signal in the binarized ECG image, where the first model is to use multiple sets of data to pass through a machine A model for identifying a target ECG signal trained by learning, each of the multiple sets of data includes: a binarized ECG image processed by a target ECG image simulation process and a binarized ECG image processed by the simulation process
  • the target sub-region includes: the target ECG signal and a surrounding area whose distance from the target ECG signal is within a preset range.
  • the target image area or target sub-area is input into the first model
  • the target sub-region includes: the target ECG signal and the surrounding area whose distance to the target ECG signal is within a preset range; the above technical solution is adopted
  • the technical solution of the prior art is unable to extract the ECG part of the binarized ECG image, etc., and provides a target image that can be obtained after performing morphological operations on the binarized ECG image
  • the area or the target sub-area obtained from the target image area is input into the first model to determine the technical solution of the target ECG signal in the binarized ECG image.
  • the morphological operations described in the present disclosure include morphological open operations and morphological closed operations.
  • morphological closed operations are adopted, that is, first expansion and then corrosion to obtain the target image area.
  • the ECG part can be effectively extracted from ECG images, especially binary ECG images, and during the extraction process, the technical solution of the present disclosure overcomes the use of deep learning-based training deep learning models, ECG images, especially binary ECG images, have a lot of noise, thin lines representing the ECG signal part, a small proportion of the image, and unclear details, which leads to problems that are difficult to manually label the ECG part.
  • the technical solution of the present disclosure can use less manual labor. Annotate, effectively complete the ECG image, especially the extraction of the ECG part of the binary ECG image.
  • the binarized ECG image is subjected to image color inversion processing, in order to protect the sensitive information in the ECG image, it is also necessary to perform other processing on the extracted ECG image.
  • the area containing sensitive information in the image is hidden.
  • the sensitive information can be the user's name, gender, and other identity information, which can be replaced in the ECG image by covering the sensitive information with a specific shape.
  • the first model obtained by machine learning can also filter out sensitive information.
  • the target image area or target sub-area is input into the first model, and the binary ECG image is output.
  • the target ECG signal does not include any sensitive information.
  • the original format of the target ECG image document is PDF. After the corresponding sensitive information is removed, the document format is converted from PDF to PNG, and then the ECG part is extracted from the binarized ECG image.
  • step S202 can be implemented in multiple ways.
  • it can be implemented in the following ways: performing morphological operations on the binarized ECG image to obtain the target image area in the binarized ECG image, including: The color inversion processing is performed on the ECG image after the color inversion processing; the morphological operation is performed on the ECG image after the color inversion processing to obtain the target image area in the binarized ECG image, and the color inversion processing process in the embodiment of the present disclosure
  • the following steps may be included: determining the foreground area and the background area in the binarized ECG image, where the foreground area includes: a target ECG signal and a table in the binarized ECG image, and the pixel value of the foreground area is the first value, The pixel value of the background area is the second value; the pixel value of the foreground area is set to the second value, and the pixel value of the background area is set to the first value, for example, the first value can be 255 and the second value can be
  • the target ECG signal in the foreground area and the table in the binarized ECG image are all black, and the black in the foreground area corresponds to the first value pixel, and the corresponding The value of is set to 0; the white in the background area corresponds to the second value pixel, and the corresponding value is set to 255.
  • the second value pixel value of the background area corresponds to the first value pixel value
  • the first value in the foreground area The value pixel value is inverted to the second value pixel value. After the color inversion, the pixels in the foreground area change from 0 to 255.
  • the foreground pixels in the effective image area are very densely distributed, most of them are closed by morphological closing operation. Areas with densely distributed pixel points are connected.
  • the implementation of the present disclosure can use structural elements with a morphological operator of 11 ⁇ 11 (that is, a matrix of 11 ⁇ 11, and the matrix elements are all 1).
  • the matrix elements When it is 1, the matrix is preferably (9-21) ⁇ (9-21), which is not specifically limited here; and after the morphological closing operation, most of the points in the foreground area in the effective image area are connected Enclose it to form several image areas with relatively porous holes.
  • the effective image area should be the image area with the largest area in the image, so remove it Images other than the image area with the largest area; from the original binarized ECG image, extract the circumscribed rectangular image of the image area with the largest area to obtain an effective ECG image containing the target ECG signal, which is the target of the above embodiment Image area.
  • the pixel value of the foreground area of the binarized ECG image is 255, and the pixel value of the background area is 0, and then the binarized ECG image is morphologically closed to obtain the target ECG signal.
  • Effective ECG image is optionally, before performing step S204, the target subregion needs to be extracted from the target image region; and then the extracted target subregion is input into the first model, and the target ECG signal in the binarized ECG image is output.
  • the ECG image contains the target ECG signal and the region of interest in the surrounding area whose distance to the target ECG signal is within a preset range is input into the first model, and the binarization is obtained through the first model processing completed by training The target ECG signal in the ECG image.
  • extracting the target sub-region from the target image area can be achieved by the following technical solution: Obtain multiple partial images from the target image area, where any two adjacent partial images in the multiple partial images overlap Region; input multiple partial images into the second model to output multiple segmentation results corresponding to multiple partial images, where the second model is trained by using multiple sets of data through machine learning to identify partial images
  • the model of the region containing the target ECG signal, each of the multiple sets of data includes: the original binarized ECG image and the labeled binarized ECG image, where the original binarized ECG image includes: The target ECG signal, the ECG area where the similarity between the target ECG signal and the target ECG signal is less than the preset threshold, the noise signal area, the marked binarized ECG image includes: the target ECG signal, and the target ECG signal similarity is less than the preset threshold ECG area; combine multiple segmentation results into the overall segmentation result of the target image area; directly determine the target sub-area according to the entire segmentation result, or the pixel value of the
  • multiple segmentation results are combined into an overall segmentation result.
  • the pixel value of each point has a probability, that is, whether this point is a point in the ECG area, and the pixel probability ranges from 0 to 1.
  • the threshold value is set to 0.5, that is, in the overall segmentation result, pixels with a pixel value greater than 0.5 are set to 1, and pixels less than or equal to 0.5 are set to 0.
  • the threshold may also be set to 0.4, 0.55, 0.6, 0.65, 0.8, etc., which is not specifically limited here. In this way, the overall segmentation result is a binary image.
  • the pixel value of the point with the pixel value of 0 in the overall segmentation result is 0 in the multiplied image
  • the point with the pixel value of 1 in the overall segmentation result is the pixel value of the corresponding pixel of the target area image in the multiplied image.
  • the pixel value can be understood as the overall segmentation result of binarization is the segmentation result, and the multiplication with the target area image is to preserve the original pixel value.
  • the input of the above-mentioned second model may also be the entire target image area, which is not limited in the embodiment of the present disclosure.
  • the following technical solution may also be executed: Obtain the binarized ECG image processed by the target ECG image simulation process in the following manner: Obtain Target ECG image.
  • the target ECG image is an RGB image; the simulation processing is to add white noise to the ECG image to obtain the binary ECG image processed by the simulation.
  • the target ECG image can be obtained by an electrocardiogram measurement system.
  • the derived may also be obtained through other technical solutions such as camera taking pictures, signal receiver reception, and network downloading, which is not limited in the embodiment of the present disclosure.
  • the ECG signal in the binary ECG image processed by the simulation is obtained in the following manner: Obtain the target ECG image, where the ECG image is an RGB image; convert the RGB image to a grayscale image, and determine the average value of each pixel in the grayscale image; retain the target pixel whose average value of the pixel point is less than the first value, And set the pixel value of the target pixel to 1 to obtain the ECG signal in the binary ECG image processed by the simulation.
  • the analysis process of the target image area by the first model can be realized by the following technical solution: acquiring multiple partial images from the target image area, wherein any two adjacent partial images in the multiple partial images overlap Region; input multiple partial images into the first model to output multiple segmentation results corresponding to multiple partial images; combine multiple segmentation results into the overall segmentation result of the target image area; combine the pixel values of the overall segmentation result
  • the pixel value of the target image area is sequentially multiplied according to the corresponding position to determine the target ECG signal.
  • the embodiment of the present disclosure may also directly determine the overall segmentation result as the target ECG signal.
  • the analysis process of the target sub-region of the above-mentioned first model can be realized by the following technical solution: acquiring multiple partial images from the target sub-region, wherein any two adjacent partial images of the multiple partial images exist Overlap area; input multiple partial images into the first model to output multiple segmentation results corresponding to multiple partial images; combine multiple segmentation results into the overall segmentation result of the target sub-region; combine the pixels of the overall segmentation result The value is multiplied by the pixel value of the target sub-region in sequence according to the corresponding position to determine the target ECG signal.
  • the analysis process of the target image area and the target sub-area of the first model is to analyze multiple partial images first, and then correspondingly output multiple segmentation results, and integrate the multiple segmentation results to obtain the overall segmentation result.
  • the input of the above-mentioned first model may also be the entire target image area or this target sub-area, which is not limited in the embodiment of the present disclosure.
  • the first model or the second model is trained in the following manner: the parameters of the first model or the second model are adjusted according to a target loss function, wherein the target loss function passes through two Value cross entropy and Dice loss function are determined.
  • the target loss function is equal to a ⁇ binary cross entropy+b ⁇ Dice loss function
  • performing a morphological operation on the binarized ECG image to obtain the target image area in the binarized ECG image includes: performing a specified morphological operator on the binarized ECG The image is processed; the areas where the pixel points are densely distributed in the processed binarized ECG image are connected to obtain a plurality of images with closed areas; the non-pixel parts of the plurality of images with closed areas are filled Pixels; the area with the largest area after filling the pixels is taken as the target image area.
  • FIG. 3 is an ECG signal according to an alternative embodiment of the present disclosure.
  • the flow chart of the acquisition method includes the following steps:
  • Step S302 preprocess the binarized ECG scan image, and then extract effective image scores from the ECG document image derived from the electrocardiogram measurement system;
  • the preprocessing process includes two steps: 1) The image color is inverted.
  • the foreground area (including the ECG signal and the table) is black.
  • the pixel value is 0; the background area is white, and the pixel value is 255. Invert the colors of the foreground area and the background area, that is, set the pixel value of the foreground area to 255 and the pixel value of the background area to 0.
  • the foreground pixel is 255 after the color is inverted. Since the foreground pixel points of the effective image area are very densely distributed, the most densely distributed areas of the pixel points are first connected through the morphological closing operation, and the morphological calculation is used.
  • the matrix element is 1, the matrix is preferably (9-21) ⁇ (9-21) structural elements, more preferably, the matrix is 11 ⁇ 11 structural elements; after the closing operation, most of the effective image area The former scenic spots are all connected to form an image area with a relatively porous hole.
  • Use hole filling to fill this object into a complete image area after filling, the effective image area should be the image area with the largest area in the image, so remove Remove other image areas except the image area with the largest area; extract the circumscribed rectangular image of the image area with the largest area from the original binary ECG scanned image, and use this image for subsequent processing.
  • FIG 4 The input and output of the above preprocessing process are shown in Figure 4, the left side is the original binary ECG scan image, and the right side is the extracted effective image part, hereinafter referred to as "ECG image".
  • ECG image the extracted effective image part
  • 1834 binary ECG scan image data are used.
  • each image needs to be preprocessed to obtain 1834 ECG images for use.
  • 1834 images are optional, and ECG images of other values can be used for model training.
  • Step S304 Manually mark the region of interest of part of the binary ECG scan image (that is, the target sub-region of the above-mentioned embodiment, which contains the ECG signal and the surrounding area of the ECG signal), and train UNet1 (that is, the second model of the above-mentioned embodiment). Extract from the region of interest (Region Of Interest, ROI for short); among them, the surrounding area of the ECG signal is shown in Figure 5 below.
  • the region of interest refers to the ECG signal region and the surrounding area of the ECG signal.
  • the region of interest contains the complete ECG signal and also contains some noise signals.
  • the noise in the region of interest is far greater. Less than the noise in the fully binarized ECG image.
  • the manual labeling includes the following: complete ECG area; manual labeling must include suspected ECG areas; manual labeling does not include OK It is determined that the area is noise.
  • the content included in the manual labeling can be determined according to the instructions of the labeler, or other implementation methods can be used.
  • UNet1 is widely used for medical image segmentation.
  • any Network for segmentation other networks also include FCN, Faster R-CNN, Mask R-CNN, deeplab, etc.
  • Step S306 Use the ECG document simulation process derived from the system to generate a binary ECG scan image, and use the simulated ECG image generated by the simulation process to train UNet2 (ie, the first model in the foregoing embodiment) to extract the ECG signal part.
  • UNet2 ie, the first model in the foregoing embodiment
  • 249 target ECG images are passed, all images are RGB images, where the background point is white, the RGB value is (255,255,255), and the ECG curve pixel is (0,0, 0), the main grid point pixel value is (255,128,128), the non-backbone grid point pixel value is (255,179,179), the RGB image is converted to a grayscale image, the specific method is to calculate the average value of each pixel, and then retain the grayscale If the pixel value of the image is less than 255, the background can be removed.
  • the simulation can be performed only by processing other noises.
  • An optional embodiment of the present disclosure adds white to the exported ECG image. Noise, preferably, the range of the proportion of added white noise can be considered in the range of 5% to 20%, for example, 5%, 8%, 10%, 12.5%, 18%, 20%, 25%, etc., specifically here It is not limited. It should be noted that the percentage refers to the ratio of the number of white noise points added to the total number of pixels in the derived ECG image.
  • training UNet1 to extract the region of interest in step S304 in FIG. 3 specifically includes the following steps:
  • Step A 10 ECG images can be used for annotation, 6 ECG images and annotations are randomly used as the training set, 2 ECG images and annotations are randomly used as the verification set in the remaining images, and the remaining 2 ECG images and The labels are used as the test set, and the number of the training set, the verification set, and the test set may be other values, which is not limited in the embodiment of the present disclosure.
  • Step B Before each training iteration starts, first randomly extract 64 from the 6 training set images. This number represents the sample size used in one training iteration. The optional values are 32, 64, 128, 256 and other pixel sizes. It is a partial image of 256 pixels ⁇ 256 pixels; 64 partial images of 256 pixels ⁇ 256 pixels are extracted from each verification set image;
  • the size of the image of the input model and the size of the ECG image in the foregoing embodiment are not fixed.
  • the entire image may not be input.
  • 128 pixels ⁇ 128 may be input.
  • Step C In each training iteration, use the partial images of the training set to train UNet, and adjust the UNet parameters according to the loss function;
  • the loss function used is the sum of the binary cross entropy and the Dice loss function; the sum of the binary cross entropy and the Dice loss function is a commonly used loss function for training the segmentation model.
  • Binary cross-entropy describes the difference between the model prediction results and the actual annotation results
  • the Dice loss function describes the overlap between the model prediction results and the actual annotation results.
  • the loss function is the sum of the Focal loss function and the Dice loss function. Because the ECG area occupies a relatively small portion of the entire image, the weight of the ECG area should be increased.
  • the Focal loss function can deal with unbalanced classification problems. In this task, a large number of pixels are the background area and a small number of pixels are the foreground area.
  • the Dice loss function only considers the foreground area in the label and the foreground area in the segmentation result, so most of the background area is ignored.
  • the loss function value obtained by combining the Focal loss function and the Dice loss function, the Focal loss function obtained at this time is lower than when the Focal loss function is used alone, and the Dice loss function is also lower than when the Dice loss function is used alone. The combination of these can effectively improve the segmentation effect of the model.
  • the complete image is generally used as the model input.
  • the part of the ECG to be segmented in the disclosed embodiment is in the shape of a slender strip, has no texture feature, has weak morphological features, and the ECG area occupies a small proportion of the complete image. Therefore, the ECG area has no obvious features on the complete image scale, and is not suitable for the complete image. Enter the model. Therefore, the partial image is input into the model, because the background area of the partial image is small, and the ECG area characteristics are more obvious. And the use of partial images is helpful for the simulation of the real ECG region. It is easier to simulate on a small image than on a complete image.
  • Step D After each training iteration, use the trained UNet to segment the image of the partial image of the verification set, and use the segmentation result and the annotation of the partial image of the verification set to calculate the loss function.
  • the loss function has no upper limit and the lower limit is 0; the loss function is the performance of the segmentation effect and cannot affect the segmentation effect; if the segmentation result is exactly the same as the labeling result, then the loss function is 0; the better the segmentation effect, the closer the loss function is to 0; The worse the segmentation effect, the greater the loss function.
  • Step E Determine whether to stop training. If it stops, the model training is completed; if it does not stop, repeat the process B to D; when the set number of training iterations is reached, the set number of the embodiments of the present disclosure may range from 100 to 200.
  • the loss function does not decrease for N consecutive times (5 ⁇ N ⁇ 20), in the embodiment of the present disclosure, the value of N is set to 10, and the above two stopping conditions are satisfied, and the training can be stopped.
  • the training of UNet in step S306 in FIG. 3 to extract the ECG region can also be implemented by the following scheme:
  • Step 1 Select 249 simulated ECG data and their annotations, randomly use 60% simulated ECG images and annotations as the training set, randomly use 20% simulated ECG images and annotations in the remaining images as the verification set, and use the remaining 20% simulated ECG images and annotations as the training set. Test set.
  • Step 2 Before each training iteration starts, first randomly extract 64 images from the 6 training set images (this number represents the sample size used in one training iteration, and the optional values are 32, 64, 128, 256, etc.). It is a partial image of 256 ⁇ 256 (the size of the input model image, the size of the ECG image is not fixed, and the image size is large, so instead of inputting the entire image, you can also input 128 ⁇ 128, 224 ⁇ 224); verify from each 64 partial images with a size of 256 ⁇ 256 are extracted from the set of images;
  • Step 3 In each training iteration, use the partial images of the training set to train UNet.
  • the parameters of UNet you can consider adjusting the UNet parameters according to the loss function, where the above loss function has no upper limit , The lower limit is 0; the loss function is the performance of the segmentation effect and does not affect the segmentation effect; when the segmentation result is exactly the same as the labeling result, the loss function is 0; the better the segmentation effect, the closer the loss function is to 0; the worse the segmentation effect , The greater the loss function.
  • Training a neural network generally contains two parameters: one is the parameters of the network itself, or weights, which exist in the hidden layer of the network and are used to calculate the output from the input and obtain new features; the other is the super Parameters. This part of the parameters control the learning process of the neural network, such as the learning rate and the number of iterations.
  • the optional embodiment of the present disclosure refers to adjusting the parameters of UNet itself, that is, the first type of parameter, and the loss function used is the sum of the binary cross-entropy and the Dice loss function;
  • Step 4 After each training iteration, use the trained UNet to segment the partial images of the validation set, use this segmentation result and the annotations of the partial images of the validation set to calculate the loss function, and determine whether to stop training. If it stops, the model The training is completed; if you do not stop the training process, continue to repeat the above steps 1 to 4, when the set number of training iterations is reached, and the loss function does not decrease for N consecutive times (5 ⁇ N ⁇ 20), the above is satisfied Two stopping conditions can stop training.
  • the value of N is set as an example by the implementer of the present disclosure, and the range of the number of training iterations mentioned above can be 100 to 200.
  • Step 1 Extract partial images uniformly from the two images in the test set (where there is an overlapping area of 128 for each two partial images). If the length and width of the partial image are 256 pixels, and the overlapped pixels are 128, then left and right Or the overlapping area of the upper and lower partial images is 0.5 of a single partial image, and the overlapping area of the two diagonal partial images is 0.25 of a single partial image.
  • the range of overlap is 0 to 255. When the overlap is 0, that is, all the partial images do not overlap; when the overlap is 255, that is, a square of 256 length and width is taken out from around each pixel in the image.
  • the completed segmentation result is converted into a binary image (the value of pixels less than or equal to 0.5 is 0, and the value of pixels greater than 0.5 is 1). Compare the Dice coefficient of the segmentation result with the annotation of the test set image, and the result of the comparison is that the Dice coefficient is 0.97.
  • the value range of the Dice coefficient is [0,1], and the embodiment of the present disclosure can accept a Dice coefficient of 0.9 or more.
  • a in the above formula can be interpreted as the real annotated image
  • B is the model segmentation result
  • represents the number of object pixels in the actual annotated image
  • represents the object pixel in the model segmentation result
  • represents the number of pixels in the overlapping part of the real annotated image and the segmentation result of the model.
  • Step 2 Divide the remaining 1824 unlabeled images (because 1834 ECG images are used as the total number in the above embodiment, and 10 images are selected for labeling, 1824 ECG images are left) images are segmented according to the method in step 1. To obtain the segmentation result. The ECG image is multiplied by the segmentation result. In the segmentation result, the pixel value of the ECG area is 1, and the pixel value of the background area is 0. When the UNet model is used for the extraction of the region of interest, it is necessary to extract the ECG part from the original ECG image , The simplest method is to multiply the corresponding positions of the two matrices of the ECG image and the segmentation result, so that the ECG part can be retained, as shown below:
  • step S306 of FIG. 3 when the UNet model is used for ECG region extraction, the following steps are performed:
  • Step 1 Extract partial images uniformly from the simulated ECG images of the test set (each two partial images have 128 overlapping areas), input all partial images into UNet for prediction, and obtain the segmentation result (the segmentation result of the partial image is 256 ⁇ 256 matrix, each element in the matrix is 0 to 1, indicating the probability that this point is the point of the ECG region of interest), and then all the segmentation results are combined into a complete segmentation result. Some of these regions are predicted multiple times, and the segmentation results of these regions are filled with the average value of multiple predictions. Using 0.5 as the threshold, the completed segmentation result is converted into a binary image (the value of pixels less than or equal to 0.5 is 0, and the value of pixels greater than 0.5 is 1).
  • the value range of the Dice coefficient is [0,1], and the embodiment of the present disclosure can accept a Dice coefficient of 0.9 or more. It should be noted that for the embodiments of the present disclosure, the higher the Dice coefficient, the better.
  • Step 2 The unlabeled 1834 real ECG images of the region of interest are segmented according to the method in step 1, and the segmentation results are obtained, as shown in Figure 10 (Note: The actual input of the model is not a complete image, and the output is not Full image size). After this step, the ECG region segmentation is completed, and then the target ECG signal is obtained.
  • the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, of course, it can also be implemented by hardware, but in many cases the former is Better implementation.
  • the technical solution of the present disclosure essentially or the part that contributes to the existing technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium (such as ROM/RAM, magnetic disk, The optical disc) includes a number of instructions to enable a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of the various embodiments of the present disclosure.
  • an ECG signal acquisition device is also provided, and the device is configured to implement the above-mentioned embodiments and preferred implementations, and what has been described will not be repeated.
  • the term "module" can implement a combination of software and/or hardware with predetermined functions.
  • the devices described in the following embodiments are preferably implemented by software, implementation by hardware or a combination of software and hardware is also possible and conceived.
  • FIG. 11 is a structural block diagram of a device for acquiring an ECG signal according to an embodiment of the present disclosure. As shown in FIG. 11, the device includes:
  • the processing module 52 performs morphological operations on the binarized ECG image to obtain the target image area in the binarized ECG image, wherein the pixel values of the binarized ECG image include: two Different values, the target image area includes: a target ECG signal;
  • the determining module 54 inputs the target image area or target sub-area into a first model to output the target ECG signal in the binarized ECG image, wherein the first model is a multi-use model.
  • a model for identifying a target ECG signal trained by a set of data through machine learning, and each set of data in the multiple sets of data includes: a binarized ECG image processed by a target ECG image simulation process and a second simulation process.
  • the target sub-region includes: the target ECG signal and a surrounding area whose distance from the target ECG signal is within a preset range;
  • the target image area or target sub-area is input into the first model to output
  • the target sub-region includes: the target ECG signal and the surrounding area whose distance from the target ECG signal is within a preset range;
  • the technical solution of the prior art is unable to extract the ECG part of the binarized ECG image, etc., and provides a target image that can first perform image coloring processing on the binarized ECG image.
  • the area or the target sub-area obtained from the target image area is input into the first model to determine the technical solution of the target ECG signal in the binarized ECG image.
  • the morphological operations described in the present disclosure include morphological open operations and morphological closed operations.
  • morphological closed operations are adopted, that is, first expansion and then corrosion to obtain the target image area.
  • the ECG part can be effectively extracted from ECG images, especially binary ECG images, and during the extraction process, the technical solution of the present disclosure overcomes the use of deep learning-based training deep learning models, ECG images, especially binary ECG images, have a lot of noise, thin lines representing the ECG signal part, a small proportion of the image, and unclear details, which leads to problems that are difficult to manually label the ECG part.
  • the technical solution of the present disclosure can use less manual labor. Annotate, effectively complete the ECG image, especially the extraction of the ECG part of the binary ECG image.
  • the binarized ECG image undergoes image color inversion processing, in order to protect the sensitive information in the ECG image, it is also necessary to perform other processing on the extracted ECG image to remove the sensitive information area in the image.
  • the sensitive information can be the user’s name, gender, and other identity information, which can be replaced in the ECG image by covering the sensitive information with a specific shape.
  • the original format of the target ECG image document is PDF. After the corresponding sensitive information is removed, the document format is converted from PDF to PNG, and then the ECG part is extracted from the binarized ECG image.
  • the processing module is further configured to determine the foreground area and the background area in the binarized ECG image, where the foreground area includes the target ECG signal and the table in the binarized ECG image, and the pixel value of the foreground area is The first value, the pixel value of the background area is the second value;
  • the pixel value of the foreground area is set to the second value, and the pixel value of the background area is set to the first value to obtain the target image area.
  • the target ECG signal in the foreground area and the table in the binarized ECG image are all black, and the black in the foreground area corresponds to the first value pixel, and the corresponding The value of is set to 0; the white in the background area corresponds to the second value pixel, and the corresponding value is set to 255.
  • the second value pixel value of the background area corresponds to the first value pixel value
  • the first value in the foreground area The value pixel value is inverted to the second value pixel value. After the color inversion, the pixels in the foreground area change from 0 to 255.
  • the foreground pixels in the effective image area are very densely distributed, most of them are closed by morphological closing operation. Areas with densely distributed pixels are connected.
  • the implementation of the present disclosure can use structural elements with a morphological operator of 11 ⁇ 11 (that is, a matrix of 11 ⁇ 11, the matrix elements are all 1, and the corresponding matrix can be selected from 9 to 21); After the morphological closing operation, most of the points in the foreground area in the effective image area are connected to form an object with a relatively porous hole, and this object is filled into a complete object with hole filling; After filling, the effective image area should be the object with the largest area in the image.
  • an effective ECG image containing the target ECG signal (that is, the target image area in the above-mentioned embodiment) is obtained.
  • the determining module is further configured to extract the target sub-region from the target image region; input the target sub-region into the first model, and output the target ECG signal in the binarized ECG image.
  • the determining module is further configured to obtain multiple partial images from the target image area, where any two adjacent partial images in the multiple partial images have overlapping areas; input the multiple partial images into the second model , To output multiple segmentation results corresponding to multiple partial images, where the second model is a model trained by machine learning using multiple sets of data to identify regions in the partial images that contain the target ECG signal.
  • Each set of data includes: the original binarized ECG image, and the labeled binarized ECG image, where the original binarized ECG image includes: the target ECG signal, and the similarity between the target ECG signal and the target ECG signal is less than the expected Threshold ECG area, noise signal area, labeled binarized ECG image includes: target ECG signal, and ECG area whose similarity with target ECG signal is less than the preset threshold; combine multiple segmentation results into target image area The overall segmentation result; the pixel value of the overall segmentation result and the pixel value of the target image area are sequentially multiplied according to the corresponding position to determine the target sub-area.
  • the determining module is further configured to obtain multiple partial images from the target image area, where any two adjacent partial images in the multiple partial images have overlapping areas; input the multiple partial images into the first model , To output multiple segmentation results corresponding to multiple partial images; combine multiple segmentation results into the overall segmentation result of the target image area; multiply the pixel value of the overall segmentation result and the pixel value of the target image area according to the corresponding position
  • the overall segmentation result can also be directly determined as the target ECG signal.
  • the input of the above-mentioned second model may also be the entire target image area, which is not limited in the embodiment of the present disclosure.
  • the determining module is further configured to obtain multiple partial images from the target sub-region, where any two adjacent partial images in the multiple partial images have overlapping areas; input the multiple partial images into the first model , To output multiple segmentation results corresponding to multiple partial images; combine multiple segmentation results into the overall segmentation result of the target sub-region; multiply the pixel value of the overall segmentation result and the pixel value of the target sub-region according to the corresponding position in sequence
  • the overall segmentation result can also be directly determined as the target ECG signal.
  • the processing module is further configured to obtain a binarized ECG image processed through a target ECG image simulation process by: obtaining the target ECG image, wherein the target ECG image is an RGB image; White noise is added to the ECG image to simulate the processing of the binarized ECG image.
  • the method further includes: Obtain the ECG signal in the binary ECG image processed by the simulation in the following manner: Obtain the target ECG image, where the ECG image is an RGB image; Convert the RGB image into a grayscale image, and determine The average value of each pixel in the grayscale image; retain the target pixel whose average value of the pixel is less than the first value, and set the pixel value of the target pixel to 1, to obtain the second of the simulation processing The ECG signal in the valued ECG image.
  • the determining module is further configured to adjust the parameters of the first model or the second model according to a target loss function, wherein the target loss function is determined by a binary cross-entropy and a Dice loss function.
  • the embodiment of the present disclosure also provides a storage medium in which a computer program is stored, wherein the computer program is configured to execute the steps in any one of the foregoing method embodiments when running.
  • the aforementioned storage medium may be configured to store a computer program for executing the following steps:
  • each of the multiple sets of data includes: a binarized ECG image processed by a target ECG image simulation process and a binarized ECG image processed by the simulation process
  • the target sub-region includes: the target ECG signal and a surrounding area whose distance from the target ECG signal is within a preset range.
  • the foregoing storage medium may include, but is not limited to: U disk, Read-Only Memory (Read-Only Memory, ROM for short), Random Access Memory (Random Access Memory, RAM for short), Various media that can store program codes, such as mobile hard disks, magnetic disks, or optical disks.
  • the embodiment of the present disclosure also provides an electronic device, including a memory and a processor, the memory is stored with a computer program, and the processor is configured to run the computer program to execute the steps in any of the foregoing method embodiments.
  • the aforementioned electronic device may further include a transmission device and an input-output device, wherein the transmission device is connected to the aforementioned processor, and the input-output device is connected to the aforementioned processor.
  • the foregoing processor may be configured to execute the following steps through a computer program:
  • each of the multiple sets of data includes: a binarized ECG image simulated by an ECG image derived from an electrocardiogram measurement system and the simulated binarization
  • the target sub-region includes: the target ECG signal and a surrounding area whose distance from the target ECG signal is within a preset range.
  • modules or steps of the present disclosure can be implemented by a general computing device, and they can be concentrated on a single computing device or distributed in a network composed of multiple computing devices.
  • they can be implemented with program codes executable by a computing device, so that they can be stored in a storage device for execution by the computing device, and in some cases, they can be executed in a different order than here.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Artificial Intelligence (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Image Analysis (AREA)

Abstract

本公开提供了一种ECG信号的获取方法及装置、存储介质、电子装置,上述方法包括:对二值化的ECG图像进行形态学运算获得到所述二值化的ECG图像中的目标图像区域,其中,所述二值化的ECG图像的像素值包括:两个不同的值,所述目标图像区域中包括:目标ECG信号;将所述目标图像区域或目标子区域输入到第一模型中,以输出所述二值化的ECG图像中的目标ECG信号,其中,所述第一模型为使用多组数据通过机器学习训练出的用于识别目标ECG信号的模型,所述多组数据中的每组数据均包括:通过目标ECG图像仿真处理后的二值化的ECG图像和所述仿真处理的二值化的ECG图像中的ECG信号,所述目标子区域包括:所述目标ECG信号以及与所述目标ECG信号的距离在预设范围内的周围区域。

Description

ECG信号的获取方法及装置、存储介质、电子装置 技术领域
本公开涉及图像处理技术领域,具体而言,涉及一种ECG信号的获取方法及装置、存储介质、电子装置。
背景技术
在相关技术中,心电图(ElectrocardioGraph,简称为ECG)信号被ECG设备采集后,除数字化保存外,一般被记录在热敏纸上。纸质ECG数据方便医生读图,但不便于保存和处理,一般对纸质ECG数据进行扫描,将ECG信号保存成图像。经此过程后,ECG信号由多导联一维数据,被转换为二维图像。由于ECG信号本身的特殊性,在图像中ECG信号的时序变化在图像中无法直接被分析,而且ECG信号细节部分在整个图像中并不显著,因此需要将ECG信号从二维图像中提取出来转换为一维数据,再进行后续分析,此过程被称为ECG的数字化。
ECG数字化过程一般分为两步:①ECG信号图像的预处理,去除噪声,保留ECG部分;②ECG信号转换为一维数据。现有技术对ECG图像处理的方法为通过颜色或灰度值将ECG部分和其他部分分离,但是ECG图像中,特别是二值化后的ECG图像中,ECG部分的像素值和其他噪音部分像素值存在相同的情况,因而,现有的方法中无法获得从ECG图像中,特别是二值ECG图像中有效地获得ECG部分。
现有技术的技术方案无法对二值化的ECG图像进行ECG部分的提取等问题,尚未提出有效的技术方案。
发明内容
本公开实施例提供了一种ECG信号的获取方法及装置、存储介质、电子装置,以至少解决相关技术中,现有技术的技术方案无法对二值化的ECG图像进行ECG部分的提取等问题。
根据本公开的一个实施例,提供了一种ECG信号的获取方法,包括:对二值化的ECG图像进行形态学运算获得所述二值化的ECG图像中的目标图像区域,其中,所述二值化的ECG图像的像素值包括:两个不同的值,所述目标图像区域中包括:目标ECG信号;将所述目标图像区域或目标子区域输入到第一模型中,以输出所述二值化的ECG图像中的目标ECG信号,其中,所述第一模型为使用多组数据通过机器学习训练出的用于识别目标ECG信号的模型,所述多组数据中的每组数据均包括:通过目标ECG图像仿真处理后的二值化的ECG图像和所述仿真处理的二值化的ECG图像中的ECG信号,所述目标子区域包括:所述目标ECG信号以及与所述目标ECG信号的距离在预设范围内的周围区域。
根据本公开的另一个实施例,还提供了一种ECG信号的获取装置,包括:处理模块,设置为对二值化的ECG图像进行形态学运算获得所述二值化的ECG图像中的目标图像区域,其中,所述二值化的ECG图像的像素值包括:两个不同的值,所述目标图像区域中包括:目标ECG信号;确定模块,设置为将所述目标图像区域或目标子区域输入到第一模型中,以输出所述二值化的ECG图像中的目标ECG信号,其中,所述第一模型为使用多组数据通过机器学习训练出的用于识别目标ECG信号的模型,所述多组数据中的每组数据均包括:通过目标ECG图像仿真处理后的二值化的ECG图像和所述仿真处理的二值化的ECG图像中的ECG信号,所述目标子区域包括:所述目标ECG信号以及与所述目标ECG信号的距离在预设范围内的周围区域。
根据本公开的另一个实施例,还提供了一种存储介质,所述存储介质中存储有计算机程序,其中,所述计算机程序被设置为运行时执行以上任一项ECG信号的获取方法。
根据本公开的另一个实施例,还提供了一种电子装置,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器被设置为运行所述计算机程序以执行以上任一项ECG信号的获取方法。
通过本公开的技术方案,对二值化的ECG图像进行形态学运算以得到所述二值化的ECG图像中的目标图像区域,进而将所述目标图像区域或目标子区域输入到第一模型中,以输出所述二值化的ECG图像中的目标ECG信号,其中,所述目标子区域包括:所述目标ECG信号以及与所述目标ECG信号的距离在预设范围内的周围区域;采用上述技术方案解决相关技术中,现有技术的技术方案无法对二值化的ECG图像进行ECG部分的提取等问题,提供了一种能够先对二值化的ECG图像进行图像发色处理后,将得到的目标图像区域或者给予目标图像区域得到的目标子区域输入到第一模型中,以确定二值化的ECG图像中的目标ECG信号的技术方案。
进一步地,通过本公开的技术方案,可有效地从ECG图像,特别是二值ECG图像中提取ECG部分,且在提取过程中本公开的技术方案克服了采用基于深度学习训练深度学习模型中,ECG图像,特别是二值ECG图像噪声多、表示ECG信号部分的线条较细,占图像比例小、细节不清晰导致人工标注ECG部分难度大的问题,本公开的技术方案能够使用较少的人工标注,有效地完成ECG图像,特别是二值ECG图像中ECG部分的提取。
附图说明
此处所说明的附图用来提供对本公开的进一步理解,构成本公开的一部分,本公开的示意性实施例及其说明用于解释本公开,并不构成对本公开的不当限定。在附图中:
图1是根据本公开实施例的一种ECG信号的获取方法的计算机终端的硬件结构框图;
图2为根据本公开实施例的ECG信号的获取方法的流程图;
图3是根据本公开可选实施例的ECG信号的获取方法的流程图;
图4是根据本公开可选实施例的预处理过程的示意图;
图5是根据本公开可选实施例的ECG信号的周围区域的示意图;
图6是根据本公开可选实施例的导出ECG图像示意图;
图7是根据本公开可选实施例的导出ECG标注的示意图;
图8是根据本公开可选实施例的仿真前后图像细节示意图;
图9是根据本公开可选实施例的ECG图像中的感兴趣区域示意图;
图10是根据本公开可选实施例的ECG图像的分割结果示意图;
图11是根据本公开实施例的ECG信号的获取装置的结构框图。
具体实施方式
下文中将参考附图并结合实施例来详细说明本公开。需要说明的是,在不冲突的情况下,本公开中的实施例及实施例中的特征可以相互组合。
需要说明的是,本公开的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。
本公开实施例所提供的方法实施例可以在计算机终端或者类似的运算装置中执行。以运行在计算机终端上为例,图1是本公开实施例的一种ECG信号的获取方法的计算机终端的硬件结构框图。如图1所示,计算机终端可以包括一个或多个(图1中仅示出一个)处理器102(处理器102可以包括但不限于微处理器MCU或可编程逻辑器件FPGA等的处理装置)和设置为存储数据的存储器104,可选地,上述计算机终端还可以包括设置为通信功能的传输设备106以及输入输出设备108。在另一个实施例中,以运行在手机端上为例,包括输入设备、输出设备、处理器102、存储器104和传输设备106,其中输入设备可以为摄像头,输出设备可以为手机显示屏。本领域普通技术人员可以理解,图1所示的结构仅为示意,其并不对上述计算机终端的结构造成限定。例如,计算机终端也可以是智能手机(如Android手机、iOS手机等)、平板电脑、掌上电脑以及移动互联网设备(Mobile Internet Devices,MID)、PAD等终端设备。图1其并不对 上述电子装置的结构造成限定。例如,电子装置还可包括比图1中所示更多或者更少的组件(如网络接口等),或者具有与图1所示不同的配置。
存储器104可设置为存储计算机程序,例如,应用软件的软件程序以及模块,如本公开实施例中的ECG信号的获取方法对应的计算机程序,处理器102通过运行存储在存储器104内的计算机程序,从而执行各种功能应用以及数据处理,即实现上述的方法。存储器104可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器104可进一步包括相对于处理器102远程设置的存储器,这些远程存储器可以通过网络连接至计算机终端。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
传输装置106设置为经由一个网络接收或者发送数据。上述的网络具体实例可包括计算机终端的通信供应商提供的无线网络。在一个实例中,传输装置106包括一个网络适配器(Network Interface Controller,简称为NIC),其可通过基站与其他网络设备相连从而可与互联网进行通讯。在一个实例中,传输装置106可以为射频(Radio Frequency,简称为RF)模块,其设置为通过无线方式与互联网进行通讯。
此外,上述电子装置还包括:显示器110,设置为显示目标ECG信号;和连接总线112,设置为连接上述电子装置中的各个模块部件。
本公开实施例提供了一种可选的ECG信号的获取方法,图2为根据本公开实施例的ECG信号的获取方法的流程图,如图2所示,包括以下步骤:
步骤S202:对二值化的ECG图像进行形态学运算获得所述二值化的ECG图像中的目标图像区域,其中,所述二值化的ECG图像的像素值包括:两个不同的值,所述目标图像区域中包括:目标ECG信号;
步骤S204:将所述目标图像区域或目标子区域输入到第一模型中,以输出所述二值化的ECG图像中的目标ECG信号,其中,所述第一模型 为使用多组数据通过机器学习训练出的用于识别目标ECG信号的模型,所述多组数据中的每组数据均包括:通过目标ECG图像仿真处理后的二值化的ECG图像和所述仿真处理的二值化的ECG图像中的ECG信号,所述目标子区域包括:所述目标ECG信号以及与所述目标ECG信号的距离在预设范围内的周围区域。
通过本公开的技术方案,对二值化的ECG图像进行形态学运算获得所述二值化的ECG图像中的目标图像区域;将所述目标图像区域或目标子区域输入到第一模型中,以输出所述二值化的ECG图像中的目标ECG信号,所述目标子区域包括:所述目标ECG信号以及与所述目标ECG信号的距离在预设范围内的周围区域;采用上述技术方案解决相关技术中,现有技术的技术方案无法对二值化的ECG图像进行ECG部分的提取等问题,提供了一种能够对二值化的ECG图像进行形态学运算后,将得到的目标图像区域或者给予目标图像区域得到的目标子区域输入到第一模型中,以确定二值化的ECG图像中的目标ECG信号的技术方案。
本公开所述形态学运算包括形态学开运算和形态学闭运算,本公开一个优选的实施方式中,采用形态学闭运算,即先膨胀,再腐蚀,以获得目标图像区域。
进一步地,通过本公开的技术方案,可有效地从ECG图像,特别是二值ECG图像中提取ECG部分,且在提取过程中本公开的技术方案克服了采用基于深度学习训练深度学习模型中,ECG图像,特别是二值ECG图像噪声多、表示ECG信号部分的线条较细,占图像比例小、细节不清晰导致人工标注ECG部分难度大的问题,本公开的技术方案能够使用较少的人工标注,有效地完成ECG图像,特别是二值ECG图像中ECG部分的提取。
需要说明的是,在一个具体实施例中,在进行二值化的ECG图像进行图像颜色反相处理之前,为保护ECG图像中的敏感信息,还需要对进行提取的ECG图像进行其他处理,将图像中包含敏感信息的区域进行隐 去,例如,敏感信息可以为用户的姓名性别等身份信息,可以通过将敏感信息用特定形状盖住的方式在ECG图像中替换。在其他优选的实施例中,也可以让机器学习获得的第一模型能够过滤掉敏感信息,比如,将目标图像区域或目标子区域输入到第一模型中,输出二值化的ECG图像中的目标ECG信号中不包括任何的敏感信息。在一个具体实施例中,目标ECG图像文档原格式为PDF,在进行相应的敏感信息移除后,文档格式由将PDF转为PNG,进行后续从二值化的ECG图像中提取出ECG部分。
上述步骤S202有多种实现方式,可选地,可以通过以下方式实现:对二值化的ECG图像进行形态学运算获得所述二值化的ECG图像中的目标图像区域,包括:对二值化的ECG图像进行颜色反相处理;对颜色反相处理后的ECG图像进行形态学运算获得所述二值化的ECG图像中的目标图像区域,而本公开实施例中的颜色反相处理过程可以包括以下步骤:确定二值化的ECG图像中的前景区域和背景区域,其中,前景区域包括:目标ECG信号和二值化的ECG图像中的表格,前景区域的像素值为第一值,背景区域的像素值为第二值;将前景区域的像素值设置为第二值,以及将背景区域的像素值设置为第一值,例如,第一值可以为255,第二值可以为0,本公开实施例对此不作限定。
在本公开实施例中,在原始二值化的ECG图像中,前景区域中的目标ECG信号和二值化的ECG图像中的表格均为黑色,前景区域中的黑色对应第一值像素,相应的值为设置0;背景区域中的白色对应第二值像素,相应的值设置为255,通过将背景区域的第二值像素值反相为第一值像素值,将前景区域中的第一值像素值反相为第二值像素值,在颜色反相后,前景区域的像素由0变为255,由于有效图像区域的前景像素点分布的很密集,进而通过形态学闭操作将大部分像素点分布密集的区域连接起来,本公开实施可以使用的是形态学算子为11×11的结构元素(即11×11的矩阵,矩阵元素均为1),在其他实施例中,矩阵元素为1时,矩阵优选为(9-21)×(9-21),具体在此不做限定;而在形态学闭操作后,大部分有效图像区域内的前景区域内的点都被来接起来围合形成若干个有较多孔洞的图 像区域,使用孔洞填充将此图像区域填充为一个完整的图像区域;填充后,有效图像区域应为图像中的面积最大图像区域,因此,移除掉除面积最大图像区域以外的其他图像;从原始的二值化的ECG图像中,提取出面积最大图像区域的外接矩形图像,从而得到包含目标ECG信号的有效ECG图像,即为上述实施例的目标图像区域。在另一个优选实施中,二值化的ECG图像的前景区域的像素值为255,背景区域的像素值为0,再将该二值化的ECG图像进行形态学闭操作获得包含目标ECG信号的有效ECG图像。可选的,在执行步骤S204之前,需要从目标图像区域中提取出目标子区域;进而将提取出来的目标子区域输入到第一模型中,输出二值化的ECG图像中的目标ECG信号。
也就是说,将ECG图像中包含目标ECG信号以及与目标ECG信号的距离在预设范围内的周围区域的感兴趣区域输入到第一模型中,通过训练完成的第一模型处理获取二值化的ECG图像中的目标ECG信号。
具体地,从目标图像区域中提取出目标子区域,可以通过以下技术方案实现:从目标图像区域获取多个局部图像,其中,多个局部图像中的任意两个相邻的局部图像均存在重叠区域;将多个局部图像输入到第二模型中,以输出与多个局部图像对应的多个分割结果,其中,第二模型为使用多组数据通过机器学习训练出的用于识别局部图像中包含目标ECG信号的区域的模型,多组数据中的每组数据均包括:原始二值化的ECG图像,以及标注后的二值化的ECG图像,其中,原始二值化的ECG图像包括:目标ECG信号,和目标ECG信号的相似度小于预设阈值的ECG区域,噪声信号区域,标注后的二值化的ECG图像包括:目标ECG信号,和目标ECG信号的相似度小于预设阈值的ECG区域;将多个分割结果组合成目标图像区域的整体分割结果;根据整个分割结果直接确定为目标子区域,也可以将整体分割结果的像素值与目标图像区域的像素值按照对应位置依次相乘,以确定目标子区域。
一个优选的实施例中,多个分割结果组合成整体分割结果,在整体分割结果中,每个点的像素值为一个概率,即这个点是否是ECG区域中的 点,像素概率范围从0到1。本实施例中,设置阈值0.5,即将整体分割结果中像素值大于0.5的像素点设置为1,小于等于0.5的像素点设置为0。在其他实施例中,阈值也可以设置为0.4、0.55、0.6、0.65、0.8等,具体在此不做限定。这样,整体分割结果是一个二值化图像。将二值化的整体分割结果与目标区域图像区域相乘,获得分割结果。相乘后,整体分割结果中像素值为0的点在相乘所得图像中像素值为0,整体分割结果中像素值为1的点在相乘所得图像中像素值为目标区域图像对应像素的像素值,可以理解为,二值化的整体分割结果即为分割结果,与目标区域图像相乘是为了保留原始的像素值。
需要说明的是,上述第二模型的输入也可以是整个目标图像区域,本公开实施例对此不作限定。
在一个可选实施例中,在第一模型对目标图像区域或目标子区域进行分析之前,还可以执行以下技术方案:通过以下方式获取通过目标ECG图像仿真处理的二值化的ECG图像:获取目标ECG图像。一个具体的实施例中,目标ECG图像为RGB图像;仿真处理为在ECG图像中添加白噪声,以获得仿真处理的二值化ECG图像,需要说明的是,目标ECG图像可以是通过心电图测量系统导出的,也可以是通过其他技术方案比如摄像头拍照、信号接收器接收、网络中下载获取到的,本公开实施例对此不作限定。
在另一个可选实施例中,在第一模型对目标图像区域或目标子区域进行分析之前,还可以执行以下技术方案:通过以下方式获取仿真处理的二值化的ECG图像中的ECG信号:获取目标ECG图像,其中,ECG图像为RGB图像;将RGB图像转换为灰度图像,并确定灰度图像中的每个像素点的均值;保留像素点的均值小于第一值的目标像素点,并将目标像素点的像素值设置为1,以获取仿真处理的二值化的ECG图像中的ECG信号。
进一步地,上述第一模型对目标图像区域的分析过程,可以通过以下 技术方案实现:从目标图像区域获取多个局部图像,其中,多个局部图像中的任意相邻两个局部图像均存在重叠区域;将多个局部图像输入到第一模型中,以输出与多个局部图像对应的多个分割结果;将多个分割结果组合成目标图像区域的整体分割结果;将整体分割结果的像素值与目标图像区域的像素值按照对应位置依次相乘,以确定目标ECG信号,可选地,本公开实施例也可以直接将整体分割结果直接确定为目标ECG信号。
进一步地,上述第一模型对目标子区域的分析过程,可以通过以下技术方案实现:从目标子区域获取多个局部图像,其中,多个局部图像中的任意两个相邻的局部图像均存在重叠区域;将多个局部图像输入到第一模型中,以输出与多个局部图像对应的多个分割结果;将多个分割结果组合成目标子区域的整体分割结果;将整体分割结果的像素值与目标子区域的像素值按照对应位置依次相乘,以确定目标ECG信号。
可见,第一模型对目标图像区域和目标子区域的分析过程都是先对多个局部图像进行分析,然后对应输出多个分割结果,将多个分割结果进行整合后得到整体分割结果。
需要说明的是,上述第一模型的输入也可以是整个目标图像区域或这个目标子区域,本公开实施例对此不作限定。
可选地,通过以下方式训练所述第一模型或所述第二模型:根据目标损失函数对所述第一模型或所述第二模型的参数进行调整,其中,所述目标损失函数通过二值交叉熵和Dice损失函数确定,例如,目标损失函数等于a×二值交叉熵+b×Dice损失函数,a和b分别为对应项系数,a>0,b>0,具体地,[a=1,b=1]是优选实施方式,其他a与b的取值也可以采用,例如[a=0.5,b=1],[a=1,b=0.5],[a=2,b=1],[a=1,b=2]等,本公开实施例对此不作限定。
在本公开实施例中,对二值化的ECG图像进行形态学运算获得所述二值化的ECG图像中的目标图像区域,包括:通过指定的形态学算子对所述二值化的ECG图像进行处理;将处理后的二值化的ECG图像中像素 点分布密集的区域连接起来,以获得多个具有封闭区域的图像;将所述多个具有封闭区域的图像的无像素的部分填充像素;将填充像素后面积最大的区域作为所述目标图像区域。
为了更好的理解上述ECG信号的获取过程,以下结合一可选实施例对上述流程进行说明,但不用于限定本公开实施例的技术方案,图3是根据本公开可选实施例的ECG信号的获取方法的流程图,包括以下步骤:
步骤S302,预处理二值化的ECG扫描图,进而从心电图测量系统导出的ECG文档图像中提取出有效图像分;
在二值化的ECG扫描图像中,除有效图像部分,即上述实施例的目标图像区域外,有可能存在大量的空白区域,这些空白区域不包含信息,不需要处理,需将这些空白区域移除,从而提取出有效图像部分用于后续的处理,预处理过程包含两步:1)图像颜色反相,在原始的二值ECG扫描图像中,前景区域(包括ECG信号和表格)为黑色,像素值为0;背景区域为白色,像素值为255,将上述前景区域和背景区域的颜色反相,即将前景区域的像素值设置为255,背景区域的像素值设置为0。2)有效图像区域提取在颜色反相后,前景像素至为255,由于有效图像区域的前景像素点分布的很密集,首先通过形态学闭操作将大部分像素点分布密集的区域连接起来,使用的形态学算子,在矩阵元素为1,矩阵优选为(9-21)×(9-21)的结构元素,更优选的,矩阵为11×11的结构元素;闭操作后,大部分有效图像区域内的前景点都被连接起来形成一个有较多孔洞的图像区域,使用孔洞填充将此物体填充为一个完整的图像区域;填充后,有效图像区域应为图像中的面积最大图像区域,因此,移除掉除面积最大图像区域以外的其他图像区域;从原始的二值ECG扫描图像中,提取出面积最大图像区域的外接矩形图像,此图像用于后续处理。
上述预处理过程的输入和输出如图4中所示,左侧为原始的二值ECG扫描图,右侧为提取后的有效图像部分,以下简称“ECG图像”。本公开实施例中,采用1834张二值ECG扫描图数据,当需要使用包含1834张 二值ECG扫描图数据集时,需对每一张图像进行预处理,从而获得1834张ECG图像,用于进行模型训练,需要说明的是,1834张图像是可选的,可以采用其他数值的ECG图像进行模型训练。
步骤S304,人工标注部分二值ECG扫描图的感兴趣区域(即上述实施例的目标子区域,其中包含ECG信号及ECG信号的周围区域),训练UNet1(即上述实施例的第二模型)用于感兴趣区域(Region Of Interest,简称为ROI)提取;其中,ECG信号的周围区域,如下图5所示。
在本公开实施例中,感兴趣区域是指ECG信号区域及ECG信号的周围区域,当然,在感兴趣区域中包含完整的ECG信号,还包含一些噪声信号,感兴趣区域中的噪声要远远少于完整二值化的ECG图像中的噪声。为了从ECG图像中提取感兴趣区域,可选地,随机选取10张ECG图像进行人工标注,人工标注包含以下内容:完整的ECG区域;人工标注需包含疑似的ECG区域;人工标注中不包含可以确定是噪声的区域,在实际标注过程中,上述人工标注包括的内容可以根据标注者的指示进行确定,也可以通过其他实现方式。使用这10张ECG图像作为输入,10张ECG图像的标注作为分割标签,训练UNet1用于感兴趣区域提取,需要说明的是,UNet1广泛用于医学图像分割,这里不限于使用UNet,可使用任何以分割为目的网络,其他网络还包括FCN,Faster R-CNN,Mask R-CNN,deeplab等。
步骤S306,使用系统导出的ECG文档仿真处理生成二值ECG扫描图,用仿真处理生成的仿真ECG图片训练UNet2(即上述实施例的第一模型)进行ECG信号部分的提取。
在本公开实施例的一可选实施例中,通过目标ECG图像249张,所有图像均为RGB图像,其中,背景点为白色,RGB值为(255,255,255),ECG曲线像素为(0,0,0),主干网格点像素值为(255,128,128),非主干网格点像素值为(255,179,179),将RGB图像转为灰度图像,具体方法为计算每个像素点的均值,进而保留灰度图像中像素值小于255的点,即可将 背景去除,将这些点的像素值设置为1,记为“导出ECG图像”,如图6所示,去除背景,保留“导出ECG图像,此图像用于生成对真实ECG图像的仿真图像;保留灰度图像中像素等于0的点,即保留ECG区域,将这些点的像素值设置为1,记为“导出ECG标注”,如图7所示,保留“导出ECG标注”用于训练模型,此标注用于后续UNet2(即为上述实施例的第一模型)的训练。
需要说明的是,在使用真实ECG图像进行仿真时,因为导出ECG图像中已存在网格噪声,因此仅需仿真处理其他噪声即可进行仿真,本公开可选实施例在导出ECG图像中添加白噪声,优选地,添加的白噪声比例的范围可以考虑范围是5%至20%,例如,如5%、8%、10%、12.5%、18%、20%、25%等,具体在此不作限定,需要说明的是,百分比是指添加的白噪声点的个数占导出ECG图像像素点总数的比例。添加的白噪声会出现两种情况:1)若添加的噪声点位于导出ECG图像的背景区域处(像素值为0处),仅添加噪声点,无其他操作;2)若添加的噪声点位于导出ECG图像的前景区域处(像素值为1处,表格或ECG区域),则移除掉前景像素点,这样做可以造成部分区域的缺失,使仿真处理出的二值化的ECG图像更真实,进而仿真过程的输出记为“仿真ECG图像”,仿真前后图像细节如图8所示。仿真ECG图像与导出ECG标注共同用于接下来的模型训练。
本公开实施例中,图3的步骤S304中训练UNet1进行感兴趣区域的提取具体包含以下步骤;
步骤A,可选地,可以采用10张ECG图像做了标注,随机使用6张ECG图像及标注作为训练集,剩余图像中随机使用2张ECG图像及标注作为验证集,剩余2张ECG图像及标注作为测试集,训练集,验证集以及测试集的数量可以是其他数值,本公开实施例对此不作限定。
步骤B,在每一个训练迭代开始前,首先从6张训练集图像中随机提取出64,这个数字表示一次训练迭代使用的样本量,可选值为32,64, 128,256等张像素大小为256像素×256像素的局部图像;从每张验证集图像中提取出64张大小为256像素×256像素的局部图像;
可选地,上述实施例中输入模型的图像的大小,ECG图像的尺寸是不固定的,此外,由于图像尺寸较大,可以考虑不输入整张图像,可选地,可以输入128像素×128像素,224像素×224像素。
步骤C,在每一个训练迭代中,使用训练集的局部图像训练UNet,根据损失函数调整UNet参数;
需要说明的是,使用的损失函数为二值交叉熵和Dice损失函数的和;二值交叉熵与Dice损失函数的和是常用的用于训练分割模型的损失函数。二值交叉熵描述了模型预测结果与真实标注结果中像素的差异,而Dice损失函数描述的是模型预测结果与真实标注结果中分割区域的重合情况。损失函数为Focal损失函数与Dice损失函数的和,因为ECG区域在整副图像中占比较小,因此要增加ECG区域的权重。Focal损失函数可以处理不均衡的分类问题,在这个任务中,大量的像素为背景区域,少量的像素为前景区域。Dice损失函数仅考虑标签中的前景区域及分割结果中的前景区域,因此大部分背景区域被忽略。通过将Focal损失函数和Dice损失函数结合起来得到的损失函数值,这时获得的Focal损失函数比单独使用Focal损失函数时要低,同时Dice损失函数也比单独使用Dice损失函数时要低,二者结合可有效提升模型的分割效果。
进行训练集的局部图像训练UNet需要注意,当需要分割的目标对象的物体呈块状、且纹理、形态等特征明显,如器官、肿瘤、病变区域等,一般使用完整图像作为模型输入,但本公开实施例中需分割的ECG部分呈细长条状,没有纹理特征,形态特征较弱,且ECG区域占完整图像比例小,因此ECG区域在完整图像尺度上特征不明显,不适合将完整图像输入模型。因此将局部图像输入模型,因为局部图像的背景区域面积小,ECG区域特征更明显。并且使用局部图像有助于对真实ECG区域的仿真,在一张小图像上的仿真总比在完整图像上做仿真容易。
步骤D,在每一个训练迭代后,使用训练的UNet对验证集的局部图像的图像进行分割,使用此分割结果与验证集局部图像的标注计算损失函数。损失函数无上限,下限为0;损失函数是分割效果的表现,并不能影响分割效果;如果分割结果与标注结果完全相同,那么损失函数为0;分割效果越好,损失函数越接近于0;分割效果越差,损失函数越大。
步骤E,判断是否停止训练,若停止,则模型训练完毕;若不停止,则重复过程B到D;当达到设定的训练迭代次数,本公开实施例的设置次数范围可为100至200,当连续N次(5≤N≤20)损失函数未下降,本公开实施例中,设定N的取值为10,满足此上述两个停止条件,可停止训练。
本公开实施例中,图3中的步骤S306的训练UNet进行ECG区域的提取还可以通过以下方案实现;
步骤1,选取249张仿真ECG数据及其标注,随机60%仿真ECG图像及标注作为训练集,剩余图像中随机使用20%仿真ECG图像及标注作为验证集,剩余20%仿真ECG图像及标注作为测试集。
步骤2,在每一个训练迭代开始前,首先从6张训练集图像中随机提取出64(这个数字表示一次训练迭代使用的样本量,可选值为32,64,128,256等)张大小为256×256的局部图像(输入模型图像的大小,ECG图像的尺寸不固定,且图像尺寸较大,因此不输入整张图像,也可输入128×128,224×224);从每张验证集图像中提取出64张大小为256×256的局部图像;
步骤3,在每一个训练迭代中,使用训练集的局部图像训练UNet,在一个可选实施例中,为了调整UNet的参数,可以考虑根据损失函数来调整UNet参数,其中,上述损失函数无上限,下限为0;损失函数是分割效果的表现,并不影响分割效果;当分割结果与标注结果完全相同,那么损失函数为0;分割效果越好,损失函数越接近于0;分割效果越差,损失函数越大。训练一个神经网络,一般包含两种参数:一是网络本身的参 数,或者叫权值,这部分参数存在于网络的隐层中,用于从输入中计算输出,获得新的特征;二是超参数,这部分参数控制的是神经网络学习的过程,如学习速率及迭代次数等。本公开可选实施例中指的是调整UNet本身的参数即第一种参数,使用的损失函数为二值交叉熵和Dice损失函数的和;
步骤4,在每一个训练迭代后,使用训练的UNet对验证集的局部图像的图像进行分割,使用此分割结果与验证集局部图像的标注计算损失函数,判断是否停止训练,若停止,则模型训练完毕;若不停止训练过程,则继续重复上述步骤1到步骤4,当达到设定的训练迭代次数,且连续N次(5≤N≤20)损失函数未下降的情况下,满足此上述两个停止条件,可停止训练,本公开实施人为例中设定的设定N的取值为10,上述训练迭代次数范围可为100至200。
进一步地,当上述技术方案中使用UNet模型用于感兴趣区域提取时,通过以下步骤进行:
步骤1,从测试集的2张图像中均匀的提取局部图像(其中,每两张局部图像存在128的重叠区域),若局部图像长宽为256个像素,重叠的像素为128个,那么左右或上下两幅局部图像的重叠区域为单个局部图像的0.5,对角的两幅局部图像的重叠区域为单个局部图像的0.25。重叠的范围为0至255。重叠为0时,即所有局部图像没有重叠;重叠为255时,即从图像中每个像素周围取出长宽为256的正方形。重叠越小,计算量越小,但分割效果会降低,因为像素被重复预测的次数较少;重叠与大,计算量越大,但分割效果越好。将所有局部图像输入UNet进行预测,获得分割结果(局部图像的分割结果是256×256的矩阵,矩阵中每个元素为0到1,表示此点是ECG感兴趣区域点的概率),再将所有分割结果组合成完整的分割结果。这其中有部分区域被多次预测,这些区域的分割结果以多次预测的平均值填充。以0.5为阈值,将完成的分割结果转化为二值图像(小于等于0.5的像素值为0,大于0.5的像素值为1)。将此分割结果与测试集图像的标注进行比较Dice系数,比较结果Dice系数为0.97。Dice系数值 范围为[0,1],本公开实施例可接受0.9以上的Dice系数。
公式:
Figure PCTCN2021072748-appb-000001
衡量两个样本的重叠部分,该指标范围从0到1,其中“1”表示完整的重叠。,其中|A∩B|表示集合A、B之间的共同元素,|A|和|B|分别表示A和B中的元素个数,分子中的系数2,是因为分母中存在重复计算A和B之间共同元素的原因。
在本公开实施例中,上述公式中的A可以解释为真实标注图像,B为模型分割结果,|A|表示真实标注图像中物体像素点的个数,|B|表示模型分割结果中物体像素点的个数,|A∩B|表示真实标注图像与模型分割结果重合部分的像素点的个数。
步骤2,将剩余的未标注的1824张(由于上述实施例中以1834张ECG图像为总数量,以及选择出10张进行标注,剩下1824张ECG图像)图像按照步骤1中的方式进行分割,获得分割结果。ECG图像与其分割结果相乘,在分割结果中,ECG区域像素值为1,背景区域像素值为0,当使用UNet模型用于感兴趣区域提取时需要从原始的ECG图像中提取出ECG的部分,最简单的方法就是将ECG图像与分割结果这两个矩阵的对应位置相乘,这样就可以保留ECG部分,如下所示:
Figure PCTCN2021072748-appb-000002
原始ECG图像
Figure PCTCN2021072748-appb-000003
与分割结果
Figure PCTCN2021072748-appb-000004
对应位置相乘,结果获得原始图像中的ECG区域
Figure PCTCN2021072748-appb-000005
即为ECG图像中的感兴趣区域,如图9所示,需要注意的是图9中的模型实际输入并非为完整图像,输出也并未为完整图像尺寸,仅是对相应过程进行处理方式示意。通过上述步骤后,ECG图像中大部分噪声被去除,有利于接下来的ECG信号分割。
进一步地,在附图3的步骤S306中的当使用UNet模型用于ECG区域提取时,通过以下步骤进行:
步骤1,从测试集的仿真ECG图像中均匀的提取局部图像(每两张局部图像存在128的重叠区域),将所有局部图像输入UNet进行预测,获得分割结果(局部图像的分割结果是256×256的矩阵,矩阵中每个元素为0到1,表示此点是ECG感兴趣区域点的概率),再将所有分割结果组合成完整的分割结果。这其中有部分区域被多次预测,这些区域的分割结果以多次预测的平均值填充。以0.5为阈值,将完成的分割结果转化为二值图像(小于等于0.5的像素值为0,大于0.5的像素值为1)。将此分割结果与测试集图像的标注进行比较,Dice系数。Dice系数值范围为[0,1],本公开实施例可接受0.9以上的Dice系数。需要说明的是,对于本公开实施例来说Dice系数越高越好。
步骤2,将未标注的1834张真实ECG图像的感兴趣区域图像按照步骤一中的方式进行分割,获得分割结果,如图10所示(注:模型实际输入并非为完整图像,输出也并非为完整图像尺寸)。这一步骤后,完成ECG区域分割,进而获取到目标ECG信号。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本公开的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本公开各个实施例的方法。
在本实施例中还提供了一种ECG信号的获取装置,该装置设置为实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下 实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。
图11是根据本公开实施例的ECG信号的获取装置的结构框图,如图11所示,该装置包括:
(1)处理模块52,对二值化的ECG图像进行形态学运算获得到所述二值化的ECG图像中的目标图像区域,其中,所述二值化的ECG图像的像素值包括:两个不同的值,所述目标图像区域中包括:目标ECG信号;
(2)确定模块54,将所述目标图像区域或目标子区域输入到第一模型中,以输出所述二值化的ECG图像中的目标ECG信号,其中,所述第一模型为使用多组数据通过机器学习训练出的用于识别目标ECG信号的模型,所述多组数据中的每组数据均包括:通过目标ECG图像仿真处理的二值化的ECG图像和所述仿真处理的二值化的ECG图像中的ECG信号,所述目标子区域包括:所述目标ECG信号以及与所述目标ECG信号的距离在预设范围内的周围区域;
通过上述技术方案,对二值化的ECG图像进行形态学运算得到所述二值化的ECG图像中的目标图像区域;将所述目标图像区域或目标子区域输入到第一模型中,以输出所述二值化的ECG图像中的目标ECG信号,所述目标子区域包括:所述目标ECG信号以及与所述目标ECG信号的距离在预设范围内的周围区域;采用上述技术方案解决相关技术中,现有技术的技术方案无法对二值化的ECG图像进行ECG部分的提取等问题,提供了一种能够先对二值化的ECG图像进行图像发色处理后,将得到的目标图像区域或者给予目标图像区域得到的目标子区域输入到第一模型中,以确定二值化的ECG图像中的目标ECG信号的技术方案。
本公开所述形态学运算包括形态学开运算和形态学闭运算,本公开一个优选的实施方式中,采用形态学闭运算,即先膨胀,再腐蚀,以获得目标图像区域。
进一步地,通过本公开的技术方案,可有效地从ECG图像,特别是 二值ECG图像中提取ECG部分,且在提取过程中本公开的技术方案克服了采用基于深度学习训练深度学习模型中,ECG图像,特别是二值ECG图像噪声多、代表ECG信号部分的线条较细,占图像比例小、细节不清晰导致人工标注ECG部分难度大的问题,本公开的技术方案能够使用较少的人工标注,有效地完成ECG图像,特别是二值ECG图像中ECG部分的提取。
需要说明的是,在进行二值化的ECG图像进行图像颜色反相处理之前,为保护ECG图像中的敏感信息,还需要对进行提取的ECG图像进行其他处理,将图像中包含敏感信息的区域进行隐去,例如,敏感信息可以为用户的姓名性别等身份信息,可以通过将敏感信息用特定形状盖住的方式在ECG图像中替换,需要说明的是,目标ECG图像文档原格式为PDF,在进行相应的敏感信息移除后,文档格式由将PDF转为PNG,进行后续从二值化的ECG图像中提取出ECG部分。
可选的,处理模块还设置为确定二值化的ECG图像中的前景区域和背景区域,其中,前景区域包括:目标ECG信号和二值化的ECG图像中的表格,前景区域的像素值为第一值,背景区域的像素值为第二值的;
将前景区域的像素值设置为第二值的,以及将背景区域的像素值设置为第一值,以得到目标图像区域。
在本公开实施例中,在原始二值化的ECG图像中,前景区域中的目标ECG信号和二值化的ECG图像中的表格均为黑色,前景区域中的黑色对应第一值像素,相应的值为设置0;背景区域中的白色对应第二值像素,相应的值设置为255,通过将背景区域的第二值像素值反相为第一值像素值,将前景区域中的第一值像素值反相为第二值像素值,在颜色反相后,前景区域的像素由0变为255,由于有效图像区域的前景像素点分布的很密集,进而通过形态学闭操作将大部分像素点分布密集的区域连接起来,本公开实施可以使用的是形态学算子为11×11的结构元素(即11×11的矩阵,矩阵元素均为1,相应的矩阵可选范围为9至21);而在形态学闭操 作后,大部分有效图像区域内的前景区域内的点都被来接起来形成一个有较多孔洞的物体,使用孔洞填充将此物体填充为一个完整的物体;填充后,有效图像区域应为图像中的面积最大物体,因此,移除掉除面积最大物体以外的其他物体;从原始的二值化的ECG图像中,提取出面积最大物体的外接矩形图像,从而得到包含目标ECG信号的有效ECG图像(即为上述实施例的目标图像区域)。
可选的,确定模块还设置为从目标图像区域中提取出目标子区域;将目标子区域输入到第一模型中,输出二值化的ECG图像中的目标ECG信号。
可选的,确定模块还设置为从目标图像区域获取多个局部图像,其中,多个局部图像中的任意相邻两个局部图像均存在重叠区域;将多个局部图像输入到第二模型中,以输出与多个局部图像对应的多个分割结果,其中,第二模型为使用多组数据通过机器学习训练出的用于识别局部图像中包含目标ECG信号的区域的模型,多组数据中的每组数据均包括:原始二值化的ECG图像,以及标注后的二值化的ECG图像,其中,原始二值化的ECG图像包括:目标ECG信号,和目标ECG信号的相似度小于预设阈值的ECG区域,噪声信号区域,标注后的二值化的ECG图像包括:目标ECG信号,和目标ECG信号的相似度小于预设阈值的ECG区域;将多个分割结果组合成目标图像区域的整体分割结果;将整体分割结果的像素值与目标图像区域的像素值按照对应位置依次相乘,以确定目标子区域。
可选的,确定模块还设置为从目标图像区域获取多个局部图像,其中,多个局部图像中的任意相邻两个局部图像均存在重叠区域;将多个局部图像输入到第一模型中,以输出与多个局部图像对应的多个分割结果;将多个分割结果组合成目标图像区域的整体分割结果;将整体分割结果的像素值与目标图像区域的像素值按照对应位置依次相乘,以确定目标ECG信号,在本公开实施例中,也可以直接将整体分割结果确定为上述目标ECG信号。
需要说明的是,上述第二模型的输入也可以是整个目标图像区域,本公开实施例对此不作限定。
可选的,确定模块还设置为从目标子区域获取多个局部图像,其中,多个局部图像中的任意相邻两个局部图像均存在重叠区域;将多个局部图像输入到第一模型中,以输出与多个局部图像对应的多个分割结果;将多个分割结果组合成目标子区域的整体分割结果;将整体分割结果的像素值与目标子区域的像素值按照对应位置依次相乘,以确定目标ECG信号,在本公开实施例中,也可以直接将整体分割结果确定为上述目标ECG信号。
可选地,处理模块,还设置为通过以下方式获取通过目标ECG图像仿真处理的二值化的ECG图像:获取所述目标ECG图像,其中,所述目标ECG图像为RGB图像;将所述目标ECG图像中添加白噪声,以仿真处理所述二值化的ECG图像。
可选地,处理模块,还设置为将所述目标图像区域或目标子区域输入到第一模型中,以输出所述二值化的ECG图像中的目标ECG信号之前,所述方法还包括:通过以下方式获取所述仿真处理的二值化的ECG图像中的ECG信号:获取所述目标ECG图像,其中,所述ECG图像为RGB图像;将所述RGB图像转换为灰度图像,并确定所述灰度图像中的每个像素点的均值;保留像素点的均值小于第一值的目标像素点,并将所述目标像素点的像素值设置为1,以获取所述仿真处理的二值化的ECG图像中的ECG信号。
所述确定模块,还设置为根据目标损失函数对所述第一模型或所述第二模型的参数进行调整,其中,所述目标损失函数通过二值交叉熵和Dice损失函数确定。
需要说明的是,以上技术方案可以结合使用,上述各个模块可以位于同一处理器中,也可以位于不同处理器中,本公开实施例对此不作限定。
本公开的实施例还提供了一种存储介质,该存储介质中存储有计算机 程序,其中,该计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。
可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的计算机程序:
S1,对二值化的ECG图像进行形态学运算得到所述二值化的ECG图像中的目标图像区域,其中,所述二值化的ECG图像的像素值包括:两个不同的值,所述目标图像区域中包括:目标ECG信号;
S2,将所述目标图像区域或目标子区域输入到第一模型中,以输出所述二值化的ECG图像中的目标ECG信号,其中,所述第一模型为使用多组数据通过机器学习训练出的用于识别目标ECG信号的模型,所述多组数据中的每组数据均包括:通过目标ECG图像仿真处理的二值化的ECG图像和所述仿真处理的二值化的ECG图像中的ECG信号,所述目标子区域包括:所述目标ECG信号以及与所述目标ECG信号的距离在预设范围内的周围区域。
可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(Read-Only Memory,简称为ROM)、随机存取存储器(Random Access Memory,简称为RAM)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。
可选地,本实施例中的具体示例可以参考上述实施例及可选实施方式中所描述的示例,本实施例在此不再赘述。
本公开的实施例还提供了一种电子装置,包括存储器和处理器,该存储器中存储有计算机程序,该处理器被设置为运行计算机程序以执行上述任一项方法实施例中的步骤。
可选地,上述电子装置还可以包括传输设备以及输入输出设备,其中,该传输设备和上述处理器连接,该输入输出设备和上述处理器连接。
可选地,在本实施例中,上述处理器可以被设置为通过计算机程序执行以下步骤:
S1,对二值化的ECG图像进行图像反色处理,以得到所述二值化的ECG图像中的目标图像区域,其中,所述二值化的ECG图像的像素值包括:两个不同的值,所述目标图像区域中包括:目标ECG信号;
S2,将所述目标图像区域或目标子区域输入到第一模型中,以输出所述二值化的ECG图像中的目标ECG信号,其中,所述第一模型为使用多组数据通过机器学习训练出的用于识别目标ECG信号的模型,所述多组数据中的每组数据均包括:通过心电图测量系统导出的ECG图像所模拟的二值化的ECG图像和所述模拟的二值化的ECG图像中的ECG信号,所述目标子区域包括:所述目标ECG信号以及与所述目标ECG信号的距离在预设范围内的周围区域。
可选地,本实施例中的具体示例可以参考上述实施例及可选实施方式中所描述的示例,本实施例在此不再赘述。
显然,本领域的技术人员应该明白,上述的本公开的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本公开不限制于任何特定的硬件和软件结合。
以上所述仅为本公开的优选实施例而已,并不用于限制本公开,对于本领域的技术人员来说,本公开可以有各种更改和变化。凡在本公开的原则之内,所作的任何修改、等同替换、改进等,均应包含在本公开的保护范围之内。

Claims (23)

  1. 一种ECG信号的获取方法,包括:
    对二值化的ECG图像进行形态学运算获得所述二值化的ECG图像中的目标图像区域,其中,所述二值化的ECG图像的像素值包括:两个不同的值,所述目标图像区域中包括:目标ECG信号;
    将所述目标图像区域或目标子区域输入到第一模型中,以输出所述二值化的ECG图像中的目标ECG信号,其中,所述第一模型为使用多组数据通过机器学习训练出的用于识别目标ECG信号的模型,所述多组数据中的每组数据均包括:通过目标ECG图像仿真处理后的二值化的ECG图像和所述仿真处理的二值化的ECG图像中的ECG信号,所述目标子区域包括:所述目标ECG信号以及与所述目标ECG信号的距离在预设范围内的周围区域。
  2. 根据权利要求1所述的方法,其中,对二值化的ECG图像进行形态学运算获得所述二值化的ECG图像中的目标图像区域,包括:
    对二值化的ECG图像进行颜色反相处理;
    对颜色反相处理后的ECG图像进行形态学运算获得所述二值化的ECG图像中的目标图像区域。
  3. 根据权利要求2所述的方法,其中,对二值化的ECG图像进行颜色反相处理,包括:
    确定所述二值化的ECG图像中的前景区域和背景区域,其中,所述前景区域包括:所述目标ECG信号和所述二值化的ECG图像中的表格,所述前景区域的像素值为第一值,所述背景区域的像素值为第二值;
    将所述前景区域的像素值设置为第二值,以及将所述背景区域的 像素值设置为第一值。
  4. 根据权利要求1所述的方法,其中,将所述目标子区域输入到第一模型中,输出所述二值化的ECG图像中的目标ECG信号,包括:
    从目标图像区域中提取出所述目标子区域;
    将所述目标子区域输入到第一模型中,输出所述二值化的ECG图像中的目标ECG信号。
  5. 根据权利要求4所述的方法,其中,从目标图像区域中提取出所述目标子区域,包括:
    从所述目标图像区域获取多个局部图像,其中,所述多个局部图像中的任意相邻两个局部图像均存在重叠区域;
    将所述多个局部图像输入到第二模型中,以输出与所述多个局部图像对应的多个分割结果,其中,所述第二模型为使用多组数据通过机器学习训练出的用于识别局部图像中包含目标ECG信号的区域的模型,所述多组数据中的每组数据均包括:原始二值化的ECG图像,以及标注后的二值化的ECG图像,其中,所述原始二值化的ECG图像包括:目标ECG信号,和所述目标ECG信号的相似度小于预设阈值的ECG区域,噪声信号区域,所述标注后的二值化的ECG图像包括:所述目标ECG信号,和所述目标ECG信号的相似度小于预设阈值的ECG区域;
    将所述多个分割结果组合成所述目标图像区域的整体分割结果;
    根据所述整体分割结果确定所述目标子区域。
  6. 根据权利要求5所述的方法,其中,根据所述整体分割结果确定所述目标子区域,包括:
    将所述整体分割结果的像素值与所述目标图像区域的像素值按照对应位置依次相乘,以确定所述目标子区域。
  7. 根据权利要求1所述的方法,其中,将所述目标图像区域或目标子区域输入到第一模型中,以输出所述二值化的ECG图像中的目标ECG信号之前,所述方法还包括:
    通过以下方式获取ECG图像仿真处理的二值化的ECG图像:
    获取所述目标ECG图像,其中,所述目标ECG图像为RGB图像;
    将所述目标ECG图像中添加白噪声,以获得仿真处理后的二值化的ECG图像。
  8. 根据权利要求1所述的方法,其中,将所述目标图像区域或目标子区域输入到第一模型中,以输出所述二值化的ECG图像中的目标ECG信号之前,所述方法还包括:
    通过以下方式获取所述仿真处理的二值化的ECG图像中的ECG信号:
    获取目标ECG图像,其中,所述目标ECG图像为RGB图像;
    将所述RGB图像转换为灰度图像,并确定所述灰度图像中的每个像素点的均值;
    保留像素点的均值小于第一值的目标像素点,并将所述目标像素点的像素值设置为1,以获取所述仿真处理的二值化的ECG图像中的ECG信号。
  9. 根据权利要求1所述的方法,其中,将所述目标图像区域或目标子区域输入到第一模型中,以输出所述二值化的ECG图像中的目标ECG信号,包括:
    从所述目标图像区域获取多个局部图像,其中,所述多个局部图像中的任意相邻两个局部图像均存在重叠区域;
    将所述多个局部图像输入到第一模型中,以输出与所述多个局部图像对应的多个分割结果;
    将所述多个分割结果组合成所述目标图像区域的整体分割结果,以确定所述目标ECG信号;或
    从所述目标子区域获取多个局部图像,其中,所述多个局部图像中的任意相邻两个局部图像均存在重叠区域;
    将所述多个局部图像输入到第一模型中,以输出与所述多个局部图像对应的多个分割结果;
    将所述多个分割结果组合成所述目标子区域的整体分割结果,以确定所述目标ECG信号。
  10. 根据权利要求5所述的方法,其中,通过以下方式训练所述第一模型或所述第二模型:
    根据目标损失函数对所述第一模型或所述第二模型的参数进行调整,其中,所述目标损失函数通过二值交叉熵和Dice损失函数确定;其中,
    所述目标损失函数=a×二值交叉熵+b×Dice损失函数,其中,a>0;b>0。
  11. 根据权利要求1所述的方法,其中,对二值化的ECG图像进行形态学运算获得所述二值化的ECG图像中的目标图像区域,包括:
    通过指定的形态学算子对所述二值化的ECG图像进行处理;
    将处理后的二值化的ECG图像中像素点分布密集的区域连接起来,以获得多个具有封闭区域的图像;
    将所述多个具有封闭区域的图像的无像素的部分填充像素;
    将填充像素后面积最大的区域作为所述目标图像区域。
  12. 一种ECG信号的获取装置,包括:
    处理模块,设置为对二值化的ECG图像进行形态学运算获得所述二值化的ECG图像中的目标图像区域,其中,所述二值化的ECG图像的像素值包括:两个不同的值,所述目标图像区域中包括:目标ECG信号;
    确定模块,设置为将所述目标图像区域或目标子区域输入到第一模型中,以输出所述二值化的ECG图像中的目标ECG信号,其中,所述第一模型为使用多组数据通过机器学习训练出的用于识别目标ECG信号的模型,所述多组数据中的每组数据均包括:通过目标ECG图像仿真处理后的二值化的ECG图像和所述仿真处理的二值化的ECG图像中的ECG信号,所述目标子区域包括:所述目标ECG信号以及与所述目标ECG信号的距离在预设范围内的周围区域。
  13. 根据权利要求12所述的装置,其中,所述处理模块,还设置为对二值化的ECG图像进行颜色反相处理;对颜色反相处理后的ECG图像进行形态学运算获得所述二值化的ECG图像中的目标图像区域。
  14. 根据权利要求12所述的装置,其中,所述处理模块,还设置为确定所述二值化的ECG图像中的前景区域和背景区域,其中,所述前景区域包括:所述目标ECG信号和所述二值化的ECG图像中的表格,所述前景区域的像素值为第一值,所述背景区域的像素值为 第二值;将所述前景区域的像素值设置为第二值,以及将所述背景区域的像素值设置为第一值。
  15. 根据权利要求12所述的装置,其中,所述确定模块,还设置为从目标图像区域中提取出所述目标子区域;将所述目标子区域输入到第一模型中,输出所述二值化的ECG图像中的目标ECG信号。
  16. 根据权利要求15所述的装置,其中,所述确定模块,还设置为从所述目标图像区域获取多个局部图像,其中,所述多个局部图像中的任意相邻两个局部图像均存在重叠区域;
    将所述多个局部图像输入到第二模型中,以输出与所述多个局部图像对应的多个分割结果,其中,所述第二模型为使用多组数据通过机器学习训练出的用于识别分割局部图像中包含目标ECG信号的区域的模型,所述多组数据中的每组数据均包括:原始二值化的ECG图像,以及标注后的二值化的ECG图像,其中,所述原始二值化的ECG图像包括:目标ECG信号,和所述目标ECG信号的相似度小于预设阈值的ECG区域,噪声信号区域,所述标注后的二值化的ECG图像包括:所述目标ECG信号,和所述目标ECG信号的相似度小于预设阈值的ECG区域;将所述多个分割结果组合成所述目标图像区域的整体分割结果;根据所述整体分割结果确定所述目标子区域。
  17. 根据权利要求16所述的装置,其中,所述确定模块,还设置为将所述整体分割结果的像素值与所述目标图像区域的像素值按照对应位置依次相乘,以确定所述目标子区域。
  18. 根据权利要求12所述的装置,其中,所述确定模块,还设置为通过以下方式获取ECG图像仿真处理的二值化的ECG图像:
    获取所述目标ECG图像,其中,所述目标ECG图像为RGB图像;将所述目标ECG图像中添加白噪声,以获得仿真处理后的二值化的 ECG图像。
  19. 根据权利要求12所述的装置,其中,所述确定模块,还设置为通过以下方式获取所述仿真处理的二值化的ECG图像中的ECG信号:获取目标ECG图像,其中,所述目标ECG图像为RGB图像;将所述RGB图像转换为灰度图像,并确定所述灰度图像中的每个像素点的均值;保留像素点的均值小于第一值的目标像素点,并将所述目标像素点的像素值设置为1,以获取所述仿真处理的二值化的ECG图像中的ECG信号。
  20. 根据权利要求13所述的装置,其中,
    所述确定模块,还设置为从所述目标图像区域获取多个局部图像,其中,所述多个局部图像中的任意相邻两个局部图像均存在重叠区域;将所述多个局部图像输入到第一模型中,以输出与所述多个局部图像对应的多个分割结果;将所述多个分割结果组合成所述目标图像区域的整体分割结果,以确定所述目标ECG信号;或,
    所述确定模块,还设置为从所述目标子区域获取多个局部图像,其中,所述多个局部图像中的任意相邻两个局部图像均存在重叠区域;将所述多个局部图像输入到第一模型中,以输出与所述多个局部图像对应的多个分割结果;将所述多个分割结果组合成所述目标子区域的整体分割结果,以确定所述目标ECG信号。
  21. 根据权利要求16所述的装置,其中,所述确定模块,还设置为根据目标损失函数对所述第一模型或所述第二模型的参数进行调整,其中,所述目标损失函数通过二值交叉熵和Dice损失函数确定,其中,
    所述目标损失函数=a×二值交叉熵+b×Dice损失函数,其中,a>0;b>0。
  22. 一种计算机可读的存储介质,所述存储介质中存储有计算机程序,其中,所述计算机程序被设置为运行时执行所述权利要求1至11任一项中所述的方法。
  23. 一种电子装置,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器被设置为运行所述计算机程序以执行所述权利要求1至11任一项中所述的方法。
PCT/CN2021/072748 2020-01-20 2021-01-19 Ecg信号的获取方法及装置、存储介质、电子装置 WO2021147866A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010066235.6A CN111882559B (zh) 2020-01-20 2020-01-20 Ecg信号的获取方法及装置、存储介质、电子装置
CN202010066235.6 2020-01-20

Publications (1)

Publication Number Publication Date
WO2021147866A1 true WO2021147866A1 (zh) 2021-07-29

Family

ID=73153907

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/072748 WO2021147866A1 (zh) 2020-01-20 2021-01-19 Ecg信号的获取方法及装置、存储介质、电子装置

Country Status (2)

Country Link
CN (1) CN111882559B (zh)
WO (1) WO2021147866A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111882559B (zh) * 2020-01-20 2023-10-17 深圳数字生命研究院 Ecg信号的获取方法及装置、存储介质、电子装置
CN112508976A (zh) * 2020-12-22 2021-03-16 大连民族大学 基于u型卷积神经网络的满文历史文档图像二值化方法
CN114366116B (zh) * 2022-01-28 2023-08-25 南方医科大学 一种基于Mask R-CNN网络及心电图的参数获取方法

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050027201A1 (en) * 2003-04-24 2005-02-03 Badilini Fabio F. Method and system for converting paper ECG printouts to digital ECG files
CN101051351A (zh) * 2007-05-23 2007-10-10 重庆医科大学 一种图像带参二值化方法及采用该方法的装置
CN107174232A (zh) * 2017-04-26 2017-09-19 天津大学 一种心电图波形提取方法
CN109620211A (zh) * 2018-11-01 2019-04-16 吉林大学珠海学院 一种基于深度学习的智能化异常心电辅助诊断方法
CN111882559A (zh) * 2020-01-20 2020-11-03 深圳数字生命研究院 Ecg信号的获取方法及装置、存储介质、电子装置

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10039502B2 (en) * 2011-04-12 2018-08-07 Medtronic Ablation Frontiers Llc Electrophysiological signal processing and utilization
US20130046168A1 (en) * 2011-08-17 2013-02-21 Lei Sui Method and system of characterization of carotid plaque
US9289150B1 (en) * 2012-08-17 2016-03-22 Analytics For Life Non-invasive method and system for characterizing cardiovascular systems
US9576107B2 (en) * 2013-07-09 2017-02-21 Biosense Webster (Israel) Ltd. Model based reconstruction of the heart from sparse samples
DE102015216115B4 (de) * 2015-08-24 2023-08-10 Siemens Healthcare Gmbh Verfahren und System zum Bestimmen eines Triggersignals
CA3042952A1 (en) * 2016-11-14 2018-05-17 Nuralogix Corporation System and method for camera-based heart rate tracking
KR102021491B1 (ko) * 2018-04-24 2019-09-16 조선대학교산학협력단 사용자 인증을 위한 장치 및 방법
CN108968951B (zh) * 2018-08-15 2021-06-22 武汉中旗生物医疗电子有限公司 心电图检测方法、装置及系统
CN109741346B (zh) * 2018-12-30 2020-12-08 上海联影智能医疗科技有限公司 感兴趣区域提取方法、装置、设备及存储介质
CN109978890B (zh) * 2019-02-25 2023-07-07 平安科技(深圳)有限公司 基于图像处理的目标提取方法、装置及终端设备
CN109907753B (zh) * 2019-04-23 2022-07-26 杭州电子科技大学 一种多维度ecg信号智能诊断系统
CN110400626B (zh) * 2019-07-08 2023-03-24 上海联影智能医疗科技有限公司 图像检测方法、装置、计算机设备和存储介质
CN110490073A (zh) * 2019-07-15 2019-11-22 浙江省北大信息技术高等研究院 目标检测方法、装置、设备及存储介质
CN110432894B (zh) * 2019-08-09 2022-04-22 上海鹰瞳医疗科技有限公司 心电图关键点标注方法及电子设备

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050027201A1 (en) * 2003-04-24 2005-02-03 Badilini Fabio F. Method and system for converting paper ECG printouts to digital ECG files
CN101051351A (zh) * 2007-05-23 2007-10-10 重庆医科大学 一种图像带参二值化方法及采用该方法的装置
CN107174232A (zh) * 2017-04-26 2017-09-19 天津大学 一种心电图波形提取方法
CN109620211A (zh) * 2018-11-01 2019-04-16 吉林大学珠海学院 一种基于深度学习的智能化异常心电辅助诊断方法
CN111882559A (zh) * 2020-01-20 2020-11-03 深圳数字生命研究院 Ecg信号的获取方法及装置、存储介质、电子装置

Also Published As

Publication number Publication date
CN111882559A (zh) 2020-11-03
CN111882559B (zh) 2023-10-17

Similar Documents

Publication Publication Date Title
WO2021147866A1 (zh) Ecg信号的获取方法及装置、存储介质、电子装置
CN109741346B (zh) 感兴趣区域提取方法、装置、设备及存储介质
CN108665456B (zh) 基于人工智能的乳腺超声病灶区域实时标注的方法及系统
CN109978890B (zh) 基于图像处理的目标提取方法、装置及终端设备
CN111862044B (zh) 超声图像处理方法、装置、计算机设备和存储介质
CN111291629A (zh) 图像中文本的识别方法、装置、计算机设备及计算机存储介质
CN109871845B (zh) 证件图像提取方法及终端设备
CN110570435B (zh) 用于对车辆损伤图像进行损伤分割的方法及装置
CN111325750B (zh) 一种基于多尺度融合u型链神经网络的医学图像分割方法
CN108830149B (zh) 一种目标细菌的检测方法及终端设备
CN109886928A (zh) 一种目标细胞标记方法、装置、存储介质及终端设备
CN111160114B (zh) 手势识别方法、装置、设备及计算机可读存储介质
CN110246579B (zh) 一种病理诊断方法及装置
WO2019184851A1 (zh) 图像处理方法和装置及神经网络模型的训练方法
CN113139977B (zh) 一种基于YOLO和U-Net的口腔曲断影像智齿分割方法
CN106530290A (zh) 医学图像分析方法和装置
CN112528058B (zh) 基于图像属性主动学习的细粒度图像分类方法
WO2021139447A1 (zh) 一种宫颈异常细胞检测装置及方法
CN117152507A (zh) 一种牙齿健康状态检测方法、装置、设备及存储介质
CN113177554B (zh) 甲状腺结节识别与分割方法、系统、存储介质及设备
CN112801940B (zh) 模型评测方法、装置、设备及介质
CN112330648A (zh) 基于半监督学习的无参考图像质量评价方法及装置
CN110647889A (zh) 医学图像识别方法、医学图像识别装置、终端设备及介质
CN111612755B (zh) 肺部病灶分析方法、装置、电子设备和存储介质
CN111626313A (zh) 一种特征提取模型训练方法、图像处理方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21745187

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 08.12.2022)

122 Ep: pct application non-entry in european phase

Ref document number: 21745187

Country of ref document: EP

Kind code of ref document: A1