Code Monkey home page Code Monkey logo

heated_up_softmax_embedding's Introduction

Heated-Up Softmax Embedding

Project page for Heated-Up Softmax Embedding. We propose a โ€œheating-upโ€ strategy to train a classifier with increasing temperatures, leading the corresponding embeddings to achieve state-of-the-art performance on a variety of metric learning benchmarks.

Introduction

Descriptor extraction is mapping an image to a point in the descriptor space.

A good descriptor should be:

  • Compact: Samples from the same class to be close
  • Spread-out: Samples from different classes to be far away

Bottleneck feature from classification network shows strong performance in [1]

Bottleneck feature is not learned to be compact and spread-out, thus may not be suitable for clustering and retreival. Here are some features learned from MNIST. Each color shows one digit. The diamond shows classifier weight.

Temperature Parameter ๐›ผ

Applying both โ„“2 normalization to both feature and weight show strong performance in face verification [2,3]. Need temperature parameter ๐›ผ for gradient tuning.

Here are some features learned from MNIST with new pipeline. ๐›ผ plays an important role in determining the final distribution.

Consider the magnitude of the gradient with respect to descriptor, different ๐›ผ values assign different gradients to different samples.

Heated-Up Feature

At the begining of the training, we need intermediate ๐›ผ to assign large gradient to incorrect sample and medium gradient to boundary sample. If ๐›ผ is too large (red dash line to the right hand side), boundary sample may not get enough gradient to update, the feature will be not compact. If ๐›ผ is too small (red dash line to the left hand side, close to 0), all samples will have similar gradient, training may not be effective (no "hard mining").

At the end of the training, all the samples are correctly classified. We need small ๐›ผ to assign large gradient to all the samples to further compress the distribution.

Requirements

See ./requirements.txt

Run the code

  1. Prepare the data. Run codes in ./dataset/ to download and preprocess the data.
python ./dataset/car196.py -h
  1. Download inception_v1 from Tensorflow site, and save it in ./data/model/.

  2. Check ./tensorflow/run_Inception.py to see how to run on Car196, Bird200 and Product datasets.

python ./tensorflow/run_Inception.py
  1. Check ./tensorflow/run_mnist_lenet.py to see how to run on Mnist dataset to get the distribution map.
python ./tensorflow/run_mnist_lenet.py

Citation

Please cite us if you find this code useful:

@inproceedings{zhang2018Heated,
title={Heated-Up Softmax Embedding},
author={Zhang, Xu and Yu, Felix X. and Karaman, Svebor and Zhang, Wei and Chang, Shih-Fu},
booktitle={arXiv preprint arXiv:1809.04157},
year={2018}
}

Reference

[1] Y. Movshovitz-Attias, A. Toshev, T. K. Leung, S. Ioffe, and S. Singh. No Fuss Distance Metric Learning Using Proxies. In ICCV 2017

[2] Wang, Feng, Xiang Xiang, Jian Cheng, and Alan L. Yuille. NormFace: L2 Hypersphere Embedding for Face Verification. In ACM MM 2017

[3] Liu, Weiyang, Yandong Wen, Zhiding Yu, et al. SphereFace: Deep Hypersphere Embedding for Face Recognition. In CVPR 2017

heated_up_softmax_embedding's People

Contributors

biswajitsc avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.