Method for predicting heparin dosage per hour of anticoagulant drug treatment for cardiac surgery patient
Through machine learning models, predicting the hourly heparin dose of patients with heart surgery, solving the problem of inaccurate recommendation of heparin dose in the prior art, realizing accurate anticoagulation treatment during the perioperative period of heart surgery, and improving patient safety and surgical success rate .
Patent Information
- Application Number
- CN202411123151.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-15
- Publication Date
- 2024-12-10
AI Technical Summary
In the prior art, in perioperative anticoagulant treatment of heart surgery patients, the recommendation of heparin dose is usually not performed per hour, and based on limited clinical data and characteristics, resulting in dose errors that affect patient safety and rehabilitation.
Using machine learning model, the regression model is constructed by collecting and processing electronic medical record data using a full connection layer and Self-Attention mechanism to predict hourly heparin doses, combined with deep learning and clinical knowledge, verify the reliability of the model, and adjust the heparin dosage speed in real time .
It achieves accurate recommendations for heparin speeds in real time based on changes in patients' health status, improves the accuracy and safety of anticoagulation treatment, reduces the risk of thrombosis and bleeding, and enhances the success rate of surgery and patient safety.
Smart Images

Figure CN119108075A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of perioperative anticoagulation therapy for cardiac surgery, and in particular to a method for predicting hourly heparin dosage for anticoagulation drug therapy for cardiac surgery patients. Background Art
[0002] Perioperative anticoagulation therapy for cardiac surgery is very important, and it involves multiple stages before and after the operation to ensure the safety of the patient and the success of the operation. Among them, preoperative evaluation means that before the operation, the doctor needs to conduct a comprehensive assessment of the patient's coagulation function and understand the patient's coagulation status in order to formulate a suitable anticoagulation treatment plan; intraoperative anticoagulation means that during the operation, the doctor will select appropriate anticoagulants and doses according to the needs of the operation and the patient's coagulation status to maintain the blood flow and avoid thrombosis; postoperative anticoagulation means that the patient needs to continue to receive anticoagulant therapy after the operation to prevent the occurrence of thrombosis and embolic events. The doctor will adjust the dose and medication time of the anticoagulant according to the patient's recovery to ensure the patient's safety. Anticoagulation monitoring means that during the perioperative period, the doctor will regularly monitor the patient's coagulation function, including prothrombin time (PT), activated partial thromboplastin time (APTT) and other indicators, so as to adjust the dose of anticoagulants in time to ensure that the anticoagulation effect is within a safe range.
[0003] Perioperative anticoagulation is very necessary: first, to prevent thrombosis. Cardiac surgery, especially valve replacement, can easily cause thrombosis in the artificial valve in the patient's body. Anticoagulant therapy can inhibit the activity of coagulation factors and reduce platelet aggregation, thereby preventing thrombosis and reducing the incidence of postoperative embolic events. After heart valve replacement, platelet deposition and fibrin deposition are easily formed on the surface of the artificial valve, leading to thrombosis. Anticoagulant therapy can inhibit the activity of coagulation factors and prevent blood coagulation, thereby reducing the formation of thrombi; second, to maintain blood flow: anticoagulant therapy helps to maintain the flow of blood in blood vessels, avoid blood clots in the heart or blood vessels, and ensure the normal functioning of the heart; third, to prevent endocarditis, which is an infectious heart disease caused by bacteria or other microorganisms. Heart valve replacement may damage the integrity of the heart and increase the risk of infection. Anticoagulation therapy helps to reduce the time blood stays in the heart, reducing the chance of infection; Finally, reduce the risk of infection: Anticoagulation therapy can reduce the time blood stays in the heart, reducing the risk of bacteria and other microorganisms growing in the heart and causing infection.
[0004] In summary, anticoagulant therapy needs to balance the prevention of thromboembolism and the risk of surgical bleeding. For patients undergoing coronary artery bypass grafting and mechanical valve prosthesis replacement, anticoagulant therapy is required to prevent coronary artery or intracardiac thrombosis. Among anticoagulants, heparin has a strong anticoagulant effect, especially in patients who are prone to thromboembolism, bleeding or serious related complications. However, the ideal dose of ordinary heparin varies significantly between patients in different situations; therefore, the time to reach the optimal dose may be prolonged. Perioperative anticoagulant therapy in cardiac surgery is one of the key measures to ensure patient safety and surgical success. Doctors need to develop appropriate anticoagulant therapy plans based on the patient's specific situation and surgical needs, and conduct regular monitoring and adjustments to ensure the patient's safety and recovery. Moreover, the currently recommended heparin dose is not recommended according to the hourly heparin dose. Only using single or limited clinical oligodata and selecting only a few features of interest for research will result in errors in the final heparin dose for the patient, which will affect the patient's own. Summary of the invention
[0005] The present invention provides a method for predicting the hourly heparin dosage of anticoagulant drug therapy for cardiac surgery patients, so as to solve the defects in the prior art.
[0006] The present invention is achieved through the following technical solutions:
[0007] A method for predicting hourly heparin doses for anticoagulant therapy in cardiac surgery patients comprises the following steps:
[0008] Step 1: Collect electronic medical record data to be incorporated into the machine learning model;
[0009] Step 2: Divide the data of each case into fixed data and sequence variable data;
[0010] Step 3: Feature screening: Delete the features without obvious meaning in the original features, and then normalize the features with the same essential meaning. For the remaining features, filter out the features with a missing rate greater than 99% to obtain the final feature set.
[0011] Step 4: Data preprocessing; divide all features into discrete features and continuous features;
[0012] Step 5: Model construction: Use the fully connected layer (FC) and the Self-Attention mechanism to build a regression model (FC+Self-Attention model) that can predict the heparin speed;
[0013] Step 6: Model training; the feature data processed by feature engineering is used as the model input, and the patient’s actual heparin dose at the next moment is used as the output, which together constitute the final data set.
[0014] In the method for predicting the hourly heparin dosage for anticoagulant treatment of cardiac surgery patients as described above, the electronic medical record data in step 1 includes various document data such as medical record front page, admission record, examination report, test report, vital signs and monitoring data.
[0015] In the method for predicting the hourly heparin dosage for anticoagulant treatment of cardiac surgery patients as described above, the fixed data in step 2 refers to data that no longer changes during the current hospitalization visits, and the sequence variable data refers to data that may be updated at any time during the current hospitalization visits. In order to be input into the subsequent machine learning model, the sequence variable data is fixed, that is, if there are features with multiple values, the latest value is used as the final value of the feature.
[0016] In the method for predicting the hourly heparin dosage for anticoagulant treatment of cardiac surgery patients as described above, in step 4, the discrete features are encoded by the One-Hot method, where the presence of a feature is represented by 1, and the absence of a feature is represented by 0.
[0017] In the method for predicting the hourly heparin dosage for anticoagulant treatment of cardiac surgery patients as described above, in step 4, for continuous features, the test report can convert the features according to the normal range corresponding to the features, converting those exceeding the normal range into "high" and those below the normal range into "low".
[0018] As described above, the method for predicting the hourly heparin dose for anticoagulant treatment of cardiac surgery patients first uses the 3σ principle based on the normal distribution to detect outliers for the remaining continuous features, with μ±3σ as the detection boundary. Values beyond the boundary are considered outliers and replaced with the mean of the feature, where μ is the feature mean and σ is the feature standard deviation. The missing values in the continuous features are filled using the KNN (K-Nearest Neighbor) interpolation method. Finally, the features are numerically standardized using the mean and standard deviation. Formula 1 is as follows:
[0019]
[0020] Where μ is the mean of feature x and s is the standard deviation of feature x.
[0021] In the method for predicting the hourly heparin dose of anticoagulant drug treatment for cardiac surgery patients as described above, the regression model in step 5 is divided into two parts. One part is a commonly used feedforward neural network, which contains 4 layers in total. The number of neurons in each layer is [64, 32, 16, 1], and each layer applies a Relu activation function to increase the nonlinear computing power, and adds BN (Batch Normalization) to normalize the output of the neural network and scale it to the same scale, which can improve the training efficiency and performance of the model. In addition, Dropout is used to reduce the overfitting of the model. The other part is the Self-Attention layer. The introduction of the attention mechanism can calculate the mutual influence between features. For the input of the Self-Attention layer, it is multiplied by the three weight matrices to obtain the three matrices Q, K, and V. The calculation formula 2 is as follows:
[0022]
[0023] As described above, the method for predicting the hourly heparin dosage for anticoagulant treatment of cardiac surgery patients, the operation for obtaining the feature data processed in step six is: for the height and weight characteristics, the BMI index is calculated; in order to introduce certain historical information, the heparin speed at the previous moment is introduced; at the same time, 4-dimensional features are also processed for the APTT feature, namely, the difference between the APTT value at the current moment and the last test, the difference between the APTT value at the current moment and the previous moment, the upper limit of normal minus the current APTT value, and the current APTT value minus the lower limit of normal.
[0024] In the method for predicting the hourly heparin dose for anticoagulant therapy in cardiac surgery patients as described above, the specific operation of model training in step 6 is as follows: the data set is divided into a training set and a test set according to an 8:2 ratio. The training set is used to train the model, and the test set is used to evaluate the final effect of the model in predicting the heparin dose. The evaluation method adopts MAE (Mean Absolute Error), and the model is trained using a gradient descent algorithm, and finally the model weight with the best MAE on the test set is retained as the final heparin dose recommendation model.
[0025] The advantages of the present invention are:
[0026] The present invention starts from the perspective of big data, incorporates as many data features as possible into the experiment, and captures the functional relationship between the features and the heparin speed through a deep learning model. Then, the model obtained by deep learning training is combined with clinical knowledge to verify and explain the reliability of the prediction model, so as to better enable the prediction model to assist in clinical practical applications; at the same time, the present invention uses the clinical real heparin administration speed at each time point (hour) as the data label, and the features such as the patient's physical examination, test report and vital signs at each time point (hour) as the model input, outputs the recommended heparin speed at the current time point, and realizes that the recommended heparin speed is given at any time according to the changes in the patient's health status during the treatment process; moreover, the present invention uses the FC+Self-Attention model to establish a good performance heparin pump speed hour adjustment suggestion. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0028] Figure 1 It is a schematic diagram of the process of the present invention;
[0029] Figure 2 It is a schematic diagram of the structure of the regression model (FC+Self-Attention model) of the present invention;
[0030] Figure 3 It is a schematic diagram of the total number of patients meeting the inclusion criteria and the time of admission during 2012-2022 of the validation test of the present invention;
[0031] Figure 4 It is a schematic diagram of the point value analysis of the intravenous heparin pumping speed of the patients enrolled in the validation test of the present invention;
[0032] Figure 5 It is a schematic diagram of the analysis of intravenous heparin dosage for patients enrolled in the validation test of the present invention;
[0033] Figure 6 It is a schematic diagram of the intravenous heparin pumping rate point values and the distribution of patients with intravenous heparin injections in the validation test of the present invention;
[0034] Figure 7 It is a schematic diagram of the distribution of the number of APTT monitoring and the APTT monitoring time interval during the period from the start of heparin treatment to the APTT reaching the target in the verification test of the present invention;
[0035] Figure 8It is a schematic diagram of APTT monitoring after initial heparin treatment in the validation test of the present invention;
[0036] Fig. 9 It is a schematic diagram of the number of heparin injections and the time after the initiation of heparin in the validation test of the present invention;
[0037] Fig.10 It is a schematic diagram of the number of patients reaching the APTT target range in different time periods after the initial heparin treatment in the validation test of the present invention;
[0038] Fig.11 It is a statistical diagram of the ICU patients transferred to the previous department in the verification test of the present invention;
[0039] Fig.12 Schematic diagram of the distribution of APTT values of patients from vascular surgery and patients from cardiac surgery 24-72 hours after the initial heparin treatment in the validation test of the present invention;
[0040] Fig.13 This is one of the schematic diagrams comparing the actual value and the predicted result of the verification test of the present invention;
[0041] Fig.14 This is the second schematic diagram comparing the actual value and the predicted result of the verification test of the present invention;
[0042] Fig.15 It is the SHAP diagram of the top 20 important features of the verification test of the present invention;
[0043] Fig.16 It is the SHAP diagram of the top 20 important features after removing heparin in the verification test of the present invention;
[0044] Fig.17 is a flow chart of further screening data according to characteristics for the validation test of the present invention;
[0045] Fig.18 This is the third schematic diagram of the comparison between the actual value and the predicted result of the verification test of the present invention;
[0046] Fig.19 This is the fourth schematic diagram of comparison between the actual value and the predicted result of the verification test of the present invention;
[0047] Fig. 20 This is the fifth schematic diagram comparing the actual value and the predicted result of the verification test of the present invention. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are 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.
[0049] like Figure 1 As shown, a method for predicting hourly heparin dosage for anticoagulant therapy in cardiac surgery patients comprises the following steps:
[0050] Step 1: Collect electronic medical record data to be incorporated into the machine learning model;
[0051] Step 2: Divide the data of each case into fixed data and sequence variable data; The present invention divides the data of each case into fixed data and sequence variable data. Fixed data refers to data that no longer changes during the current hospitalization, such as diseases in the past medical history, which represent the patient's past history, and they will not change; sequence variable data refers to data that may be updated at any time during the current hospitalization, such as multiple test reports may be generated during hospitalization, which means that certain features have multiple values over time. In order to input into the subsequent machine learning model, the sequence variable data is fixed, that is, for features with multiple values, the latest value is used as the final value of the feature;
[0052] Step 3: Feature screening; delete the features without obvious meaning in the original features, such as "past history / disease / chronic disease", "current medical history / disease / nodule", etc., which lack obvious reference meaning, and then normalize the features with the same essential meaning, such as "mild mitral regurgitation" and "mild mitral regurgitation" are normalized to "mild mitral regurgitation"; in addition, for the remaining features, filter out the features with a missing rate greater than 99% to obtain the final feature set;
[0053] Step 4: Data preprocessing; divide all features into discrete features and continuous features;
[0054] Step 5: Model construction: Use the full connection layer (FC) and the Self-Attention mechanism to build a regression model that can predict the heparin speed (FC+Self-Attention model, its structure is as follows Figure 2 shown);
[0055] Step 6: Model training; the feature data processed by feature engineering is used as the model input, and the patient’s actual heparin dose at the next moment is used as the output, which together constitute the final data set.
[0056] Specifically, the electronic medical record data in step one described in this embodiment includes various document data such as the medical record front page, admission record, examination report, test report, vital signs and monitoring data, among which the medical record front page mainly includes basic information such as gender and age; the admission record includes data such as the chief complaint, current medical history, past medical history, personal history, family history, menstrual marital history and physical examination.
[0057] Specifically, the fixed data in step 2 described in this embodiment refers to data that no longer changes during the current hospitalization, such as diseases in the past medical history that represent the patient's past historical conditions, which will not change; the sequence variable data refers to data that may be updated at any time during the current hospitalization, such as multiple test reports that may be generated during hospitalization, which means that certain features have multiple values as time changes; in order to input into the subsequent machine learning model, the sequence variable data is fixed, that is, for features with multiple values, the latest value is used as the final value of the feature.
[0058] More specifically, in step 4 described in this embodiment, for discrete features, feature encoding is performed using the One-Hot method, where the presence of a feature is represented by 1, and the absence of a feature is represented by 0.
[0059] More specifically, in step 4 of this embodiment, for continuous features, the test report can transform the features according to the normal range corresponding to the features, converting those exceeding the normal range into "high" and those below the normal range into "low".
[0060] Furthermore, in this embodiment, the remaining continuous features are first detected for outliers using the 3σ principle based on normal distribution, with μ±3σ as the detection boundary. Values beyond the boundary are considered outliers and replaced with the mean of the feature, where μ is the feature mean and σ is the feature standard deviation. The missing values in the continuous features are filled using the KNN (K-NearestNeighbor) interpolation method. Finally, the features are numerically standardized using the mean and standard deviation, as shown in Formula 1:
[0061]
[0062] Where μ is the mean of feature x and s is the standard deviation of feature x.
[0063] Furthermore, the regression model in step 5 described in this embodiment is divided into two parts, one part is a commonly used feedforward neural network, which includes 4 layers, and the number of neurons in each layer is [64, 32, 16, 1], and each layer applies a Relu activation function to increase the nonlinear computing capability, and adds BN (Batch Normalization) to normalize the output of the neural network and scale it to the same scale, which can improve the training efficiency and performance of the model. In addition, Dropout is used to reduce the overfitting of the model; the other part is the Self-Attention layer. The introduction of the attention mechanism can calculate the mutual influence between features. For the input of the Self-Attention layer, it is multiplied by the three weight matrices to obtain the three matrices Q, K, and V. The calculation formula 2 is as follows:
[0064]
[0065] Furthermore, the feature data obtained after processing in step six described in this embodiment are as follows: for the height and weight features, the BMI index is calculated; in order to introduce certain historical information, the heparin speed at the previous moment is introduced; at the same time, 4-dimensional features are also processed for the APTT feature, namely, the difference between the APTT value at the current moment and the last test, the difference between the APTT value at the current moment and the previous moment, the normal upper limit minus the current APTT value, and the current APTT value minus the normal lower limit.
[0066] Furthermore, in step 6 of this embodiment, the specific operation of model training is as follows: the data set is divided into a training set and a test set according to an 8:2 ratio. The training set is used to train the model, and the test set is used to evaluate the final effect of the model in predicting the heparin dose. The evaluation method adopts MAE (Mean Absolute Error), and the model is trained using a gradient descent algorithm, and finally the model weight with the best MAE on the test set is retained as the final heparin dose recommendation model.
[0067] Verification test
[0068] 1. Patient Selection and Initial Data Collection
[0069] Study population: Retrospectively collected ICU cases
[0070] Inclusion criteria:
[0071] 1. Age ≥ 18 years old;
[0072] 2. Receiving intravenous unfractionated heparin (UFH) treatment during ICU hospitalization;
[0073] 3. At least one APTT test result before and after the initial heparin treatment;
[0074] 4. APTT results reach the normal range within 8-24 hours after initial heparin treatment.
[0075] Exclusion criteria:
[0076] 1. The interval between the last APTT test and the initial heparin treatment exceeds 24 hours;
[0077] 2. Less than 2 APTT test results within 8-24 hours after initial heparin treatment;
[0078] 3. Missing key clinical characteristics (such as weight, ALT, etc.).
[0079] Between 2012 and 2022, a total of 1460 patients meeting the inclusion criteria were enrolled, with 10 to 20 patients enrolled each month (the number of patients and the time of admission were as follows Figure 3 shown).
[0080] Prediction target (sample label) definition: APTT uses the average value within 8-24 hours after the start of heparin treatment and is divided into three intervals of 0-35s, 35-45s, and >45s.
[0081] Feature selection: Total heparin dose was used as the input feature, calculated as the total heparin dose within 8 hours after starting heparin therapy.
[0082] A total of 130,000 intravenous heparin pumping rate points were analyzed for the enrolled patients (eg Figure 4 The average speed is 7.9u / kg·h.
[0083] A total of 1152 intravenous heparin doses were analyzed in the enrolled patients (eg Figure 5 The average injected dose was 819±597u.
[0084] A total of 130,000 intravenous heparin pump rate points and 1,152 intravenous heparin injections were included in the study (eg Figure 6 95.3% of the patients had intravenous heparin pump speed points ≤ 400 and intravenous heparin injection times ≤ 4 times.
[0085] Usually, 2-4 APTT monitorings are completed after the initiation of heparin therapy and before the APTT reaches the target. The average APTT monitoring interval is 4.3 hours (eg Figure 7 At the fifth APTT monitoring, 96.5% of patients could reach the target range of APTT (as shown in Figure 8 shown).
[0086] The patient data are sorted in chronological order, and then starting from the initial use of heparin, multiple training samples are generated with 1 hour as a time step, and the corresponding labels are the heparin speed in this time interval.
[0087] The model uses a fully connected layer (FC) and a Self-Attention mechanism to construct a regression model (FC+Self-Attention model) that can predict the heparin speed to predict the heparin speed at the next moment.
[0088] Of the 1460 patients, 504 (35%) received intravenous heparin boluses. Of the 1149 intravenous heparin boluses, 158 (13.8%) were given as the initial intravenous heparin bolus, 638 (55.5%) were given within 24 hours, and 370 (74.4%) of the 497 patients had their first intravenous heparin bolus within 24 hours, and 329 (66.2%) within 12 hours (e.g. Fig. 9 After starting heparin therapy, about three-quarters of patients reach the APTT target range for the first time within 24 hours (as shown in Fig.10 shown).
[0089] Statistics of ICU patients before transfer to the previous department (such as Fig.11 The average APTT value of patients from vascular surgery was 43.7±11.4s and that of patients from cardiac surgery was 238.1±7.3s 24-72 hours after the start of heparin treatment (as shown in Figure 2). Fig.12 shown).
[0090] 2. Model Training
[0091] 70632 heparin speed values were selected as the training set, and 17554 heparin speed values were selected as the test set to compare the predicted results with the actual results. The mean absolute error (MAE) was 1.566 u / kg·h, and the mean percentage error (MAPE) was 0.332 (e.g. Fig.13 and Fig.14 As shown), we get the SHAP diagram of the top 20 important features (as shown Fig.15 ) and the SHAP diagram of the top 20 important features after removing heparin (as shown in Fig.16 As shown in the figure), the influence of each characteristic parameter on the result can be clearly seen.
[0092] And further filter the data according to the characteristics (such as Fig.17 After the data screening, 90% of the samples were randomly trained and 10% of the samples were tested for classification training. The final average absolute error MAE was 1.374u / kg·h (as shown in Fig.18 As shown); the average absolute error MAE obtained by randomly training with 80% samples and 20% samples for testing is 1.293u / kg·h (as shown Fig.19As shown), we then learned that the average absolute error obtained by training the dataset with a ratio of 8:2 into training and test sets is lower and the accuracy is higher.
[0093] Four new features were added for the APTT feature, namely the difference between the current APTT value and the last test, the difference between the current APTT value and the last test, the upper limit of normal minus the current APTT value (45 minus the APTT value), and the current APTT value minus the lower limit of normal (APTT value minus 35). Then, 80% of the samples were randomly trained and 20% of the samples were tested for classification training. The final average absolute error MAE was: 0.8419u / kg·h (such as Fig. 20 As shown), by introducing 4 new features for the APTT feature, it can be seen that the mean absolute error is further reduced, and thus after adding 4 new features for the APTT feature, the mean absolute error is further reduced and the accuracy is further improved.
[0094] Through the above verification test, it can be known that the present invention uses the FC+Self-Attention model to establish a good performance heparin pump speed hourly adjustment suggestion, so as to achieve the recommended heparin speed at any time and more accurately according to the changes in the patient's health status during the treatment process.
[0095] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for predicting hourly heparin dosage for anticoagulant therapy in cardiac surgery patients, characterized in that: The steps include: Step 1: Collect electronic medical record data to be incorporated into the machine learning model; Step 2: Divide the data of each case into fixed data and sequence variable data; Step 3: Feature screening: Delete the features without obvious meaning in the original features, and then normalize the features with the same essential meaning. For the remaining features, filter out the features with a missing rate greater than 99% to obtain the final feature set. Step 4: Data preprocessing; divide all features into discrete features and continuous features; Step 5: Model construction: Use the fully connected layer and the Self-Attention mechanism to build a regression model that can predict the heparin speed; Step 6: Model training; the feature data processed by feature engineering is used as the model input, and the patient’s actual heparin dose at the next moment is used as the output, which together constitute the final data set.
2. The method for predicting hourly heparin dosage for anticoagulant drug treatment in cardiac surgery patients according to claim 1, characterized in that: The electronic medical record data in step 1 includes various document data such as medical record front page, admission record, examination report, test report, vital signs and monitoring data.
3. The method for predicting hourly heparin dosage for anticoagulant drug treatment in cardiac surgery patients according to claim 1, characterized in that: The fixed data in step 2 refers to data that no longer changes during the current hospitalization visits, and the sequence variable data refers to data that may be updated at any time during the current hospitalization visits. In order to input into the subsequent machine learning model, the sequence variable data is fixed, that is, if there are features with multiple values, the latest value is used as the final value of the feature.
4. The method for predicting hourly heparin dosage for anticoagulant drug treatment in cardiac surgery patients according to claim 1, characterized in that: In the step 4, for discrete features, feature encoding is performed using the One-Hot method, where the presence of a feature is represented by 1, and the absence of a feature is represented by 0.
5. The method for predicting hourly heparin dosage for anticoagulant drug treatment in cardiac surgery patients according to claim 1, characterized in that: In the step 4, for the continuous characteristics, the test report can transform the characteristics according to the normal range corresponding to the characteristics, converting those exceeding the normal range into "high" and those below the normal range into "low".
6. The method for predicting hourly heparin dosage for anticoagulant drug treatment in cardiac surgery patients according to claim 5, characterized in that: For the remaining continuous features, the 3σ principle based on the normal distribution is first used to detect outliers, with μ±3σ as the detection boundary. Values beyond the boundary are considered outliers and replaced with the mean of the feature, where μ is the feature mean and σ is the feature standard deviation. The missing values in the continuous features are filled using the KNN (K-Nearest Neighbor) interpolation method. Finally, the features are numerically standardized using the mean and standard deviation. Formula 1 is as follows: Where μ is the mean of feature x and s is the standard deviation of feature x.
7. The method for predicting hourly heparin dosage for anticoagulant drug treatment in cardiac surgery patients according to claim 1, characterized in that: The regression model in step 5 is divided into two parts; one part is a commonly used feedforward neural network, which contains 4 layers in total. The number of neurons in each layer is [64, 32, 16, 1], and each layer applies a Relu activation function to increase the nonlinear computing capability, and adds BN to normalize the output of the neural network and scale it to the same scale, which can improve the training efficiency and performance of the model. In addition, Dropout is used to reduce the overfitting of the model; the other part is the Self-Attention layer. The introduction of the attention mechanism can calculate the mutual influence between features. For the input of the Self-Attention layer, it is multiplied by the three weight matrices to obtain the three matrices Q, K, and V. The calculation formula 2 is as follows:
8. The method of claim 1 for predicting hourly heparin dosage for anticoagulant therapy in cardiac surgery patients, characterized in that: The operations for obtaining the feature data after processing in the step six are as follows: for the height and weight features, the BMI index is calculated; in order to introduce certain historical information, the heparin speed at the previous moment is introduced; at the same time, 4-dimensional features are also processed for the APTT feature, namely, the difference between the APTT value at the current moment and the last test, the difference between the APTT value at the current moment and the previous moment, the normal upper limit minus the current APTT value, and the current APTT value minus the normal lower limit.
9. The method of claim 1, wherein: The specific operation of model training in step 6 is as follows: the data set is divided into a training set and a test set according to an 8:2 ratio, the training set is used to train the model, and the test set is used to evaluate the final effect of the model in predicting the heparin dose. The evaluation method adopts MAE, and the model is trained using a gradient descent algorithm, and finally the model weight with the best MAE on the test set is retained as the final heparin dose recommendation model.
