Skip to content

Our code for paper "CAME: Contrastive Automated Model Evaluation" in ICCV 2023

License

Notifications You must be signed in to change notification settings

jybxie123/Contrastive_AutoEval

 
 

Repository files navigation

CAME: Contrastive Automated Model Evaluation [Paper]

Statement

This repository is built by the first author Pengr(https://github.com/pengr). As the fourth author, I followed him and forked this paper's project here. To see the original one, please go to: https://github.com/pengr/Contrastive_AutoEval

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. Create 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

About

Our code for paper "CAME: Contrastive Automated Model Evaluation" in ICCV 2023

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 98.2%
  • Shell 1.8%