Private domain data privacy leakage risk assessment method based on knowledge graph

By introducing graph priors and virtual data evaluation of knowledge graphs in gradient attacks, the efficiency and robustness of gradient attacks on large-scale discrete data sets are solved, achieving more efficient data recovery and prediction, and reducing privacy leakage risk.

CN118114257BActive Publication Date: 2024-12-03NANJING ARTIFICIAL INTELLIGENCE CHIPS RES INST OF AUTOMATION CHINESE ACAD OF SCI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410297214.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-15
Publication Date
2024-12-03
Estimated Expiration
2044-03-15

AI Technical Summary

Technical Problem

In the prior art, gradient attacks are not very effective in processing large-scale discrete data sets, the data restoration effect is high, the risk of single point failure is high, the global information is insufficient, and communication and computing overhead is large.

Method used

Adopt a private domain data privacy leakage risk assessment method based on knowledge graphs, by converting real data into vector representations, introducing graph priors, optimizing learning model weights, using virtual data to detect overfitting of models, balancing original losses and graph regularization losses , adjust model parameters to reduce the risk of privacy leakage.

Benefits of technology

It significantly improves the restoration effect of discrete data, improves the accuracy of data recovery and prediction, enhances the global information capture ability and robustness of the model, and reduces the risk of privacy leakage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118114257B_ABST
    Figure CN118114257B_ABST
Patent Text Reader

Abstract

The present invention relates to a private domain data privacy attack method based on knowledge graph. First, real data is converted into vector representation, input into a machine learning model for prediction, and the original loss is calculated based on the real label and the prediction result; a graph prior is introduced, and the difference between the learning model weight and the prior weight is calculated through a regularization term, which is used as a regularization loss. The learning model is optimized and iterated according to the original loss and the regularization loss; virtual data is used to test the optimized learning model to detect whether the learning model overfits the real data and evaluate the privacy leakage risk of the model. The present invention uses prior knowledge from the co-occurrence matrix to improve the data restoration effect of the gradient attack, greatly enhances the restoration effect of discrete data, and improves the accuracy of data recovery and prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data privacy protection technology, and in particular to a private domain data privacy leakage risk assessment method based on knowledge graph. Background Art

[0002] In the existing technology, the accuracy of data recovery and prediction has always been an important challenge in machine learning. Especially when dealing with discrete data, due to the sparsity and discontinuity of the data, traditional data recovery and prediction methods often fail to achieve ideal results. To improve this problem, researchers have tried various techniques, including using gradient attacks to restore data, such as gradient attacks in centralized training and gradient attacks in decentralized training.

[0003] 1. Gradient attacks in centralized training:

[0004] Centralized training usually refers to training that updates models and aggregates parameters through a central server. Attackers will directly try to access the central server and steal the gradient data uploaded during the training process. This method directly targets the data transmission or storage link and attempts to obtain the original gradient information. If the attacker cannot directly access the gradient data, they will also choose to infer information about the training data by analyzing the results of the model update, that is, the gradient applied to the model parameters.

[0005] This attack may be diluted by the gradients of other normal nodes, and a larger attack force is required to cause a significant impact. Some anomaly detection technologies can detect abnormal gradient values ​​to weaken the effect of the attack. The attacker needs to be able to access or influence the central server, which requires a higher level of attack skills or advanced internal access rights. However, in reality, centralized servers usually deploy strict security measures, such as encrypted communications, access control, and monitoring systems, which greatly increase the difficulty of the attack.

[0006] 2. Gradient attacks in distributed training:

[0007] In distributed training, the communication between nodes may not go through the central server. In this case, the attack will pollute the model. Malicious nodes interfere with and affect the training process of the entire model by sending malicious gradients or parameters to normal nodes. Such attacks can significantly hinder the convergence of the model and endanger the integrity of the model. The decentralized structure makes attacks more difficult to detect, but it also requires the attacker to have the ability to control the communication process or be able to control multiple nodes to produce a significant impact. In addition, the decentralized system may use encryption and verification mechanisms to protect gradient information, which increases the difficulty of attacks.

