A Light CNN for Deep Face Representation with Noisy Labels

Overview

A Light CNN for Deep Face Representation with Noisy Labels

Citation

If you use our models, please cite the following paper:

@article{wulight,
  title={A Light CNN for Deep Face Representation with Noisy Labels},
  author={Wu, Xiang and He, Ran and Sun, Zhenan and Tan, Tieniu}
  journal={arXiv preprint arXiv:1511.02683},
  year={2015}
}
@article{wu2015lightened,
  title={A Lightened CNN for Deep Face Representation},
  author={Wu, Xiang and He, Ran and Sun, Zhenan},
  journal={arXiv preprint arXiv:1511.02683},
  year={2015}
}
@article{wu2015learning,
  title={Learning Robust Deep Face Representation},
  author={Wu, Xiang},
  journal={arXiv preprint arXiv:1507.04844},
  year={2015}
}

Updates

  • Dec 16, 2016
  • Nov 08, 2016
    • The prototxt and model C based on caffe-rc3 is updated. The accuracy on LFW achieves 98.80% and the TPR@FAR=0 obtains 94.97%.
    • The performance of set 1 on MegaFace achieves 65.532% for rank-1 accuracy and 75.854% for TPR@FAR=10^-6.
  • Nov 26, 2015
    • The prototxt and model B is updated and the accuracy on LFW achieves 98.13% for a single net without training on LFW.
  • Aug 13, 2015
    • Evaluation of LFW for identification protocols is published.
  • Jun 11, 2015
    • The prototxt and model A is released. The accuracy on LFW achieves 97.77%.

Overview

The Deep Face Representation Experiment is based on Convolution Neural Network to learn a robust feature for face verification task. The popular deep learning framework caffe is used for training on face datasets such as CASIA-WebFace, VGG-Face and MS-Celeb-1M. And the feature extraction is realized by python code caffe_ftr.py.

Structure

  • Code
    • data pre-processing and evaluation code
  • Model
    • caffemodel.
      • The model A and B is trained on CASIA-WebFace by caffe-rc.
      • The model C is trained on MS-Celeb-1M by caffe-rc3.
  • Proto
    • Lightened CNN implementations by caffe
  • Results
    • LFW features

Description

Data Pre-processing

  1. Download face dataset such as CASIA-WebFace, VGG-Face and MS-Celeb-1M.
  2. All face images are converted to gray-scale images and normalized to 144x144 according to landmarks.
  3. According to the 5 facial points, we not only rotate two eye points horizontally but also set the distance between the midpoint of eyes and the midpoint of mouth(ec_mc_y), and the y axis of midpoint of eyes(ec_y) .
Dataset size ec_mc_y ec_y
Training set 144x144 48 48
Testing set 128x128 48 40

Training

  1. The model is trained by open source deep learning framework caffe.
  2. The network configuration is showed in "proto" file and the trained model is showed in "model" file.

Evaluation

  1. The model is evaluated on LFW which is a popular data set for face verification task.
  2. The extracted features and lfw testing pairs are located in "results" file.
  3. To evaluate the model, the matlab code or other ROC evaluation code can be used.
  4. The model is also evaluated on MegaFace. The dataset and evaluation code can be downloaded from http://megaface.cs.washington.edu/

Results

The single convolution net testing is evaluated on unsupervised setting only computing cosine similarity for lfw pairs.

Model 100% - EER TPR@FAR=1% TPR@FAR=0.1% TPR@FAR=0 Rank-1 DIR@FAR=1%
A 97.77% 94.80% 84.37% 43.17% 84.79% 63.09%
B 98.13% 96.73% 87.13% 64.33% 89.21% 69.46%
C 98.80% 98.60% 96.77% 94.97% 93.80% 84.40%

The details are published as a technical report on arXiv.

The released models are only allowed for non-commercial use.

Comments
  • Train and Fine-Tuning LightCNN

    Train and Fine-Tuning LightCNN

    First, congratulations and thank you for your work, it's very exciting to see that's possible to make a light CNN without millions (or billions) of parameters and achieve state-of-art accuracy.

    I intend to do two experiments (varying type of activations, cost functions, solver types, neurons, ...) using the model C architecture, one training a new CNN on my database and another with fine-tuning of model C on my database. I made the following solver.prototxt and train_value.prototxt:

    • solver:
    net: "LightenedCNN_New_train_val.prototxt"
    test_iter: 1000
    test_interval: 10000
    iter_size: 60
    base_lr: 0.001
    lr_policy: "step"
    gamma: 0.1
    stepsize: 500000
    display: 100
    max_iter: 5000000
    momentum: 0.9
    weight_decay: 0.0005
    snapshot: 10000
    snapshot_prefix: "LightenedCNN_New_Net"
    solver_mode: GPU
    
    • train_val
    layer {
      name: "data"
      type:"Data"
      top: "data"
      top: "label"
      data_param{
    	  source: "my_csv_train_database.txt"
    	  batch_size: 32
    	}
      transform_param {
        scale: 0.00390625
        crop_size: 128
        mirror: true
      }
      include: { phase: TRAIN }
    }
    
    layer {
      name: "data"
      type: "Data"
      top: "data"
      top: "label"
      data_param{
    	  source: "my_csv_validation_database.txt"
    	  batch_size: 10
    	}
      transform_param {
        scale: 0.00390625
        crop_size: 128
        mirror: false
      }
      include: { phase: TEST }
    }
    ...
    the same layers on deploy
    

    Could you tell me if this solver and train_val are similar to those you used on the final training of model C? And for fine-tuning can I use the same solver used in train and just freeze the layers on the train_val or it's necessary another solver for fine-tuning?

    Thanks

    opened by TheusStremens 26
  • Extract features with MATLAB

    Extract features with MATLAB

    Hi,

    I would like to know if you have a Matlab program to extract the features. I have written one but did not get the results properly. For a single image (i.e., batch size = 1), my program is as follows:


    modelName = 'LightenedCNN_A_deploy.prototxt'; modelWeight = 'LightenedCNN_A.caffemodel'; caffe.set_device(1); caffe.set_mode_gpu();

    % Define net net = caffe.Net(modelName, modelWeight, 'test');

    % read image I = rgb2gray(imread('imgName.jpg'));

    % get features J(:,:,1,1) = I; net.forward({J}); fts = net.blobs('eltwise6').get_data()';


    I get features of 256 dimension. However, with these features I obtained very low accuracy. I have pre-processed the images with the normalization program written by you.

    • Here I did not scale the value to 1 (by dividing pixel values with 256) as it gives even worse result on LFW.
    • Besides, I would like to inform you that I was unable to load the caffemodel for your CNN-B.

    Looking forward for your feedback.

    Thank you.

    opened by mhasnat 21
  • B model does not converge.

    B model does not converge.

    I am trying to train with lightened_B model in CASIA. I followed the training methodology in paper, But it does not converge. At beginning, accuracy is 0, and loss is 87.3365. What's the problem? I am using caffe-windows-master of happynear(Feng Wang). Thanks.

    opened by cheer37 16
  • Could not reproduce your LFW-closed set results

    Could not reproduce your LFW-closed set results

    Hi, I want to reproduce your results mentioned in your paper arXiv:1511.02683 "A Lightened CNN for Deep Face Representation". Although you claim that the fc1 layer dimension is 256 in your paper, it is actually 512 in your prototxt file. I used Dlib to detect and extract faces of LFW-closedset. Dlib in addition, rotates faces to align wrt the centers of eye locations horizontally. Then I resized the faces to 128x128 pixels. Then I used your LightenedCNN_A caffemodel release to extract features from fc1 layer, which has 512 dimensionality, using matcaffe latest release. One thing to note is, you did not release the mean binaryproto file of your training set. Don't you apply mean normalization before testing? I compared the probe features with gallery features using cosine similarity. I obtained very low Rank-1 accuracy (less than %10). What would be the reason of the difference with your results?

    opened by kizilkanat 16
  • MegaFace evalutation: How to save a OpenCV mat (bin) by using matio.py?

    MegaFace evalutation: How to save a OpenCV mat (bin) by using matio.py?

    Hello, Mr Wu: I have study how to evaluate a model on MegaFace recently. But I confuse how to convert a vector into bin form. The default material said matio.py is a good tool. But I don't understand it without the comment. Could you tell me something about it ? Thank you so much.

    opened by globallocal 14
  • 测试模型遇到的问题

    测试模型遇到的问题

    吴老师,您好: 先感谢您分享的网络模型! 当测试模型时遇到两个问题:

    1. 按照网络A_deploy,提取fc1层的特征应该是512维(按这个正确率是93.8%),但看保存特征的mat里,特征维数是256维,想问一下,您提取的是那一层特征? 2.在测试网络B_deploy时,出现 : ...insert_splits.cpp:35] Unknown blob input label to layer 1 的错误,想问一下这个怎么解决?

    十分感谢!

    opened by tianboguangding 10
  • try to extract layer ‘fc1’ feature using C++,but get an error

    try to extract layer ‘fc1’ feature using C++,but get an error

    Pretrained model: LightenedCNN_B.caffemodel Net proto: LightenedCNN_B_ex.prototxt but change the input to (so that I can read the image_path in commend line): layers { name: "icub-camera" type: MEMORY_DATA top: "data" top: "label" memory_data_param { batch_size: 1 channels: 1 height: 144 width: 144 }
    }

    Report Cannot copy param 0 weights from layer 'fc1'; shape mismatch. Source param shape is 1 1 512 8192 (4194304); target param shape is 512 10368 (5308416).

    What is wrong?

    opened by yzk0281 10
  • 关于模型的两个问题

    关于模型的两个问题

    老师您好 首先我想请问下 文章中进行测试时是对于LFW的原始数据集进行的特征点定位还是说根据deep funneled的图片进行的特征点定位呢 其次 readme里面写的利用caffe_ftr.py进行特征提取 但是我们在运行文件的时候提示说 'Classifier' object has no attribute 'set_phase_test'

    opened by mengfanr 9
  • Feature extraction - shape error

    Feature extraction - shape error

    Hi!

    Thank you for sharing your approaches.

    When I use your python code for feature extraction, I get the error "ValueError: could not broadcast input array from shape (64,3,28,28) into shape (64,1,28,28)". I am a little confused about what should I change.

    I'm using as inputs:

    • your pretrained model (DeepFace_set003_net_iter.caffemodel)
    • your network definition (DeepFace_set003.prototxt)
    • an image list of some LFW grayscale images' path and labels

    Thank you!!

    opened by naranjuelo 7
  • feature dimension

    feature dimension

    Hi, why the features stored in the matlab matrix is 256 dimensions? but fc1-layer in the network's output number is 512. I cannot understand which layer's output treat as the terminal feature!

    opened by kingloo2014 7
  • Labeling of images

    Labeling of images

    Hello, I want to train on the pre-trained Lightened CNN model. I would like know how should the labeling be done. Is it binary labeling stating 0 for similar images and 1 for non-similar? Or do we have to get a similarity between each image pair of the same subject? Thank you in advance.

    opened by sanjanajainsj 6
Owner
Alfred Xiang Wu
魔炮厨 | 夏娜厨 | 久远厨 | 珂朵莉厨 | PSN: wkira_vivio
Alfred Xiang Wu
A GOOD REPRESENTATION DETECTS NOISY LABELS

A GOOD REPRESENTATION DETECTS NOISY LABELS This code is a PyTorch implementation of the paper: Prerequisites Python 3.6.9 PyTorch 1.7.1 Torchvision 0.

REAL@UCSC 64 Jan 4, 2023
PyTorch implementation of "Contrast to Divide: self-supervised pre-training for learning with noisy labels"

Contrast to Divide: self-supervised pre-training for learning with noisy labels This is an official implementation of "Contrast to Divide: self-superv

null 55 Nov 23, 2022
A curated (most recent) list of resources for Learning with Noisy Labels

A curated (most recent) list of resources for Learning with Noisy Labels

Jiaheng Wei 321 Jan 9, 2023
NeurIPS 2021, "Fine Samples for Learning with Noisy Labels"

[Official] FINE Samples for Learning with Noisy Labels This repository is the official implementation of "FINE Samples for Learning with Noisy Labels"

mythbuster 27 Dec 23, 2022
Generalized Jensen-Shannon Divergence Loss for Learning with Noisy Labels

