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

Add Oracle Aligned Adversarial Training #2348

Merged
merged 3 commits into from
Dec 13, 2023

Conversation

Zaid-Hameed
Copy link
Collaborator

Description

Oracle aligned adversarial training (OAAT) is an important adversarial training approach because it provides better robustness against adversarial attacks with larger perturbation magnitudes. OAAT has been proposed in paper "Scaling Adversarial Training to Large Perturbation Bounds".

Paper Link: https://link.springer.com/chapter/10.1007/978-3-031-20065-6_18

Fixes # (issue)

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.

  • Oracle aligned adversarial training implementation produces results similar to original implementation
  • All functions in implemented code work as expected

Test Configuration:

  • OS: Red Hat Enterprise Linux 8.7 (Ootpa)
  • Python version: 3.9.12
  • ART version or commit number
  • TensorFlow / Keras / PyTorch / MXNet version: PyTorch 1.13.1+cu117

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
  • My changes have been tested using both CPU and GPU devices

Signed-off-by: Muhammad Zaid Hameed <Zaid.Hameed@ibm.com>
@codecov-commenter
Copy link

codecov-commenter commented Dec 8, 2023

Codecov Report

Merging #2348 (e472e5f) into dev_1.17.0 (ab389e7) will decrease coverage by 6.52%.
The diff coverage is 10.89%.

❗ 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    #2348      +/-   ##
==============================================
- Coverage       85.60%   79.08%   -6.52%     
==============================================
  Files             324      326       +2     
  Lines           29326    29849     +523     
  Branches         5407     5514     +107     
==============================================
- Hits            25104    23606    -1498     
- Misses           2840     4920    +2080     
+ Partials         1382     1323      -59     
Files Coverage Δ
art/defences/trainer/__init__.py 100.00% <100.00%> (ø)
art/defences/trainer/adversarial_trainer_oaat.py 62.50% <62.50%> (ø)
...fences/trainer/adversarial_trainer_oaat_pytorch.py 8.04% <8.04%> (ø)

... and 42 files with indirect coverage changes

Signed-off-by: Muhammad Zaid Hameed <Zaid.Hameed@ibm.com>
@beat-buesser beat-buesser self-requested a review December 11, 2023 15:34
@beat-buesser beat-buesser self-assigned this Dec 11, 2023
@beat-buesser beat-buesser added the enhancement New feature or request label Dec 11, 2023
@beat-buesser beat-buesser added this to the ART 1.17.0 milestone Dec 11, 2023
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 @Zaid-Hameed Thank you very much for your pull request! I have added a few review comments, please let me know what you think?

art/defences/trainer/adversarial_trainer_oaat_pytorch.py Outdated Show resolved Hide resolved
art/defences/trainer/adversarial_trainer_oaat_pytorch.py Outdated Show resolved Hide resolved
art/defences/trainer/adversarial_trainer_oaat_pytorch.py Outdated Show resolved Hide resolved
art/defences/trainer/adversarial_trainer_oaat_pytorch.py Outdated Show resolved Hide resolved
art/defences/trainer/adversarial_trainer_oaat_pytorch.py Outdated Show resolved Hide resolved
art/defences/trainer/adversarial_trainer_oaat_pytorch.py Outdated Show resolved Hide resolved
art/defences/trainer/adversarial_trainer_oaat_pytorch.py Outdated Show resolved Hide resolved
art/defences/trainer/adversarial_trainer_oaat_pytorch.py Outdated Show resolved Hide resolved
art/defences/trainer/adversarial_trainer_oaat_pytorch.py Outdated Show resolved Hide resolved
art/defences/trainer/adversarial_trainer_oaat.py Outdated Show resolved Hide resolved
Signed-off-by: Muhammad Zaid Hameed <Zaid.Hameed@ibm.com>
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 @Zaid-Hameed Thank you very much. It looks good to me.

@beat-buesser beat-buesser merged commit 1b3120b into Trusted-AI:dev_1.17.0 Dec 13, 2023
35 checks passed
@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