-
Notifications
You must be signed in to change notification settings - Fork 3
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
2005 generate adversarial dataset #3
Conversation
There are two deprecation warnings on /home/msw/.virtualenvs/cdao/lib/python3.10/site-packages/transformers/models/vit/feature_extraction_vit.py:28: FutureWarning: The class ViTFeatureExtractor is deprecated and will be removed in version 5 of Transformers. Please use ViTImageProcessor instead. |
Yeah, those are coming right out of HuggingFace because of the model's built-in configuration/metadata. I've seen similar deprecation warnings on a lot of the models picked at random from the HF hub (even from popular models). If HF goes through with the deprecated feature removal in version 3.0, there will be a lot of broken/unusuable models in their hub. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A PR of Treubig cleanliness. Thanks.
I am not waiting for the dataset to load before merging. I'll report errors post hoc should I happen to see one.
What does this MR do and why?
Add engine to support creation of adversarial datasets (datasets with an evasion attack pre-applied to all samples for the ability to perform quicker real-time demonstrations).
Also refactors the batches from tuples of
(x, y)
to dictionaries (where thex_key
andy_key
are provided so armory knows how to obtain x/y from the dictionary). This is done to avoid reducing or dropping information from the original dataset.Related issues
#2005
How to set up and validate locally
In the
examples/src/charmory_examples/image_classification/eurosat_precomputed_pgd/
folder:create_adversarial_eurosat.py [convnext|swin|vit]
to create an adversarial datasetrun_against_pregenerated.py [convnext|swin|vit] [convnext|swin|vit]
to perform evaluation using the adversarial datasetcreate_adversarial_eurosat.py
)run_with_attack.py [convnext|swin|vit]
to perform inline attack evaluation (typical armory usage)MR approval & acceptance process
Areas of focus for the review:
LightningEngine
rename andevaluation.Dataset
changessrc/charmory/data.py
andsrc/charmory/tasks/base.py
src/charmory/engine/adversarial_dataset.py
examples/src/charmory_examples/image_classification/eurosat_precomputed_pgd/
src/charmory/tasks/image_classification.py
andsrc/charmory/tasks/object_detection.py
Closes #2005