Skip to content

[QUESTION]The attack success rate of CW in the least-likely mode is 0, and the BIM in the same situation is above 90 #198

Description

@wang1528186571

❔ Any questions

images, labels = get_imagenet_data()

print('[Data loaded]')
device = "cuda"
model = models.resnet50(pretrained=True).to(device).eval()
acc = get_accuracy(model, [(images.to(device), labels.to(device))])
atk = torchattacks.CW(model, c=0.1, kappa=14, steps=1000, lr=0.01)
atk.set_normalization_used(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
atk.set_mode_targeted_least_likely(kth_min=1)

I also noticed that there is a question about the CW success rate in the issue. He said that the data was normalized. I did that too - removed the line of code atk.set_normalization_used, but it still doesn't work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions