Home

Awesome

Sphere Confidence Face (SCF)

This repository contains the PyTorch implementation of Sphere Confidence Face (SCF) proposed in the CVPR2021 oral paper:

Shen Li, Jianqing Xu, Xiaqing Xu, Pengcheng Shen, Shaoxin Li, and Bryan Hooi. Spherical Confidence Learning for Face Recognition, IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) 2021 (Oral).

Appendices can be found here: Appendices.

<p align="center"> <img src="scf_illustr.png" title="roc" width="850" /> </p>

Empirical Results

IJB-BResNet100 1e-5ResNet100 1e-4IJB-CResNet100 1e-5ResNet100 1e-4
CosFace89.8194.59CosFace93.8695.95
+ PFE-G89.9694.64+ PFE-G94.0996.04
+ PFE-vN/AN/A+ PFE-vN/AN/A
+ SCF-G89.9794.56+ SCF-G94.1596.02
+ SCF91.0294.95+ SCF94.7896.22
ArcFace89.3394.20ArcFace93.1595.60
+ PFE-G89.5594.30+ PFE-G92.9595.32
+ PFE-vN/AN/A+ PFE-vN/AN/A
+ SCF-G89.5294.24+ SCF-G93.8595.33
+ SCF90.6894.74+ SCF94.0496.09

Requirements

Getting Started

Training

Training consists of two separate steps:

  1. Train ResNet100 imported from backbones.py as the deterministic backbone using spherical loss, e.g. ArcFace loss.
  2. Train SCF based on the pretrained backbone by specifying the arguments including [GPU_IDS], [OUTPUT_DIR], [PATH_BACKBONE_CKPT] (the path of the pretrained backbone checkpoint) and [PATH_FC_CKPT] (the path of the pretrained fc-layer checkpoint) and then running the command:
python train.py \
    --dataset "ms1m" \
    --seed 777 \
    --gpu_ids [GPU_IDS] \
    --batch_size 1024 \
    --output_dir [OUTPUT_DIR] \
    --saved_bkb [PATH_BACKBONE_CKPT] \
    --saved_fc [PATH_FC_CKPT] \
    --num_workers 8 \
    --epochs 30 \
    --lr 3e-5 \
    --lr_scheduler "StepLR" \
    --step_size 2 \
    --gamma 0.5 \
    --convf_dim 25088 \
    --z_dim 512 \
    --radius 64 \
    --max_grad_clip 0 \
    --max_grad_norm 0 \
    --tensorboard

Test

IJB benchmark: use $\kappa$ as confidence score for each face image to aggregate representations as in Eqn (14). Refer to the standard IJB benchmark for implementation.

1v1 verification benchmark: use Eqn (13) as the similarity score.

Other Implementations

SCF in TFace: SCF

Citation

@inproceedings{li2021spherical,
  title={Spherical Confidence Learning for Face Recognition},
  author={Li, Shen and Xu, Jianqing and Xu, Xiaqing and Shen, Pengcheng and Li, Shaoxin and Hooi, Bryan},
  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  pages={15629--15637},
  year={2021}
}