Reliable probability face embeddings

Related tags

Deep LearningProbFace
Overview

ProbFace, arxiv

This is a demo code of training and testing [ProbFace] using Tensorflow. ProbFace is a reliable Probabilistic Face Embeddging (PFE) method. The representation of each face will be an Guassian distribution parametrized by (mu, sigma), where mu is the original embedding and sigma is the learned uncertainty. Experiments show that ProbFace could

  • improve the robustness of PFE.
  • simplify the calculation of the multal likelihood score (MLS).
  • improve the recognition performance on the risk-controlled scenarios.

Usage

Preprocessing

Download the MS-Celeb-1M dataset from insightface or face.evoLVe.PyTorch and decode it using this code

Training

  1. Download the base model ResFace64 and unzip the files under log/resface64.

  2. Modify the configuration files under configfig/ folder.

  3. Start the training:

    python train.py configfig/resface64_msarcface.py
    Start Training
    name: resface64
    # epochs: 12
    epoch_size: 1000
    batch_size: 128
    
    Saving variables...
    Saving metagraph...
    Saving variables...
    [1][1] time: 4.19 a 0.8130 att_neg 2.7123 att_pos 0.9874 atte 1.8354 lr 0.0100 mls 0.6820 regu 0.1267 s_L2 0.0025 s_max 0.4467 s_min 0.2813
    [1][101] time: 37.72 a 0.8273 att_neg 2.9455 att_pos 1.0839 atte 1.8704 lr 0.0100 mls 0.6946 regu 0.1256 s_L2 0.0053 s_max 0.4935 s_min 0.2476
    [1][201] time: 38.06 a 0.8533 att_neg 2.9560 att_pos 1.1092 atte 1.9117 lr 0.0100 mls 0.7208 regu 0.1243 s_L2 0.0063 s_max 0.5041 s_min 0.2505
    [1][301] time: 38.82 a 0.7510 att_neg 2.9985 att_pos 1.0223 atte 1.7441 lr 0.0100 mls 0.6209 regu 0.1231 s_L2 0.0053 s_max 0.4552 s_min 0.2251
    [1][401] time: 37.95 a 0.8122 att_neg 2.9846 att_pos 1.0803 atte 1.8501 lr 0.0100 mls 0.6814 regu 0.1219 s_L2 0.0070 s_max 0.4964 s_min 0.2321
    [1][501] time: 38.42 a 0.7307 att_neg 3.0087 att_pos 1.0050 atte 1.8465 lr 0.0100 mls 0.6005 regu 0.1207 s_L2 0.0076 s_max 0.5249 s_min 0.2181
    [1][601] time: 37.69 a 0.7827 att_neg 3.0395 att_pos 1.0703 atte 1.8236 lr 0.0100 mls 0.6552 regu 0.1195 s_L2 0.0062 s_max 0.4952 s_min 0.2211
    [1][701] time: 37.36 a 0.7410 att_neg 2.9971 att_pos 1.0180 atte 1.8086 lr 0.0100 mls 0.6140 regu 0.1183 s_L2 0.0068 s_max 0.4955 s_min 0.2383
    [1][801] time: 37.27 a 0.6889 att_neg 3.0273 att_pos 0.9755 atte 1.7376 lr 0.0100 mls 0.5635 regu 0.1171 s_L2 0.0065 s_max 0.4773 s_min 0.2481
    [1][901] time: 37.34 a 0.7609 att_neg 2.9962 att_pos 1.0403 atte 1.8056 lr 0.0100 mls 0.6367 regu 0.1160 s_L2 0.0064 s_max 0.4861 s_min 0.2272
    Saving variables...
    --- cfp_fp ---
    testing verification..
    (14000, 96, 96, 3)
    # of images: 14000 Current image: 13952 Elapsed time: 00:00:12
    save /_feature.pkl
    sigma_sq (14000, 1)
    sigma_sq (14000, 1)
    sigma_sq [0.19821654 0.25770819 0.29024169 0.35030219 0.40342696 0.44539295
     0.56343746] percentile [0, 10, 30, 50, 70, 90, 100]
    risk_factor 0.0 risk_threshold 0.5634374618530273 keep_idxes 7000 / 7000 Cosine score acc 0.980429 threshold 0.182809
    risk_factor 0.1 risk_threshold 0.4627984762191772 keep_idxes 6301 / 7000 Cosine score acc 0.983336 threshold 0.201020
    risk_factor 0.2 risk_threshold 0.4453900158405304 keep_idxes 5603 / 7000 Cosine score acc 0.985007 threshold 0.203516
    risk_factor 0.3 risk_threshold 0.4327596127986908 keep_idxes 4904 / 7000 Cosine score acc 0.986134 threshold 0.207834
    

