Git Product home page Git Product logo

unsupervised_embedding_learning's Introduction

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.

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

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

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.

  • Prerequisites: Python2.7, pytorch=0.4, Numpy, TensorboardX, Scikit_learn

  • Clone this repo: git clone https://github.com/mangye16/Unsupervised_Embedding_Learning

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
  • --dataset: "cifar": cifar-10 dataset, "stl": stl-10 dataset.

  • --batch-t: softmax temperature parameter (0.05-0.1).

  • --lr: learning rate (initialization: 0.03).

  • --low-dim: the feature embedding dimension (default: 128).

  • --batch-size: the training batch size (Generally, larger batch size results in better performance)

  • --gpu: gpu used for training

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
  • --dataset: "cub200": CUB200-2011 dataset or, "car196": Cars196 dataset, "ebay": Stanford Online Product dataset.

  • --arch: backbone network structure (defualt: inception_v1_ml).

  • --lr: learning rate (initialization: 0.01).

  • --gpu: gpu used for training (only support single GPU training for inception_v1 backbone)

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: [email protected]

unsupervised_embedding_learning's People

Contributors

mangye16 avatar

Watchers

James Cloos 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.