fra31 / auto-attack

Code relative to "Reliable evaluation of adversarial robustness with an ensemble of diverse parameter-free attacks"
https://arxiv.org/abs/2003.01690
MIT License
656 stars 112 forks source link

Can AutoAttack be used to dense prediction task? #100

Open zhanglijun95 opened 1 year ago

zhanglijun95 commented 1 year ago

Dear Author,

Thank you for your work and code! Recently I'm trying to apply AutoAttack on dense prediction tasks like semantic segmentation, but I got some error messages. So I'm wondering whether your package supports dense prediction task or currently it can only support classification task? Wait for your response. Thank you!

Best

fra31 commented 1 year ago

Hi,

at the moment only classification tasks are supported. Adapting APGD and Square to optimize a different loss (i.e. when you have dense predictions) should be possible, but would require some adaptation of the code. If you have a reference to an example of the case you're considering, I'd be happy to have a look.

zhanglijun95 commented 1 year ago

Thank you for your kind reply! The case I'm considering is a segmentation task. The input is in [B, C, H, W], where B is the batch size, C is 3, H and W are the height and width of the image. The label is in [B, 1, H, W], which indicates the class label for each pixel in the input. The output of the model is in [B, 40, H, W], where 40 is the number of classes for this segmentation task. Do you have any suggestion for me to fit my case? Thank you!