[0008] Therefore, the existing gradient attack methods in centralized training and decentralized training have certain problems, such as low restoration effect, high risk of single point failure, insufficient utilization of global information, and high communication and computing overhead. In order to solve these problems, it is necessary to develop new technologies or methods to better utilize gradient attacks for data recovery and prediction, especially when dealing with large-scale discrete data sets. Summary of the invention

[0009] The purpose of the invention is to solve the problems of how to improve data restoration effect, reduce the impact of single point failures on the training process and insufficient utilization of global information when gradient attacks are used in the prior art to process large-scale discrete data sets.

[0010] Technical solution, according to one aspect of the present application, a private domain data privacy leakage risk assessment method based on knowledge graph includes the following steps:

[0011] S1. Convert the real data into vector representation, input it into the machine learning model for prediction, and calculate the original loss based on the real label and the prediction result;

[0012] S2. Introduce graph priors, calculate the difference between the learning model weights and the prior weights through the regularization term, and use it as the regularization loss. Based on the original loss and the regularization loss, optimize and iterate the learning model.

[0013] S3. Use virtual data to test the optimized learning model to detect whether the learning model overfits the real data and evaluate the privacy leakage risk of the model.

[0014] According to one aspect of the present application, step S1 further comprises:

[0015] S11, converting real data into vector representation;

[0016] S12. Input the transformed data into the machine learning model;

[0017] S13. The learning model predicts the data and calculates the original loss based on the true label and the predicted result.

[0018] According to one aspect of the present application, step S1 further includes:

[0019] S1a, at each time step t, each node i samples a batch of data (x t,i ,y t,i ), input the sampled data into the learning model and calculate the local gradient:

[0020] ▽W t,i =(βl(M(x t,i |W t ),yt,i )) / βW t ;

[0021] Where W is the weight of the model; β is the partial derivative;

[0022] S1b, send the local gradients of all nodes to the central server, and aggregate the local gradients by the average value ▽W t,i , use the obtained average gradient to update the model weight W:

[0023] μW , t=(1 / N) ∑ i N ▽W t,i ;

[0024] W t+1 =W t -η μW , t ;

[0025] In the formula, μW , t is the average gradient;

[0026] S1c, initialize the virtual data and the real label to make them the same size as the original data, input the virtual data into the learning model to calculate the virtual gradient, and adjust the virtual data so that the virtual gradient is close to the real gradient:

[0027] ▽W' t,i =(βl(M(x ’ |W t ),y ’ )) / βW t ;

[0028] In the formula, x' is virtual data; y' is the real label;

[0029] S1d. Establish a differentiable optimization target and optimize the virtual data through the gradient descent algorithm:

[0030] Loss dlg =║▽W' t,i -▽W t,i ║ 2 .

[0031] According to one aspect of the present application, step S2 further comprises:

[0032] S21, converting the real data into a discrete index list, and converting the discrete index list into a multi-hot vector representation;

[0033] S22, construct a co-occurrence matrix to record the co-occurrence relationship between data, and use the co-occurrence matrix as a data correlation graph to guide the optimization process;

[0034] S23. During the model training process, the co-occurrence matrix is ​​used as prior knowledge, and the prior knowledge is incorporated into a regularization term to force the co-occurrence relationship between the virtual data and the real data to be consistent;

[0035] S24. Initialize and optimize virtual data by executing the gradient attack algorithm and calculate the graph regularization loss Loss reg , so that the co-occurrence patterns of the virtual data are consistent with the graph statistics of the real data:

[0036] Loss reg =∑ B i=1 ∑ B j=1 x’ mh ×G D ×x’ T mh ;

[0037] In the formula, G D It is a graph relationship; x’ mh It is virtual diagnostic data;

[0038] S25. Define and adjust the loss function to balance the impact of the original loss and the graph regularization loss:

[0039] Loss= Loss dlg -a·Loss reg =║▽W' t,i -▽W t,i ║ 2 -α·∑ B i=1 ∑ B j=1 x’ mh ×G D ×x’ T mh ;

[0040] Where α is the regularization coefficient.

[0041] According to one aspect of the present application, step S3 further comprises:

[0042] S31. Create virtual data with similar structure and distribution to real data;

