Skip to content

LSIbabnikz/AI-KD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI-KD: Towards Alignment Invariant Face Image Quality Assessment Using Knowledge Distillation

Official repository of "AI-KD: Towards Alignment Invariant Face Image Quality Assessment Using Knowledge Distillation" presented at IWBF 2024.

Table of Contents

1. Method Overview

1.1 Abstract

Face Image Quality Assessment (FIQA) techniques have seen steady improvements over recent years, but their performance still deteriorates if the input face samples are not properly aligned. This alignment sensitivity comes from the fact that most FIQA techniques are trained or designed using a specific face alignment procedure. If the alignment technique changes, the performance of most existing FIQA techniques quickly becomes suboptimal. To address this problem, we present in this paper a novel knowledge distillation approach, termed AI-KD that can extend on any existing FIQA technique, improving its robustness to alignment variations and, in turn, performance with different alignment procedures. To validate the proposed distillation approach, we conduct comprehensive experiments on 6 face datasets with 4 recent face recognition models and in comparison to 7 state-of-the-art FIQA techniques. Our results show that AI-KD consistently improves performance of the initial FIQA techniques not only with misaligned samples, but also with properly aligned facial images. Furthermore, it leads to a new state-of-the-art, when used with a competitive initial FIQA approach.


1.2 Methodology

Methodology image

Overview of the proposed Alignment Invariant Knowledge Distillation (AI-KD) process. The proposed approach trains a quality-regression model, consisting of a FR backbone $M^s$ and a quality regression head $MLP$, on quality labels $q_i$ extracted using any existing FIQA approach. Training samples $\hat{x}_i$ are (mis)aligned on the fly, by perturbing the correct landmark $k^{pts}_i$ of the initial unaligned face samples $\ddot{x}_i$. Additionally, to ensure robustness to alignment variations in the distilled model, we design a distillation objective that ensures consistency between representations of the aligned $e_i$ and (mis)aligned images $\hat{e}_i$, as well as matching the predicted quality scores $\hat{q}_i$ to the quality labels $q_i$.


1.3 Results

SOTA proper

COMPARISON WITH STATE-OF-THE-ART – PROPERLY ALIGNED SAMPLES.

SOTA misalign

COMPARISON WITH THE STATE-OF-THE-ART – MISALIGNED SAMPLES.

2. Running the Code

2.1 Environment Setup

We strongly suggest using Conda to setup the necessary environment.

  1. Create and activate a new conda environment: conda create -n aikd python=3.10

  2. Activate the environment: conda activate aikd

  3. Install PyTorch using (use appropriate version of CUDA): conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia

  4. Install other needed libraries:
    numpy, scipy, pillow, tqdm, wandb, einops, opencv, skimage


2.2 Inference

To perform quality score inference you will need to either train your own AI-KD model as described below or download the pretrained models used in the paper, available here.

Once you have an AI-KD model you can alter the inference script ./configs/inference_config.yaml.

  • Alter the image folder location (dataset.loc) to point to the dataset for which you want to extract quality scores.

  • Possibly alter the used model (model.config and model.weight).

  • Alter the save location (base.save_path) to the location where you want to save the extracted quality scores.

Once you have configured the parameters run the inference script.

python3 inference.py -c ./configs/inference_config.yaml


2.3 Training

To train an AI-KD quality regression model first download:

  • The VGGFace2 quality scores extracted using DifFIQA(R) and the extracted VGGFace2 face detections from here and place them in "./data".

  • Additionally download the pretrained weights of the teacher ResNet100 CosFace model available here.

Then configure the training configuration file ./configs/train_config.yaml.

  • Alter the save location (save_path) where you wish to save the trained model.

  • Alter the dataset image location (image_loc) to point to the cropped VGGFace2 dataset.

  • You are free to alter also the rest of the provided configuration parameters, at your own risk.

Once you have configured the parameters run the training script.

python train_main.py -c ./configs/train_config.yaml

3. Citation

If you use any of the code provided in this repository or find this research useful, please cite the following paper:

 @inproceedings{babnikIWBF2024,
  title={{AI-KD: Towards Alignment Invariant Face Image Quality Assessment Using Knowledge Distillation}},
  author={Babnik, {\v{Z}}iga and Boutros, Fadi and Damer, Naser and Peer, Peter and {\v{S}}truc, Vitomir},
  booktitle={Proceedings of the International Workshop on Biometrics and Forensics (IWBF)},
  year={2024},
}

About

Official repository of "AI-KD: Towards Alignment Invariant Face Image Quality Assessment Using Knowledge Distillation" presented at IWBF 2024.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages