Heart failure risk prediction method and system fusing domain knowledge and deep learning
Through the cascaded LSTM-CNN module and self-attention mechanism, combined with medical guidelines and triplet sequences, the problem of insufficient integration of medical knowledge in the existing technology is solved, and the accuracy and credibility of heart failure risk prediction are improved. Spend.
Patent Information
- Application Number
- CN202410729760.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-06
- Publication Date
- 2024-09-24
AI Technical Summary
Existing disease risk prediction methods fail to fully integrate in-depth medical knowledge, resulting in unsatisfactory prediction results and low credibility. Especially in heart failure risk prediction, the model fails to effectively utilize multiple medical visit records and evidence-based evidence. Knowledge.
The cascaded LSTM-CNN module is used to build a heart failure risk auxiliary prediction model, combined with medical guidelines to divide heart failure stages, construct a triplet sequence and introduce a self-attention mechanism, extract features through CNN and integrate into time coding, combine abnormal indicators and intersection Entropy loss function trains the model.
The accuracy and credibility of heart failure disease risk prediction are improved, and the predictive performance of the model is enhanced by effectively utilizing the correlation between medical knowledge and medical records.
Smart Images

Figure CN118692671A
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of medical care and prediction technology, and in particular to a method and system for predicting heart failure risk by integrating domain knowledge and deep learning. Background Art
[0002] In the healthcare field, accurate prediction of disease risk is crucial for prevention, diagnosis, and treatment. With the deepening of medical research and the development of big data technology, combining advanced data analysis methods with rich medical knowledge has become the forefront of research. In real life, the development of disease is a dynamic process involving data at multiple time points, such as physiological parameters, test results, and treatment records. Sequence models have attracted much attention for their ability to process time series data, dynamically modeling these changes and capturing temporal correlations. However, existing models still face limitations in accuracy and generalization ability in disease risk prediction, mainly because the models fail to fully understand and incorporate deep medical knowledge.
[0003] Most existing disease prediction methods are data-driven. For example, traditional machine learning is used in cancer prediction and diagnosis, which can process biomarker data and help identify early signs of cancer. There are also deep learning methods, including convolutional networks and long short-term memory networks, which predict disease risks by analyzing patients' electronic health records. These studies are based on pure data-driven predictions, which are divorced from the medical knowledge that humans have summarized, resulting in unsatisfactory prediction results and low credibility.
[0004] In recent years, some scholars have begun to study the integration of medical knowledge into prediction models. The forms adopted include: 1) In the data screening stage, expert advice knowledge is used, that is, the constructed data set should be related to the disease as prior knowledge, so as to construct different types of data sets according to the disease stage, and then combine the deep learning network LSTM to process different types of data and finally integrate them together for final prediction; 2) Based on the graph attention mechanism, EHRs information is combined with the medical knowledge graph. This mechanism is to find the relationship related to the event based on the input data of each t input event combined with the knowledge graph, and then input it into the deep learning model through the attention mechanism. 3) In the medical field, doctors have classified risk factors into five main categories: patient characteristics, patients' underlying diseases, disease duration, genetics and family history. Corresponding constraint features are designed for these categories, and the required distribution is introduced through the posterior regularization technique. The goal is to integrate prior medical knowledge into the risk prediction model. In order to solve the problem of how to specify boundaries for different constraint features, a log-linear model is used to represent the required distribution. For example, race and age are considered in patient characteristics; the constraint characteristics of the underlying disease are determined based on the frequency of the diagnosis code that appears in the patient's medical records. Different underlying diseases have different effects on the final disease prediction, so corresponding constraint characteristics are designed for these diseases. In general, the number of methods for integrating such medical knowledge is increasing, and the form of knowledge is not deeply integrated with the conclusion knowledge that humans have summarized. There is a risk that the knowledge of feature identification is separated from the data, resulting in unsatisfactory prediction performance of the model and low credibility.
[0005] Considering that a patient's multiple medical records can reflect the patient's personal physical condition from more aspects, incorporating evidence-based knowledge in the field of disease that has been summarized by humans can provide multiple reflections for previous research conclusions, thereby strengthening the prediction of disease risk for patients. Therefore, sequence prediction research that incorporates evidence-based evidence is of great significance for disease risk prediction. Summary of the invention
[0006] To solve the above problems, the present invention provides a method and system for predicting heart failure risk by integrating domain knowledge and deep learning.
[0007] In a first aspect, the method provided by the present invention comprises constructing and training a heart failure risk auxiliary prediction model; obtaining a medical record to be predicted and inputting the trained heart failure risk auxiliary prediction model to obtain a risk auxiliary prediction result; the heart failure risk auxiliary prediction model comprises N cascaded LSTM-CNN modules;
[0008] The training process of the heart failure risk auxiliary prediction model includes the following steps:
[0009] S1. According to the heart failure disease guidelines, the heart failure stage is divided into heart failure disease risk stage A and heart failure disease risk stage B, and a medical record sequence data set is obtained according to the division results; the medical record sequence data set is composed of multiple groups of medical record sequence data, and each group of medical record sequence data includes N medical record records;
[0010] S2. construct a triple set for each medical record in the medical record sequence data set, and construct the triple sets of all medical records in each set of medical record sequence data into a triple sequence;
[0011] S3. Input the medical record sequence data and its triple sequence into the LSTM-CNN module in sequence, and finally output the prediction result;
[0012] S4. According to the prediction results, the loss function group is used to calculate the loss and back-propagate the training model parameters until the model converges.
[0013] In a second aspect, based on the method of the first aspect, the present invention further provides a heart failure risk prediction system integrating domain knowledge and deep learning, comprising:
[0014] Data collection module, used to obtain patients' medical records;
[0015] A data processing module, used to divide the acquired medical records into stages of heart failure according to the heart failure disease guidelines, and obtain medical record sequence data;
[0016] A triplet construction module, used to construct triplet sequences based on medical record sequence data;
[0017] The model construction training module constructs a heart failure risk auxiliary prediction model including N cascaded LSTM-CNN modules, which is used to train according to the medical record sequence data and its triplet sequence, and save the trained model parameters; the prediction module is used to input the medical record to be predicted into the trained heart failure risk auxiliary prediction model to obtain the risk auxiliary prediction results.
[0018] Beneficial effects of the present invention:
[0019] The present invention provides a heart failure risk prediction method and system integrating domain knowledge and deep learning, constructs a heart failure risk auxiliary prediction model based on LSTM and CNN, uses LSTM to focus on the connection between multiple medical records, extracts triple knowledge between features and diseases through CNN, and introduces a self-attention mechanism to shorten the semantic gap between medical record data and triples; in particular, in order to integrate time information into the model, the present invention introduces a time encoding method in LSTM, which simulates the absolute position encoding method and spiral position encoding method adopted in processing position encoding information in a transformer model.
[0020] The present invention performs data feature screening and collection according to guidelines formed by expert consensus, and adopts the largest Chinese knowledge graph in the country to construct triple knowledge.
[0021] The present invention sets focal loss and cross entropy loss in combination with abnormal indicators, and the two are combined to train the model, so that the model can well predict heart failure disease. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 is a flow chart of the method of the present invention;
[0023] Figure 2 This is a structural diagram of the model of the present invention. DETAILED DESCRIPTION
[0024] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0025] The present invention provides a heart failure risk prediction method integrating domain knowledge and deep learning, which includes constructing and training a heart failure risk auxiliary prediction model; obtaining a medical record to be tested and inputting the trained heart failure risk auxiliary prediction model to obtain a risk auxiliary prediction result; the heart failure risk auxiliary prediction model includes multiple cascaded LSTM-CNN modules, and the number of LSTM-CNN modules is recorded as N>0.
[0026] Specifically, Figure 1 As shown, the training process of the heart failure risk auxiliary prediction model includes the following steps:
[0027] S1. According to the heart failure disease guidelines, the heart failure stage is divided into heart failure disease risk stage A and heart failure disease risk stage B, and a medical record sequence data set is obtained based on the division results; the medical record sequence data set is composed of multiple groups of medical record sequence data, and each group of medical record sequence data includes N medical record records.
[0028] Specifically, the present invention mainly constructs a medical record sequence data set based on multiple heart failure guidelines of the Chinese Medical Association. First, according to the content recorded in the heart failure disease guideline "National Heart Failure Guidelines 2023 (Simplified Edition)", the heart failure stage is divided into heart failure disease risk period A and heart failure disease risk period B. Among them, heart failure disease risk period A mainly includes some heart failure-related diseases, and heart failure disease risk period B mainly includes abnormal states of biomarkers related to heart failure. At the same time, based on the heart failure diagnosis and treatment guidelines "China Heart Failure Diagnosis and Treatment Guidelines 2018", the laboratory test indicators required for heart failure are used as features.
[0029] Specifically, the process of obtaining the medical record data set in step S1 includes:
[0030] S11. According to the guidelines for heart failure diseases, risk factor diseases that belong to the risk period A of heart failure diseases are identified, and subjects with risk factor diseases are extracted from the mimiciv dataset as sample persons, and all medical records of each sample person are extracted from the mimiciv dataset; the risk factor diseases include hypertension, arrhythmia, coronary artery disease, valvular heart disease, diabetes, and atherosclerotic cardiovascular disease; specifically, as long as all medical records of the subject indicate that the subject suffers from any one or more of the aforementioned 6 diseases, the present invention regards the subject as a sample person.
[0031] S12. According to the guidelines for heart failure disease, cardiac biomarkers belonging to the risk period B of heart failure are clearly identified; for each sample person, the first medical record showing an abnormal cardiac biomarker is searched in all their medical records, and then the medical record and all subsequent medical records are extracted as one medical record data; among them, if the sample person already has a history of heart failure, the first medical record showing an abnormal cardiac biomarker, the first medical record in which heart failure is detected, and all medical records in between are extracted from all their medical records to form one medical record data; the cardiac biomarkers include natriuretic peptides and troponins.
[0032] Specifically, all medical records in each medical record data are arranged in chronological order.
[0033] S13. Feature annotation is performed on each medical record in each medical record data according to the test indicators; the test indicators include indicators with range and indicators without range; the indicators with range include: hematocrit, glycosylated hemoglobin, platelet count, red blood cell count, white blood cell count, anion distance, urea nitrogen, creatinine, blood sodium, blood potassium, alanine aminotransferase, alkaline phosphatase, aspartate aminotransferase, bilirubin, creatine kinase, creatine kinase MB subtype, age, gender, and body mass index; the indicators without range include height, weight, and glomerular filtration rate.
[0034] Specifically, the present invention mainly determines 16 heart failure laboratory indicators based on the heart failure diagnosis and treatment guidelines "Chinese Heart Failure Diagnosis and Treatment Guidelines 2018", including hematocrit, glycosylated hemoglobin, platelet count, red blood cell count, white blood cell count, anion spacing, urea nitrogen, creatinine, blood sodium, blood potassium, alanine aminotransferase, alkaline phosphatase, aspartate aminotransferase, bilirubin, creatine kinase, and creatine kinase MB subtype; at the same time, 4 demographic indicators are determined, including age, height, weight, and gender; and 2 calculated indicators, including body mass index and glomerular filtration rate; and according to whether the indicators are within the normal range, the 22 indicators are further divided into range indicators and non-range indicators. Whether it has a normal range refers to whether the indicator corresponds to a standard range. For example, the prior art stipulates that a white blood cell count within the range of 4000-10000 / ml is normal, and exceeding this range is abnormal, so the white blood cell count is an indicator with a range. For example, indicators such as height and weight do not have corresponding standard ranges, but according to the medical knowledge map, it can be known that the BMI calculated by height and weight has a range.
[0035] S14. After the feature annotation is completed, each medical record data is screened and extracted with the same time step to obtain a set of medical record sequence data. All medical record sequence data constitute a medical record sequence data set.
[0036] Specifically, assuming that the time step is 2, for the medical record data containing 5 medical records, the last two medical record records (i.e., the two most recent medical record records) are taken to form a set of medical record sequence data. The medical record data containing the least number of medical record records among all the medical record data is M, and the number of medical record records it contains is M'. It should be noted that the size of the time step is less than or equal to M'.
[0037] S2. Construct a triple set for each medical record in the medical record sequence data set, and construct the triple sets of all medical records in each group of medical record sequence data into a triple sequence.
[0038] Specifically, the present invention combines the CPubMed-KG knowledge graph to construct triple knowledge about heart failure and indicators, and extracts triple features as the source of external knowledge integration through the CNN convolutional network.
[0039] Specifically, in step S2, a triple is constructed with the range indicator as the head entity, heart failure as the tail entity, and the correlation between the range indicator and heart failure as the entity relationship; among them, the cause, high-risk factors, risk assessment factors, disease tendency and laboratory test indicators are used as entity relationships to represent the correlation between the range indicator and heart failure, and the importance of their correlation decreases in turn.
[0040] Specifically, the specific process of step S2 constructing a triple set according to any medical record in the medical record sequence data set includes:
[0041] S21. Extracting the characteristic value of each range indicator marked in the medical record;
[0042] S22. For each characteristic value with a range indicator, determine whether it is abnormal. If so, execute step S23; if not, execute step S24;
[0043] S23. Whether the range indicator has multiple entity relationships with heart failure, if so, select the entity relationship with the highest relevance importance to construct a triple; if not, mark the abnormality before this entity relationship and then construct a triple;
[0044] S24. Whether the range indicator has multiple entity relationships with heart failure, if so, select the entity relationship with the lowest correlation importance to construct a triple; if not, directly construct a triple based on this entity relationship;
[0045] S25. All triples with range indicators marked in the medical record form a triple set.
[0046] Among them, taking age as an example, the existence of multiple entity relationships between age and heart failure means that advanced age is both the cause of heart failure and a high-risk factor for heart failure. For example, there are two entity relationships between the range indicator "age" and heart failure, namely "cause" and "high-risk factor". If the specific "age" feature value exceeds its normal range and is an abnormal feature value, the entity relationship "cause" with the highest relevance importance is selected from it to construct the triple <age, cause, heart failure>; if it does not exceed the normal range, the entity relationship "high-risk factor" with the lowest relevance importance is selected from it to construct the triple <age, high-risk factor, heart failure>. There is only one entity relationship between the range indicator "white blood cell count" and heart failure, namely "high-risk factor". If the specific "white blood cell count" feature value exceeds its normal range, it needs to be marked as abnormal and then the triple <white blood cell count, abnormal high-risk factor cause, heart failure> is constructed; if it does not exceed the normal range, the triple <white blood cell count, high-risk factor, heart failure> is constructed. The purpose of constructing triples in this way is mainly to indicate the status between range indicators and heart failure, and to show the influence of range indicators on heart failure.
[0047] S3. Input the medical record sequence data and its triple sequence into the LSTM-CNN module in sequence, and finally output the prediction results.
[0048] Specifically, Figure 2As shown in the figure, each LSTM-CNN module includes 1 improved LSTM unit, 1 CNN unit and 1 self-attention mechanism unit.
[0049] Specifically, Figure 2 As shown, the processing of the t=1, 2, ..., N LSTM-CNN modules includes:
[0050] S31. Input the hidden layer state output by the t-1th LSTM-CNN module and the tth medical record in the medical record sequence data into the tth LSTM unit to obtain the hidden layer features;
[0051] S32. Input the triplet set corresponding to the t-th medical record in the medical record sequence data into the CNN unit to obtain triplet features;
[0052] S33. Input the hidden layer features and triplet features into the self-attention mechanism unit to obtain the hidden layer state output by the tth LSTM-CNN module.
[0053] Specifically, the processing process of the tth improved LSTM unit is expressed as:
[0054] Forget Gate:
[0055] f t =sigmoid(x t w fx +h t-1 w fh +b f )
[0056] f t ′=f t +f_absolute_posEncoding
[0057] Input Gate:
[0058] i t =sigmoid(x t w ix +h t-1 w ih +b i )
[0059] i t ′=i t +f_rope_posEncoding
[0060]
[0061] Long-term memory unit:
[0062]
[0063] Output Gate:
[0064] o t =sigmoid(x t w ox +h t-1 w oh +b o )
[0065] h t =o t *tanh(C t )
[0066] Among them, x t represents the input data of the tth improved LSTM unit, h t-1 represents the hidden state output by the t-1th LSTM-CNN module, w fx 、w fh is the parameter learned by the forget gate, b f is the forget gate bias; f t represents the output of the forget gate at time t, f_absoluta_posEncoding represents the encoding vector after encoding the time by simulating the absolute position encoding of the time index of the current improved LSTM unit, and f t ' represents the time encoding output of the forget gate at time t; w ix 、w ih Learn parameters for the input gate, b i is the input gate bias term, i t represents the output of the input gate at time t, f_rope_posEncoding represents the encoding vector after the time index simulation spiral position encoding of the current improved LSTM unit, i t ' represents the position encoding output of the input gate at time t; w cx 、w ch Learn parameters for candidate memory units, b c is the candidate memory unit bias term, represents the output of the candidate memory unit at time t; C t is the output of the long-term memory unit at time t; w ox 、w oh Learn the parameters for the output gate, b o is the output gate bias term, o t represents the output of the output gate at time t; h t represents the hidden layer features at time t, that is, the hidden layer features output by the tth improved LSTM unit.
[0067] Specifically, the time code is expressed as:
[0068]
[0069]
[0070] Among them, all the time in the data set is put into a set time_offset, pos represents the index of the current time in time_offset, d model Indicates the dimension of the vector, PE (pos,2i) Indicates the calculation method of the even bits of the time encoding vector, PE (pos,2i+1) Indicates how the odd bits of the time encoding vector are calculated.
[0071] Specifically, the spiral position encoding is expressed as:
[0072]
[0073] θ={θ i =10000 -2(i-1) / d ,i∈[1,2,…,d / 2]}
[0074] in, represents the spiral encoding vector matrix, d represents the dimension of the encoding vector, θ represents the angle parameter associated with the time position i, θ i The i in it represents the i-th index of the encoding vector, and m represents the index position of the time of the current input vector in the entire time offset time_offset.
[0075] Specifically, the processing process of each self-attention mechanism unit includes: taking the hidden layer features output by the LSTM unit as the K value and V value, and the triplet features output by the CNN unit as the Q value, and then calculating.
[0076] S4. Calculate the loss based on the prediction results and back-propagate the training model parameters until the model converges.
[0077] Specifically, the formula for calculating the loss is:
[0078] Loss=BCE_Loss+Mean(∑Focal_Loss i )
[0079] Among them, BCE_Loss is the cross entropy loss, Focal_Loss i represents the focal loss of the i-th feature (test indicator), Mean() is the averaging operation, and γ is an adjustable factor.
[0080] Specifically,
[0081] BCE_Loss=-y pred log(y real )-(1-y pred)log(1-y real )
[0082] Among them, y pred Represents the predicted value, y real Represents the true sample label.
[0083] Focal_Loss i =-y real (1-y pred ) γ log(y pred )except_features i
[0084] -(1-y real )(y pred ) γ log(1-y pred )except_features i
[0085] Among them, γ is an adjustable factor; except_features represents a vector matrix composed of all vectors with range indicators in a set of medical record sequence data, features i It represents the range indicator vector of the i-th medical record in the group of medical records. The range indicator vector only contains two elements, "0" and "1". "0" indicates that the range indicator is normal, and "1" indicates that the range indicator is abnormal. For example, a set of medical record sequence data includes 3 medical records. A 3×19 vector matrix is constructed, in which the columns represent 19 range indicators and the rows represent 3 medical records. The vector matrix is [features1, features2, features3] T , where features1 represents the range indicator vector of the ith medical record in the group of medical records, which indicates whether the 19 range indicators in the medical record are normal or not. Assume that features1 = [1,0,1,1,0,0,0,1,1,0,10,0,0,0,0,0], which means that the 1st, 3rd, 4th, 8th, 9th, 11th, and 13th range indicators in the medical record are abnormal, and the rest of the range indicators are normal. When calculating the loss, a group of medical record sequence data only takes the range indicator vector of the last medical record for calculation, so except_features i The i-th binary vector in the range index vector representing the last medical record in a set of medical record sequence data, except_features i =1, indicating that the i-th medical record has an abnormal range indicator, except_features i =0, indicating that the i-th range indicator is normal.
[0086] In one embodiment, the present invention further provides a heart failure risk prediction system integrating domain knowledge and deep learning, comprising:
[0087] The data collection module is used to obtain the patient's medical records; specifically, the data in the medical records include instrument detection data collected by intensive care unit monitoring instruments, sensors and other equipment, as well as various laboratory examination indicators during the patient's hospitalization;
[0088] A data processing module, used to divide the acquired medical records into stages of heart failure according to the heart failure disease guidelines, and obtain medical record sequence data;
[0089] A triplet construction module, used to construct triplet sequences based on medical record sequence data;
[0090] The model construction training module constructs a heart failure risk auxiliary prediction model including N cascaded LSTM-CNN modules, which is used to train according to the medical record sequence data and its triplet sequence, and save the trained model parameters; the prediction module is used to input the medical record to be predicted into the trained heart failure risk auxiliary prediction model to obtain the risk auxiliary prediction results.
[0091] In the present invention, unless otherwise clearly stipulated and limited, the terms such as "installation", "setting", "connection", "fixation" and "rotation" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral one; it can be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium; it can be the internal connection of two elements or the interaction relationship between two elements. Unless otherwise clearly defined, ordinary technicians in this field can understand the specific meanings of the above terms in the present invention according to the specific circumstances.
[0092] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A heart failure risk prediction method integrating domain knowledge and deep learning, characterized in that: Constructing and training a heart failure risk auxiliary prediction model; obtaining the medical record to be predicted and inputting it into the trained heart failure risk auxiliary prediction model to obtain a risk auxiliary prediction result; the heart failure risk auxiliary prediction model includes N cascaded LSTM-CNN modules; The training process of the heart failure risk auxiliary prediction model includes the following steps: S1. According to the heart failure disease guidelines, the heart failure stage is divided into heart failure disease risk stage A and heart failure disease risk stage B, and a medical record sequence data set is obtained according to the division results; the medical record sequence data set is composed of multiple groups of medical record sequence data, and each group of medical record sequence data includes N medical record records; S2. construct a triple set for each medical record in the medical record sequence data set, and construct the triple sets of all medical records in each set of medical record sequence data into a triple sequence; S3. Input the medical record sequence data and its triple sequence into the LSTM-CNN module in sequence, and finally output the prediction result; S4. According to the prediction results, the loss function group is used to calculate the loss and back-propagate the training model parameters until the model converges.
2. A heart failure risk prediction method integrating domain knowledge and deep learning according to claim 1, characterized in that: The process of obtaining the medical record data set in step S1 includes: S11. According to the guidelines for heart failure, we identified the risk factor diseases that belong to the risk period A of heart failure, extracted the subjects with risk factor diseases from the mimiciv dataset as sample persons, and extracted all the medical records of each sample person from the mimiciv dataset; the risk factor diseases include hypertension, arrhythmia, coronary artery disease, valvular heart disease, diabetes, and atherosclerotic cardiovascular disease; S12. According to the guidelines for heart failure disease, identify cardiac biomarkers that belong to the risk period B of heart failure disease; for each sample person, search for the first medical record in which the cardiac biomarker is abnormal in all of their medical records, and then extract the medical record and all subsequent medical records as a medical record data; among them, if the sample person has a history of heart failure, extract the first medical record in which the cardiac biomarker is abnormal, the first medical record in which heart failure is detected, and all medical records between the two from all of their medical records, and together they form a medical record data; the cardiac biomarkers include natriuretic peptides and troponins; S13. Feature annotation is performed on each medical record in each medical record sequence data according to the test indicators; the test indicators include indicators with range and indicators without range; indicators with range include: hematocrit, glycosylated hemoglobin, platelet count, red blood cell count, white blood cell count, anion spacing, urea nitrogen, creatinine, blood sodium, blood potassium, alanine aminotransferase, alkaline phosphatase, aspartate aminotransferase, bilirubin, creatine kinase, creatine kinase MB subtype, age, gender, body mass index; indicators without range include height, weight, glomerular filtration rate; S14. After the feature annotation is completed, each medical record data is screened and extracted with the same time step to obtain a set of medical record sequence data. All medical record sequence data constitute a medical record sequence data set.
3. The method for predicting heart failure risk by integrating domain knowledge and deep learning according to claim 1, characterized in that: In step S2, a triple is constructed with the range indicator as the head entity, heart failure as the tail entity, and the correlation between the range indicator and heart failure as the entity relationship; among them, the cause, high-risk factors, risk assessment factors, disease tendency and laboratory test indicators are used as entity relationships to represent the correlation between the range indicator and heart failure, and the importance of their correlation decreases in turn.
4. A heart failure risk prediction method integrating domain knowledge and deep learning according to claim 3, characterized in that: The specific process of step S2 constructing a triple set according to any medical record in the medical record sequence data set includes: S21. Extracting the characteristic value of each range indicator marked in the medical record; S22. For each characteristic value with a range indicator, determine whether it is abnormal. If so, execute step S23; if not, execute step S24; S23. Whether the range indicator has multiple entity relationships with heart failure, if so, select the entity relationship with the highest relevance importance to construct a triple; if not, mark the abnormality before this entity relationship and then construct a triple; S24. Whether the range indicator has multiple entity relationships with heart failure, if so, select the entity relationship with the lowest correlation importance to construct a triple; if not, directly construct a triple based on this entity relationship; S25. All triples with range indicators marked in the medical record form a triple set.
5. The method for predicting heart failure risk by integrating domain knowledge and deep learning according to claim 1, characterized in that: Each LSTM-CNN module consists of 1 improved LSTM unit, 1 CNN unit and 1 self-attention mechanism unit.
6. According to the method for predicting heart failure risk integrating domain knowledge and deep learning according to claim 5, the processing process of the t=1, 2, ..., N LSTM-CNN modules includes: S31. Input the hidden layer state output by the t-1th LSTM-CNN module and the tth medical record in the medical record sequence data into the tth LSTM unit to obtain the hidden layer features; S32. Input the triplet set corresponding to the t-th medical record in the medical record sequence data into the CNN unit to obtain triplet features; S33. Input the hidden layer features and triplet features into the self-attention mechanism unit to obtain the hidden layer state output by the tth LSTM-CNN module.
7. A method for predicting heart failure risk by integrating domain knowledge and deep learning according to any one of claims 5 or 6, characterized in that: The processing of the tth improved LSTM unit is expressed as: f t =sigmoid(x t w fx +h t-1 w fh +b f ) f t ′=f t +f_absolute_posEncoding i t =sigmoid(x t w ix +h t-1 w ih +b i ) i t ′=i t +f_rope_posEncoding x t represents the input data of the current improved LSTM unit, h t-1 represents the hidden state of the previous LSTM-CNN module output; w fx 、w fh is the parameter learned by the forget gate, b f is the forget gate bias term, f t represents the output of the forget gate, f_absolute_posEncoding represents the encoding vector after encoding the time by simulating the absolute position encoding of the time index of the current improved LSTM unit, and f t ' represents the time encoding output of the forget gate; w ix 、w ih Learn the parameters for the input gate, b i is the input gate bias term, i t represents the output of the input gate, f_rope_posEncoding represents the encoding vector after the time index simulation spiral position encoding of the current improved LSTM unit, i t ' represents the positional encoding output of the input gate.
8. A method for predicting heart failure risk by integrating domain knowledge and deep learning according to any one of claims 5 or 6, characterized in that: In the processing of each self-attention mechanism unit, the hidden layer features output by the LSTM unit are used as K values and V values, and the triple features output by the CNN unit are used as Q values.
9. The method for predicting heart failure risk by integrating domain knowledge and deep learning according to claim 1, characterized in that: The formula for calculating the loss in step S4 is: Loss=BCE_Loss+Mean(∑Focal_Loss i ) BCE_Loss=-y pred log(y real )-(1-y pred )log(1-y real ) Focal_Loss i =-y real (1-y pred ) γ log(y pred )except_features i -(1-y real )(y pred ) γ log(1-y pred )except_features i Among them, BCE_Loss is the cross entropy loss, Focal_Loss i represents the focal loss of the i-th feature, Mean() is the averaging operation, γ is an adjustable factor, except_features i Represents the i-th binary vector in the range index vector of a medical record, y pred Represents the predicted value, y real Indicates a label.
10. A heart failure risk prediction system integrating domain knowledge and deep learning for implementing the method according to any one of claims 1 to 9, characterized in that: include: Data collection module, used to obtain patients' medical records; A data processing module, used to divide the acquired medical records into stages of heart failure according to the heart failure disease guidelines, and obtain medical record sequence data; A triplet construction module, used to construct triplet sequences based on medical record sequence data; The model construction training module constructs a heart failure risk auxiliary prediction model including N cascaded LSTM-CNN modules, which is used to train according to the medical record sequence data and its triplet sequence, and save the trained model parameters; the prediction module is used to input the medical record to be predicted into the trained heart failure risk auxiliary prediction model to obtain the risk auxiliary prediction results.