[0043] S32, testing the learning model using virtual data and generating prediction results;

[0044] S33. Analyze the prediction results to determine whether the learning model can accurately predict the virtual data; if the learning model can accurately predict the virtual data, it indicates that the model overfits the real data and there is a risk of privacy leakage;

[0045] S34. According to the test results, adjust the parameters of the learning model to reduce the risk of privacy leakage;

[0046] S35. Repeat steps S31-S34 until the prediction ability of the learning model for virtual data reaches a set threshold.

[0047] According to one aspect of the present application, step S31 is further:

[0048] S31a, analyzing the structure and distribution characteristics of real data; the structure and distribution characteristics include the type of data, the relationship between features and the distribution law of data;

[0049] S31b. Based on the analysis results, generate virtual data similar to the real data structure and distribution by randomly generating data or using the generative adversarial network (GAN) method;

[0050] S31c, preprocessing the generated virtual data to make it consistent with the real data in terms of format and dimension; the preprocessing includes data cleaning, missing value filling and outlier detection;

[0051] S31d, perform quality assessment on the virtual data to determine whether it meets the test requirements; if not, return to step S31a to re-analyze and generate virtual data until it meets the test requirements.

[0052] According to one aspect of the present application, step S33 is further:

[0053] S33a, calculating the difference between the prediction results of the learning model for the virtual data and the true label, and evaluating it through the precision, recall or F1 score indicators;

[0054] S33b, judging whether the learning model overfits the real data according to the evaluation result, if the learning model can accurately predict the virtual data, it indicates that the model overfits the real data;

[0055] S33c. Adjust the learning model parameters to reduce the risk of privacy leakage.

[0056] According to one aspect of the present application, step S34 is further:

[0057] S34a. Analyze the type and range of parameters that need to be adjusted based on the assessment results of privacy leakage risks;

[0058] S34b, using an optimization algorithm to adjust the learning model parameters; the optimization algorithm includes a gradient descent method and a random search method;

[0059] S34c, verify whether the adjusted parameters can reduce the risk of privacy leakage. If the effect is not good, repeat step S34a and re-analyze until the preset effect is achieved.

[0060] Beneficial Effects

[0061] The present invention optimizes the gradient attack process through the prior knowledge of the self-co-occurrence matrix, significantly improves the restoration effect of discrete data, and greatly improves the accuracy of data recovery and prediction. By integrating graph structure information with the training of deep learning models, the present invention solves the bottleneck encountered by traditional gradient attacks when processing large-scale discrete data, which not only improves the efficiency of the algorithm, but also significantly enhances the global information capture ability and robustness of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Figure 1 It is a flow chart of the present invention.

[0063] Figure 2 This is a flow chart of step S1 of the present invention.

[0064] Figure 3 This is a flow chart of step S2 of the present invention.

[0065] Figure 4 This is a flow chart of step S3 of the present invention.

[0066] Figure 5 It is a schematic diagram of the framework of an embodiment of the present invention.

[0067] Figure 6 Schematic diagram of pseudo code of the GraphDLG attack algorithm of the present invention. DETAILED DESCRIPTION

[0068] like Figure 1 As shown, a private domain data privacy leakage risk assessment method based on knowledge graph includes the following steps:

[0069] S1. Convert the real data into vector representation, input it into the machine learning model for prediction, and calculate the original loss based on the real label and the prediction result;

[0070] S2. Introduce graph priors, calculate the difference between the learning model weights and the prior weights through the regularization term, and use it as the regularization loss. Based on the original loss and the regularization loss, optimize and iterate the learning model.

[0071] S3. Use virtual data to test the optimized learning model to detect whether the learning model overfits the real data and evaluate the privacy leakage risk of the model.

[0072] This embodiment is mainly divided into three steps:

[0073] Data and model training:

[0074] Real data, such as disease diagnoses such as alcohol dependence, anorexia, and acute respiratory failure, are converted into vector representations and fed into a machine learning model. The model makes predictions on the data and calculates a loss based on the true labels.

[0075] Graph Priors and Regularization:

