Home

Awesome

Unsupervised_Embedding_Learning

Pytorch code for Unsupervised Embedding Learning via Invariant and Spreading Instance Feature in CVPR 2019. (arXiv).

Highlight

The goal of this work is to learn a feature extraction DNN, such that features of the same instance under different data augmentations should be invariant, while features of different image instances should be separated.

<img src="./fig/Motivation.png" width="400">

We propose to optimize the embedding directly on the real-time instance features with softmax function.

<img src="./fig/Pipeline.png" width="600">

The proposed feature achieves much faster learning speed and better accuracy.

<img src="./fig/Performance.png" width="300">

The learned embedding performs well on both seen and unseen testing categories.

Usage

Our code extends the pytorch implementation of NCE paper in Github. Please refer to the official repo for details of data preparation and hardware configurations.

Training on Seen Testing Categories

The training and testing set share the same categories. We use kNN classifier to evaluate the performance follow the settings in NCE paper.

python demo_seen.py --dataset cifar --batch-t 0.1 --lr 0.03 --low-dim 128 --batch-size 128 --gpu 0,1,2,3

Training on Unseen Testing Categories

The training and testing set DO NOT share any common categories. We use recall at K accuracy to evaluate the performance following existing deep metric learning papers.

1) Dataset Preparation

Prepare the data. Download the datasets first. Then run codes in ./pre_process/ to download and pre-process each dataset

You may use

python pre_process_bird.py

Alternatively, you can use the code to directly download and pre-process the datasets.

Remember to change the dataset path to your own path.

2) Start Training

python demo_unseen.py --dataset cub200 --arch inception_v1_ml --lr 0.001 --low-dim 128 --batch-size 64 --gpu 0

Citation

Please kindly cite this paper in your publications if it helps your research:

@inproceedings{cvpr19unsupervised,
  title={Unsupervised Embedding Learning via Invariant and Spreading Instance Feature},
  author={Ye, Mang and Zhang, Xu and Yuen, Pong C. and Chang, Shih-Fu},
  booktitle={IEEE International Conference on Computer Vision and Pattern Recognition (CVPR)},
  year={2019},
}

Contact: mangye16@gmail.com