question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tripletloss(Facenet) for few shot learning

See original GitHub issue

For few-shot learning tasks like IDCard<->Camera face verification(identification), we only have two face images for each person in most cases for training. Under such situation, metric learning approaches can be tried such as tripletloss.

STEPS:

  1. Prepare insightface ‘.rec’ dataset from your IDCard/camera face images.
  2. Finetuning pretrained models with tripletloss, for example:
CUDA_VISIBLE_DEVICES='0,1,2,3' python -u train_triplet.py --data-dir $DATA_DIR \
  --network "$NETWORK" --lr 0.005 --pretrained "$PRETRAINED" --per-batch-size 60 

We use GPU to do the semi-hard mining so training will be fast.

RESULTS:

We have a private IDCard/Camera face image dataset with 220K identities. Each person has two or more photos, one from IDCard and the others from camera. Split it as 8-2 for training(176K IDs) and testing(45K IDs). We report top1 accuracy and TAR vs FAR for 1:N identification task(N=45K). (Note that we do not use idcard training data in Model-A and Model-B)

DESC. Rank-1 TAR@FAR=1e-3 TAR@FAR=1e-4
Model-A1 LResNet100E trained on ms1m-v1 with Softmax loss 26.9% 0.3% 0.06%
Model-A2 LResNet100E trained on ms1m-v1 with ArcFace loss 70.7% 17% 8%
Model-A3 LResNet100E trained on ms1m-v2 with ArcFace loss 76.8% 21% 9%
Model-B LResNet100E trained on (ms1m-v2+Glint-Asia) with ArcFace loss 82.4% 33% 16%
Model-C Triplet-loss finetuning on Model-B 95.2%(still ongoing) 78% 26%

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:32
  • Comments:7

github_iconTop GitHub Comments

3reactions
stupidingcommented, Sep 10, 2018

Will you release the emore + Glin-Asia data, or show how to combine the two?

0reactions
harshraj22commented, Jul 11, 2022

where is train_triplet.py file located ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

One-Shot Learning for Face Recognition
The approach of directly training face embeddings, such as via triplet loss, and using the embeddings as the basis for face identification and ......
Read more >
A Few-shot Learning Model based on a Triplet Network for the ...
We present a few- shot learning model to classify a day as a 5CP day or a non-. 5CP day 24-hours ahead. A...
Read more >
Train FaceNet with triplet loss for real time face recognition on ...
Last year I completed the coursera's Deep Learning Specialization. ... FaceNet is a one-shot model, that directly learns a mapping from face ...
Read more >
A conditional Triplet loss for few-shot learning and its ...
In this paper we present a novel conditional Triplet loss for solving few-shot problems using deep metric learning. While the conventional Triplet loss...
Read more >
arXiv:1907.03123v2 [cs.CV] 16 Apr 2020
The goal of few-shot learning is to recognize new visual concepts with just ... Compared with the traditional triplet loss, more inter-class ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found