[0076] The learning model uses a graph prior to enhance model training. This means that the model not only learns based on the data itself, but also uses the relationship between the data, such as the correlation between different diseases. The graph prior is introduced into the learning model through the regularization term, which calculates the difference between the model weight W and the prior weight W'. The final loss function is the original loss plus the regularization loss.

[0077] Privacy Leakage and Virtual Data:

[0078] If the learning model is overtrained, it may "remember" specific details of the training data, which may leak patients' private information. To test this risk, dummy data was used for model testing, and the learning model tried to make predictions on this data. If the model can accurately predict the dummy data, this may indicate that the model is overfitting the real data and there is a risk of privacy leakage.

[0079] In this embodiment, the prediction of patient health status using electronic medical record data is taken as an example:

[0080] Suppose there is a set of electronic medical record data, which includes patients' personal information such as name, age, gender, medical history records, and medical diagnosis results. Our goal is to train a machine learning model to predict the patient's future health status based on his or her historical records.

[0081] First, these medical records need to be converted into vector representations. For example, name and gender can be encoded into numeric values ​​or one-hot encoded vectors, while medical history records and diagnosis results can be converted into word embeddings or encoded as sequence data.

[0082] Next, these vectorized data are fed into the learning model and trained to predict the patient’s health status. During the training process, the original loss is calculated using cross entropy loss or mean squared error loss based on the predictions of the learning model and the true label, i.e. the patient’s actual health status.

[0083] In this example, a knowledge graph is used to represent the relationships between patients and the mutual impact of their health conditions. The knowledge graph can capture information such as shared medical history, family genetic history, or social network between patients.

[0084] In order to introduce graph priors, a regularization term is defined to calculate the difference between the weights of the learning model and the prior weights learned from the knowledge graph.

[0085] By using this regularization term as the regularization loss and combining it with the original loss, the learning model is optimized so that during the training process, not only the accuracy of the medical record data is considered, but also the prior knowledge of the graph structure in the knowledge graph is incorporated.

[0086] After the learning model is optimized and iterated, the generated virtual data is used to test the learning model. These virtual data should be similar to the real data in distribution but do not contain real personal information.

[0087] By comparing the performance difference of the learning model on real data and virtual data, it is possible to detect whether the learning model has overfitted the real data. If the performance of the learning model on virtual data is significantly reduced, there may be a risk of overfitting. The privacy leakage risk of the model can also be evaluated, such as by calculating the degree of leakage of personal information in the virtual data by the model.

[0088] This example uses real data for vector representation, introduces graph priors for model optimization, and uses virtual data for learning model testing and privacy leakage risk assessment. This embodiment better utilizes data to train a more robust and secure machine learning model.

[0089] The application fields of the present invention also include:

[0090] Social network analysis: In social networks, the relationships between users can form a graph structure. This graph structure prior knowledge is used to improve the results of tasks such as user behavior prediction, information dissemination analysis, and community discovery.

[0091] Recommendation system: In the recommendation system, the relationship between items and users can form a graph structure, such as a user-item interaction graph. The performance of the recommendation model can be optimized by introducing graph priors, thereby improving the accuracy of recommendations and user satisfaction.

[0092] Natural language processing: In natural language processing, the relationship between sentences and words can form a graph structure, such as a syntactic dependency tree or a semantic relationship graph. It can be used to improve the performance of tasks such as word embedding, sentence representation learning, and text classification.

[0093] Traffic network analysis: In a traffic network, the relationship between roads and intersections can form a graph structure. It can be used for tasks such as traffic flow prediction, route planning, and traffic congestion analysis to improve the efficiency and reliability of the transportation system.

[0094] Financial field: In the financial field, the relationship between financial products such as stocks and funds can form a graph structure. It can be used for tasks such as financial market forecasting, risk assessment, and portfolio optimization to help investors make more informed decisions.

[0095] Computer vision: In computer vision, the relationship between pixels, objects, and scenes in an image can form a graph structure. It can be used for tasks such as image classification, object detection, and semantic segmentation to improve the accuracy and robustness of visual tasks.

[0096] Bioinformatics: In bioinformatics, the relationships between genes, proteins, and metabolites can form complex graph structures. They can be used for tasks such as gene expression analysis, protein interaction prediction, and metabolic pathway analysis, promoting the progress of biomedical research.

