Coder Social home page Coder Social logo

joyhuang9473 / deep-metric-learning-cvpr16 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rksltnl/deep-metric-learning-cvpr16

0.0 2.0 1.0 41 KB

Main repository for Deep Metric Learning via Lifted Structured Feature Embedding

License: MIT License

MATLAB 54.70% Python 3.38% C++ 41.92%

deep-metric-learning-cvpr16's Introduction

Deep Metric Learning via Lifted Structured Feature Embedding

This repository has the source code and the Stanford Online Products dataset for the paper "Deep Metric Learning via Lifted Structured Feature Embedding" (CVPR16). The paper preprint is available on arXiv. If you just need the Caffe code, check out the Submodule. For the loss layer implementation, look at here.

Citing this work

If you find this work useful in your research, please consider citing:

@inproceedings{songCVPR16,
    Author = {Hyun Oh Song and Yu Xiang and Stefanie Jegelka and Silvio Savarese},
    Title = {Deep Metric Learning via Lifted Structured Feature Embedding},
    Booktitle = {Computer Vision and Pattern Recognition (CVPR)},
    Year = {2016}
}

Installation

  1. Install prerequsites for Caffe (see: Caffe installation instructions)
  2. Compile the Caffe-Deep-Metric-Learning-CVPR16 Github submodule.

Training procedure

  1. Download pretrained GoogLeNet model from here
  2. Download the ILSVRC12 ImageNet mean file for mean subtraction. Refer to Caffe the ImageNet examples here.
  3. Generate the LMDB file to convert the training set of images to the DB format. Example scripts are in code/ directory.
  • Modify and run code/compile.m to mex compile the cpp files used for LMDB generation.
  • Modify code/config.m to set save paths.
  • Run code/gen_caffe_dataset_multilabel_m128.m to start the LMDB generation process.
  1. Create the model/train*.prototxt and model/solver*.prototxt files. Please refer to the included *.prototxt files in model/ directory for examples. You also need to provide the path to the ImageNet mean file (usually called imagenet_mean.binaryproto) you downloaded in step 2.
  2. Inside the caffe submodule, launch the Caffe training procedure. caffe/build/tools/caffe train -solver [path-to-training-prototxt-file] -weights [path-to-pretrained-googlenet] -gpu [gpuid]

Feature extraction after training

  1. Modify and run code/gen_caffe_validation_imageset.m to convert the test images to LMDB format.
  2. Modify the test set path in model/extract_googlenet*.prototxt.
  3. Modify the model and test set path and run code/compute_googlenet_distance_matrix_cuda_embeddings_liftedstructsim_softmax_pair_m128.py.

Clustering and Retrieval evaluation code

  1. Use code/evaluation/evaluate_clustering.m to evaluate the clustering performance.
  2. Use code/evaluation/evaluate_recall.m to evaluate recall@K for image retrieval.

Stanford Online Products dataset

You can download the Stanford Online Products dataset (2.9G) from ftp://cs.stanford.edu/cs/cvgl/Stanford_Online_Products.zip

  • We also have the text meta data for each product images. Please let us know if you're interested in using them.

Our Pre-trained Models

You can download our pre-trained models on the Cars196 dataset, the CUB200 dataset and the Online Products dataset (265M) from ftp://cs.stanford.edu/cs/cvgl/pretrained_models.zip

Licence

MIT Licence

deep-metric-learning-cvpr16's People

Contributors

rksltnl avatar

Watchers

 avatar  avatar

Forkers

baucheng

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.