The official code for the NeurIPS 2021 paper Generalized Jensen-Shannon Divergence Loss for Learning with Noisy Labels

null 13 Dec 22, 2022
Official PyTorch implemention of our paper "Learning to Rectify for Robust Learning with Noisy Labels".

WarPI The official PyTorch implemention of our paper "Learning to Rectify for Robust Learning with Noisy Labels". Run python main.py --corruption_type

Haoliang Sun 3 Sep 3, 2022
Sample Prior Guided Robust Model Learning to Suppress Noisy Labels

PGDF This repo is the official implementation of our paper "Sample Prior Guided Robust Model Learning to Suppress Noisy Labels ". Citation If you use

CVSM Group -  email: czhu@bupt.edu.cn 22 Dec 23, 2022
Large-Scale Pre-training for Person Re-identification with Noisy Labels (LUPerson-NL)

LUPerson-NL Large-Scale Pre-training for Person Re-identification with Noisy Labels (LUPerson-NL) The repository is for our CVPR2022 paper Large-Scale

null 43 Dec 26, 2022
Face Synthetics dataset is a collection of diverse synthetic face images with ground truth labels.

The Face Synthetics dataset Face Synthetics dataset is a collection of diverse synthetic face images with ground truth labels. It was introduced in ou

Microsoft 608 Jan 2, 2023
CNN Based Meta-Learning for Noisy Image Classification and Template Matching

CNN Based Meta-Learning for Noisy Image Classification and Template Matching Introduction This master thesis used a few-shot meta learning approach to

Kumar Manas 2 Dec 9, 2021
Code for HLA-Face: Joint High-Low Adaptation for Low Light Face Detection (CVPR21)

HLA-Face: Joint High-Low Adaptation for Low Light Face Detection The official PyTorch implementation for HLA-Face: Joint High-Low Adaptation for Low L

Wenjing Wang 77 Dec 8, 2022
Python tools for 3D face: 3DMM, Mesh processing(transform, camera, light, render), 3D face representations.

face3d: Python tools for processing 3D face Introduction This project implements some basic functions related to 3D faces. You can use this to process

Yao Feng 2.3k Dec 30, 2022
NFT-Price-Prediction-CNN - Using visual feature extraction, prices of NFTs are predicted via CNN (Alexnet and Resnet) architectures.

NFT-Price-Prediction-CNN - Using visual feature extraction, prices of NFTs are predicted via CNN (Alexnet and Resnet) architectures.

null 5 Nov 3, 2022
CondenseNet: Light weighted CNN for mobile devices

CondenseNets This repository contains the code (in PyTorch) for "CondenseNet: An Efficient DenseNet using Learned Group Convolutions" paper by Gao Hua

Shichen Liu 690 Nov 30, 2022
Training a deep learning model on the noisy CIFAR dataset

Training-a-deep-learning-model-on-the-noisy-CIFAR-dataset This repository contai

null 1 Jun 14, 2022
Realtime Face Anti Spoofing with Face Detector based on Deep Learning using Tensorflow/Keras and OpenCV

Realtime Face Anti-Spoofing Detection ?? Realtime Face Anti Spoofing Detection with Face Detector to detect real and fake faces Please star this repo

Prem Kumar 86 Aug 3, 2022
my graduation project is about live human face augmentation by projection mapping by using CNN

Live-human-face-expression-augmentation-by-projection my graduation project is about live human face augmentation by projection mapping by using CNN o

null 1 Mar 8, 2022
A light and fast one class detection framework for edge devices. We provide face detector, head detector, pedestrian detector, vehicle detector......

A Light and Fast Face Detector for Edge Devices Big News: LFD, which is a big update of LFFD, now is released (2021.03.09). It is strongly recommended

YonghaoHe 1.3k Dec 25, 2022
STEAL - Learning Semantic Boundaries from Noisy Annotations (CVPR 2019)

STEAL This is the official inference code for: Devil Is in the Edges: Learning Semantic Boundaries from Noisy Annotations David Acuna, Amlan Kar, Sanj

null 469 Dec 26, 2022