Decision optimization method based on anti-fact interpretation

Through the decision optimization method based on counterfactual explanation, clinical data is processed and counterfactual examples are generated, the problems of data complexity and individual differences in drug use decision-making are solved, personalized medical and resource optimization are achieved, and the effectiveness of drug use decision-making is improved. Resource utilization efficiency.

CN119207814APending Publication Date: 2024-12-27SOUTHWEST JIAOTONG UNIV
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411403336.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-09
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

There are problems in the optimization of drug use decisions, the clinical data pattern is complex, the individual differences between patients and the difficulty in optimizing drug use decisions, which makes it difficult to achieve unreasonable allocation of medical resources and personalized treatment.

Method used

The decision optimization method based on counterfactual explanation is adopted, and the original data is obtained and processed, the integrated learning model is trained, and the prototype guidance strategy and dynamic constraint strategy are designed for custom genetic algorithms, counterfactual instances are generated, and drug decision optimization suggestions are provided.

Benefits of technology

It improves the effectiveness, diversity and feasibility of drug use decisions, helps to achieve personalized medical care, reduces medical costs, and optimizes resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119207814A_ABST
    Figure CN119207814A_ABST
Patent Text Reader

Abstract

The invention provides a decision optimization method based on anti-fact explanation, and belongs to the technical field of medication decision optimization. The method comprises the following steps: acquiring original data, and processing the original data to obtain a standard data set; training the integrated learning model by using the standard data set to obtain a trained prediction model; a genetic algorithm is customized, a prototype guidance strategy and a dynamic constraint strategy are designed, and an anti-fact explanation model is obtained; and taking the prediction model and the original instance as the input of an anti-fact explanation model to obtain a corresponding anti-fact instance, and comparing the difference between the original instance and the anti-fact instance to obtain a medication decision optimization suggestion. The problems that in medication decision optimization, a clinical data mode is complex, individual differences of patients are remarkable, and medication decision optimization is difficult are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of medication decision optimization, and in particular relates to a decision optimization method based on counterfactual interpretation. Background Art

[0002] Medication decision optimization has shown great application potential in modern clinical practice and personalized medicine. It can assist researchers and clinicians in gaining in-depth insights into the efficacy characteristics of drugs, and further refine the drug treatment regimen, thereby significantly improving the quality and efficacy of treatment responses.

[0003] Medication decision optimization involves many challenges in clinical practice: data collection and processing. Clinical practice involves a large amount of patient data, including medical records, laboratory test results, and drug use records. Integrating and converting this data into structured information that can be used for analysis is a complex process that requires efficient data management and processing capabilities; individual differences. There are significant genetic, physiological, and metabolic differences between patients, which can affect the efficacy and side effects of drugs. Therefore, how to fully consider these individual differences in medication decisions and achieve personalized treatment is a major challenge; clinical guidelines and practice differences. Although there are a large number of clinical guidelines for reference, there are often differences between guidelines and doctors' actual operations in actual clinical practice. These differences may be due to factors such as doctors' personal experience and differences in regional medical resources; medical resource limitations. In a medical environment with limited resources, how to reasonably allocate and utilize medical resources to achieve the optimization of medication decisions is a challenge. Therefore, studying medication decision optimization methods is of great significance to reducing medical costs and promoting personalized medicine. Summary of the invention

[0004] In view of the above-mentioned deficiencies in the prior art, the present invention provides a decision optimization method based on counterfactual interpretation, which solves the problems of complex clinical data patterns, significant individual differences among patients, and difficulty in optimizing medication decisions in medication decision optimization.

[0005] In order to achieve the above objectives, the technical solution adopted by the present invention is: a decision optimization method based on counterfactual explanation, comprising the following steps:

[0006] S1. Obtaining raw data and processing the raw data to obtain a standard data set;

[0007] S2. Use the standard data set to train the integrated learning model to obtain a trained prediction model;

[0008] S3, customize the genetic algorithm, design the prototype guidance strategy and dynamic constraint strategy, and obtain the counterfactual explanation model;

[0009] S4. The prediction model and the original instance are used as the input of the counterfactual explanation model to obtain the corresponding counterfactual instance, and the difference between the original instance and the counterfactual instance is compared to obtain the optimization suggestion of medication decision.

[0010] The beneficial effects of the present invention are as follows: based on the constructed standard data set and prediction model, the present invention customizes the genetic algorithm, solves the problem of customization of specific field needs through customized fitness functions and genetic operations, introduces a prototype guidance strategy to optimize the search space, designs a dynamic constraint strategy to limit the range of feature changes to meet the field background requirements, generates counterfactual examples with effectiveness, diversity and feasibility, and analyzes to obtain specific suggestions for optimizing medication decisions, so it has high application value.

[0011] Furthermore, the step S1 includes the following steps:

