dvlab-research / LBGAT

Learnable Boundary Guided Adversarial Training (ICCV2021)
https://arxiv.org/abs/2011.11164
MIT License
34 stars 2 forks source link

Could you show your code on Tiny-ImageNet dataset? #7

Open KululuMi opened 2 years ago

KululuMi commented 2 years ago

Hello, I'm very surprised to see your work, which is simple but effective. However, when I coded your method on tiny-imagenet dataset, I met some trouble, the robust acc and natural acc always 0.01. So could you show your code on Tiny-ImageNet dataset? Thanks a lot.

jiequancui commented 2 years ago

Hi, thanks for your question.

You may need to set a smaller learning rate for tiny-imagenet.

KululuMi commented 2 years ago

Thank you! By the way, I set lr=0.1, batch size m = 128, and number of training epochs 100 with transition epochs {75, 90} on the training dataset. And here is my transforms: transform_train = transforms.Compose([ transforms.RandomCrop(32, padding=4), transforms.RandomHorizontalFlip(), transforms.ToTensor(), ]) transform_test = transforms.Compose([ transforms.Resize(32), transforms.ToTensor(), ]) Could you tell me which hyper-parameters need to be modified?

jiequancui commented 2 years ago

Hi,

(1) for transformations, train_dataset = datasets.ImageFolder( traindir, transforms.Compose([ transforms.Resize(32), transforms.RandomHorizontalFlip(), transforms.ToTensor(), ]))

test_loader = torch.utils.data.DataLoader( datasets.ImageFolder(valdir, transforms.Compose([ transforms.Resize(32), transforms.ToTensor(), ])), batch_size=args.batch_size, shuffle=False, num_workers=4, pin_memory=True)

(2) we use WideResNet-34-10 and the teacher model WideResNet-34-10.

Other hyper-parameters keep the same with CIFAR. You can have a try with this setting. We can talk about it further if it still can not work well.

KululuMi commented 2 years ago

@jiequancui Thanks for your help, but I have followed your transformations and teacher model setting, and robust/clean acc still is 0.01 when epoch =21. My torch==1.9.0, is there anything else I can do?

jiequancui commented 2 years ago

Hi,

Let me check it.