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

CW attack doesn't work.maybe i don't know how to run correctly. help me #5

Closed
xieshisheng opened this issue Jul 27, 2020 · 12 comments
Closed

Comments

@xieshisheng
Copy link

No description provided.

@xieshisheng xieshisheng changed the title CW attack doesn't work,maybe something is wrong CW attack doesn't work.maybe i don't know how to run correctly. help me Jul 27, 2020
@Harry24k
Copy link
Owner

Please let me know the error situation.

@xuxiangsun
Copy link

Sir, I also encounter this issue, I found when I use the parameters default in your code, the success rate of adversarial attack is close to 0. Cause I do not check the original paper about C&W, so I am not sure how to do. Can you help me ? @Harry24k

@Harry24k
Copy link
Owner

Harry24k commented Jul 30, 2020

Sir, I also encounter this issue, I found when I use the parameters default in your code, the success rate of adversarial attack is close to 0. Cause I do not check the original paper about C&W, so I am not sure how to do. Can you help me ? @Harry24k

With default c, you can't easily get adversarial images. Set higher c like 1.

I also used c=1 in the demo.

@xuxiangsun
Copy link

xuxiangsun commented Jul 30, 2020 via email

@xieshisheng
Copy link
Author

set c like 1, I tried, but the code doesn't work too.I also check the souce code, i found the source code are not wrong.So i dont know where is wrong.

@xieshisheng
Copy link
Author

I found, set c to 10 or up(1 is not enough), CW attack can changed image to adversarial image with high success rate

@xuxiangsun
Copy link

Let me try, thanks for your precious experience! @xieshisheng

@xuxiangsun
Copy link

By the way, sir, how do you set iters and lr? @xieshisheng

@xieshisheng
Copy link
Author

I dont change iters and lr.
source code
"loss1 = nn.MSELoss(reduction='sum')(a, images)
loss2 = torch.sum(self.c*f(a))"
i think MSEELoss force new image as same as old image, if c is small ,gradient of loss2 is small . So the "adversarial" image is just as same as image, but not truly adversarial image.

@xuxiangsun
Copy link

xuxiangsun commented Jul 31, 2020 via email

@xieshisheng
Copy link
Author

hhhhh, maybe large iteration is more effective.I‘ll try it later.thank you

@xuxiangsun
Copy link

xuxiangsun commented Jul 31, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants