Face Recognition

This introduction includes Face Datasets, Face Detection, Face Alignment, Face Landmark, Face Recognition, Face Identification and Exercises.



Face Datasets

VGGFace

vgg_face_dataset.tar.gz
The VGG Face dataset is face identity recognition dataset that consists of 2,622 identities. It contains over 2.6 million images


VGGFace2

Paper: VGGFace2: A dataset for recognising faces across pose and age


CelebA

Large-scale CelebFaces Attributes dataset
Paper: Deep Learning Face Attributes in the Wild


LFW

Labeled Faces in the Wild Home (lfw.tgz)
Paper: Labeled Faces in the Wild: A Database for Studying Face Recognition in Unconstrained Environments

The LFW dataset contains 13,233 images of faces collected from the web. This dataset consists of the 5749 identities with 1680 people with two or more images. In the standard LFW evaluation protocol the verification accuracies are reported on 6000 face pairs.


WebFace260M


Face Detection

MTCNN

Paper: Joint Face Detection and Alignment using Multi-task Cascaded Convolutional Networks
Code: ipazc/mtcnn
$pip install mtcnn


DeepFace

Code: RiweiChen/DeepFace
5 key points detection using DeepID architecture


Face Alignment

Face-Alignment

Code: 1adrianb/face-alignment

import face_alignment
from skimage import io

fa = face_alignment.FaceAlignment(face_alignment.LandmarksType._2D, flip_input=False)

input = io.imread('../test/assets/aflw-test.jpg')
preds = fa.get_landmarks(input)

OpenFace

Code: cmusatyalab/openface
Ref. Machine Learning is Fun! Part 4: Modern Face Recognition with Deep Learning


Face Landmark

Face Landmark Estimation

Paper: One Millisecond Face Alignment with an Ensemble of Regression Trees
The basic idea is we will come up with 68 specific points (called landmarks) that exist on every face


3D Face Reconstruction & Alignment

Paper: Joint 3D Face Reconstruction and Dense Alignment with Position Map Regression Network
Code: YadiraF/PRNet

3D Head Pose Estimation


EfficientFAN

Paper: EfficientFAN: Deep Knowledge Transfer for Face Alignment


Face Recognition

Paper: A Survey of Face Recognition

DeepID

Paper:DeepID3: Face Recognition with Very Deep Neural Networks
Code: hqli/face_recognition
Blog: DeepID人臉識別算法之三代
Ref. DeepID3 face recognition
DeepID3在LFW上的face verification準確率爲99.53%,性能上並沒有比DeepID2+的99.47%提升多少。而且LFW數據集裏面有三對人臉被錯誤地標記了,在更正這些錯誤的label後,兩者準確率均爲99.52%。


FaceNet

Paper: FaceNet: A Unified Embedding for Face Recognition and Clustering
Code: https://github.com/davidsandberg/facenet
   FaceNet-with-TripletLoss
   Face Recognition Using Pytorch


VarGFaceNet

Paper: VarGFaceNet: An Efficient Variable Group Convolutional Neural Network for Lightweight Face Recognition
Code: https://github.com/zma-c-137/VarGFaceNet


MogFace

Paper: MogFace: Towards a Deeper Appreciation on Face Detection
Code: https://github.com/damo-cv/MogFace


MixFaceNets

Paper: MixFaceNets: Extremely Efficient Face Recognition Networks
Code: https://github.com/fdbtrs/mixfacenets


EfficientFace

Paper: EfficientFace: An Efficient Deep Network with Feature Enhancement for Accurate Face Detection
Code: https://github.com/zengqunzhao/EfficientFace


TransFace

Paper: TransFace: Calibrating Transformer Training for Face Recognition from a Data-Centric Perspective
Code: https://github.com/DanJun6737/TransFace


Efficient Face Recognition Competition at IJCB2023

Paper: EFaR 2023: Efficient Face Recognition Competition


Face Identification (人臉辨識)

FaceNet-PyTorch

Kaggle: FaceNet-PyTorch

test_images

dists = [[(e1 - e2).norm().item() for e2 in embeddings] for e1 in test_embeddings]
for dist in dists:
    if any(e<1 for e in dist):
        print(names[np.argmin(dist)])
    else:
        print('unknown')


Open-Set One-Shot Face Recognition

Code: https://github.com/robertanto/Open-Set-One-Shot-Face-Recognition


Exercises

Face Mask Detection (口罩偵測)

Using MTCNN to detect face, then use CNN model to detect facemask

Sync-up Tensorflow version on Kaggle and PC

On Kaggle:
import tensorflow as tf
print(tf.__version__)
2.6.1

On PC:
$python -c 'import tensorflow as tf; print(tf.__version__)'
2.6.1

Make sure to use same version of Tensorflow on Kaggle and PC for model file compatibilty !

Train Model on Kaggle

Kaggle: rkuo2000/faskmask-cnn
Dataset: [Face Mask Detection ~12K Images Dataset](https://www.kaggle.com/ashishjangra27/face-mask-12k-images-dataset

  1. [Edit & Copy] FaceMask-CNN
  2. [Run All] to Train model
  3. Download model file facemask_cnn.h5

Run Model Prediction on PC

  1. Clone sample codes
    $git clone https://github.com/rkuo2000/tf
  2. Copy facemask_cnn.h5 to ~/tf/models
  3. To detect using image file
    $python mtcnn_facemask_detection.py images/facemask1.jpg
  4. To detect using webcam
    $python mtcnn_facemask_detection_cam.py

[Homework]: Face Detection

Code: https://github.com/derronqi/yolov8-face
Dataset: WiderFace
YOLOv8n-face


[Homework]: Face Identification

Kaggle: FaceNet-PyTorch

Steps:

  1. [Fork] https://github.com/rkuo2000/facenet-pytorch
  2. upload 1.jpg for each name to https://github.com/your_name/facenet-pytoch/data/test_images
  3. upload yourself photo 1.jpg to https://github.com/your_name/facenet-pytoch/data/test_images/your_name
  4. [Edit&Copy] https://kaggle.com/rkuo2000/facenet-pytorch
  5. modify git clone path
    !git clone https://github.com/your_name/facenet-pytorch
  6. modify test image path
    img = plt.imread("facenet_pytorch/data/test_images/your_name/1.jpg")
  7. [Run-All]



This site was last updated June 29, 2024.