Testing

  • Single Image Comparison We use LFW dataset as an example for single image comparison. Make sure you have aligned LFW images using the previous commands. Then you can test it on the LFW dataset with the following command:
    run_eval.bat

Visualization of Uncertainty

Pre-trained Model

ResFace64

Method Download2 Download2
Base Mode Baidu Drive PW:v800 [Google Drive]TODO
MLS Only Baidu Drive PW:72tt [Google Drive]TODO
MLS + L1 + Triplet Baidu Drive PW:sx8a [Google Drive]TODO
ProbFace Baidu Drive PW:pr0m [Google Drive]TODO

ResFace64(0.5)

Method Download2 Download2
Base Mode Baidu Drive PW:zrkl [Google Drive]TODO
MLS Only Baidu Drive PW:et0e [Google Drive]TODO
MLS + L1 + Triplet Baidu Drive PW:glmf [Google Drive]TODO
ProbFace Baidu Drive PW:o4tn [Google Drive]TODO

Test Results:

Method LFW CFP-FF CALFW AgeDB30 CPLFW CFP-FP Vgg2FP Avg
Base Mode 99.80 99.80 95.93 97.93 92.53 98.04 94.92 96.99
MLS Only 99.80 99.76 95.87 97.35 93.01 98.29 95.26 97.05
MLS + L1 + Triplet 99.85 99.83 96.05 97.93 93.17 98.39 95.36 97.22
ProbFace 99.85 99.80 96.02 97.90 93.53 98.41 95.34 97.26

Acknowledgement

This repo is inspired by Probabilistic-Face-Embeddings

Reference

If you find this repo useful, please consider citing:

@misc{chen2021reliable,
    title={Reliable Probabilistic Face Embeddings in the Wild},
    author={Kai Chen and Qi Lv and Taihe Yi and Zhengming Yi},
    year={2021},
    eprint={2102.04075},
    archivePrefix={arXiv},
    primaryClass={cs.CV}
}
Owner
Kaen Chan
Kaen Chan
Julia and Matlab codes to simulated all problems in El-Hachem, McCue and Simpson (2021)

Substrate_Mediated_Invasion Julia and Matlab codes to simulated all problems in El-Hachem, McCue and Simpson (2021) 2DSolver.jl reproduces the simulat

Matthew Simpson 0 Nov 09, 2021
A web application that provides real time temperature and humidity readings of a house.

About A web application which provides real time temperature and humidity readings of a house. If you're interested in the data collected so far click

Ben Thompson 3 Jan 28, 2022
Stable Neural ODE with Lyapunov-Stable Equilibrium Points for Defending Against Adversarial Attacks

Stable Neural ODE with Lyapunov-Stable Equilibrium Points for Defending Against Adversarial Attacks Stable Neural ODE with Lyapunov-Stable Equilibrium

Kang Qiyu 8 Dec 12, 2022
Neural style transfer as a class in PyTorch

pt-styletransfer Neural style transfer as a class in PyTorch Based on: https://github.com/alexis-jacq/Pytorch-Tutorials Adds: StyleTransferNet as a cl

Tyler Kvochick 31 Jun 27, 2022
Hierarchical Aggregation for 3D Instance Segmentation (ICCV 2021)

HAIS Hierarchical Aggregation for 3D Instance Segmentation (ICCV 2021) by Shaoyu Chen, Jiemin Fang, Qian Zhang, Wenyu Liu, Xinggang Wang*. (*) Corresp

Hust Visual Learning Team 145 Jan 05, 2023
A Python Package for Portfolio Optimization using the Critical Line Algorithm

PyCLA A Python Package for Portfolio Optimization using the Critical Line Algorithm Getting started To use PyCLA, clone the repo and install the requi

19 Oct 11, 2022
[NeurIPS 2020] This project provides a strong single-stage baseline for Long-Tailed Classification, Detection, and Instance Segmentation (LVIS).

A Strong Single-Stage Baseline for Long-Tailed Problems This project provides a strong single-stage baseline for Long-Tailed Classification (under Ima

Kaihua Tang 514 Dec 23, 2022
A library for implementing Decentralized Graph Neural Network algorithms.

decentralized-gnn A package for implementing and simulating decentralized Graph Neural Network algorithms for classification of peer-to-peer nodes. De

Multimedia Knowledge and Social Analytics Lab 5 Nov 07, 2022
MapReader: A computer vision pipeline for the semantic exploration of maps at scale

MapReader A computer vision pipeline for the semantic exploration of maps at scale MapReader is an end-to-end computer vision (CV) pipeline designed b

Living with Machines 25 Dec 26, 2022
Code release for "Masked-attention Mask Transformer for Universal Image Segmentation"

Mask2Former: Masked-attention Mask Transformer for Universal Image Segmentation Bowen Cheng, Ishan Misra, Alexander G. Schwing, Alexander Kirillov, Ro

Meta Research 1.2k Jan 02, 2023
Galileo library for large scale graph training by JD

近年来,图计算在搜索、推荐和风控等场景中获得显著的效果,但也面临超大规模异构图训练,与现有的深度学习框架Tensorflow和PyTorch结合等难题。 Galileo(伽利略)是一个图深度学习框架,具备超大规模、易使用、易扩展、高性能、双后端等优点,旨在解决超大规模图算法在工业级场景的落地难题,提

JD Galileo Team 128 Nov 29, 2022
PyTorch implementation of the cross-modality generative model that synthesizes dance from music.

Dancing to Music PyTorch implementation of the cross-modality generative model that synthesizes dance from music. Paper Hsin-Ying Lee, Xiaodong Yang,

NVIDIA Research Projects 485 Dec 26, 2022
Code for ICCV 2021 paper Graph-to-3D: End-to-End Generation and Manipulation of 3D Scenes using Scene Graphs

Graph-to-3D This is the official implementation of the paper Graph-to-3d: End-to-End Generation and Manipulation of 3D Scenes Using Scene Graphs | arx

Helisa Dhamo 33 Jan 06, 2023
MultiMix: Sparingly Supervised, Extreme Multitask Learning From Medical Images (ISBI 2021, MELBA 2021)

MultiMix This repository contains the implementation of MultiMix. Our publications for this project are listed below: "MultiMix: Sparingly Supervised,

Ayaan Haque 27 Dec 22, 2022
Python Multi-Agent Reinforcement Learning framework

- Please pay attention to the version of SC2 you are using for your experiments. - Performance is *not* always comparable between versions. - The re

whirl 1.3k Jan 05, 2023
Deep deconfounded recommender (Deep-Deconf) for paper "Deep causal reasoning for recommendations"

Deep Causal Reasoning for Recommender Systems The codes are associated with the following paper: Deep Causal Reasoning for Recommendations, Yaochen Zh

Yaochen Zhu 22 Oct 15, 2022
The best solution of the Weather Prediction track in the Yandex Shifts challenge

yandex-shifts-weather The repository contains information about my solution for the Weather Prediction track in the Yandex Shifts challenge https://re

Ivan Yu. Bondarenko 15 Dec 18, 2022
Implementation of TransGanFormer, an all-attention GAN that combines the finding from the recent GanFormer and TransGan paper

TransGanFormer (wip) Implementation of TransGanFormer, an all-attention GAN that combines the finding from the recent GansFormer and TransGan paper. I

Phil Wang 146 Dec 06, 2022
Optimizing synthesizer parameters using gradient approximation

Optimizing synthesizer parameters using gradient approximation NASH 2021 Hackathon! These are some experiments I conducted during NASH 2021, the Neura

Jordie Shier 10 Feb 10, 2022
PyTorch implementation of TSception V2 using DEAP dataset

TSception This is the PyTorch implementation of TSception V2 using DEAP dataset in our paper: Yi Ding, Neethu Robinson, Su Zhang, Qiuhao Zeng, Cuntai

Yi Ding 27 Dec 15, 2022