Skip to content

"Deep Metric Learning Meets DeepClustering: An Novel UnsupervisedApproach for Feature Embedding" (BMVC 2020)

Notifications You must be signed in to change notification settings

aioz-ai/BMVC20_CBSwR

Repository files navigation

BMVC20 - Deep Metric Learning Meets DeepClustering: An Novel Unsupervised Approach for Feature Embedding

AIOZ - BMVC 2020: "Deep Metric Learning Meets DeepClustering: An Novel UnsupervisedApproach for Feature Embedding"

This repository is the implementation of CBSwR for Unsupervised Deep Metric Learning task. Our model achieved 55.9, 37.6 on NMI, and 47.5, 45.6 on R@1 over CUB200-2001 and Car196 datasets, respectively. For the detail, please refer to link.

Summary

The proposed framework

Illustration of the proposed framework

Prerequisites

Python3

Please install dependence package by run following command:

pip install -r requirements.txt

Preprocessing

CUB200-2011

The CUB200-2011 dataset should be downloaded via link. The downloaded file should be extracted to data/cub200 directory.

To pre-process CUB200-2011 dataset, please follow:

$ python pre_process/pre_process_cub200.py

Car196

The Car196 dataset should be downloaded via img_link and ano_link. The downloaded files should be extracted to data/car196 directory.

To pre-process Car196 dataset, please follow:

$ python pre_process/pre_process_car196.py

Training

To train CBSwR model on CUB200-2011 dataset, please follow:

$ python train.py --dataset cub200 --model_name CBSwR_CUB200

To train CBSwR model on Car196 dataset, please follow:

$ python train.py --dataset car196 --model_name CBSwR_Car196

The training scores will be printed every epoch.

Testing

In this repo, we include the pre-trained weight of CBSwR_CUB200 and CBSwR_Car196 models.

For CBSwR_CUB200 pretrained model. Please download the link and move to new_checkpoint. The trained CBSwR_CUB200 model can be tested in CUB200 validation set via:

$ python test.py --dataset cub200 --checkpoint_path new_checkpoint/CBSwR_CUB200.pth

For CBSwR_Car196 pretrained model. Please download the link and move to new_checkpoint. The trained CBSwR_Car196 model can be tested in Car196 validation set via:

$ python test.py --dataset car196 --checkpoint_path new_checkpoint/CBSwR_Car196.pth

Citation

If you use this code as part of any published research, we'd really appreciate it if you could cite the following paper:

@inproceedings{aioz_cbswr_bmvc2020,
  author    = {Nguyen, Binh X and Nguyen, Binh D and Carneiro, Gustavo and Tjiputra, Erman and Tran, Quang D and Do, Thanh-Toan},
  title     = {Deep Metric Learning Meets Deep Clustering: An Novel Unsupervised Approach for Feature Embedding},
  booktitle = {BMVC},
  year      = {2020}}
}

License

MIT License

More information

AIOZ AI Homepage: https://ai.aioz.io

AIOZ Network: https://aioz.network