fgsm专题

【对抗样本】【FGSM】Explaining and Harnessing Adversarial Examples 代码复现

简介 参考Pytorch官方的代码Adversarial Example Generation 参数设置(main.py) # 模型选择:GPUdevice = 'mps' if torch.backends.mps.is_available() else 'cpu'# 数据集位置dataset_path = '../../../Datasets'batch_size =

FGSM方法生成交通信号牌的对抗图像样本

背景: 生成对抗样本,即扰动图像,让原本是“停车”的信号牌识别为“禁止驶入” 实验准备 模型:找一个训练好的,识别交通信号牌的CNN模型,灰度图像 模型地址:GitHub - Daulettulegenov/TSR_CNN: Traffic sign recognition 数据:Chinese Traffic Sign Database(CTSDB) 当下最受欢迎的国内交通标

FGSM(Fast Gradient Sign Method)算法源码解析

论文链接:https://arxiv.org/abs/1412.6572 源码出处:https://github.com/Harry24k/adversarial-attacks-pytorch/tree/master 源码 import torchimport torch.nn as nnfrom ..attack import Attackclass FGSM(Attack):r""

FGSM快速梯度符号法非定向攻击代码(PyTorch)

数据集:手写字体识别MNIST 模型:LeNet import torch.nn as nnimport torch.nn.functional as Fimport torchfrom torchvision import datasets, transformsimport matplotlib.pyplot as pltuse_cuda = Truedevice = torc