Views
No views yet
| File | Architecture | Task | Best Accuracy |
|---|---|---|---|
resnet18_cifar10_best.pt | ResNet-18 (CIFAR adapted) | 10-class classification | 94.68% val acc |
detector_BIM_best.pt | ResNet-34 (CIFAR adapted) | BIM adversarial detector (binary) | 99.57% detection acc |
detector_PGD_best.pt | ResNet-34 (CIFAR adapted) | PGD adversarial detector (binary) | 99.93% detection acc |
| ε | FGSM-Scratch | FGSM-ART | Drop (Scratch) |
|---|---|---|---|
| 0.01 | 48.70% | 52.55% | 45.55% |
| 0.05 | 33.80% | 35.90% | 60.45% |
| 0.10 | 16.80% | 17.45% | 77.45% |
| 0.30 | 9.90% | 9.95% | 84.35% |
1import torch
2import torch.nn as nn
3from torchvision import models
4
5def build_resnet18():
6 m = models.resnet18(pretrained=False)
7 m.conv1 = nn.Conv2d(3, 64, kernel_size=3, stride=1, padding=1, bias=False)
8 m.maxpool = nn.Identity()
9 m.fc = nn.Linear(m.fc.in_features, 10)
10 return m
11
12model = build_resnet18()
13state = torch.load("resnet18_cifar10_best.pt", map_location="cpu")
14model.load_state_dict(state)
15model.eval()