[0097] like Figure 2 As shown, according to one aspect of the present application, the step S1 is further:

[0098] S11, converting real data into vector representation;

[0099] S12. Input the transformed data into the machine learning model;

[0100] S13. The learning model predicts the data and calculates the original loss based on the true label and the predicted result.

[0101] According to one aspect of the present application, step S1 further includes:

[0102] S1a, at each time step t, each node i samples a batch of data (x t,i ,y t,i ), input the sampled data into the learning model and calculate the local gradient:

[0103] ▽W t,i =(βl(M(x t,i |W t ),y t,i )) / βW t ;

[0104] Where W is the weight of the model; β is the partial derivative;

[0105] S1b, send the local gradients of all nodes to the central server, and aggregate the local gradients by the average value ▽W t,i , use the obtained average gradient to update the model weight W:

[0106] μW , t=(1 / N) ∑ i N ▽W t,i ;

[0107] W t+1 =W t -η μW , t ;

[0108] In the formula, μW , t is the average gradient;

[0109] S1c, initialize the virtual data and the real label to make them the same size as the original data, input the virtual data into the learning model to calculate the virtual gradient, and adjust the virtual data so that the virtual gradient is close to the real gradient:

[0110] ▽W' t,i =(βl(M(x ’ |W t ),y ’ )) / βW t ;

[0111] In the formula, x' is virtual data; y' is the real label;

[0112] S1d. Establish a differentiable optimization target and optimize the virtual data through the gradient descent algorithm:

[0113] Loss dlg =║▽W' t,i -▽W t,i ║ 2 .

[0114] In this embodiment, the standard workflow of multi-node distributed training is followed: at each time step t, each node i samples a batch of data (x t,i ,y t,i ), feed it into the learning model and compute the local gradient:

[0115] ▽W t,i =(βl(M(x t,i |W t ),y t,i )) / βWt ;

[0116] Where W is the weight of the model, the local gradients are sent to the central server where they are aggregated by averaging, and the resulting average gradient is then used to update the weights for the next time step.

[0117] μW , t=(1 / N) ∑ i N ▽W t,i ;

[0118] W t+1 =W t -η μW , t ;

[0119] In the formula, μW , t is the average gradient;

[0120] Local gradients are shared between nodes, and once malicious attackers obtain these local gradients, they can easily restore the original data. Specifically, virtual data and labels are initialized to the same size as the original data and then input into the model to calculate virtual gradients:

[0121] ▽W' t,i =(βl(M(x'|W t ),y')) / βW t ;

[0122] Once the virtual gradient is close to the real gradient, it means that the virtual data is also closely similar to the real data. In order to optimize the virtual data, this method establishes the following optimization objectives:

[0123] Loss dlg =║▽W' t,i -▽W t,i ║ 2 .

[0124] In the scenario of this method, the optimization objective is differentiable, which enables this method to use traditional gradient descent algorithms commonly used in machine learning, such as L-BFGS and Adam optimization methods.

[0125] like Figure 3 As shown, according to one aspect of the present application, the step S2 is further:

[0126] S21, converting the real data into a discrete index list, and converting the discrete index list into a multi-hot vector representation;

[0127] S22, construct a co-occurrence matrix to record the co-occurrence relationship between data, and use the co-occurrence matrix as a data correlation graph to guide the optimization process;

[0128] S23. During the model training process, the co-occurrence matrix is ​​used as prior knowledge, and the prior knowledge is incorporated into a regularization term to force the co-occurrence relationship between the virtual data and the real data to be consistent;

[0129] S24. Initialize and optimize virtual data by executing the gradient attack algorithm and calculate the graph regularization loss Loss reg , so that the co-occurrence patterns of the virtual data are consistent with the graph statistics of the real data:

[0130] Loss reg =∑ B i=1 ∑ B j=1 x’ mh ×G D ×x’ T mh ;

[0131] In the formula, G D It is a graph relationship; x’ mh It is virtual diagnostic data;

[0132] S25. Define and adjust the loss function to balance the impact of the original loss and the graph regularization loss:

