Gradient Alignment for Cross-Domain Face Anti-Spoofing

April 18, 2025 · View on GitHub

The IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) 2024
[paper]

GitHub top languageGitHub last commitGitHub repo size

Overview

overall pipeline

1. Installation

  • Ubuntu 18.04.5 LTS
  • CUDA 11.3
  • Python 3.6.12
  • pytorch == 1.10.1

2. Dataset

Data pre-processing: Follow the preprocessing steps in SAFAS.

3. Training

3.1 Running

Our implementaion of GAC-FAS is in optimizers/gacfas.py

Update configuration file and start training ICM2O by:

python train.py --config ./configs/ICM2O.yaml

Pre-trained weights are released.

3.2 Bag of tricks

Please consider following parameters while runing as it affects on final results (See our Suppl.)

  • Random seed
  • Leaning rate decay steps (40, 5)
  • FC learning rate scale (1, 10)
  • Logit scale (12, 16, 32)
  • Weight decay (1e-4, 5e-4, 6e-4)
  • ERM losses (BCE, CE: OMI2C)
  • Color Jitter may help
  • Balanced live vs. spoof data loader may help (only for OCI2M)
  • Larger lr may help (1e-2: OMI2C)

3.3 Snapshot resutls

MethodsICM2OOCM2IOCI2MOMI2C
HTERAUCHTERAUCHTERAUCHTERAUC
MMD-AAE40.9863.0831.5875.1827.0883.1944.5958.29
MADDG27.9880.0222.1984.9917.6988.0624.5084.51
RFM16.4591.1617.3090.4813.8993.9820.2788.16
SSDG-M25.1781.8318.2194.6116.6790.4723.1185.45
SSDG-R15.6191.5411.7196.597.3897.1710.4495.94
D2AM15.2790.8715.4391.2212.7095.6620.9885.58
SDA23.1084.3015.6090.1015.4091.8024.5084.40
DRDG15.6391.7515.5691.7912.4395.8119.0588.79
ANRL15.6791.9016.0391.0410.8396.7517.8589.26
SSAN13.7293.638.8896.796.6798.7510.0096.67
AMEL11.3193.9618.6088.7910.2396.6211.8894.39
EBDG15.6692.0218.6992.289.5697.1718.3490.01
PathNet11.8295.0713.4095.677.1098.4611.3394.58
IADG8.8697.1410.6294.505.4198.198.7096.40
SA-FAS10.0096.236.5897.545.9596.558.7895.37
UDG-FAS10.9795.365.8698.625.9598.479.8296.76
GAC-FAS (ours)8.60 (0.28)97.16 (0.40)4.29 (0.83)98.87 (0.60)5.00 (0.00)97.56 (0.06)8.20 (0.43)95.16 (0.09)

4. Landscape visualization

[paper][code][software]

overall pipeline

Star (⭐) if you find it useful, and consider to cite our work

Citation

@inproceedings{le2024grad,
  title={Gradient Alignment for Cross-Domain Face Anti-Spoofing},
  author={Le, Binh M and Woo, Simon S},
  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year={2024},
  pages={188--199},
}