Xiaziheng89 / Adversarial-Motorial-Prototype-Framework-for-Open-Set-Recognition

MIT License
14 stars 4 forks source link

Adversarial Motorial Prototype Framework for Open Set Recognition

Official PyTorch implementation of "Adversarial Reciprocal Points Learning for Open Set Recognition". It needs to say, these codes are modified by http://github.com/iCGY96/ARPL.

1. Requirements

Environments

These codes are supposed to be run with a Linux system. If you use Windows system to run them, it may encounter some errors.

Currently, requires following packages

Datasets

For Tiny-ImageNet, please download the following datasets to ./data/tiny_imagenet and unzip it.

2. Training

Open Set Recognition

To train open set recognition models in paper, run this command:

python osr.py --dataset <DATASET> --loss <LOSS>

Option

--loss can be one of ARPLoss/RPLoss/GCPLoss/Softmax/AMPFLoss.

--dataset is one of mnist/svhn/cifar10/cifar100/tiny_imagenet.

To run ARPL+CS, add --cs after this command.

To run MPF, just use --loss AMPFLoss.

To run AMPF, use --loss AMPFLoss --cs.

To run AMPF++, use --loss AMPFLoss --cs++.

3. Results

We visualize the deep feature of Softmax/GCPL/RPL/ARPL/MPF as below.

/MPFLoss_visualize_open_set.png width="800">

Before getting the figure above, you need to train the LeNet++ network, whose architecture is in "./models/model.py".

Citation