Home

Awesome

Confidence-Aware Learning for Deep Neural Networks

This repository provides the code for training with Correctness Ranking Loss presented in the paper "Confidence-Aware Learning for Deep Neural Networks" accepted to ICML2020.

Getting Started

Requirements

* ubuntu 18.0.4, cuda10
* python 3.6.8
* pytorch >= 1.2.0
* torchvision >= 0.4.0 

Datasets

How to Run

Arguments

ArgsTypeDescriptionDefault
epochs[int]epochs300
batch_size[int]batch size128
data[str]cifar10, cifar100, svhncifar10
model[str]res, dense, vggres
rank_target[str]softmax, entropy, marginsoftmax
rank_weight[float]rank_weight1.0
data_path[str]data path./data/
save_path[str]save files path-
file_name[str]pretrained file name-
gpu[str]gpu number0

Train with Correctness Ranking Loss

# Examples 
python main.py --save_path ./res_cifar10/softmax/ --model res --data cifar10 --rank_target softmax --rank_weight 1.0 --gpu 0 
python main.py --save_path ./vgg_cifar100/entropy/ --model vgg --data cifar100 --rank_target entropy --rank_weight 1.0 --gpu 0 

Train baseline models

# Examples
python main.py --save_path ./res_cifar10/baseline/ --model res --data cifar10 --rank_weight 0.0 --gpu 0 
python main.py --save_path ./vgg_cifar100/baseline/ --model vgg --data cifar100 --rank_weight 0.0 --gpu 0 

Evaluate the trained model

# Calculate performance measures from the trained model `file_name.pth` located in `save_path`

|---- test.py
|     |---- save_path
|           |---- file_name.pth
|           |---- result.log

python test.py --save_path ./res_cifar10/ --file_name model --model res --data cifar10 --gpu 0 
python test.py --save_path ./vgg_svhn/ --file_name model --model vgg --data svhn --gpu 0

Results

Performance measures

Results on CIFAR-100

ArchitectureDatasetModelACCAURCAUPRFPRECENLL
PreActResNet110CIFAR100Baseline73.3286.5465.3766.4216.3914.93
PreActResNet110CIFAR100CRL-softmax74.3472.3568.1361.3011.4510.86
DenseNet_BCCIFAR100Baseline75.1372.4066.4162.8512.9411.59
DenseNet_BCCIFAR100CRL-softmax76.7562.7165.8760.228.669.12
VGG16CIFAR100Baseline73.6277.8068.1162.2119.9518.35
VGG16CIFAR100CRL-softmax73.8471.9871.0459.0613.9213.03

Citation

@inproceedings{moon2020crl,
  title={Confidence-Aware Learning for Deep Neural Networks},
  author={Moon, Jooyoung and Kim, Jihyo and Shin, Younghak and Hwang, Sangheum},
  booktitle={International Conference on Machine Learning},
  year={2020}
}

Contact for issues