[0133] Loss= Loss dlg -a·Loss reg =║▽W' t,i -▽W t,i ║ 2 -α·∑ B i=1 ∑ B j=1 x’ mh ×G D ×x’ T mh ;

[0134] Where α is the regularization coefficient.

[0135] In this embodiment, in order to reduce the optimization uncertainty associated with large batches, a co-occurrence matrix is ​​introduced as a data correlation graph as a priori to guide the optimization process. By incorporating the prior knowledge into a regularization term, the constraint that the co-occurrence relationship observed in the virtual data is consistent with that in the real data is enforced. This constraint enables the method to improve the accuracy of data restoration.

[0136] The overall framework of the gradient attack algorithm designed by this method is as follows Figure 5 As shown in the figure, the upper part illustrates the standard forward training process. The lower part shows the gradient attack process. The dashed box is the prior graph reward (Loss reg ) is calculated. The size of the reward is determined by the similarity between the co-occurrence statistics of the elements in the virtual data and the expected patterns in the co-occurrence matrix. The higher the similarity, the larger the reward value, as shown in the following example: Figure 6 Pseudocode of the GraphDLG attack algorithm shown.

[0137] Taking the diagnosis record as an example, EHR x=[ x1,x2,x i …] is a list of discrete indices mapped from the original text descriptions via the diagnostic vocabulary D. i ∈N and x i ∈[0,|D|], where |D| is the size of the diagnostic vocabulary. This method requires converting x into a multi-hot vector representation x mh ∈N B×|D| , where B is the batch size. Specifically, x mh [i,j] = 1 means that the jth diagnosis is in the i-th batch of the original diagnosis data x, otherwise x mh [i,j]=0. In addition, this method randomly initializes the vector space of size x in the multi-hot vector space. mh Virtual diagnostic data x' mh .

[0138] Assume G D ∈N |D|×|D| is a graph generated for diagnosis, which records the co-occurrence relationships between all diagnoses in the vocabulary. D [i,j] represents the co-occurrence frequency of the i-th and j-th diagnoses. Therefore, the graph regularization loss Loss reg The following definition can be expressed:

[0139] Loss reg =∑ B i=1 ∑ B j=1 x’ mh ×GD ×x’ T mh ;

[0140] In layman's terms, if the co-occurrence pattern of different diagnoses in the virtual data is closely consistent with the statistical results obtained from the graph, then this means that the current virtual data is more reasonable and deserves a higher loss. reg In other words, the closer the co-occurrence pattern is to the graph statistics, the more reasonable the virtual data is. Ultimately, the complete loss of the learning model can be expressed as follows:

[0141] Loss= Loss dlg -a·Loss reg =║▽W' t,i -▽W t,i ║ 2 -α·∑ B i=1 ∑ B j=1 x’ mh ×G D ×x’ T mh ;

[0142] Among them, α is the regularization coefficient. Similarly, when facing different private feature entities, the graph relationship G D In this work, MIMIC-Ⅲ also applies the process diagram G P and drug graph G M , while in eICU it involves graph G constructed by medical coding C .

[0143] When processing large batches of training data, the introduction of regularization terms containing graph priors reduces the difficulty of optimization and significantly improves the restoration accuracy of gradient attacks. By adding regularization, the optimization process is guided towards more reliable and meaningful co-occurrence relationships, resulting in more accurate restoration results.

[0144] like Figure 4 As shown, according to one aspect of the present application, step S3 is further:

[0145] S31. Create virtual data with similar structure and distribution to real data;

[0146] S32, testing the learning model using virtual data and generating prediction results;

[0147] S33. Analyze the prediction results to determine whether the learning model can accurately predict the virtual data; if the learning model can accurately predict the virtual data, it indicates that the model overfits the real data and there is a risk of privacy leakage;

[0148] S34. According to the test results, adjust the parameters of the learning model to reduce the risk of privacy leakage;

[0149] S35. Repeat steps S31-S34 until the prediction ability of the learning model for virtual data reaches a set threshold.

[0150] According to one aspect of the present application, step S31 is further:

[0151] S31a, analyzing the structure and distribution characteristics of real data; the structure and distribution characteristics include the type of data, the relationship between features and the distribution law of data;

