Heart state detection method, device, equipment and medium
A neural network model for electrocardiogram analysis addresses the variability in human interpretation by enhancing accuracy and enabling timely detection of cardiac conditions, improving diagnostic efficiency and patient care.
Patent Information
- Application Number
- CN202411020382.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-29
- Publication Date
- 2025-01-03
AI Technical Summary
Existing methods for analyzing electrocardiograms rely heavily on medical professionals' experience, leading to varying accuracy and a lack of timely detection of cardiac conditions like hypertrophy, dilation, and enlargement, which can lead to severe outcomes such as heart failure and arrhythmia.
A neural network model is employed to analyze electrocardiogram data, selecting a diagnostic model matching the number of leads and using a multi-layer architecture to determine cardiac states, incorporating one-dimensional and two-dimensional feature extraction and correlation modules for improved accuracy.
The neural network model significantly enhances the efficiency and accuracy of electrocardiogram analysis, enabling timely detection of cardiac hypertrophy, dilation, and enlargement, reducing missed diagnoses and improving patient outcomes.
Smart Images

Figure CN119252471A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of neural network technology, and in particular to a heart state detection method, device, equipment and medium. Background Art
[0002] The main function of the heart is to provide power for blood flow and to circulate blood to all parts of the body. Electrocardiogram (ECG) is a technical means for detecting the health of the heart. In related technologies, doctors mainly analyze ECGs to determine whether the heart is abnormal. However, doctors can only analyze ECGs based on experience, and the accuracy of the analysis varies with experience. Therefore, how to quickly and accurately analyze ECGs is a problem that needs to be solved urgently. Summary of the invention
[0003] The embodiments of the present application provide a heart state detection method, device, equipment and medium, which solves the technical problem in the prior art that doctors rely on experience to analyze electrocardiograms, and the accuracy of the analysis varies with the change of experience. The embodiment of the present application achieves the technical effect of analyzing electrocardiograms through a neural network model to improve the accuracy of electrocardiogram recognition.
[0004] In a first aspect, the present application provides a method for detecting a heart state, the method comprising:
[0005] Collect target electrocardiogram data of the patient to be diagnosed;
[0006] According to the actual number of leads corresponding to the target electrocardiogram data, a target diagnostic neural network model matching the actual number of leads is selected from a plurality of pre-trained standard diagnostic neural network models;
[0007] The target electrocardiogram data is input into a target diagnostic neural network model to obtain at least one target cardiac state label determined by the target diagnostic neural network model from a plurality of pre-calibrated cardiac state labels according to the target electrocardiogram data, and the at least one target cardiac state label is used to characterize the actual cardiac state of the patient to be diagnosed.
[0008] Further, the plurality of cardiac status labels include at least one of a normal status label, a left ventricular hypertrophy status label, a left ventricular dilation status label, a right ventricular hypertrophy status label, a right ventricular dilation status label, a left atrial enlargement status label, and a right atrial enlargement status label.
[0009] Furthermore, before selecting a target diagnostic neural network model matching the actual number of leads from a plurality of pre-trained standard diagnostic neural network models according to the actual number of leads corresponding to the target electrocardiogram data, the method further includes:
[0010] Acquire historical electrocardiogram data and historical echocardiogram data corresponding to a plurality of historically diagnosed patients; the number of leads of the historical electrocardiogram data corresponds to a preset number of leads, and the leads of the historical electrocardiogram data corresponding to each historically diagnosed patient are the same;
[0011] According to the historical echocardiogram of each historically diagnosed patient, a corresponding historical status label is obtained, and the historical status label corresponding to each historically diagnosed patient corresponds to the historical electrocardiogram data;
[0012] The pre-constructed initial diagnostic neural network model is trained according to the historical electrocardiogram data, historical status labels and preset multiple model training indicators corresponding to each historically diagnosed patient, and a standard diagnostic neural network model corresponding to the preset number of leads is obtained, wherein the cost function between the predicted status label and the historical status label output by the standard diagnostic neural network model is minimized.
[0013] Furthermore, before selecting a target diagnostic neural network model matching the actual number of leads from a plurality of pre-trained standard diagnostic neural network models according to the actual number of leads corresponding to the target electrocardiogram data, the method further includes:
[0014] The preset number of leads is set to 12, and a 12-lead standard diagnostic neural network model corresponding to the number of 12 leads is obtained;
[0015] The aggregate attribution score of the expected gradient corresponding to each of the 12 leads output by the 12-lead standard diagnostic neural network model;
[0016] The first N leads with the largest aggregate attribution scores among the 12 leads are taken as equivalent leads; N is a positive integer less than 12;
[0017] The preset number of leads is set to N, and an N-lead standard diagnostic neural network model corresponding to the N equivalent leads is obtained.
[0018] Further, when N is 4, the 4 equivalent leads include I, aVR, V1 and V5.
[0019] Furthermore, before training the pre-built initial diagnostic neural network model according to the historical electrocardiogram data, historical status labels and preset multiple model training indicators corresponding to each historically diagnosed patient to obtain a standard diagnostic neural network model corresponding to the preset number of leads, the method further includes:
[0020] Constructing an initial diagnosis neural network model, the initial diagnosis neural network model includes a one-dimensional embedding module, a one-dimensional correlation module, an image conversion module, a two-dimensional embedding module, a two-dimensional correlation module and a multi-label diagnosis module, the one-dimensional embedding module is connected to the one-dimensional correlation module, the one-dimensional correlation module is connected to the multi-label diagnosis module, the image conversion module, the two-dimensional embedding module and the two-dimensional correlation module are connected in sequence, and the two-dimensional correlation module is connected to the multi-label diagnosis module;
[0021] The one-dimensional embedding module is used to receive the one-dimensional amplitude data of the electrocardiogram and determine the one-dimensional amplitude feature;
[0022] The one-dimensional correlation module is used to receive the one-dimensional amplitude features output by the one-dimensional embedding module, and determine the one-dimensional mutual dependence between different channels and spatial positions of the potential features according to the one-dimensional amplitude features;
[0023] The image conversion module is used to convert the electrocardiogram into a two-dimensional image;
[0024] The two-dimensional embedding module is used to receive the two-dimensional image output by the image conversion module and determine the two-dimensional image features according to the two-dimensional image;
[0025] The two-dimensional correlation module is used to receive the two-dimensional image features output by the two-dimensional embedding module, and determine the two-dimensional mutual dependence between different channels and spatial positions of the potential features according to the two-dimensional image features;
[0026] The multi-label diagnosis module is used to receive the one-dimensional interdependence output by the one-dimensional correlation module and the two-dimensional interdependence output by the two-dimensional correlation module, and output a state label corresponding to the electrocardiogram according to the one-dimensional interdependence and the two-dimensional interdependence.
[0027] Furthermore, the multiple model training indicators include at least one indicator among subset accuracy, Hamming loss, average F1 score, average recall rate and average precision.
[0028] In a second aspect, the present application provides a heart state detection device, the device comprising:
[0029] A data acquisition module, used for acquiring target electrocardiogram data of the patient to be diagnosed;
[0030] A model determination module, for selecting a target diagnostic neural network model that matches the actual number of leads from a plurality of pre-trained standard diagnostic neural network models according to the actual number of leads corresponding to the target electrocardiogram data;
[0031] The model diagnosis module is used to input the target electrocardiogram data into the target diagnosis neural network model to obtain at least one target heart state label determined by the target diagnosis neural network model from a plurality of pre-calibrated heart state labels based on the target electrocardiogram data, and the at least one target heart state label is used to characterize the actual heart state of the patient to be diagnosed.
[0032] In a third aspect, the present application provides an electronic device, including:
[0033] processor;
[0034] a memory for storing processor-executable instructions;
[0035] The processor is configured to execute to implement a heart state detection method as provided in the first aspect.
[0036] In a fourth aspect, the present application provides a non-temporary computer-readable storage medium. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to implement a heart state detection method as provided in the first aspect.
[0037] One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:
[0038] This embodiment collects target electrocardiogram data of the patient to be diagnosed; then, according to the actual number of leads corresponding to the target electrocardiogram data, selects a target diagnostic neural network model that matches the actual number of leads from a plurality of pre-trained standard diagnostic neural network models; inputs the target electrocardiogram data into the target diagnostic neural network model, and obtains at least one target heart state label determined by the target diagnostic neural network model from a plurality of pre-calibrated heart state labels according to the target electrocardiogram data, and the at least one target heart state label is used to characterize the actual heart state of the patient to be diagnosed. It can be seen that this embodiment can rely on the neural network model to automatically analyze the electrocardiogram data, greatly improving the efficiency of electrocardiogram data analysis; and avoids the phenomenon that there are differences in electrocardiogram analysis results caused by different experiences of different doctors, and improves the accuracy of electrocardiogram data analysis. In addition, this embodiment relies on the neural network model to automatically analyze the electrocardiogram data, and can timely detect the state of cardiac hypertrophy, dilation and enlargement through the electrocardiogram, which can timely detect the pathological state of cardiac hypertrophy, dilation and enlargement before the occurrence of symptoms such as heart failure, sudden death and arrhythmia, so that more patients can be diagnosed in time. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0040] Figure 1 A schematic diagram of a flow chart of a heart state detection method provided in this embodiment;
[0041] Figure 2 A schematic diagram of the architecture of the diagnostic neural network model provided in this embodiment;
[0042] Figure 3 A schematic diagram showing a comparison between the diagnostic performance of the diagnostic neural network model provided in this embodiment and the results of the doctor's diagnosis;
[0043] Figure 4 A schematic diagram of the average score distribution corresponding to each category provided in this embodiment;
[0044] Figure 5 A schematic diagram showing a comparison of average values of four categories provided for this embodiment;
[0045] Figure 6 A schematic diagram showing the comparison of the three neural network models provided in this embodiment in terms of sensitivity, specificity, F1 score and accuracy;
[0046] Figure 7 This is a schematic diagram of the distribution ratio of each sample in each state label;
[0047] Figure 8 A schematic diagram of the structure of a heart state detection device provided in this embodiment;
[0048] Fig. 9 A schematic diagram of the structure of an electronic device provided in this embodiment. DETAILED DESCRIPTION
[0049] The embodiment of the present application provides a heart state detection method, which solves the technical problem in the prior art that doctors rely on experience to analyze electrocardiograms, and the accuracy of the analysis varies with the change of experience.
[0050] The technical solution of the embodiment of the present application is to solve the above technical problems, and the overall idea is as follows:
[0051] This embodiment collects target electrocardiogram data of the patient to be diagnosed; then, according to the actual number of leads corresponding to the target electrocardiogram data, selects a target diagnostic neural network model that matches the actual number of leads from a plurality of pre-trained standard diagnostic neural network models; inputs the target electrocardiogram data into the target diagnostic neural network model, and obtains at least one target heart state label determined by the target diagnostic neural network model from a plurality of pre-calibrated heart state labels according to the target electrocardiogram data, and the at least one target heart state label is used to characterize the actual heart state of the patient to be diagnosed. It can be seen that this embodiment can rely on the neural network model to automatically analyze the electrocardiogram data, greatly improving the efficiency of electrocardiogram data analysis; and avoids the phenomenon that there are differences in electrocardiogram analysis results caused by different experiences of different doctors, and improves the accuracy of electrocardiogram data analysis. In addition, this embodiment relies on the neural network model to automatically analyze the electrocardiogram data, and can timely detect the state of cardiac hypertrophy, dilation and enlargement through the electrocardiogram, which can timely detect the pathological state of cardiac hypertrophy, dilation and enlargement before the occurrence of symptoms such as heart failure, sudden death and arrhythmia, so that more patients can be diagnosed in time.
[0052] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0053] First of all, the term "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0054] The main function of the heart is to provide power for blood flow and to circulate blood to all parts of the body. Electrocardiogram (ECG) is a technical means for detecting the health of the heart. In related technologies, doctors mainly analyze ECGs to determine whether the heart is abnormal. However, doctors can only analyze ECGs based on experience, and the accuracy of the analysis varies with experience. Therefore, how to quickly and accurately analyze ECGs is a problem that needs to be solved urgently.
[0055] In addition, cardiac hypertrophy, dilation and enlargement are important causes of heart failure, sudden death and arrhythmia, and have a high incidence rate in the general population. However, electrocardiograms cannot detect cardiac hypertrophy, dilation and enlargement in a timely manner, which makes it impossible to detect cardiac hypertrophy, dilation and enlargement in time before symptoms such as heart failure, sudden death and arrhythmia occur. Only after symptoms of heart failure, sudden death and arrhythmia appear, will echocardiography be used to determine whether the heart is hypertrophic, dilated and enlarged, resulting in many patients not being diagnosed in time. Therefore, how to detect cardiac hypertrophy, dilation and enlargement in time through electrocardiograms is an urgent problem to be solved.
[0056] In order to solve the above problems, this embodiment provides Figure 1 A heart state detection method is shown, the method comprising steps S11 to S13.
[0057] Step S11, collecting target electrocardiogram data of the patient to be diagnosed;
[0058] Step S12, selecting a target diagnostic neural network model that matches the actual number of leads from a plurality of pre-trained standard diagnostic neural network models according to the actual number of leads corresponding to the target electrocardiogram data;
[0059] Step S13, input the target electrocardiogram data into the target diagnosis neural network model, and obtain at least one target heart state label determined by the target diagnosis neural network model from multiple pre-calibrated heart state labels based on the target electrocardiogram data, and the at least one target heart state label is used to characterize the actual heart state of the patient to be diagnosed.
[0060] The heart state detection method provided in this embodiment can be executed by a target device configured with a standard diagnostic neural network model, which is not described in detail in this embodiment.
[0061] Regarding step S11, target electrocardiogram data of the patient to be diagnosed is collected.
[0062] The target electrocardiogram data of the patient to be diagnosed may be collected by the electrocardiogram electronic device, and the target device may obtain the target electrocardiogram data of the patient to be diagnosed from the electrocardiogram electronic device.
[0063] The electrocardiogram can correspond to at least one of the 12 leads, that is, the electrical activity of the heart is obtained from 12 angles, including Ⅰ, Ⅱ, Ⅲ, avF, avR, avL, V1, V2, V3, V4, V5, and V6.
[0064] Regarding step S12, according to the actual number of leads corresponding to the target electrocardiogram data, a target diagnostic neural network model matching the actual number of leads is selected from a plurality of pre-trained standard diagnostic neural network models.
[0065] The actual number of leads corresponding to the target ECG data can be directly obtained from the target ECG data. The target diagnostic neural network model matching the actual number of leads is selected. That is to say, the standard diagnostic neural network models corresponding to different numbers of leads are different. For example, 12 leads correspond to a 12-lead diagnostic neural network model, and 4 leads correspond to a 4-lead diagnostic neural network model.
[0066] The target electrocardiogram data is input into the target diagnosis neural network model so that the target diagnosis neural network model performs state analysis on the target electrocardiogram.
[0067] Although the standard diagnostic neural network models corresponding to different numbers of leads are different, the training methods of the various standard diagnostic neural network models are basically the same, specifically including steps S1211 to S1213.
[0068] Step S1211, obtaining historical electrocardiogram data and historical echocardiogram data corresponding to a plurality of historically diagnosed patients respectively; the number of leads of the historical electrocardiogram data corresponds to the preset number of leads, and the leads of the historical electrocardiogram data corresponding to each historically diagnosed patient are the same;
[0069] Step S1212, obtaining corresponding historical status labels according to the historical echocardiograms of each historically diagnosed patient, wherein the historical status labels corresponding to each historically diagnosed patient correspond to the historical electrocardiogram data;
[0070] Step S1213, training the pre-constructed initial diagnostic neural network model according to the historical electrocardiogram data, historical status labels and preset multiple model training indicators corresponding to each historically diagnosed patient, to obtain a standard diagnostic neural network model corresponding to the preset number of leads, wherein the cost function between the predicted status label and the historical status label output by the standard diagnostic neural network model is minimized.
[0071] Regarding step S1211, the historical electrocardiogram data and historical echocardiogram data corresponding to multiple historically diagnosed patients can be data after data preprocessing. Use discrete wavelet transform (DWT) combined with threshold shrinkage algorithm to remove baseline drift, remove power line interference and reduce noise. Daubechies 8 wavelet is selected as the basis function of wavelet transform, which can most significantly represent the waveform characteristics of ECG signal. The decomposition level of DWT is selected as 7. For the removal of low-frequency (0.5Hz-2Hz) baseline drift, the wavelet coefficient CA7 is set to zero, which can correspond to the low-frequency part (<2Hz) of the original ECG signal. On the basis of the reconstructed signal after low-frequency removal, in order to reduce high-frequency noise and power line interference, the decomposition level is set to 6. Then, level-dependent threshold DWT denoising is performed to ensure accurate estimation of the true signal. The denoised ECG signal can then be used for the development of a multiple representation model.
[0072] Obtain the historical electrocardiogram data and historical echocardiogram data corresponding to multiple historically diagnosed patients. When the preset number of leads is 12, the historical electrocardiogram data corresponding to each historically diagnosed patient is the ECG data corresponding to the 12 leads. When the preset number of leads is 4 and they are Ⅰ, Ⅱ, Ⅲ, and avF respectively, the historical electrocardiogram data corresponding to each historically diagnosed patient is the ECG data corresponding to the Ⅰ, Ⅱ, Ⅲ, and avF leads.
[0073] Each historically diagnosed patient should meet the preset age requirement. For example, the historical electrocardiogram data and historical echocardiogram data of historically diagnosed patients over 18 years old can be used to train the diagnostic neural network model. The collection time interval between the historical electrocardiogram data and historical echocardiogram data corresponding to each historically diagnosed patient should be less than the preset time interval. For example, only the historical electrocardiogram data and historical echocardiogram data of the same historically diagnosed patient collected within three days can be used to train the diagnostic neural network model.
[0074] The historical electrocardiogram data and historical echocardiogram data corresponding to multiple historically diagnosed patients can be stored in the corresponding database and continuously updated, thereby ensuring the freshness of the historical electrocardiogram data and historical echocardiogram data used to train the diagnostic neural network model.
[0075] Each historical ECG data was recorded in a standard 10-second, 12-lead format with a sampling rate of 500 Hz. The echocardiographic data of historically diagnosed patients were acquired by a Vivid E9 ultrasound scanner (GE Vingmed, Horten, Norway).
[0076] Regarding step S1212, the historical echocardiographic data are preprocessed data. Specifically, they are measured offline by experienced cardiologists using EchoPac software to measure the diastolic interventricular septum thickness (IVS) and left ventricular posterior wall thickness, left ventricular end-diastolic dimension, right ventricular end-diastolic dimension and left atrial end-diastolic dimension from the transthoracic long-axis view, and the right atrial systolic dimension from the apical four-chamber view, so as to calibrate the heart state represented by each historical echocardiographic data.
[0077] For example, according to the relevant guidelines for cardiac disease certification, LVH (left ventricular hypertrophy) / LVD (left ventricular dilatation) can be classified as males>53 mm, females>51 mm, IVS and left ventricular posterior wall (PW)>10 mm. RVH (right ventricular hypertrophy) / RVD (right ventricular dilatation) is classified as males and females>33 mm, LAE (left atrial enlargement) is classified as males>37 mm, females>35 mm, and RAE (right atrial enlargement) is classified as males and females>45 mm. That is, the historical status label can include at least one of the normal status label Normal, the left ventricular hypertrophy status label LVH, the left ventricular dilatation status label LVD, the right ventricular hypertrophy status label RVH, the right ventricular dilatation status label RVD, the left atrial enlargement status label LAE, and the right atrial enlargement status label RAE.
[0078] Each ECG data is associated with its corresponding echocardiogram record, for example, a patient with a normal ECG may be labeled as having LVH (left ventricular hypertrophy) or / and LVD (left ventricular dilatation) based on the echocardiogram results. A patient with an ECG diagnosis of a single LVH (left ventricular hypertrophy) label may also have RVH (right ventricular hypertrophy) or / and RVD (right ventricular dilatation). Each historically diagnosed patient is assigned a unique patient identifier ID to ensure that the ECG and echocardiogram of each historically diagnosed patient are consistent. Figure 1 One to one correspondence.
[0079] It should be noted that the historical electrocardiogram data and historical echocardiogram data corresponding to multiple historically diagnosed patients should cover data corresponding to all state labels, that is, data with normal state label Normal, left ventricular hypertrophy state label LVH, left ventricular dilation state label LVD, right ventricular hypertrophy state label RVH, right ventricular dilation state label RVD, left atrial enlargement state label LAE and right atrial enlargement state label RAE, so as to ensure the comprehensiveness and accuracy of the diagnostic neural network model.
[0080] More specifically, the historical electrocardiogram data and historical echocardiogram data corresponding to the multiple historically diagnosed patients collected in step S1211 can be divided into data sets according to a preset ratio (e.g., 8:1:1) to obtain a training data set, a test data set, a retained test set, etc., to implement a cross-validation training model. For the training data set, all ECGs that match the echocardiogram can be included, regardless of ECG abnormalities. For the test data set, abnormalities related to depolarization (e.g., bundle branch block, ventricular pacing, etc.) can be excluded to reduce the degree to which the model is affected by depolarization abnormalities during the test. The test set is retained to further verify whether the performance of the model is good.
[0081] Regarding step S1213, the pre-built initial diagnostic neural network model, such as Figure 2 As shown, the model architecture for classification designed based on ResNet includes a one-dimensional embedding module, a one-dimensional correlation module, an image conversion module, a two-dimensional embedding module, a two-dimensional correlation module and a multi-label diagnosis module. The one-dimensional embedding module is connected to the one-dimensional correlation module, the one-dimensional correlation module is connected to the multi-label diagnosis module, the image conversion module, the two-dimensional embedding module and the two-dimensional correlation module are connected in sequence, and the two-dimensional correlation module is connected to the multi-label diagnosis module.
[0082] Among them, the one-dimensional correlation module includes a channel dependency block and a hierarchical convolution block. The channel dependency block is designed based on SENet and is used to fuse information between channels. The two-dimensional correlation module includes a channel dependency block and a separable convolution block. The channel dependency block is designed based on SENet and is used to fuse information between channels. The separable convolution block is formed based on Xception and is used for feature extraction. The separable convolution block reduces the number of parameters and avoids overfitting.
[0083] The one-dimensional embedding module and the one-dimensional correlation module constitute a one-dimensional data stream, corresponding to the amplitude of the 10-second time series of ECG. The image conversion module, the two-dimensional embedding module, and the two-dimensional correlation module constitute a two-dimensional data stream, corresponding to the segmented image input by the preset number of leads. For example, when the preset number of leads is 12 leads, the segmented image is a heartbeat of a 10-second ECG sample, and the flattened period of the segmented waveform (the first and last 40 samples) is cropped. These cropped waveform samples are then converted into 2D images with a resolution of 128×128 for each lead as the input of the two-dimensional data stream.
[0084] The one-dimensional embedding module is used to receive the one-dimensional amplitude data of the electrocardiogram and determine the one-dimensional amplitude features; it is used to extract hidden features in the latent space. This module consists of two stacked convolutional layers (Conv) to embed the input ECG signal into the latent space. Each Conv layer is followed by batch normalization and ReLU nonlinear activation function. An average pooling layer is inserted between the two Conv layers to smoothly reduce the size of the feature map. Then, the output feature h of this module can be calculated as follows:
[0085]
[0086] Where, for 1-D stream, X_(1-D)∈R^(5000×12), for 2-D stream, X_(1-D)∈R^(128×128×l). l represents the number of leads.
[0087] The one-dimensional correlation module is used to receive the one-dimensional amplitude features output by the one-dimensional embedding module, and determine the one-dimensional interdependencies between different channels and spatial positions of the latent features based on the one-dimensional amplitude features; it is used to explore the interdependencies between different channels and spatial positions of the extracted latent features. This module is stacked four times through the same module, each of which contains three separable convolution blocks (SepConv), a channel dependency block (ChaDep), a pooling layer, and an activation function to explicitly model the interdependencies between different channels and spatial positions of the latent feature h. The SepConv block first performs point convolution (i.e., the kernel size is 1×1 or 1, which is suitable for images or time series, respectively) to map the correlation across channels, and then performs spatial convolution on the input channels independently. The one-dimensional correlation module includes two substreams, one of which contains one SepConv block (layered convolution block) and the other contains two SepConv blocks (layered convolution blocks), so that features at different levels can be learned. After average pooling, each substream is concatenated into a single vector u, as shown below:
[0088] u=Concat(SubFlow_1,SubFlow_2) formula (2)
[0089] SubFlow1=AvePool(SepConv(h)) Formula (3)
[0090] SubFlow2=AvePool(SepConv(SepConv(h))) Formula (4)
[0091] The ChaDep block (channel dependency block) is similar to SENet. Through global information embedding and channel-level information recalibration operations, it can selectively emphasize the information channels of u and suppress less useful channels. Through global average pooling (GAP), the global information embedding operation aggregates the global spatial information of each channel into a channel descriptor. Through the channel-level information recalibration operation using two dense layers (ReLU and sigmoid nonlinear functions), the channel dependency of each channel is captured, and the output z is obtained as follows:
[0092] z=Reshape(Dense(Dense(GAP(u))))u Formula (5)
[0093] The image conversion module is used to convert the electrocardiogram into a two-dimensional image; it is used to study the rich characteristics of morphological features from the segmentation of ECG input images. One heartbeat of the input ECG data is segmented and then converted into a 128×128×l 2-D input feature to explore the changes in morphological features, where l=12 is suitable for 12-lead ECG input, l=4 is suitable for 4-lead ECG input, and so on.
[0094] The two-dimensional embedding module is used to receive the two-dimensional image output by the image conversion module and determine the two-dimensional image features based on the two-dimensional image; it is used to extract hidden features in the latent space. This module consists of two stacked convolutional layers (Conv) to embed the input ECG signal into the latent space. Each Conv layer is followed by batch normalization and ReLU nonlinear activation function. An average pooling layer is inserted between the two Conv layers to smoothly reduce the size of the feature map. Then, the output feature h of this module can refer to formula (1).
[0095] The 2D correlation module is used to receive the 2D image features output by the 2D embedding module, and determine the 2D interdependencies between different channels and spatial positions of the latent features based on the 2D image features; it is used to explore the interdependencies between different channels and spatial positions of the extracted latent features. The module is stacked four times through the same module, each of which contains three separable convolution blocks (SepConv), a channel dependency block (ChaDep), a pooling layer, and an activation function to explicitly model the interdependencies between different channels and spatial positions of the latent feature h. The SepConv block first performs point convolution (i.e., the kernel size is 1×1 or 1, which is suitable for images or time series, respectively) to map the correlation across channels, and then performs spatial convolution on the input channels independently. The 1D correlation module includes two substreams, one of which contains a SepConv block (layered convolution block) and the other contains two SepConv blocks (layered convolution blocks), so that features at different levels can be learned. After average pooling, each substream is connected into a single vector u, which can be specifically referred to formula (2)-formula (4).
[0096] The ChaDep block (channel dependency block) is similar to SENet. Through global information embedding and channel-level information recalibration operations, it can selectively emphasize the information channels of u and suppress less useful channels. Through global average pooling (GAP), the global information embedding operation aggregates the global spatial information of each channel into a channel descriptor. By using two dense layers (ReLU and sigmoid nonlinear functions) to perform channel-level information recalibration operations, the channel dependency of each channel is captured to obtain the output z. For details, please refer to formula (5).
[0097] The multi-label diagnosis module is used to receive the one-dimensional interdependence output by the one-dimensional correlation module, and the two-dimensional interdependence output by the two-dimensional correlation module, and output the state label corresponding to the electrocardiogram according to the one-dimensional interdependence and the two-dimensional interdependence, that is, output at least one state label among the normal state label Normal, the left ventricular hypertrophy state label LVH, the left ventricular dilatation state label LVD, the right ventricular hypertrophy state label RVH, the right ventricular dilatation state label RVD, the left atrial enlargement state label LAE and the right atrial enlargement state label RAE.
[0098] The multi-label diagnosis module concatenates the one-dimensional interdependency z_(1-D) and the two-dimensional interdependency z_(2-D) and then passes them through two dense layers and five sigmoid functions to return the distribution corresponding to the five output categories for multi-label diagnosis, as shown below:
[0099] Y ~=Sigmoid(Dense(Dense(Concat(z1-D,z2-D)))) Formula (6)
[0100] Among them, Y ~ ∈R^(1×5) is the predicted output vector. The diagnostic neural network model provided in this embodiment should have good generalization ability in minimizing the risk of the multi-label cross entropy loss function of Y and Y.
[0101] It is important to note that except for the heartbeat segmentation and image translation operations performed in the 2-D stream (i.e., image translation module, 2D embedding module, and 2D correlation module), the hyperparameters in the 1-D (i.e., 1D embedding module and 1D correlation module) and 2-D streams are identical in all aspects, differing only in their dimensionality (e.g., the kernel size of the first Conv layer is 5 in the 1-D stream, while it is 5×5 in the 2-D stream).
[0102] The diagnostic neural network model provided in this embodiment can be implemented in Keras and TensorFlow backends using Python. All training is performed on an NVIDIA platform equipped with three available GTX 1080Ti GPUs and 0.8GB RAM per GPU. For the case where only 12-lead ECG is used as input, each model takes about 4 minutes per epoch (in a neural network, an epoch refers to the process in which the entire training data set is completely traversed by the model once). When the segmented image is added to the model, the training time per epoch increases to about 13 minutes.
[0103] Multiple model training metrics include at least one of subset accuracy, Hamming loss, average F1 score, average recall, and average precision. Subset accuracy measures the exact match ratio for multi-label diagnosis problems, indicating the percentage of accurately predicted ECGs for all five labels. Hamming loss (i.e., Hamming loss) evaluates the Hamming distance between the predicted label and the true label, penalizing the differences of individual labels. Single-label metrics, such as the area under the receiver operating characteristic curve (AUROC), the area under the precision-recall curve (AUPRC), sensitivity, specificity, F1 score, and accuracy, calculate different categories of metrics separately.
[0104] Subset accuracy is usually a strict metric that requires the predicted label to match the true label exactly. It penalizes all predictions equally, whether they are close to accurate or completely wrong. Set accuracy is used to measure the accuracy of the predicted label set and the true label set. In multi-label classification problems, the sample is considered to be correctly classified only when all predicted labels are exactly the same as the true labels. Hamming loss is used to calculate the misclassification of labels, reflecting the proportion of labels that are predicted incorrectly, that is, the proportion of the number of predicted labels that do not match the true labels to the total number of labels. The F1 score is the harmonic mean of precision and recall, and is used to comprehensively evaluate the performance of the classification model. In multi-label classification problems, the F1 score of each label can be calculated, and then the average F1 score is obtained by averaging. The average recall is the mean of the recall rates of targets of multiple categories, also known as the average recall rate. In multi-label classification problems, the recall rate of each label can be calculated, and then the average recall rate is obtained by averaging. The average precision is for a single object or category, indicating the detection performance of the model for that class of objects. The average precision is a measure of the robustness of the algorithm for all categories of the data set for multiple categories.
[0105] like Figure 3 Shown (including Figure 3 A and Figure 3 B) shows the comparison results of the diagnostic performance of the standard diagnostic neural network model provided in this embodiment with the multi-label diagnostic performance of six experienced physicians. The physicians were divided into two groups according to their working experience (average working experience was 9.67 years ± 6.26), i.e., physicians 1-3 had 0-6 years of experience, and physicians 4-6 had 6-24 years of experience. AUROC and AUPRC curves of single-label indicators RVH (right ventricular hypertrophy), RVD (right ventricular dilatation), RAE (right atrial enlargement) and Normal.
[0106] exist Figure 3 In A, the physician marks are clustered in the lower left corner of the figure, indicating that the clinical ECG readings have a low diagnostic sensitivity (the probability of making a correct diagnosis when the condition is indeed cardiac hypertrophy / dilatation) for cardiac hypertrophy, dilatation, and enlargement, while the specificity (the probability of making a correct diagnosis when the condition is indeed non-cardiac hypertrophy / dilatation) is high. In contrast, the standard diagnostic neural network model provided in this embodiment achieved high AUROC values (classifier scores) in LAE (left atrial enlargement), LVH (left ventricular hypertrophy), LVD (left ventricular dilatation), RAE (right atrial enlargement), RVH (right ventricular hypertrophy), RVD (right ventricular dilatation), and Normal, which were 0.837, 0.881, 0.888, 0.898, and 0.929, respectively. Similarly, in Figure 3 In B, the physician marks are clustered to the left of the anomaly, indicating that the clinical ECG readings have a recall value (equal to Figure 3 The sensitivity value in A) is lower.
[0107] It can be seen that, whether the physicians have 0-6 years or 6-24 years of work experience, the sensitivity of RAE (right atrial enlargement), RVH (right ventricular hypertrophy), and RVD (right ventricular dilatation) is even lower than 0.100 (0.018±0.031 and 0.029±0.013 for 0-6 years, and 0.036±0.047 and 0.065±0.038 for 6-24 years), which proves that the missed diagnosis rate of ECG interpretation in clinical practice is very high. The standard diagnostic neural network model provided in this embodiment significantly improves the diagnostic performance. The AUROC of the model ( Figure 3 A) and AUPRC( Figure 3 The F1 score increased from 0.159±0.173 (LAE (left atrial enlargement)), 0.321±0.128 (LVH (left ventricular hypertrophy), LVD (left ventricular dilatation)), 0.044±0.059 (RAE (right atrial enlargement)), 0.080±0.046 (RVH (right ventricular hypertrophy), RVD (right ventricular dilatation)) and 0.692±0.012 (Normal) of the physicians to 0.655±0.039, 0.614±0.044, 0.521±0.039, 0.531±0.038 and 0.855±0.005 of the model.
[0108] The sensitivity of abnormal categories increased from 0.111±0.149 (LAE (left atrial enlargement)), 0.224±0.131 (LVH (left ventricular hypertrophy), LVD (left ventricular dilatation)), 0.027±0.037 (RAE (right atrial enlargement)), and 0.047±0.032 (RVH (right ventricular hypertrophy), RVD (right ventricular dilatation)) for physicians to 0.612±0.064, 0.565±0.080, 0.417±0.042, and 0.440±0.052 for the model.
[0109] In specific implementation, it is not necessary to train the models corresponding to any combination of lead groups in the 12 leads to reduce the model training time. Therefore, the preset number of leads can be set to 12 first, and a 12-lead standard diagnostic neural network model corresponding to the number of 12 leads (referred to as ECG-Cor-Net) can be obtained; then, according to the aggregated attribution score of the expected gradient corresponding to each lead in the 12 leads output by the 12-lead standard diagnostic neural network model; the first N leads with the largest aggregated attribution score in the 12 leads are taken as equivalent leads; N is a positive integer less than 12; finally, the preset number of leads is set to N, and an N-lead standard diagnostic neural network model corresponding to N equivalent leads is obtained.
[0110] That is to say, the N leads with the greatest impact on the heart state label are screened out from the 12 leads, and then the historical data corresponding to these N leads are trained to obtain an N-lead standard diagnostic neural network model. That is, the best leads for detecting myocardial hypertrophy, dilatation and enlargement are screened out. The diagnostic neural network model provided in this embodiment outputs an aggregate attribute score for each lead l in each category, which is determined based on the expected gradient of the diagnostic neural network model at each time point. The higher the aggregate attribute score of a lead, the greater the importance of the lead in correctly predicting the category. In order to avoid inferring ECG characteristics between different types of abnormalities, four trained binary classification models are used to calculate the aggregate attribute scores.
[0111] like Figure 4 The individual categories (LVH (left ventricular hypertrophy), LVD (left ventricular dilatation), RVH (right ventricular hypertrophy), RVD (right ventricular dilatation), LAE (left atrial enlargement), and RAE (right atrial enlargement)) and their average scores (AVG) for all four categories are shown. The value for each lead corresponds to each category, and the average of the four categories is shown in Figure 5 In the limb leads, I, II and aVR leads and V1, V5 and V6 leads in the chest leads are more important than other leads in detecting RVH (right ventricular hypertrophy) and RVD (right ventricular dilatation). In the case of RAE (right atrial enlargement), the scores of leads I and V1 reached 0.161 and 0.108, respectively, ranking the top two in the diagnosis of RAE (right atrial enlargement). For LVH (left ventricular hypertrophy), LVD (left ventricular dilatation) and LAE (left atrial enlargement), the scores of I, II and aVR leads in the limb leads and V1, V2 and V4 leads in the chest leads are very high. In the Figure 5 In the figure, it can be seen that the top three representative leads with the highest scores are I / II and V1 of limb leads, and V5 / V6 of chest leads. The higher the score of a lead, the more important the lead is for the correct prediction of the category.
[0112] The aggregate attribution score based on the expected gradient of each lead for each class and considering that the binary classification model is a nonlinear function F:R 5000×12 →[0,1], and x k,l Denotes the ECG input X∈R 5000×12 time points in , where k = 1, 2, ..., 5000 is the kth data point and l = 1, 2, ..., 12 represents the lead. k,l On input x k,l At, indicating x k,l For the prediction F(x k,l ) relative to the sampled reference value where b = 1, 2, ..., N_b is a random sample used as background distribution. Each expected gradient e k,l can be calculated as the sampling reference value The expectation of the gradient to the current input x k,l :
[0113]
[0114] Among them, p b represents samples uniformly distributed on [0,1). Positive e k,l indicates that these time points increase the probability of the predicted category, while negative e k,l This reduces the chances of the ECG recording being correctly diagnosed.
[0115] For example, for lead l, this embodiment defines an evaluation metric called the aggregate attribution score A l , through the centralized e k,l The absolute values of the outliers are summed, that is:
[0116]
[0117] in, is the indicator function for outlier detection and is defined as follows:
[0118]
[0119] Among them, μ and σ represent According to formula (9), when calculating A l When , only outliers with extremely large positive values and extremely small negative values are considered. Therefore, the larger A l A value of indicates that the lead provides more reasons to recommend a particular category.
[0120] Combining the above content and Figure 4 Important leads I, II, aVR, V1, and V5 can be screened out. To further verify the validity of the leads selected from the five representative leads, the model can be retrained using only four input leads selected from these five leads.
[0121] Using the same training dataset, two simplified models can be obtained: one uses the input of Lead I, aVR, V1 and V5, named the first diagnostic neural network model (ECG-Cor-Net-rep-I); the other uses the input of Lead II, aVR, V1 and V5, named the second diagnostic neural network model (ECG-Cor-Net-rep-II).
[0122] ECG-Cor-Net-rep-I and ECG-Cor-Net-rep-II are compared with ECG-Cor-Net respectively. The results are shown in Figure 5 The comparison of AUROC and AUPRC values with ECG-Cor-Net and ECG-Cor-Net-1D models is shown in the Supplementary Figure 5 and Figure 6 In terms of subset accuracy, it can be observed that the subset accuracy of the two simplified models (ECG-Cor-Net-rep-I and ECG-Cor-Net-rep-II) is slightly lower than that of the original ECG-Cor-Net model, decreasing from 0.592 to 0.551 and 0.534 respectively. Both models maintain a very high level of accuracy compared to the doctors. In particular, ECG-Cor-Net-rep-II shows an average sensitivity of 0.554, a specificity of 0.894, an F1 score of 0.603, and an accuracy of 0.833 in diagnosing cardiac structural abnormalities and normal groups, with detailed information shown in Figure 6 The AUC (AUROC and AUPRC) scores of the two simplified models are comparable to those of the ECG-Cor-Net and ECG-Cor-Net-1D models.
[0123] Specifically, the ECG data of different categories are evaluated by aggregate attribution scores. The aggregate attribution score is calculated based on the expected gradient of the 12-lead standard diagnostic neural network model, combining the concepts of integrated gradients (a gradient-based pixel attribution method) and Shapley Additive Explanations (an additive feature attribution method). Combined with the binary classification model F:R^(5000×12)→[0,1], it represents a nonlinear function of diagnosing one of the abnormalities among LVH (left ventricular hypertrophy), LVD (left ventricular dilatation), RVH (right ventricular hypertrophy), RVD (right ventricular dilatation), LAE (left atrial enlargement) and RAE (right atrial enlargement).
[0124] This embodiment selects four leads with high aggregate attribution scores to obtain a simplified model for detecting cardiac hypertrophy, dilatation, and enlargement. When N is 4, the 4 equivalent leads include I, aVR, V1, and V5. In the experiment, the performance of the simplified 4-lead model and the 12-lead model were compared to prove that only four leads can be used to diagnose complex atrioventricular hypertrophy problems, which can be applied to clinical work and portable devices. In this way, ECG data can be collected using only N leads, facilitating the implementation of portable devices using fewer leads.
[0125] Regarding step S13, the target electrocardiogram data is input into the target diagnosis neural network model to obtain at least one target heart state label determined by the target diagnosis neural network model from multiple pre-calibrated heart state labels based on the target electrocardiogram data, and the at least one target heart state label is used to characterize the actual heart state of the patient to be diagnosed.
[0126] At least one target cardiac state label may be represented as an output vector, and when a label among LVH (left ventricular hypertrophy), LVD (left ventricular dilatation), RVH (right ventricular hypertrophy), RVD (right ventricular dilatation), LAE (left atrial enlargement), and RAE (right atrial enlargement) is selected, the corresponding output is 1, and when it is not selected, the corresponding output is 0. For example, if the target cardiac state labels corresponding to the target electrocardiogram data include LVH (left ventricular hypertrophy), LVD (left ventricular dilatation), and RVH (right ventricular hypertrophy), then LVH (left ventricular hypertrophy), LVD (left ventricular dilatation), and RVH (right ventricular hypertrophy) respectively output corresponding 1, and RVD (right ventricular dilatation), LAE (left atrial enlargement), and RAE (right atrial enlargement) respectively output corresponding 0.
[0127] In summary, this embodiment collects target electrocardiogram data of the patient to be diagnosed; then, according to the actual number of leads corresponding to the target electrocardiogram data, selects a target diagnostic neural network model that matches the actual number of leads from a plurality of pre-trained standard diagnostic neural network models; inputs the target electrocardiogram data into the target diagnostic neural network model, and obtains at least one target heart state label determined by the target diagnostic neural network model from a plurality of pre-calibrated heart state labels according to the target electrocardiogram data, and the at least one target heart state label is used to characterize the actual heart state of the patient to be diagnosed. It can be seen that this embodiment can rely on the neural network model to automatically analyze the electrocardiogram data, greatly improving the efficiency of electrocardiogram data analysis; and avoids the phenomenon that there are differences in electrocardiogram analysis results caused by different experiences of different doctors, and improves the accuracy of electrocardiogram data analysis. In addition, this embodiment relies on the neural network model to automatically analyze the electrocardiogram data, and can timely detect the state of cardiac hypertrophy, dilation and enlargement through the electrocardiogram, which can timely detect the pathological state of cardiac hypertrophy, dilation and enlargement before the symptoms of heart failure, sudden death and arrhythmia occur, so that more patients can be diagnosed in time.
[0128] The diagnostic neural network model provided in this embodiment analyzes the electrocardiogram data of multiple patients to be diagnosed, and the analysis results are basically consistent with the results in relevant research reports.
[0129] For example, Figure 7As shown, in terms of etiology, congenital cardiovascular disease ranked first in RVH (right ventricular hypertrophy) or / and RVD (right ventricular dilatation) (28.1%) and RAE (right atrial enlargement) (15.1%), hypertension ranked first in LVH (left ventricular hypertrophy) or / and LVD (left ventricular dilatation) (5.5%), valvular disease ranked first in LAE (left atrial enlargement) (7.9%), and hypertension ranked second in LAE (left atrial enlargement) (5.4%).
[0130] Regarding comorbidities, coronary artery disease was most prevalent in LVH (left ventricular hypertrophy) and / or LVD (left ventricular dilatation) (6.8%), RVH (right ventricular hypertrophy) and / or RVD (right ventricular dilatation) (5.7%), and LAE (left atrial enlargement) (13.9%), and atrial fibrillation ranked first in RAE (right atrial enlargement) (8.4%). In addition, 24,933 / 80,007 (31.2%) patients had LVH (left ventricular hypertrophy) or / and LVD (left ventricular dilatation), which is consistent with the range reported in these studies.
[0131] High multi-label rates of LVH (left ventricular hypertrophy) or / and LVD (left ventricular dilatation), RVH (right ventricular hypertrophy) or / and RVD (right ventricular dilatation), LAE (left atrial enlargement), and RAE (right atrial enlargement). According to the echocardiographic results, all electrocardiograms (ECGs) were classified into five specific categories: normal, LVH (left ventricular hypertrophy) or / and LVD (left ventricular dilatation), RVH (right ventricular hypertrophy) or / and RVD (right ventricular dilatation), LAE (left atrial enlargement), and RAE (right atrial enlargement). After exclusion, RVH (right ventricular hypertrophy) or / and RVD (right ventricular dilatation), RAE (right atrial enlargement), LVH (left ventricular hypertrophy) or / and LVD (left ventricular dilatation), and LAE (left atrial enlargement) were analyzed, with 5,493, 11,023, 24,933, and 37,153 ECG samples, respectively ( Figure 7 B) Identify patients with (in addition to normal) at least one abnormality in the left atrium and / or right atrium and / or ventricle.
[0132] Overall, ECGs diagnosed with LAE (left atrial enlargement) accounted for almost 46% (37,153 / 80,007) of the total abnormal samples, while LVH (left ventricular hypertrophy) or / and LVD (left ventricular dilatation) accounted for almost 31% (24,933 / 80,007), indicating that most cardiac hypertrophy, dilatation, and enlargement occurred in the left atrium and ventricle. Figure 7B shows that RVH (right ventricular hypertrophy) or / and RVD (right ventricular dilatation) and RAE (right atrial enlargement) had high multi-label percentages, 98% and 75%, respectively, indicating that patients with RVH (right ventricular hypertrophy) or / and RVD (right ventricular dilatation) or RAE (right atrial enlargement) often also have functional abnormalities in other areas of the heart. The multi-label percentages of LVH (left ventricular hypertrophy) and LAE (left atrial enlargement) were relatively low (36% and 31%, respectively). In addition, the majority of RVH (right ventricular hypertrophy) abnormalities (94.8%; 5,209 / 5,493) were also diagnosed with RAE (right atrial enlargement), indicating that the enlargement of the right ventricle is highly correlated with the increase in the size of the right atrium. Such a high multi-label rate confirms the significantly high incidence of LVH (left ventricular hypertrophy) and / or LVD (left ventricular dilatation), RVH (right ventricular hypertrophy) and / or RVD (right ventricular dilatation), LAE (left atrial enlargement) and RAE (right atrial enlargement), complicates the training of the model, and improves the recognition accuracy of the diagnostic neural network model provided in this embodiment for electrocardiogram data.
[0133] In addition, electrocardiogram (ECG), as the most basic technology for detecting heart diseases, is used as an auxiliary tool for detecting cardiac hypertrophy, dilatation and enlargement. Unlike abnormal heart rhythm (such as regular / irregular rhythm, sinus / ectopic) and abnormal heart rate (too slow / too fast), ECG indicators of atrial enlargement and ventricular hypertrophy / dilatation are more complex. Cardiac hypertrophy, dilatation and enlargement change the ECG waveform in many ways, including the growth or increase in amplitude of P wave and QRS wave, changes in ST segment and T wave, pathological deep and narrow Q wave, and conduction abnormalities such as bundle branch block. Multiple criteria have been proposed to describe different locations of hypertrophy / dilatation, including left ventricular hypertrophy and dilatation (LVH (left ventricular hypertrophy) or / and LVD (left ventricular dilatation)), right ventricular hypertrophy and dilatation (RVH (right ventricular hypertrophy) or / and RVD (right ventricular dilatation)), right atrial enlargement (RAE (right atrial enlargement)) and left atrial enlargement (LAE (left atrial enlargement)), which are mainly established through linear or simple nonlinear combinations of different amplitudes and complex intervals, but are generally insufficient worldwide due to insufficient sensitivity or / and specificity scores. The diagnostic neural network model provided in this embodiment can accurately identify various types of waveform abnormalities in the electrocardiogram, convert the ECG into a screening tool and predictor for cardiac and non-cardiac diseases, and provide a feasible solution for identifying potential patterns of cardiac hypertrophy, dilatation and enlargement, thereby improving the accuracy of electrocardiogram analysis.
[0134] Based on the same inventive concept, this embodiment provides Figure 8 A heart state detection device is shown, the device comprising:
[0135] A data acquisition module 81 is used to acquire target electrocardiogram data of a patient to be diagnosed;
[0136] A model determination module 82, for selecting a target diagnostic neural network model that matches the actual number of leads from a plurality of pre-trained standard diagnostic neural network models according to the actual number of leads corresponding to the target electrocardiogram data;
[0137] The model diagnosis module 83 is used to input the target electrocardiogram data into the target diagnosis neural network model to obtain at least one target heart state label determined by the target diagnosis neural network model from multiple pre-calibrated heart state labels based on the target electrocardiogram data, and the at least one target heart state label is used to characterize the actual heart state of the patient to be diagnosed.
[0138] Further, the plurality of cardiac status labels include at least one of a normal status label, a left ventricular hypertrophy status label, a left ventricular dilation status label, a right ventricular hypertrophy status label, a right ventricular dilation status label, a left atrial enlargement status label, and a right atrial enlargement status label.
[0139] Furthermore, the device also includes a model training module, which is used to:
[0140] Before selecting a target diagnostic neural network model that matches the actual number of leads from a plurality of pre-trained standard diagnostic neural network models according to the actual number of leads corresponding to the target electrocardiogram data, obtaining historical electrocardiogram data and historical echocardiogram data corresponding to a plurality of historically diagnosed patients respectively; the number of leads of the historical electrocardiogram data corresponds to the preset number of leads, and the leads of the historical electrocardiogram data corresponding to each historically diagnosed patient are the same;
[0141] According to the historical echocardiogram of each historically diagnosed patient, a corresponding historical status label is obtained, and the historical status label corresponding to each historically diagnosed patient corresponds to the historical electrocardiogram data;
[0142] The pre-constructed initial diagnostic neural network model is trained according to the historical electrocardiogram data, historical status labels and preset multiple model training indicators corresponding to each historically diagnosed patient, and a standard diagnostic neural network model corresponding to the preset number of leads is obtained, wherein the cost function between the predicted status label and the historical status label output by the standard diagnostic neural network model is minimized.
[0143] Furthermore, the device also includes a model training module, which is used to:
[0144] The preset number of leads is set to 12, and a 12-lead standard diagnostic neural network model corresponding to the number of 12 leads is obtained;
[0145] The aggregate attribution score of the expected gradient corresponding to each of the 12 leads output by the 12-lead standard diagnostic neural network model;
[0146] The first N leads with the largest aggregate attribution scores among the 12 leads are taken as equivalent leads; N is a positive integer less than 12;
[0147] The preset number of leads is set to N, and an N-lead standard diagnostic neural network model corresponding to the N equivalent leads is obtained.
[0148] Further, when N is 4, the 4 equivalent leads include I, aVR, V1 and V5.
[0149] Furthermore, the device also includes a model training module, which is used to:
[0150] Before training the pre-built initial diagnosis neural network model according to the historical electrocardiogram data, historical status labels and preset multiple model training indicators corresponding to each historically diagnosed patient to obtain a standard diagnosis neural network model corresponding to the preset number of leads, the method further includes:
[0151] Constructing an initial diagnosis neural network model, the initial diagnosis neural network model includes a one-dimensional embedding module, a one-dimensional correlation module, an image conversion module, a two-dimensional embedding module, a two-dimensional correlation module and a multi-label diagnosis module, the one-dimensional embedding module is connected to the one-dimensional correlation module, the one-dimensional correlation module is connected to the multi-label diagnosis module, the image conversion module, the two-dimensional embedding module and the two-dimensional correlation module are connected in sequence, and the two-dimensional correlation module is connected to the multi-label diagnosis module;
[0152] The one-dimensional embedding module is used to receive the one-dimensional amplitude data of the electrocardiogram and determine the one-dimensional amplitude feature;
[0153] The one-dimensional correlation module is used to receive the one-dimensional amplitude features output by the one-dimensional embedding module, and determine the one-dimensional mutual dependence between different channels and spatial positions of the potential features according to the one-dimensional amplitude features;
[0154] The image conversion module is used to convert the electrocardiogram into a two-dimensional image;
[0155] The two-dimensional embedding module is used to receive the two-dimensional image output by the image conversion module and determine the two-dimensional image features according to the two-dimensional image;
[0156] The two-dimensional correlation module is used to receive the two-dimensional image features output by the two-dimensional embedding module, and determine the two-dimensional mutual dependence between different channels and spatial positions of the potential features according to the two-dimensional image features;
[0157] The multi-label diagnosis module is used to receive the one-dimensional interdependence output by the one-dimensional correlation module and the two-dimensional interdependence output by the two-dimensional correlation module, and output a state label corresponding to the electrocardiogram according to the one-dimensional interdependence and the two-dimensional interdependence.
[0158] Furthermore, the multiple model training indicators include at least one indicator among subset accuracy, Hamming loss, average F1 score, average recall rate and average precision.
[0159] Based on the same inventive concept, this embodiment provides Fig. 9 An electronic device as shown includes:
[0160] Processor 91;
[0161] A memory 92 for storing instructions executable by the processor 91;
[0162] The processor 91 is configured to execute to implement a heart state detection method as provided above.
[0163] Based on the same inventive concept, this embodiment provides a non-temporary computer-readable storage medium. When the instructions in the storage medium are executed by the processor 91 of the electronic device, the electronic device can execute a heart state detection method as provided above.
[0164] Since the electronic device introduced in this embodiment is an electronic device used to implement the information processing method in the embodiment of the present application, based on the information processing method introduced in the embodiment of the present application, a person skilled in the art can understand the specific implementation of the electronic device of the present embodiment and its various variations, so how the electronic device implements the method in the embodiment of the present application is not described in detail here. As long as a person skilled in the art implements the electronic device used by the information processing method in the embodiment of the present application, it belongs to the scope of protection of this application.
[0165] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0166] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0167] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0168] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0169] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0170] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A heart state detection method, characterized in that: The method comprises: Collect target electrocardiogram data of the patient to be diagnosed; According to the actual number of leads corresponding to the target electrocardiogram data, selecting a target diagnostic neural network model that matches the actual number of leads from a plurality of pre-trained standard diagnostic neural network models; The target electrocardiogram data is input into the target diagnosis neural network model to obtain at least one target heart state label determined by the target diagnosis neural network model from a plurality of pre-calibrated heart state labels based on the target electrocardiogram data, wherein the at least one target heart state label is used to characterize the actual heart state of the patient to be diagnosed.
2. The method according to claim 1, characterized in that The multiple heart state labels include at least one of a normal state label, a left ventricular hypertrophy state label, a left ventricular dilation state label, a right ventricular hypertrophy state label, a right ventricular dilation state label, a left atrial enlargement state label, and a right atrial enlargement state label.
3. The method according to claim 1, characterized in that Before selecting a target diagnostic neural network model that matches the actual number of leads corresponding to the target electrocardiogram data from a plurality of pre-trained standard diagnostic neural network models, the method further includes: Acquire historical electrocardiogram data and historical echocardiogram data corresponding to a plurality of historically diagnosed patients respectively; the number of leads of the historical electrocardiogram data corresponds to a preset number of leads, and the leads of the historical electrocardiogram data corresponding to each historically diagnosed patient are the same; Obtaining corresponding historical status labels according to the historical echocardiograms of the historically diagnosed patients, wherein the historical status labels corresponding to the historically diagnosed patients correspond to the historical electrocardiogram data; The pre-constructed initial diagnostic neural network model is trained according to the historical electrocardiogram data corresponding to each of the historically diagnosed patients, the historical status labels, and a plurality of preset model training indicators to obtain the standard diagnostic neural network model corresponding to the preset number of leads, wherein the cost function between the predicted status label output by the standard diagnostic neural network model and the historical status label is minimized.
4. The method according to claim 3, characterized in that Before selecting a target diagnostic neural network model that matches the actual number of leads corresponding to the target electrocardiogram data from a plurality of pre-trained standard diagnostic neural network models, the method further includes: The preset number of leads is set to 12, and a 12-lead standard diagnostic neural network model corresponding to the number of 12 leads is obtained; The aggregate attribution score of the expected gradient corresponding to each of the 12 leads output by the 12-lead standard diagnostic neural network model; The first N leads with the largest aggregate attribution scores among the 12 leads are taken as equivalent leads; N is a positive integer less than 12; The preset number of leads is set to N, and an N-lead standard diagnostic neural network model corresponding to the N equivalent leads is obtained.
5. The method according to claim 4, characterized in that When N is 4, the 4 equivalent leads include I, aVR, V1 and V5.
6. The method according to claim 3, characterized in that Before training the pre-constructed initial diagnosis neural network model according to the historical electrocardiogram data, the historical status labels and the preset multiple model training indicators corresponding to each of the historically diagnosed patients to obtain the standard diagnosis neural network model corresponding to the preset number of leads, the method further includes: Constructing the initial diagnosis neural network model, the initial diagnosis neural network model includes a one-dimensional embedding module, a one-dimensional correlation module, an image conversion module, a two-dimensional embedding module, a two-dimensional correlation module and a multi-label diagnosis module, the one-dimensional embedding module is connected to the one-dimensional correlation module, the one-dimensional correlation module is connected to the multi-label diagnosis module, the image conversion module, the two-dimensional embedding module and the two-dimensional correlation module are connected in sequence, and the two-dimensional correlation module is connected to the multi-label diagnosis module; The one-dimensional embedding module is used to receive one-dimensional amplitude data of the electrocardiogram and determine one-dimensional amplitude characteristics; The one-dimensional correlation module is used to receive the one-dimensional amplitude feature output by the one-dimensional embedding module, and determine the one-dimensional mutual dependence between different channels and spatial positions of the potential feature according to the one-dimensional amplitude feature; The image conversion module is used to convert the electrocardiogram into a two-dimensional image; The two-dimensional embedding module is used to receive the two-dimensional image output by the image conversion module, and determine the two-dimensional image features according to the two-dimensional image; The two-dimensional correlation module is used to receive the two-dimensional image features output by the two-dimensional embedding module, and determine the two-dimensional mutual dependence relationship between different channels and spatial positions of potential features according to the two-dimensional image features; The multi-label diagnosis module is used to receive the one-dimensional interdependence output by the one-dimensional correlation module, and to receive the two-dimensional interdependence output by the two-dimensional correlation module, and to output a state label corresponding to the electrocardiogram according to the one-dimensional interdependence and the two-dimensional interdependence.
7. The method according to claim 3, characterized in that The multiple model training indicators include at least one indicator among subset accuracy, Hamming loss, average F1 score, average recall rate and average precision.
8. A heart state detection device, characterized in that: The device comprises: A data acquisition module, used for acquiring target electrocardiogram data of the patient to be diagnosed; A model determination module, configured to select, according to the actual number of leads corresponding to the target electrocardiogram data, a target diagnostic neural network model that matches the actual number of leads from a plurality of pre-trained standard diagnostic neural network models; The model diagnosis module is used to input the target electrocardiogram data into the target diagnosis neural network model to obtain at least one target heart state label determined by the target diagnosis neural network model from a plurality of pre-calibrated heart state labels based on the target electrocardiogram data, wherein the at least one target heart state label is used to characterize the actual heart state of the patient to be diagnosed.
9. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute to implement a heart state detection method as described in any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to implement a heart state detection method as described in any one of claims 1 to 7.
