All Projects → lenscloth → Rkd

lenscloth / Rkd

Official pytorch Implementation of Relational Knowledge Distillation, CVPR 2019

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Rkd

Deep-Metric-Embedding
Papers and Codes about Deep Metric Learning/Deep Embedding
Stars: ✭ 37 (-85.6%)
Mutual labels:  metric-learning
MinkLoc3D
MinkLoc3D: Point Cloud Based Large-Scale Place Recognition
Stars: ✭ 83 (-67.7%)
Mutual labels:  metric-learning
advrank
Adversarial Ranking Attack and Defense, ECCV, 2020.
Stars: ✭ 19 (-92.61%)
Mutual labels:  metric-learning
lfda
Local Fisher Discriminant Analysis in R
Stars: ✭ 74 (-71.21%)
Mutual labels:  metric-learning
recipe1m.bootstrap.pytorch
Retrieve recipes from foodie pictures using Deep Learning and Pytorch
Stars: ✭ 42 (-83.66%)
Mutual labels:  metric-learning
dml
R package for Distance Metric Learning
Stars: ✭ 58 (-77.43%)
Mutual labels:  metric-learning
TCE
This repository contains the code implementation used in the paper Temporally Coherent Embeddings for Self-Supervised Video Representation Learning (TCE).
Stars: ✭ 51 (-80.16%)
Mutual labels:  metric-learning
Deep Learning In Production
In this repository, I will share some useful notes and references about deploying deep learning-based models in production.
Stars: ✭ 3,104 (+1107.78%)
Mutual labels:  deep-neural-networks
SPML
Universal Weakly Supervised Segmentation by Pixel-to-Segment Contrastive Learning
Stars: ✭ 81 (-68.48%)
Mutual labels:  metric-learning
MetricLearning-mnist-pytorch
Playground of Metric Learning with MNIST @pytorch. We provide ArcFace, CosFace, SphereFace, CircleLoss and visualization.
Stars: ✭ 19 (-92.61%)
Mutual labels:  metric-learning
Metric Learning Adversarial Robustness
Code for NeurIPS 2019 Paper
Stars: ✭ 44 (-82.88%)
Mutual labels:  metric-learning
scLearn
scLearn:Learning for single cell assignment
Stars: ✭ 26 (-89.88%)
Mutual labels:  metric-learning
Heated Up Softmax Embedding
Project page for Heated-up Softmax Embedding
Stars: ✭ 42 (-83.66%)
Mutual labels:  metric-learning
MHCLN
Deep Metric and Hash Code Learning Network for Content Based Retrieval of Remote Sensing Images
Stars: ✭ 30 (-88.33%)
Mutual labels:  metric-learning
disent
🧶 Modular VAE disentanglement framework for python built with PyTorch Lightning ▸ Including metrics and datasets ▸ With strongly supervised, weakly supervised and unsupervised methods ▸ Easily configured and run with Hydra config ▸ Inspired by disentanglement_lib
Stars: ✭ 41 (-84.05%)
Mutual labels:  metric-learning
GeDML
Generalized Deep Metric Learning.
Stars: ✭ 30 (-88.33%)
Mutual labels:  metric-learning
ePillID-benchmark
ePillID Dataset: A Low-Shot Fine-Grained Benchmark for Pill Identification (CVPR 2020 VL3)
Stars: ✭ 54 (-78.99%)
Mutual labels:  metric-learning
Chaidnn
HLS based Deep Neural Network Accelerator Library for Xilinx Ultrascale+ MPSoCs
Stars: ✭ 258 (+0.39%)
Mutual labels:  deep-neural-networks
symmetrical-synthesis
Official Tensorflow implementation of "Symmetrical Synthesis for Deep Metric Learning" (AAAI 2020)
Stars: ✭ 67 (-73.93%)
Mutual labels:  metric-learning
finetuner
Finetuning any DNN for better embedding on neural search tasks
Stars: ✭ 442 (+71.98%)
Mutual labels:  metric-learning

Relational Knowledge Distillation

Official implementation of Relational Knowledge Distillation, CVPR 2019
This repository contains source code of experiments for metric learning.

Quick Start

python run.py --help    
python run_distill.py --help

# Train a teacher embedding network of resnet50 (d=512)
# using triplet loss (margin=0.2) with distance weighted sampling.
python run.py --mode train \ 
               --dataset cub200 \
               --base resnet50 \
               --sample distance \ 
               --margin 0.2 \ 
               --embedding_size 512 \
               --save_dir teacher

# Evaluate the teacher embedding network
python run.py --mode eval \ 
               --dataset cub200 \
               --base resnet50 \
               --embedding_size 512 \
               --load teacher/best.pth 

# Distill the teacher to student embedding network
python run_distill.py --dataset cub200 \
                      --base googlnet \
                      --embedding_size 64 \
                      --teacher_base resnet50 \
                      --teacher_embedding_size 512 \
                      --teacher_load teacher/best.pth \
                      --dist_ratio 1  \
                      --angle_ratio 2 \
                      --save_dir student
                      
# Distill the trained model to student network
python run.py --mode eval \ 
               --dataset cub200 \
               --base googlenet \
               --embedding_size 64 \
               --load student/best.pth 
            

Dependency

  • Python 3.6
  • Pytorch 1.0
  • tqdm (pip install tqdm)
  • h5py (pip install h5py)
  • scipy (pip install scipy)

Note

  • Hyper-parameters that used for experiments in the paper are specified at scripts in exmples/.
  • Heavy teacher network (ResNet50 w/ 512 dimension) requires more than 12GB of GPU memory if batch size is 128.
    Thus, you might have to reduce the batch size. (The experiments in the paper were conducted on P40 with 24GB of gpu memory. )

Citation

In case of using this source code for your research, please cite our paper.

@inproceedings{park2019relational,
  title={Relational Knowledge Distillation},
  author={Park, Wonpyo and Kim, Dongju and Lu, Yan and Cho, Minsu},
  booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},
  pages={3967--3976},
  year={2019}
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].