/ChaLearn_liveness_challenge

ChaLearn Face Anti-spoofing Attack Detection Challenge@CVPR2019

Primary LanguagePythonMIT LicenseMIT

Solution for ChaLearn Face Anti-spoofing Attack Detection Challenge @ CVPR2019 by a.parkin (VisionLabs)

Alt text

Our method uses a modified network architecture in [1]. As shown on image, the RGB, Depth and IR inputs are processed by separate streams followed by the concatenation and fully-connected layers. Differently from [1] we use aggregation blocks (Agg res2, ...) to aggregate outputs from multiple layers of the network. We pre-train network weights on four different tasks for face recognition and gender recognition. We then fine- tune these networks separately on the training set of the CASIA-SURF face anti-spoofing dataset. To increase the robustness to various attacks, we ensemble networks trained on three training folds and with two initial seeds. Results of our models evaluated separately and in combination are illustrated in table.

NN1 NN1a NN2 NN3 NN4 seed Val trp@fpr=10e-4 Test trp@fpr=10e-4
✔️ 0.9943
✔️ 0.9987
✔️ 0.9870
✔️ 0.9963
✔️ 0.9933
✔️ ✔️ 0.9963
✔️ ✔️ ✔️ 0.9983
✔️ ✔️ ✔️ ✔️ 0.9997
✔️ ✔️ ✔️ ✔️ ✔️ 1.0000
✔️ ✔️ ✔️ ✔️ ✔️ 1.0000 0.9988

References

[1] Shifeng Zhang, Xiaobo Wang, Ajian Liu, Chenxu Zhao, Jun Wan, Ser- gio Escalera, Hailin Shi, Zezheng Wang, Stan Z. Li, ”CASIA-SURF: A Dataset and Benchmark for Large-scale Multi-modal Face Anti-spoofing”, arXiv, 2018.

Environment

Сreating the conda environment and installing the required libraries

conda create --name python3 --file spec-file.txt;
conda activate python3;
pip install -r requirements.txt

Train

Used pretrained models for face or gender recognition

Exp. Name Model architecture Train description Architecture Weights
exp1_2stage resnet caffe34 CASIA, sphere loss MCS2018 Google Drive
exp2 resnet caffe34 Gender classifier on AFAD-Lite ./attributes_trainer Google Drive
exp3b IR50 MSCeleb, arcface face.evoLVe.PyTorch Google Drive
exp3c IR50 asia(private) dataset, arcface face.evoLVe.PyTorch Google Drive

Step 1 (can be skipped)

Download all pretrained models (Google Drive) and challenge train/val/test data

Step 2 (can be skipped)

Download AFAD-Lite and train a model for gender recognition task

Step 3 (can be skipped)

Train models:

  • exp1
  • exp2
  • exp3b
  • exp3c

or run train.sh

Inference

Step 1 (can be skipped)

Step 1.1

Change data_root path in datasets/init_dataloader.py:23

Step 1.2

Run all prepaired models from data/opts/ and use inference.py or inference.sh

Step 2

ensemble all results

python ensemble.py