2025Adversarial Diffusion for Fraud Defense

Diff AI Attacks

Using diffusion models (DDPMs) to make fraud detectors tougher against evasion and data poisoning attacks.

Banks lean on machine learning to catch fraud in real time, but those models can be fooled by adversarial attacks. I wanted to see if diffusion models could both stress-test a detector and clean up malicious inputs, without constantly retraining it on new attacks.

On the IEEE-CIS Fraud Detection dataset, I used Diff-PGD (diffusion-based projected gradient descent) to generate realistic adversarial examples, then TabDiff reverse diffusion to pull tampered inputs back toward clean data. Robustness improved while the detector kept its 96% ROC-AUC baseline.

01

TabDiff Diffusion Model Training

Trained TabDiff on fraud samples in a PCA-reduced feature space with 500 denoising steps and EDM (Elucidating Diffusion Models) sampling. Rare-class generation tends to collapse onto a few modes, so I added distribution-aware training with contrastive learning and regularization. The result was realistic synthetic fraud that keeps the relationships between mixed-type tabular features.

02

Adversarial Attack & Purification

For attacks, Diff-PGD kept adding TabDiff-style noise on a PowerMean schedule (σ: 0.002 → 80) until XGBoost flipped its prediction to 'Safe'. For defense, TabDiff reverse diffusion maps those tampered inputs back to the clean data manifold, with no gradients needed at inference time.

03

Robustness Evaluation & Model Hardening

Retrained the detectors on three setups: original data only (baseline), original + synthetic fraud, and original + synthetic + adversarial (with adversarial samples weighted 3×). Judged by AUC-ROC, precision, recall, and F1, the hardened models generalized better to new evasion attacks and still matched baseline performance on clean data.

Got a 96% ROC-AUC baseline with XGBoost, SMOTE, and random undersampling, which became the benchmark to attack and defend.

Generated 1000+ realistic synthetic fraud samples with TabDiff in PCA space (500 denoising steps, EDM sampling), using distribution-aware training and contrastive learning to deal with how rare fraud is.

Built an attack pipeline with Diff-PGD and a PowerMean noise schedule (σ: 0.002 → 80) to create sneaky adversarial samples, then a TabDiff reverse-diffusion defense that cleans them up without computing any gradients at defense time.

What surprised me was that diffusion helps on both sides of the fight: generating hard fraud examples and cleaning up adversarial inputs without retraining the detector. It got really fun once I saw that generation and purification rely on the same idea of a clean data manifold.