Heart failure risk prediction model construction method based on transfer learning
Through the heart failure risk prediction model based on transfer learning, integrating multi-dimensional clinical data and using transfer learning technology and adaptive moment estimation optimization algorithm, the accuracy and adaptability of traditional heart failure risk prediction are solved, and efficient and accurate risk grading and personalized intervention guidance are achieved.
Patent Information
- Application Number
- CN202510437600.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-09
- Publication Date
- 2025-07-25
AI Technical Summary
The existing methods of heart failure risk prediction rely on traditional medical evaluation, with problems such as subjective differences and low prediction accuracy, and the existing machine learning models have poor adaptability in different data sets and clinical scenarios, making it difficult to meet actual needs.
A heart failure risk prediction model based on transfer learning is adopted, and a heart failure risk prediction model is generated by integrating multi-dimensional clinical data, using transfer learning technology to fine-tune the medical pre-trained model of Transformer architecture, and combining adaptive moment estimation optimization algorithm and threshold grading strategy.
It improves the accuracy and adaptability of heart failure risk prediction, reduces misdiagnosis and misdiagnosis, provides clear risk classification guidance, and supports personalized intervention and health management.
Smart Images

Figure CN120376133A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the cross - field of medical artificial intelligence and deep learning, and particularly to a method for constructing a heart failure risk prediction model based on transfer learning. Background Art
[0002] Heart failure, as a serious cardiovascular disease, poses a major threat to human health. Its incidence and mortality rates are on the rise year by year, bringing a heavy economic burden to society and families. Therefore, early and accurate risk prediction of heart failure and timely taking of effective intervention measures are of crucial significance for improving the prognosis of patients and reducing mortality.
[0003] Currently, the clinical methods for predicting the risk of heart failure mainly rely on traditional medical evaluations and empirical judgments. Traditional methods usually rely on doctors' clinical experience, combined with some medical histories, physical signs of patients and limited laboratory test results for comprehensive judgment. However, this approach has certain limitations. On the one hand, the subjective factors of doctors will affect the judgment results, and the judgment criteria of different doctors may vary; on the other hand, it is difficult for traditional methods to comprehensively and accurately consider the influence of various complex factors on the risk of heart failure occurrence, resulting in relatively low accuracy and reliability of the prediction.
[0004] With the rapid development of information technology, the application of machine learning and deep learning technologies in the medical field has gradually increased. Although there are some studies attempting to use these technologies to construct heart failure risk prediction models, most of these models are trained from scratch, requiring a large amount of labeled data, with a time - consuming training process and high consumption of computing resources. At the same time, the adaptability of these models in different datasets and clinical scenarios is poor, and it is difficult to meet the needs of actual clinical applications.
[0005] In addition, existing prediction models often lack a detailed grading of prediction results, and cannot provide clear risk prompts and targeted intervention suggestions for doctors and patients, which is not conducive to clinical decision - making and patient health management.
[0006] Therefore, developing a heart failure risk prediction model with high prediction accuracy, strong adaptability and reasonable grading of prediction results is of great practical significance. High prediction accuracy allows doctors to accurately identify high - risk patients and reduce the misdiagnosis and missed diagnosis rates; strong adaptability breaks geographical and data barriers, facilitating clinical promotion, and reasonable grading can provide differentiated guidance for different risk groups, which not only improves the utilization rate of medical resources but also helps the clinical prevention and treatment of heart failure to move towards scientific and standardized. Summary of the Invention
[0007] The objective of the present invention is to provide a method for constructing a heart failure risk prediction model based on transfer learning. By innovatively applying transfer learning technology, multi-dimensional clinical data integration, and refined threshold classification strategies, it overcomes the drawbacks of traditional heart failure risk prediction methods, such as low prediction accuracy, poor adaptability, and lack of risk stratification guidance. It significantly improves the prediction accuracy, enhances the adaptability of the model in different clinical scenarios, and realizes risk stratification guidance. It is particularly suitable for clinical diagnosis and treatment scenarios with extremely high requirements for prediction accuracy and intervention timeliness, provides a reliable solution for the early diagnosis and personalized intervention of heart failure, and strongly promotes the efficient development of cardiovascular disease prevention and treatment work.
[0008] To achieve the above objective, the present invention provides a method for constructing a heart failure risk prediction model based on transfer learning, including the following steps: S1. Collect the clinical data of the group without heart failure and the group with heart failure. The clinical data includes medical history, physical sign data, and laboratory test results, and perform data cleaning and standardization processing on the clinical data to generate a heart failure data set; S2. Use a medical pre-trained model as the basic model, and through transfer learning technology, make the medical pre-trained model adaptable to the heart failure risk prediction task to generate a heart failure model; S3. Use the adaptive moment estimation optimization algorithm to optimize the parameters of the heart failure model on the heart failure data set to improve the prediction accuracy; S4. Use a threshold algorithm to divide the heart failure risk into three levels: low risk, medium risk, and high risk according to the prediction probability output by the heart failure model; S5. Use performance indicators to evaluate the effect of the heart failure model. When the performance indicators fail to reach the preset threshold, re-execute steps S1, S2, and S3.
[0009] Further, in step S1, the clinical data ensures that the data volumes of the people without heart failure and the people with heart failure are consistent;
[0010] The medical history data includes cardiovascular disease history, medication history, surgical history, and family history;
[0011] The physical sign data includes blood pressure, heart rate, respiratory rate, body mass index, and cardiac function classification;
[0012] The laboratory test data includes blood biochemical indicators, myocardial injury markers, and inflammatory markers;
[0013] Further, the data cleaning includes handling missing values and removing outliers;
[0014] For handling the missing values, the mode filling method is used for the medical history data, the time series linear interpolation method is used to complete the physical sign data, and the similar case filling method is used for the laboratory test data;
[0015] The outlier removal determines and removes the abnormal data in the clinical data through a preset threshold;
[0016] The processing of missing values and the outlier removal require manual determination of the final result of the clinical data processing;
[0017] Furthermore, the standardization processing uses Z-score to normalize the clinical data, which is expressed as follows:
[0018]
[0019] where x norm represents the eigenvalue of the clinical data after normalization, x represents the eigenvalue of the original clinical data, μ x represents the mean of the clinical data features, and σ x represents the standard deviation of the clinical data features.
[0020] Furthermore, the medical pre-trained model in step S2 is a deep learning model pre-trained on the general medical dataset MIMIC-III based on the Transformer architecture;
[0021] The transfer learning technology includes parameter initialization transfer, hierarchical fine-tuning strategy, and dynamic loss optimization;
[0022] The parameter initialization transfer directly uses the parameters of the medical pre-trained model as the initial model parameters of the heart failure model;
[0023] The hierarchical fine-tuning strategy only updates the classification output layer of the heart failure model, and the input layer and hidden layer of the heart failure model remain unchanged;
[0024] The dynamic loss optimization updates the parameters of the heart failure model by designing a hybrid loss function, and the hybrid loss function is expressed as follows:
[0025] L mig = α·||θ enc -θ pre ||2+(1-α)L tar
[0026] where L mig represents the total transfer loss, and the parameters of the heart failure model are updated by minimizing L mig ; θ enc is the current parameter of the heart failure model, and θ pre is the parameter of the heart failure model at initialization; L tar represents the training loss of the heart failure model on the heart failure dataset, and α represents the balance coefficient.
[0027] Further, the training loss L of the heart failure model on the heart failure dataset is tar The weighted cross entropy loss function is used for calculation, which is expressed as follows:
[0028]
[0029] Wherein, N represents the number of heart failure data sets, y i represents the true label of the i-th sample in the heart failure dataset, p i Indicates that the heart failure model predicts that the label of sample i is y i The probability of w + and w - Represents the weight coefficient.
[0030] Further, the adaptive moment estimation optimization algorithm in step S3 is expressed as follows:
[0031]
[0032] Among them, θ t represents the heart failure model parameters of the t-th iteration, and η represents the initial learning rate; and They represent first-order moment estimation and second-order moment estimation respectively. The first-order moment provides direction for updating the parameters of the heart failure model; the second-order moment is used to adjust the learning rate of the heart failure model; ∈ represents a very small constant to prevent the denominator from being 0.
[0033] Further, the calculation process of the threshold algorithm in step S4 is: setting the low risk threshold P low , and the medium risk threshold P medium , when the heart failure model predicts that the probability of heart failure is P and is less than P low , which is low risk; when P is greater than P low and less than P medium It is judged as medium risk; when P is greater than P medium Determined to be high risk;
[0034] Furthermore, the performance indicator evaluation in step S5 includes precision and recall; when the precision and recall fail to reach the preset threshold at the same time, steps S1, S2, and S3 are re-executed.
[0035] Compared with the prior art, the advantages of the present invention are:
[0036] (1) Multi-dimensional data integration and high-precision prediction: The system of the present invention integrates medical history, physical examination data, and laboratory test results. Through data cleaning and standardization, it mines the potential value of the data. By using transfer learning technology to fine-tune the medical pre-trained model, the model can capture complex clinical features, greatly improving the accuracy of heart failure risk prediction and reducing misdiagnosis and missed diagnosis.
[0037] (2) Transfer learning empowerment and high adaptability: Based on the medical pre-trained model with the Transformer architecture, with the help of parameter initialization transfer, hierarchical fine-tuning strategy, and dynamic loss optimization, the model can quickly adapt to the heart failure risk prediction task. Compared with the model trained from scratch, it significantly reduces the dependence on large-scale specific data and can maintain stable performance in clinical scenarios of different hospitals and different data sets.
[0038] (3) Intelligent optimization algorithm and efficient training: Using the adaptive moment estimation optimization algorithm, it adjusts the direction and learning rate of model parameter update through the first moment and the second moment, accelerating model convergence and shortening the training time. Compared with traditional optimization algorithms, it can achieve higher accuracy with fewer iterations, greatly improving computational efficiency and saving computational resources.
[0039] (4) Scientific risk grading: Using the threshold algorithm to grade the heart failure risk as low, medium, and high, providing clear guidance for doctors to formulate personalized intervention plans. At the same time, it helps patients understand their own health conditions and reasonably arrange health management. Brief Description of the Drawings
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0041] Figure 1 It is the flowchart of the method of the present invention;
[0042] Figure 2 It is the flowchart of step S2 of the present invention;
[0043] Figure 3 It is the flowchart of step S4 of the present invention. Detailed Description of the Invention
[0044] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Apparently, the described embodiments are part of the embodiments of the present application, rather than all of them. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative efforts shall fall within the scope of protection of the present application.
[0045] Embodiment 1: Please refer to Figure 1 As shown, a method for constructing a heart failure risk prediction model based on transfer learning in this embodiment includes the following steps:
[0046] S1. Collect clinical data of the group without heart failure and the group with heart failure. The clinical data includes medical history, physical sign data, and laboratory test results, and perform data cleaning and standardization processing on the clinical data to generate a heart failure data set;
[0047] The clinical data ensures that the data volumes of people without heart failure and people with heart failure are consistent;
[0048] The medical history data includes cardiovascular disease history, medication history, surgical history, and family medical history;
[0049] The physical sign data includes blood pressure, heart rate, respiratory rate, body mass index, and heart function classification;
[0050] The laboratory test data includes blood biochemical indicators, myocardial injury markers, and inflammatory markers;
[0051] The data cleaning includes handling missing values and removing outliers;
[0052] For handling missing values, the mode filling method is used for the medical history data, the time series linear interpolation method is used to complete the physical sign data, and the similar case filling method is used for the laboratory test data;
[0053] The mode filling method fills the missing values by statistically calculating the frequency of each category and taking the category with the highest frequency as the filling value for the missing values;
[0054] The time series linear interpolation method estimates the missing values based on adjacent known data points, and the formula is expressed as follows:
[0055]
[0056] where y mv is the missing value of the physical sign data, t is the time point corresponding to y mv ; y b is the value at the time point t mv which is the previous moment of the time point t corresponding to yb The corresponding data value, y a is y mv the moment t after the corresponding time point t a the corresponding data value;
[0057] The similar case filling method first finds cases that are similar to the case with missing values in other features, and then uses the corresponding laboratory test values of the similar cases to fill the missing values; the similarity between cases is determined by calculating the Euclidean distance, and two cases are determined to be similar if the distance is less than a preset threshold;
[0058] The outlier removal determines and removes the abnormal data in the clinical data through a preset threshold. Through the preset threshold, data values in the clinical data that are not within the preset threshold range are considered abnormal data;
[0059] The processing of missing values and the outlier removal require manual determination of the final result of the clinical data processing; manual determination can incorporate medical expertise and clinical experience. When processing physical sign data and laboratory test data, doctors can comprehensively analyze the data by combining the patient's overall condition, treatment process, and other relevant factors. At the same time, data determined to be abnormal may not necessarily be truly abnormal data due to individual differences in patients, so manual intervention is required for screening;
[0060] The standardization processing uses Z-score to normalize the clinical data, which is expressed as follows:
[0061]
[0062] where, x norm represents the normalized clinical data feature value, x represents the original clinical data feature value, μ x represents the mean of the clinical data feature, and σ x represents the standard deviation of the clinical data feature.
[0063] S2. Use a medical pre-trained model as the basic model, and through transfer learning technology, enable the medical pre-trained model to adapt to the heart failure risk prediction task and generate a heart failure model reference Figure 2 as shown;
[0064] The medical pre-trained model is a deep learning model pre-trained on the general medical dataset MIMIC-III based on the Transformer architecture;
[0065] The Transformer architecture can perform all-round and in-depth feature extraction on the input heart failure dataset through the self-attention mechanism. The heart failure dataset has the characteristic of long sequences. In this embodiment, it is the medical history records of patients over the years, as well as the physical sign data and laboratory test data collected at different time nodes. The Transformer architecture can effectively model long sequence data and learn the long-term dependence relationship of data in the time dimension;
[0066] The transfer learning technique includes parameter initialization transfer, hierarchical fine-tuning strategy, and dynamic loss optimization;
[0067] The parameter initialization transfer directly uses the medical pre-trained model parameters as the initial model parameters of the heart failure model;
[0068] The hierarchical fine-tuning strategy only updates the classification output layer of the heart failure model, and the input layer and hidden layer of the heart failure model remain unchanged;
[0069] The dynamic loss optimization updates the heart failure model parameters by designing a hybrid loss function, and the hybrid loss function is expressed as follows:
[0070] L mig = α·||θ enc -θ pre ||2 + (1 - α)L tar
[0071] Where, L mig represents the total transfer loss, and the heart failure model parameters are updated by minimizing L mig ; θ enc is the current heart failure model parameters, and θ pre is the heart failure model parameters at initialization; L tar represents the training loss of the heart failure model on the heart failure dataset, and α represents the balance coefficient.
[0072] The training loss L tar of the heart failure model on the heart failure dataset is calculated using a weighted cross-entropy loss function, and is expressed as follows:
[0073]
[0074] Where, N represents the number in the heart failure dataset, y i represents the true label of the i-th sample in the heart failure dataset, p i represents the probability that the heart failure model predicts the label of sample i as y i , w + and w -Represents the weight coefficient.
[0075] S3. Use the Adaptive Moment Estimation (Adam) optimization algorithm to optimize the heart failure model parameters on the heart failure dataset to improve the prediction accuracy;
[0076] The Adaptive Moment Estimation (Adam) optimization algorithm is expressed by the following formula:
[0077]
[0078] where θ t represents the heart failure model parameters at the t-th iteration, and η represents the initial learning rate; and represent the first-order moment estimation and the second-order moment estimation respectively. The first-order moment provides the direction for updating the heart failure model parameters; the second-order moment is used to adjust the learning rate of the heart failure model; ∈ represents a very small constant to prevent the denominator from being zero;
[0079] The first-order moment m t is the exponentially weighted moving average of the gradient, and the calculation formula is:
[0080] m t = β1·m t-1 + (1 - β1)·g t
[0081] where β1 is the decay rate of the first-order moment, with a value of 0.9; m t-1 is the first-order moment of the previous iteration, g t is the gradient of the heart failure model parameters θ, and t represents the number of iterations; to correct the bias, the bias-corrected first-order moment is used, and the formula is:
[0082]
[0083] where is the first-order moment decay rate of the t-th round;
[0084] The second-order moment v t is the exponentially weighted moving average of the square of the gradient, and the calculation formula is:
[0085]
[0086] where β2 is the decay rate of the second-order moment, with a value of 0.999, v t-1 is the second-order moment of the previous iteration, is the square of the current iteration gradient; similarly, to correct the bias, the bias-corrected second-order moment is used, and the formula is:
[0087]
[0088] Among them, is the second - moment decay rate of the t - th round.
[0089] S4. Use the threshold algorithm to divide the heart failure risk into three levels: low risk, medium risk, and high risk according to the predicted probability output by the heart failure model;
[0090] The calculation process of the threshold algorithm: Set the low - risk threshold P low , and the medium - risk threshold P medium . When the probability of heart failure predicted by the heart failure model is P and less than P low , it is a low risk; when P is greater than P low and less than P medium , it is determined as a medium risk; when P is greater than P medium , it is determined as a high risk;
[0091] Being determined as the low risk, it is recommended to maintain the current healthy lifestyle and have regular routine physical examinations;
[0092] Being determined as the medium risk, further examinations in the hospital are needed, including echocardiogram to evaluate the heart structure and function;
[0093] When being determined as the high risk, immediate medical treatment should be sought, a comprehensive cardiac specialty examination and evaluation should be carried out, and a targeted intervention and treatment plan should be formulated.
[0094] S5. Use performance indicators to evaluate the effect of the heart failure model. When the performance indicators do not reach the preset threshold, re - execute steps S1, S2, and S3;
[0095] The performance indicator evaluation includes precision and recall rate; when the precision and the recall rate do not reach the preset threshold simultaneously, re - execute steps S1, S2, and S3;
[0096] The precision focuses on the accuracy of the prediction results of the heart failure model. Among all the cases predicted by the heart failure model to have heart failure, count the number of cases with correct predictions (medium - risk and high - risk cases), divide this number by the total number of cases predicted by the model to have heart failure, and the resulting ratio is the precision; for example, if the heart failure model predicts that 100 people have heart failure and 80 of them are indeed ill, the precision is 80÷100 = 80%;
[0097] The recall rate is calculated by counting the number of cases in which the heart failure model successfully predicts the disease among all cases of actual heart failure (medium-risk and high-risk cases), and then dividing this number by the total number of cases of actual heart failure. For example, if there are 100 people with actual heart failure and the model successfully predicts 60 of them, the recall rate is 60÷100 = 60%.
[0098] The above formulas are all dimensionless and only use numerical values for calculation. These formulas are obtained based on a large amount of data and through software simulation, aiming to be as close to the actual situation as possible. The preset parameters in the formulas can be adjusted by those skilled in the art according to specific requirements.
[0099] In the description of this specification, the descriptions referring to terms such as "one embodiment", "example", "specific example", etc. mean that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in a suitable manner in any one or more embodiments or examples.
[0100] The preferred embodiments of the present invention disclosed above are only used to help explain the present invention. The preferred embodiments do not describe all the details in detail, nor do they limit the present invention to the specific implementation manners. Obviously, many modifications and changes can be made according to the content of this specification. These embodiments are selected and specifically described in this specification to better explain the principles and practical applications of the present invention, so that those skilled in the art can understand and utilize the present invention well. The present invention is only limited by the claims and their full scope and equivalents.
Claims
1. A method for constructing a heart failure risk prediction model based on transfer learning, characterized in that, It includes the following steps: S1. Collect the clinical data of the group without heart failure and the group with heart failure. The clinical data includes medical history, physical sign data, and laboratory test results, and perform data cleaning and standardization on the clinical data to generate a heart failure dataset; S2. Use a medical pre-trained model as the basic model, and through transfer learning technology, enable the medical pre-trained model to adapt to the heart failure risk prediction task to generate a heart failure model; S3. Use the adaptive moment estimation optimization algorithm to optimize the parameters of the heart failure model on the heart failure dataset to improve the prediction accuracy; S4. Use a threshold algorithm to divide the heart failure risk into three levels: low risk, medium risk, and high risk according to the prediction probability output by the heart failure model; S5. Use performance indicators to evaluate the effect of the heart failure model. When the performance indicators do not reach the preset threshold, re-execute steps S1, S2, and S3.
2. The method according to claim 1, wherein In step S1, the clinical data ensures that the data volumes of people without heart failure and people with heart failure are the same; The medical history data includes cardiovascular disease history, medication history, surgical history, and family history; The physical sign data includes blood pressure, heart rate, respiratory rate, body mass index, and cardiac function classification; The laboratory test data includes blood biochemical indicators, myocardial injury markers, and inflammatory markers.
3. The method according to claim 2, wherein The data cleaning includes handling missing values and removing outliers; For handling missing values, the mode filling method is used for the medical history data, the time series linear interpolation method is used to complete the physical sign data, and the similar case filling method is used for the laboratory test data; The outlier removal determines and removes the abnormal data in the clinical data through a preset threshold; The final result of processing the clinical data for handling missing values and outlier removal needs to be determined manually.
4. The method according to claim 3, characterized in that, The standardization processing uses Z-score to normalize the clinical data, which is expressed as follows: Among them, xnorm represents the normalized clinical data eigenvalue, x represents the original clinical data eigenvalue, μ x represents the mean of the clinical data feature, σ x represents the standard deviation of the clinical data feature.
5. The method according to claim 1, characterized in that, In step S2, the medical pre-trained model is a deep learning model pre-trained on the general medical dataset MIMIC-III based on the Transformer architecture; The transfer learning technology includes parameter initialization transfer, hierarchical fine-tuning strategy, and dynamic loss optimization; The parameter initialization transfer directly uses the parameters of the medical pre-trained model as the initial model parameters of the heart failure model; The hierarchical fine-tuning strategy only updates the classification output layer of the heart failure model, and the input layer and hidden layer of the heart failure model remain unchanged; The dynamic loss optimization updates the parameters of the heart failure model by designing a hybrid loss function, and the hybrid loss function is expressed as follows: L mig = α · ||θ enc - θ pre ||² + (1 - α)L tar Among them, L mig represents the total migration loss, and the heart failure model parameters are updated by minimizing L mig ; θ enc is the current heart failure model parameter, and θ pre is the heart failure model parameter at initialization; L tar represents the training loss of the heart failure model on the heart failure data set, and α represents the balance coefficient.
6. The method according to claim 5, characterized in that, The training loss L of the heart failure model on the heart failure data set tar Calculated using a weighted cross-entropy loss function, is expressed as follows: where N represents the quantity in the heart failure dataset, y i represents the true label of the i-th sample in the heart failure dataset, p i represents the probability that the heart failure model predicts the label of sample i as y i , and w + and w - represent weight coefficients.
7. The method according to claim 1, characterized in that, In step S3, the formula of the adaptive moment estimation optimization algorithm is expressed as follows: Among them, θ t represents the heart failure model parameters of the t-th iteration, and η represents the initial learning rate; and They represent first-order moment estimation and second-order moment estimation respectively. The first-order moment provides direction for updating the parameters of the heart failure model; the second-order moment is used to adjust the learning rate of the heart failure model; ∈ represents a very small constant to prevent the denominator from being 0.
8. The method according to claim 1, wherein Calculation process of the threshold algorithm described in step S4: Set the low-risk threshold P low , and the medium-risk threshold P medium . When the probability of heart failure predicted by the heart failure model is P and less than P low , it is a low risk; when P is greater than P low and less than P medium , it is determined to be a medium risk; when P is greater than P medium , it is determined to be a high risk.
9. The method according to claim 1, characterized in that In step S5, the performance indicator evaluation includes precision and recall; when the precision and recall do not reach the preset threshold simultaneously, re-execute steps S1, S2, and S3.