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

Implement Adversarial Texture Attack on Object Trackers #1430

Merged
merged 21 commits into from
Dec 10, 2021

Conversation

beat-buesser
Copy link
Collaborator

Description

Continuing from PR #1353

This pull request implements the Adversarial Texture attack on object trackers by Wiyatno and Xu, 2019 (https://arxiv.org/abs/1904.11042) in PyTorch compatible with ART's PyTorchGoturn object tracking estimator. This implementation supports segmentation masks of foreground objects to train adversarial textures that are robust against being partially covered by the tracked or other objects.

Fixes #1326

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

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 and others added 16 commits October 7, 2021 23:09
Signed-off-by: Beat Buesser <beat.buesser@ie.ibm.com>
Signed-off-by: Beat Buesser <beat.buesser@ie.ibm.com>
Signed-off-by: Beat Buesser <beat.buesser@ie.ibm.com>
Signed-off-by: Beat Buesser <beat.buesser@ie.ibm.com>
Signed-off-by: Beat Buesser <beat.buesser@ie.ibm.com>
Signed-off-by: Beat Buesser <beat.buesser@ie.ibm.com>
Signed-off-by: Beat Buesser <beat.buesser@ie.ibm.com>
Signed-off-by: Beat Buesser <beat.buesser@ie.ibm.com>
Signed-off-by: Beat Buesser <beat.buesser@ie.ibm.com>
Signed-off-by: Beat Buesser <beat.buesser@ie.ibm.com>
@beat-buesser beat-buesser changed the title This pull request implements the Adversarial Texture attack on object trackers by Wiyatno and Xu, 2019 (https://arxiv.org/abs/1904.11042) in PyTorch compatible with ART's PyTorchGoturn object tracking estimator. This implementation supports segmentation masks of foreground objects to train adversarial textures that are robust against being partially covered by the tracked or other objects. Implement Adversarial Texture Attack on Object Trackers Dec 6, 2021
@beat-buesser beat-buesser self-assigned this Dec 6, 2021
@beat-buesser beat-buesser added the enhancement New feature or request label Dec 6, 2021
@beat-buesser beat-buesser added this to Pull request open in ART 1.9.0 via automation Dec 6, 2021
@beat-buesser beat-buesser added this to the ART 1.9.0 milestone Dec 6, 2021
@beat-buesser beat-buesser linked an issue Dec 6, 2021 that may be closed by this pull request
@codecov-commenter
Copy link

codecov-commenter commented Dec 6, 2021

Codecov Report

Merging #1430 (0f23952) into dev_1.9.0 (3cdd1ae) will increase coverage by 8.96%.
The diff coverage is 89.09%.

Impacted file tree graph

@@              Coverage Diff              @@
##           dev_1.9.0    #1430      +/-   ##
=============================================
+ Coverage      81.55%   90.52%   +8.96%     
=============================================
  Files            235      236       +1     
  Lines          19049    19214     +165     
  Branches        3365     3387      +22     
=============================================
+ Hits           15535    17393    +1858     
+ Misses          2807     1051    -1756     
- Partials         707      770      +63     
Impacted Files Coverage Δ
...adversarial_texture/adversarial_texture_pytorch.py 89.02% <89.02%> (ø)
art/attacks/evasion/__init__.py 100.00% <100.00%> (ø)
art/estimators/classification/tensorflow.py 82.80% <0.00%> (+0.41%) ⬆️
art/estimators/classification/scikitlearn.py 90.86% <0.00%> (+0.66%) ⬆️
art/attacks/attack.py 92.59% <0.00%> (+0.92%) ⬆️
art/utils.py 90.92% <0.00%> (+1.03%) ⬆️
art/estimators/object_tracking/pytorch_goturn.py 76.05% <0.00%> (+2.11%) ⬆️
art/estimators/classification/keras.py 87.70% <0.00%> (+4.98%) ⬆️
art/attacks/evasion/iterative_method.py 100.00% <0.00%> (+9.09%) ⬆️
art/attacks/evasion/elastic_net.py 99.33% <0.00%> (+16.00%) ⬆️
... and 17 more

@lgtm-com
Copy link

lgtm-com bot commented Dec 7, 2021

This pull request introduces 9 alerts when merging fb2db39 into 451d909 - view on LGTM.com

new alerts:

  • 9 for Module is imported more than once

@lgtm-com
Copy link

lgtm-com bot commented Dec 8, 2021

This pull request introduces 9 alerts when merging a27d478 into 96ad148 - view on LGTM.com

new alerts:

  • 9 for Module is imported more than once

@lgtm-com
Copy link

lgtm-com bot commented Dec 8, 2021

This pull request introduces 9 alerts when merging cfc743a into 3cdd1ae - view on LGTM.com

new alerts:

  • 9 for Module is imported more than once

Copy link
Collaborator

@GiulioZizzo GiulioZizzo left a comment

Choose a reason for hiding this comment

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

Hi Beat, many thanks for the review. I hope you find the comments helpful!

import torch # lgtm [py/repeated-import]

y_pred = self._predictions(videos, y_init, foreground)
loss = torch.nn.L1Loss(size_average=False)(y_pred[0]["boxes"].float(), target[0]["boxes"].float())
Copy link
Collaborator

Choose a reason for hiding this comment

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

size_average is deprecated, perhaps implement equivalent functionality using the reduction parameter

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point, I'll replace it with reduction='sum'.

from scripts.train import GoturnTrain
from pathlib import Path

_device = "cpu"
Copy link
Collaborator

Choose a reason for hiding this comment

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

If a GPU is available, would it make sense to run the tests on a GPU to ensure that there is device consistency on this and future modifications of the code?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That's good idea and would be very nice, at the moment there are no GPUs available on Actions. At the moment we run the tests manually on a GPU.

Beat Buesser added 2 commits December 10, 2021 17:01
Signed-off-by: Beat Buesser <beat.buesser@ie.ibm.com>
Signed-off-by: Beat Buesser <beat.buesser@ie.ibm.com>
@lgtm-com
Copy link

lgtm-com bot commented Dec 10, 2021

This pull request introduces 9 alerts when merging 0f23952 into 3cdd1ae - view on LGTM.com

new alerts:

  • 9 for Module is imported more than once

@beat-buesser beat-buesser merged commit b77725e into dev_1.9.0 Dec 10, 2021
ART 1.9.0 automation moved this from Pull request open to Pull request done Dec 10, 2021
@beat-buesser beat-buesser deleted the development_object_tracking_attack_dev branch December 10, 2021 22:08
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.9.0
  
Pull request done
Development

Successfully merging this pull request may close these issues.

Implement Physical Adversarial Textures
3 participants