Home

Awesome

Mitigating Embedding and Class Assignment Mismatch in Unsupervised Image Classification

This repository is the PyTorch codes for "Mitigating Embedding and Class Assignment Mismatch in Unsupervised Image Classification", which will be published in ECCV2020.

Highlight

Required packages

Two stage model architecture

<center><img src="./fig/model_arch.png"> </center>

(a) First stage : Unsupervised deep embedding


super_and.py

The encoder projects input images to a lower dimension embedding sphere via deep embedding (Super-AND). The encoder is trained to gather samples with similar semantic contents nearby and separate them if otherwise.

usage: super_and.py [-h] [--dataset DATASET] [--low_dim LOW_DIM] [--npc_t T]
                    [--npc_m NPC_M] [--ANs_select_rate ANS_SELECT_RATE]
                    [--ANs_size ANS_SIZE] [--lr LR] [--momentum M]
                    [--weight_decay W] [--epochs EPOCHS] [--rounds ROUNDS]
                    [--batch_t T] [--batch_m N] [--batch_size B]
                    [--model_dir MODEL_DIR] [--resume RESUME] [--test_only]
                    [--seed SEED]
Example
python3 super_and.py --dataset cifar10

(b) Second stage: Unsupervised class assignment with refining pretrained embeddings


main.py

Multi-head normalized fully-connected layer classifies images by jointly optimizing the clustering and embedding losses.

usage: main.py [-h] [--dataset DATASET] [--low_dim LOW_DIM] [--lr LR]
               [--momentum M] [--weight_decay W] [--epochs EPOCHS]
               [--batch_t T] [--batch_m N] [--batch_size B]
               [--model_dir MODEL_DIR] [--resume RESUME] [--test_only]
               [--seed SEED]
Example
python3 main.py --dataset cifar10 --resume [first stage pretrained model]
<img src="./fig/stage2.png">

Pretrained Model

Currently, we support the pretrained model for our model and super-AND on CIFAR10 dataset.

Result

Unsupervised Image Classification Result

+ Additional experiments

Supplementary Materials

This repository contains supplementary materials in ECCV2020 directory. You can check implementation details and additional analyses of our model.