Home

Awesome

Build Status license

AuthorYunYang1994
E-maildreameryangyun@sjtu.edu.cn

SphereFace

This is a quick implementation for Deep Hypersphere Embedding for Face Recognition(CVPR 2017).This paper proposed the angular softmax loss that enables convolutional neural networks(CNNs) to learn angularly discriminative features. The main content I replicated contains: <br>

CNN-network

many current CNNS can viewed as convolution feature learning guided by softmax loss on top. however, softmax is easy to to optimize but does not explicitly encourage large margin between different classes.

<p align="center"> <img width="70%" src="https://github.com/YunYang1994/SphereFace/blob/master/image/network.png" style="max-width:90%;"> </a> </p> on this situation, the author proposed a new loss function that always encourages an angular decision margin between different classes.

softmax loss

softmaxformulatest acc(MNIST)
original softmaxweibo-logo0.9775
modified softmaxweibo-logo0.9847
angular softmaxweibo-logo0.9896

A toy example on MNIST dataset, CNN features can be visualized by setting the output dimension as 2 or 3, as shown in following figures.

2D visualization

original softmaxmodified softmaxangular softmax
weibo-logoweibo-logoweibo-logo

3D visualization

original softmaxmodified softmaxangular softmax
weibo-logoweibo-logoweibo-logo

loss and accuracy

training losstraining accuracy
weibo-logoweibo-logo