[0152] S31b. Based on the analysis results, generate virtual data similar to the real data structure and distribution by randomly generating data or using the generative adversarial network (GAN) method;

[0153] S31c, preprocessing the generated virtual data to make it consistent with the real data in terms of format and dimension; the preprocessing includes data cleaning, missing value filling and outlier detection;

[0154] S31d, perform quality assessment on the virtual data to determine whether it meets the test requirements; if not, return to step S31a to re-analyze and generate virtual data until it meets the test requirements.

[0155] According to one aspect of the present application, step S33 is further:

[0156] S33a, calculating the difference between the prediction results of the learning model for the virtual data and the true label, and evaluating it through the precision, recall or F1 score indicators;

[0157] S33b, judging whether the learning model overfits the real data according to the evaluation result, if the learning model can accurately predict the virtual data, it indicates that the model overfits the real data;

[0158] S33c. Adjust the learning model parameters to reduce the risk of privacy leakage.

[0159] According to one aspect of the present application, step S34 is further:

[0160] S34a. Analyze the type and range of parameters that need to be adjusted based on the assessment results of privacy leakage risks;

[0161] S34b, using an optimization algorithm to adjust the learning model parameters; the optimization algorithm includes a gradient descent method and a random search method;

[0162] S34c, verify whether the adjusted parameters can reduce the risk of privacy leakage. If the effect is not good, repeat step S34a and re-analyze until the preset effect is achieved.

[0163] In the case of large batches of data, prior knowledge from the co-occurrence matrix is ​​used to improve the data reduction effect of gradient attacks. GraphDLG achieves good results when using 5% of the dataset and is easy to implement in the setting of distributed training, which greatly enhances the reduction effect of discrete data. This method extensively evaluates the algorithm of this method using publicly available electronic health record datasets and attacks mainstream models. Empirical results verify that GraphDLG performs better than previous research results, especially when large batches of data are involved.

[0164] The present invention is groundbreaking in applying data-related graphs to the gradient attack algorithm, thereby achieving significant improvements in the accuracy of data restoration, especially in large-scale scenarios. A large number of experiments were conducted on the eICU and MIMIC public datasets using MLP and Transformer models, which aim to thoroughly verify the effectiveness of the algorithm.

[0165] Finally, the finding that building the graph requires only a minimal amount of local data but can still achieve significant performance improvements greatly enhances the practical application value of the gradient attack algorithm.

[0166] The preferred embodiments of the present invention are described in detail above; however, the present invention is not limited to the specific details in the above embodiments. Within the technical concept of the present invention, various equivalent transformations can be made to the technical solutions of the present invention, and these equivalent transformations all belong to the protection scope of the present invention.

Claims

1. A private domain data privacy leakage risk assessment method based on knowledge graph, characterized in that: The method comprises the following steps: S1. Convert the real data into vector representation, input it into the machine learning model for prediction, and calculate the original loss based on the real label and the prediction result; S2. Introduce graph priors, calculate the difference between the learning model weights and the prior weights through the regularization term, and use it as the regularization loss. Based on the original loss and the regularization loss, optimize and iterate the learning model. S3. Use virtual data to test the optimized learning model to detect whether the learning model overfits the real data and evaluate the privacy leakage risk of the model; The step S2 is further as follows: S21, converting the real data into a discrete index list, and converting the discrete index list into a multi-hot vector representation; S22, construct a co-occurrence matrix to record the co-occurrence relationship between data, and use the co-occurrence matrix as a data correlation graph to guide the optimization process; S23, during the model training process, using the co-occurrence matrix as prior knowledge, merging the prior knowledge into a regularization term, and forcing the co-occurrence relationship between the second virtual data and the real data to be consistent; S24. Initialize and optimize the second virtual data by executing the gradient attack algorithm and calculate the graph regularization loss Loss reg , so that the co-occurrence pattern of the second virtual data is consistent with the graph statistics of the real data: Loss reg =∑ B i=1 ∑ B j=1 x’ mh ×G D ×x’ T mh ; In the formula, G D It is a graph relationship; x’ mh It is virtual diagnostic data; S25. Define and adjust the loss function to balance the impact of the original loss and the graph regularization loss: Loss= Loss dlg -α·Loss reg =║▽W’ t,i -▽W t,i ║ 2 -α·∑ B i=1 ∑ B j=1 x’ mh ×G D ×x’ T mh ; Where α is the regularization coefficient; The step S3 is further as follows: S31, creating third virtual data similar to the real data structure and distribution; S32, using the third virtual data to test the learning model and generate a prediction result; S33, analyzing the prediction results to determine whether the learning model can accurately predict the third virtual data; if the learning model can accurately predict the third virtual data, it indicates that the model overfits the real data and there is a risk of privacy leakage; S34. According to the test results, adjust the parameters of the learning model to reduce the risk of privacy leakage; S35. Repeat steps S31-S34 until the prediction ability of the learning model for the third virtual data reaches a set threshold.

