SPICE: Semantic Pseudo-labeling for Image Clustering

July 27, 2022 ยท View on GitHub

By Chuang Niu, Hongming Shan, and Ge Wang

This is a Pytorch implementation of the paper.

PWC PWC PWC PWC PWC

Installation

Please refer to requirement.txt for all required packages. Assuming Anaconda with python 3.8, a step-by-step example for installing this project is as follows:

conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch
conda install -c conda-forge addict tensorboard python-lmdb
conda install matplotlib scipy scikit-learn pillow
conda install -c anaconda seaborn

Then, clone this repo

git clone https://github.com/niuchuangnn/SPICE.git
cd SPICE

Data

Prepare datasets of interest as described in dataset.md.

Training

Read the training tutorial for details.

Evaluation

Evaluation of SPICE-Self:

python tools/eval_self.py --config-file configs/stl10/eval.py --weight PATH/TO/MODEL --all 1

Evaluation of SPICE-Semi:

python tools/eval_semi.py --load_path PATH/TO/MODEL --net WideResNet --widen_factor 2 --data_dir PATH/TO/DATA --dataset cifar10 --all 1 

Read the evaluation tutorial for more descriptions about the evaluation and the visualization of learned clusters.

Model Zoo

All trained models in our paper are available as follows.

DatasetVersionACCNMIARIModel link
STL10SPICE-Self91.082.081.5Model
SPICE93.887.287.0Model
SPICE-Self*89.980.979.7Model
SPICE*92.986.085.3Model
CIFAR10SPICE-Self83.873.470.5Model
SPICE92.686.585.2Model
SPICE-Self*84.974.571.8Model
SPICE*91.785.883.6Model
CIFAR100SPICE-Self46.844.829.4Model
SPICE53.856.738.7Model
SPICE-Self*48.045.030.8Model
SPICE*58.458.342.2Model
ImageNet-10 (ImageNet Pretrained)SPICE-Self96.992.793.3Model
SPICE96.791.792.9Model
ImageNet-Dog (ImageNet Pretrained)SPICE-Self54.649.836.2Model
SPICE55.450.434.3Model
ImageNet-10SPICE-Self92.182.883.6Model
SPICE95.990.291.2Model
ImageNet-DogSPICE-Self64.657.247.9Model
SPICE67.562.752.6Model
TinyImageNetSPICE-Self30.544.916.3Model
SPICE-Self*29.252.514.5Model

More models based on ResNet18 for both SPICE-Self* and SPICE-Semi*.

DatasetVersionACCNMIARIModel link
STL10SPICE-Self*86.275.673.2Model
SPICE*92.085.283.6Model
CIFAR10SPICE-Self*84.573.970.9Model
SPICE*91.885.083.6Model
CIFAR100SPICE-Self*46.845.732.1Model
SPICE*53.556.540.4Model

Acknowledgement for reference repos

License

This project is under the CC-BY-NC 4.0 license. See LICENSE for details.

Citation

@misc{niu2021spice,
      title={SPICE: Semantic Pseudo-labeling for Image Clustering}, 
      author={Chuang Niu and Ge Wang},
      year={2021},
      eprint={2103.09382},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}