Home

Awesome

Learning towards Minimum Hyperspherical Energy

By Weiyang Liu*, Rongmei Lin*, Zhen Liu*, Lixin Liu*, Zhiding Yu, Bo Dai, Le Song

License

MHE and SphereFace+ are released under the MIT License (refer to the LICENSE file for details).

Contents

  1. Introduction
  2. Citation
  3. Requirements
  4. Usage
  5. Results
  6. SphereFace+ for face recognition
  7. Generative Adversarial Networks with MHE
  8. Note

Introduction

The repository contains the tensorflow implementation of Minimum Hyperspherical Energy (MHE) and Caffe implementation of SphereFace+. Inspired by a well-known Physics problem (Thomson problem), MHE is formulated as an energy on a hypersphere. Minimizing it can achieve better generalization in various applications. In general, MHE serves as a simple plug-in regularization for neural networks, which enchances the neuron diversity on hyperspheres (i.e., angular diversity) and is able to consistently improve the network's generalization ability in various application. Our paper is published in NIPS 2018 and is available at arXiv.

<img src="assets/teaser.png" width="55%" height="55%">

Citation

If you find our work useful in your research, please consider to cite:

@article{LiuNIPS18,
  title={Learning towards Minimum Hyperspherical Energy},
  author={Liu, Weiyang and Lin, Rongmei and Liu, Zhen and Liu, Lixin and Yu, Zhiding and Dai, Bo and Song, Le},
  journal={NIPS},
  year={2018}
  }

Requirements

  1. Python 3.6 (Python 2.7 needs to modify the unpickle funtion in train.py)
  2. TensorFlow
  3. Keras (for MHE-GAN)
  4. numpy

Usage

Part 1: Clone the repositary

Part 2: Download CIFAR-100 training and testing data

Part 3: CIFAR-100

Results

SphereFace-plus

SphereFace+ is an improved deep face recognition algorithm based on SphereFace. We incorporate the MHE regularization to the original SphereFace and further boost the recognition accuracy. SphereFace+ is implemented in Caffe and therefore is independently host here. An PyTorch version is available in OpenSphere.

MHE-GAN

To train a model from scratch, simply run python train.py. To test the best models we provide, run python test.py.

For the model trained with both MHE (magnitude 1e-7) and spectral normalization (located in MHE-GAN/sn-model), we obtained the inception score of 7.68, which is much higher than we originally reported in the paper. In contrast, the same GAN with only spectral normalization yields 7.4 inception score and the baseline GAN only achieves 6.64.

For the model trained with only MHE (magnitude 1e-6, located in MHE-GAN/non-sn-model), we obtained the inception score of 7.48, which is also much higher than we originally reported in the paper.

The weight files of the MHE+SN model with inception score 7.68 and the MHE-only model with inception score 7.48 are provided at Google Drive. Please place the model files under the snapshots folder in the corresponding experiment folders.

The following table summarizes the results:

ModelInception ScoreWeights
Baseline GAN6.64N/A
GAN w/ Spectral Norm7.40N/A
GAN w/ MHE7.48Google Drive
GAN w/ Spectral Norm & MHE7.68Google Drive

Some random samples of the generated images from MHE-GAN (MHE+SN) is shown as follows:

<img src="assets/MHE-GAN-Samples.png" width="30%" height="30%">

Note