Method of training deep learning model to predict heart disease
A deep learning model for ECG data analysis addresses the limitations of statistical methods by enhancing the accuracy of cardiac disease risk prediction, facilitating early detection and efficient screening.
Patent Information
- Application Number
- JP2025107995
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-08-06
- Filing Date
- 2025-06-26
- Publication Date
- 2025-08-28
- Estimated Expiration
- 2044-08-21
AI Technical Summary
Existing electrocardiogram (ECG) devices are limited in their ability to predict or stratify the risk of future heart diseases, particularly arrhythmias like atrial fibrillation, due to reliance on statistical analysis that fails to capture nonlinear patterns and is affected by noise, leading to inaccurate risk assessment.
A deep learning model is developed to generate a cardiac disease prediction model using electrocardiogram data, involving preprocessing, self-supervised learning, clustering, and ensemble learning with HRV characteristic information and metadata to improve risk stratification.
The model enhances the accuracy of predicting cardiac diseases by extracting relevant features from ECG data, enabling early detection and reducing the time required for medical analysis, thus improving patient health outcomes and screening efficiency.
Smart Images

Figure 2025126288000001_ABST
Abstract
Description
[Technical Field]
[0001] Various embodiments of the present invention relate to a method for providing a neural network model for predicting future cardiac disease in a patient, and more particularly to a technique for assessing and predicting the risk of arrhythmias, including atrial fibrillation, and other cardiac diseases based on electrocardiogram data using a deep learning model. [Background technology]
[0002] Electrocardiogram (ECG) data is widely used as an important tool for diagnosing cardiac conditions by recording the electrical activity of the heart. Existing multi-lead electrocardiograms (ECGs) detect abnormalities in the heart's rhythm and electrical conduction, playing a key role in diagnosing cardiac diseases such as arrhythmias, particularly atrial fibrillation. Arrhythmias, including atrial fibrillation, are common disorders characterized by irregular or abnormal heartbeats. They often exhibit asymptomatic or mild symptoms and are difficult to detect without appropriate screening. If left untreated, these arrhythmias can lead to serious health complications, such as stroke, heart failure, and sudden cardiac death. Atrial fibrillation, in particular, is a critical type of arrhythmia because it is associated with an increased risk of stroke and heart failure. Therefore, early detection and intervention of atrial fibrillation and arrhythmias are crucial for the effective management of these diseases. On the other hand, existing electrocardiogram devices mainly focus on diagnosis and are limited in their ability to predict or stratify the risk of future heart disease. This is because existing electrocardiogram analysis methods mainly rely on statistical analysis. Statistical methodologies do not adequately reflect nonlinear and complex patterns, making it difficult to accurately evaluate a patient's individual cardiac condition and risk of various arrhythmias. Furthermore, statistical-based models perform poorly compared to deep learning-based probabilistic models when processing large amounts of data. Electrocardiogram data can be affected by overlapping signals, such as muscle movement, breathing, and electrical noise from other equipment. These external factors can reduce the accuracy of statistical methodologies, resulting in significant obstacles to accurately stratifying and quantifying heart disease risk. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] Korean Patent Publication No. 10-2022-0104583 Summary of the Invention [Problem to be solved by the invention]
[0004] The problem to be solved by the present invention has been devised in response to the above-mentioned background technology, and is to provide a technology that can predict and stratify future risks of heart disease based on electrocardiogram data. The problems to be solved by the present invention are not limited to those mentioned above, and other problems not mentioned above will be clearly understood by those skilled in the art from the following description. [Means for solving the problem]
[0005] In order to solve the above problem, a method for generating a cardiac disease prediction model according to one embodiment of the present invention is disclosed, which includes the steps of acquiring a plurality of electrocardiogram data and generating a model for cardiac disease prediction based on the plurality of electrocardiogram data. In an alternative embodiment, the step of generating a model for cardiac disease prediction includes the steps of: constructing a training dataset based on the plurality of electrocardiogram data; and generating a cardiac disease risk prediction model by training one or more network functions based on the training dataset, wherein the training dataset includes a first training dataset and a second training dataset classified for different learning purposes, and the cardiac disease risk prediction model may provide hierarchical prediction information regarding future cardiac disease risk based on the patient's electrocardiogram data. In an alternative embodiment, the first training data set may include data for training corresponding to a process of transforming features of electrocardiogram data into a feature space, and the second training data set may include data for calibration related to cardiac risk prediction. In an alternative embodiment, the step of constructing the training dataset includes a step of preprocessing the plurality of electrocardiogram data, the preprocessing step including a step of performing noise preprocessing on the plurality of electrocardiogram data, a step of dividing the noise-preprocessed plurality of electrocardiogram data into a predetermined window size to generate a plurality of ROI signals, and a step of extracting HRV characteristic information on a lead-by-lead basis from the plurality of electrocardiogram data, wherein the HRV characteristic information may include index information related to beat-to-beat variability. In an alternative embodiment, the step of generating the heart disease risk prediction model may include the steps of: generating an embedding model through masking-based self-supervised learning using the first training data set; using the embedding model to extract latent vectors corresponding to each of a plurality of ROI signals corresponding to the second training data set; performing clustering on the latent vectors using a clustering model; and constructing a vector database (DB, Database) based on information on the latent vectors and each cluster corresponding to each latent vector. In an alternative embodiment, the step of generating the embedded model includes the steps of: processing data included in the first training dataset as input to a self-reconstruction model, and inducing self-supervised learning so that the self-reconstruction model generates output similar to the input data; and extracting an encoder from the self-reconstruction model after the training is completed to generate the embedded model, wherein the self-reconstruction model is a neural network model that masks a portion of the input data and restores the masked portion, and may include a dimensionality reduction network function and a dimensionality restoration network function. In an alternative embodiment, the clustering model may perform clustering based on a similarity distance between latent vectors corresponding to each of the plurality of ROI signals, and the step of performing the clustering may include a step of extracting a representative vector for each of a plurality of clusters corresponding to the clustering result. In an alternative embodiment, the method may include the steps of acquiring electrocardiogram data of the subject to be predicted, performing preprocessing on the electrocardiogram data of the subject to be predicted, generating a plurality of latent vectors corresponding to the electrocardiogram data after the preprocessing using the embedding model, comparing each of the plurality of latent vectors with a respective representative vector corresponding to each of the plurality of clusters, and classifying each of the plurality of latent vectors into one of the plurality of clusters, and generating stratification information regarding the risk of heart disease based on the classification result in which each of the plurality of latent vectors is classified into the plurality of clusters. In an alternative embodiment, the step of generating the heart disease risk prediction model may include the steps of acquiring user meta-information corresponding to each of the plurality of electrocardiogram data; acquiring the plurality of latent vectors and cluster information corresponding to the plurality of latent vectors from the vector database; and performing ensemble learning to train a plurality of tree models based on the HRV characteristic information, the user meta-information, the plurality of latent vectors, and the cluster information corresponding to the latent vectors, and integrating the outputs of each tree model to generate the heart disease risk prediction model. In an alternative embodiment, the step of generating a model for cardiac disease prediction may further include the steps of classifying the acquired plurality of electrocardiogram data into a training dataset, a validation dataset, and a test dataset; acquiring ROI electrocardiogram data divided into a predetermined window size from each of the electrocardiogram data classified into the training dataset, the validation dataset, and the test dataset; training the deep learning model to predict cardiac disease classes for each of the first ROI electrocardiogram data in response to inputting first ROI electrocardiogram data acquired from the electrocardiogram data included in the training dataset into a deep learning model for predicting cardiac disease in a patient; and applying second ROI electrocardiogram data acquired from the electrocardiogram data included in the validation dataset to the trained deep learning model to determine a threshold for classifying the cardiac disease classes. In an alternative embodiment, the determining step may include the steps of collecting probability scores for each of the ROI electrocardiogram data separated from the same electrocardiogram data for each of the second ROI electrocardiogram data, averaging the probability scores for each of the collected second ROI electrocardiogram data to derive a final probability score, and fine-tuning a threshold for classifying the cardiac disease class based on the derived final probability score. In an alternative embodiment, the determined threshold value can be stored along with the weights of the deep learning model.
[0006] According to another embodiment of the present invention, a server for performing the method for generating a cardiac disease prediction model is disclosed, the server including a memory for storing one or more instructions and a processor for executing the one or more instructions stored in the memory, the processor executing the one or more instructions to perform the method for generating a cardiac disease prediction model. According to another embodiment of the present invention, there is disclosed a computer program stored on a computer-readable recording medium, the computer program being coupled to a computer as hardware and capable of performing the method for generating a cardiac disease prediction model. Other details of the invention are included in the detailed description and drawings. [Effects of the Invention]
[0007] According to various embodiments of the present invention, the accuracy of predicting cardiac disease in a patient can be improved by extracting ROI electrocardiogram data from the patient's electrocardiogram data and applying the extracted ROI electrocardiogram data to a deep learning model. Furthermore, the present invention can provide the effect of enabling patients to understand their own health status and prevent heart disease by predicting future heart disease risks using multiple machine learning models, thereby enabling early detection and rapid response to heart disease, providing an opportunity to protect patients' lives and improve treatment outcomes. In addition, the present invention significantly reduces the physical time required by medical staff to analyze ECG data one by one through an automated AI-based processing process, thereby improving screening efficiency and reducing opportunity costs in the medical field. In addition, the present invention can further improve the accuracy of predicting heart disease risk by using multiple tree-based machine learning models to ensemble HRV characteristic information, latent vectors extracted from the embedding model, and metadata such as patient age. The effects of the present invention are not limited to those described above, and other effects not described above will be clearly understood by those skilled in the art from the following description. [Brief explanation of the drawings]
[0008] [Figure 1] FIG. 1 is a block diagram of a computing device that performs a method for generating a heart disease prediction model according to an embodiment of the present invention. [Figure 2] 1 is a flowchart illustrating a method for training a deep learning model for predicting heart disease according to an embodiment of the present invention. [Figure 3] FIG. 2 is a diagram illustrating a method for classifying electrocardiogram data according to an embodiment of the present invention. [Figure 4] FIG. 2 illustrates a method for segmenting electrocardiogram data into individual heart beats according to an embodiment of the present invention. [Figure 5a] FIG. 1 illustrates types of deep learning models according to an embodiment of the present invention. [Figure 5b] FIG. 1 illustrates types of deep learning models according to an embodiment of the present invention. [Figure 5c] FIG. 1 illustrates types of deep learning models according to an embodiment of the present invention. [Figure 6] FIG. 1 illustrates the training steps of a deep learning model according to an embodiment of the present invention. [Figure 7] 1 is a flowchart illustrating a method for predicting heart disease using a trained deep learning model according to an embodiment of the present invention. [Figure 8] FIG. 1 illustrates the steps of heart disease prediction using a deep learning model according to one embodiment of the present invention. [Figure 9]1 is an exemplary flowchart of a method for generating a cardiac disease prediction model according to an embodiment of the present invention. [Figure 10] 1 is a flowchart illustrating an example of a pre-processing process for a plurality of electrocardiogram data according to an embodiment of the present invention. [Figure 11] 10 is a flowchart illustrating an example process of embedding a latent vector and constructing a vector database based on the embedding result according to an embodiment of the present invention. [Figure 12] 1 is a flowchart illustrating an exemplary process for generating an embedded model according to an embodiment of the present invention. [Figure 13] 1 is an exemplary diagram illustrating a self-reconfiguration model according to an embodiment of the present invention, and a process of generating an embedded model from the trained self-reconfiguration model; [Figure 14] 1 is an exemplary flowchart illustrating a process of generating a heart disease risk prediction model through ensemble learning of multiple tree-series models according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE INVENTION
[0009] Specific structural or functional descriptions of the embodiments are disclosed for illustrative purposes only and can be modified and implemented in various forms. Therefore, the actual implementation is not limited to the specific embodiments disclosed, and the scope of this specification includes modifications, equivalents, or alternatives included in the technical ideas described in the embodiments. Although terms such as first or second may be used to describe various components, these terms should be construed only to distinguish one component from another. For example, a first component may be termed a second component, and similarly, a second component may be termed a first component. When a component is described as being "coupled" to another component, it should be understood that the component may be directly coupled or connected to the other component, or there may be other components intervening therebetween. The singular includes the plural unless the context clearly dictates otherwise. In this document, each of the phrases "A or B," "at least one of A and B," "at least one of A or B," "A, B or C," "at least one of A, B and C," and "at least one of A, B, or C" can include any of the items listed together with that phrase, or all possible combinations thereof. In this specification, terms such as "comprise" or "have" specify the presence of stated features, numbers, steps, operations, components, parts, or combinations thereof, but should be understood not to preclude the presence or addition of one or more other features, numbers, steps, operations, components, parts, or combinations thereof. Unless otherwise defined, all terms used herein, including technical or scientific terms, have the same meaning as commonly understood by a person of ordinary skill in the art. Terms defined in commonly used dictionaries should be interpreted to have a meaning consistent with the contextual meaning of the relevant art, and should not be interpreted in an idealized or overly formal sense unless expressly defined herein. Hereinafter, embodiments will be described in detail with reference to the accompanying drawings. In the description with reference to the accompanying drawings, the same components are denoted by the same reference numerals regardless of the reference numerals, and redundant description thereof will be omitted. The present invention can acquire multiple electrocardiogram data corresponding to multiple patients and generate a model for predicting heart disease based on the acquired multiple electrocardiogram data. In an embodiment, the model for predicting heart disease can be a neural network model that extracts important patterns and features from the electrocardiogram data and predicts the likelihood of heart disease based on the extracted patterns and features. A computing device of the present invention processes the multiple electrocardiogram data into a form suitable for learning and uses the processed data to train the model for predicting heart disease. According to one embodiment, the present invention may generate and provide a deep learning model and a heart disease risk prediction model as models for predicting heart disease. In an embodiment, the present invention may process a plurality of electrocardiogram data into various forms and train neural networks in different ways to generate and provide various prediction models. Hereinafter, a method for generating a model for predicting heart disease will be described in detail with reference to various drawings.
[0010] FIG. 1 is a diagram illustrating the configuration of a computing device that performs a method for generating a heart disease prediction model according to an embodiment of the present invention. As shown in Fig. 1, computing device 100 may include one or more processors 110 and memory 120 for loading or storing programs 130 executed by processor 110. The components included in computing device 100 in Fig. 1 are merely examples, and those skilled in the art will appreciate that other general-purpose components may be included in addition to the components shown in Fig. 1. The processor 110 controls the overall operation of each component of the computing device 100. The processor 110 may include at least one of a central processing unit (CPU), a microprocessor unit (MPU), a microcontroller unit (MCU), a graphic processing unit (GPU), a neural processing unit (NPU), a digital signal processor (DSP), or any other type of processor well known in the art. The processor 110 may also perform calculations for at least one application or program for executing methods / operations according to various embodiments of the present invention. The computing device 100 may include one or more processors. Memory 120 stores one or more combinations of various data, instructions, and information used by components (e.g., processor 110) included in computing device 100. Memory 120 may include volatile memory and / or non-volatile memory. The program 130 may include one or more actions that realize methods / operations according to various embodiments of the present invention and may be stored in the memory 120 in the form of software. Here, the actions correspond to instructions implemented by the program 130. For example, the program 130 may include instructions to perform the following operations: classifying electrocardiogram data acquired from a plurality of patients into a training dataset, a validation dataset, and a test dataset; acquiring ROI electrocardiogram data divided into a predetermined window size from each of the electrocardiogram data classified into the training dataset, the validation dataset, and the test dataset; training the deep learning model to predict each cardiac disease class of the first ROI electrocardiogram data in response to inputting first ROI electrocardiogram data acquired from the electrocardiogram data included in the training dataset into a deep learning model for predicting cardiac disease in patients; and applying second ROI electrocardiogram data acquired from the electrocardiogram data included in the validation dataset to the trained deep learning model to determine a threshold for classifying cardiac disease classes. According to an embodiment, ROI electrocardiogram data divided into a predetermined window size may represent, but is not limited to, an individual heartbeat. Hereinafter, for convenience of explanation, according to an embodiment, ROI electrocardiogram data divided into a predetermined window size may be described as an individual heartbeat, but the type of ROI electrocardiogram data applied to each embodiment is not limited thereto.
[0011] When the program 130 is loaded into the memory 120, the processor 110 executes a number of operations to implement the program 130, thereby performing the methods / operations according to various embodiments of the present invention. An execution screen of the program 130 may be displayed via the display 140. In the case of FIG. 1, the display 140 is shown as a separate device connected to the computing device 100, but in the case of the computing device 100 being a terminal that can be carried by a user, such as a smartphone or a tablet, the display 140 may be a component of the computing device 100. The screen displayed on the display 140 may be a screen before information is input into the program or a result of the execution of the program. FIG. 2 is a flowchart illustrating a method for training a deep learning model for predicting heart disease according to one embodiment of the present invention. The deep learning model training method shown in FIG. 2 is performed by the processor of the computing device shown in FIG. 1. In step 210, the processor may classify electrocardiogram data acquired from a plurality of patients into a training data set, a validation data set, and a test data set. First, the electrocardiogram data acquired from a plurality of patients may be classified into groups of true-normal sinus rhythm (T-NSR), atrial fibrillation-normal sinus rhythm (AF-NSR), and clinically important arrhythmia-normal sinus rhythm (CIA-NSR). In this case, the electrocardiogram data acquired from a plurality of patients may be 10-second, 12-lead electrocardiogram data, but this type of electrocardiogram data is merely an example and is not limited to the above example.
[0012] On the other hand, clinically important arrhythmia (CIA) can include atrial arrhythmia, ventricular arrhythmia, atrial fibrillation, and bundle branch block (BBB). Atrial arrhythmia is an arrhythmia originating from the atria, and refers to a sustained arrhythmia lasting 30 seconds or more or a non-sustained arrhythmia lasting less than 30 seconds, and can include atrial premature complex, sustained / non-sustained atrial rhythm, etc. Ventricular arrhythmia is an arrhythmia originating from the ventricles, and refers to a sustained arrhythmia lasting 30 seconds or more or a non-sustained arrhythmia lasting less than 30 seconds, and can include ventricular premature complex, sustained / non-sustained ventricular arrhythmia, etc. Atrial fibrillation can refer to an arrhythmia that lacks regular electrical signals and contractions of the atria, resulting in irregular ventricular contractions. Finally, BBB can refer to arrhythmias that occur when the right or left bundle branch, which transmit cardiac impulses through the ventricles, is blocked, resulting in characteristic electrocardiographic patterns. The T-NSR group can consist of ECGs from patients with no history of atrial fibrillation or arrhythmia and at least three normal sinus rhythm ECGs per year. The AF-NSR group can consist of ECGs from patients with a normal sinus rhythm ECG paired with an atrial fibrillation or atrial flutter ECG that occurred within 14 days of the normal sinus rhythm ECG. Similarly, the CIA-NSR group can consist of ECGs from patients with a normal sinus rhythm ECG paired with an arrhythmia ECG that occurred within 14 days of the normal sinus rhythm ECG. The processor can classify the electrocardiogram data belonging to the thus-separated T-NSR group, AF-NSR group, and CIA-NSR group into a training dataset, a validation dataset, and a test dataset that can be applied to a deep learning model for predicting heart disease. 3 is a diagram illustrating a method for classifying electrocardiogram data according to an embodiment of the present invention. The processor may classify electrocardiogram data 310 belonging to a T-NSR group, an AF-NSR group, and a CIA-NSR group according to the cardiac disease to be predicted. For example, the processor may classify the electrocardiogram data 310 into electrocardiogram data 320 belonging to the T-NSR group and the AF-NSR group for predicting atrial fibrillation, and electrocardiogram data 330 belonging to the T-NSR group and the CIA-NSR group for predicting arrhythmia.
[0013] The processor can then classify the electrocardiogram data 320, 330 classified by each cardiac disease into a training data set, a validation data set, and a test data set based on any date on which the electrocardiogram data 320, 330 was generated. 3, if the electrocardiogram data 320, 330 were acquired between May 23, 2017 and May 23, 2022, the processor can classify the electrocardiogram data 320, 330 based on an arbitrary date (e.g., June 11, 2021) into a training data set and a validation data set at a certain ratio, and classify the electrocardiogram data after (including) the arbitrary date into a test data set. In the example of FIG. 3, the electrocardiogram data 320, 330 are classified into a training data set (60%), a validation data set (20%), and a test data set (20%). However, such classification ratios are merely illustrative and are not limited to the above example. In step 220, the processor can obtain individual heart beats from each of the electrocardiogram data classified into the training data set, the validation data set, and the test data set. The processor can perform pre-processing on the 10-second 12-lead electrocardiogram data classified into the training data set, the validation data set, and the test data set to obtain accurate and reliable data. More specifically, the processor can receive input electrocardiogram data classified into a training dataset, a validation dataset, and a test dataset in an extensible markup language (XML) file format. The processor can parse the input data into structured data portions, such as the patient's name, age, and gender, and unstructured data portions consisting of continuous signals. The processor can then perform pre-processing to remove noise from the unstructured data portions consisting of continuous signals and classify key markers of heart beats. The processor can obtain discrete individual heart beats from the unstructured data consisting of continuous signals through the key markers of heart beats thus classified. 4, the processor may decode 10-second, 12-lead electrocardiogram data using Base64 encryption, then pass it through an IIR Butterworth SOS filter with a moving average kernel and a power line noise filter for noise removal and cleansing. The processor may then segment the denoised 10-second, 12-lead electrocardiogram data into individual heart beats using a QRS peak detection algorithm. As a result, the processor can obtain multiple discrete individual heart beats from a single 10-second 12-lead ECG data, as shown in FIG. 3, and the obtained individual heart beats can be used to train a deep learning model for more accurate cardiac disease prediction.
[0014] In step 230, in response to inputting first individual heart beats obtained from electrocardiogram data included in the training dataset into the deep learning model for predicting cardiac disease in the patient, the processor trains the deep learning model to predict a cardiac disease class for each of the first individual heart beats. At this time, the processor can train the deep learning model to predict the cardiac disease class of each first individual heart beat using one of ResNet-18, Conv1D including LSTM (Long Short-Term Memory), and Conv1D including a Transformer. As an example, ResNet-18, shown in Figure 5a, is a deep learning model that can extract essential features from inputs using convolutional operations such as those used in various convolutional neural networks (CNNs). To solve the vanishing gradient problem in CNN architectures, ResNet-18 can perform residual learning via skipped connections, in which input data skips multiple layers on the network and is directly connected to the output layer, as shown in Figure 5a. Because the ResNet-18 deep learning model requires a fixed-length input, the processor can fix the length of an individual heart beat to the average length of all individual heart beats. As an example, if the average length of all individual heart beats is 700, the processor can fix the length to 700 by slicing individual heart beats having a heart beat length longer than 700 and padding individual heart beats having a heart beat length shorter than 700 with zeros. As another example, Conv1D with LSTM, as shown in Figure 5b, can capture both local and long-range temporal patterns from sequential data. In this case, the Conv1D layer excels at detecting local temporal patterns, and the LSTM layer excels at modeling long-term dependencies. As another example, Conv1D with a transformer, as shown in Figure 5c, can capture both local patterns and global dependencies of the input data. In this case, the transformer layer is suitable for modeling global dependencies, while the Conv1D layer can be effective in detecting local patterns. Unlike ResNet-18, which has a fixed input length, Conv1D with a transformer has the advantage of being able to accommodate various input sizes. Meanwhile, FIG. 6 is a diagram illustrating the training steps of a deep learning model according to an embodiment of the present invention. Referring to FIG. 6, a processor may optimize parameters of a deep learning model using binary cross entropy with logarithmic loss and an AdamW optimizer with an initial learning rate of 0.0001. Here, the binary cross entropy is a loss function that reduces the difference between a predicted result in training of the deep learning model and an actual correct answer, and the AdamW optimizer is an algorithm involved in updating the actual deep learning model based on this loss function. The processor may obtain a probability value for each cardiac disease class of the first individual heartbeat in the range of 0 to 1 by applying a sigmoid function to the output of the deep learning model optimized by the binary cross entropy and the AdamW optimizer.
[0015] In step 240, the processor may apply the second individual cardiac rate obtained from the electrocardiogram data included in the validation dataset to the trained deep learning model to determine a threshold for distinguishing cardiac disease classes. More specifically, as shown in FIG. 6, the processor collects probability values for each individual heart beat separated from the same electrocardiogram data for each second individual heart beat, collects probability values for each of all collected second individual heart beats, averages the probability values for all collected second individual heart beats to derive a final probability score, and then fine-tunes the optimal threshold for classifying cardiac disease classes based on the derived final probability score. In this case, the optimal threshold can be obtained by applying a threshold between 0 and 1 in increments of 0.01 to achieve the highest F1 score in the validation dataset for the cardiac disease classes, i.e., the T-NSR and AF-NSR classes or the T-NSR and CIA-NSR classes. In this case, the F1 score can be defined as follows:
number
[0016] As an example, Figure 8 is a diagram illustrating a cardiac disease prediction step using a deep learning model according to an embodiment of the present invention. Referring to Figure 8, after loading the weights and thresholds of the trained deep learning model, the processor can derive a probability value for each individual cardiac beat. The processor can calculate the average value of all the derived probability values for each individual cardiac beat. As an example, if the T-NSR Logit value, which is the average of the probability values for determining T-NSR, is greater than the first threshold θ1, and the CA-NSR Logit value, which is the average of the probability values for determining CIA-NSR, is less than the second threshold θ2, the processor can determine that the patient's cardiac disease class is normal, i.e., T-NSR. Alternatively, when the T-NSR Logit value is greater than the first threshold θ1 and the CIA-NSR Logit value is greater than the second threshold θ2, the processor can compare the T-NSR Logit value with the CIA-NSR Logit value and select the greater value as the final prediction. As an example, when the CIA-NSR Logit value is greater than the T-NSR Logit value, the cardiac disease class of the patient can be determined to be CIA-NSR, which may cause arrhythmia. In addition, if the T-NSR Logit value is smaller than a first threshold θ1 and the CIA-NSR Logit value is smaller than a second threshold θ2, the processor can compare the T-NSR Logit value and the CIA-NSR Logit value and select the larger value as the final prediction. Finally, if the T-NSR Logit value is smaller than the first threshold θ1 and the CIA-NSR Logit value is greater than the second threshold θ2, the processor can determine that the patient's cardiac disease class is CIA-NSR, which may cause arrhythmia. These four methods for classifying cardiac disease classes can be similarly applied to classifying T-NSR and AF-NSR. Below, with reference to Figures 9 to 14, a method of using HRV characteristic information, latent vectors, cluster information corresponding to the latent vectors, and metadata according to one embodiment of the present invention, and a method of predicting heart disease by ensembling multiple tree model outputs will be specifically described.
[0017] FIG. 9 shows an exemplary flowchart of a method for generating a heart disease prediction model according to an embodiment of the present invention. According to one embodiment of the present invention, the method for generating a cardiac disease prediction model may include a step of acquiring a plurality of electrocardiogram data (S1000). According to an embodiment, multiple electrocardiogram data are acquired corresponding to multiple patients and can be collected in various ways. In one embodiment, electrocardiogram data in the present invention can refer to multi-lead electrocardiogram (ECG) data related to recording the electrical activity of the heart and assessing cardiac status. Multi-lead electrocardiogram data includes cardiac electrical signals obtained through various leads (i.e., leads), thereby providing comprehensive information on cardiac rhythm, electrical conduction status, and other cardiac functions. In some embodiments, the electrocardiogram data acquired from the multiple patients may include normal electrocardiogram data, electrocardiogram data related to arrhythmia, and electrocardiogram data for other cardiac conditions. In specific embodiments, the electrocardiogram data acquired from the multiple patients may be classified into groups of true-normal sinus rhythm (T-NSR), atrial fibrillation-normal sinus rhythm (AF-NSR), and clinically important arrhythmia-normal sinus rhythm (CIA-NSR). In this case, the electrocardiogram data acquired from the multiple patients may be 10-second 12-lead electrocardiogram data, but the type of electrocardiogram data is not limited to this example. In one embodiment, acquiring the plurality of electrocardiogram data may be receiving or loading data stored in memory 120. Acquiring the plurality of electrocardiogram data may be receiving or loading the plurality of electrocardiogram data from another storage medium, another computing device, or a separate processing module within the same computing device via wired or wireless communication. As an example, a user (e.g., a patient or a healthcare provider) may connect to computing device 100 through a user terminal, receive a user interface for predicting heart disease from computing device 100, and transfer the electrocardiogram data to computing device 100 by dragging and dropping the electrocardiogram data into the provided user interface.
[0018] According to various embodiments, the computing device 100 of the present invention can perform data augmentation on a plurality of acquired electrocardiogram data. Specifically, the computing device 100 can perform data augmentation using lead pairs to augment training data for training a neural network. More specifically, electrocardiogram data can be acquired lead by lead, for example, electrocardiogram data can be collected in various lead configurations, such as 1-lead, 3-lead, 12-lead, etc., which record electrical activity in different parts of the heart and are used to assess the overall cardiac condition. For example, a 12-lead signal can acquire many signals over a relatively short period of time, but the total amount of data can be limited. On the other hand, a 1-lead signal can be recorded for a longer period of time, but the variety of data is limited. When these two types of data are used together, a more accurate cardiac status assessment can be achieved, but in practice, the number of such data pairs may be insufficient. To solve this problem, the computing device 100 of the present invention can generate a reconstruction model that generates other lead data based on one lead data. The reconstruction model receives one-lead data as input and generates multi-lead data based on the input. This process expands the one-lead data to three-lead or more leads (12-lead), thereby enhancing the training data as if there were more lead data. Training the reconstruction model involves learning the correlation between one-read and multi-read data. To achieve this, the reconstruction model is trained using paired data containing both one-read and multi-read data. During the training process, the model learns how to reconstruct multi-read data from one-read data, learning the characteristics of the one-read data and the patterns of multi-read signals that can be inferred from them. After model training is complete, the reconstruction model can generate multi-read signals even with only one-read data, thereby compensating for the lack of actual multi-read data. This increases data diversity and improves the generalization performance of the model. The generated multi-read data (i.e., augmented multi-read data) can be used in neural network training together with the existing multi-read data to further train the model on various lead configurations and improve its predictive performance for various cardiac conditions. As a result, data augmentation using the reconstruction model substantially increases the amount of training data, improving the model's predictive accuracy and strengthening the reliability of the heart disease prediction model, thereby helping medical staff more accurately diagnose patients' health conditions and establish more effective treatment and prevention plans. According to one embodiment of the present invention, the method for generating a cardiac disease prediction model may include a step (S2000) of constructing a training dataset based on a plurality of electrocardiogram data. In one embodiment, constructing a training dataset through multiple electrocardiogram data is a process of collecting and organizing various data to learn important features and patterns of each electrocardiogram data, thereby generating a dataset containing various examples and patterns required for predicting heart disease.
[0019] According to an embodiment, the learning dataset of the present invention includes various data related to the prediction of heart disease, and may include a training dataset for training a neural network model, a validation dataset for evaluating and optimizing the performance of the model, and test data for evaluating the generalization performance of the model. In one embodiment, the training data set may include a first training data set and a second training data set classified for different training purposes. The first training data set and the second training data set may be classified for training different neural network models. The first training data set and the second training data set may be classified by the computing device 100. For example, a first training dataset may be used in the training process of an embedding model, where the dataset focuses on extracting and representing key features of electrocardiogram data, and a second training dataset may be used to train a model for predicting the risk of heart disease, where the dataset may be used for calibration and performance evaluation to improve the accuracy of the predictive model. Specifically, the first training dataset may include data for learning corresponding to the process of transforming electrocardiogram data characteristics into a feature space. The first training dataset is data for ECG representation learning and can be used to extract and embed various characteristics and patterns of electrocardiogram data signals. The second training dataset may include data for calibration related to cardiac risk prediction. That is, the second training dataset is data for correcting cardiac risk and can be used to more accurately predict the risk predicted by the model. According to an embodiment, the step of constructing the training dataset may include a step of performing pre-processing on the plurality of electrocardiogram data. FIG. 10 is a flowchart illustrating an example of a pre-processing process for a plurality of electrocardiogram data according to an embodiment of the present invention. 10, the preprocessing method for a plurality of electrocardiogram data may include the steps of: performing noise preprocessing on the plurality of electrocardiogram data (S2100); dividing the plurality of electrocardiogram data after the noise preprocessing into predetermined window sizes to obtain a plurality of ROI signals (S2200); and extracting HRV (Heart Rate Variability) characteristic information for each lead of the plurality of electrocardiogram data (S2300). In one embodiment, the HRV characteristic information may include index information related to beat-to-beat variability.
[0020] More specifically, first, preprocessing for noise removal is performed on the plurality of electrocardiogram data acquired in step S2100. Here, the preprocessing for noise removal includes low-pass filtering and noise removal, which is intended to remove baseline noise from the electrocardiogram signal. Specifically, low-pass filtering removes high-frequency components from the electrocardiogram data using a frequency band limiting method to increase signal purity, while noise removal utilizes a time series analysis technique to reduce unnecessary noise from the electrocardiogram data and more clearly define important signal components. These preprocessing steps minimize distortion of the electrocardiogram signal and contribute to improving signal quality for more accurate assessment of cardiac activity. Furthermore, according to an embodiment, the computing device 100 may perform data augmentation to increase the diversity and robustness of model training. The computing device 100 performs data augmentation by simulating various noise patterns, thereby enabling the model to learn and adapt to various noise conditions that may occur in a real environment. In a specific embodiment, in the process of preprocessing electrocardiogram data, various noises that may occur in actual electrocardiogram measurement environments, such as Gaussian noise, jitter noise, random time warping, scaling, amplitude modulation, and phase shifting, are artificially added to increase the dataset, thereby enabling the model to learn and adapt to noises that may occur in various environments. Such noise addition and removal processes have the advantage of improving data quality and improving the generalization performance of the model. Then, in step S2200, the noise-removed electrocardiogram data is divided into a predetermined window size and organized into multiple ROI signals. Depending on the embodiment, the ROI signal is defined as a range including at least 3 to 5 QRS complexes (heart beats) in a deformable window size unit that includes meaningful heart beats from each of the electrocardiogram data. In one embodiment, the QRS complex indicates ventricular depolarization during cardiac electrical activity and can contribute to identifying the start and end of a heart beat as a key feature in an electrocardiogram. For example, each ROI signal can be divided into 30-second to 1-minute units, which is useful for analyzing important patterns in the electrocardiogram signal and identifying regularities and abnormalities in heart beats. The computing device 100 extracts and organizes the ROI signals into data that can more accurately analyze key characteristics of the heartbeat, which plays an important role in identifying specific patterns and signs of abnormalities in the ECG signal and assessing the risk of heart disease. In addition, in step S2300, an HRV characteristic information extraction process is performed. HRV characteristic information is an index that measures periodic changes in heart rate over time and is an important signal characteristic that reflects cardiac activity. For example, the computing device 100 divides the electrocardiogram data into 30-second to 1-minute intervals to obtain multiple ROI signals, and extracts HRV characteristics corresponding to each ROI signal. This is to more accurately evaluate the overall cardiac activity by analyzing data over a longer time range than existing bit-by-bit analysis. The computing device 100 derives HRV characteristics from each ROI signal by a method such as frequency analysis or time domain analysis. In a specific embodiment, the computing device 100 may apply various analysis techniques to extract HRV characteristic information corresponding to each ROI signal. As a specific example, the computing device may extract HRV characteristic information through evaluation of high- and low-frequency components by spectral analysis and statistical analysis of NN intervals.
[0021] Spectral analysis evaluates heart rate variability in the frequency domain, with high-frequency components primarily reflecting parasympathetic nervous system activity, while low-frequency components indicate mixed sympathetic and parasympathetic nervous system activity. This is useful for understanding the balance of the autonomic nervous system. Statistical analysis of NN intervals evaluates the variability of heart rate intervals in the time domain to quantify cardiac autonomic nervous system activity. This may be an important indicator for assessing heart rate irregularities, stress responses, cardiac health, and more. In one embodiment, the HRV characteristic information extracted for each lead may include RMSSD (Root Mean Square of Successive Differences), SDNN (Standard Deviation of NN intervals), SDANN (Standard Deviation of Average NN intervals), etc. Specifically, RMSSD refers to the root mean square of the differences between successive heartbeat intervals and primarily reflects the influence of the parasympathetic nervous system. SDNN indicates the standard deviation of all normal heartbeat intervals and indicates the overall variability of the autonomic nervous system. SDANN measures the standard deviation of the average heartbeat intervals over a certain period to evaluate long-term heart rate variability. These indices play an important role in evaluating the activity of the cardiac autonomic nervous system and comprehensively analyzing cardiac health. That is, HRV characteristic information reflects various aspects of heart rate variability and can be used to evaluate heartbeat irregularity, autonomic nervous system activity, etc., and can serve as a basis for predicting the risk of heart disease. According to one embodiment of the present invention, a method for generating a heart disease prediction model may include a step (S3000) of generating a heart disease risk prediction model by training one or more network functions based on a training dataset. FIG. 11 is a flowchart illustrating an example process of embedding a latent vector and constructing a vector database based on the embedding result according to an embodiment of the present invention. Referring to FIG. 11, the step of generating a heart disease risk prediction model may include a step of generating an embedding model through masking-based self-supervised learning using a first learning dataset (S3100), an embedding execution step of extracting latent vectors corresponding to each of a plurality of ROI signals corresponding to a second learning dataset using the embedding model (S3200), a step of performing clustering on the latent vectors using a clustering model (S3300), and a step of constructing a vector database (DB, Database) based on information on the latent vectors and each cluster corresponding to each latent vector (S3400).
[0022] More specifically, in step S3100, computing device 100 may generate an embedding model based on the first training data set. The embedding model can be a model trained to represent complex patterns of electrocardiogram data in a low-dimensional space. When multiple ROI signals corresponding to electrocardiogram data are input, the embedding model can generate latent vectors corresponding to each ROI signal. Here, the latent vector may be a low-dimensional vector that condenses important features of electrocardiogram data. This is a data representation that is converted into a form that contains key information of the signal to make it easier to understand and analyze high-dimensional electrocardiogram signals. The latent vector can provide useful information for assessing the health of the heart or detecting signs of disease based on patterns in the electrocardiogram data. A detailed description of a method for generating an embedded model will be given below with reference to FIGS. 12 is a flowchart illustrating an example of a process for generating an embedded model according to an embodiment of the present invention, and FIG. 13 is an example diagram illustrating a process for generating an embedded model from a self-reconfiguration model and a trained self-reconfiguration model according to an embodiment of the present invention. Referring to FIG. 12, the step of generating an embedded model may include a step (S3110) of processing data included in a first training dataset as input to a self-reconstruction model to induce self-supervised learning so that the self-reconstruction model generates output similar to the input data, and a step (S3120) of extracting an encoder from the self-reconstruction model that has completed learning to generate an embedded model. A self-reconstructing model can be a model designed to inherently learn important features of data in the process of learning through inputs and outputs. In one embodiment, the self-reconstruction model is a neural network model that masks a portion of input data and restores the masked portion, and may include an encoder (or a dimension reduction network function) and a decoder (or a dimension restoration network function). In one embodiment, the self-reconstruction model of the present invention may be, but is not limited to, a Masked AutoEncoder (MAE) that learns important patterns in electrocardiogram data and accurately restores masked signals. The self-reconstruction model can effectively learn important features of the data through the process of intentionally hiding parts of the ECG signal (specifically, each ROI signal) and reconstructing the entire signal based on the remaining parts. Self-reconstruction models train in a way that minimizes reconstruction errors between input and output, thereby effectively extracting and representing important signal characteristics. Self-reconstruction models have the advantage of understanding and exploiting the underlying structure of data, especially when the data is complex or incomplete. More specifically, as shown in FIG. 13, a self-reconstruction model 800 can learn important features by reducing the dimension of input data and then restoring it. The self-reconstruction model may include an encoder (or dimension reduction network function) 810 and a decoder (or dimension restoration network function) 820. The self-reconstruction model 800 converts high-dimensional data into a low-dimensional latent space via the encoder 810, compressing key information of the data and reducing noise in the process. The decoder 820 then attempts to restore the compressed low-dimensional representation to the original high-dimensional space, thereby learning and reproducing important patterns in the data.
[0023] According to an embodiment, the computing device 100 can induce the self-reconstruction model 800 to be trained via a masking learning method. In this method, a portion of the input data is intentionally masked, and the model is trained to restore the masked portion. For example, without masking, the self-reconstruction model may be biased toward noise rather than the QRS complex. Therefore, masking allows the model to focus on important features. This allows the model to develop the ability to extract important patterns and features from the remaining input data and accurately restore the masked information. This has the advantage of being robust to noise and incomplete data. In addition, the process of restoring the masked portions allows the model to understand the context of the data and learn important features, making it extremely useful for analyzing and interpreting complex medical data such as electrocardiogram data. By applying masks, the model can focus on key signals such as the QRS complex, enabling reliable data analysis for accurate diagnosis and evaluation of cardiac diseases. That is, to improve reliability in the analysis and interpretation of electrocardiogram data, the present invention trains a self-reconstruction model using a masking learning method to focus on important cardiac signals, allowing the model to understand the context of the data and learn key features, thereby enabling it to accurately capture and restore core signals such as the QRS complex. The self-reconstruction model aims to reproduce the entire signal by masking a specific meaningful range of the signal and then focusing on restoring the masked portion. As a specific example, the significant portion of the entire range of an electrocardiogram signal is masked so that this masked region contains approximately three QRS complexes. The self-reconstruction model focuses on this region for training, and the loss function is calculated only for this region. In this way, the model learns the features of the data, focusing on the important signals, allowing it to more accurately understand and reproduce the overall context of the data. As a result, it is robust to noise and imperfections that may occur in ECG data, enabling reliable data analysis necessary for early diagnosis and evaluation of cardiac diseases. This approach minimizes the loss of important information in the analysis of ECG signals, supporting accurate cardiac status assessment and significantly improving medical data interpretation. According to one embodiment, the self-reconfiguration model 800 may include at least one hidden layer, and an odd number of hidden layers may be disposed between the input and output layers. The number of nodes in each layer may be reduced from the number of nodes in the input layer to an intermediate layer called a bottleneck layer (encode), and then expanded symmetrically with the reduction from the bottleneck layer to the output layer (symmetric with the input layer). In this case, while FIG. 13 shows that the layers of the encoder 810 and the decoder 820 are symmetric, the present invention is not limited thereto, and the nodes in the layers of the encoder 810 and the decoder 820 may or may not be symmetric. The self-reconfiguration model 800 may perform nonlinear dimensionality reduction. The number of input and output layers may correspond to the number of input data items remaining after preprocessing of the input data. The structure of the self-reconfiguration model 800 may have a structure in which the number of nodes in the hidden layer included in the encoder 810 decreases with increasing distance from the input layer. The number of nodes in the bottleneck layer (the layer with the fewest nodes located between the encoder and decoder) can also be kept above a certain number (e.g., more than half of the input layer), since if it is too small, a sufficient amount of information may not be conveyed.
[0024] In an embodiment, the computing device 100 trains a self-reconstruction model through a plurality of ROI signals corresponding to a first training data set, so that the model learns important features and patterns of the electrocardiogram data. The trained self-reconstruction model is applied to each of the plurality of electrocardiogram data to extract and analyze key features of the electrocardiogram signal through a process of masking and restoring a portion of the input data. In summary, the computing device 100 guides learning using a masked learning method for the self-reconstruction model to ensure high reliability in the analysis and interpretation of electrocardiogram data. During this process, the self-reconstruction model focuses on key signals such as the QRS complex to learn the inherent distribution of cardiac beats. While the self-reconstruction model reproduces the original signal of the electrocardiogram data, it also effectively learns important features of the electrocardiogram data itself, such as the peak of the QRS complex. In the next step S3120, an encoder is extracted from the trained self-reconstruction model to generate an embedded model. The encoder part in the trained self-reconstruction model is trained (i.e., pre-trained using the first training data set) to compress important features of high-dimensional data and remove noise, so it can output a low-dimensional latent vector corresponding to input data (e.g., multiple ROI signals included in the second training data set). According to the embodiment, the generated embedding model can compress and represent the data features, thereby effectively reflecting the similarity between input data in the latent space. For example, in response to similar input data, the embedding model outputs a similar latent vector in the latent space. For example, a second latent vector of a second ROI signal similar to a first ROI signal is located in a similar latent space to the first latent vector corresponding to the first ROI signal. In other words, they are located in close positions in the latent space. Conversely, if the input data are different from each other (i.e., have large differences), the embedding model will place these data at positions far apart in the latent space, which can clearly distinguish between similarities and differences based on the characteristic patterns of ECG data, which can be used in the diagnosis and evaluation process of cardiac diseases. That is, the present invention induces a self-reconstruction model to self-train using a first training data set, and then extracts an encoder from the self-reconstruction model after training to form an embedded model. The computing device 100 can generate an embedding model using the first training data set, and then use the embedding model to perform embedding to extract latent vectors corresponding to each of a plurality of ROI signals corresponding to the second training data set. More specifically, each ROI signal included in the second training dataset is provided as input to the embedding model by the computing device 100, and the embedding model compresses key features of the signal to output a low-dimensional latent vector. The latent vector concisely represents the complex patterns of the ROI signals and reflects the similarities and differences between each ROI signal in a latent space. For example, among ROI signals of electrocardiogram data included in the second training dataset, signals with similar patterns are output as latent vectors located close to each other in the latent space.
[0025] Then, in step (S3300), computing device 100 can perform clustering on the latent vectors using a clustering model. According to an embodiment, computing device 100 may utilize a clustering model to perform clustering on the latent vectors. As an example, the clustering model is a model trained to perform clustering using latent vectors extracted by the embedding model, and may be a KNN (K-Nearest Neighbors) model. In one embodiment, the clustering model can be characterized by performing clustering based on the similarity distance between latent vectors corresponding to each of a plurality of ROI signals. More specifically, the clustering process calculates the distance or similarity between each latent vector to determine how close or similar these vectors are, where distance is typically calculated using a metric such as Euclidean distance or cosine similarity. For example, the distance between latent vector A extracted from a specific ROI signal and latent vector B extracted from another ROI signal is calculated to evaluate how similar these two vectors are. If the distance between A and B is close, these two vectors can be considered to represent electrocardiogram signals containing the same or similar patterns. The clustering model groups the latent vectors into multiple clusters based on such distance information. In the KNN model, clustering is performed by finding the K nearest neighboring vectors of a particular vector and including that vector in the cluster to which those neighboring vectors belong. For example, if K=3, the three nearest neighboring vectors of latent vector A are found and A is assigned to the cluster to which the majority of those neighboring vectors belong. This process is repeated for all latent vectors, and ultimately vectors that share similar characteristics are grouped into the same cluster. This process is useful for classifying various patterns in electrocardiogram data and analyzing how each pattern correlates with a particular type or risk level of heart disease. For example, if a particular cluster contains signals related to irregularities in heartbeats, that cluster can be used as an indicator of a disease such as arrhythmia. As a more specific example, when clustering each latent vector using a clustering model, four clusters can be formed. In this clustering process, vectors are grouped based on the similarity between each latent vector. Assuming there are four clusters, namely, a first cluster, a second cluster, a third cluster, and a fourth cluster, each of these clusters can represent a different electrocardiogram pattern. For example, the first cluster can include signals having a normal heartbeat pattern, while the second cluster can include signals having a specific abnormality such as arrhythmia. The third and fourth clusters can each include signals reflecting different types of cardiac diseases or conditions. While the above description illustrates that four clusters (or groups) can be formed, this is merely an example, and the actual number of clusters may vary depending on the characteristics of the data and the settings of the clustering model.
[0026] Such clustering can automatically identify specific patterns or abnormalities in ECG data and analyze the characteristics of each cluster to provide information useful for the early diagnosis and management of cardiac disease. The clustering results provide important data for medical professionals to comprehensively assess a patient's condition and develop a customized treatment plan. Additionally, in step S3400, computing device 100 may build a vector database based on the latent vectors and information for each cluster corresponding to each latent vector. The vector database of the present invention may be a NoSQL database server for storing and managing information on embedding vectors, cluster membership information, and distances between each vector. The vector database of the present invention is optimized for analyzing and managing latent vectors extracted from various electrocardiogram data, thereby systematically storing characteristic patterns of electrocardiogram signals and enabling them to be searched and utilized as needed. As an example, the vector database of the present invention can support risk assessment and condition monitoring based on a patient's electrocardiogram data. When newly collected electrocardiogram data for a specific patient is received, the latent vector extracted from the data can be compared with existing vectors stored in the vector database to evaluate similarity. Through this similarity evaluation, it can be determined which cluster the patient's electrocardiogram data belongs to and which previously observed patterns the cluster resembles. In addition, in an embodiment, the computing device 100 can extract a representative vector, i.e., a principal vector, for each of the multiple clusters corresponding to the clustering result. Such a principal vector is a vector that represents each cluster and can represent the center of the latent vectors within the cluster. More specifically, if the data stored in the vector database is enormous, it may take a long time to search, for example, 300,000 pieces of electrocardiogram data. Generally, when new electrocardiogram data for a specific patient is input, it is divided into multiple ROI signals during the preprocessing process, and 80 to 120 embedding vectors are generated for each ROI signal through an embedding process. For example, if the new electrocardiogram data is individually compared with all vectors stored in the database, this can be computationally inefficient. This takes a lot of time and is not suitable for situations requiring real-time analysis. In this way, to shorten search time and improve efficiency, the latent vector generated based on the patient's ECG data is compared with the principal vector of each cluster to quickly identify similar clusters. In this process, the dot product between each embedding vector and the principal vector is calculated to evaluate the similarity, and based on this information, it is determined which cluster the ECG data belongs to.
[0027] This method allows for the rapid identification of related clusters by comparing them with the principal vector representing each cluster, instead of comparing the entire data one by one. As a result, rapid analysis and efficient management of ECG data is possible, which plays an important role in quickly assessing the risk of heart disease and monitoring patient conditions in real time. In addition, in an embodiment, cardiac disease prediction information for the electrocardiogram data of a prediction subject can be generated through the following process. In an embodiment, a method for generating heart disease prediction information for electrocardiogram data of a subject to be predicted includes the steps of acquiring the electrocardiogram data of the subject to be predicted, preprocessing the electrocardiogram data of the subject to be predicted, generating a plurality of latent vectors corresponding to the preprocessed electrocardiogram data using an embedding model, comparing each of the plurality of latent vectors with a representative vector corresponding to each of a plurality of clusters, and classifying each of the plurality of latent vectors into one of the plurality of clusters, and generating stratification information regarding the risk of heart disease based on the classification results in which each of the plurality of latent vectors is classified into a plurality of clusters. In an embodiment, the prediction subject may be an individual who has undergone an electrocardiogram (ECG) test for the purpose of assessing and managing the risk of heart disease. This may be people undergoing a general health check, people with a family history of heart disease, or patients who have previously been diagnosed with or exhibited symptoms of heart disease. The prediction subject may continuously assess their cardiac condition through regular ECG monitoring and utilize the computing device 100 of the present invention for the early detection and prevention of heart disease. More specifically, after acquiring electrocardiogram data of a prediction target, the data is preprocessed to remove noise and refine the signal. As described above, preprocessing can include removing unnecessary signal components and emphasizing important signal features to improve the quality of the electrocardiogram data, and can also include dividing each electrocardiogram signal into appropriate units (predetermined window sizes) for processing. The predetermined window size can generally be defined as a section of the electrocardiogram data that contains important information, for example, a length of approximately 30 seconds to 1 minute. In this process, the electrocardiogram data is divided into regular time intervals, and each section can be analyzed independently. The preprocessed electrocardiogram data is input to an embedding model (e.g., an encoder extracted from a self-reconstruction model previously trained via a first training dataset), and a latent vector (or embedding vector) is generated from each data. The generated latent vectors are compared with existing vectors stored in a vector database, and each vector is classified into a specific cluster according to its similarity. Each cluster has a specific pattern that reflects the heart condition, so the risk of heart disease is assessed depending on which cluster the latent vector belongs to.
[0028] Furthermore, the computing device 100 can generate stratified information regarding the risk of heart disease based on a classification result in which multiple latent vectors are classified into multiple clusters. More specifically, in the case of electrocardiogram data of a prediction subject, the data is divided into specific time units in a preprocessing process to obtain multiple ROI signals, and each ROI signal is processed as an input for an embedding model to generate a latent vector for each of the multiple ROI signals. In this case, prediction information regarding the risk of heart disease can be generated according to the classification result regarding to what extent each latent vector is classified into which cluster. As a more specific example, if the ECG data of a subject is composed of ten 30-second ROI signals, each of the ten ROI signals can be converted into ten latent vectors through an embedding model, and the ten vectors can be classified into one of four predetermined clusters, where each predetermined cluster indicates a particular cardiac condition, with the first cluster representing the highest risk and the fourth cluster representing the lowest risk. The computing device 100 can predict the overall risk based on how the 10 input signals fall into each cluster. For example, if eight signals belong to cluster 1 and two to cluster 2, the patient's risk of heart disease can be assessed as very high. On the other hand, if five signals belong to cluster 2, three to cluster 3, and two to cluster 4, the patient's risk can be assessed as medium. If two signals belong to cluster 3 and eight to cluster 4, the patient's risk can be assessed as low. If all ten signals belong to cluster 4, the patient's risk of heart disease can be assessed as very low. That is, the computing device 100 of the present invention can predict a patient's risk of heart disease in a hierarchical manner by analyzing the ROI signal of the electrocardiogram data using an embedded model to obtain latent vectors, and evaluating which of predetermined clusters each latent vector belongs to through a clustering model based on a training dataset. In other words, the computing device 100 compares the latent vectors generated by the embedded model with predetermined clusters to determine which cluster each vector belongs to, and based on this information, performs a multidimensional assessment of the patient's cardiac condition. Such a stratified risk prediction method improves the accuracy of electrocardiogram data analysis and aids in a comprehensive understanding of a patient's cardiac condition. Therefore, the computing device of the present invention systematically and clearly stratifies a patient's cardiac disease risk and provides important information for medical professionals to establish appropriate preventive measures or treatment plans. This enables early detection of cardiac disease and appropriate treatment, thereby contributing to patient health management.
[0029] FIG. 14 shows an exemplary flowchart illustrating a process for generating a heart disease risk prediction model through ensemble learning of multiple tree sequence models according to an embodiment of the present invention. Referring to FIG. 14, the step of generating a heart disease risk prediction model may include a step of acquiring user meta information corresponding to each of a plurality of electrocardiogram data (S3500), a step of acquiring a plurality of latent vectors and cluster information corresponding to the plurality of latent vectors from a vector database (S3600), and a step of performing ensemble learning to train a plurality of tree models based on HRV characteristic information, user meta information, a plurality of latent vectors, and cluster information corresponding to the latent vectors, and integrating the outputs of each tree model to generate a heart disease risk prediction model (S3700). More specifically, the step of acquiring user meta-information in step S3500 may include collecting personal health information such as the patient's age, gender, medical history, and lifestyle habits. Such information closely reflects an individual's health status and characteristics and has a significant impact on the interpretation of electrocardiogram data. In particular, such meta-information is used as an important variable necessary for more accurate assessment of the risk of heart disease. This enables customized predictions and assessments that take into account the patient's personal health factors. In step S3600, multiple latent vectors and cluster information corresponding to each vector are obtained from the vector database. The latent vector summarizes the characteristics of the electrocardiogram data, and the cluster information indicates the pattern of a specific cardiac condition or disease to which the vector belongs. This makes it possible to determine which cluster the patient's electrocardiogram data belongs to and evaluate the risk of heart disease indicated by that cluster. In step S3700, multiple tree models are trained based on the HRV characteristic information, user meta information, latent vectors, and cluster information, and each tree model predicts the risk of heart disease using a variety of tree-based machine learning algorithms, such as decision trees, random forests, and gradient boosting trees. Here, the cluster information can be obtained from a vector database and can include information on the cluster to which each vector belongs and information on the distance between the vectors. For example, the cluster information provides information on which cluster each latent vector belongs to and distance information indicating the similarity or difference between vectors within the cluster. Such information plays an important role in evaluating which cluster a specific electrocardiogram pattern belongs to and how similar or different this pattern is compared to other electrocardiogram data. This allows for analysis of the characteristics of the electrocardiogram data and more accurately determining whether the data is related to a specific disease or condition. More specifically, the process of training multiple tree sequence models based on HRV characteristic information, user meta information, latent vectors, and cluster information is as follows. First, HRV characteristic information is a heart rate variability index extracted from electrocardiogram data and reflects the activity of the cardiac autonomic nervous system. User meta information is information indicating the patient's individual health status, such as age, gender, medical history, and lifestyle. Latent vectors are values that represent the features of electrocardiogram data in a low-dimensional space, and cluster information indicates which cardiac conditions or diseases these vectors are associated with. These various pieces of information are used as input variables to train multiple tree-based models. For example, a random forest model uses these input variables to construct multiple decision trees and combines the results of each tree to provide a final prediction. Gradient boosting trees aim to achieve more accurate predictions by correcting the errors of previous models at each step through successive model training.
[0030] In this case, cluster information can be particularly important. The distance information between each latent vector's cluster and other vectors can be used to better understand the characteristics of the ECG data and assess the risk of heart disease. Such information acts as an important determinant in multiple tree models, which learn patterns in the data based on this information. The final ensemble process combines the prediction results of the individual tree models to derive a single overall prediction. During this process, the weights of each model are adjusted to increase the reliability and accuracy of the final prediction. The ensemble process compensates for the weaknesses of the individual models and combines their strengths to provide more robust and consistent predictions. As a result, such comprehensive learning and ensemble processes can reflect the multidimensional characteristics of ECG data and enable accurate and precise prediction of heart disease risk. Ensemble learning is then performed to integrate the outputs of each tree model, which combines the prediction results of each individual model to improve the accuracy and reliability of the final prediction. Through ensemble learning, heart disease risk can be predicted more accurately, which allows for a comprehensive assessment of a patient's health status and the establishment of early diagnosis and preventive treatment plans. That is, the present invention combines the strengths of multiple tree-based models through ensemble learning to provide better predictive performance than a single model and improves robustness against data noise and fluctuations, thereby enabling the model to provide consistent predictions for various patient data and reducing prediction uncertainty. In summary, the computing device of the present invention utilizes three neural network models to more accurately predict heart disease risk. First, the embedding model converts electrocardiogram data into low-dimensional latent vectors to summarize important signal features. Second, the clustering model clusters the latent vectors and determines the cluster to which each vector belongs. Finally, the heart disease risk prediction model predicts heart disease risk by combining HRV characteristic information, user meta information, latent vectors, and cluster information. This integrated approach enables the computing device to more accurately and consistently predict heart disease risk. In particular, in the final heart disease risk prediction process, multiple tree-based models are used using four variables: HRV characteristic information, user meta information, latent vector, and cluster information. Each model generates its own output. These outputs are integrated through ensemble learning to generate the final output, i.e., the predicted heart disease risk. This configuration improves the accuracy of heart disease risk prediction and enables a more multidimensional and comprehensive assessment through the combination of various variables. This more accurately reflects the individual health status of each patient, playing an important role in helping medical staff clearly understand the patient's risk and establish optimal treatment plans.
[0031] As a result, the heart disease risk prediction model generated through the final learning process can provide hierarchical predictive information on future heart disease risk based on the patient's electrocardiogram data. This hierarchical information plays an important role in multidimensionally assessing a patient's cardiac health and establishing an individualized treatment plan. This allows medical staff to more clearly understand a patient's risk and implement more precise treatment and preventative measures, thereby contributing to the early detection and management of heart disease. Specifically, the system comprehensively analyzes electrocardiogram data and patient meta-information to categorize the likelihood of developing heart disease into various risk levels. By providing risk stratification into categories such as low, medium, and high, medical staff can clearly understand the level of attention they should pay to specific patients. This increases the likelihood that high-risk patients will receive early diagnosis and treatment, while low-risk patients will undergo fewer unnecessary tests, enabling more efficient health management. As a result, the system supports the efficient allocation of medical resources, plays an important role in preventing complications from heart disease, and improves patients' quality of life. The above-described embodiments may be implemented using hardware components, software components, and / or a combination of hardware and software components. For example, the devices, methods, and components described in the embodiments may be implemented using a general-purpose computer or a special-purpose computer, such as a processor, controller, arithmetic logic unit (ALU), digital signal processor, microcomputer, field programmable gate array (FPGA), programmable logic unit (PLU), microprocessor, or any other device capable of executing and responding to instructions. The processing device may execute an operating system (OS) and software applications that run on the operating system. The processing device may also access, store, manipulate, process, and generate data in response to the execution of software. For ease of understanding, although a single processing device may be described as being used, those skilled in the art will recognize that the processing device may include multiple processing elements and / or multiple types of processing elements. For example, the processing device may include multiple processors or one processor and one controller. Other processing configurations are also possible, such as parallel processors. Software may include a computer program, code, instructions, or a combination of one or more of these, which may configure or, independently or collectively, instruct a processing device to operate in a desired manner. The software and / or data may be stored on any type of machine, component, physical device, virtual device, computer storage medium, or device to be interpreted by or provide instructions or data to a processing device. The software may also be distributed across computer systems connected to a network, stored or executed in a distributed manner. The software and data may be stored on a computer-readable recording medium.
[0032] Methods according to embodiments can be embodied in the form of program instructions that can be executed by various computer means and stored on a computer-readable medium. The computer-readable medium can store program instructions, data files, data structures, and the like, alone or in combination. The program instructions stored on the medium may be specially designed and constructed for the embodiments, or may be known and available to those skilled in the art of computer software. Examples of computer-readable storage media include magnetic media such as hard disks, floppy disks, and magnetic tape; optical media such as CD-ROMs and DVDs; magneto-optical media such as floptical disks; and hardware devices specially configured to store and execute program instructions, such as ROM, RAM, and flash memory. Examples of program instructions include not only machine code, such as produced by a compiler, but also high-level language code that can be executed by a computer using an interpreter, for example. The hardware devices described above may be configured to operate as one or more software modules to perform the operations of the embodiments, and vice versa. As described above, although the embodiments have been described using limited drawings, those skilled in the art can apply various technical modifications and variations thereto. For example, suitable results can be achieved even if the described techniques are performed in a different order from the described method, and / or the components of the described systems, structures, devices, circuits, etc. are combined or coupled in a different manner from the described method, or are replaced or replaced by other components or equivalents. Accordingly, other implementations, other embodiments, and equivalents of the claims are within the scope of the following claims. [Explanation of symbols]
[0033] 100 Computing Devices 110 processors 120 Memory 130 Programs 140 Display
Claims
1. 1. A method performed via a processor included in a computing device, comprising: The processor acquires discrete individual heart beats from electrocardiogram data, which is non-standard data consisting of continuous signals and is acquired from a plurality of patients; A deep learning model training method for predicting cardiac disease, comprising: a step in which the processor inputs the acquired individual heart beats into a deep learning model for predicting cardiac disease in a patient, thereby training the deep learning model to predict a cardiac disease class for each of the acquired individual heart beats.
2. The learning step includes:
2. The deep learning model training method for cardiac disease prediction according to claim 1, comprising a step of training the deep learning model using a first individual heart beat acquired from electrocardiogram data of at least one of the acquired individual heart beats.
3. The obtaining step includes: filtering each of the electrocardiogram data to remove noise; and segmenting each of the noise-removed electrocardiogram data into individual heart beats by applying a peak detection algorithm to each of the noise-removed electrocardiogram data.
4. The learning step includes: The method for training a deep learning model for predicting heart disease according to claim 1 , further comprising optimizing parameters of the deep learning model using binary cross entropy and an optimizer.
5. The method comprises:
2. The deep learning model training method for cardiac disease prediction according to claim 1, further comprising a step in which a processor applies a second individual heart beat acquired from electrocardiogram data of at least one of the acquired individual heart beats to the trained deep learning model to determine a threshold for classifying the cardiac disease class.
6. The determining step includes: collecting a probability score for each of the second individual heart beats separated from the same electrocardiogram data; averaging the probability scores for each of the collected second individual heart beats to derive a final probability score; and fine-tuning a threshold for distinguishing the cardiac disease classes based on the derived final probability score.
7. The determined threshold value is: The deep learning model training method for predicting heart disease according to claim 5, wherein the deep learning model weights are stored together with the deep learning model weights.
8. 1. A method performed via a processor included in a computing device, comprising: receiving electrocardiogram data from a patient, the electrocardiogram data being non-structured data consisting of continuous signals; obtaining discrete individual cardiac beats from the received electrocardiogram data; A step of inputting the acquired individual heart beats into a deep learning model to derive a probability value of being predicted as a specific cardiac disease class for each of the acquired individual heart beats; and predicting cardiac disease in the patient using the derived probability value; The deep learning model is A method for predicting heart disease using a deep learning model, characterized in that the model is trained using individual heart beats obtained from electrocardiogram data of multiple patients.
9. The predicting step includes: classifying the patient into a cardiac disease class by comparing the average of the derived probability values with a threshold; The threshold value is The cardiac disease prediction method using a deep learning model according to claim 8, wherein the value is determined by applying the deep learning model to individual heart beats obtained from at least one electrocardiogram data among the electrocardiogram data of the plurality of patients, and is a value for classifying the cardiac disease class.
10. The obtaining step includes: filtering the received electrocardiogram data to remove noise; and segmenting the electrocardiogram data into individual heart beats by applying a peak detection algorithm to the noise-removed electrocardiogram data.
11. The deep learning model is The method for predicting heart disease using a deep learning model according to claim 8, wherein parameters are optimized based on binary cross entropy and an optimizer.
12. a processor; A network interface; Memory and a computer program loaded into the memory and executed by the processor; The processor: A computing device configured to perform the method of claim 1 or 8 by executing one or more instructions contained in the computer program.
13. coupled to a computing device, A computer program stored on a computing device readable medium for carrying out the method of claim 1 or 8.
Citation Information
Patent Citations
Multi-lead electrocardiosignal feature point extraction method combining deep learning and electrophysiological knowledge
CN113951893A
Method and apparatus for high accuracy photoplethysmogram based atrial fibrillation detection using wearable device
JP2019084343A
Automatic electrocardiogram analysis method and device based on artificial intelligence self-learning
JP2020536693A
Electrocardiographic abnormality detection network training method, and electrocardiographic abnormality early warning method and device
JP2022045870A
Methods for detecting risk of torsades de pointes
JP2022535574A