holisticai.security.metrics.privacy_risk_score#
- holisticai.security.metrics.privacy_risk_score(shadow_train, shadow_test, target_train)[source]#
Calculate the risk score for membership inference attacks. The privacy risk score of an input sample for the target machine learning model is defined as the posterior probability that it is from the training set after observing the target model’s behavior over that sample. In other words, The privacy risk score estimates an individual sample’s probability of being in the target model’s training set.
A higher privacy risk score indicates a higher likelihood that the sample is in the target model’s training set, which implies a higher risk of membership inference attacks.
Parameters
- shadow_traintuple
A tuple containing the probabilities and labels for the shadow training set.
- shadow_testtuple
A tuple containing the probabilities and labels for the shadow test set.
- target_traintuple
A tuple containing the probabilities and labels for the target training set.
Returns
- np.ndarray
Array of computed privacy risk scores for the given data values.
References