Home

Awesome

L2C: Learning to Cluster

A clustering strategy with deep neural networks. This blog article provides a generic overview.

Introduction

This repository provides the PyTorch implementation of the transfer learning schemes (L2C) and two learning criteria useful for deep clustering:

<sub><sup>*It is renamed from CCL</sup></sub>

This repository covers following references:

@inproceedings{Hsu19_MCL,
	title =	    {Multi-class classification without multi-class labels},
	author =    {Yen-Chang Hsu, Zhaoyang Lv, Joel Schlosser, Phillip Odom, Zsolt Kira},
	booktitle = {International Conference on Learning Representations (ICLR)},
	year =      {2019},
	url =       {https://openreview.net/forum?id=SJzR2iRcK7}
}

@inproceedings{Hsu18_L2C,
	title =     {Learning to cluster in order to transfer across domains and tasks},
	author =    {Yen-Chang Hsu and Zhaoyang Lv and Zsolt Kira},
	booktitle = {International Conference on Learning Representations (ICLR)},
	year =      {2018},
	url =       {https://openreview.net/forum?id=ByRWCqvT-}
}

@inproceedings{Hsu16_KCL,
	title =	    {Neural network-based clustering using pairwise constraints},
	author =    {Yen-Chang Hsu and Zsolt Kira},
	booktitle = {ICLR workshop},
	year =      {2016},
	url =       {https://arxiv.org/abs/1511.06321}
}

Preparation

This repository supports PyTorch 1.0, python 2.7, 3.6, and 3.7.

pip install -r requirements.txt

Demo

Supervised Classification/Clustering with only pairwise similarity

# A quick trial:
python demo.py  # Default Dataset:MNIST, Network:LeNet, Loss:MCL
python demo.py --loss KCL

# Lookup available options:
python demo.py -h

# For more examples:
./scripts/exp_supervised_MCL_vs_KCL.sh

Unsupervised Clustering (Cross-task Transfer Learning)

# Learn the Similarity Prediction Network (SPN) with Omniglot_background and then transfer to the 20 alphabets in Omniglot_evaluation.
# Default loss is MCL with an unknown number of clusters (Set a large cluster number, i.e., k=100)
# It takes about half an hour to finish.
python demo_omniglot_transfer.py

# An example of using KCL and set k=gt_#cluster
python demo_omniglot_transfer.py --loss KCL --num_cluster -1

# Lookup available options:
python demo_omniglot_transfer.py -h

# Other examples:
./scripts/exp_unsupervised_transfer_Omniglot.sh

Notes

Datasetgt #classKCL (k=100)MCL (k=100)KCL (k=gt)MCL (k=gt)
Angelic2073.2%82.2%89.0%91.7%
Atemayar_Qelisayer2673.3%89.2%82.5%86.0%
Atlantean2665.5%83.3%89.4%93.5%
Aurek_Besh2688.4%92.8%91.5%92.4%
Avesta2679.0%85.8%85.4%86.1%
Ge_ez2677.1%84.0%85.4%86.6%
Glagolitic4583.9%85.3%84.9%87.4%
Gurmukhi4578.8%78.7%77.0%78.0%
Kannada4164.6%81.1%73.3%81.2%
Keble2691.4%95.1%94.7%94.3%
Malayalam4773.5%75.0%72.7%73.0%
Manipuri4082.8%81.2%85.8%81.5%
Mongolian3084.7%89.0%88.3%90.2%
Old_Church_Slavonic_Cyrillic4589.9%90.7%88.7%89.8%
Oriya4656.5%73.4%63.2%75.3%
Sylheti2861.8%68.2%69.8%80.6%
Syriac_Serto2372.1%82.0%85.8%89.8%
Tengwar2567.7%76.4%82.5%85.5%
Tibetan4281.8%80.2%84.3%81.9%
ULOG2653.3%77.1%73.0%89.1%
--Average--75.0%82.5%82.4%85.7%

Compare MCL and KCL

The loss surface of MCL is more similar to the cross-entropy (CE) than KCL. Empirically, MCL converged faster than KCL. For details, please refer to the ICLR paper.

<a href="https://openreview.net/pdf?id=SJzR2iRcK7"><img src="fig/loss_surface_compare.png" width="640"></a>

Related Applications

Lane detection for autonomous driving / Instance segmentation

@article{Hsu18_InsSeg,
	title =     {Learning to Cluster for Proposal-Free Instance Segmentation},
	author =    {Yen-Chang Hsu, Zheng Xu, Zsolt Kira, Jiawei Huang},
	booktitle = {accepted to the International Joint Conference on Neural Networks (IJCNN)},
	year =      {2018},
	url =       {https://arxiv.org/abs/1803.06459}
}

Acknowledgments

This work was supported by the National Science Foundation and National Robotics Initiative (grant # IIS-1426998) and DARPA’s Lifelong Learning Machines (L2M) program, under Cooperative Agreement HR0011-18-2-001.