diff --git a/README.md b/LTD/README.md similarity index 100% rename from README.md rename to LTD/README.md diff --git a/cifar10-WRN-34-10/auto_attack.txt b/LTD/cifar10-WRN-34-10/auto_attack.txt similarity index 100% rename from cifar10-WRN-34-10/auto_attack.txt rename to LTD/cifar10-WRN-34-10/auto_attack.txt diff --git a/cifar10-WRN-34-10/wideresnet.py b/LTD/cifar10-WRN-34-10/wideresnet.py similarity index 100% rename from cifar10-WRN-34-10/wideresnet.py rename to LTD/cifar10-WRN-34-10/wideresnet.py diff --git a/cifar10-WRN-34-20/auto_attack.txt b/LTD/cifar10-WRN-34-20/auto_attack.txt similarity index 100% rename from cifar10-WRN-34-20/auto_attack.txt rename to LTD/cifar10-WRN-34-20/auto_attack.txt diff --git a/cifar10-WRN-34-20/wideresnet.py b/LTD/cifar10-WRN-34-20/wideresnet.py similarity index 100% rename from cifar10-WRN-34-20/wideresnet.py rename to LTD/cifar10-WRN-34-20/wideresnet.py diff --git a/cifar100-WRN-34-10/auto_attack.txt b/LTD/cifar100-WRN-34-10/auto_attack.txt similarity index 100% rename from cifar100-WRN-34-10/auto_attack.txt rename to LTD/cifar100-WRN-34-10/auto_attack.txt diff --git a/cifar100-WRN-34-10/wideresnet.py b/LTD/cifar100-WRN-34-10/wideresnet.py similarity index 100% rename from cifar100-WRN-34-10/wideresnet.py rename to LTD/cifar100-WRN-34-10/wideresnet.py diff --git a/LessIsMore/README.md b/LessIsMore/README.md new file mode 100644 index 0000000..03f6a11 --- /dev/null +++ b/LessIsMore/README.md @@ -0,0 +1,5 @@ +# Data filtering for efficient adversarial training + +The code for the paper [Data filtering for efficient adversarial training](https://doi.org/10.1016/j.patcog.2024.110394). + +The details will be released soon. diff --git a/LessIsMore/cifar10-WRN-34-10/auto_attack.txt b/LessIsMore/cifar10-WRN-34-10/auto_attack.txt new file mode 100644 index 0000000..6e0da5f --- /dev/null +++ b/LessIsMore/cifar10-WRN-34-10/auto_attack.txt @@ -0,0 +1,76 @@ +2022-08-05 13:14:14.844 [INFO] eval_pytorch::59 | [ GPU ] CUDA_VISIBLE_DEVICES: 3 +2022-08-05 13:14:14.844 [INFO] eval_pytorch::60 | [torch] Pytorch version: 1.12.0+cu113 +2022-08-05 13:14:14.845 [INFO] eval_pytorch::61 | [param] Listing hyper-parameters... +2022-08-05 13:14:14.845 [INFO] eval_pytorch::62 | [param] store_path : ../AWP/trades_AWP/model-best/ +2022-08-05 13:14:14.845 [INFO] eval_pytorch::63 | [param] ckpt_name : ./model-best.pt +2022-08-05 13:14:14.845 [INFO] eval_pytorch::64 | [param] norm : Linf +2022-08-05 13:14:14.845 [INFO] eval_pytorch::65 | [param] epsilon : 0.031373 +2022-08-05 13:14:14.846 [INFO] eval_pytorch::75 | [param] dataset : CIFAR10 +2022-08-05 13:14:14.846 [INFO] eval_pytorch::76 | [param] model_depth: 34 +2022-08-05 13:14:14.846 [INFO] eval_pytorch::77 | [param] model_widen: 10 +2022-08-05 13:14:18.908 [WARNING] eval_pytorch::112 | using the original data +2022-08-05 13:14:22.522 [INFO] eval_pytorch::135 | MD5 checksum: 274deb91b91e16a86466a5fc86a27b10 +2022-08-05 13:14:22.733 [INFO] eval_pytorch::136 | SHA1 checksum: 9bb5639c033de0ecd58c567d533b584eb722060b +2022-08-05 13:14:36.035 [INFO] other_utils:log:13 | initial accuracy: 86.54% +2022-08-05 13:15:58.752 [INFO] other_utils:log:13 | apgd-ce - 1/18 - 149 out of 500 successfully perturbed +2022-08-05 13:17:15.184 [INFO] other_utils:log:13 | apgd-ce - 2/18 - 132 out of 500 successfully perturbed +2022-08-05 13:18:31.619 [INFO] other_utils:log:13 | apgd-ce - 3/18 - 136 out of 500 successfully perturbed +2022-08-05 13:19:48.043 [INFO] other_utils:log:13 | apgd-ce - 4/18 - 147 out of 500 successfully perturbed +2022-08-05 13:21:04.464 [INFO] other_utils:log:13 | apgd-ce - 5/18 - 160 out of 500 successfully perturbed +2022-08-05 13:22:20.876 [INFO] other_utils:log:13 | apgd-ce - 6/18 - 146 out of 500 successfully perturbed +2022-08-05 13:23:37.293 [INFO] other_utils:log:13 | apgd-ce - 7/18 - 149 out of 500 successfully perturbed +2022-08-05 13:24:53.688 [INFO] other_utils:log:13 | apgd-ce - 8/18 - 136 out of 500 successfully perturbed +2022-08-05 13:26:10.135 [INFO] other_utils:log:13 | apgd-ce - 9/18 - 150 out of 500 successfully perturbed +2022-08-05 13:27:26.555 [INFO] other_utils:log:13 | apgd-ce - 10/18 - 153 out of 500 successfully perturbed +2022-08-05 13:28:42.976 [INFO] other_utils:log:13 | apgd-ce - 11/18 - 144 out of 500 successfully perturbed +2022-08-05 13:29:59.389 [INFO] other_utils:log:13 | apgd-ce - 12/18 - 140 out of 500 successfully perturbed +2022-08-05 13:31:15.791 [INFO] other_utils:log:13 | apgd-ce - 13/18 - 159 out of 500 successfully perturbed +2022-08-05 13:32:32.217 [INFO] other_utils:log:13 | apgd-ce - 14/18 - 130 out of 500 successfully perturbed +2022-08-05 13:33:48.631 [INFO] other_utils:log:13 | apgd-ce - 15/18 - 165 out of 500 successfully perturbed +2022-08-05 13:35:05.045 [INFO] other_utils:log:13 | apgd-ce - 16/18 - 144 out of 500 successfully perturbed +2022-08-05 13:36:21.463 [INFO] other_utils:log:13 | apgd-ce - 17/18 - 149 out of 500 successfully perturbed +2022-08-05 13:36:48.202 [INFO] other_utils:log:13 | apgd-ce - 18/18 - 41 out of 154 successfully perturbed +2022-08-05 13:36:48.202 [INFO] other_utils:log:13 | robust accuracy after APGD-CE: 61.24% (total time 1332.2 s) +2022-08-05 13:47:30.659 [INFO] other_utils:log:13 | apgd-t - 1/13 - 39 out of 500 successfully perturbed +2022-08-05 13:58:19.215 [INFO] other_utils:log:13 | apgd-t - 2/13 - 25 out of 500 successfully perturbed +2022-08-05 14:09:05.150 [INFO] other_utils:log:13 | apgd-t - 3/13 - 29 out of 500 successfully perturbed +2022-08-05 14:19:53.440 [INFO] other_utils:log:13 | apgd-t - 4/13 - 25 out of 500 successfully perturbed +2022-08-05 14:30:37.473 [INFO] other_utils:log:13 | apgd-t - 5/13 - 34 out of 500 successfully perturbed +2022-08-05 14:41:15.466 [INFO] other_utils:log:13 | apgd-t - 6/13 - 36 out of 500 successfully perturbed +2022-08-05 14:51:59.074 [INFO] other_utils:log:13 | apgd-t - 7/13 - 29 out of 500 successfully perturbed +2022-08-05 15:02:33.482 [INFO] other_utils:log:13 | apgd-t - 8/13 - 41 out of 500 successfully perturbed +2022-08-05 15:13:15.251 [INFO] other_utils:log:13 | apgd-t - 9/13 - 31 out of 500 successfully perturbed +2022-08-05 15:23:52.353 [INFO] other_utils:log:13 | apgd-t - 10/13 - 34 out of 500 successfully perturbed +2022-08-05 15:34:25.614 [INFO] other_utils:log:13 | apgd-t - 11/13 - 36 out of 500 successfully perturbed +2022-08-05 15:45:09.937 [INFO] other_utils:log:13 | apgd-t - 12/13 - 27 out of 500 successfully perturbed +2022-08-05 15:47:59.642 [INFO] other_utils:log:13 | apgd-t - 13/13 - 8 out of 124 successfully perturbed +2022-08-05 15:47:59.643 [INFO] other_utils:log:13 | robust accuracy after APGD-T: 57.30% (total time 9203.6 s) +2022-08-05 16:03:08.041 [INFO] other_utils:log:13 | fab-t - 1/12 - 0 out of 500 successfully perturbed +2022-08-05 16:18:16.559 [INFO] other_utils:log:13 | fab-t - 2/12 - 0 out of 500 successfully perturbed +2022-08-05 16:33:25.204 [INFO] other_utils:log:13 | fab-t - 3/12 - 0 out of 500 successfully perturbed +2022-08-05 16:48:34.252 [INFO] other_utils:log:13 | fab-t - 4/12 - 0 out of 500 successfully perturbed +2022-08-05 17:03:43.067 [INFO] other_utils:log:13 | fab-t - 5/12 - 0 out of 500 successfully perturbed +2022-08-05 17:18:52.190 [INFO] other_utils:log:13 | fab-t - 6/12 - 0 out of 500 successfully perturbed +2022-08-05 17:34:01.195 [INFO] other_utils:log:13 | fab-t - 7/12 - 0 out of 500 successfully perturbed +2022-08-05 17:49:09.736 [INFO] other_utils:log:13 | fab-t - 8/12 - 0 out of 500 successfully perturbed +2022-08-05 18:04:18.557 [INFO] other_utils:log:13 | fab-t - 9/12 - 0 out of 500 successfully perturbed +2022-08-05 18:19:27.193 [INFO] other_utils:log:13 | fab-t - 10/12 - 0 out of 500 successfully perturbed +2022-08-05 18:34:35.867 [INFO] other_utils:log:13 | fab-t - 11/12 - 0 out of 500 successfully perturbed +2022-08-05 18:41:38.436 [INFO] other_utils:log:13 | fab-t - 12/12 - 0 out of 230 successfully perturbed +2022-08-05 18:41:38.436 [INFO] other_utils:log:13 | robust accuracy after FAB-T: 57.30% (total time 19622.4 s) +2022-08-05 19:01:45.922 [INFO] other_utils:log:13 | square - 1/12 - 0 out of 500 successfully perturbed +2022-08-05 19:21:53.203 [INFO] other_utils:log:13 | square - 2/12 - 0 out of 500 successfully perturbed +2022-08-05 19:41:59.006 [INFO] other_utils:log:13 | square - 3/12 - 0 out of 500 successfully perturbed +2022-08-05 20:02:03.977 [INFO] other_utils:log:13 | square - 4/12 - 0 out of 500 successfully perturbed +2022-08-05 20:22:10.998 [INFO] other_utils:log:13 | square - 5/12 - 0 out of 500 successfully perturbed +2022-08-05 20:42:18.367 [INFO] other_utils:log:13 | square - 6/12 - 0 out of 500 successfully perturbed +2022-08-05 21:02:26.304 [INFO] other_utils:log:13 | square - 7/12 - 0 out of 500 successfully perturbed +2022-08-05 21:22:34.902 [INFO] other_utils:log:13 | square - 8/12 - 0 out of 500 successfully perturbed +2022-08-05 21:42:43.920 [INFO] other_utils:log:13 | square - 9/12 - 0 out of 500 successfully perturbed +2022-08-05 22:02:53.565 [INFO] other_utils:log:13 | square - 10/12 - 0 out of 500 successfully perturbed +2022-08-05 22:23:06.879 [INFO] other_utils:log:13 | square - 11/12 - 0 out of 500 successfully perturbed +2022-08-05 22:32:27.113 [INFO] other_utils:log:13 | square - 12/12 - 0 out of 230 successfully perturbed +2022-08-05 22:32:27.114 [INFO] other_utils:log:13 | robust accuracy after SQUARE: 57.30% (total time 33471.1 s) +2022-08-05 22:32:27.116 [INFO] other_utils:log:13 | max Linf perturbation: 0.03137, nan in tensor: 0, max: 1.00000, min: 0.00000 +2022-08-05 22:32:27.116 [INFO] other_utils:log:13 | robust accuracy: 57.30% + diff --git a/LessIsMore/cifar10-WRN-34-10/wideresnet.py b/LessIsMore/cifar10-WRN-34-10/wideresnet.py new file mode 100644 index 0000000..98e78d0 --- /dev/null +++ b/LessIsMore/cifar10-WRN-34-10/wideresnet.py @@ -0,0 +1,90 @@ +import math +import torch +import torch.nn as nn +import torch.nn.functional as F + + +class BasicBlock(nn.Module): + def __init__(self, in_planes, out_planes, stride, dropRate=0.0): + super(BasicBlock, self).__init__() + self.bn1 = nn.BatchNorm2d(in_planes) + self.relu1 = nn.ReLU(inplace=True) + self.conv1 = nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, + padding=1, bias=False) + self.bn2 = nn.BatchNorm2d(out_planes) + self.relu2 = nn.ReLU(inplace=True) + self.conv2 = nn.Conv2d(out_planes, out_planes, kernel_size=3, stride=1, + padding=1, bias=False) + self.droprate = dropRate + self.equalInOut = (in_planes == out_planes) + self.convShortcut = (not self.equalInOut) and nn.Conv2d(in_planes, out_planes, kernel_size=1, stride=stride, + padding=0, bias=False) or None + + def forward(self, x): + if not self.equalInOut: + x = self.relu1(self.bn1(x)) + else: + out = self.relu1(self.bn1(x)) + out = self.relu2(self.bn2(self.conv1(out if self.equalInOut else x))) + if self.droprate > 0: + out = F.dropout(out, p=self.droprate, training=self.training) + out = self.conv2(out) + return torch.add(x if self.equalInOut else self.convShortcut(x), out) + + +class NetworkBlock(nn.Module): + def __init__(self, nb_layers, in_planes, out_planes, block, stride, dropRate=0.0): + super(NetworkBlock, self).__init__() + self.layer = self._make_layer(block, in_planes, out_planes, nb_layers, stride, dropRate) + + def _make_layer(self, block, in_planes, out_planes, nb_layers, stride, dropRate): + layers = [] + for i in range(int(nb_layers)): + layers.append(block(i == 0 and in_planes or out_planes, out_planes, i == 0 and stride or 1, dropRate)) + return nn.Sequential(*layers) + + def forward(self, x): + return self.layer(x) + + +class WideResNet(nn.Module): + def __init__(self, depth=34, num_classes=10, widen_factor=10, dropRate=0.0): + super(WideResNet, self).__init__() + nChannels = [16, 16 * widen_factor, 32 * widen_factor, 64 * widen_factor] + assert ((depth - 4) % 6 == 0) + n = (depth - 4) / 6 + block = BasicBlock + # 1st conv before any network block + self.conv1 = nn.Conv2d(3, nChannels[0], kernel_size=3, stride=1, + padding=1, bias=False) + # 1st block + self.block1 = NetworkBlock(n, nChannels[0], nChannels[1], block, 1, dropRate) + # 2nd block + self.block2 = NetworkBlock(n, nChannels[1], nChannels[2], block, 2, dropRate) + # 3rd block + self.block3 = NetworkBlock(n, nChannels[2], nChannels[3], block, 2, dropRate) + # global average pooling and classifier + self.bn1 = nn.BatchNorm2d(nChannels[3]) + self.relu = nn.ReLU(inplace=True) + self.fc = nn.Linear(nChannels[3], num_classes) + self.nChannels = nChannels[3] + + for m in self.modules(): + if isinstance(m, nn.Conv2d): + n = m.kernel_size[0] * m.kernel_size[1] * m.out_channels + m.weight.data.normal_(0, math.sqrt(2. / n)) + elif isinstance(m, nn.BatchNorm2d): + m.weight.data.fill_(1) + m.bias.data.zero_() + elif isinstance(m, nn.Linear): + m.bias.data.zero_() + + def forward(self, x): + out = self.conv1(x) + out = self.block1(out) + out = self.block2(out) + out = self.block3(out) + out = self.relu(self.bn1(out)) + out = F.avg_pool2d(out, 8) + out = out.view(-1, self.nChannels) + return self.fc(out) diff --git a/LessIsMore/cifar10-WRN-34-20/auto_attack.txt b/LessIsMore/cifar10-WRN-34-20/auto_attack.txt new file mode 100644 index 0000000..761c8eb --- /dev/null +++ b/LessIsMore/cifar10-WRN-34-20/auto_attack.txt @@ -0,0 +1,73 @@ +2022-02-11 05:32:33.098 [INFO] eval_pytorch::61 | [ GPU ] CUDA_VISIBLE_DEVICES: 2 +2022-02-11 05:32:33.099 [INFO] eval_pytorch::62 | [torch] Pytorch version: 1.10.1+cu113 +2022-02-11 05:32:33.099 [INFO] eval_pytorch::63 | [param] Listing hyper-parameters... +2022-02-11 05:32:33.099 [INFO] eval_pytorch::64 | [param] dataset : CIFAR10 +2022-02-11 05:32:33.099 [INFO] eval_pytorch::65 | [param] store_path : ../AWP/trades_AWP/model-best/ +2022-02-11 05:32:33.099 [INFO] eval_pytorch::66 | [param] ckpt_name : ./model-best.pt +2022-02-11 05:32:33.099 [INFO] eval_pytorch::67 | [param] norm : Linf +2022-02-11 05:32:33.099 [INFO] eval_pytorch::68 | [param] epsilon : 0.031373 +2022-02-11 05:32:37.689 [WARNING] eval_pytorch::113 | using the original data +2022-02-11 05:33:00.337 [INFO] eval_pytorch::136 | MD5 checksum: 287f8e885bd44f748d21f7ad77eb7d11 +2022-02-11 05:33:01.317 [INFO] eval_pytorch::137 | SHA1 checksum: 65cdd1d98e5132d683c29345ac2c5f3a8f33ae1a +2022-02-11 05:33:21.838 [INFO] other_utils:log:13 | initial accuracy: 86.10% +2022-02-11 05:37:31.347 [INFO] other_utils:log:13 | apgd-ce - 1/18 - 150 out of 500 successfully perturbed +2022-02-11 05:41:35.934 [INFO] other_utils:log:13 | apgd-ce - 2/18 - 136 out of 500 successfully perturbed +2022-02-11 05:45:40.689 [INFO] other_utils:log:13 | apgd-ce - 3/18 - 139 out of 500 successfully perturbed +2022-02-11 05:49:45.250 [INFO] other_utils:log:13 | apgd-ce - 4/18 - 149 out of 500 successfully perturbed +2022-02-11 05:53:49.968 [INFO] other_utils:log:13 | apgd-ce - 5/18 - 148 out of 500 successfully perturbed +2022-02-11 05:57:54.800 [INFO] other_utils:log:13 | apgd-ce - 6/18 - 136 out of 500 successfully perturbed +2022-02-11 06:01:59.610 [INFO] other_utils:log:13 | apgd-ce - 7/18 - 136 out of 500 successfully perturbed +2022-02-11 06:06:04.420 [INFO] other_utils:log:13 | apgd-ce - 8/18 - 130 out of 500 successfully perturbed +2022-02-11 06:10:09.260 [INFO] other_utils:log:13 | apgd-ce - 9/18 - 140 out of 500 successfully perturbed +2022-02-11 06:14:13.939 [INFO] other_utils:log:13 | apgd-ce - 10/18 - 150 out of 500 successfully perturbed +2022-02-11 06:18:18.689 [INFO] other_utils:log:13 | apgd-ce - 11/18 - 153 out of 500 successfully perturbed +2022-02-11 06:22:23.327 [INFO] other_utils:log:13 | apgd-ce - 12/18 - 140 out of 500 successfully perturbed +2022-02-11 06:26:27.981 [INFO] other_utils:log:13 | apgd-ce - 13/18 - 161 out of 500 successfully perturbed +2022-02-11 06:30:32.668 [INFO] other_utils:log:13 | apgd-ce - 14/18 - 135 out of 500 successfully perturbed +2022-02-11 06:34:37.528 [INFO] other_utils:log:13 | apgd-ce - 15/18 - 158 out of 500 successfully perturbed +2022-02-11 06:38:42.350 [INFO] other_utils:log:13 | apgd-ce - 16/18 - 132 out of 500 successfully perturbed +2022-02-11 06:42:47.087 [INFO] other_utils:log:13 | apgd-ce - 17/18 - 154 out of 500 successfully perturbed +2022-02-11 06:43:43.047 [INFO] other_utils:log:13 | apgd-ce - 18/18 - 25 out of 110 successfully perturbed +2022-02-11 06:43:43.047 [INFO] other_utils:log:13 | robust accuracy after APGD-CE: 61.38% (total time 4221.2 s) +2022-02-11 07:18:15.151 [INFO] other_utils:log:13 | apgd-t - 1/13 - 34 out of 500 successfully perturbed +2022-02-11 07:53:24.270 [INFO] other_utils:log:13 | apgd-t - 2/13 - 15 out of 500 successfully perturbed +2022-02-11 08:27:58.437 [INFO] other_utils:log:13 | apgd-t - 3/13 - 29 out of 500 successfully perturbed +2022-02-11 09:02:30.998 [INFO] other_utils:log:13 | apgd-t - 4/13 - 26 out of 500 successfully perturbed +2022-02-11 09:36:43.824 [INFO] other_utils:log:13 | apgd-t - 5/13 - 31 out of 500 successfully perturbed +2022-02-11 10:11:16.419 [INFO] other_utils:log:13 | apgd-t - 6/13 - 28 out of 500 successfully perturbed +2022-02-11 10:45:30.324 [INFO] other_utils:log:13 | apgd-t - 7/13 - 26 out of 500 successfully perturbed +2022-02-11 11:19:49.398 [INFO] other_utils:log:13 | apgd-t - 8/13 - 30 out of 500 successfully perturbed +2022-02-11 11:54:18.904 [INFO] other_utils:log:13 | apgd-t - 9/13 - 24 out of 500 successfully perturbed +2022-02-11 12:28:28.030 [INFO] other_utils:log:13 | apgd-t - 10/13 - 29 out of 500 successfully perturbed +2022-02-11 13:02:40.310 [INFO] other_utils:log:13 | apgd-t - 11/13 - 27 out of 500 successfully perturbed +2022-02-11 13:36:53.112 [INFO] other_utils:log:13 | apgd-t - 12/13 - 25 out of 500 successfully perturbed +2022-02-11 13:47:00.036 [INFO] other_utils:log:13 | apgd-t - 13/13 - 5 out of 138 successfully perturbed +2022-02-11 13:47:00.037 [INFO] other_utils:log:13 | robust accuracy after APGD-T: 58.09% (total time 29618.2 s) +2022-02-11 14:35:54.853 [INFO] other_utils:log:13 | fab-t - 1/12 - 0 out of 500 successfully perturbed +2022-02-11 15:24:49.647 [INFO] other_utils:log:13 | fab-t - 2/12 - 0 out of 500 successfully perturbed +2022-02-11 16:13:44.217 [INFO] other_utils:log:13 | fab-t - 3/12 - 0 out of 500 successfully perturbed +2022-02-11 17:02:38.775 [INFO] other_utils:log:13 | fab-t - 4/12 - 0 out of 500 successfully perturbed +2022-02-11 17:51:34.339 [INFO] other_utils:log:13 | fab-t - 5/12 - 0 out of 500 successfully perturbed +2022-02-11 18:40:31.251 [INFO] other_utils:log:13 | fab-t - 6/12 - 0 out of 500 successfully perturbed +2022-02-11 19:29:28.811 [INFO] other_utils:log:13 | fab-t - 7/12 - 0 out of 500 successfully perturbed +2022-02-11 20:18:26.582 [INFO] other_utils:log:13 | fab-t - 8/12 - 0 out of 500 successfully perturbed +2022-02-11 21:07:27.107 [INFO] other_utils:log:13 | fab-t - 9/12 - 0 out of 500 successfully perturbed +2022-02-11 21:56:27.485 [INFO] other_utils:log:13 | fab-t - 10/12 - 0 out of 500 successfully perturbed +2022-02-11 22:45:28.873 [INFO] other_utils:log:13 | fab-t - 11/12 - 0 out of 500 successfully perturbed +2022-02-11 23:15:39.622 [INFO] other_utils:log:13 | fab-t - 12/12 - 0 out of 309 successfully perturbed +2022-02-11 23:15:39.624 [INFO] other_utils:log:13 | robust accuracy after FAB-T: 58.09% (total time 63737.8 s) +2022-02-12 00:24:18.455 [INFO] other_utils:log:13 | square - 1/12 - 0 out of 500 successfully perturbed +2022-02-12 01:32:58.302 [INFO] other_utils:log:13 | square - 2/12 - 0 out of 500 successfully perturbed +2022-02-12 02:41:37.447 [INFO] other_utils:log:13 | square - 3/12 - 0 out of 500 successfully perturbed +2022-02-12 03:50:16.588 [INFO] other_utils:log:13 | square - 4/12 - 0 out of 500 successfully perturbed +2022-02-12 04:58:54.419 [INFO] other_utils:log:13 | square - 5/12 - 0 out of 500 successfully perturbed +2022-02-12 06:07:33.118 [INFO] other_utils:log:13 | square - 6/12 - 0 out of 500 successfully perturbed +2022-02-12 07:16:11.055 [INFO] other_utils:log:13 | square - 7/12 - 0 out of 500 successfully perturbed +2022-02-12 08:24:53.178 [INFO] other_utils:log:13 | square - 8/12 - 0 out of 500 successfully perturbed +2022-02-12 09:33:26.522 [INFO] other_utils:log:13 | square - 9/12 - 0 out of 500 successfully perturbed +2022-02-12 10:42:00.672 [INFO] other_utils:log:13 | square - 10/12 - 0 out of 500 successfully perturbed +2022-02-12 11:50:32.460 [INFO] other_utils:log:13 | square - 11/12 - 0 out of 500 successfully perturbed +2022-02-12 12:32:41.405 [INFO] other_utils:log:13 | square - 12/12 - 0 out of 309 successfully perturbed +2022-02-12 12:32:41.406 [INFO] other_utils:log:13 | robust accuracy after SQUARE: 58.09% (total time 111559.6 s) +2022-02-12 12:32:41.438 [INFO] other_utils:log:13 | max Linf perturbation: 0.03137, nan in tensor: 0, max: 1.00000, min: 0.00000 +2022-02-12 12:32:41.438 [INFO] other_utils:log:13 | robust accuracy: 58.09% diff --git a/LessIsMore/cifar10-WRN-34-20/wideresnet.py b/LessIsMore/cifar10-WRN-34-20/wideresnet.py new file mode 100644 index 0000000..dc071d6 --- /dev/null +++ b/LessIsMore/cifar10-WRN-34-20/wideresnet.py @@ -0,0 +1,90 @@ +import math +import torch +import torch.nn as nn +import torch.nn.functional as F + + +class BasicBlock(nn.Module): + def __init__(self, in_planes, out_planes, stride, dropRate=0.0): + super(BasicBlock, self).__init__() + self.bn1 = nn.BatchNorm2d(in_planes) + self.relu1 = nn.ReLU(inplace=True) + self.conv1 = nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, + padding=1, bias=False) + self.bn2 = nn.BatchNorm2d(out_planes) + self.relu2 = nn.ReLU(inplace=True) + self.conv2 = nn.Conv2d(out_planes, out_planes, kernel_size=3, stride=1, + padding=1, bias=False) + self.droprate = dropRate + self.equalInOut = (in_planes == out_planes) + self.convShortcut = (not self.equalInOut) and nn.Conv2d(in_planes, out_planes, kernel_size=1, stride=stride, + padding=0, bias=False) or None + + def forward(self, x): + if not self.equalInOut: + x = self.relu1(self.bn1(x)) + else: + out = self.relu1(self.bn1(x)) + out = self.relu2(self.bn2(self.conv1(out if self.equalInOut else x))) + if self.droprate > 0: + out = F.dropout(out, p=self.droprate, training=self.training) + out = self.conv2(out) + return torch.add(x if self.equalInOut else self.convShortcut(x), out) + + +class NetworkBlock(nn.Module): + def __init__(self, nb_layers, in_planes, out_planes, block, stride, dropRate=0.0): + super(NetworkBlock, self).__init__() + self.layer = self._make_layer(block, in_planes, out_planes, nb_layers, stride, dropRate) + + def _make_layer(self, block, in_planes, out_planes, nb_layers, stride, dropRate): + layers = [] + for i in range(int(nb_layers)): + layers.append(block(i == 0 and in_planes or out_planes, out_planes, i == 0 and stride or 1, dropRate)) + return nn.Sequential(*layers) + + def forward(self, x): + return self.layer(x) + + +class WideResNet(nn.Module): + def __init__(self, depth=34, num_classes=20, widen_factor=10, dropRate=0.0): + super(WideResNet, self).__init__() + nChannels = [16, 16 * widen_factor, 32 * widen_factor, 64 * widen_factor] + assert ((depth - 4) % 6 == 0) + n = (depth - 4) / 6 + block = BasicBlock + # 1st conv before any network block + self.conv1 = nn.Conv2d(3, nChannels[0], kernel_size=3, stride=1, + padding=1, bias=False) + # 1st block + self.block1 = NetworkBlock(n, nChannels[0], nChannels[1], block, 1, dropRate) + # 2nd block + self.block2 = NetworkBlock(n, nChannels[1], nChannels[2], block, 2, dropRate) + # 3rd block + self.block3 = NetworkBlock(n, nChannels[2], nChannels[3], block, 2, dropRate) + # global average pooling and classifier + self.bn1 = nn.BatchNorm2d(nChannels[3]) + self.relu = nn.ReLU(inplace=True) + self.fc = nn.Linear(nChannels[3], num_classes) + self.nChannels = nChannels[3] + + for m in self.modules(): + if isinstance(m, nn.Conv2d): + n = m.kernel_size[0] * m.kernel_size[1] * m.out_channels + m.weight.data.normal_(0, math.sqrt(2. / n)) + elif isinstance(m, nn.BatchNorm2d): + m.weight.data.fill_(1) + m.bias.data.zero_() + elif isinstance(m, nn.Linear): + m.bias.data.zero_() + + def forward(self, x): + out = self.conv1(x) + out = self.block1(out) + out = self.block2(out) + out = self.block3(out) + out = self.relu(self.bn1(out)) + out = F.avg_pool2d(out, 8) + out = out.view(-1, self.nChannels) + return self.fc(out) diff --git a/LessIsMore/cifar100-WRN-34-10/auto_attack.txt b/LessIsMore/cifar100-WRN-34-10/auto_attack.txt new file mode 100644 index 0000000..fb6427b --- /dev/null +++ b/LessIsMore/cifar100-WRN-34-10/auto_attack.txt @@ -0,0 +1,53 @@ +2022-02-09 17:27:21.352 [INFO] eval_pytorch::61 | [ GPU ] CUDA_VISIBLE_DEVICES: 3 +2022-02-09 17:27:21.353 [INFO] eval_pytorch::62 | [torch] Pytorch version: 1.10.1+cu113 +2022-02-09 17:27:21.353 [INFO] eval_pytorch::63 | [param] Listing hyper-parameters... +2022-02-09 17:27:21.353 [INFO] eval_pytorch::64 | [param] dataset : CIFAR100 +2022-02-09 17:27:21.354 [INFO] eval_pytorch::65 | [param] store_path : ../AWP/trades_AWP/model-best/ +2022-02-09 17:27:21.354 [INFO] eval_pytorch::66 | [param] ckpt_name : ./model-best.pt +2022-02-09 17:27:21.355 [INFO] eval_pytorch::67 | [param] norm : Linf +2022-02-09 17:27:21.355 [INFO] eval_pytorch::68 | [param] epsilon : 0.031373 +2022-02-09 17:27:25.556 [WARNING] eval_pytorch::113 | using the original data +2022-02-09 17:27:33.584 [INFO] eval_pytorch::136 | MD5 checksum: 4ee1377d9a5aef6b6ef56b4584dbdc29 +2022-02-09 17:27:33.802 [INFO] eval_pytorch::137 | SHA1 checksum: 3d5e7a611a6fddb2091ffc22a13c880ee97404b3 +2022-02-09 17:27:40.511 [INFO] other_utils:log:13 | initial accuracy: 64.32% +2022-02-09 17:29:01.672 [INFO] other_utils:log:13 | apgd-ce - 1/13 - 217 out of 500 successfully perturbed +2022-02-09 17:30:21.315 [INFO] other_utils:log:13 | apgd-ce - 2/13 - 228 out of 500 successfully perturbed +2022-02-09 17:31:40.965 [INFO] other_utils:log:13 | apgd-ce - 3/13 - 208 out of 500 successfully perturbed +2022-02-09 17:33:00.594 [INFO] other_utils:log:13 | apgd-ce - 4/13 - 228 out of 500 successfully perturbed +2022-02-09 17:34:20.216 [INFO] other_utils:log:13 | apgd-ce - 5/13 - 212 out of 500 successfully perturbed +2022-02-09 17:35:39.869 [INFO] other_utils:log:13 | apgd-ce - 6/13 - 217 out of 500 successfully perturbed +2022-02-09 17:36:59.502 [INFO] other_utils:log:13 | apgd-ce - 7/13 - 217 out of 500 successfully perturbed +2022-02-09 17:38:19.172 [INFO] other_utils:log:13 | apgd-ce - 8/13 - 219 out of 500 successfully perturbed +2022-02-09 17:39:38.856 [INFO] other_utils:log:13 | apgd-ce - 9/13 - 220 out of 500 successfully perturbed +2022-02-09 17:40:58.515 [INFO] other_utils:log:13 | apgd-ce - 10/13 - 214 out of 500 successfully perturbed +2022-02-09 17:42:18.202 [INFO] other_utils:log:13 | apgd-ce - 11/13 - 208 out of 500 successfully perturbed +2022-02-09 17:43:37.881 [INFO] other_utils:log:13 | apgd-ce - 12/13 - 226 out of 500 successfully perturbed +2022-02-09 17:44:47.721 [INFO] other_utils:log:13 | apgd-ce - 13/13 - 195 out of 432 successfully perturbed +2022-02-09 17:44:47.722 [INFO] other_utils:log:13 | robust accuracy after APGD-CE: 36.23% (total time 1027.2 s) +2022-02-09 17:55:12.870 [INFO] other_utils:log:13 | apgd-t - 1/8 - 74 out of 500 successfully perturbed +2022-02-09 18:05:32.015 [INFO] other_utils:log:13 | apgd-t - 2/8 - 79 out of 500 successfully perturbed +2022-02-09 18:16:14.741 [INFO] other_utils:log:13 | apgd-t - 3/8 - 67 out of 500 successfully perturbed +2022-02-09 18:26:45.051 [INFO] other_utils:log:13 | apgd-t - 4/8 - 71 out of 500 successfully perturbed +2022-02-09 18:37:23.960 [INFO] other_utils:log:13 | apgd-t - 5/8 - 65 out of 500 successfully perturbed +2022-02-09 18:47:39.865 [INFO] other_utils:log:13 | apgd-t - 6/8 - 82 out of 500 successfully perturbed +2022-02-09 18:58:30.122 [INFO] other_utils:log:13 | apgd-t - 7/8 - 57 out of 500 successfully perturbed +2022-02-09 19:01:17.724 [INFO] other_utils:log:13 | apgd-t - 8/8 - 15 out of 123 successfully perturbed +2022-02-09 19:01:17.725 [INFO] other_utils:log:13 | robust accuracy after APGD-T: 31.13% (total time 5617.2 s) +2022-02-09 19:17:09.257 [INFO] other_utils:log:13 | fab-t - 1/7 - 0 out of 500 successfully perturbed +2022-02-09 19:33:00.930 [INFO] other_utils:log:13 | fab-t - 2/7 - 0 out of 500 successfully perturbed +2022-02-09 19:48:52.740 [INFO] other_utils:log:13 | fab-t - 3/7 - 0 out of 500 successfully perturbed +2022-02-09 20:04:44.438 [INFO] other_utils:log:13 | fab-t - 4/7 - 0 out of 500 successfully perturbed +2022-02-09 20:20:36.484 [INFO] other_utils:log:13 | fab-t - 5/7 - 0 out of 500 successfully perturbed +2022-02-09 20:36:28.696 [INFO] other_utils:log:13 | fab-t - 6/7 - 0 out of 500 successfully perturbed +2022-02-09 20:40:21.481 [INFO] other_utils:log:13 | fab-t - 7/7 - 0 out of 113 successfully perturbed +2022-02-09 20:40:21.482 [INFO] other_utils:log:13 | robust accuracy after FAB-T: 31.13% (total time 11561.0 s) +2022-02-09 21:01:45.176 [INFO] other_utils:log:13 | square - 1/7 - 0 out of 500 successfully perturbed +2022-02-09 21:23:09.101 [INFO] other_utils:log:13 | square - 2/7 - 0 out of 500 successfully perturbed +2022-02-09 21:44:32.999 [INFO] other_utils:log:13 | square - 3/7 - 0 out of 500 successfully perturbed +2022-02-09 22:05:56.952 [INFO] other_utils:log:13 | square - 4/7 - 0 out of 500 successfully perturbed +2022-02-09 22:27:20.869 [INFO] other_utils:log:13 | square - 5/7 - 0 out of 500 successfully perturbed +2022-02-09 22:48:44.625 [INFO] other_utils:log:13 | square - 6/7 - 0 out of 500 successfully perturbed +2022-02-09 22:54:00.734 [INFO] other_utils:log:13 | square - 7/7 - 0 out of 113 successfully perturbed +2022-02-09 22:54:00.734 [INFO] other_utils:log:13 | robust accuracy after SQUARE: 31.13% (total time 19580.2 s) +2022-02-09 22:54:00.737 [INFO] other_utils:log:13 | max Linf perturbation: 0.03137, nan in tensor: 0, max: 1.00000, min: 0.00000 +2022-02-09 22:54:00.737 [INFO] other_utils:log:13 | robust accuracy: 31.13% diff --git a/LessIsMore/cifar100-WRN-34-10/wideresnet.py b/LessIsMore/cifar100-WRN-34-10/wideresnet.py new file mode 100644 index 0000000..2b9e576 --- /dev/null +++ b/LessIsMore/cifar100-WRN-34-10/wideresnet.py @@ -0,0 +1,90 @@ +import math +import torch +import torch.nn as nn +import torch.nn.functional as F + + +class BasicBlock(nn.Module): + def __init__(self, in_planes, out_planes, stride, dropRate=0.0): + super(BasicBlock, self).__init__() + self.bn1 = nn.BatchNorm2d(in_planes) + self.relu1 = nn.ReLU(inplace=True) + self.conv1 = nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, + padding=1, bias=False) + self.bn2 = nn.BatchNorm2d(out_planes) + self.relu2 = nn.ReLU(inplace=True) + self.conv2 = nn.Conv2d(out_planes, out_planes, kernel_size=3, stride=1, + padding=1, bias=False) + self.droprate = dropRate + self.equalInOut = (in_planes == out_planes) + self.convShortcut = (not self.equalInOut) and nn.Conv2d(in_planes, out_planes, kernel_size=1, stride=stride, + padding=0, bias=False) or None + + def forward(self, x): + if not self.equalInOut: + x = self.relu1(self.bn1(x)) + else: + out = self.relu1(self.bn1(x)) + out = self.relu2(self.bn2(self.conv1(out if self.equalInOut else x))) + if self.droprate > 0: + out = F.dropout(out, p=self.droprate, training=self.training) + out = self.conv2(out) + return torch.add(x if self.equalInOut else self.convShortcut(x), out) + + +class NetworkBlock(nn.Module): + def __init__(self, nb_layers, in_planes, out_planes, block, stride, dropRate=0.0): + super(NetworkBlock, self).__init__() + self.layer = self._make_layer(block, in_planes, out_planes, nb_layers, stride, dropRate) + + def _make_layer(self, block, in_planes, out_planes, nb_layers, stride, dropRate): + layers = [] + for i in range(int(nb_layers)): + layers.append(block(i == 0 and in_planes or out_planes, out_planes, i == 0 and stride or 1, dropRate)) + return nn.Sequential(*layers) + + def forward(self, x): + return self.layer(x) + + +class WideResNet(nn.Module): + def __init__(self, depth=34, num_classes=10, widen_factor=100, dropRate=0.0): + super(WideResNet, self).__init__() + nChannels = [16, 16 * widen_factor, 32 * widen_factor, 64 * widen_factor] + assert ((depth - 4) % 6 == 0) + n = (depth - 4) / 6 + block = BasicBlock + # 1st conv before any network block + self.conv1 = nn.Conv2d(3, nChannels[0], kernel_size=3, stride=1, + padding=1, bias=False) + # 1st block + self.block1 = NetworkBlock(n, nChannels[0], nChannels[1], block, 1, dropRate) + # 2nd block + self.block2 = NetworkBlock(n, nChannels[1], nChannels[2], block, 2, dropRate) + # 3rd block + self.block3 = NetworkBlock(n, nChannels[2], nChannels[3], block, 2, dropRate) + # global average pooling and classifier + self.bn1 = nn.BatchNorm2d(nChannels[3]) + self.relu = nn.ReLU(inplace=True) + self.fc = nn.Linear(nChannels[3], num_classes) + self.nChannels = nChannels[3] + + for m in self.modules(): + if isinstance(m, nn.Conv2d): + n = m.kernel_size[0] * m.kernel_size[1] * m.out_channels + m.weight.data.normal_(0, math.sqrt(2. / n)) + elif isinstance(m, nn.BatchNorm2d): + m.weight.data.fill_(1) + m.bias.data.zero_() + elif isinstance(m, nn.Linear): + m.bias.data.zero_() + + def forward(self, x): + out = self.conv1(x) + out = self.block1(out) + out = self.block2(out) + out = self.block3(out) + out = self.relu(self.bn1(out)) + out = F.avg_pool2d(out, 8) + out = out.view(-1, self.nChannels) + return self.fc(out) diff --git a/LessIsMore/imagenet-resnet50/auto_attack.txt b/LessIsMore/imagenet-resnet50/auto_attack.txt new file mode 100644 index 0000000..b103531 --- /dev/null +++ b/LessIsMore/imagenet-resnet50/auto_attack.txt @@ -0,0 +1,217 @@ +2022-07-13 04:39:02.957 [INFO] eval_imagenet::58 | [ GPU ] CUDA_VISIBLE_DEVICES: 0,1 +2022-07-13 04:39:02.957 [INFO] eval_imagenet::59 | [torch] Pytorch version: 1.11.0+cu113 +2022-07-13 04:39:02.957 [INFO] eval_imagenet::60 | [param] Listing hyper-parameters... +2022-07-13 04:39:02.958 [INFO] eval_imagenet::61 | [param] store_path : ../AWP/trades_AWP/model-best/ +2022-07-13 04:39:02.958 [INFO] eval_imagenet::62 | [param] ckpt_name : ./model-best.pt +2022-07-13 04:39:02.958 [INFO] eval_imagenet::63 | [param] norm : Linf +2022-07-13 04:39:02.958 [INFO] eval_imagenet::64 | [param] epsilon : 0.015686 +2022-07-13 04:39:22.910 [INFO] eval_imagenet::112 | MD5 checksum: a630e5141f01112d3d31f9e350e0afbd +2022-07-13 04:39:23.072 [INFO] eval_imagenet::113 | SHA1 checksum: 148e45f48cc0d10af51d98a21cc7508184bf3e29 +2022-07-13 04:39:27.466 [INFO] other_utils:log:13 | initial accuracy: 69.76% +2022-07-13 04:39:38.737 [INFO] other_utils:log:13 | apgd-ce - 1/70 - 15 out of 50 successfully perturbed +2022-07-13 04:39:49.370 [INFO] other_utils:log:13 | apgd-ce - 2/70 - 19 out of 50 successfully perturbed +2022-07-13 04:40:00.022 [INFO] other_utils:log:13 | apgd-ce - 3/70 - 17 out of 50 successfully perturbed +2022-07-13 04:40:10.693 [INFO] other_utils:log:13 | apgd-ce - 4/70 - 16 out of 50 successfully perturbed +2022-07-13 04:40:21.385 [INFO] other_utils:log:13 | apgd-ce - 5/70 - 13 out of 50 successfully perturbed +2022-07-13 04:40:32.088 [INFO] other_utils:log:13 | apgd-ce - 6/70 - 20 out of 50 successfully perturbed +2022-07-13 04:40:42.800 [INFO] other_utils:log:13 | apgd-ce - 7/70 - 12 out of 50 successfully perturbed +2022-07-13 04:40:53.518 [INFO] other_utils:log:13 | apgd-ce - 8/70 - 18 out of 50 successfully perturbed +2022-07-13 04:41:04.238 [INFO] other_utils:log:13 | apgd-ce - 9/70 - 14 out of 50 successfully perturbed +2022-07-13 04:41:14.969 [INFO] other_utils:log:13 | apgd-ce - 10/70 - 16 out of 50 successfully perturbed +2022-07-13 04:41:25.719 [INFO] other_utils:log:13 | apgd-ce - 11/70 - 15 out of 50 successfully perturbed +2022-07-13 04:41:36.451 [INFO] other_utils:log:13 | apgd-ce - 12/70 - 23 out of 50 successfully perturbed +2022-07-13 04:41:47.197 [INFO] other_utils:log:13 | apgd-ce - 13/70 - 13 out of 50 successfully perturbed +2022-07-13 04:41:57.934 [INFO] other_utils:log:13 | apgd-ce - 14/70 - 19 out of 50 successfully perturbed +2022-07-13 04:42:08.663 [INFO] other_utils:log:13 | apgd-ce - 15/70 - 17 out of 50 successfully perturbed +2022-07-13 04:42:19.403 [INFO] other_utils:log:13 | apgd-ce - 16/70 - 18 out of 50 successfully perturbed +2022-07-13 04:42:30.135 [INFO] other_utils:log:13 | apgd-ce - 17/70 - 13 out of 50 successfully perturbed +2022-07-13 04:42:40.865 [INFO] other_utils:log:13 | apgd-ce - 18/70 - 16 out of 50 successfully perturbed +2022-07-13 04:42:51.593 [INFO] other_utils:log:13 | apgd-ce - 19/70 - 16 out of 50 successfully perturbed +2022-07-13 04:43:02.320 [INFO] other_utils:log:13 | apgd-ce - 20/70 - 18 out of 50 successfully perturbed +2022-07-13 04:43:13.052 [INFO] other_utils:log:13 | apgd-ce - 21/70 - 11 out of 50 successfully perturbed +2022-07-13 04:43:23.783 [INFO] other_utils:log:13 | apgd-ce - 22/70 - 16 out of 50 successfully perturbed +2022-07-13 04:43:34.519 [INFO] other_utils:log:13 | apgd-ce - 23/70 - 15 out of 50 successfully perturbed +2022-07-13 04:43:45.251 [INFO] other_utils:log:13 | apgd-ce - 24/70 - 16 out of 50 successfully perturbed +2022-07-13 04:43:55.985 [INFO] other_utils:log:13 | apgd-ce - 25/70 - 18 out of 50 successfully perturbed +2022-07-13 04:44:06.719 [INFO] other_utils:log:13 | apgd-ce - 26/70 - 20 out of 50 successfully perturbed +2022-07-13 04:44:17.460 [INFO] other_utils:log:13 | apgd-ce - 27/70 - 23 out of 50 successfully perturbed +2022-07-13 04:44:28.194 [INFO] other_utils:log:13 | apgd-ce - 28/70 - 12 out of 50 successfully perturbed +2022-07-13 04:44:38.928 [INFO] other_utils:log:13 | apgd-ce - 29/70 - 14 out of 50 successfully perturbed +2022-07-13 04:44:49.659 [INFO] other_utils:log:13 | apgd-ce - 30/70 - 15 out of 50 successfully perturbed +2022-07-13 04:45:00.383 [INFO] other_utils:log:13 | apgd-ce - 31/70 - 13 out of 50 successfully perturbed +2022-07-13 04:45:11.114 [INFO] other_utils:log:13 | apgd-ce - 32/70 - 24 out of 50 successfully perturbed +2022-07-13 04:45:21.848 [INFO] other_utils:log:13 | apgd-ce - 33/70 - 14 out of 50 successfully perturbed +2022-07-13 04:45:32.574 [INFO] other_utils:log:13 | apgd-ce - 34/70 - 16 out of 50 successfully perturbed +2022-07-13 04:45:43.296 [INFO] other_utils:log:13 | apgd-ce - 35/70 - 13 out of 50 successfully perturbed +2022-07-13 04:45:54.025 [INFO] other_utils:log:13 | apgd-ce - 36/70 - 17 out of 50 successfully perturbed +2022-07-13 04:46:04.749 [INFO] other_utils:log:13 | apgd-ce - 37/70 - 15 out of 50 successfully perturbed +2022-07-13 04:46:15.475 [INFO] other_utils:log:13 | apgd-ce - 38/70 - 16 out of 50 successfully perturbed +2022-07-13 04:46:26.198 [INFO] other_utils:log:13 | apgd-ce - 39/70 - 19 out of 50 successfully perturbed +2022-07-13 04:46:36.929 [INFO] other_utils:log:13 | apgd-ce - 40/70 - 25 out of 50 successfully perturbed +2022-07-13 04:46:47.653 [INFO] other_utils:log:13 | apgd-ce - 41/70 - 11 out of 50 successfully perturbed +2022-07-13 04:46:58.380 [INFO] other_utils:log:13 | apgd-ce - 42/70 - 20 out of 50 successfully perturbed +2022-07-13 04:47:09.110 [INFO] other_utils:log:13 | apgd-ce - 43/70 - 19 out of 50 successfully perturbed +2022-07-13 04:47:19.840 [INFO] other_utils:log:13 | apgd-ce - 44/70 - 12 out of 50 successfully perturbed +2022-07-13 04:47:30.568 [INFO] other_utils:log:13 | apgd-ce - 45/70 - 14 out of 50 successfully perturbed +2022-07-13 04:47:41.303 [INFO] other_utils:log:13 | apgd-ce - 46/70 - 16 out of 50 successfully perturbed +2022-07-13 04:47:52.035 [INFO] other_utils:log:13 | apgd-ce - 47/70 - 16 out of 50 successfully perturbed +2022-07-13 04:48:02.763 [INFO] other_utils:log:13 | apgd-ce - 48/70 - 13 out of 50 successfully perturbed +2022-07-13 04:48:13.491 [INFO] other_utils:log:13 | apgd-ce - 49/70 - 15 out of 50 successfully perturbed +2022-07-13 04:48:24.217 [INFO] other_utils:log:13 | apgd-ce - 50/70 - 16 out of 50 successfully perturbed +2022-07-13 04:48:34.954 [INFO] other_utils:log:13 | apgd-ce - 51/70 - 14 out of 50 successfully perturbed +2022-07-13 04:48:45.686 [INFO] other_utils:log:13 | apgd-ce - 52/70 - 21 out of 50 successfully perturbed +2022-07-13 04:48:56.413 [INFO] other_utils:log:13 | apgd-ce - 53/70 - 14 out of 50 successfully perturbed +2022-07-13 04:49:07.142 [INFO] other_utils:log:13 | apgd-ce - 54/70 - 14 out of 50 successfully perturbed +2022-07-13 04:49:17.869 [INFO] other_utils:log:13 | apgd-ce - 55/70 - 21 out of 50 successfully perturbed +2022-07-13 04:49:28.605 [INFO] other_utils:log:13 | apgd-ce - 56/70 - 18 out of 50 successfully perturbed +2022-07-13 04:49:39.337 [INFO] other_utils:log:13 | apgd-ce - 57/70 - 20 out of 50 successfully perturbed +2022-07-13 04:49:50.071 [INFO] other_utils:log:13 | apgd-ce - 58/70 - 14 out of 50 successfully perturbed +2022-07-13 04:50:00.799 [INFO] other_utils:log:13 | apgd-ce - 59/70 - 18 out of 50 successfully perturbed +2022-07-13 04:50:11.525 [INFO] other_utils:log:13 | apgd-ce - 60/70 - 16 out of 50 successfully perturbed +2022-07-13 04:50:22.255 [INFO] other_utils:log:13 | apgd-ce - 61/70 - 18 out of 50 successfully perturbed +2022-07-13 04:50:32.977 [INFO] other_utils:log:13 | apgd-ce - 62/70 - 22 out of 50 successfully perturbed +2022-07-13 04:50:43.701 [INFO] other_utils:log:13 | apgd-ce - 63/70 - 14 out of 50 successfully perturbed +2022-07-13 04:50:54.429 [INFO] other_utils:log:13 | apgd-ce - 64/70 - 20 out of 50 successfully perturbed +2022-07-13 04:51:05.152 [INFO] other_utils:log:13 | apgd-ce - 65/70 - 14 out of 50 successfully perturbed +2022-07-13 04:51:15.874 [INFO] other_utils:log:13 | apgd-ce - 66/70 - 20 out of 50 successfully perturbed +2022-07-13 04:51:26.605 [INFO] other_utils:log:13 | apgd-ce - 67/70 - 21 out of 50 successfully perturbed +2022-07-13 04:51:37.335 [INFO] other_utils:log:13 | apgd-ce - 68/70 - 15 out of 50 successfully perturbed +2022-07-13 04:51:48.059 [INFO] other_utils:log:13 | apgd-ce - 69/70 - 15 out of 50 successfully perturbed +2022-07-13 04:51:57.495 [INFO] other_utils:log:13 | apgd-ce - 70/70 - 10 out of 38 successfully perturbed +2022-07-13 04:51:57.495 [INFO] other_utils:log:13 | robust accuracy after APGD-CE: 46.74% (total time 750.0 s) +2022-07-13 04:53:23.463 [INFO] other_utils:log:13 | apgd-t - 1/47 - 8 out of 50 successfully perturbed +2022-07-13 04:54:53.580 [INFO] other_utils:log:13 | apgd-t - 2/47 - 6 out of 50 successfully perturbed +2022-07-13 04:56:28.683 [INFO] other_utils:log:13 | apgd-t - 3/47 - 4 out of 50 successfully perturbed +2022-07-13 04:57:57.139 [INFO] other_utils:log:13 | apgd-t - 4/47 - 6 out of 50 successfully perturbed +2022-07-13 04:59:27.134 [INFO] other_utils:log:13 | apgd-t - 5/47 - 5 out of 50 successfully perturbed +2022-07-13 05:00:59.822 [INFO] other_utils:log:13 | apgd-t - 6/47 - 3 out of 50 successfully perturbed +2022-07-13 05:02:31.019 [INFO] other_utils:log:13 | apgd-t - 7/47 - 4 out of 50 successfully perturbed +2022-07-13 05:03:58.137 [INFO] other_utils:log:13 | apgd-t - 8/47 - 8 out of 50 successfully perturbed +2022-07-13 05:05:29.268 [INFO] other_utils:log:13 | apgd-t - 9/47 - 4 out of 50 successfully perturbed +2022-07-13 05:06:58.972 [INFO] other_utils:log:13 | apgd-t - 10/47 - 5 out of 50 successfully perturbed +2022-07-13 05:08:30.714 [INFO] other_utils:log:13 | apgd-t - 11/47 - 4 out of 50 successfully perturbed +2022-07-13 05:09:56.916 [INFO] other_utils:log:13 | apgd-t - 12/47 - 7 out of 50 successfully perturbed +2022-07-13 05:11:30.993 [INFO] other_utils:log:13 | apgd-t - 13/47 - 2 out of 50 successfully perturbed +2022-07-13 05:12:57.713 [INFO] other_utils:log:13 | apgd-t - 14/47 - 7 out of 50 successfully perturbed +2022-07-13 05:14:25.623 [INFO] other_utils:log:13 | apgd-t - 15/47 - 6 out of 50 successfully perturbed +2022-07-13 05:15:52.350 [INFO] other_utils:log:13 | apgd-t - 16/47 - 7 out of 50 successfully perturbed +2022-07-13 05:17:22.305 [INFO] other_utils:log:13 | apgd-t - 17/47 - 5 out of 50 successfully perturbed +2022-07-13 05:18:50.810 [INFO] other_utils:log:13 | apgd-t - 18/47 - 6 out of 50 successfully perturbed +2022-07-13 05:20:15.806 [INFO] other_utils:log:13 | apgd-t - 19/47 - 8 out of 50 successfully perturbed +2022-07-13 05:21:47.029 [INFO] other_utils:log:13 | apgd-t - 20/47 - 4 out of 50 successfully perturbed +2022-07-13 05:23:21.499 [INFO] other_utils:log:13 | apgd-t - 21/47 - 3 out of 50 successfully perturbed +2022-07-13 05:24:51.324 [INFO] other_utils:log:13 | apgd-t - 22/47 - 5 out of 50 successfully perturbed +2022-07-13 05:26:21.060 [INFO] other_utils:log:13 | apgd-t - 23/47 - 5 out of 50 successfully perturbed +2022-07-13 05:27:53.609 [INFO] other_utils:log:13 | apgd-t - 24/47 - 3 out of 50 successfully perturbed +2022-07-13 05:29:23.926 [INFO] other_utils:log:13 | apgd-t - 25/47 - 5 out of 50 successfully perturbed +2022-07-13 05:30:48.117 [INFO] other_utils:log:13 | apgd-t - 26/47 - 10 out of 50 successfully perturbed +2022-07-13 05:32:15.866 [INFO] other_utils:log:13 | apgd-t - 27/47 - 6 out of 50 successfully perturbed +2022-07-13 05:33:46.973 [INFO] other_utils:log:13 | apgd-t - 28/47 - 4 out of 50 successfully perturbed +2022-07-13 05:35:14.955 [INFO] other_utils:log:13 | apgd-t - 29/47 - 6 out of 50 successfully perturbed +2022-07-13 05:36:37.396 [INFO] other_utils:log:13 | apgd-t - 30/47 - 11 out of 50 successfully perturbed +2022-07-13 05:38:10.310 [INFO] other_utils:log:13 | apgd-t - 31/47 - 3 out of 50 successfully perturbed +2022-07-13 05:39:35.234 [INFO] other_utils:log:13 | apgd-t - 32/47 - 8 out of 50 successfully perturbed +2022-07-13 05:41:04.731 [INFO] other_utils:log:13 | apgd-t - 33/47 - 5 out of 50 successfully perturbed +2022-07-13 05:42:36.748 [INFO] other_utils:log:13 | apgd-t - 34/47 - 4 out of 50 successfully perturbed +2022-07-13 05:44:10.930 [INFO] other_utils:log:13 | apgd-t - 35/47 - 2 out of 50 successfully perturbed +2022-07-13 05:45:46.301 [INFO] other_utils:log:13 | apgd-t - 36/47 - 1 out of 50 successfully perturbed +2022-07-13 05:47:17.584 [INFO] other_utils:log:13 | apgd-t - 37/47 - 4 out of 50 successfully perturbed +2022-07-13 05:48:47.265 [INFO] other_utils:log:13 | apgd-t - 38/47 - 5 out of 50 successfully perturbed +2022-07-13 05:50:19.851 [INFO] other_utils:log:13 | apgd-t - 39/47 - 3 out of 50 successfully perturbed +2022-07-13 05:51:51.626 [INFO] other_utils:log:13 | apgd-t - 40/47 - 5 out of 50 successfully perturbed +2022-07-13 05:53:19.605 [INFO] other_utils:log:13 | apgd-t - 41/47 - 6 out of 50 successfully perturbed +2022-07-13 05:54:50.697 [INFO] other_utils:log:13 | apgd-t - 42/47 - 4 out of 50 successfully perturbed +2022-07-13 05:56:24.898 [INFO] other_utils:log:13 | apgd-t - 43/47 - 2 out of 50 successfully perturbed +2022-07-13 05:57:52.574 [INFO] other_utils:log:13 | apgd-t - 44/47 - 6 out of 50 successfully perturbed +2022-07-13 05:59:23.832 [INFO] other_utils:log:13 | apgd-t - 45/47 - 4 out of 50 successfully perturbed +2022-07-13 06:00:48.761 [INFO] other_utils:log:13 | apgd-t - 46/47 - 8 out of 50 successfully perturbed +2022-07-13 06:01:59.287 [INFO] other_utils:log:13 | apgd-t - 47/47 - 4 out of 37 successfully perturbed +2022-07-13 06:01:59.287 [INFO] other_utils:log:13 | robust accuracy after APGD-T: 41.92% (total time 4951.8 s) +2022-07-13 06:04:29.580 [INFO] other_utils:log:13 | fab-t - 1/42 - 0 out of 50 successfully perturbed +2022-07-13 06:06:59.972 [INFO] other_utils:log:13 | fab-t - 2/42 - 0 out of 50 successfully perturbed +2022-07-13 06:09:30.837 [INFO] other_utils:log:13 | fab-t - 3/42 - 0 out of 50 successfully perturbed +2022-07-13 06:12:01.802 [INFO] other_utils:log:13 | fab-t - 4/42 - 0 out of 50 successfully perturbed +2022-07-13 06:14:32.363 [INFO] other_utils:log:13 | fab-t - 5/42 - 0 out of 50 successfully perturbed +2022-07-13 06:17:03.178 [INFO] other_utils:log:13 | fab-t - 6/42 - 0 out of 50 successfully perturbed +2022-07-13 06:19:33.740 [INFO] other_utils:log:13 | fab-t - 7/42 - 0 out of 50 successfully perturbed +2022-07-13 06:22:04.415 [INFO] other_utils:log:13 | fab-t - 8/42 - 0 out of 50 successfully perturbed +2022-07-13 06:24:35.192 [INFO] other_utils:log:13 | fab-t - 9/42 - 0 out of 50 successfully perturbed +2022-07-13 06:27:05.945 [INFO] other_utils:log:13 | fab-t - 10/42 - 0 out of 50 successfully perturbed +2022-07-13 06:29:36.515 [INFO] other_utils:log:13 | fab-t - 11/42 - 0 out of 50 successfully perturbed +2022-07-13 06:32:07.143 [INFO] other_utils:log:13 | fab-t - 12/42 - 0 out of 50 successfully perturbed +2022-07-13 06:34:37.852 [INFO] other_utils:log:13 | fab-t - 13/42 - 0 out of 50 successfully perturbed +2022-07-13 06:37:08.500 [INFO] other_utils:log:13 | fab-t - 14/42 - 0 out of 50 successfully perturbed +2022-07-13 06:39:39.191 [INFO] other_utils:log:13 | fab-t - 15/42 - 0 out of 50 successfully perturbed +2022-07-13 06:42:09.845 [INFO] other_utils:log:13 | fab-t - 16/42 - 0 out of 50 successfully perturbed +2022-07-13 06:44:40.551 [INFO] other_utils:log:13 | fab-t - 17/42 - 0 out of 50 successfully perturbed +2022-07-13 06:47:11.368 [INFO] other_utils:log:13 | fab-t - 18/42 - 0 out of 50 successfully perturbed +2022-07-13 06:49:41.855 [INFO] other_utils:log:13 | fab-t - 19/42 - 0 out of 50 successfully perturbed +2022-07-13 06:52:12.228 [INFO] other_utils:log:13 | fab-t - 20/42 - 0 out of 50 successfully perturbed +2022-07-13 06:54:42.638 [INFO] other_utils:log:13 | fab-t - 21/42 - 0 out of 50 successfully perturbed +2022-07-13 06:57:13.023 [INFO] other_utils:log:13 | fab-t - 22/42 - 0 out of 50 successfully perturbed +2022-07-13 06:59:43.432 [INFO] other_utils:log:13 | fab-t - 23/42 - 0 out of 50 successfully perturbed +2022-07-13 07:02:13.916 [INFO] other_utils:log:13 | fab-t - 24/42 - 0 out of 50 successfully perturbed +2022-07-13 07:04:44.493 [INFO] other_utils:log:13 | fab-t - 25/42 - 0 out of 50 successfully perturbed +2022-07-13 07:07:14.901 [INFO] other_utils:log:13 | fab-t - 26/42 - 0 out of 50 successfully perturbed +2022-07-13 07:09:45.377 [INFO] other_utils:log:13 | fab-t - 27/42 - 0 out of 50 successfully perturbed +2022-07-13 07:12:15.738 [INFO] other_utils:log:13 | fab-t - 28/42 - 0 out of 50 successfully perturbed +2022-07-13 07:14:46.073 [INFO] other_utils:log:13 | fab-t - 29/42 - 0 out of 50 successfully perturbed +2022-07-13 07:17:16.518 [INFO] other_utils:log:13 | fab-t - 30/42 - 0 out of 50 successfully perturbed +2022-07-13 07:19:46.937 [INFO] other_utils:log:13 | fab-t - 31/42 - 0 out of 50 successfully perturbed +2022-07-13 07:22:17.329 [INFO] other_utils:log:13 | fab-t - 32/42 - 0 out of 50 successfully perturbed +2022-07-13 07:24:47.695 [INFO] other_utils:log:13 | fab-t - 33/42 - 0 out of 50 successfully perturbed +2022-07-13 07:27:18.017 [INFO] other_utils:log:13 | fab-t - 34/42 - 0 out of 50 successfully perturbed +2022-07-13 07:29:48.377 [INFO] other_utils:log:13 | fab-t - 35/42 - 0 out of 50 successfully perturbed +2022-07-13 07:32:18.720 [INFO] other_utils:log:13 | fab-t - 36/42 - 0 out of 50 successfully perturbed +2022-07-13 07:34:49.096 [INFO] other_utils:log:13 | fab-t - 37/42 - 0 out of 50 successfully perturbed +2022-07-13 07:37:19.480 [INFO] other_utils:log:13 | fab-t - 38/42 - 0 out of 50 successfully perturbed +2022-07-13 07:39:49.924 [INFO] other_utils:log:13 | fab-t - 39/42 - 0 out of 50 successfully perturbed +2022-07-13 07:42:20.250 [INFO] other_utils:log:13 | fab-t - 40/42 - 0 out of 50 successfully perturbed +2022-07-13 07:44:50.742 [INFO] other_utils:log:13 | fab-t - 41/42 - 0 out of 50 successfully perturbed +2022-07-13 07:47:12.512 [INFO] other_utils:log:13 | fab-t - 42/42 - 0 out of 46 successfully perturbed +2022-07-13 07:47:12.513 [INFO] other_utils:log:13 | robust accuracy after FAB-T: 41.92% (total time 11265.0 s) +2022-07-13 07:49:59.024 [INFO] other_utils:log:13 | square - 1/42 - 0 out of 50 successfully perturbed +2022-07-13 07:52:45.565 [INFO] other_utils:log:13 | square - 2/42 - 0 out of 50 successfully perturbed +2022-07-13 07:55:32.080 [INFO] other_utils:log:13 | square - 3/42 - 0 out of 50 successfully perturbed +2022-07-13 07:58:18.689 [INFO] other_utils:log:13 | square - 4/42 - 0 out of 50 successfully perturbed +2022-07-13 08:01:05.202 [INFO] other_utils:log:13 | square - 5/42 - 0 out of 50 successfully perturbed +2022-07-13 08:03:51.688 [INFO] other_utils:log:13 | square - 6/42 - 0 out of 50 successfully perturbed +2022-07-13 08:06:38.108 [INFO] other_utils:log:13 | square - 7/42 - 0 out of 50 successfully perturbed +2022-07-13 08:09:24.647 [INFO] other_utils:log:13 | square - 8/42 - 0 out of 50 successfully perturbed +2022-07-13 08:12:11.121 [INFO] other_utils:log:13 | square - 9/42 - 0 out of 50 successfully perturbed +2022-07-13 08:14:57.661 [INFO] other_utils:log:13 | square - 10/42 - 0 out of 50 successfully perturbed +2022-07-13 08:17:44.179 [INFO] other_utils:log:13 | square - 11/42 - 0 out of 50 successfully perturbed +2022-07-13 08:20:30.708 [INFO] other_utils:log:13 | square - 12/42 - 0 out of 50 successfully perturbed +2022-07-13 08:23:17.172 [INFO] other_utils:log:13 | square - 13/42 - 0 out of 50 successfully perturbed +2022-07-13 08:26:03.735 [INFO] other_utils:log:13 | square - 14/42 - 0 out of 50 successfully perturbed +2022-07-13 08:28:50.321 [INFO] other_utils:log:13 | square - 15/42 - 0 out of 50 successfully perturbed +2022-07-13 08:31:36.970 [INFO] other_utils:log:13 | square - 16/42 - 0 out of 50 successfully perturbed +2022-07-13 08:34:23.596 [INFO] other_utils:log:13 | square - 17/42 - 0 out of 50 successfully perturbed +2022-07-13 08:37:10.274 [INFO] other_utils:log:13 | square - 18/42 - 0 out of 50 successfully perturbed +2022-07-13 08:39:56.914 [INFO] other_utils:log:13 | square - 19/42 - 0 out of 50 successfully perturbed +2022-07-13 08:42:43.510 [INFO] other_utils:log:13 | square - 20/42 - 0 out of 50 successfully perturbed +2022-07-13 08:45:30.278 [INFO] other_utils:log:13 | square - 21/42 - 0 out of 50 successfully perturbed +2022-07-13 08:48:16.936 [INFO] other_utils:log:13 | square - 22/42 - 0 out of 50 successfully perturbed +2022-07-13 08:51:03.669 [INFO] other_utils:log:13 | square - 23/42 - 0 out of 50 successfully perturbed +2022-07-13 08:53:50.359 [INFO] other_utils:log:13 | square - 24/42 - 0 out of 50 successfully perturbed +2022-07-13 08:56:37.055 [INFO] other_utils:log:13 | square - 25/42 - 0 out of 50 successfully perturbed +2022-07-13 08:59:23.871 [INFO] other_utils:log:13 | square - 26/42 - 0 out of 50 successfully perturbed +2022-07-13 09:02:10.716 [INFO] other_utils:log:13 | square - 27/42 - 0 out of 50 successfully perturbed +2022-07-13 09:04:57.566 [INFO] other_utils:log:13 | square - 28/42 - 0 out of 50 successfully perturbed +2022-07-13 09:07:45.003 [INFO] other_utils:log:13 | square - 29/42 - 0 out of 50 successfully perturbed +2022-07-13 09:10:31.816 [INFO] other_utils:log:13 | square - 30/42 - 0 out of 50 successfully perturbed +2022-07-13 09:13:18.663 [INFO] other_utils:log:13 | square - 31/42 - 0 out of 50 successfully perturbed +2022-07-13 09:16:05.518 [INFO] other_utils:log:13 | square - 32/42 - 0 out of 50 successfully perturbed +2022-07-13 09:18:52.380 [INFO] other_utils:log:13 | square - 33/42 - 0 out of 50 successfully perturbed +2022-07-13 09:21:39.184 [INFO] other_utils:log:13 | square - 34/42 - 0 out of 50 successfully perturbed +2022-07-13 09:24:26.099 [INFO] other_utils:log:13 | square - 35/42 - 0 out of 50 successfully perturbed +2022-07-13 09:27:13.124 [INFO] other_utils:log:13 | square - 36/42 - 0 out of 50 successfully perturbed +2022-07-13 09:30:00.064 [INFO] other_utils:log:13 | square - 37/42 - 0 out of 50 successfully perturbed +2022-07-13 09:32:47.006 [INFO] other_utils:log:13 | square - 38/42 - 0 out of 50 successfully perturbed +2022-07-13 09:35:33.912 [INFO] other_utils:log:13 | square - 39/42 - 0 out of 50 successfully perturbed +2022-07-13 09:38:20.888 [INFO] other_utils:log:13 | square - 40/42 - 0 out of 50 successfully perturbed +2022-07-13 09:41:07.571 [INFO] other_utils:log:13 | square - 41/42 - 0 out of 50 successfully perturbed +2022-07-13 09:43:44.616 [INFO] other_utils:log:13 | square - 42/42 - 0 out of 46 successfully perturbed +2022-07-13 09:43:44.616 [INFO] other_utils:log:13 | robust accuracy after SQUARE: 41.92% (total time 18257.1 s) +2022-07-13 09:43:44.649 [INFO] other_utils:log:13 | max Linf perturbation: 0.01569, nan in tensor: 0, max: 1.00000, min: 0.00000 +2022-07-13 09:43:44.649 [INFO] other_utils:log:13 | robust accuracy: 41.92%