Coder Social home page Coder Social logo

1995subhankar1995 / ncp Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 3.0 103 KB

Improving Uncertainty Quantification of Deep Classifiers via Neighborhood Conformal Prediction: Novel Algorithm and Theoretical Analysis(AAAI-2023)

License: MIT License

Python 100.00%

ncp's Introduction

NCP (Neighborhood Conformal Prediction)

This repository contains the code and models necessary to replicate the results of our recent paper:- Improving Uncertainty Quantification of Deep Classifiers via Neighborhood Conformal Prediction: Novel Algorithm and Theoretical Analysis
Please follow the project page for new updates.

Contents

The major content of our repo are:

  • CP/ The main folder containing the python scripts for running the experiments.
  • checkpoints/ Our pre trained models.
  • datasets/ A folder that contains the datasets used in our experiments CIFAR10, CIFAR100, Imagenet.
  • Results/ A folder that contains different files from different experiments.

CP folder contains:

  1. Classification.py: the main code for running experiments.

Prerequisites

Prerequisites for running our code:

  • numpy
  • scipy
  • sklearn
  • torch
  • tqdm
  • seaborn
  • torchvision
  • pandas
  • plotnine

Running instructions

  1. Install dependencies:
conda create -n NCP python=3.8
conda activate NCP
conda install -c conda-forge numpy
conda install -c conda-forge scipy
conda install -c conda-forge scikit-learn
conda install -c conda-forge tqdm
conda install -c conda-forge seaborn
conda install -c conda-forge pandas
conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch
conda install -c conda-forge plotnine

i. Download our trained models from here and extract them to NCP/checkpoints.

ii. If you want to run ImageNet experiments, obtain a copy of ImageNet ILSVRC2012 validation set from here and extract the data. Put the created folders in /datasets/.

  1. The current working directory when running the scripts should be the folder NCP.

To reproduce the results for CIFAR10:

python -W ignore ClassificationTestMyFunctions.py --dataset CIFAR10
python -W ignore plot_classification.py --dataset CIFAR10

To reproduce the results for CIFAR100:

python -W ignore ClassificationTestMyFunctions.py --dataset CIFAR100
python -W ignore plot_classification.py --dataset CIFAR100

To reproduce the results for ImageNet:

python -W ignore ClassificationTestMyFunctions.py --dataset ImageNet
python -W ignore plot_classification.py --dataset ImageNet

ncp's People

Contributors

1995subhankar1995 avatar

Stargazers

Rongxin Xu avatar Alexander Herzog avatar  avatar Leonce Nshuti avatar  avatar valeman avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.