/Contrastive_AutoEval

Our code for ICCV'23 paper "CAME: Contrastive Automated Model Evaluation".

Primary LanguagePythonMIT LicenseMIT

CAME: Contrastive Automated Model Evaluation [Paper]

PyTorch Implementation

This repository contains:

  • the PyTorch implementation of CAME
  • the example on CIFAR-10 setup
  • Contrastive Accuracy calculation and linear regression methods
  • MNIST, CIFAR-100, COCO and TinyImageNet Setups (use imgaug to generate Meta-set). Please see PROJECT_DIR/meta_set/

Please follow the instruction below to install it and run the experiment demo.

Prerequisites

Getting started

  1. Install dependencies

    # COCOAPI
    cd $DIR/libs
    git clone https://github.com/cocodataset/cocoapi.git
    cd cocoapi/PythonAPI
    python setup.py build_ext install
    # CAME
    conda env create --name contrastive_autoeval --file environment.yml
    conda activate contrastive_autoeval
  2. Co-train classifier

    # Save as "PROJECT_DIR/checkpoints/CIFAR10/checkpoint.pth"
    python run.py
  3. Creat Meta-set

    # By default it creates 400 sample sets
    python meta_set/synthesize_set_cifar.py
  4. Test classifier on Meta-set and save the fitted regression model

    # Get "PROJECT_DIR/checkpoints/CIFAR10/accuracy_cifar.npy" file
    python regression.py
  5. Eval on unseen test sets by regression model

    # 1) You will see Rank correlation and Pearsons correlation
    # 2) The absolute error of linear regression is also shown
    python eval.py
  6. Correlation study

    # You will see correlation.pdf;
    python figure/visualize_corr.py
        

Citation

If you use the code in your research, please cite:

    @inproceedings{peng2023came,
    title={Came: Contrastive automated model evaluation},
    author={Peng, Ru and Duan, Qiuyang and Wang, Haobo and Ma, Jiachen and Jiang, Yanbo and Tu, Yongjun and Jiang, Xiu and Zhao, Junbo},
    booktitle={Proceedings of the IEEE/CVF International Conference on Computer Vision},
    pages={20121--20132},
    year={2023}
}

License

MIT