Hospital infection risk prediction method and system based on random forest algorithm
By using a hospital infection risk prediction model based on the random forest algorithm, combined with patient physiological characteristics, infection sites, and treatment plans, the problem of low accuracy in hospital infection risk assessment in existing technologies is solved. This model enables personalized identification and prediction, improving prediction accuracy and interpretability.
Patent Information
- Application Number
- CN202411449150.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-17
- Publication Date
- 2024-11-15
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Current technologies have low accuracy in assessing the risk of hospital-acquired infections in patients, especially for patients with different physiological characteristics and those caused by different pathogens.
A hospital infection risk prediction model based on the random forest algorithm was constructed. By acquiring patients' physiological characteristics and infection outcome data, the risk prediction model was trained, and the decision tree of the random forest algorithm was used for risk prediction. The accuracy of the prediction was improved by combining information on infection site, treatment plan and antibiotic use.
It enables personalized identification and prediction of nosocomial infection risks, improves the interpretability and accuracy of prediction results, and helps healthcare workers prevent and detect infection events in advance, reducing adverse effects.
Smart Images

Figure CN118969291A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of risk assessment, and in particular to a hospital infection risk prediction method and system based on a random forest algorithm. Background Art
[0002] Nosocomial infection refers to an infection caused by pathogens during hospitalization when the patient is not infected or in the incubation period of infectious diseases when admitted to the hospital. This infection not only affects the patient's quality of life and recovery, but also increases the patient's medical economic burden and occupies too many medical resources. Therefore, how to detect nosocomial infection events in patients as early as possible and how to effectively control the development of nosocomial infection events in patients have become the key to improving patient treatment outcomes.
[0003] Traditional methods mainly conduct subjective assessments of patients' risk of nosocomial infection based on manual experience, but the accuracy of the assessment results is easily affected by subjective factors such as professional ability and work experience, and patients with different physiological characteristics have different susceptibility to the same pathogen, which leads to different risks of infection. Especially for pathogens that cause endogenous infections, under normal circumstances, these pathogens live in the human body and are not pathogenic, but when the human body has special circumstances such as impaired immune function or decreased resistance, it is possible to cause infection in patients. Patients with different physiological characteristics have different risks of infection caused by the same pathogen, and the risks of different pathogens causing infection in the same patient are also different, which makes it more difficult to assess patients' nosocomial infection events and reduces accuracy. Summary of the invention
[0004] The present invention provides a hospital infection risk prediction method and system based on a random forest algorithm, the purpose of which is to construct a hospital infection risk prediction model based on the random forest model, so as to at least solve the technical problem of low accuracy in risk assessment of hospital infection events in patients based on the existing technology.
[0005] According to a first aspect of the present invention, the present invention claims a method for predicting hospital infection risk based on a random forest algorithm, comprising: Acquire the physiological characteristics of historical patients at a preset observation starting point to obtain historical physiological information; wherein the physiological characteristics include basic characteristics and diagnostic characteristics; Obtaining the infection outcome of a historical patient at a preset observation endpoint to obtain a historical infection outcome; wherein the infection outcome includes an outcome label, and the outcome label is used to indicate whether the corresponding historical patient has a nosocomial infection event before the preset observation endpoint; Constructing a risk prediction model based on random forest, wherein the risk prediction model is used to predict the corresponding outcome label according to the patient's physiological characteristics; Training the risk prediction model according to the historical physiological information and the historical infection outcomes; Acquire target physiological information according to physiological characteristics of target patients; The target physiological information is input into the trained risk prediction model to obtain a target outcome label.
[0006] In one embodiment of the present application, the infection outcome also includes the infection site, and in the risk prediction model constructed based on random forest, it also includes: Dividing the historical patients into a plurality of first patient subsets according to the infection site, each of the first patient subsets includes historical patients with nosocomial infection at the corresponding site and historical patients without nosocomial infection; Constructing a risk prediction sub-model corresponding to each of the first patient subsets based on random forest, wherein the risk prediction sub-model is used to predict the corresponding outcome label according to the patient's physiological information, and obtaining the prediction result of the risk prediction model according to the prediction results of all the risk prediction sub-models; The training of the risk prediction model according to the historical physiological information and the historical infection outcomes also includes training the corresponding risk prediction sub-model according to the historical physiological information and the historical infection outcomes corresponding to each of the first patient subsets.
[0007] In one embodiment of the present application, the step of obtaining the prediction result of the risk prediction model according to the prediction results of all the risk prediction sub-models further includes: The voting rate of the risk prediction sub-model is calculated according to the proportion of the number of decision trees whose prediction results indicate that the patient will have a risk of nosocomial infection in the total number of decision trees corresponding to the risk prediction sub-model; The prediction result corresponding to the maximum value of the voting rate in all the risk prediction sub-models is taken as the prediction result of the risk prediction model.
[0008] In one embodiment of the present application, the risk prediction sub-model corresponding to the historical physiological information and the historical infection outcome training corresponding to each of the first patient subsets further includes: Dividing each of the first patient subsets into second patient subsets according to preset slicing parameters, wherein the preset slicing parameters include a minimum value of the number of historical patients in each of the second patient subsets; Setting the number of decision trees corresponding to the risk prediction sub-model according to the historical physiological information and the historical infection outcomes corresponding to each of the second patient subsets; The training amount of each computing resource in the training task corresponding to the risk prediction sub-model is calculated according to the ratio of the number of decision trees corresponding to the risk prediction sub-model to the schedulable amount of computing resources; A training task is allocated to each computing resource according to the training amount, and the computing resource trains a corresponding decision tree according to the corresponding historical physiological information and the historical infection outcomes.
[0009] In one embodiment of the present application, the physiological characteristics also include a treatment plan.
[0010] In one embodiment of the present application, the treatment regimen includes the duration of use of the drug treatment regimen, the average daily dose of the drug, and the duration or number of uses of the non-drug treatment regimen.
[0011] In one embodiment of the present application, before the risk prediction model is trained according to the historical physiological information and the historical infection outcomes, the method further includes: Calculate the difference between the number of historical patients who have not experienced nosocomial infection events and the number of historical patients who have experienced nosocomial infection events in each of the first patient subsets; If the difference is less than 0, the absolute value of the difference is used as the sampling number, and historical patients corresponding to the sampling number are randomly selected from the first patient subset as sampling targets; A sampling observation endpoint is obtained according to the outcome label of each sampling target. If the outcome label of the sampling target indicates that the patient has no nosocomial infection event, the sampling observation endpoint corresponding to the sampling target is the preset observation endpoint. If the outcome label of the sampling target indicates that the patient has a nosocomial infection event, the sampling observation endpoint corresponding to the sampling target is the infection start time point. Randomly select a time point between the preset observation starting point and the sampling observation end point corresponding to each sampling target as a target sampling point; A sampling sample is obtained according to the treatment plan of each sampling target between the preset observation starting point and the target sampling point, the basic characteristics of each sampling sample are the same as the basic characteristics of the corresponding historical patient, and the outcome label of all sampling samples is that no hospital infection event occurs; A data set corresponding to the risk prediction sub-model is obtained based on all the historical physiological information and the sampling samples corresponding to the first patient subset.
[0012] In one embodiment of the present application, the treatment regimen includes antibiotics and the antibacterial spectrum corresponding to each antibiotic.
[0013] In an embodiment of the present application, the basic features also include historical infection records.
[0014] According to a second aspect of the present invention, the present invention claims protection for a hospital infection risk prediction system based on a random forest algorithm, comprising a first training module, a first acquisition module and a first processing module, wherein the first training module comprises a first acquisition submodule, a second acquisition submodule and a first processing submodule; Wherein, the first acquisition submodule is used to acquire the physiological characteristics of historical patients at a preset observation starting point to obtain historical physiological information; wherein, the physiological characteristics include basic characteristics and diagnostic characteristics; The second acquisition submodule is used to obtain the infection outcome of the historical patient at the preset observation endpoint to obtain the historical infection outcome; wherein the infection outcome includes an outcome label, and the outcome label is used to indicate whether the corresponding historical patient has a nosocomial infection event before the preset observation endpoint; Wherein, the first processing submodule is used to construct a risk prediction model based on random forest, and the risk prediction model is used to predict the corresponding outcome label according to the physiological characteristics of the patient; the risk prediction model is trained according to the historical physiological information and the historical infection outcomes; Wherein, the first acquisition module is used to acquire target physiological information according to the physiological characteristics of the target patient; Among them, the first processing module is used to input the target physiological information into the trained risk prediction model to obtain the target outcome label.
[0015] In one embodiment of the present application, the infection outcome also includes an infection site, and the first processing submodule further includes: Dividing the historical patients into a plurality of first patient subsets according to the infection site, each of the first patient subsets includes historical patients with nosocomial infection at the corresponding site and historical patients without nosocomial infection; Constructing a risk prediction sub-model corresponding to each of the first patient subsets based on random forest, wherein the risk prediction sub-model is used to predict the corresponding outcome label according to the patient's physiological information, and obtaining the prediction result of the risk prediction model according to the prediction results of all the risk prediction sub-models; The training of the risk prediction model according to the historical physiological information and the historical infection outcomes also includes training the corresponding risk prediction sub-model according to the historical physiological information and the historical infection outcomes corresponding to each of the first patient subsets.
[0016] In one embodiment of the present application, the first processing submodule further includes: The voting rate of the risk prediction sub-model is calculated according to the proportion of the number of decision trees whose prediction results indicate that the patient will have a risk of nosocomial infection in the total number of decision trees corresponding to the risk prediction sub-model; The prediction result corresponding to the maximum value of the voting rate in all the risk prediction sub-models is taken as the prediction result of the risk prediction model.
[0017] In one embodiment of the present application, the first processing submodule further includes: Dividing each of the first patient subsets into second patient subsets according to preset slicing parameters, wherein the preset slicing parameters include a minimum value of the number of historical patients in each of the second patient subsets; Setting the number of decision trees corresponding to the risk prediction sub-model according to the historical physiological information and the historical infection outcomes corresponding to each of the second patient subsets; The training amount of each computing resource in the training task corresponding to the risk prediction sub-model is calculated according to the ratio of the number of decision trees corresponding to the risk prediction sub-model to the schedulable amount of computing resources; A training task is allocated to each computing resource according to the training amount, and the computing resource trains a corresponding decision tree according to the corresponding historical physiological information and the historical infection outcomes.
[0018] In one embodiment of the present application, the physiological characteristics also include a treatment plan.
[0019] In one embodiment of the present application, the treatment regimen includes the duration of use of the drug treatment regimen, the average daily dose of the drug, and the duration or number of uses of the non-drug treatment regimen.
[0020] In one embodiment of the present application, the first processing submodule further includes: Calculate the difference between the number of historical patients who have not experienced nosocomial infection events and the number of historical patients who have experienced nosocomial infection events in each of the first patient subsets; If the difference is less than 0, the absolute value of the difference is used as the sampling number, and historical patients corresponding to the sampling number are randomly selected from the first patient subset as sampling targets; A sampling observation endpoint is obtained according to the outcome label of each sampling target. If the outcome label of the sampling target indicates that the patient has no nosocomial infection event, the sampling observation endpoint corresponding to the sampling target is the preset observation endpoint. If the outcome label of the sampling target indicates that the patient has a nosocomial infection event, the sampling observation endpoint corresponding to the sampling target is the infection start time point. Randomly select a time point between the preset observation starting point and the sampling observation end point corresponding to each sampling target as a target sampling point; A sampling sample is obtained according to the treatment plan of each sampling target between the preset observation starting point and the target sampling point, the basic characteristics of each sampling sample are the same as the basic characteristics of the corresponding historical patient, and the outcome label of all sampling samples is that no hospital infection event occurs; A data set corresponding to the risk prediction sub-model is obtained based on all the historical physiological information and the sampling samples corresponding to the first patient subset.
[0021] In one embodiment of the present application, the treatment regimen includes antibiotics and the antibacterial spectrum corresponding to each antibiotic.
[0022] In an embodiment of the present application, the basic features also include historical infection records.
[0023] This application has the following beneficial effects: 1. The risk of nosocomial infection in patients is predicted by the random forest algorithm, which realizes personalized identification of the risk of nosocomial infection according to the physiological characteristics of patients. The risk of nosocomial infection in patients can be estimated in advance, and attention can be paid to patients with higher risk of infection during treatment, so as to prevent and timely detect nosocomial infection in patients in advance and reduce the adverse effects of nosocomial infection. At the same time, the risk prediction model is constructed based on the random forest algorithm, and a decision tree is constructed according to the information gain method to obtain all decision paths of each decision tree when judging the infection outcome of the patient, that is, the nodes of the decision tree, so that the prediction results of the risk prediction model are highly interpretable, and medical staff have a higher degree of trust in the prediction results of the model, which is convenient for wide application in the medical field.
[0024] 2. Different infection sites will lead to differences in the classification basis required to predict the patient's hospital infection risk. By dividing the training data set according to the infection site and training the corresponding risk prediction sub-model according to the corresponding training data set, the risk prediction sub-model can focus on the classification criteria corresponding to the infection site when constructing the corresponding decision tree, so as to improve the recall rate and prediction accuracy of the risk prediction model.
[0025] 3. Since different risk prediction sub-models use different data sets of infection sites to train corresponding decision trees, different risk prediction sub-models use different division bases when predicting whether a patient will have the risk of nosocomial infection events, which leads to different judgment results of different risk prediction sub-models. For the same patient, since different decision trees in the same risk prediction model use different division criteria to judge the patient's infection outcome, the higher the voting rate corresponding to the same risk prediction sub-model, the more decision trees believe that the patient will have a nosocomial infection event, and the greater the risk of infection in the corresponding part of the patient. The prediction result of the risk prediction sub-model with the highest voting rate is taken as the prediction result of the risk prediction model, indicating that the risk of nosocomial infection in this part is the highest. The final prediction result is obtained based on the maximum infection risk to improve the recall rate of the model.
[0026] 4. The fewer the number of historical patients, the greater the difference between the data distribution characteristics in the sample data used to train the risk prediction model and the actual distribution characteristics in the real world. The risk prediction model is prone to overfitting. The more historical patients there are, the longer the training time of the risk prediction model is. Even when the storage memory of the computing resources is exceeded, the model training cannot be performed. Therefore, the historical patients are sharded by setting the preset sharding parameters, a decision tree is established according to the sharding results, and training tasks are allocated to each computing resource according to the number of currently available computing resources, thereby achieving distributed training and improving training efficiency. At the same time, by setting the preset sharding parameters, it is ensured that the amount of sample data used to train each decision tree is sufficient, reducing the situation where the decision tree is overfitted because the characteristics of the training data set of the decision tree are difficult to cover most of the characteristics of the original data set.
[0027] 5. In actual application scenarios, different treatment plans for the same patient will affect whether a nosocomial infection event occurs. For example, compared with conservative treatment, patients who choose surgical treatment will have an increased infection at the surgical incision, which in turn increases the risk of nosocomial infection in patients. Therefore, using the treatment plan as an input for whether a patient will have a nosocomial infection event is conducive to improving the prediction accuracy of the risk prediction model. At the same time, after using the treatment plan that the patient is about to use as the input of the risk prediction model, the infection risk of the patient when using different treatment plans can be obtained by switching the treatment plan input into the risk prediction model, providing reference opinions for treatment plan decisions.
[0028] 6. After the same treatment method is selected for the same patient, the duration and amount of the treatment method used will affect the patient's risk of nosocomial infection. For example, when antibiotics are used to prevent and / or treat infection during treatment, the longer the patient uses the same antibiotic and the more antibiotics are used in the same time period, the greater the probability that the corresponding pathogen will develop resistance, which in turn leads to an increased risk of hospital-acquired multidrug-resistant bacteria in the patient. Therefore, the duration of use of each drug, the amount of drug used, the duration of use or the number of times non-drug treatment is used as the input of the risk prediction model. While improving the prediction accuracy of the risk prediction model, it is also possible to assist medical workers in judging the timing of nosocomial infection events in patients and assist in the decision-making of treatment plans by adjusting the duration of use of different drugs, the amount of drug used, and the duration of use or the number of times non-drug treatment is used.
[0029] 7. In the actual application process, the original data set used to train the risk prediction model is prone to data imbalance, which in turn affects the prediction accuracy of the risk prediction model. When the data of historical patients who have not experienced nosocomial infection events is difficult to obtain or the availability is low, such as infectious disease specialist hospitals, it is necessary to adjust the ratio of historical patients who have not experienced nosocomial infection events to historical patients who have experienced nosocomial infection events in the training data set by sampling, so that they remain balanced or approximately balanced. By randomly selecting the time point before the infection occurs as the target sampling point according to the time when the historical patient is infected, and integrating the sampled samples according to the target sampling point, on the one hand, the training data set is supplemented by increasing the sampled samples, which reduces the loss of the original data, improves the utilization rate of the original data, ensures the balance of the two types of data in the training data set, and improves the prediction accuracy of the risk prediction model. On the other hand, since the supplemented data belongs to real data, the sampled data is supplemented in the original data, which reduces the probability of introducing noise when supplementing new data, and improves the accuracy of the risk prediction model.
[0030] 8. Integrating the antimicrobial spectra of all antibiotics used during the patient's treatment as the input of the risk prediction model is beneficial for the risk prediction model to extract the usage characteristics of antibiotics and use them to predict the patient's hospital-acquired risk of multidrug-resistant bacteria and the risk of induced resistance after the use of antibiotics, thereby reducing the risk of a decrease in the prediction accuracy of the risk prediction model due to cross-resistance in patients.
[0031] 9. Using the historical infection records as input features of the risk prediction model is helpful for the risk prediction model to judge the patient's susceptibility. For example, if a patient has multiple infections caused by a certain species in his historical infection records, it means that the patient is sensitive to the species and is at greater risk of infection caused by the species during treatment than other people. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0033] Figure 1 This is a flowchart of a hospital infection risk prediction method based on a random forest algorithm involved in an embodiment of the present application; Figure 2 A schematic diagram of the structure of the risk prediction model involved in the embodiment of the present application; Figure 3 This is a schematic diagram of the structure of a hospital infection risk prediction system based on a random forest algorithm according to an embodiment of the present application; Figure 4 This is a schematic diagram of the structure of an electronic device involved in an embodiment of the present application. DETAILED DESCRIPTION
[0034] The present invention provides a method and system for predicting hospital infection risk based on a random forest algorithm. In order to make the above-mentioned purposes, features and advantages of the present application more obvious and understandable, the technical scheme in the embodiment of the present application will be clearly and completely described below in conjunction with the drawings in the embodiment of the present application. Obviously, the described embodiment is only a part of the embodiment of the present application, not all embodiments. The components of the embodiment of the present application described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, with reference to the terms "one embodiment", "some embodiments", "implementation method", "embodiment", "illustrative embodiment", "example", "specific example" or "some examples", the following detailed description of the embodiment of the present application provided in the drawings is not intended to limit the scope of the present application to be protected, but only indicates that the specific features, structures or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. And the specific features, structures or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0035] It should be noted that similar reference numerals and letters represent similar items in the following figures, so once an item is defined in one figure, it does not need to be further defined and explained in the subsequent figures. At the same time, in the description of this application, the terms "first", "second" and other relational terms are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations.
[0036] According to the first aspect of the present invention, the present invention claims a hospital infection risk prediction method based on random forest algorithm, referring to the attached Figure 1 As shown, including: S1: Acquire the physiological characteristics of historical patients at a preset observation starting point to obtain historical physiological information; wherein the physiological characteristics include basic characteristics, diagnostic characteristics and treatment plans, but of course they are not limited to these.
[0037] It should be noted that the preset observation starting point includes the time of admission to hospital and / or the time of submission of the latest examination indicators, etc., but it is certainly not limited to this.
[0038] It should be noted that the historical patients include inpatients in the historical medical records, but it is not limited to this. The basic characteristics include age, gender, whether they have underlying diseases, whether they have other chronic diseases, and historical infection records, etc., but it is not limited to this. Among them, the underlying diseases include diabetes, hypertension, chronic obstructive pulmonary disease and malignant tumors, etc., but it is not limited to this. The diagnostic characteristics include examination indicators, symptoms, admission diagnosis results, admission departments and admission department categories, etc., but it is not limited to this. The treatment plan includes the duration of use of the drug treatment plan, the average daily dose of the drug, and the duration or number of use of the non-drug treatment plan, but it is not limited to this. Among them, the drug treatment plan includes antibiotics and the antibacterial spectrum corresponding to all antibiotics, etc., but it is not limited to this. Among them, the non-drug treatment plan includes surgery, intubation, blood transfusion or use of blood products, hemodialysis, radiotherapy and ventilator use, etc., but it is not limited to this. Among them, intubation includes tracheal intubation, urinary catheter intubation and central venous catheter intubation, etc., but it is not limited to this.
[0039] S2: Obtain the infection outcome of historical patients at a preset observation endpoint to obtain the historical infection outcome; wherein the infection outcome includes an outcome label, and the outcome label is used to indicate whether the corresponding historical patient has a nosocomial infection event before the preset observation endpoint.
[0040] It should be noted that the preset observation endpoint includes discharge time, but it is certainly not limited to this.
[0041] S3: Perform data preprocessing on all the historical physiological information and all the historical infection outcomes. Take the historical physiological information and the historical infection outcomes corresponding to each of the historical patients as corresponding sample data, and obtain the training data set of the risk prediction model based on all the sample data.
[0042] In this embodiment, the preprocessing includes normalized representation and data sampling, but it is certainly not limited thereto.
[0043] In this embodiment, the normalized expression is used to convert the historical physiological information and the historical infection outcome into a data form that can be processed by the model. For example, the symptoms are converted into word vectors through a natural language processing algorithm; the outcome label is represented by a value of 0 and a value of 1, where a value of 0 indicates that the corresponding historical patient did not have a nosocomial infection event before the preset observation endpoint, and a value of 1 indicates that the corresponding historical patient has had a nosocomial infection event before the preset observation endpoint.
[0044] S4: constructing a risk prediction model based on random forest, wherein the risk prediction model is used to predict the corresponding outcome label according to the physiological characteristics of the patient. The input of the risk prediction model is the physiological characteristics of the patient after preprocessing, and the output is the corresponding outcome label.
[0045] In this embodiment, the risk prediction model includes several decision trees, each of which is used to judge the outcome label according to the physiological characteristics of the patient, and the risk prediction model obtains the judgment result of the risk prediction model according to the proportion of decision trees with a judgment result of 1 in all decision trees. If the proportion is not less than 50%, the judgment result of the risk prediction model is 1, which means that the patient will have a nosocomial infection event; if the proportion is not less than 50%, the judgment result of the risk prediction model is 0, which means that the patient will not have a nosocomial infection event.
[0046] S5: Training the risk prediction model based on the historical physiological information and the historical infection outcomes.
[0047] It should be noted that step S5 also includes the following sub-steps: S51, all sample data are divided into a training data set and a test data set in a ratio of 7:3, the training data set is used to train several decision trees, and the test data set is used to test the performance index of each decision tree. Performance indicators include accuracy and recall rate, etc., of course, it may not be limited to this. S52, randomly select several physiological characteristics from all physiological characteristics as the first candidate physiological characteristics, filter out the values of the historical patients in the first candidate physiological characteristics from the training data set, and obtain the training data set of the corresponding decision tree. S53, train all decision trees according to the corresponding training data set. S54, calculate the performance index of each trained decision tree according to the test data set. S55, select the decision tree whose performance index meets the preset conditions as the decision tree of the risk prediction model. Among them, the preset conditions can be preset according to the performance indicators. For example, if the performance indicator includes accuracy, the preset conditions may include the accuracy of the decision tree is not less than 80%, of course, it may not be limited to this.
[0048] In this embodiment, the decision tree construction step S53 may include the following sub-steps: S531, taking each of the first candidate physiological characteristics as the classification standard of the patient, and calculating the corresponding information gain. S532, taking the first candidate physiological characteristics corresponding to the maximum information gain as the division standard of the current node, classifying the historical patients of the current node according to the division standard of the current node, and obtaining the classification results, each of which includes the historical patients of the same category after judging according to the division standard of the current node; for example, if the division standard of the current node is whether to undergo surgical treatment, the first classification result and the second classification result corresponding to the division standard, the first classification result includes all the historical patients who underwent surgical treatment, and the second classification result includes all the historical patients who did not undergo surgical treatment. S533, updating the training data set of the decision tree according to the corresponding classification results, the updated training data set includes the sample data corresponding to the corresponding classification results. Remove the division standard of the current node from the first candidate physiological characteristics, and determine whether the number of the remaining first candidate physiological characteristics is 0. If the number is 0, the current node is taken as a leaf node, and the proportion of the judgment result of 1 in each of the classification results is calculated respectively, and the judgment result corresponding to the classification results with a proportion of not less than 50% is set to 1, and the judgment result corresponding to the classification sub-result with a proportion of less than 50% is set to 0. If the number is not 0, continue with step S534. S534, determine whether the number of historical patients corresponding to each of the classification results is 0. If the number is 0, the current node is set as a leaf node, and the proportion of the judgment result of 1 in the classification results corresponding to its parent node is calculated. If the proportion is not less than 50%, the judgment result corresponding to the leaf node is 1, and if the proportion is less than 50%, the judgment result corresponding to the leaf node is 0. If the number is not 0, the remaining first candidate physiological characteristics are taken as the new first candidate physiological characteristics, and the execution is returned to step S531.
[0049] It should be noted that in step S531, the method for calculating information gain includes the following sub-steps: S5311, calculating the information entropy of the current training data set. S5312, taking each of the current first candidate physiological characteristics as the division criteria of the current node, classifying the current training subset according to the corresponding division criteria, and calculating the information entropy corresponding to each division criteria. S5313, calculating the weight of the information entropy of the corresponding classification result according to the proportion of the number of historical patients in each classification result corresponding to the same division criteria to the number of historical patients in the current training data set. S5314, weightedly calculating all the information entropies corresponding to the same division criteria according to the weight, and obtaining the information gain according to the difference between the information entropy of the current training subset and the weighted calculation result.
[0050] It should be noted that the calculation method of information entropy includes: ; Where D represents the feature set for calculating information entropy, p1 represents the proportion of historical patients with the outcome label of 1 in the current classification result among all historical patients in the current classification result; p2 represents the proportion of historical patients with the outcome label of 0 in the current classification result among all historical patients in the current classification result. When D takes the current training data set, Ent(D) represents the information entropy of the current training data set; when D takes the classification result, Ent(D) represents the information entropy corresponding to the classification result.
[0051] It should be noted that the calculation method of the weight of the classification result includes: ; Among them, ω j represents the weight of classifying the historical patients in the training data set into the jth classification result according to the corresponding classification criteria; |D j | represents the number of historical patients in the j-th classification result, and |D| represents the number of historical patients in the training data set.
[0052] It should be noted that the information gain calculation method includes: ; Wherein, n represents the number of classification results obtained by dividing the historical patients in the training data set according to the corresponding classification criteria; D j Represents the jth classification result.
[0053] S6: Acquire target physiological information according to the physiological characteristics of the target patient.
[0054] It should be noted that the treatment plan in the target physiological information includes the treatment plan to be used, but it is not limited thereto. The physiological characteristics of the target patient are obtained. The target physiological information is obtained after preprocessing the physiological characteristics of the target patient.
[0055] S7: Input the target physiological information into the trained risk prediction model to obtain a target outcome label, where the target outcome label is the outcome label of the target patient.
[0056] It should be noted that step S7 also includes the following sub-steps: S71. The risk prediction model screens the target physiological information according to the input features of each decision tree to obtain the corresponding target physiological sub-information. S72. Input the target physiological sub-information into the corresponding decision tree to obtain the judgment result of the decision tree. S73. Obtain the prediction result of the risk prediction model based on the proportion of judgment results of 1 in the judgment results of all decision trees. If the proportion is not less than 50%, the target outcome label is 1, which means that the target patient will have a nosocomial infection event. If the proportion is less than 50%, the target outcome label is 0, which means that the target patient will not have a nosocomial infection event.
[0057] It should be noted that the use of the random forest algorithm to predict the risk of nosocomial infection events in patients has achieved personalized identification of the risk of nosocomial infection events based on the patient's physiological characteristics, and can estimate the risk of nosocomial infection in patients in advance, increase attention to patients with higher risk of infection during treatment, prevent and promptly detect nosocomial infection events in patients in advance, and reduce the adverse effects of nosocomial infection events. At the same time, the risk prediction model is constructed based on the random forest algorithm, and a decision tree is constructed according to the information gain method to obtain all decision paths of each decision tree when judging the patient's infection outcome, that is, the nodes of the decision tree, so that the prediction results of the risk prediction model are highly interpretable, and medical staff have a higher degree of trust in the prediction results of the model, which is convenient for wide application in the medical field.
[0058] In actual application scenarios, different treatment plans for the same patient will affect whether a nosocomial infection event occurs. For example, compared with conservative treatment, patients who choose surgical treatment will have an increased infection at the surgical incision, which will increase the risk of nosocomial infection in patients. Therefore, using the treatment plan as the input of whether a patient will have a nosocomial infection event is conducive to improving the prediction accuracy of the risk prediction model. At the same time, after using the treatment plan that the patient is about to use as the input of the risk prediction model, the infection risk of the patient when using different treatment plans for treatment can be obtained by switching the treatment plan input into the risk prediction model, providing reference opinions for treatment plan decision-making. In addition, after the same treatment method is selected for the same patient, the duration and amount of use of the treatment method will affect the risk of nosocomial infection in the patient. For example, when antibiotics are used to prevent and / or treat infection during treatment, the longer the patient uses the same antibiotic, the more antibiotics are used in the same period of time, and the greater the probability of drug resistance in the corresponding pathogen, which in turn leads to an increase in the patient's risk of hospital-acquired multidrug-resistant bacteria. Therefore, the duration of use of each drug, the amount of drug used, the duration of use of non-drug treatment or the number of times used are used as the input of the risk prediction model. While improving the prediction accuracy of the risk prediction model, it is also possible to assist medical workers in judging the timing of nosocomial infection events in patients and assist in making decisions on treatment plans by adjusting the duration of use of different drugs, the amount of drug used, and the duration of use of non-drug treatment or the number of times used.
[0059] It should be noted that integrating the antimicrobial spectra of all antibiotics used during the patient's treatment as the input of the risk prediction model is beneficial for the risk prediction model to extract the usage characteristics of antibiotics and use them to predict the patient's hospital-acquired risk of multidrug-resistant bacteria and the risk of induced resistance after the use of antibiotics, thereby reducing the risk of a decrease in the prediction accuracy of the risk prediction model due to cross-resistance in patients.
[0060] It should be noted that using the historical infection records as input features of the risk prediction model is helpful for the risk prediction model to judge the patient's susceptibility. For example, if a patient has multiple infections caused by a certain species in his historical infection records, it means that the patient is sensitive to the species, and compared with other people, the risk of infection caused by the species during treatment is greater.
[0061] In a possible implementation, refer to the attached Figure 2 As shown, the infection outcome also includes the infection site, and step S4 also includes: S41. Divide the historical patients into a plurality of first patient subsets according to the infection site, each of the first patient subsets including historical patients with nosocomial infection and historical patients without nosocomial infection in the corresponding site. The infection sites include respiratory system, blood system, urinary system, digestive system and surgical site, but are not limited thereto.
[0062] It should be noted that, taking the respiratory system as an example, the first patient subset corresponding to the respiratory system where the infection site is located includes historical patients who had no infection in their historical medical records and historical patients who had respiratory system infection.
[0063] In this embodiment, step S41 also includes the following sub-steps: S411, respectively compare the number of historical patients who have not had nosocomial infection events with the number of historical patients who have had nosocomial infection events at each infection site, and obtain the historical patients who have had nosocomial infection events and the historical patients who have not had nosocomial infection in the corresponding first patient subset according to the comparison result. For example, if the number of historical patients who have not had nosocomial infection events is greater than the number of historical patients who have had nosocomial infection events at the corresponding infection site, an equal number of historical patients can be randomly selected from the historical patients who have not had infection according to the number of historical patients who have had nosocomial infection at the corresponding site, as the sample data with the outcome label of 0 in the first patient subset corresponding to the infection site; if the number of historical patients who have not had nosocomial infection events is less than the number of historical patients who have had nosocomial infection events at the corresponding infection site, an equal number of historical patients can be randomly selected from the historical patients who have had infection at the corresponding site according to the number of historical patients who have not had nosocomial infection, as the sample data with the outcome label of 1 in the first patient subset corresponding to the infection site, so that the number of sample data without nosocomial infection events and the number of sample data with nosocomial infection events in each of the first patient subsets are the same, so as to ensure the balance of sample data at each infection site and improve the accuracy of model prediction.
[0064] S42. Construct a risk prediction sub-model corresponding to each of the first patient subsets based on random forest, wherein the risk prediction sub-model is used to predict the corresponding outcome label according to the patient's physiological information, and obtain the prediction result of the risk prediction model according to the prediction results of all the risk prediction sub-models.
[0065] In this embodiment, the risk prediction model includes several risk prediction sub-models, and the number of the risk prediction sub-models is the same as the number of infection sites. Each of the risk prediction sub-models includes several decision trees. Each decision tree is used to judge the outcome label of the patient based on the historical physiological information corresponding to the first patient subset. The judgment result of the corresponding risk prediction sub-model is obtained according to the proportion of decision trees with a judgment result of 1 in all decision trees. For example, if the proportion is not less than 50%, the judgment result of the corresponding risk prediction sub-model is 1, and if the proportion is less than 50%, the judgment result of the corresponding risk prediction sub-model is 0. The judgment result of the risk prediction model can be obtained based on the judgment results of all the risk prediction sub-models.
[0066] In this embodiment, step S5 also includes: training the corresponding risk prediction sub-model according to the historical physiological information and the historical infection outcome corresponding to each of the first patient subsets. The method for constructing a decision tree is similar to the above S53 and will not be described in detail here.
[0067] It should be noted that in actual application scenarios, different infection sites will lead to differences in the division basis required to predict patients' hospital infection risks. By dividing the training data set according to the infection site and training the corresponding risk prediction sub-model according to the corresponding training data set, the risk prediction sub-model can focus on the division criteria corresponding to the infection site when constructing the corresponding decision tree, so as to improve the recall rate and prediction accuracy of the risk prediction model.
[0068] In a feasible implementation manner, in step S42, it further includes: The voting rate of the risk prediction sub-model is calculated based on the proportion of the number of decision trees whose prediction results indicate that the patient will have a risk of nosocomial infection in the total number of decision trees corresponding to the risk prediction sub-model. The prediction result corresponding to the maximum value of the voting rate in all the risk prediction sub-models is taken as the prediction result of the risk prediction model.
[0069] It should be noted that if the prediction result of the risk prediction sub-model corresponding to the maximum value of the voter turnout is 1, the prediction result of the risk prediction model is 1; if the prediction result of the risk prediction sub-model corresponding to the maximum value of the voter turnout is 0, the prediction result of the risk prediction model is 0. For example, if 50% is used as the classification threshold, if the maximum value of the voter turnout is not less than 50%, the prediction result of the risk prediction model is 1; if the maximum value of the voter turnout is less than 50%, the prediction result of the risk prediction model is 0.
[0070] In this embodiment, since different risk prediction sub-models use different data sets of infection sites to train corresponding decision trees, different risk prediction sub-models use different division bases when predicting whether a patient will have the risk of nosocomial infection events, which leads to different judgment results of different risk prediction sub-models. For the same patient, since different decision trees in the same risk prediction model use different division criteria for judging the infection outcomes of patients, the higher the voting rate corresponding to the same risk prediction sub-model, the more decision trees believe that the patient will have nosocomial infection events, and the greater the risk of infection in the corresponding part of the patient. The prediction result of the risk prediction sub-model with the highest voting rate is taken as the prediction result of the risk prediction model, indicating that the risk of nosocomial infection in this part is the highest, and the final prediction result is obtained according to the maximum value of the infection risk, so as to improve the recall rate of the model.
[0071] In a feasible implementation manner, step S53 further includes: Each of the first patient subsets is divided into second patient subsets according to preset segmentation parameters, wherein the preset segmentation parameters include a minimum value of the number of historical patients in each of the second patient subsets.
[0072] It should be noted that the specific value of the preset slicing parameter is preset according to the number of historical patients. Calculate the quotient and the first remainder after dividing the number of historical patients in the first patient subset by the preset slicing parameter. Take the number of historical patients corresponding to the quotient as the total number of the second patient subset, and evenly distribute the number of historical patients corresponding to the first remainder to each of the second patient subsets. If there is still a second remainder after evenly distributing the number of historical patients corresponding to the first remainder to each of the second patient subsets, the second patient subset corresponding to the number of the second remainder can be randomly selected for distribution. Obtain the number of historical patients in each of the second patients. For example, if the value of the preset slicing parameter is 1000, and the total number of historical patients in the first patient subset is 5678, the first patient subset can be divided into 5 second patient subsets, of which 3 of the second patient subsets contain 1136 historical patients, and 2 of the second patient subsets contain 1135 historical patients, so as to ensure that the number of historical patients in each of the second patient subsets is small.
[0073] The number of decision trees corresponding to the risk prediction sub-model is set according to the historical physiological information and the historical infection outcomes corresponding to each of the second patient subsets. For example, input features of a training data set containing k physiological features are randomly selected from all the physiological features to obtain a decision tree, and this operation is repeated m times to train m decision trees.
[0074] The training amount of each computing resource in the training task corresponding to the risk prediction sub-model is calculated based on the ratio of the number of decision trees corresponding to the risk prediction sub-model to the schedulable amount of computing resources. If there is a remainder when the number of decision trees corresponding to the risk prediction sub-model is divided by the schedulable amount of computing resources, the number of decision trees corresponding to the remainder is evenly distributed to each computing resource.
[0075] It should be noted that the computing resources include the minimum set of resources required for training a decision tree, including CPU resources, memory resources, network resources, etc., but of course it is not limited to this.
[0076] A training task is allocated to each computing resource according to the training amount, and the computing resource trains a corresponding decision tree according to the corresponding historical physiological information and the historical infection outcome. The method for constructing a decision tree is similar to the above method and will not be described in detail here.
[0077] It should be noted that the fewer the number of historical patients, the greater the difference between the data distribution characteristics in the sample data used to train the risk prediction model and the actual distribution characteristics in the real world. The risk prediction model is prone to overfitting. The more historical patients there are, the longer the training time of the risk prediction model is, and even when the storage memory of the computing resources is exceeded, the model training cannot be performed. Therefore, the historical patients are sharded by setting the preset sharding parameters, a decision tree is established according to the sharding results, and training tasks are allocated to each computing resource according to the number of currently available computing resources, thereby achieving distributed training and improving training efficiency. At the same time, by setting the preset sharding parameters, it is ensured that the amount of sample data used to train each decision tree is sufficient, reducing the situation where the decision tree is overfitted because the characteristics of the training data set of the decision tree are difficult to cover most of the characteristics of the original data set.
[0078] In a feasible implementation, step S411 also includes the following sub-steps: S4111, calculate the difference between the number of historical patients who have not experienced nosocomial infection events in each of the first patient subsets and the number of historical patients who have experienced nosocomial infection events. S4112, if the difference is less than 0, take the absolute value of the difference as the sampling number, randomly select historical patients corresponding to the sampling number from the corresponding first patient subset as sampling targets, and execute step S4113. If the difference is greater than 0, sample the historical patients who have experienced nosocomial infection events in the first patient subset and then execute step S4116. S4113, obtain the sampling observation endpoint according to the outcome label of each of the sampling targets, if the outcome label of the sampling target indicates that the patient has not experienced nosocomial infection events, the sampling observation endpoint corresponding to the sampling target is the preset observation endpoint, if the outcome label of the sampling target indicates that the patient has experienced nosocomial infection events, the sampling observation endpoint corresponding to the sampling target is the infection start time point. S4114, randomly select a time point between the preset observation starting point and the sampling observation endpoint corresponding to each of the sampling targets as the target sampling point. S4115. According to the treatment plan of each sampling target between the preset observation starting point and the target sampling point, a sampling sample is obtained, the basic characteristics of each sampling sample are the same as the basic characteristics of the corresponding historical patient, and the outcome label of all sampling samples is that no hospital infection event occurred. S4116. According to all the historical physiological information corresponding to the first patient subset and the sampling samples, a data set corresponding to the risk prediction sub-model is obtained.
[0079] In this embodiment, if the first historical patient has had a nosocomial infection event before the preset observation endpoint, the treatment process includes the first treatment plan A on day a1 and the second treatment plan B on day b1, and the nosocomial infection event begins to occur after day a1+b1, then the sampling observation endpoint of the first historical patient is day a1+b1 after the start of treatment, and day c1 is randomly selected from day 1 to day a1+b1 of the treatment process as the target sampling point of the first historical patient, wherein the value of c1 is not less than 1 and not greater than the sum of a1 and b1. The treatment plan of the first historical patient from day 1 to day c1 of the treatment process is integrated to obtain the treatment plan in the sampling sample, the basic characteristics of the sampling sample are the same as the basic characteristics of the first historical patient, and the outcome label of the sampling sample is 0. If the second historical patient has no hospital infection event before the preset observation endpoint, and the treatment process includes the first treatment plan A on day a2 and the second treatment plan B on day b2, then the sampling observation endpoint of the second historical patient is the preset observation point, and the c2th day is randomly selected from the beginning to the end of the treatment process as the target sampling point of the second historical patient, where the value of c2 is not less than 1 and not greater than the sum of a2 and b2. The treatment plan in the sampling sample is obtained by integrating the treatment plan of the second historical patient from day 1 to day c2 of the treatment process, and the basic characteristics of the sampling sample are the same as those of the second historical patient, and the outcome label of the sampling sample is 0.
[0080] It should be noted that the steps after sampling the historical patients with nosocomial infection events in the first patient subset can be obtained by using sampling methods such as simple random sampling, stratified sampling, SMOTE sampling, etc. This application does not further limit the specific sampling method.
[0081] It should be noted that, in the actual application process, the original data set used to train the risk prediction model is prone to data imbalance, which in turn affects the prediction accuracy of the risk prediction model. When the data of historical patients who have not experienced nosocomial infection events is difficult to obtain or the availability is low, such as infectious disease specialist hospitals, it is necessary to adjust the ratio of historical patients who have not experienced nosocomial infection events to historical patients who have experienced nosocomial infection events in the training data set by sampling, so that it remains balanced or approximately balanced. By randomly selecting the time point before the infection occurs as the target sampling point according to the time when the historical patient is infected, and integrating the sampled samples according to the target sampling point, on the one hand, the training data set is supplemented by increasing the sampled samples, the loss of the original data is reduced, the utilization rate of the original data is improved, the balance of the two types of data in the training data set is ensured, and the prediction accuracy of the risk prediction model is improved. On the other hand, since the supplemented data belongs to the real data, the sampled data is supplemented in the original data, which reduces the probability of introducing noise when supplementing the new data, and improves the accuracy of the risk prediction model.
[0082] According to a second aspect of the present invention, the present invention claims a hospital infection risk prediction system based on a random forest algorithm, referring to the attached Figure 3 As shown, it includes a first training module, a first acquisition module and a first processing module, and the first training module includes a first acquisition submodule, a second acquisition submodule and a first processing submodule; Wherein, the first acquisition submodule is used to acquire the physiological characteristics of historical patients at a preset observation starting point to obtain historical physiological information; wherein, the physiological characteristics include basic characteristics and diagnostic characteristics; The second acquisition submodule is used to obtain the infection outcome of the historical patient at the preset observation endpoint to obtain the historical infection outcome; wherein the infection outcome includes an outcome label, and the outcome label is used to indicate whether the corresponding historical patient has a nosocomial infection event before the preset observation endpoint; Wherein, the first processing submodule is used to construct a risk prediction model based on random forest, and the risk prediction model is used to predict the corresponding outcome label according to the physiological characteristics of the patient; the risk prediction model is trained according to the historical physiological information and the historical infection outcomes; Wherein, the first acquisition module is used to acquire target physiological information according to the physiological characteristics of the target patient; Among them, the first processing module is used to input the target physiological information into the trained risk prediction model to obtain the target outcome label.
[0083] In a feasible implementation manner, the infection outcome further includes an infection site, and the first processing submodule further includes: Dividing the historical patients into a plurality of first patient subsets according to the infection site, each of the first patient subsets includes historical patients with nosocomial infection at the corresponding site and historical patients without nosocomial infection; Constructing a risk prediction sub-model corresponding to each of the first patient subsets based on random forest, wherein the risk prediction sub-model is used to predict the corresponding outcome label according to the patient's physiological information, and obtaining the prediction result of the risk prediction model according to the prediction results of all the risk prediction sub-models; The training of the risk prediction model according to the historical physiological information and the historical infection outcomes also includes training the corresponding risk prediction sub-model according to the historical physiological information and the historical infection outcomes corresponding to each of the first patient subsets.
[0084] In a feasible implementation manner, the first processing submodule further includes: The voting rate of the risk prediction sub-model is calculated according to the proportion of the number of decision trees whose prediction results indicate that the patient will have a risk of nosocomial infection in the total number of decision trees corresponding to the risk prediction sub-model; The prediction result corresponding to the maximum value of the voting rate in all the risk prediction sub-models is taken as the prediction result of the risk prediction model.
[0085] In a feasible implementation manner, the first processing submodule further includes: Dividing each of the first patient subsets into second patient subsets according to preset slicing parameters, wherein the preset slicing parameters include a minimum value of the number of historical patients in each of the second patient subsets; Setting the number of decision trees corresponding to the risk prediction sub-model according to the historical physiological information and the historical infection outcomes corresponding to each of the second patient subsets; The training amount of each computing resource in the training task corresponding to the risk prediction sub-model is calculated according to the ratio of the number of decision trees corresponding to the risk prediction sub-model to the schedulable amount of computing resources; A training task is allocated to each computing resource according to the training amount, and the computing resource trains a corresponding decision tree according to the corresponding historical physiological information and the historical infection outcomes.
[0086] In a possible embodiment, the physiological characteristics also include a treatment plan.
[0087] In a feasible embodiment, the treatment regimen includes the duration of use of the drug treatment regimen, the average daily dose of the drug, and the duration or number of uses of the non-drug treatment regimen.
[0088] In a feasible implementation manner, the first processing submodule further includes: Calculate the difference between the number of historical patients who have not experienced nosocomial infection events and the number of historical patients who have experienced nosocomial infection events in each of the first patient subsets; If the difference is less than 0, the absolute value of the difference is used as the sampling number, and historical patients corresponding to the sampling number are randomly selected from the first patient subset as sampling targets; A sampling observation endpoint is obtained according to the outcome label of each sampling target. If the outcome label of the sampling target indicates that the patient has no nosocomial infection event, the sampling observation endpoint corresponding to the sampling target is the preset observation endpoint. If the outcome label of the sampling target indicates that the patient has a nosocomial infection event, the sampling observation endpoint corresponding to the sampling target is the infection start time point. Randomly select a time point between the preset observation starting point and the sampling observation end point corresponding to each sampling target as a target sampling point; A sampling sample is obtained according to the treatment plan of each sampling target between the preset observation starting point and the target sampling point, the basic characteristics of each sampling sample are the same as the basic characteristics of the corresponding historical patient, and the outcome label of all sampling samples is that no hospital infection event occurs; A data set corresponding to the risk prediction sub-model is obtained based on all the historical physiological information and the sampling samples corresponding to the first patient subset.
[0089] In one possible embodiment, the treatment regimen includes antibiotics and an antibacterial spectrum corresponding to each antibiotic.
[0090] In a feasible implementation manner, the basic characteristics also include historical infection records.
[0091] Refer to the attached Figure 4 As shown, an embodiment of the present application provides an electronic device, including: a processor and a memory, the processor and the memory are interconnected and communicate with each other through a communication bus and / or other forms of connection mechanisms (not shown), the memory stores a computer program executable by the processor, and when the computing device is running, the processor executes the computer program to execute the system in any optional implementation of the above embodiments.
[0092] The embodiment of the present application provides a storage medium, and when the computer program is executed by the processor, the system in any optional implementation of the above embodiment is executed. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, referred to as SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, referred to as EEPROM), erasable programmable read-only memory (Erasable Programmable Read-Only Memory, referred to as EPROM), programmable read-only memory (Programmable Read-Only Memory, referred to as PROM), read-only memory (Read-Only Memory, referred to as ROM), magnetic storage, flash memory, disk or optical disk.
[0093] In the embodiments provided in the present application, it should be understood that the disclosed system can be implemented in other ways. The system embodiments described above are merely schematic. For example, the division of the modules is only a logical function division, and can be implemented in another way. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some communication interface, system or unit, which can be electrical, mechanical or other forms.
[0094] In addition, the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0095] Furthermore, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0096] Flowcharts are used herein to illustrate the steps of the method of the embodiments of the present disclosure. It should be understood that the preceding or following steps are not necessarily performed precisely in order. On the contrary, various steps may be evaluated in reverse order or simultaneously. At the same time, other operations may also be added to these processes.
[0097] Unless otherwise defined, all terms used herein have the same meaning as commonly understood by those of ordinary skill in the art to which the present disclosure belongs. It should also be understood that terms such as those defined in common dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant technology, and should not be interpreted in an idealized or highly formal sense, unless explicitly defined as such herein.
[0098] The above is a detailed introduction to a hospital infection risk prediction method and system based on a random forest algorithm. This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only an embodiment of this application, which is only used to help understand the hospital infection risk prediction method and system based on a random forest algorithm of this application, and is not used to limit the scope of protection of this application. At the same time, for those skilled in the art, this application can have various changes and variations. Any modifications and equivalent substitutions made within the spirit and principles of this application should be included in the scope of protection of this application.
Claims
1. A hospital infection risk prediction method based on random forest algorithm, characterized in that: include: Acquire the physiological characteristics of historical patients at a preset observation starting point to obtain historical physiological information; wherein the physiological characteristics include basic characteristics and diagnostic characteristics; Obtaining the infection outcome of a historical patient at a preset observation endpoint to obtain a historical infection outcome; wherein the infection outcome includes an outcome label, and the outcome label is used to indicate whether the corresponding historical patient has a nosocomial infection event before the preset observation endpoint; Constructing a risk prediction model based on random forest, wherein the risk prediction model is used to predict the corresponding outcome label according to the patient's physiological characteristics; Training the risk prediction model according to the historical physiological information and the historical infection outcomes; Acquire target physiological information according to physiological characteristics of target patients; The target physiological information is input into the trained risk prediction model to obtain a target outcome label.
2. A hospital infection risk prediction method based on random forest algorithm according to claim 1, characterized in that: The infection outcome also includes the infection site, and the risk prediction model based on random forest also includes: Dividing the historical patients into a plurality of first patient subsets according to the infection site, each of the first patient subsets includes historical patients with nosocomial infection at the corresponding site and historical patients without nosocomial infection; Constructing a risk prediction sub-model corresponding to each of the first patient subsets based on random forest, wherein the risk prediction sub-model is used to predict the corresponding outcome label according to the patient's physiological information, and obtaining the prediction result of the risk prediction model according to the prediction results of all the risk prediction sub-models; The training of the risk prediction model according to the historical physiological information and the historical infection outcomes also includes training the corresponding risk prediction sub-model according to the historical physiological information and the historical infection outcomes corresponding to each of the first patient subsets.
3. A hospital infection risk prediction method based on random forest algorithm according to claim 2, characterized in that: The step of obtaining the prediction result of the risk prediction model according to the prediction results of all the risk prediction sub-models further includes: The voting rate of the risk prediction sub-model is calculated according to the proportion of the number of decision trees whose prediction results indicate that the patient will have a risk of nosocomial infection in the total number of decision trees corresponding to the risk prediction sub-model; The prediction result corresponding to the maximum value of the voting rate in all the risk prediction sub-models is taken as the prediction result of the risk prediction model.
4. The hospital infection risk prediction method based on random forest algorithm according to claim 2 is characterized in that: The risk prediction sub-model corresponding to the historical physiological information and the historical infection outcome training corresponding to each of the first patient subsets further includes: Dividing each of the first patient subsets into second patient subsets according to preset slicing parameters, wherein the preset slicing parameters include a minimum value of the number of historical patients in each of the second patient subsets; Setting the number of decision trees corresponding to the risk prediction sub-model according to the historical physiological information and the historical infection outcomes corresponding to each of the second patient subsets; The training amount of each computing resource in the training task corresponding to the risk prediction sub-model is calculated according to the ratio of the number of decision trees corresponding to the risk prediction sub-model to the schedulable amount of computing resources; A training task is allocated to each computing resource according to the training amount, and the computing resource trains a corresponding decision tree according to the corresponding historical physiological information and the historical infection outcomes.
5. The hospital infection risk prediction method based on random forest algorithm according to claim 2 is characterized in that: The physiological characteristics also include treatment options.
6. A hospital infection risk prediction method based on random forest algorithm according to claim 5, characterized in that: The treatment regimen includes the duration of use of the drug treatment regimen, the average daily dose of the drug, and the duration or number of uses of the non-drug treatment regimen.
7. The hospital infection risk prediction method based on random forest algorithm according to claim 6 is characterized in that: Before the risk prediction model is trained according to the historical physiological information and the historical infection outcomes, the method further includes: Calculate the difference between the number of historical patients who have not experienced nosocomial infection events and the number of historical patients who have experienced nosocomial infection events in each of the first patient subsets; If the difference is less than 0, the absolute value of the difference is used as the sampling number, and historical patients corresponding to the sampling number are randomly selected from the first patient subset as sampling targets; A sampling observation endpoint is obtained according to the outcome label of each sampling target. If the outcome label of the sampling target indicates that the patient has no nosocomial infection event, the sampling observation endpoint corresponding to the sampling target is the preset observation endpoint. If the outcome label of the sampling target indicates that the patient has a nosocomial infection event, the sampling observation endpoint corresponding to the sampling target is the infection start time point. Randomly select a time point between the preset observation starting point and the sampling observation end point corresponding to each sampling target as a target sampling point; A sampling sample is obtained according to the treatment plan of each sampling target between the preset observation starting point and the target sampling point, the basic characteristics of each sampling sample are the same as the basic characteristics of the corresponding historical patient, and the outcome label of all sampling samples is that no hospital infection event occurs; A data set corresponding to the risk prediction sub-model is obtained based on all the historical physiological information and the sampling samples corresponding to the first patient subset.
8. A hospital infection risk prediction method based on random forest algorithm according to any one of claims 5 to 7, characterized in that: The treatment regimen includes antibiotics and the antimicrobial spectrum corresponding to each antibiotic.
9. A hospital infection risk prediction method based on random forest algorithm according to any one of claims 1 to 7, characterized in that: The basic characteristics also include historical infection records.
10. A hospital infection risk prediction system based on random forest algorithm, characterized in that: It includes a first training module, a first acquisition module and a first processing module, wherein the first training module includes a first acquisition submodule, a second acquisition submodule and a first processing submodule; Wherein, the first acquisition submodule is used to acquire the physiological characteristics of historical patients at a preset observation starting point to obtain historical physiological information; wherein, the physiological characteristics include basic characteristics and diagnostic characteristics; The second acquisition submodule is used to obtain the infection outcome of the historical patient at the preset observation endpoint to obtain the historical infection outcome; wherein the infection outcome includes an outcome label, and the outcome label is used to indicate whether the corresponding historical patient has a nosocomial infection event before the preset observation endpoint; Wherein, the first processing submodule is used to construct a risk prediction model based on random forest, and the risk prediction model is used to predict the corresponding outcome label according to the physiological characteristics of the patient; the risk prediction model is trained according to the historical physiological information and the historical infection outcomes; Wherein, the first acquisition module is used to acquire target physiological information according to the physiological characteristics of the target patient; Among them, the first processing module is used to input the target physiological information into the trained risk prediction model to obtain the target outcome label.
Citation Information
Patent Citations
Time period reasoning method of sample selection of hospital infection data
CN109360657A
Intelligent system for stroke risk prediction
CN112101413A
Full-process management method for hospital infection prevention and control
CN116913544A
Method and device for predicting infection risk based on recurrent neural network, and electronic equipment
CN118039183A
System for infection diagnosis
US20210134405A1
Cited By
Multi-point triggering biological safety monitoring method and device, computer equipment and storage medium
CN119153105A
XGBoost-based critically ill patient malnutrition risk prediction system
CN120015330A
Infectious shock early recognition method based on machine learning
CN120913837A
Machine learning based early identification of septic shock
CN120913837B
