cluster-loss-tensorflow
cluster-loss-tensorflow copied to clipboard
This a an impletation of Deep Metric Learning via Facility Location on tensorflow
Cluster-loss-Tensorflow
This repository is an implementation of Deep Metric Learning via Facility Location on tensorflow. We build this on Cifar100 and Densenet-40. This paper is available here. For the loss layer implementation, look at here. For the Densenet implementation, look at here.
@inproceedings{songCVPR17,
Author = {Hyun Oh Song and Stefanie Jegelka and Vivek Rathod and Kevin Murphy},
Title = {Deep Metric Learning via Facility Location},
Booktitle = {Computer Vision and Pattern Recognition (CVPR)},
Year = {2017}
}
Installation
- Install prerequsites for
tensorflow(see: tensorflow-gpu installation instructions). - Run
pip install -r requirements.txtget required support.
Training Procedure
- Modify
metric_learning_densenet.pyfor training-params and densenet-params. We pick Cifar100 as our training data, because it's tiny, save GPU-memory (when batch size 64, it cost about 4.6G GPU-Memory) and good for doing research. - Run
python metric_learning_densenet.py, thedata_providerwith automaticlly handle data download and process. After that, start Densenet-Cluster-loss training. - Download Downsampled Imagenet with size 32x32 from here. Modify
metric_learning_densenet.pytrain on Imagenet.
Feature Extraction after Training
- Modify
metric_learning_densenet.pyextract feature embeddings on cifar test set, the embeddings is saved with.npyformat used for evaluation process.
Clustering and Retrieval Evaluation
- Run
python visualization/tsne.pycan plot and save the cluster result on Cifar database.
Repository Information
- [x] Densenet tensorflow training code
- [x] Deep metric learning cluster loss code
- [ ] Evaludation
- [ ] NMI, Recall@K code
- [x] feature extraction code
- [x] feature visulization code (tSNE)
- [x] Dataset support
- [x] cifar-10
- [x] cifar-100
- [x] imagenet-32x32