2. The private domain data privacy leakage risk assessment method based on knowledge graph according to claim 1 is characterized in that: The step S1 is further as follows: S11, converting real data into vector representation; S12. Input the transformed data into the machine learning model; S13. The learning model predicts the data and calculates the original loss based on the true label and the predicted result.

3. The private domain data privacy leakage risk assessment method based on knowledge graph according to claim 2 is characterized in that: The step S1 further comprises: S1a, at each time step t, each node i samples a batch of data (x t,i ,y t,i ), input the sampled data into the learning model and calculate the local gradient: ▽W t,i =(βl(M(x t,i |W t ),y t,i )) / βW t ; Where W is the weight of the model; β is the partial derivative; S1b, send the local gradients of all nodes to the central server, and aggregate the local gradients by the average value ▽W t,i , use the obtained average gradient to update the model weight W: μW , t=(1 / N)∑ i N ▽W t,i ; W t+1 =W t -or μW , t ; In the formula, μW , t is the average gradient; S1c, initialize the first virtual data and the real label to make them the same size as the original data, input the first virtual data into the learning model to calculate the virtual gradient, and adjust the first virtual data to make the virtual gradient close to the real gradient: ▽W’ t,i =(βl(M(x’|W t ),y’)) / βW t ; Wherein, x' is the first virtual data; y' is the virtual label; S1d. Establish a differentiable optimization target and optimize the first virtual data by gradient descent algorithm: Loss dlg =║▽W’ t,i -▽W t,i ║ 2 。 4. The private domain data privacy leakage risk assessment method based on knowledge graph according to claim 3 is characterized in that: The step S31 is further as follows: S31a, analyzing the structure and distribution characteristics of real data; the structure and distribution characteristics include the type of data, the relationship between features and the distribution law of data; S31b, based on the analysis results, generating third virtual data similar to the real data structure and distribution by randomly generating data or using a generative adversarial network (GAN) method; S31c, preprocessing the generated third virtual data to make it consistent with the real data in terms of format and dimension; the preprocessing includes data cleaning, missing value filling and outlier detection; S31d, perform quality assessment on the third virtual data to determine whether it meets the test requirements; if not, return to step S31a to re-analyze and generate the third virtual data until it meets the test requirements.

5. The private domain data privacy leakage risk assessment method based on knowledge graph according to claim 3 is characterized in that: The step S33 is further as follows: S33a, calculating the difference between the prediction result of the learning model for the third virtual data and the true label, and evaluating it through the accuracy, recall or F1 score indicator; S33b, judging whether the learning model overfits the real data according to the evaluation result, if the learning model can accurately predict the third virtual data, it indicates that the model overfits the real data; S33c. Adjust the learning model parameters to reduce the risk of privacy leakage.

6. The private domain data privacy leakage risk assessment method based on knowledge graph according to claim 3 is characterized in that: The step S34 is further as follows: S34a. Analyze the type and range of parameters that need to be adjusted based on the assessment results of privacy leakage risks; S34b, using an optimization algorithm to adjust the learning model parameters; the optimization algorithm includes a gradient descent method and a random search method; S34c, verify whether the adjusted parameters can reduce the risk of privacy leakage. If the effect is not good, repeat step S34a and re-analyze until the preset effect is achieved.