Giter VIP home page Giter VIP logo

active_learning's Introduction

Active Learning at the ImageNet Scale

This repo contains code for the following paper:

@misc{emam2021active,
      title={Active Learning at the ImageNet Scale}, 
      author={Zeyad Ali Sami Emam and Hong-Min Chu and Ping-Yeh Chiang and Wojciech Czaja and Richard Leapman and Micah Goldblum and Tom Goldstein},
      year={2021},
      eprint={2111.12880},
      archivePrefix={arXiv},
      primaryClass={cs.CV}}

Please cite our work if you use this code.

Requirements

pip install -r requirements.txt

Comet and Logging

This project uses Comet ML to log all experiments, you must install comet_ml (included in requirements.txt), however, the code does not require the user to have a Comet ML account or to enable comet logging at all. If you choose to use comet ML, then you should include your API key in your home directory ~/.comet.config (more on this in the Comet ML documentation). To use comet make sure the use the flag --enable_comet.

Logs and network weights are stored according to the command line arguments --log_dir and --ckpt_path.

Loading SSP checkpoints

Self-supervised pretrained checkpoints must be obtained separately and specified in ./src/arg_pools for each argpool, under the key "init_pretrained_ckpt_path". To access the checkpoints used in our experiments, please use the following links:

Sample Commands to Reproduce the Results in the Paper

Each Imagenet experiment was conducted on a cluster node with a single V100-SXM2 GPU (32GB VRAM), 64gb of RAM, and 16 2.3 GHz Intel Gold 6140 cpus. If more than one gpu are available on the node, the code will automatically distribute batches across all gpus using DistributedDataParallel training.

Below is a sample command for running an experiment. The full list of command line arguments can be found in src/utils/parser.py.

python main_al.py --dataset_dir <YOUR DATASET DIR HERE> --exp_name RandomSampler_arg_ssp_linear_evaluation_imagenet_b10000 --dataset imagenet --arg_pool ssp_linear_evaluation --model SSLResNet50 --strategy RandomSampler --rounds 8 --round_budget 10000 --init_pool_size 30000 --subset_labeled 50000 --subset_unlabeled 80000 --freeze_feature --partitions 10 --init_pool_type random 

The full list of commands to reproduce all plots in the paper can be obtained by running python src/gen_jobs.py.

active_learning's People

Contributors

zeyademam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

active_learning's Issues

Some errors while reproducing

Hi, Thank you so much for sharing your code.
I run the repository on my personal computer however on remote cluster GPU when I have uploaded and tried my code I am facing the following error
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1091)

urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1091)>
I think this is because of comet

I really want to generate graphs for ImageNet using GPUS.

Regarding related work on trying AL on fixed self-supervised model

In the end of section 3 of your paper, you described
"Consequently, it is important to evaluate AL algorithms when the feature extractor is fixed and only the classifica-tion head is finetuned. This task is a common benchmark inself-supervised learning (SSL) research [13, 14, 26], wherethe proposed SSL method is used to pretrain the network’sfeature extractor, then a linear classification head is trained on the features in a fully-supervised fashion. However, tothe best of our knowledge, AL strategies on ImageNet havenot been evaluated in this specific setting."

There actually seems to be a previous work that did just this.
Please check out the paper "Reducing Label Effort: Self-Supervised meets Active Learning" published on August, 2021.
link: https://arxiv.org/abs/2108.11458
image

The Computation of Normal Vector of DB

Hi, I cannot understand the computation of normal vectors of DBs in the source code.
Because I think the weights of the linear layer in current models can be expressed as the normal vectors of DBs, why do we need to calculate the \delta_weight and epsilon?
Could you please reply when you are free? I have been troubled by this problem for a long time, which makes it difficult for me to fundamentally understand the essence of the algorithm.

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.