Pluggable attribute forgetting method and system for drug recommendation
By constructing an erasure module and utilizing the loss function of information theory rate distortion theory, sensitive attribute information of patient embedding vectors in drug recommendation systems is eliminated, solving the problem of sensitive attribute leakage in drug recommendation systems and improving security and credibility.
Patent Information
- Application Number
- CN202511385656.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-26
- Publication Date
- 2025-10-31
AI Technical Summary
Existing drug recommendation systems tend to learn and encode sensitive patient attributes when generating patient representation vectors, making them vulnerable to attribute reasoning attacks after model deployment. Furthermore, existing methods have limitations in practical applications and fail to meet the requirements for security and reliability.
An erasure module is constructed, and a loss function is built based on rate-distortion theory in information theory. The erasure module eliminates sensitive attribute information in the embedded vector, and the module is inserted into the drug recommendation model to optimize the parameters, ensuring that sensitive attributes are unidentifiable while retaining recommendation performance.
It achieves flexible suppression of sensitive attribute leakage without modifying the original model structure, improving the security and credibility of the drug recommendation system, meeting actual deployment needs, and possessing high module versatility and reversibility.
Smart Images

Figure CN120878037A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of artificial intelligence and medical information processing technology, specifically relating to a pluggable attribute forgetting method and system for drug recommendation. Background Technology
[0002] Drug recommendation systems, which analyze patients' electronic health records (EHRs) to enable personalized medication, are an important component of modern intelligent medical decision support systems. In recent years, with continuous advancements in the accuracy and safety of recommendation algorithms, models such as SafeDrug and MoleRec have been widely applied in clinical decision support.
[0003] However, in the process of generating patient representation vectors using EHRs, these recommendation models often inadvertently learn and encode sensitive patient attributes, even if these attributes are not explicitly used for training. Due to the potentially sensitive features remaining in the patient embeddings, the models are vulnerable to attribute inference attacks after deployment.
[0004] While some research has attempted to achieve attribute forgetting through adversarial training and distribution alignment, these methods still have limitations in practical applications. Firstly, these methods typically rely on access to the original training data, making it difficult to meet security information constraints during actual deployment. Secondly, they often have a strong dependence on the recommendation model structure, lacking generality and transferability. Furthermore, most methods lack reversibility and cannot flexibly handle user requests to modify or undo attribute forgetting.
[0005] Therefore, it is of great importance to design a pluggable attribute forgetting method and system for drug recommendation that can effectively mitigate the risk of security information leakage in drug recommendation systems while ensuring recommendation performance, and improve the security and credibility of the system in real medical scenarios. Summary of the Invention
[0006] This invention aims to overcome the problem of patient safety information leakage risk in existing drug recommendation systems. It provides a pluggable attribute forgetting method and system for drug recommendation that can effectively mitigate the risk of safety information leakage in drug recommendation systems while ensuring recommendation performance, and improve the security and credibility of the system in real medical scenarios.
[0007] To achieve the above-mentioned objectives, the present invention adopts the following technical solution: A pluggable attribute forgetting method for drug recommendation includes the following steps; S1, Construct the erasure module to remove sensitive attribute information contained in the embedded vector; S2, based on rate-distortion theory in information theory, constructs a loss function to guide the learning of the erasure module; S3 uses the complete training set to train the existing drug recommendation model and obtains a stable ability to model patient representation and drug interaction. S4, insert the learned erasure module into the patient embedding output path in the drug recommendation model, and freeze the drug recommendation model parameters, optimizing only the parameters of the erasure module; S5 utilizes the interactive modeling capabilities obtained from the drug recommendation model to receive patient embedding information and drug embedding information, and performs interactive calculations to generate recommendation prediction results.
[0008] Preferably, in step S1, the specific process of the erasure module is as follows: Let the embedding representation matrix be denoted as ,in Representing a dimension as The real matrix space, that is, the embedding representation of each patient is composed of d-dimensional real vectors, forming an n-row d-column representation matrix; Map U to a matrix This makes the patient's sensitive attributes unidentifiable, while preserving as much information as possible related to drug recommendations.
[0009] Preferably, in step S2, the loss function includes an upper bound on the mutual information between the encoded representation and the sensitive attribute, and conditional mutual information given the sensitive attribute.
[0010] Preferably, the process of constructing the loss function includes the following steps: S21, Estimate the mutual information between the encoded representation and the sensitive attribute label y, the specific process is as follows: A variational upper bound is adopted, which relates to the logarithmic determinant operator of the variance regularization Gram matrix; Given a batch of normalized embedding representation matrices , For the original embedding representation matrix The indistinguishability of the corresponding attributes of the matrix obtained after mean centering is calculated as follows: ; in, This represents the normalized embedding representation matrix. This metric quantifies the indistinguishability of attributes; a higher value indicates more information in the embedding representation that can be used to distinguish sensitive attributes. This metric is calculated by... covariance matrix plus adjustment term The determinant is calculated and its logarithm is taken to characterize the amount of sensitive information contained in the overall representation. I is the identity matrix, n is the number of samples in the batch, and d represents the dimension. Robustness of control estimation;
[0011] The embedding representation matrix U is grouped according to the sensitive attribute label y, and the intra-class coding rate is calculated, where Y represents the set of values for the sensitive attribute tag. The specific process is as follows: There are C sensitive attribute categories, and each category has a corresponding tag matrix. The intra-class coding rate is then defined as: ; in, To embed the matrix under the condition of sensitive attribute grouping G. Intra-class coding rate. Label matrix Trace operation.
[0012] S22, the loss function for pluggable attribute forgetting loss PDAU is defined as follows: ; in, Used to control the strength of security information protection. represents the set of positive real numbers; b is the flooding coding rate threshold.
[0013] "Flooding" is a coding rate control strategy that sets a target coding compression level b and limits the overall coding rate R to approach it in the loss function, preventing over-compression or redundant exposure of sensitive information.
[0014] Preferably, step S2 further includes the following steps: S23, The final loss function of the drug recommendation model when jointly optimizing the basic task and attribute forgetting objective. for: ; in, Indicates recommendation error; parameters Control the weight of the erase module in the optimization process.
[0015] Preferably, in step S5, the interactive calculation method adopts one of the following: dot product, neural network, or attention mechanism.
[0016] Preferably, the method further includes the following steps: S6, a closed-loop attack verification mechanism is introduced to verify the actual suppression effect of the erasure module on sensitive attributes; the specific process of the closed-loop attack verification mechanism is as follows: The matrix output by the erase module A binary classification dataset is constructed with the original sensitive attribute label y; then, a traditional attribute classifier is used as the attack model to perform supervised learning training on the binary classification dataset, with the goal of maximizing the attribute recognition accuracy. If the erasure module is effective, the performance of the attribute classifier on the binary classification dataset will decrease significantly, indicating that sensitive attribute information is difficult to identify.
[0017] The present invention also provides a pluggable attribute forgetting system for drug recommendation, comprising: The erase module building module is used to build the erase module and eliminate sensitive attribute information contained in the embedded vector; The loss function construction module is used to construct loss functions based on rate-distortion theory in information theory, and guide the learning of the erasure module. The training module is used to train existing drug recommendation models using the complete training set to obtain stable patient representation and drug interaction modeling capabilities. The deployment module is used to insert the learned erasure module into the patient embedding output path in the drug recommendation model, while freezing the drug recommendation model parameters and optimizing only the parameters of the erasure module; The prediction result generation module is used to receive patient embedding information and drug embedding information by utilizing the interactive modeling capabilities obtained from the drug recommendation model, and perform interactive calculations to generate recommendation prediction results.
[0018] Compared with the prior art, the beneficial effects of this invention are: (1) The method of this invention has high modular versatility and can be flexibly adapted to a variety of mainstream drug recommendation models without modifying their original structure, avoiding the high risk and high cost of structural modification of complex systems; (2) The optimization objective of the method of this invention is derived based on the rate-distortion information theory framework. The loss function not only has clear interpretability, but also ensures the stability and convergence of the training process; (3) At the deployment level, this invention has good engineering usability, supports offline training and online plug-and-play, and can implement attribute erasure without accessing training data, which meets the needs of safety information compliance management in real-world scenarios (such as GDPR and HIPAA); (4) This invention has natural scalability and flexibility, supporting parallel suppression of multiple attributes (such as age, gender and other combined sensitive features), and supporting enabling or revoking the erasure module at the user's will, meeting the high standard requirements for dynamic safety information control in clinical or intelligent medical care. Attached Figure Description
[0019] Figure 1This is a flowchart of a pluggable attribute forgetting method for drug recommendation in this invention. Detailed Implementation
[0020] To more clearly illustrate the embodiments of the present invention, specific implementation methods will be described below with reference to the accompanying drawings. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings and other implementation methods can be obtained based on these drawings without any creative effort.
[0021] This invention primarily constructs an embedding erasure module and incorporates an objective function derived from rate-distortion theory in information theory. This effectively weakens the representation of sensitive attributes in patient embeddings while ensuring the accuracy of the recommendation system, thereby resisting attribute reasoning attacks. This invention redefines the optimization objective function structure for embedding compression and forgetting based on a rate-distortion theory-based information compression framework, combined with the user representation scenario in drug recommendation. It also possesses good theoretical interpretability and system deployment adaptability.
[0022] In order to achieve the above-mentioned objectives of the invention, such as Figure 1 As shown, this invention provides a pluggable attribute forgetting method for drug recommendation, comprising the following steps: 1. Construct an erasure module to remove sensitive attribute information contained in the embedded vector; 2. Based on rate-distortion theory in information theory, a loss function is constructed to guide the learning of the erasure module; 3. Train existing drug recommendation models using the complete training set to obtain stable patient representation and drug interaction modeling capabilities; 4. Insert the learned erasure module into the patient embedding output path of the drug recommendation model, while freezing the parameters of the drug recommendation model (such as SafeDrug, MoleRec), optimizing only the parameters of the erasure module to minimize sensitive attribute signals while preserving recommendation performance as much as possible. 5. Utilize the interactive modeling capabilities obtained from the drug recommendation model to receive patient embedding information and drug embedding information, and perform interactive calculations (using one of the following methods: dot product, neural network, or attention mechanism) to generate recommendation prediction results. The training objective is to balance maximizing attribute indistinguishability (intra-class encoding rate) with controlled overall compression rate.
[0023] In step 1, the present invention proposes a flexible and modular pluggable erasure module. Based on any existing drug recommendation model, the original structure remains unchanged, and a learnable erasure module is inserted only between the patient representation (embedding) output and the subsequent drug matching module to weaken the sensitive attribute signals in the representation.
[0024] The specific process of the erasure module is as follows: Let the embedding representation matrix be denoted as ,in Representing a dimension as The real matrix space, that is, the embedding representation of each patient is composed of d-dimensional real vectors, forming an n-row d-column representation matrix; The goal of the erasure module is to map U into an embedding representation matrix. This makes the patient's sensitive attributes unidentifiable, while preserving as much information as possible related to drug recommendations.
[0025] For step 2, to achieve attribute forgetting while preserving task-related semantics, this invention introduces a specialized loss function to guide the learning of the erasure module during joint training. This loss consists of two key parts: an upper bound on the mutual information between the encoded representation and the sensitive attribute, and conditional mutual information given the sensitive attribute. The goal is to make the embedding... It is difficult to encode within a class (indicating large differences within the class), while the overall compression rate is controlled, thus avoiding the leakage of sensitive attributes while preserving recommendation performance.
[0026] The process of constructing the loss function includes the following steps: 2-1, Estimating the mutual information between the encoded representation and the sensitive attribute label y, the specific process is as follows: A variational upper bound is adopted, which relates to the logarithmic determinant operator of the variance regularization Gram matrix; Given a batch of normalized embedding representation matrices , For the original embedding representation matrix The attribute-agnostic information of the matrix obtained after mean centering is calculated as follows: ; in, This represents the normalized embedding representation matrix. The metric is used to quantify the indistinguishability of attributes, where I is the identity matrix, n is the number of samples in the batch, and d represents the dimension. Robustness of control estimation; To further measure the compressibility within sample groups of different attribute categories y (i.e., the inter-class distinguishable portion after ignoring the attribute), this invention groups the embedding representation matrix U according to the sensitive attribute label y and calculates the intra-class coding rate, where Y represents the set of values for the sensitive attribute label. For example, for the gender attribute Y={0,1}, it can correspond to the two categories of "male" and "female" respectively. This is used to group patient samples according to attribute categories. The specific process is as follows: There are C sensitive attribute categories, and each category has a corresponding tag matrix. The intra-class coding rate is then defined as: ; in, To embed the matrix under the condition of sensitive attribute grouping G. Intra-class coding rate. Label matrix Trace operation.
[0027] 2-2, The loss function for pluggable attribute forgetting loss PDAU is defined as follows: ; in, Used to control the strength of security information protection. represents the set of positive real numbers; b is the flooding coding rate threshold.
[0028] "Flooding" is a coding rate control strategy that sets a target coding compression level b and limits the overall coding rate R to approach it in the loss function, preventing over-compression or redundant exposure of sensitive information.
[0029] 2-3, The final loss function of the drug recommendation model when jointly optimizing the basic task and attribute forgetting objective. for: ; in, Indicates recommendation error (e.g., multi-label cross-entropy, DDI penalty term); parameters Control the weight of the erase module in the optimization process.
[0030] The erasure module in this invention can be directly applied to the user representation path of any drug recommendation model without modifying the recommendation backbone network, thus meeting the practical needs of "post-training protection" and "configurable attribute erasure". It also supports an attribute revocation mechanism—if the user revokes the forgetting request, the identity transformation f(U) = U is restored.
[0031] At the experimental level, to verify the actual suppression effect of the erasure module on sensitive attributes, this invention also introduces a closed-loop attack verification mechanism. Specifically, firstly, the embedded representation output by the erasure module is... A binary classification dataset is constructed using the original sensitive attribute label y. Then, a traditional attribute classifier (such as XGBoost or MLP) is used as the attack model for supervised learning training on this dataset, aiming to maximize attribute recognition accuracy. If the erasure module is effective, the classifier's performance (such as accuracy and AUC) on this dataset should significantly decrease, indicating that attribute information is difficult to recognize. Simultaneously, the original embedding U and the erased embedding U are compared before and after training. If the prediction results are... A significant reduction in predictive ability indicates that the attribute forgetting objective has been achieved. This process forms a complete "attack-verification" closed-loop path, which can help evaluate the privacy protection capabilities of the erasure module in real-world deployments.
[0032] In addition, the present invention also provides a pluggable attribute forgetting system for drug recommendation, comprising: The erase module building module is used to build the erase module and eliminate sensitive attribute information contained in the embedded vector; The loss function construction module is used to construct loss functions based on rate-distortion theory in information theory, and guide the learning of the erasure module. The training module is used to train existing drug recommendation models using the complete training set to obtain stable patient representation and drug interaction modeling capabilities. The deployment module is used to insert the learned erasure module into the patient embedding output path in the drug recommendation model, while freezing the drug recommendation model parameters and optimizing only the parameters of the erasure module; The prediction result generation module is used to receive patient embedding information and drug embedding information by utilizing the interactive modeling capabilities obtained from the drug recommendation model, and perform interactive calculations to generate recommendation prediction results.
[0033] Based on the technical solution of this invention, the following case scenario illustrates the implementation process of this invention in practical applications. The specific application implementation scheme is as follows: Based on the real-world medical dataset, the Intensive Care Clinical Dataset III (MIMIC-III), a drug recommendation system scenario for hospitalized patients is constructed. This system takes patient information, medication information, and diagnostic records as input, and obtains patient representation vectors and drug risk prediction distributions through the main model, SafeDrug. To address the risk of leakage of patient gender-sensitive attributes, a pluggable attribute forgetting module (erasure module) proposed in this invention is inserted after the main model training to compress the patient representation.
[0034] The specific implementation steps are as follows: First, train the original SafeDrug model using the complete training set and fix its structure and parameters; then, embed the patient into the erase module and construct an optimization function with the goal of "maximizing intra-class coding rate + controlling the target level of coding rate" to optimize the module without accessing the original training labels; finally, in the deployment stage, only the erase module is retained as the embedding transformation layer in the recommendation process, and the overall system architecture remains unchanged.
[0035] In the following experiments, this invention used "gender attribute" as a sensitive target and evaluated the identifiability of patient embeddings using attack classifiers (MLP and XGBoost) while observing changes in recommendation performance. The comparative results are shown in Tables 1 and 2: Table 1. Attribute Forgetting Effect Data Table
[0036] Table 2 Recommended Performance Data Table
[0037] Table 1 shows the effectiveness of the attack on the classifier, including five attack metrics: Discrimination Power (AUROC) measures the attack model's ability to distinguish different attribute categories; a lower AUROC indicates better privacy protection. Overall Performance (AUPR) measures the stability of the attack model in identifying rare attributes; a lower AUPR indicates that sensitive attributes are more difficult to recover. Accuracy represents the proportion of correct overall judgments by the attack model; a lower accuracy indicates stronger attribute unrecognition. Precision represents the accuracy of the attack model's prediction of a certain attribute; a lower precision indicates more ambiguous predictions. Recall represents the proportion of attributes identified by the attack model from the true attributes; a lower recall indicates that sensitive information is effectively suppressed. Table 1 shows that the method proposed in this invention achieves a significant improvement in suppressing sensitive attribute leakage.
[0038] Table 2 shows the drug recommendation performance after using the method of this invention, including five indicators: Drug Interaction Rate (DDI) (↓) measures the proportion of potential drug conflicts in the recommendation results; the lower the value, the higher the safety. Drug Set Overlap Rate (Jaccard) (↑) indicates the degree of overlap between the recommended drug set and the actual drug set; the higher the value, the more accurate the recommendation. Overall Accuracy (F1-score) (↑) comprehensively evaluates the accuracy and coverage of the recommendations; the higher the value, the better the overall performance. Predictive Stability (PRAUC) (↑) indicates the model's ability to identify positive samples in the drug recommendation task; the higher the value, the better. The average number of recommended drugs reflects the complexity or dosage level of the recommendation results. As can be seen from Table 2, the loss on the main recommendation indicators is minimal compared to the original model, verifying the practicality and deployability of this method in medical recommendation systems.
[0039] This invention inserts an independent neural network module (erasure module) between the patient representation vector and the drug matching module in the recommendation model to eliminate sensitive attribute information contained in the embedded vector. This module has a simple structure, good scalability and independence, and can be flexibly deployed without modifying the original recommendation model's main structure.
[0040] To achieve accurate attribute erasure, the training objective of the erasure module is based on rate-distortion theory in information theory, balancing attribute unidentifiability with recommendation performance. Specifically, this invention constructs a loss function to maximize the representation difference between categories of the same sensitive attribute, while controlling the overall embedding compression rate within a specified range, thereby ensuring that the "shuffling" of sensitive attributes does not significantly impair the accuracy of the recommendation system.
[0041] This invention's method does not rely on original training data; the training process only affects the parameters of the erase module, exhibiting reversibility and transferability. It allows for flexible adjustment or reversal of the forgetting strategy based on different deployment requirements. Through this mechanism, the risk of security information leakage in drug recommendation systems can be effectively mitigated while maintaining recommendation performance, thereby improving the system's security and credibility in real-world medical scenarios.
[0042] The above description is merely a detailed explanation of preferred embodiments and principles of the present invention. For those skilled in the art, there may be changes in specific implementation methods based on the ideas provided by the present invention, and these changes should also be considered within the scope of protection of the present invention.
Claims
1. A pluggable attribute forgetting method for drug recommendation, characterized in that, Includes the following steps; S1, Construct the erasure module to remove sensitive attribute information contained in the embedded vector; S2, based on rate-distortion theory in information theory, constructs a loss function to guide the learning of the erasure module; S3 uses the complete training set to train the existing drug recommendation model and obtains a stable ability to model patient representation and drug interaction. S4, insert the learned erasure module into the patient embedding output path in the drug recommendation model, and freeze the drug recommendation model parameters, optimizing only the parameters of the erasure module; S5 utilizes the interactive modeling capabilities obtained from the drug recommendation model to receive patient embedding information and drug embedding information, and performs interactive calculations to generate recommendation prediction results.
2. The pluggable attribute forgetting method for drug recommendation according to claim 1, characterized in that, In step S1, the specific process of the erasure module is as follows: Let the embedding representation matrix be denoted as ,in Representing a dimension as The real matrix space, that is, the embedding representation of each patient is composed of d-dimensional real vectors, forming an n-row d-column representation matrix; Map U to a matrix This makes the patient's sensitive attributes unidentifiable, while preserving as much information as possible related to drug recommendations.
3. The pluggable attribute forgetting method for drug recommendation according to claim 2, characterized in that, In step S2, the loss function includes an upper bound on the mutual information between the encoded representation and the sensitive attribute, and conditional mutual information given the sensitive attribute.
4. The pluggable attribute forgetting method for drug recommendation according to claim 3, characterized in that, The process of constructing the loss function includes the following steps: S21, Estimate the mutual information between the encoded representation and the sensitive attribute label y, the specific process is as follows: A variational upper bound is adopted, which relates to the logarithmic determinant operator of the variance regularization Gram matrix; Given a batch of normalized embedding representation matrices , For the original embedding representation matrix After mean centering, the indistinguishability of the corresponding attributes of the matrix is calculated as follows: ; in, Representation matrix The metric used to quantify the indistinguishability of attributes is I, where I is the identity matrix, n is the number of samples in the batch, and d represents the dimension. Robustness of control estimation; The embedding representation matrix U is grouped according to the sensitive attribute label y, and the intra-class coding rate is calculated, where Y represents the set of values for the sensitive attribute tag. The specific process is as follows: There are C sensitive attribute categories, and each category has a corresponding tag matrix. The intra-class coding rate is then defined as: ; in, To embed the matrix under the condition of sensitive attribute grouping G. Intra-class coding rate; Label matrix trace operation; S22, the loss function for pluggable attribute forgetting loss PDAU is defined as follows: ; in, Used to control the strength of security information protection. represents the set of positive real numbers; b is the flooding coding rate threshold.
5. The pluggable attribute forgetting method for drug recommendation according to claim 4, characterized in that, Step S2 further includes the following steps: S23, The final loss function of the drug recommendation model when jointly optimizing the basic task and attribute forgetting objective. for: ; in, Indicates recommendation error; parameters Control the weight of the erase module in the optimization process.
6. The pluggable attribute forgetting method for drug recommendation according to claim 1, characterized in that, In step S5, the interactive calculation method employs one of the following: dot product, neural network, or attention mechanism.
7. The pluggable attribute forgetting method for drug recommendation according to claim 5, characterized in that, It also includes the following steps: S6, a closed-loop attack verification mechanism is introduced to verify the actual suppression effect of the erasure module on sensitive attributes; the specific process of the closed-loop attack verification mechanism is as follows: The matrix output by the erase module A binary classification dataset is constructed with the original sensitive attribute label y; then, a traditional attribute classifier is used as the attack model to perform supervised learning training on the binary classification dataset, with the goal of maximizing the attribute recognition accuracy. If the erasure module is effective, the performance of the attribute classifier on the binary classification dataset will decrease significantly, indicating that sensitive attribute information is difficult to identify.
8. A pluggable attribute forgetting system for drug recommendation, used to implement the pluggable attribute forgetting method for drug recommendation as described in any one of claims 1-7, characterized in that, The pluggable attribute forgetting system for drug recommendation includes: The erase module building module is used to build the erase module and eliminate sensitive attribute information contained in the embedded vector; The loss function construction module is used to construct loss functions based on rate-distortion theory in information theory, and guide the learning of the erasure module. The training module is used to train existing drug recommendation models using the complete training set to obtain stable patient representation and drug interaction modeling capabilities. The deployment module is used to insert the learned erasure module into the patient embedding output path in the drug recommendation model, while freezing the drug recommendation model parameters and optimizing only the parameters of the erasure module; The prediction result generation module is used to receive patient embedding information and drug embedding information by utilizing the interactive modeling capabilities obtained from the drug recommendation model, and perform interactive calculations to generate recommendation prediction results.
Citation Information
Patent Citations
Drug recommendation method and device, electronic equipment and storage medium
CN112652375A
Efficient self-adaptive safe cross-domain recommendation method
CN118170972A
Drug recommendation system and method based on causal inference
CN119811576A