Code of TIP2021 Paper《SFace: Sigmoid-Constrained Hypersphere Loss for Robust Face Recognition》. We provide both MxNet and Pytorch versions.

Related tags

Deep Learning SFace
Overview

SFace

Code of TIP2021 Paper 《SFace: Sigmoid-Constrained Hypersphere Loss for Robust Face Recognition》.

We provide both MxNet, PyTorch and Jittor versions.

Abstract

Deep face recognition has achieved great success due to large-scale training databases and rapidly developing loss functions. The existing algorithms devote to realizing an ideal idea: minimizing the intra-class distance and maximizing the inter-class distance. However, they may neglect that there are also low quality training images which should not be optimized in this strict way. Considering the imperfection of training databases, we propose that intra-class and inter-class objectives can be optimized in a moderate way to mitigate overfitting problem, and further propose a novel loss function, named sigmoid-constrained hypersphere loss (SFace). Specifically, SFace imposes intra-class and inter-class constraints on a hypersphere manifold, which are controlled by two sigmoid gradient re-scale functions respectively. The sigmoid curves precisely re-scale the intra-class and inter-class gradients so that training samples can be optimized to some degree. Therefore, SFace can make a better balance between decreasing the intra-class distances for clean examples and preventing overfitting to the label noise, and contributes more robust deep face recognition models. Extensive experiments of models trained on CASIA-WebFace, VGGFace2, and MS-Celeb-1M databases, and evaluated on several face recognition benchmarks, such as LFW, MegaFace and IJB-C databases, have demonstrated the superiority of SFace.

arch

Usage

Please check your familiar version: MxNet and PyTorch, PyTorch and Jittor versions.

You might also like...
A large-scale face dataset for face parsing, recognition, generation and editing.
A large-scale face dataset for face parsing, recognition, generation and editing.

CelebAMask-HQ [Paper] [Demo] CelebAMask-HQ is a large-scale face image dataset that has 30,000 high-resolution face images selected from the CelebA da

DVG-Face: Dual Variational Generation for Heterogeneous Face Recognition, TPAMI 2021

DVG-Face: Dual Variational Generation for HFR This repo is a PyTorch implementation of DVG-Face: Dual Variational Generation for Heterogeneous Face Re

Official implementation of the MM'21 paper Constrained Graphic Layout Generation via Latent Optimization
Official implementation of the MM'21 paper Constrained Graphic Layout Generation via Latent Optimization

[MM'21] Constrained Graphic Layout Generation via Latent Optimization This repository provides the official code for the paper "Constrained Graphic La

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

PyTorch implementation of Constrained Policy Optimization
PyTorch implementation of Constrained Policy Optimization

PyTorch implementation of Constrained Policy Optimization (CPO) This repository has a simple to understand and use implementation of CPO in PyTorch. A

Simple and Robust Loss Design for Multi-Label Learning with Missing Labels
Simple and Robust Loss Design for Multi-Label Learning with Missing Labels

Simple and Robust Loss Design for Multi-Label Learning with Missing Labels Official PyTorch Implementation of the paper Simple and Robust Loss Design

Simple, efficient and flexible vision toolbox for mxnet framework.

MXbox: Simple, efficient and flexible vision toolbox for mxnet framework. MXbox is a toolbox aiming to provide a general and simple interface for visi

Modular Probabilistic Programming on MXNet

MXFusion | | | | Tutorials | Documentation | Contribution Guide MXFusion is a modular deep probabilistic programming library. With MXFusion Modules yo

MXNet implementation for:  Drop an Octave: Reducing Spatial Redundancy in Convolutional Neural Networks with Octave Convolution
MXNet implementation for: Drop an Octave: Reducing Spatial Redundancy in Convolutional Neural Networks with Octave Convolution

Octave Convolution MXNet implementation for: Drop an Octave: Reducing Spatial Redundancy in Convolutional Neural Networks with Octave Convolution Imag

Comments
  • pixel scaling

    pixel scaling

    https://github.com/zhongyy/SFace/blob/cb5ffb3c4863eecb3abf6a80529daffb05a0e820/SFace_torch/backbone/model_mobilefacenet.py#L81

    According to the paper, this should be 0,0078125 ?

    opened by rgrbic 1
  • intraloss和interloss是否总是分别在减小和增大?

    intraloss和interloss是否总是分别在减小和增大?

    我最近在声音的一些识别工作上尝试使用SFace,发现在第一个epoch中的最初intraloss是在不停减少的,但是到后面的epoch甚至会逐渐增大,稳定在一个范围,但是错误率在下降,这是比较反优化目标,或者说这样的稳定就是把loss控制在一个合适的范围? 这是我的训练loss,我使用的是adam+Cyclical Learning Rates学习率调整策略(学习率会周期从最低到最高),这和您在论文中使用的SGD+固定缩减lr不太相同。 epoch: 1, lr: 7.27e-03 - train loss: -6.43e+00, train intra_loss: -2.75e+01, train inter_loss: 21.07 - valid loss: -1.13e+01, valid intra_loss: -3.15e+01, valid inter_loss: 20.16, valid ErrorRate: 5.17e-02 epoch: 2, lr: 5.47e-03 - train loss: -1.18e+01, train intra_loss: -2.86e+01, train inter_loss: 16.84 - valid loss: -1.21e+01, valid intra_loss: -2.97e+01, valid inter_loss: 17.54, valid ErrorRate: 3.19e-02 epoch: 3, lr: 1.80e-03 - train loss: -1.23e+01, train intra_loss: -2.86e+01, train inter_loss: 16.27 - valid loss: -1.09e+01, valid intra_loss: -2.58e+01, valid inter_loss: 14.86, valid ErrorRate: 2.51e-02 epoch: 4, lr: 9.07e-03 - train loss: -1.16e+01, train intra_loss: -2.53e+01, train inter_loss: 13.62 - valid loss: -1.59e+01, valid intra_loss: -3.04e+01, valid inter_loss: 14.43, valid ErrorRate: 3.47e-02 epoch: 5, lr: 3.67e-03 - train loss: -1.07e+01, train intra_loss: -2.33e+01, train inter_loss: 12.57 - valid loss: -1.01e+01, valid intra_loss: -2.24e+01, valid inter_loss: 12.34, valid ErrorRate: 2.12e-02 epoch: 6, lr: 3.60e-03 - train loss: -1.18e+01, train intra_loss: -2.48e+01, train inter_loss: 13.01 - valid loss: -1.16e+01, valid intra_loss: -2.46e+01, valid inter_loss: 13.06, valid ErrorRate: 2.38e-02 epoch: 7, lr: 9.14e-03 - train loss: -1.00e+01, train intra_loss: -2.07e+01, train inter_loss: 10.69 - valid loss: -1.65e+01, valid intra_loss: -2.86e+01, valid inter_loss: 12.16, valid ErrorRate: 2.80e-02 epoch: 8, lr: 1.88e-03 - train loss: -1.03e+01, train intra_loss: -2.16e+01, train inter_loss: 11.32 - valid loss: -7.19e+00, valid intra_loss: -1.79e+01, valid inter_loss: 10.75, valid ErrorRate: 1.86e-02 epoch: 9, lr: 5.39e-03 - train loss: -1.10e+01, train intra_loss: -2.21e+01, train inter_loss: 11.10 - valid loss: -1.31e+01, valid intra_loss: -2.48e+01, valid inter_loss: 11.78, valid ErrorRate: 2.52e-02 epoch: 10, lr: 7.35e-03 - train loss: -8.92e+00, train intra_loss: -1.82e+01, train inter_loss: 9.27 - valid loss: -1.56e+01, valid intra_loss: -2.55e+01, valid inter_loss: 9.91, valid ErrorRate: 2.32e-02

    opened by zhaoyiming 1
  • Initialization method of weights

    Initialization method of weights

    Hi, yy, I was wondering why you choose xavier_normal_(self.weight, gain=2, mode='out') instead of nn.init.xavier_uniform_(self.weight) when initializing weights. And by looking through the xavier_normal_ function, I found the weights won't participate in gradient propagation, why?

    Thanks for your sharing, and have a nice day :)

    opened by CloudWalking0 0
Owner
Zhong Yaoyao
PhD student in BUPT
Zhong Yaoyao
[TIP 2021] SADRNet: Self-Aligned Dual Face Regression Networks for Robust 3D Dense Face Alignment and Reconstruction

SADRNet Paper link: SADRNet: Self-Aligned Dual Face Regression Networks for Robust 3D Dense Face Alignment and Reconstruction Requirements python

Multimedia Computing Group, Nanjing University 99 Dec 30, 2022
Recall Loss for Semantic Segmentation (This repo implements the paper: Recall Loss for Semantic Segmentation)

Recall Loss for Semantic Segmentation (This repo implements the paper: Recall Loss for Semantic Segmentation) Download Synthia dataset The model uses

null 32 Sep 21, 2022
An implementation for the loss function proposed in Decoupled Contrastive Loss paper.

Decoupled-Contrastive-Learning This repository is an implementation for the loss function proposed in Decoupled Contrastive Loss paper. Requirements P

Ramin Nakhli 71 Dec 4, 2022
Implement of "Training deep neural networks via direct loss minimization" in PyTorch for 0-1 loss

This is the implementation of "Training deep neural networks via direct loss minimization" published at ICML 2016 in PyTorch. The implementation targe

Cuong Nguyen 1 Jan 18, 2022
This is the official source code for SLATE. We provide the code for the model, the training code, and a dataset loader for the 3D Shapes dataset. This code is implemented in Pytorch.

SLATE This is the official source code for SLATE. We provide the code for the model, the training code and a dataset loader for the 3D Shapes dataset.

Gautam Singh 66 Dec 26, 2022
Official PyTorch implementation of the paper "Deep Constrained Least Squares for Blind Image Super-Resolution", CVPR 2022.

Deep Constrained Least Squares for Blind Image Super-Resolution [Paper] This is the official implementation of 'Deep Constrained Least Squares for Bli

MEGVII Research 141 Dec 30, 2022
MMdnn is a set of tools to help users inter-operate among different deep learning frameworks. E.g. model conversion and visualization. Convert models between Caffe, Keras, MXNet, Tensorflow, CNTK, PyTorch Onnx and CoreML.

MMdnn MMdnn is a comprehensive and cross-framework tool to convert, visualize and diagnose deep learning (DL) models. The "MM" stands for model manage

Microsoft 5.7k Jan 9, 2023
Face Library is an open source package for accurate and real-time face detection and recognition

Face Library Face Library is an open source package for accurate and real-time face detection and recognition. The package is built over OpenCV and us

null 52 Nov 9, 2022
PyTorch implementation for Partially View-aligned Representation Learning with Noise-robust Contrastive Loss (CVPR 2021)

2021-CVPR-MvCLN This repo contains the code and data of the following paper accepted by CVPR 2021 Partially View-aligned Representation Learning with

XLearning Group 33 Nov 1, 2022
Tensorboard for pytorch (and chainer, mxnet, numpy, ...)

tensorboardX Write TensorBoard events with simple function call. The current release (v2.3) is tested on anaconda3, with PyTorch 1.8.1 / torchvision 0

Tzu-Wei Huang 7.5k Dec 28, 2022