QGFace: Quality-Guided Joint Training For Mixed-Quality Face Recognition

January 19, 2024 · View on GitHub

Official repository for QGFace: Quality-Guided Joint Training For Mixed-Quality Face Recognition

Installation

conda create --name qgface
pip install -r requirements.txt

Train

  • We follow AdaFace to take BGR images in training and evaluation. The datasets downloaded from ArcFace is recommended. Other training datasets could check the ContrastDataset in dataset.record_dataset.py. Other evaluation datasets could check the ListDataset in validation.validation_lq.data_utils.py.

  • We take hydra to configure our project. This makes the experiments more trackable. The entrance is simple and configurable.

    python main.py trainer.num_nodes=2

  • [IMPORTANT NOTICE FROM ADAFACE] Note that our implementation assumes that input to the model is BGR color channel as in cv2 package. InsightFace models assume RGB color channel as in PIL package. So all our evaluation code uses BGR color channel with cv2 package.

Validation

  • We take the .rec file to apply validation instead of the memfile in AdaFace.
  • We incorporate IJB-B, SCface into the whole framework and make them as a regular validation dataset. It gets rid of the offline evaluation script.
  • This asks for compressing them at first. To assure the order of images is the same used for accuracy calculation and compression, it should be applied on the training machine. An example of Tinyface is shown below. For SCface, as it needs identity label, a lab_func is necessary.
from validation.validation_lq import tinyface_helper
from dataset import convert

tinyface_image_paths = tinyface_helper.get_all_files(
    os.path.join(
        cfg.validation.tinyface.data_root,
        cfg.validation.tinyface.aligned_dir,
    )
)
lab_func = None
convert.make_rec(tinyface_image_paths, cfg.validation.tinyface.data_root, lab_func, dataset_name='tinyface', is_origin=True)

Comparing with AdaFace on different Ablation

SettingAugmentationQSCLSCface d1SCface d2SCface d3TinyfaceIJB-BHQ Avg.All Avg.
Baseline61.6997.2399.8563.9890.2695.6284.77
AAdaFace66.7799.08100.067.4974.0795.7683.86
BAdaFace68.1598.46100.067.0370.4595.7383.30
CAdaFace70.9298.6299.6966.5890.5995.7187.02
DOurs92.3199.54100.069.8591.0595.4391.36

Comparing with other resolution-invariant methods on SCface

Methodd1d2d3
T-C45.1085.9096.10
FAN62.0090.0094.00
RAN70.5096.0098.00
FAN-FT77.5095.0098.30
S. -C. Laiet al.79.7095.7098.20
RAN-FT81.3097.8098.80
NPT-Loss85.6999.0899.08
DDL86.8098.3098.30
S. S. Khalidet al.88.3098.3098.60
Ours92.3199.54100.0

Comparing with other resolution-invariant methods on Tinyface

MethodRank-1 accuracy
QualNet50-LM35.54
MobileFaceNet48.70
T-C58.60
URL63.89
MIND-Resnet-50-FT66.82
S. S. Khalidet al.70.40
CurricularFace*63.68
AdaFace*68.21
AdaFace63.98
Ours69.85

Acknowledgement

  • InsightFace provides datasets and the fundamental ArcFace loss.
  • AdaFace provides elegant code and new view to incorporate image quality.
  • Paper-Writing-Tips provides many tips for paper writing.

We hope more methods focusing on low-quality face recognition could open their codes and promote the development of the community.