-
Notifications
You must be signed in to change notification settings - Fork 453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add threshold-entropy attack #131
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks Liwei! I left 2 comments
|
||
@property | ||
def is_trained_attack(self): | ||
"""Returns whether this type of attack requires training a model.""" | ||
return self != AttackType.THRESHOLD_ATTACK | ||
return (self != AttackType.THRESHOLD_ATTACK) & (self != AttackType.THRESHOLD_ENTROPY_ATTACK) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use words instead, i.e. self != AttackType.THRESHOLD_ATTACK and self != AttackType.THRESHOLD_ENTROPY_ATTACK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
@@ -96,6 +96,19 @@ def _run_threshold_attack(attack_input: AttackInputData): | |||
attack_type=AttackType.THRESHOLD_ATTACK, | |||
roc_curve=roc_curve) | |||
|
|||
def _run_threshold_entropy_attack(attack_input: AttackInputData): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add an end-to-end test for this to membership_inference_attack_test.py? Something like the "test_run_attack_threshold_calculates_correct_auc" test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test case is added!
I have fixed these issues, please take another look, thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Following our recent paper https://arxiv.org/pdf/2003.10595.pdf, I implement the code to run membership inference attacks by setting a threshold value on the prediction entropy value.
Compared to THRESHOLD_ATTACK, THRESHOLD_ENTROPY_ATTACK leverages the entropy value instead of the loss value.