Drug recommendation system and method based on causal inference
By introducing causal inference and deep learning models into the drug recommendation system, low-dimensional hidden variables are generated and parameters are optimized, the problems of causality neglect and data bias in the drug recommendation system are solved, and more accurate and reliable drug recommendations are achieved.
Patent Information
- Application Number
- CN202510292960.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-13
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2045-03-13
AI Technical Summary
The existing drug recommendation system fails to fully consider the causal relationship between the patient and the drug, which makes the recommendation system susceptible to data deviations and noise interference, affecting the accuracy and reliability of the recommendation.
Using a deep learning model based on causal inference, low-dimensional hidden variables of patient and medical examination data are generated through patient status encoder and medical examination autoencoder. Combining contrast learning and collaborative filtering models, the parameters of the drug recommendation system are optimized to improve the accuracy and reliability of recommendations.
By embedding causal mechanisms, the effects of unobserved covariates on recommendations are reduced, the effects of data bias and noise are reduced, and the accuracy and robustness of drug recommendations are improved.
Smart Images

Figure CN119811576A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data mining, and in particular to a drug recommendation system and method based on causal inference. Background Art
[0002] Drug recommendation aims to provide doctors and patients with the most appropriate drug recommendations based on the patient's health status, avoiding side effects and adverse reactions caused by improper use of drugs. Existing drug recommendation systems are mainly based on electronic medical record data, which are usually organized at the patient level, visit level, and event level. By analyzing the patient's current visit information or multiple visit records, the system can construct an expression of the patient's health status and provide personalized drug recommendations accordingly.
[0003] As a method of studying causal relationships, causal inference focuses on the causal mechanism between variables and attempts to reveal the true impact of an intervention on a specific outcome. By introducing causal inference, data bias problems can be effectively alleviated, such as distinguishing between patient-irrelevant manifestations and false associations between recommended drugs caused by confounding factors. In addition, causal inference can also help the system make reasonable inferences in the absence of data, improving the robustness and credibility of recommendations.
[0004] However, most existing drug recommendation algorithms use data-driven supervised learning methods. Specifically, these algorithms use patient data as a supervisory signal for model training. However, bias and noise problems in the data can easily interfere with model training and affect its performance in the deployment phase. For example, due to unobserved covariates, some drugs may be effective in specific patient groups, but may not be applicable in other groups. This data bias weakens the generalization ability of the model, resulting in reduced accuracy and applicability of recommendations. In addition, patients' medical records may be missing or contain irrelevant diagnostic information, which further affects the reliability of drug recommendations. Summary of the invention
[0005] In view of the shortcomings of the prior art, the present invention provides a drug recommendation system and method based on causal inference, which solves the problem that the existing drug recommendation method fails to fully consider the causal relationship between patients and drugs, resulting in the recommendation system being susceptible to data bias and noise interference. The present invention estimates the true causal relationship between patients and drugs through the front-door criterion in causal inference, and implements a deep learning model to improve the accuracy and reliability of recommendations.
[0006] A drug recommendation system based on causal inference, using a deep learning model, specifically including a patient state encoder, a medical examination autoencoder, and a recommendation module; The patient state encoder inputs patient characteristics X , using a multi-layer perceptron to transform high-dimensional patient featuresX Mapping to a low-dimensional latent space to generate latent variables of the patient's status Z X , expressed as: Z X = f enc ( X , θ X ); in, f enc is the neural network model of the patient state encoder, θ X is the model parameter.
[0007] The medical examination autoencoder uses an encoder-decoder structure to process medical examination data R , extract key features and compress them into low-dimensional space, construct alternative low-dimensional latent variables Z R ; The encoder-decoder structure adopts a variational autoencoder VAE structure, which specifically includes two modules, an encoder and a decoder, as shown below: , ; in, and For encoder and decoder, and are encoder and decoder parameters, Medical examination data for reconstruction; In the variational autoencoder VAE, replace the low-dimensional latent variable Z R The prior distribution of is set to the standard multivariate normal distribution: ; in, N (0, I ) means the mean is 0 and the covariance matrix is the identity matrix I The multivariate normal distribution of .
[0008] The encoder inputs medical examination data to generate alternative low-dimensional latent variables Z R The posterior distribution of As the output of the encoder: ; in, and They are respectively replacing low-dimensional latent variables Z R The mean and standard deviation of represents a diagonal matrix.
[0009] The decoder is composed of low-dimensional latent variables Z R As input, the encoded latent variables are mapped back to the original input space, and the original data is reconstructed to generate medical examination data R The reconstruction vector, i.e. the reconstructed medical examination data .
[0010] The training goal of the variational autoencoder VAE is to minimize the total loss function L VAE , the total loss function L VAE Including reconstruction loss and KL divergence loss: The reconstruction loss is the negative expectation of the conditional log-likelihood: ; in, represents the expected value, is the log-likelihood term, indicating that Z R Under the condition of R probability.
[0011] If the conditional distribution Assuming a normal distribution, expand it into the mean square error form: ; in, and For the i The original and reconstructed medical examination data of samples.
[0012] The KL divergence loss is specifically: ; in, represents the Kullback-Leibler divergence; d is the dimension of the latent variable, and They are i The mean and standard deviation of the latent variables, For a given medical examination R Low-dimensional latent variables Z R The posterior distribution of .
[0013] Through hyperparameters Balancing the reconstruction loss and the KL divergence loss, the total loss function is have: .
[0014] Use contrastive learning to further optimize the replacement of low-dimensional latent variables Z R , capturing medical examination data Rand patient characteristics X The causal relationship between , the posterior probability and prior probability P ( X ) ratio.
[0015] In the contrastive learning, the positive sample is a pair of data from the same patient ( X , R ), R is the medical examination data of the target patient, X is the corresponding patient feature; negative samples are randomly selected patient features and medical examination data of target patients R Combination that is ( X’ , R ); Contrastive learning calculates the contrast probability by shortening the distance between positive sample pairs and extending the distance between negative samples. ; Specifically, the InfoNCE loss function is used as the contrastive learning loss, which is defined as follows: ; in, is the temperature coefficient, i, j Represents the positive and negative sample index, , are the positive and negative samples of the index, For patients i Medical examination R The alternative latent variable is N is the number of negative samples, is the similarity function; similarity function Represents the similarity between the surrogate variable and the patient characteristics, calculated using cosine similarity: .
[0016] The recommendation module is a collaborative filtering model, namely, a factorization machine FM; X and low-dimensional latent variables As input, drug recommendations are provided for each patient, and the output of the recommendation module is the conditional probability , indicating that each drug The recommendation probability is as follows: ; in It is a recommended module; is the parameter of the recommendation module, and the output is a multi-class probability distribution, indicating the recommendation probability of each drug ; Using Recommendation Loss Measures the deviation between the drug recommendation probability predicted by the model and the actual drug label, which is defined as the multi-classification cross entropy loss: ; in, N represents the number of patients; K is the quantity of the drug; i indexing patients; k Drug Class Index, Indicates patient i In medicine k The real label on Indicates patient i In medicine k The predicted probability of Combine reconstruction loss, contrastive learning loss and recommendation loss to construct a joint optimization goal : ; In the formula , , Weigh the importance weights of reconstruction loss, contrastive learning loss, and recommendation loss respectively; In the causal graph corresponding to the drug recommendation system, the variable X Represents patient characteristics, variables R Represents medical examination data, Y represents the set of drugs suitable for the patient, C represents unobserved covariates; the drug recommendation system aims to mine X→Y Identify causal effects ; There is a causal path: X→R→Y , where the patient is suitable for a set of drugs Y Patient characteristics X and medical test results R For conditions; Based on the front-door adjustment in causal inference, the following causal effect is obtained: ; in, express X right Y causal effect; Express X Conduct intervention operations; Z R As an alternative R The low-dimensional latent variables, and is a low-dimensional latent variable Z R and X The probability distribution of Indicates a given Z R hour X The probability distribution of Indicates a given X andR of Y The probability distribution of .
[0017] Train the drug recommendation system to optimize three probability terms , and , get X right Y causal effect and eliminate unobserved covariates C Specifically, the causal effect is approximately estimated by optimizing the above reconstruction loss, contrastive learning loss, and recommendation loss.
[0018] A drug recommendation method based on causal inference is implemented based on the aforementioned drug recommendation system based on causal inference, and specifically includes the following steps: Step 1: Enter patient characteristics X , using a neural network encoder to X Projection into a low-dimensional embedding space; Step 2: Reconstruct medical examination data using the encoder-decoder structure R ,get R Alternative low-dimensional latent variables Z R , and calculate the reconstruction loss; Step 3: Calculate contrastive learning loss and optimize low-dimensional latent variables through contrastive learning loss Z R ; Step 4: Based on patient characteristics X and hidden variables of medical examinations Z R Predict appropriate medications and calculate recommendation losses; Step 5: Jointly optimize the reconstruction loss, contrastive learning loss, and recommendation loss to optimize the parameters of the drug recommendation system by optimizing the causal relationship between patients and drugs P ( Y | do ( X )) to improve the recommendation ability of the drug recommendation system; Step 6: After the drug recommendation system is optimized, ignore contrastive learning and use the drug recommendation system to make drug recommendations by combining patient characteristics and medical examination data.
[0019] The beneficial effects of adopting the above technical solution are: The present invention provides a drug recommendation system and method based on causal inference, which utilizes the front door criterion in causal inference to eliminate unobserved covariates. C In model training, the patient features are first transformed intoX Mapped to a low-dimensional embedding space; then using the encoder-decoder structure and reconstruction loss, the low-dimensional latent variables are learned as R By contrasting the learning loss, we ensure that the generated low-dimensional latent variables can capture R and X Predict appropriate medication based on patient characteristics and medical tests Y And calculate the recommendation loss. Finally, the drug recommendation model integrating causal relationships is obtained by jointly optimizing the reconstruction loss, contrast loss and recommendation loss. Compared with the existing methods, the present invention can embed the potential causal mechanism in the data into the drug recommendation model, eliminate the impact of unobserved covariates, reduce the bias and noise in the data, and improve the recommendation ability of the model. This method not only improves the robustness of the model when facing complex clinical data, but also improves the prediction accuracy in practical applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 It is a schematic diagram of the cause-effect relationship of the present invention; Figure 2 This is a schematic diagram of the drug recommendation system of the present invention; Figure 3 The figure is an overall flow chart of the drug recommendation method of the present invention. DETAILED DESCRIPTION
[0021] The specific implementation of the present invention is further described in detail below in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present invention, but are not intended to limit the scope of the present invention.
[0022] A drug recommendation system based on causal inference, using a deep learning model, the embodiment of the present invention discloses a drug recommendation system such as Figure 2 As shown, it specifically includes a patient state encoder, a medical examination autoencoder, and a recommendation module; the training process in this embodiment is as follows Figure 3 shown.
[0023] The patient state encoder inputs patient characteristics X , including patient demographic information (such as age, gender), medical history data and other health characteristics. Multilayer perceptron is used to transform high-dimensional patient features X Mapping to a low-dimensional latent space to generate latent variables of the patient's status , the encoding process is expressed as: ; in, is the neural network model of the patient state encoder, are model parameters; The medical examination autoencoder uses an encoder-decoder structure to process medical examination data R, extract key features and compress them into low-dimensional space representation, and construct alternative low-dimensional latent variables that can effectively reflect task-related causal information ,To achieve effective compression and representation of medical examination data; The encoder-decoder structure adopts a variational autoencoder VAE structure, which specifically includes two modules, an encoder and a decoder, as shown below: , ; in, and For encoder and decoder, and are encoder and decoder parameters, Medical examination data for reconstruction; In the variational autoencoder VAE, replace the low-dimensional latent variable The prior distribution of is set to the standard multivariate normal distribution: ; in, Indicates that the mean is 0 and the covariance matrix is the identity matrix The multivariate normal distribution of The encoder inputs medical examination data to generate alternative low-dimensional latent variables The posterior distribution of As the output of the encoder: ; in, and They are respectively replacing low-dimensional latent variables The mean and standard deviation of represents a diagonal matrix; The decoder is composed of low-dimensional latent variables As input, the encoded latent variables are mapped back to the original input space, and the original data is reconstructed to generate medical examination data R The reconstruction vector, i.e. the reconstructed medical examination data
[0024] The training goal of the variational autoencoder VAE is to minimize the total loss function , the total loss function Including reconstruction loss and KL divergence loss: The reconstruction loss measures the and medical examination data R The consistency of is defined as the negative expectation of the conditional log-likelihood: ; If the conditional distribution Assuming a normal distribution, expand it into the mean square error form: ; in, and For the i The original and reconstructed medical examination data of samples.
[0025] The KL divergence loss measures the posterior distribution of the latent variables With prior distribution The differences are as follows: ; in, represents the Kullback-Leibler divergence; d is the dimension of the latent variable, and They are i The mean and standard deviation of the latent variable.
[0026] Through hyperparameters Balancing the reconstruction loss and the KL divergence loss, the total loss function is have: ; Through the above design, the present invention uses the variational autoencoder (VAE) structure to effectively compress and characterize medical examination data and convert it into low-dimensional latent variables Hidden variables can not only express data features compactly, but also contain task-related causal information, which helps to improve recommendation accuracy.
[0027] Use contrastive learning to further optimize the replacement of low-dimensional latent variables , capturing medical examination data R and patient characteristics X The causal relationship between them, that is, the derived comparative probability term By leveraging the similarities and differences between data samples, contrastive learning can enhance the representation ability of surrogate variables for causal information.
[0028] In the contrastive learning, the positive sample is a pair of data from the same patient. , R is the medical examination data of the target patient, X are the corresponding patient features. Since the two come from the same patient and have a direct causal relationship, they are defined as a positive sample pair. The goal is to enable the encoder to capture this causal relationship through contrastive learning and replace the variable It is manifested in.
[0029] Negative samples are randomly selected patient characteristics and target patient medical examination data combinations. ; Since the randomly selected patient characteristics have no significant correlation with the positive sample data, they are defined as negative sample pairs. Contrastive learning calculates the contrast probability by pulling the distance of the positive sample pair closer and pushing the distance of the negative sample farther. ; Specifically, the InfoNCE loss function is used as the contrastive learning loss, which is defined as follows: ; in, The temperature coefficient controls the sensitivity of the distribution of positive and negative samples in contrastive learning, which is usually a hyperparameter less than 1 (e.g. 0.1). N is the number of negative samples; i, j Represents the positive and negative sample indexes, which are used to construct the negative sample set. is the similarity function.
[0030] Similarity function Represents the similarity between the surrogate variable and the patient characteristics, calculated using cosine similarity: ;
[0031] The recommendation module is a collaborative filtering model, namely, factorization machine FM. It aims to generate personalized drug recommendation results for patients based on their characteristics and medical examination data. X and hidden variables As input, it captures its potential feature interactions, and then provides accurate drug recommendations for each patient to maximize their clinical needs; the output of the recommendation module is the conditional probability , indicating that each drug The recommendation probability is as follows: ;
[0032] in It is a recommended module; is the parameter of the recommendation module, and the output is a multi-class probability distribution, indicating the recommendation probability of each drug ; Using Recommendation Loss It is used to measure the deviation between the drug recommendation probability predicted by the model and the actual drug label, which is defined as the multi-classification cross entropy loss: ; in, N represents the number of patients; K is the quantity of the drug; i indexing patients; k Drug Class Index, Indicates patient i In drug category k The true label on (usually 0 or 1); Indicates patient i In medicine k The predicted probability of The optimization goal of this loss function is to maximize the model's predicted probability of the patient's actual medication use, while minimizing the probability of incorrectly recommending unused drugs.
[0033] Combine reconstruction loss, contrastive learning loss and recommendation loss to construct a joint optimization goal : ;
[0034] In the formula , , Weigh the importance weights of reconstruction loss, contrastive learning loss, and recommendation loss respectively. By tuning these weights experimentally, we can achieve a balance between different tasks and ensure that the model performance is optimal in each subtask. Optimize and improve the accuracy of drug recommendations, eliminate irrelevant noise and bias, and provide patients with more reliable personalized treatment recommendations.
[0035] The causal graph corresponding to the drug recommendation system is as follows: Figure 1 As shown, the variable X Represents patient characteristics, variables R Represents medical examination data (including laboratory tests, imaging examinations, etc.), Y represents the set of drugs suitable for the patient, C represents unobserved covariates; the drug recommendation system aims to mine X→Y Identify causal effects ; Due to the presence of unobserved covariates C , through the path X←C→Y produce X and Y The false correlation between the two will damage the recommendation performance; in clinical practice, the results of medical examinations can objectively reflect the health status of patients and provide important support for medical diagnosis. Therefore, there is a causal path: X→R→Y , where the patient is suitable for a set of drugs Y Patient characteristics X and medical test results R As a condition, R As a mediating variable, it provides strong evidence to support the treatment of drugs Y .
[0036] Eliminate unobserved covariates based on the front-door criterion in causal inference theory C The bias and noise caused by the path X→R→Y For the front-door path, the covariate is effectively eliminated through the front-door adjustment technique C Accurately estimate the impact X→Y causal relationship.
[0037] Based on the front-door adjustment in causal inference, the following causal effect is obtained: ;
[0038] in, express X right Y causal effect; Indicates intervention operation on X; As an alternative R Low-dimensional latent variables are used to approximate causal effects; and is a hidden variable and X The probability distribution of Indicates a given hour X The probability distribution of Indicates a given X and R of Y The probability distribution of .
[0039] Train the drug recommendation system to optimize three probability terms , and , get X right Y causal effect and eliminate unobserved covariates C The confusion effect produced; specifically, the causal effect is approximately estimated by optimizing the reconstruction loss, contrastive learning loss, and recommendation loss.
[0040] A drug recommendation method based on causal inference is implemented based on the aforementioned drug recommendation system based on causal inference, and specifically includes the following steps: Step 1: Enter patient characteristics X (such as age, gender, medical history, etc.), using a neural network encoder (such as a multilayer perceptron) X Projection into a low-dimensional embedding space; Step 2: Use an encoder-decoder structure (such as a variational autoencoder) to reconstruct medical examination data R ,get R Alternative low-dimensional latent variables , and calculate the reconstruction loss; Step 3: Calculate contrastive learning loss and optimize low-dimensional latent variables through contrastive learning loss (such as InfoNCE) , ensuring that the generated surrogate variables can learn X→R causal relationship; Step 4: Based on patient characteristics X and hidden variables of medical examinations Predict appropriate medications and calculate recommendation losses; Step 5: Jointly optimize the reconstruction loss, contrastive learning loss, and recommendation loss to optimize the parameters of the drug recommendation system by optimizing the causal relationship between patients and drugs , improve the recommendation ability of the drug recommendation system; Step 6: After the drug recommendation system is optimized, ignore contrastive learning and use the drug recommendation system to make drug recommendations by combining patient characteristics and medical examination data.
[0041] The drug recommendation system proposed in the embodiment of the present invention was verified and applied on the open source electronic health record dataset MIMIC-III. To ensure the validity and consistency of the data, the dataset was preprocessed (filtering patients who were admitted only once), and finally 5,449 patients and their 14,141 admission records were selected. In this embodiment, the Diagnoses and Procedures data in the MIMIC-III dataset were used to extract the patient's condition characteristics and medical examination information as input features, respectively, to build and optimize the drug recommendation model. The drug recommendation effect is comprehensively evaluated by indicators such as Jaccard similarity score (Jaccard), F1 score (F1 Score) and area under the Precision-Recall curve (PRAUC), and the specific comparison is shown in Table 1 below.
[0042] Table 1 method Jaccard F1 Score PRAUC Factorization Machine 0.428 0.587 0.693 Factorization Machine + Reconstruction Loss 0.443 0.602 0.717 Factorization Machine + Contrastive Learning Loss 0.434 0.593 0.697 Embodiments of the present invention 0.467 0.620 0.734 From the results in the table, it can be seen that the embodiments of the present invention significantly improve various indicators compared with other methods, especially in Jaccard, F1 Score and PRAUC, all of which have achieved the best performance. At the same time, based on the factor decomposition machine, the reconstruction loss and contrastive learning loss are added respectively, and the performance is improved, indicating the effectiveness of each module in the invention. In summary, it can be seen that the drug recommendation system based on causal inference of the present invention can better integrate patient characteristics and medical examinations, and more accurately recommend drug regimens, and has broad practical application value and promotion prospects.
[0043] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above inventive concept. For example, the above features are replaced with (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure to form a technical solution.
Claims
1. A drug recommendation system based on causal inference, characterized in that: Use deep learning models, including patient state encoder, medical examination autoencoder, and recommendation module; The patient state encoder inputs patient characteristics X , using a multi-layer perceptron to transform high-dimensional patient features X Mapping to a low-dimensional latent space to generate latent variables of the patient's status Z X , expressed as: Z X = f enc ( X , θ X ); in, f enc is the neural network model of the patient state encoder, θ X are model parameters; The medical examination autoencoder uses an encoder-decoder structure to process medical examination data R , extract key features and compress them into low-dimensional space, construct alternative low-dimensional latent variables Z R ; The encoder-decoder structure adopts a variational autoencoder VAE structure, which specifically includes two modules, an encoder and a decoder, as shown below: , ; in, and For encoder and decoder, and are encoder and decoder parameters, Medical examination data for reconstruction; In the variational autoencoder VAE, replace the low-dimensional latent variable Z R The prior distribution of is set to the standard multivariate normal distribution: ; in, N (0, I ) means the mean is 0 and the covariance matrix is the identity matrix I The multivariate normal distribution of The recommendation module is a collaborative filtering model, namely, a factorization machine FM; X and low-dimensional latent variables Z R As input, a drug recommendation is provided for each patient, and the output of the recommendation module is the conditional probability, Indicates each drug The recommendation probability is as follows: ; in It is a recommended module; is the parameter of the recommendation module, and the output is a multi-class probability distribution, indicating the recommendation probability of each drug .
2. A drug recommendation system based on causal inference according to claim 1, characterized in that: The encoder inputs medical examination data to generate alternative low-dimensional latent variables Z R The posterior distribution of As the output of the encoder: ; in, and They are respectively replacing low-dimensional latent variables Z R The mean and standard deviation of diag represents a diagonal matrix; The decoder is composed of low-dimensional latent variables Z R As input, the encoded latent variables are mapped back to the original input space, and the original data is reconstructed to generate medical examination data R The reconstruction vector, i.e. the reconstructed medical examination data .
3. A drug recommendation system based on causal inference according to claim 1, characterized in that: The training objective of the variational autoencoder VAE is to minimize the total loss function L VAE , the total loss function L VAE Including reconstruction loss and KL divergence loss: The reconstruction loss is the negative expectation of the conditional log-likelihood: ; in, represents the expected value, is the log-likelihood term, indicating that Z R Under the condition of R probability; If the conditional distribution Assuming a normal distribution, expand it into the mean square error form: ; in, and For the i The original and reconstructed medical examination data of samples; The KL divergence loss is specifically: ; in, represents the Kullback-Leibler divergence; d is the dimension of the latent variable, and They are i The mean and standard deviation of the latent variables, For a given medical examination R Low-dimensional latent variables The posterior distribution of Balancing the reconstruction loss and the KL divergence loss, the total loss function is have: ; Use contrastive learning to further optimize the replacement of low-dimensional latent variables Z R , capturing medical examination data R and patient characteristics X The causal relationship between , the posterior probability and prior probability ratio.
4. A drug recommendation system based on causal inference according to claim 3, characterized in that: In the contrastive learning, the positive sample is a pair of data from the same patient ( X , R ), R is the medical examination data of the target patient, X is the corresponding patient characteristic; Negative samples are randomly selected patient features X‘ and medical examination data of target patients R Combination that is ( X’ , R ); Contrastive learning calculates the contrast probability by shortening the distance between positive sample pairs and extending the distance between negative samples. ; Specifically, the InfoNCE loss function is used as the contrastive learning loss, which is defined as follows: ; in, is the temperature coefficient, i, j Represents the positive and negative sample index, , are the positive and negative samples of the index, For patients i Medical examination R The alternative latent variable is N is the number of negative samples, is the similarity function; similarity function Represents the similarity between the surrogate variable and the patient characteristics, calculated using cosine similarity: .
5. A drug recommendation system based on causal inference according to claim 4, characterized in that: In the recommendation module, the recommendation loss is used L recommendation Measures the deviation between the drug recommendation probability predicted by the model and the actual drug label, which is defined as the multi-classification cross entropy loss: ; in, N represents the number of patients; K is the quantity of the drug; i indexing patients; k Drug Class Index, Indicates patient i In medicine k The real label on Indicates patient i In medicine k The predicted probability of Combine reconstruction loss, contrastive learning loss and recommendation loss to construct a joint optimization goal : ; In the formula , , Weigh the importance weights of reconstruction loss, contrastive learning loss, and recommendation loss respectively.
6. A drug recommendation system based on causal inference according to claim 1, characterized in that: In the causal graph corresponding to the drug recommendation system, the variable X Represents patient characteristics, variables R Represents medical examination data, Y represents the set of drugs suitable for the patient, C represents unobserved covariates; the drug recommendation system aims to mine X→Y Identify causal effects ; There is a causal path: X→R→Y , where the patient is suitable for a set of drugs Y Patient characteristics X and medical test results R For conditions; Based on the front-door adjustment in causal inference, the following causal effect is obtained: ;in, express X right Y causal effect; Express X Conduct intervention operations; Z R As a replacement R The low-dimensional latent variables, and is a low-dimensional latent variable Z R and X The probability distribution of Indicates a given Z R hour X The probability distribution of Indicates a given X and R of Y The probability distribution of Train the drug recommendation system to optimize three probability terms , and , get X right Y causal effect and eliminate unobserved covariates C Specifically, the causal effect is approximately estimated by optimizing the above reconstruction loss, contrastive learning loss, and recommendation loss.
7. A drug recommendation method based on causal inference, implemented by a drug recommendation system based on causal inference as claimed in claim 1, characterized in that: The specific steps include: Step 1: Enter patient characteristics X , using a neural network encoder to X Projection into a low-dimensional embedding space; Step 2: Reconstruct medical examination data using the encoder-decoder structure R ,get R Alternative low-dimensional latent variables Z R , and calculate the reconstruction loss; Step 3: Calculate contrastive learning loss and optimize low-dimensional latent variables through contrastive learning loss Z R ; Step 4: Based on patient characteristics X and hidden variables of medical examinations Z R Predict appropriate medications and calculate recommendation losses; Step 5: Jointly optimize the reconstruction loss, contrastive learning loss, and recommendation loss to optimize the parameters of the drug recommendation system by optimizing the causal relationship between patients and drugs P ( Y | do ( X )) to improve the recommendation ability of the drug recommendation system; Step 6: After the drug recommendation system is optimized, ignore contrastive learning and use the drug recommendation system to make drug recommendations by combining patient characteristics and medical examination data.
Citation Information
Patent Citations
Drug-disease associated prediction method based on variational auto-encoder
CN113223655A
Method, system and device for correcting mainstream deviation of recommendation system and storage medium
CN115809374A
Generalized image classification method and device based on comparative learning and invariant causality
CN116994026A
Out-of-domain intention detection method based on comparative learning and variational auto-encoder
CN117744665A
Recommendation method, system and equipment based on causal reasoning and storage medium
CN118113939A
Cited By
Pluggable attribute forgetting method and system for drug recommendation
CN120878037A