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

ActivationDefense and SpectralSignatures expect flattened activations #2313

Closed
f4str opened this issue Oct 19, 2023 · 1 comment · Fixed by #2327
Closed

ActivationDefense and SpectralSignatures expect flattened activations #2313

f4str opened this issue Oct 19, 2023 · 1 comment · Fixed by #2327
Assignees
Labels
improvement Improve implementation
Milestone

Comments

@f4str
Copy link
Collaborator

f4str commented Oct 19, 2023

Describe the bug
The ActivationDefense and SpectralSignatures defenses call the get_activations() method on a classifier, but do not flatten it. In many cases, the final hidden layer is the output of a convolutional layer which is not flattened. This will cause the defense to only be run using the first channel of the convolution rather than the flattened output.

To Reproduce
Running either of these defenses using a PyTorch ResNet-18 model will use the final hidden layer output which is a convolution layer and therefore will only use the first channel.

Expected behavior
After calling the get_activations() method, both of these defenses should flatten the output before applying their respective algorithm.

Screenshots
N/A

@beat-buesser beat-buesser added the improvement Improve implementation label Nov 1, 2023
@beat-buesser beat-buesser added this to the ART 1.17.0 milestone Nov 1, 2023
@beat-buesser
Copy link
Collaborator

Hi @f4str Sounds good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improve implementation
Projects
None yet
2 participants