[0012] S101, obtaining original data;

[0013] S102, cleaning the original data, extracting the features with the smallest missing rate and related to medication decision-making, and obtaining cleaned data;

[0014] S103, integrating the cleaned data according to the timestamps of various features to obtain a standard data set.

[0015] The beneficial effect of the above further scheme is that in the present invention, a standard data set is constructed through data cleaning and processing, which improves the quality of subsequent prediction models and counterfactual explanation models.

[0016] Furthermore, step S2 includes the following steps:

[0017] S201, using a standard data set as an ensemble learning model input, and using default values ​​for the ensemble learning model parameters, performing a first ensemble learning model training to obtain an ensemble learning model after initial training;

[0018] S202. Using the evaluation index, the integrated learning model after the initial training is evaluated, and according to the evaluation result, the parameters of the integrated learning model after the initial training are optimized to obtain the trained prediction model.

[0019] The beneficial effect of the above further scheme is: in the present invention, by using a standard data set and default parameter values ​​for the first model training, a basic integrated learning model is quickly established, and the TPE algorithm is used to solve the parameter optimization problem and adaptively search for the optimal parameter configuration, thereby improving the performance of the prediction model.

[0020] Furthermore, the step S202 includes the following steps:

[0021] S2021. Evaluate the ensemble learning model after initial training using evaluation indicators.

[0022] S2022. According to the evaluation results, the parameter optimization algorithm TPE is used to optimize the parameters of the integrated learning model after the initial training, and the expected improvement EI is used as the acquisition function. In the parameter optimization process performed by the parameter optimization algorithm TPE, the probability distribution of the objective function is estimated using a Gaussian mixture model, and the expected improvement EI is used to evaluate the improvement brought by a single evaluation of the objective function under the current known information. In the parameter optimization process performed by the parameter optimization algorithm TPE, the goal is to find the parameter configuration that maximizes the expected improvement of the objective function in the parameter space;

[0023] The integral expression of the expected improvement EI is as follows:

[0024]

[0025] Among them, EI(θ) represents the acquisition function, which is used to guide the parameter optimization algorithm TPE to search for the next optimal solution, y' represents the currently known optimal objective function value, y represents the value of the objective function, θ represents the parameter configuration, and p(y|θ) represents the probability distribution of the objective function value y when the parameter configuration θ is given;

[0026] In the parameter optimization process performed by the parameter optimization algorithm TPE, p(y|θ) is calculated by p(θ|y), and the expression is as follows:

[0027]

[0028] Among them, p(θ|y) represents the parameter configuration θ corresponding to the objective function value y, p(θ) represents the marginal probability of the parameter configuration θ, p(y) represents the marginal probability of the objective function value y, l(θ) represents the density function of excellent parameter points, g(θ) represents the density function of non-excellent parameter points, l(θ) and g(θ) are calculated based on the Gaussian mixture model, and the expressions are as follows:

[0029]

[0030]

[0031] in, represents the Gaussian distribution of excellent parameter points, μ l (θ) and Respectively represent the mean and variance of excellent parameter points, Z l and Z g are normalization constants, Represents the Gaussian distribution of non-excellent parameter points, μ g (θ) and Both represent the mean and variance of non-excellent parameter points;

[0032] S2023, selecting the hyperparameters corresponding to the maximum density estimation values ​​of the excellent parameter points and the density estimation values ​​of the non-excellent parameter points as the next set of search values, and obtaining the optimal parameter configuration by obtaining the global optimal solution when a preset number of iterations is reached;

[0033] S2024. Obtain a trained prediction model based on the optimal parameter configuration.

[0034] The beneficial effect of the above further scheme is: in the present invention, an integrated learning model is used to predict whether the patient's medication has improved, and the features closely related to the medication decision are fully extracted. The good performance of the integrated learning model is the basis for the subsequent counterfactual explanation model to generate high-quality counterfactual instances.

[0035] Furthermore, step S3 includes the following steps:

[0036] S301, customizing the fitness function according to the attribute requirements of the counterfactual instance to customize the genetic algorithm;

[0037] S302, using the distance function, searching for a sample that is most similar to the original instance and has the opposite predicted category as a prototype sample, obtaining a prototype of the original instance, and designing a prototype guidance strategy;

[0038] S303, performing feature change constraint processing on features according to the domain knowledge of the standard data set to design a dynamic constraint strategy;

[0039] S304, using the prototype guidance strategy for the population initialization phase of the custom genetic algorithm, and using the dynamic constraint strategy for the crossover and mutation operation phases of the custom genetic algorithm to obtain a counterfactual explanation model.

[0040] Furthermore, the step S301 includes the following steps:

[0041] S3011. Determine the mathematical definition of the counterfactual instance c;

