An implement of the NeurIPS 2022 paper: Exploring the Algorithm-Dependent Generalization of AUPRC Optimization with List Stability.
- Ubuntu 16.04
- CUDA 11.1
- Python 3.8.10
- Pytorch 1.8.2+cu11
See requirement.txt
for others.
Download SOP, PKU VehicleID, and iNaturalist. Unzip these files and place then in ./data/[dataset]/images
.
Download the pretrained model of ResNet-50 in ./pretrained_models
.
Run the following command for training & validation
bash scripts/run.sh config/$DATASET/$CONFIG $gpu_id
For example,
bash scripts/run.sh config/iNaturalist/soprc_sgd.yaml 0
bash scripts/test.sh config/$DATASET/$CONFIG $gpu_id
For example,
bash scripts/test.sh config/iNaturalist/soprc_sgd.yaml 0
The following methods are provided in this repository (see Appendix in our paper):
- Pairwise Losses, including Contrastive Loss, Triplet Loss, Multi-Similarity (MS) Loss, Cross-Batch Memory (XBM)
- Ranking-Based Losses, including SmoothAP, FastAP, DIR, BlackBox, Area Under the ROC Curve Loss (AUROC), and SOPRC (Ours)
See losses/loss_warpper.py
for usage.
By default, these losses take a dict with keys "feat" and "target" as input.
Here the feature is an config/demo.yaml
for more details on configures. For example, by setting batchsize = 224
, num_sample_per_id = 4
, output_channels = 512
, we have
If this code is helpful to you, please consider citing our paper:
@inproceedings{wen2022exploring,
title={Exploring the Algorithm-Dependent Generalization of AUPRC Optimization with List Stability},
author={Wen, Peisong and Xu, Qianqian and Yang, Zhiyong and He, Yuan and Huang, Qingming},
booktitle={Annual Conference on Neural Information Processing Systems},
year={2022}
}