Skip to content

Added DPA_VMI_FGSM Transfer Attack - #7

Open
SaxenaAmogh wants to merge 2 commits into
AItruste:mainfrom
SaxenaAmogh:main
Open

Added DPA_VMI_FGSM Transfer Attack#7
SaxenaAmogh wants to merge 2 commits into
AItruste:mainfrom
SaxenaAmogh:main

Conversation

@SaxenaAmogh

Copy link
Copy Markdown

Summary

This PR adds an implementation of the DPA_VMI (Dual-Perspective Transformation & Variance-Tuned Momentum) transfer attack to the face recognition transfer attack framework.

Paper basis:

  • "Enhancing the Transferability of Adversarial Attacks through Variance Tuning" (CVPR 2021), Wang et al.
  • "Improving the Transferability of Adversarial Attacks on Face Recognition with Diverse Parameters Augmentation" (CVPR 2025)

Changes

  • Implemented dpa_vmi() in core/transfer_attack_core.py
  • Added TensorFlow implementation of Nesterov Accelerated Gradient lookahead and DPA hard-anchor projective perspective batch transformations
  • Added VMI variance estimation across $N=8$ noisy neighbor states around candidate lookahead states (v = avg_neighbor_grad - cur_grad)
  • Added Translation-Invariant (TI) depthwise 2D Gaussian kernel spatial smoothing (tf.nn.depthwise_conv2d)
  • Adapted the attack objective from image classification to face verification by using the repository's existing embedding similarity loss (compute_embedding() + attack_loss())
  • Added DPA_VMI to ALL_ATTACKS
  • Added the corresponding output column ('DPA_VMI': 'dpa_vmi_path') to ATTACK_COLS
  • Connected the attack through run_attack()

Notes

  • Only core/transfer_attack_core.py has been modified, following the Assignment 4 submission guidelines.
  • The implementation preserves the core optimization pipeline of VMI & DPA, including:
    • Nesterov lookahead momentum trajectory
    • DPA projective perspective transform batching
    • Neighborhood variance tuning estimation
    • Gaussian Conv2D spatial translation-invariance smoothing
    • Iterative adversarial update under $L_\infty$ constraint ($\epsilon = 0.062$)
  • The primary algorithmic adaptation replaces original classification loss with the repository's embedding similarity objective to support both impersonation and dodging attacks.

Evaluation Results (docs/subset_input_pairs.csv):

Attack Breach Rate (%) Impact Mean
DPA_VMI 37.92 0.2101
SI_NI_FGSM 29.17 0.1755
MI_FGSM 26.67 0.1643
MI_ADMIX_DI_TI 24.17 0.1534
TI_FGSM 20.42 0.1313
PGD 16.67 0.1002

DPA_VMI breakdown:

Goal Breach Rate (%) Impact Mean
Dodging 47.08 0.2652
Impersonation 28.75 0.1549

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant