Skip to content
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

Feat: Add three new Membership Inference attacks #2271

Open
wants to merge 5 commits into
base: dev_1.17.0
Choose a base branch
from

Conversation

iamsh4shank
Copy link

Description

Added three new types of membership inference attacks, these are as follows -

  • SIF Attack
  • Blind Membership inference Attack
  • White Box based Membership Inference Attacks

Type of change

Please check all relevant options.

  • Improvement (non-breaking)
  • Bug fix (non-breaking)
  • New feature (non-breaking)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Testing

Please describe the tests that you ran to verify your changes. Consider listing any relevant details of your test configuration.

  • I ran test files to test the changes

Test Configuration:

  • Ubuntu 20
  • 3.9
  • 1.15
  • TensorFlow / Keras / PyTorch / MXNet version - all in the newest version

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@iamsh4shank
Copy link
Author

iamsh4shank commented Sep 5, 2023

@beat-buesser could you review my pull request and let me know if I have to make changes? I am new to the community and would like to add some more Confidentiality attacks.

@beat-buesser
Copy link
Collaborator

Hi @iamsh4shank Thank you very much for your interest in ART and working on contributing new inference attacks! We will review this PR as soon as possible.

@beat-buesser beat-buesser added the enhancement New feature or request label Sep 6, 2023
@codecov-commenter
Copy link

codecov-commenter commented Sep 6, 2023

Codecov Report

Merging #2271 (f710043) into dev_1.17.0 (c5c6012) will decrease coverage by 7.16%.
Report is 328 commits behind head on dev_1.17.0.
The diff coverage is 14.84%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Impacted file tree graph

@@              Coverage Diff               @@
##           dev_1.17.0    #2271      +/-   ##
==============================================
- Coverage       85.62%   78.47%   -7.16%     
==============================================
  Files             308      314       +6     
  Lines           27448    28399     +951     
  Branches         5044     5235     +191     
==============================================
- Hits            23502    22285    -1217     
- Misses           2667     4867    +2200     
+ Partials         1279     1247      -32     
Files Coverage Δ
...attacks/inference/membership_inference/__init__.py 100.00% <100.00%> (ø)
art/estimators/classification/pytorch.py 86.03% <66.66%> (-0.27%) ⬇️
...rt/attacks/inference/membership_inference/utils.py 23.07% <23.07%> (ø)
...s/inference/membership_inference/blindMI_attack.py 29.62% <29.62%> (ø)
...ership_inference/self_influence_function_attack.py 14.38% <14.38%> (ø)
...ttacks/inference/membership_inference/utils_sif.py 18.30% <18.30%> (ø)
...erence/membership_inference/influence_functions.py 12.40% <12.40%> (ø)
...ttacks/inference/membership_inference/white_box.py 8.26% <8.26%> (ø)

... and 25 files with indirect coverage changes

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeQL found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.

@beat-buesser
Copy link
Collaborator

Hi @iamsh4shank It looks like something failed in the new unit tests like unexpected arguments, etc. Could you please take a look?

@iamsh4shank
Copy link
Author

Hi @iamsh4shank It looks like something failed in the new unit tests like unexpected arguments, etc. Could you please take a look?

Yep sure will check and update the pull request soon

Signed-off-by: iamsh4shank <[email protected]>
@iamsh4shank
Copy link
Author

@beat-buesser could you please once run the CI/CD?

Signed-off-by: iamsh4shank <[email protected]>
@iamsh4shank
Copy link
Author

@beat-buesser I modified the commit, now it should fix almost all of the checks. I have a question here in this https://github.com/Trusted-AI/adversarial-robustness-toolbox/actions/runs/6130115176/job/16713558817?pr=2271, as here there is no installation for the cv2 that causes a few failures. So should I add cv2 in these files?

@iamsh4shank
Copy link
Author

Hi is there any update on this?

@beat-buesser beat-buesser changed the base branch from main to dev_1.17.0 September 27, 2023 08:48
json_path = json_path.parents[0] / f"{str(json_path.stem)}_{time}" f"{str(json_path.suffix)}"

if overwrite_if_exists:
append_if_exists = False

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable append_if_exists is not used.

"""

from art.utils import check_and_transform_label_format

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'check_and_transform_label_format' is not used.
import torch
from torch.utils.data import TensorDataset, DataLoader
from torchvision import transforms
import time

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'time' is not used.
import time
import datetime
import numpy as np
import copy

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'copy' is not used.
@beat-buesser
Copy link
Collaborator

Hi @iamsh4shank Sorry for the delay. We think the attacks are a great addition to ART's current inference attacks. We'll add a more detailed technical review soon. A few items I have noticed from a high-level review: could you please start adding unit tests for each attack and function in tests/ following the pytest pattern, update/add all docstrings following ART's format and add typing to all functions and methods?

@iamsh4shank
Copy link
Author

Hi @iamsh4shank Sorry for the delay. We think the attacks are a great addition to ART's current inference attacks. We'll add a more detailed technical review soon. A few items I have noticed from a high-level review: could you please start adding unit tests for each attack and function in tests/ following the pytest pattern, update/add all docstrings following ART's format and add typing to all functions and methods?

Yep sure, I will start working on the tests

@beat-buesser beat-buesser added this to the ART 1.17.0 milestone Oct 10, 2023
@beat-buesser beat-buesser self-requested a review October 10, 2023 08:42
@beat-buesser beat-buesser modified the milestones: ART 1.17.0, ART 1.18.0 Dec 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
ART 1.18.0
Awaiting triage
Development

Successfully merging this pull request may close these issues.

None yet

3 participants