[0042] S3012. Based on the property requirements of the counterfactual instance c, the generation process of the counterfactual instance c is modeled using the following formula, that is, a customized fitness function is used to customize the genetic algorithm:

[0043] C(x)=argminf_dist(c,x)+f_nchg(c,x)+f_dist(h(c),y')

[0044] Among them, C(x) represents the custom fitness function, h represents the trained prediction model, f_dist(c,x) represents the distance function between the counterfactual instance c and the original instance x, representing the similarity of the counterfactual instance c, f_nchg(c,x) represents the number of features changed to generate the counterfactual instance c, representing the sparsity of the counterfactual instance c, and f_dist(h(c),y') represents the distance function between the predicted result h(c) of the counterfactual instance c and the expected class y', representing the effectiveness of the counterfactual instance.

[0045] Furthermore, the step S302 includes the following steps:

[0046] S3021, determining a distance function for finding a prototype, using cosine similarity as a distance metric;

[0047] S3022, introducing the concept of prototype, using the distance function, finding the sample that is most similar to the original instance and has the opposite predicted category as the prototype sample, and obtaining the prototype of the original instance to design a prototype guidance strategy, wherein the expression of the prototype sample is as follows:

[0048]

[0049] Where p represents the prototype sample, x represents the feature vector of the original instance, x' represents the feature vector of the instance with predicted category y' in the standard dataset D, x·x' represents the dot product between vectors, and ||x||||x'|| represents the product of the lengths of vectors.

[0050] Furthermore, the step S303 includes the following steps:

[0051] S3031. Determine the dynamic constraint strategy of the indicator class features based on the domain knowledge of the standard data set;

[0052] S3032. Determine the dynamic constraint strategy of medication characteristics based on the domain knowledge of the standard data set to design a dynamic constraint strategy.

[0053] Furthermore, the step S304 includes the following steps:

[0054] S3041, create an initial population, and use the prototype guidance strategy to find samples with similar features to the original instance but opposite categories as the initial population;

[0055] S3042. Evaluate the similarity, sparsity and effectiveness of each individual in the current population Pop(t) according to the fitness function;

[0056] S3043, using elitist selection, select elite individuals from the current population Pop(t) and keep them in the next generation population;

[0057] S3044, use roulette wheel method to select parent generation;

[0058] S3045, using dynamic constraint strategy to guide crossover operation;

[0059] S3046, performing a mutation operation on the newly generated offspring, using a dynamic constraint strategy to change the value of the feature;

[0060] S3047. When the preset number of iterations is reached, the final population is sorted according to the evaluation function, and the first k counterfactual instances are returned to complete the construction of the counterfactual explanation model.

[0061] The beneficial effect of the above further scheme is that: in the present invention, the process of population initialization is optimized by using the prototype guidance strategy, which effectively narrows the search space, thereby improving the efficiency of generating counterfactual instances. A dynamic constraint strategy is used to define a search space that is consistent with the actual clinical nutrition background, and the strategy is applied to the crossover operation and mutation operation in the genetic algorithm to obtain high-quality counterfactual instances. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Figure 1 The present invention is a flow chart of the method. DETAILED DESCRIPTION

[0063] The specific implementation modes of the present invention are described below so that those skilled in the art can understand the present invention. However, it should be clear that the present invention is not limited to the scope of the specific implementation modes. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations utilizing the concept of the present invention are protected.

[0064] Example

[0065] like Figure 1 As shown, the present invention provides a decision optimization method based on counterfactual explanation, and its implementation method is as follows:

[0066] S1. Obtain the original data and process the original data to obtain a standard data set. The implementation method is as follows:

[0067] S101, obtaining original data;

[0068] S102, cleaning the original data, extracting the features with the smallest missing rate and related to medication decision-making, and obtaining cleaned data;

[0069] S103, integrating the cleaned data according to the timestamps of various features to obtain a standard data set.

[0070] In the present embodiment, the original data comes from the clinical nutrition support data of the cooperative hospital, including basic information, hematological index test data during hospitalization, and nutritional medication and drug use. In order to ensure the privacy protection of patients, all data are desensitized, and the use restrictions of the present invention are strictly observed to ensure that irrelevant personnel cannot access the patient's privacy information. The original data are divided into three categories, including basic patient data, hematological index data and nutritional support data. The basic patient data covers the relevant information of demographic information and current nutritional status, including fields such as patient ID, gender, age, number of comorbidities, CCI index, MNA-SF score, etc. The hematological index data includes the results of 12 conventional hematological test indicators, test date, normal value range, etc. The nutritional support data records the nutritional intervention of the patient during hospitalization, including fields such as patient ID, doctor's order, doctor's order sign, dosage, unit, recording time, nurse start execution and end execution time.

[0071] In this example, the data set was screened to delete the hematological indicators with a high missing rate, while retaining the indicators with a low missing rate and close relationship with nutritional level. A small number of missing values ​​were filled to ensure the integrity and availability of the data. The final data set involved 5 basic characteristics, 9 hematological indicator characteristics, and 7 nutritional support characteristics, laying a solid foundation for subsequent analysis.

[0072] In this embodiment, the data needs to be integrated. The patient's basic data and hematological index test data are stored in the same table of the database, while the nutritional support data are distributed in different tables. Since the patient may have test results for multiple days during hospitalization, these data need to be aligned in order to predict the nutritional level after intervention. The following method is used for data alignment: Taking the timestamp of the nutritional intervention as the benchmark, the average value of the hematological index test data within 72 hours before the timestamp is extracted as the input feature of the model. At the same time, the average albumin level within 72 hours after the timestamp is extracted as the albumin level result after intervention. In this process, if the albumin levels of several prognoses are increased compared with those before the intervention, it indicates that the patient's nutritional level has improved, and the prediction label is marked as 1; conversely, if the albumin level does not increase, the prediction label is 0. In this way, a nutritional support data set containing complete feature variables and prediction labels is constructed.

[0073] S2. Use the standard data set to train the ensemble learning model to obtain a trained prediction model. The implementation method is as follows:

[0074] S201, using a standard data set as an ensemble learning model input, and using default values ​​for the ensemble learning model parameters, performing a first ensemble learning model training to obtain an ensemble learning model after initial training;

[0075] S202, using the evaluation index, evaluating the integrated learning model after the initial training, and according to the evaluation result, performing parameter optimization processing on the integrated learning model after the initial training to obtain a trained prediction model, and the implementation method thereof is as follows:

[0076] S2021. Evaluate the ensemble learning model after initial training using evaluation indicators.

[0077] S2022. According to the evaluation results, the parameter optimization algorithm TPE is used to optimize the parameters of the integrated learning model after the initial training, and the expected improvement EI is used as the acquisition function. In the parameter optimization process performed by the parameter optimization algorithm TPE, the probability distribution of the objective function is estimated using the Gaussian mixture model, and the expected improvement EI is used to evaluate the improvement brought by an evaluation of the objective function under the current known information. In the parameter optimization process performed by the parameter optimization algorithm TPE, the goal is to find the parameter configuration that maximizes the expected improvement of the objective function in the parameter space. This probability distribution represents the possibility of performance indicators corresponding to different parameter configurations in the parameter space. In this way, TPE can score the parameter configuration, and the higher the score, the greater the possibility of performance improvement. At the same time, the expected improvement (Expected Improvement, EI) is used as the acquisition function, which is used to evaluate the improvement that may be brought by an evaluation of the objective function under the current known information. In the TPE algorithm, the goal is to find the parameter configuration that can maximize the expected improvement of the objective function in the parameter space. Such a parameter configuration is expected to bring the greatest performance improvement in practical applications.

[0078] The integral expression of the expected improvement EI is as follows:

[0079]

[0080] Among them, EI(θ) represents the acquisition function, which is used to guide the parameter optimization algorithm TPE to search for the next optimal solution, y' represents the currently known optimal objective function value, y represents the value of the objective function, θ represents the parameter configuration, and p(y|θ) represents the probability distribution of the objective function value y when the parameter configuration θ is given;

[0081] In the parameter optimization process performed by the parameter optimization algorithm TPE, p(y|θ) is calculated by p(θ|y), and the expression is as follows:

[0082]

[0083] Among them, p(θ|y) represents the parameter configuration θ corresponding to the objective function value y, p(θ) represents the marginal probability of the parameter configuration θ, p(y) represents the marginal probability of the objective function value y, l(θ) represents the density function of excellent parameter points, g(θ) represents the density function of non-excellent parameter points, l(θ) and g(θ) are calculated based on the Gaussian mixture model, and the expressions are as follows:

[0084]

[0085] in, represents the Gaussian distribution of excellent parameter points, μ l (θ) and Respectively represent the mean and variance of excellent parameter points, Z l and Z g are normalization constants, Represents the Gaussian distribution of non-excellent parameter points, μ g (θ) and Both represent the mean and variance of non-excellent parameter points;

[0086] S2023, selecting the hyperparameters corresponding to the maximum density estimation values ​​of the excellent parameter points and the density estimation values ​​of the non-excellent parameter points as the next set of search values, and obtaining the optimal parameter configuration by obtaining the global optimal solution when a preset number of iterations is reached;

[0087] S2024. Obtain a trained prediction model based on the optimal parameter configuration.

[0088] In this embodiment, the nutritional support dataset is used as the input of the integrated learning model XGBoost, and the parameters use the default values ​​during the initial training to obtain the XGBoost model after the initial training.

[0089] In this embodiment, the XGBoost model after initial training is evaluated using the evaluation indicators precision, recall, F1 score and AUC. On the basis of the evaluation, the parameter optimization algorithm TPE is used to optimize the parameters of the XGBoost model, and a set of parameter configurations are randomly selected in the parameter space as the initial parameter points. These parameter points will be used to train the integrated learning model and evaluated according to the performance of the model on the validation set. According to the performance on the validation set, the parameter optimization algorithm TPE estimates the probability distribution of the objective function by constructing a Gaussian mixture model, and uses the expected improvement (EI) as the acquisition function to guide the search process in the parameter space to find the parameter configuration that can bring the maximum performance improvement. In this way, the TPE algorithm can adaptively adjust the size of the parameter search space, and can find the global optimal solution in the fewest possible number of iterations. After reaching the number of iterations, the optimal parameter set is obtained, and the trained prediction model is obtained at this time.

[0090] S3, customize the genetic algorithm, design the prototype guidance strategy and dynamic constraint strategy, and obtain the counterfactual explanation model. The implementation method is as follows:

[0091] S301. Customize the fitness function according to the attribute requirements of the counterfactual instance to customize the genetic algorithm. The implementation method is as follows:

[0092] S3011. Determine the mathematical definition of the counterfactual instance c;

[0093] S3012. Based on the property requirements of the counterfactual instance c, use the following formula to model the generation process of the counterfactual instance c, that is, customize the fitness function to customize the genetic algorithm.

[0094] In this embodiment, the mathematical definition of the counterfactual instance is determined. Based on the constructed prediction model h, for the original instance x, h(x) = y, if there is an instance c that is as close to x as possible, and h(c) = y', y' is the opposite prediction result of y, then instance c is the counterfactual instance. By comparing the difference between the original instance x and the counterfactual instance c, the relationship between the change of features and the potential results is explored.

[0095] Model the generation process of the counterfactual instance c, that is, the custom fitness function is:

[0096] C(x)=argminf_dist(c,x)+f_nchg(c,x)+f_dist(h(c),y')

[0097] Where C(x) represents a custom fitness function, h represents a trained prediction model, f_dist(c,x) represents the distance function between the counterfactual instance c and the original instance x, representing the similarity of the counterfactual instance c, f_nchg(c,x) represents the number of features changed to generate the counterfactual instance c, representing the sparsity of the counterfactual instance c, f_dist(h(c),y') represents the distance function between the predicted result h(c) of the counterfactual instance c and the expected class y', representing the validity of the counterfactual instance. The validity explains how to use the prediction model to evaluate the degree of closeness between the predicted result of a candidate counterfactual instance and the expected category, f_dist(c,x) and f_nchg(c,x) ensure that the counterfactual instance c is as close as possible to the original instance c, and f_dist(h(c),y') ensures that the generated counterfactual instance c can be predicted as the opposite class by the prediction model h to obtain a valid counterfactual instance.

[0098] S302, using the distance function, searching for a sample that is most similar to the original instance and has the opposite predicted category as a prototype sample, obtaining a prototype of the original instance, and designing a prototype guidance strategy, the implementation method of which is as follows:

[0099] S3021, determining a distance function for finding a prototype, using cosine similarity as a distance metric;

[0100] S3022. Introduce the concept of prototype, use the distance function to find the sample that is most similar to the original instance and has the opposite predicted category as the prototype sample, and obtain the prototype of the original instance to design a prototype guidance strategy.

[0101] In this embodiment, the concept of prototype is introduced, and the sample that is most similar to the original instance and has the opposite predicted category is called the prototype. The distance function for finding the prototype is determined, and cosine similarity is used as a method to measure the distance because it can effectively measure the directional difference between vectors without being affected by the size of the vector. The expression of the prototype sample is as follows:

[0102]

[0103] Where p represents the prototype sample, x represents the feature vector of the original instance, x' represents the feature vector of the instance with predicted category y' in the standard dataset D, x·x' represents the dot product between vectors, and ||x||||x'|| represents the product of the lengths of vectors.

[0104] S303: Based on the domain knowledge of the standard data set, feature change constraint processing is performed on the features to design a dynamic constraint strategy, and the implementation method is as follows:

[0105] S3031. Determine the dynamic constraint strategy of the indicator class features based on the domain knowledge of the standard data set;

[0106] S3032. Determine the dynamic constraint strategy of medication characteristics based on the domain knowledge of the standard data set to design a dynamic constraint strategy.

[0107] In this embodiment, a dynamic constraint strategy for indicator features is determined, and the constraint principle of this type of feature is to ensure that the indicator value changes are close to the normal value range of the indicator. A dynamic constraint strategy for medication features is determined, and the constraint principle of this type of feature is to ensure that the medication method and medication dosage change synchronously.

[0108] S304, using the prototype guidance strategy for the population initialization phase of the custom genetic algorithm, and using the dynamic constraint strategy for the crossover and mutation operation phases of the custom genetic algorithm to obtain a counterfactual explanation model, the implementation method of which is as follows:

[0109] S3041, create an initial population, and use the prototype guidance strategy to find samples with similar features to the original instance but opposite categories as the initial population;

[0110] S3042. Evaluate the similarity, sparsity and effectiveness of each individual in the current population Pop(t) according to the fitness function;

[0111] S3043, using elitist selection, select elite individuals from the current population Pop(t) and keep them in the next generation population;

[0112] S3044, use roulette wheel method to select parent generation;

[0113] S3045, using dynamic constraint strategy to guide crossover operation;

[0114] S3046, performing a mutation operation on the newly generated offspring, using a dynamic constraint strategy to change the value of the feature;

[0115] S3047. When the preset number of iterations is reached, the final population is sorted according to the evaluation function, and the first k counterfactual instances are returned to complete the construction of the counterfactual explanation model.

[0116] In this embodiment, the dynamic constraint strategy is mainly composed of feature constraint statements, which determine the specific scope of feature disturbance in the process of counterfactual instance generation. In the process of generating counterfactual instances, the basic characteristics of the patient, such as age, gender, and characteristics reflecting the current physical condition of the patient, will not change in the case of short-term intervention, so these characteristics are set as static characteristics at the beginning and do not need to be disturbed. However, the hematological index characteristics and nutritional support characteristics need to be dynamically constrained, which is also the core constraint object of the dynamic constraint strategy.

[0117] The hematological index features include multiple indicators related to nutritional risks. Each indicator has its normal range value. In the absence of constraints, the generated counterfactual instances are prone to have indicator features that are seriously lower than or higher than the normal value range, which does not meet the expectations of the patient's hematological indicators after actual intervention. At the same time, the original values ​​of different hematological indicators of each patient vary greatly, and the constraints on this type of feature cannot be constrained by a static numerical range. Therefore, corresponding constraint statements are designed for the hematological index features. Given that overly strict constraints will result in the inability to generate any valid counterfactual instances, in order to balance effectiveness and feasibility, discuss with clinicians to determine the constraint principles of the indicators, that is, to ensure that the indicator value changes in the counterfactual instances are close to the normal value range of the indicator. Taking the total bilirubin feature as an example, its normal value reference range is 2 to 19, 2 and 19 are the lowest and highest values ​​in the normal range, respectively. The total bilirubin of the candidate instance patient E is feature e1, and the constraint statement of feature c1 of the counterfactual instance C is:

[0118]

[0119] This statement means: when the value of feature e1 of the candidate instance is lower than 2, the value of feature c1 of the counterfactual instance can only be higher than e1 and not exceed 19; when the value of feature e1 is higher than 19, the value of feature c1 can only be higher than 2 and not exceed the value of feature e1; when the value of feature e1 is within the normal value range, the value of feature c1 can be directly constrained within the normal value range. This statement constrains the total bilirubin index of candidate patient E to change in a positive direction as much as possible, that is, to move closer to the normal value range, which is consistent with the clinical expectations for patients. The constraint statement logic of other hematological indicators is similar to that of total bilirubin.

[0120] The nutritional support characteristics mainly include the intervention method and intervention dose. The intervention method and intervention dose need to be consistent. When the intervention dose is not 0, the corresponding intervention method must be 1 to indicate that the patient has used this intervention method. In the absence of constraints, it is easy for the counterfactual instance to be out of sync. For example, the original instance did not use the enteral intervention method, and the total enteral nutrition dose of the counterfactual instance increased, but the enteral nutrition feature was not modified to 1 at the same time, which does not conform to the actual clinical situation. Therefore, corresponding constraint statements are designed for the nutritional support characteristics. There are a total of three intervention methods, namely enteral nutrition, parenteral nutrition, and human albumin infusion nutrition, each with a corresponding total intervention dose. Taking enteral nutrition as an example, the enteral nutrition of the counterfactual instance C is feature c2, and the total enteral nutrition dose is feature c3. The constraint statements for feature c2 and feature c3 are:

[0121]

[0122] This statement means: when one of the enteral nutrition dosage feature c3 and enteral nutrition feature c2 of counterfactual instance C is 0, the other must be synchronized to 0; when feature c3 is not 0, feature c2 is synchronized to 1, that is, when feature c2 is 1, feature c3 is not 0 and is within the enteral nutrition dosage range, D CN Indicates the numerical range of enteral nutrition dose in this dataset. This statement constrains the intervention mode and intervention dose to always remain synchronized. The constraint statements for parenteral nutrition and human albumin infusion nutrition are similar, ensuring that the disturbance of nutrition support characteristics conforms to the actual clinical situation.

[0123] In this embodiment, the core of the constructed counterfactual explanation model is a custom genetic algorithm, which ensures that the generated counterfactual instances are both valid (i.e., the predicted category is opposite to the original instance) and meet the requirement of minimizing feature disturbance through a customized fitness function. The algorithm maintains population diversity to explore multiple areas of the problem space, achieving the diversity of counterfactual instances. Finally, the adjustability of crossover and mutation operations lays the foundation for generating feasible counterfactual instances.

[0124] S4. The prediction model and the original instance are used as the input of the counterfactual explanation model to obtain the corresponding counterfactual instance, and the difference between the original instance and the counterfactual instance is compared to obtain the optimization suggestion of medication decision.

[0125] In this embodiment, the prediction model and the original instance are used as the input of the counterfactual explanation model, the corresponding counterfactual instance is output, the difference between the original instance and the counterfactual instance is analyzed and compared, and the optimization suggestion of medication decision is obtained, which is as follows:

[0126] Determine the original instance that needs counterfactual explanation, input the prediction model and the original instance into the counterfactual explanation model to obtain the counterfactual instance; compare the data points of the counterfactual instance relative to the original instance, analyze the characteristics and degree of change involved in these data points, and obtain optimization suggestions for medication decisions.

[0127] In this embodiment, a patient with a negative outcome is taken as the original instance, and the original instance and the prediction model are input into the counterfactual explanation model. The counterfactual explanation model returns three counterfactual instances corresponding to the original instance. The specific changes in the characteristics of the three counterfactual instances relative to the original instance are: reducing the high-sensitivity C-reactive protein index and starting to use human albumin for nutrition infusion; reducing the aspartate aminotransferase index, reducing the alanine aminotransferase index, and increasing the total dose of parenteral nutrition; increasing the total dose of parenteral nutrition and starting to use human albumin for nutrition infusion. A counterfactual instance corresponds to a specific suggestion that can reverse the current patient's outcome. Therefore, through the counterfactual explanation model, it can be understood that based on the patient in the original instance, improvements in which aspects can change the patient's outcome to a positive outcome as much as possible, effectively helping clinicians optimize the current patient's medication decisions.

[0128] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A decision optimization method based on counterfactual explanation, characterized in that: The following steps are involved: S1. Obtaining raw data and processing the raw data to obtain a standard data set; S2. Use the standard data set to train the integrated learning model to obtain a trained prediction model; S3, customize the genetic algorithm, design the prototype guidance strategy and dynamic constraint strategy, and obtain the counterfactual explanation model; S4. The prediction model and the original instance are used as the input of the counterfactual explanation model to obtain the corresponding counterfactual instance, and the difference between the original instance and the counterfactual instance is compared to obtain the optimization suggestion of medication decision.

2. The decision optimization method based on counterfactual explanation according to claim 1, characterized in that: The step S1 comprises the following steps: S101, obtaining original data; S102, cleaning the original data, extracting the features with the smallest missing rate and related to medication decision-making, and obtaining cleaned data; S103, integrating the cleaned data according to the timestamps of various features to obtain a standard data set.

3. The decision optimization method based on counterfactual explanation according to claim 1, characterized in that: The step S2 comprises the following steps: S201, using a standard data set as an ensemble learning model input, and using default values ​​for the ensemble learning model parameters, performing a first ensemble learning model training to obtain an ensemble learning model after initial training; S202. Using the evaluation index, the integrated learning model after the initial training is evaluated, and according to the evaluation result, the parameters of the integrated learning model after the initial training are optimized to obtain the trained prediction model.

4. The decision optimization method based on counterfactual explanation according to claim 3 is characterized in that: The step S202 includes the following steps: S2021. Evaluate the ensemble learning model after initial training using evaluation indicators. S2022. According to the evaluation results, the parameter optimization algorithm TPE is used to optimize the parameters of the integrated learning model after the initial training, and the expected improvement EI is used as the acquisition function. In the parameter optimization process performed by the parameter optimization algorithm TPE, the probability distribution of the objective function is estimated using a Gaussian mixture model, and the expected improvement EI is used to evaluate the improvement brought by a single evaluation of the objective function under the current known information. In the parameter optimization process performed by the parameter optimization algorithm TPE, the goal is to find the parameter configuration that maximizes the expected improvement of the objective function in the parameter space; The integral expression of the expected improvement EI is as follows: Among them, EI(θ) represents the acquisition function, which is used to guide the parameter optimization algorithm TPE to search for the next optimal solution, y' represents the currently known optimal objective function value, y represents the value of the objective function, θ represents the parameter configuration, and p(y|θ) represents the probability distribution of the objective function value y when the parameter configuration θ is given; In the parameter optimization process performed by the parameter optimization algorithm TPE, p(y|θ) is calculated by p(θ|y), and the expression is as follows: Among them, p(θ|y) represents the parameter configuration θ corresponding to the objective function value y, p(θ) represents the marginal probability of the parameter configuration θ, p(y) represents the marginal probability of the objective function value y, l(θ) represents the density function of excellent parameter points, g(θ) represents the density function of non-excellent parameter points, l(θ) and g(θ) are calculated based on the Gaussian mixture model, and the expressions are as follows: in, represents the Gaussian distribution of excellent parameter points, μ l (θ) and Respectively represent the mean and variance of excellent parameter points, Z l and Z g are normalization constants, Represents the Gaussian distribution of non-excellent parameter points, μ g (θ) and Both represent the mean and variance of non-excellent parameter points; S2023, selecting the hyperparameters corresponding to the maximum density estimation values ​​of the excellent parameter points and the density estimation values ​​of the non-excellent parameter points as the next set of search values, and obtaining the optimal parameter configuration by obtaining the global optimal solution when a preset number of iterations is reached; S2024. Obtain a trained prediction model based on the optimal parameter configuration.

5. The decision optimization method based on counterfactual explanation according to claim 1, characterized in that: The step S3 comprises the following steps: S301, customizing the fitness function according to the attribute requirements of the counterfactual instance to customize the genetic algorithm; S302, using the distance function, searching for a sample that is most similar to the original instance and has the opposite predicted category as a prototype sample, obtaining a prototype of the original instance, and designing a prototype guidance strategy; S303, performing feature change constraint processing on features according to the domain knowledge of the standard data set to design a dynamic constraint strategy; S304, using the prototype guidance strategy for the population initialization phase of the custom genetic algorithm, and using the dynamic constraint strategy for the crossover and mutation operation phases of the custom genetic algorithm to obtain a counterfactual explanation model.

6. The decision optimization method based on counterfactual explanation according to claim 5, characterized in that: The step S301 includes the following steps: S3011. Determine the mathematical definition of the counterfactual instance c; S3012. According to the property requirements of the counterfactual instance c, the generation process of the counterfactual instance c is modeled using the following formula, that is, a customized fitness function is used to customize the genetic algorithm: C(x)=argminf_dist(c,x)+f_nchg(c,x)+f_dist(h(c),y') Among them, C(x) represents the custom fitness function, h represents the trained prediction model, f_dist(c,x) represents the distance function between the counterfactual instance c and the original instance x, representing the similarity of the counterfactual instance c, f_nchg(c,x) represents the number of features changed to generate the counterfactual instance c, representing the sparsity of the counterfactual instance c, and f_dist(h(c),y') represents the distance function between the predicted result h(c) of the counterfactual instance c and the expected class y', representing the effectiveness of the counterfactual instance.

7. The decision optimization method based on counterfactual explanation according to claim 5, characterized in that: The step S302 includes the following steps: S3021, determining a distance function for finding a prototype, using cosine similarity as a distance metric; S3022, introducing the concept of prototype, using the distance function, finding the sample that is most similar to the original instance and has the opposite predicted category as the prototype sample, and obtaining the prototype of the original instance to design a prototype guidance strategy, wherein the expression of the prototype sample is as follows: Where p represents the prototype sample, x represents the feature vector of the original instance, x' represents the feature vector of the instance with predicted category y' in the standard dataset D, x·x' represents the dot product between vectors, and ||x||||x'|| represents the product of the lengths of vectors.

8. The decision optimization method based on counterfactual explanation according to claim 5, characterized in that: The step S303 includes the following steps: S3031. Determine the dynamic constraint strategy of the indicator class features based on the domain knowledge of the standard data set; S3032. Determine the dynamic constraint strategy of medication characteristics based on the domain knowledge of the standard data set to design a dynamic constraint strategy.

9. The decision optimization method based on counterfactual explanation according to claim 5, characterized in that: The step S304 includes the following steps: S3041, create an initial population, and use the prototype guidance strategy to find samples with similar features to the original instance but opposite categories as the initial population; S3042. Evaluate the similarity, sparsity and effectiveness of each individual in the current population Pop(t) according to the fitness function; S3043, using elitist selection, select elite individuals from the current population Pop(t) and keep them in the next generation population; S3044, use roulette wheel method to select parent generation; S3045, using dynamic constraint strategy to guide crossover operation; S3046, performing a mutation operation on the newly generated offspring, using a dynamic constraint strategy to change the value of the feature; S3047. When the preset number of iterations is reached, the final population is sorted according to the evaluation function, and the first k counterfactual instances are returned to complete the construction of the counterfactual explanation model.

Citation Information

Cited By

  • Photovoltaic energy storage cabinet fault diagnosis method and system based on deep learning

    CN120744463A

  • A photovoltaic energy storage cabinet fault diagnosis method and system based on deep learning

    CN120744463B