【实验代码】Implementation of FGSM and PGD

AI-Adversarial-Attacks

This repository contains the implementation of Fast Gradient Sign Method (FGSM) and Projected Gradient Descent (PGD) and analysis.

The purpose of using the adversarial attacks was to fool LeNet to incorrectly classify MNIST data to an untargeted attack label with small perturbations in the image.

FGSM was taken from PyTorch’s documentation here: click

References:
Explaining and Harnessing Adversarial Examples
Adversarial examples in the physical world

FGSM

Fast Gradient Sign Method
快速梯度符号方法

PGD)

Projected Gradient Descent
投影梯度下降

LeNet

Discussion

PGD performs much better than FGSM, mostly because PGD allows more extreme perturbations with the given hyperparameter values. Note that the samples used to evaluate FGSM is not the same as the samples used to evaluate PGD, so the accuracies are not an apples to apples comparison. If alpha or epsilon was smaller, PGD might result similar accuracy to FGSM.
在这里插入图片描述

Reference Links

AI-Adversarial-Attacks

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
FGSM(Fast Gradient Sign Method)是一种用于对抗样本生成的攻击方法。它通过在原始输入数据上添加一个微小的幅度扰动,以便欺骗机器学习模型。FGSM的思想是利用梯度信息来计算出对抗样本。具体来说,它计算出使损失函数最大化的输入扰动,然后将该扰动添加到原始输入中,从而生成对抗样本。 I-FGSM(Iterative Fast Gradient Sign Method)是对FGSM的改进。与FGSM只进行一次扰动不同,I-FGSM通过迭代的方式进行多次扰动来生成对抗样本。在每次迭代中,利用当前生成的对抗样本计算梯度,然后使用梯度信息来更新对抗样本。通过多次迭代,I-FGSM可以生成更强的对抗样本,提高攻击成功率。 PGD(Projected Gradient Descent)也是一种改进的对抗样本生成方法。PGD与I-FGSM类似,都是通过迭代方式生成对抗样本。不同之处在于,PGD在每次迭代中,会对生成的对抗样本进行投影,确保其在一定的距离范围内。这样做的目的是防止生成的对抗样本偏离原始输入太远,保持样本的可接受性。通过投影操作,PGD可以生成较为强鲁棒的对抗样本。 总结来说,FGSM是一种简单而快速的对抗样本生成方法,而I-FGSMPGD则是对其的改进,通过迭代生成更强鲁棒的对抗样本。这些对抗样本生成方法的应用可以帮助我们了解和提升机器学习模型的安全性,从而更好地保护数据和系统的安全。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Bosenya12

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值