• 频域中的后门攻击论文笔记


    文章一:Rethinking the Backdoor Attacks’ Triggers: A Frequency Perspective

    文章贡献:

    • 在频域上对现有的 backdoor trigger 进行分析,发现常见 trigger 存在 high-frequency artifacts 的问题。
    • 对这些 artifacts 进行了详细的分析
    • 展示了在频域空间中检测 trigger 的有效性
    • 提出了一种方法,生成不具有 high-frequency artifacts 的 trigger ,并且对其的可检测性进行了分析

    Frequency Artifacts

    作者通过 type-II 2D-DCT 变换,将图片从空域转换到频域。

    在这里插入图片描述

    Analyzing Causes of High-Frequency Artifacts

    • Local Patching

      By the linearity of DCT, adding a trigger to an image is equivalent to adding the trigger’s frequency spectrum to the image’s spectrum.

    • Large-Size or Global Patching

      相邻像素之间相关性降低,触发器携带的高频信息

    • GAN-Generated Backdoor Data

      GAN中使用的上采样导致 high-frequency artifacts (引用文章

    Frequency-Based Backdoor Data Detection

    关于使用频域信息进行防御,未阅读。

    Creating Smooth Triggers

    • 问题定义:

      min ⁡ δ Σ i L ( x i + δ , y tar  ; θ p ) + λ Ω ( δ ; g ) \min _{\delta} \Sigma_{i} L\left(x_{i}+\delta, y_{\text {tar }} ; \theta_{p}\right)+\lambda \Omega(\delta ; g) minδΣiL(xi+δ,ytar ;θp)+λΩ(δ;g),
      s.t. x i + δ ⏟ i = 1 , … , N ∈ [ 0 , 1 ] n \quad \underbrace{x_{i}+\delta}_{i=1, \ldots, N} \in[0,1]^{n} i=1,,N xi+δ[0,1]n,

      We adopt Ω ( ⋅ ; g ) \Omega(\cdot ; g) Ω(;g) from SmoothFool

      θ p = argmin ⁡ θ ( Σ i L ( x i , y i ; θ ) + Σ j L ( x j + δ , y t a r ; θ ) ) \theta_{p}=\operatorname{argmin}_{\theta}\left(\Sigma_{i} L\left(x_{i}, y_{i} ; \theta\right)+\Sigma_{j} L\left(x_{j}+\delta, y_{t a r} ; \theta\right)\right) θp=argminθ(ΣiL(xi,yi;θ)+ΣjL(xj+δ,ytar;θ))

      关于 trigger 的生成,文中采用了:每一次迭代后,将扰动通过低通滤波器再更新触发器。 (pdf)

    • 因此生成 trigger 的公式变为:

      min ⁡ r Σ i L ( x i p o i , y t a r ; θ p o i ) \min _{r} \Sigma_{i} L\left(x_{i}^{p o i}, y_{t a r} ; \theta_{p o i}\right) minrΣiL(xipoi,ytar;θpoi),
      s.t. r = δ ∗ g r=\delta * g r=δg,
      x i p o i = M ( x i + λ r ) ⏟ i = 1 , … , N \underbrace{x_{i}^{p o i}=M\left(x_{i}+\lambda r\right)}_{i=1, \ldots, N} i=1,,N xipoi=M(xi+λr),

      • 其中 r r r 为扰动与低通滤波器卷积后的结果。
      • M M M 代表标准化的过程,让 posion image 限制到 [0, 1]
      • 标准化可以更好地保持像素间的比例
    • 生成 trigger 的可视化

    在这里插入图片描述

    由图所示,High-Frequency Artifacts 减少了。

    但是生成的 trigger 有点发绿,看起来效果一般般

    文章二:Backdoor Attack through Frequency Domain

    • Backdoor Attack through Frequency Domain

    在这里插入图片描述

    五个步骤:

    1. color channel transform from RGB to YUV
    2. discrete cosine transform from spatial domain to frequency domain
    3. trigger generation in the frequency domain
    4. inverse discrete cosine transform from frequency domain to spatial domain
    5. color channel transform from YUV to RGB

    FFT:

    幅度谱(amplitude spectrum)与相位谱(phase spectrum)

  • 相关阅读:
    【一生一芯】Chap.0 IC常用网站论坛门户 & 如何提出一个技术问题 并尝试解决 | 提问的智慧
    node版本管理器nvm安装及切换
    python数据分析-matplotlib绘制折线图
    【计算机网络】第一章——计算机概述(上篇)
    将c、c++变为python
    Java之异常
    【云原生 | Kubernetes 系列】---Consul 安装配置
    Linxu学习——上
    QWEN technical report
    Python与pycharm-----windows安装与运行
  • 原文地址:https://blog.csdn.net/weiyuxin107/article/details/127981864