Skip to content

4 classes model; targeted attacks are different #79

@jS5t3r

Description

@jS5t3r

Follow up from #76

Since I have a model trained in only 4 classes I adapted the number of targets t.

I changed this block:

if version == 'standard':
to

        elif version == 'standard_4':
            self.attacks_to_run = ['apgd-ce', 'apgd-t', 'fab-t', 'square']
            if self.norm in ['Linf', 'L2']:
                self.apgd.n_restarts = 1
                self.apgd_targeted.n_target_classes = 3 # 9
            elif self.norm in ['L1']:
                self.apgd.use_largereps = True
                self.apgd_targeted.use_largereps = True
                self.apgd.n_restarts = 5
                self.apgd_targeted.n_target_classes = 3 # 5
            self.fab.n_restarts = 1
            self.apgd_targeted.n_restarts = 1
            self.fab.n_target_classes = 3 # 9
            #self.apgd_targeted.n_target_classes = 9
            self.square.n_queries = 5000

where t = classes - 1 = 4 - 1 = 3, so that I dont get any warning.

It seems that APGD-CE is creating most perturbations.

using standard_4 version including apgd-ce, apgd-t, fab-t, square
initial accuracy: 93.00%
apgd-ce - 1/1 - 458 out of 465 successfully perturbed
robust accuracy after APGD-CE: 1.40% (total time 112.7 s)
apgd-t - 1/1 - 0 out of 7 successfully perturbed
robust accuracy after APGD-T: 1.40% (total time 122.2 s)
fab-t - 1/1 - 0 out of 7 successfully perturbed
robust accuracy after FAB-T: 1.40% (total time 133.2 s)
square - 1/1 - 0 out of 7 successfully perturbed
robust accuracy after SQUARE: 1.40% (total time 169.0 s)
max Linf perturbation: 0.00784, nan in tensor: 0, max: 1.00000, min: 0.00000
robust accuracy: 1.40%

Well, I think that I am not doing something wrong, right?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions