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

BadDet Regional Misclassification Attack Implementation #2054

Merged
merged 11 commits into from
Mar 12, 2023

Conversation

f4str
Copy link
Collaborator

@f4str f4str commented Mar 6, 2023

Description

Implementation of the BadDet Regional Misclassification Attack. This creates a new poisoning object art.attacks.poisoning.BadDetRegionalMisclassificationAttack which is can be used to generate poisoned samples. Since this is the first poisoning attack on object detector models, a new abstract class art.attacks.attack.PoisoningAttackObjectDetector was created which will serve as the base for all future poisoning attacks on object detectors.

Additionally, a demo notebook notebooks/poisoning_attack_bad_det_rma.ipynb was created to demonstrate how to use the attack.

Paper link: https://arxiv.org/abs/2205.14497

This is a partial implementation of #2038 as the other three attacks need to also be implemented.

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.

  • Tests for BadDetRegionalMisclassificationAttack which are framework agnostic

Test Configuration:

  • OS
  • Python version
  • ART version or commit number
  • TensorFlow / Keras / PyTorch / MXNet 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

Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com>
Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com>
Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com>
Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com>
Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com>
Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com>
@codecov-commenter
Copy link

codecov-commenter commented Mar 6, 2023

Codecov Report

Merging #2054 (43e79fe) into dev_1.14.0 (0a0a701) will increase coverage by 0.04%.
The diff coverage is 96.92%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Impacted file tree graph

@@              Coverage Diff               @@
##           dev_1.14.0    #2054      +/-   ##
==============================================
+ Coverage       85.57%   85.62%   +0.04%     
==============================================
  Files             293      294       +1     
  Lines           26158    26221      +63     
  Branches         4733     4744      +11     
==============================================
+ Hits            22386    22452      +66     
+ Misses           2556     2553       -3     
  Partials         1216     1216              
Impacted Files Coverage Δ
art/attacks/poisoning/bad_det/bad_det_rma.py 96.42% <96.42%> (ø)
art/attacks/__init__.py 100.00% <100.00%> (ø)
art/attacks/attack.py 92.85% <100.00%> (+0.26%) ⬆️
art/attacks/poisoning/__init__.py 100.00% <100.00%> (ø)

... and 4 files with indirect coverage changes

@beat-buesser beat-buesser self-requested a review March 6, 2023 23:15
@beat-buesser beat-buesser self-assigned this Mar 6, 2023
@beat-buesser beat-buesser added the enhancement New feature or request label Mar 6, 2023
@beat-buesser beat-buesser added this to Pull request open in ART 1.14.0 via automation Mar 6, 2023
@beat-buesser beat-buesser added this to the ART 1.14.0 milestone Mar 6, 2023
@beat-buesser beat-buesser linked an issue Mar 6, 2023 that may be closed by this pull request
Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com>
Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com>
Comment on lines 20 to 23
import logging
import os
import numpy as np
import pytest
Copy link
Collaborator

Choose a reason for hiding this comment

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

Separate standard library from third party imports with blank line.

Suggested change
import logging
import os
import numpy as np
import pytest
import logging
import os
import numpy as np
import pytest

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 @f4str Thank you very much for this pull request adding the BadDet Regional Misclassification Attack! I only have found a very, very small item during my review, otherwise the code looks good to me.

ART 1.14.0 automation moved this from Pull request open to Pull request review Mar 9, 2023
f4str and others added 2 commits March 9, 2023 09:05
Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com>
@beat-buesser beat-buesser merged commit cdff3cf into Trusted-AI:dev_1.14.0 Mar 12, 2023
ART 1.14.0 automation moved this from Pull request review to Pull request done Mar 12, 2023
@f4str f4str deleted the bad-dets-attack branch March 12, 2023 22:19
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.14.0
  
Pull request done
Development

Successfully merging this pull request may close these issues.

Implementation of BadDet Poisoning Attack on Object Detectors
3 participants