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

Added support for Composite Adversarial Attacks [JATIC-I2-IBM] #2287

Merged

Conversation

twweeb
Copy link
Contributor

@twweeb twweeb commented Sep 13, 2023

Description

This pull request adds the support of the Composite Adversarial Attack (CAA) proposed in [1]. It provides an example notebook for explaining how to launch CAA.

[1] Towards Compositional Adversarial Robustness: Generalizing Adversarial Training to Composite Semantic Perturbations (CVPR 2023). [Paper], [Demo], and [Official repo].

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.

  • Unit Test
  • Notebook Example

Test Configuration:

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

@beat-buesser beat-buesser self-assigned this Sep 14, 2023
@beat-buesser beat-buesser added the enhancement New feature or request label Sep 14, 2023
@beat-buesser beat-buesser added this to Pull request open in ART 1.16.0 via automation Sep 14, 2023
@beat-buesser beat-buesser added this to the ART 1.16.0 milestone Sep 14, 2023
@beat-buesser beat-buesser changed the base branch from main to dev_1.16.0 September 14, 2023 08:33
@codecov-commenter
Copy link

codecov-commenter commented Sep 14, 2023

Codecov Report

Merging #2287 (d8f2a10) into dev_1.17.0 (dec5ddf) will increase coverage by 7.09%.
The diff coverage is 92.53%.

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

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff               @@
##           dev_1.17.0    #2287      +/-   ##
==============================================
+ Coverage       76.66%   83.75%   +7.09%     
==============================================
  Files             326      327       +1     
  Lines           30509    30777     +268     
  Branches         5645     5697      +52     
==============================================
+ Hits            23390    25778    +2388     
+ Misses           5776     3547    -2229     
- Partials         1343     1452     +109     
Files Coverage Δ
art/attacks/evasion/__init__.py 98.24% <100.00%> (+0.03%) ⬆️
...rt/attacks/evasion/composite_adversarial_attack.py 92.50% <92.50%> (ø)

... and 33 files with indirect coverage changes

Copy link
Collaborator

@beat-buesser beat-buesser left a comment

Choose a reason for hiding this comment

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

Hi @twweeb Thank you very much for your pull request and contributing the Composite Adversarial Attack to ART! Your code looks good and I have added a few comments on the integration with ART. Please let me know what you think.

art/attacks/evasion/composite_adversarial_attack.py Outdated Show resolved Hide resolved
art/attacks/evasion/composite_adversarial_attack.py Outdated Show resolved Hide resolved
art/attacks/evasion/composite_adversarial_attack.py Outdated Show resolved Hide resolved
art/attacks/evasion/composite_adversarial_attack.py Outdated Show resolved Hide resolved
art/attacks/evasion/composite_adversarial_attack.py Outdated Show resolved Hide resolved
art/attacks/evasion/composite_adversarial_attack.py Outdated Show resolved Hide resolved
notebooks/composite-adversarial-attack.ipynb Show resolved Hide resolved
art/attacks/evasion/composite_adversarial_attack.py Outdated Show resolved Hide resolved
art/attacks/evasion/composite_adversarial_attack.py Outdated Show resolved Hide resolved
ART 1.16.0 automation moved this from Pull request open to Pull request review Sep 14, 2023
@beat-buesser beat-buesser changed the title Added support for Composite Adversarial Attacks Added support for Composite Adversarial Attacks [JATIC-I2-IBM] Sep 14, 2023
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.

@twweeb twweeb force-pushed the composite-adversarial-attack branch 2 times, most recently from cd803c3 to f339238 Compare September 14, 2023 20:23
twweeb and others added 3 commits September 15, 2023 04:25
Signed-off-by: Lei Hsiung <leihsiung.ray@gmail.com>
Co-authored-by: Beat Buesser <49047826+beat-buesser@users.noreply.github.com>
Signed-off-by: Lei Hsiung <leihsiung.ray@gmail.com>
Signed-off-by: Lei Hsiung <leihsiung.ray@gmail.com>
Signed-off-by: Lei Hsiung <leihsiung.ray@gmail.com>
…rsarial-robustness-toolbox into composite-adversarial-attack
Signed-off-by: Lei Hsiung <leihsiung.ray@gmail.com>
@beat-buesser beat-buesser modified the milestones: ART 1.16.0, ART 1.17.0 Sep 22, 2023
@beat-buesser beat-buesser removed this from Pull request review in ART 1.16.0 Sep 22, 2023
@beat-buesser beat-buesser changed the base branch from dev_1.16.0 to dev_1.17.0 October 10, 2023 08:40
Signed-off-by: Lei Hsiung <leihsiung.ray@gmail.com>
@twweeb twweeb force-pushed the composite-adversarial-attack branch from f8dcaa4 to 3528185 Compare October 14, 2023 05:16
Signed-off-by: Lei Hsiung <leihsiung.ray@gmail.com>
@twweeb twweeb force-pushed the composite-adversarial-attack branch from cf31929 to 03aaeb7 Compare October 16, 2023 16:41
Copy link
Collaborator

@beat-buesser beat-buesser left a comment

Choose a reason for hiding this comment

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

Hi @twweeb Thank you very much for the updates. I have added my final review and found only a few minor required changes.

tests/attacks/test_composite_adversarial_attack.py Outdated Show resolved Hide resolved
tests/attacks/test_composite_adversarial_attack.py Outdated Show resolved Hide resolved
tests/attacks/test_composite_adversarial_attack.py Outdated Show resolved Hide resolved
art/attacks/evasion/composite_adversarial_attack.py Outdated Show resolved Hide resolved
art/attacks/evasion/composite_adversarial_attack.py Outdated Show resolved Hide resolved
art/attacks/evasion/composite_adversarial_attack.py Outdated Show resolved Hide resolved
art/attacks/evasion/composite_adversarial_attack.py Outdated Show resolved Hide resolved
art/attacks/evasion/composite_adversarial_attack.py Outdated Show resolved Hide resolved
art/attacks/evasion/composite_adversarial_attack.py Outdated Show resolved Hide resolved
art/attacks/evasion/composite_adversarial_attack.py Outdated Show resolved Hide resolved
Signed-off-by: Lei Hsiung <leihsiung.ray@gmail.com>
@twweeb
Copy link
Contributor Author

twweeb commented Oct 28, 2023

All comments are addressed.

@beat-buesser beat-buesser merged commit d8f2a10 into Trusted-AI:dev_1.17.0 Dec 18, 2023
33 of 35 checks passed
@beat-buesser
Copy link
Collaborator

Hi @twweeb Thank you very much for your first contribution to ART!

@beat-buesser beat-buesser added this to Pull request done in ART 1.17.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
No open projects
ART 1.17.0
Pull request done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants