GithubHelp home page GithubHelp logo

fairnas's Introduction

[ICCV 2021] FairNAS: Rethinking Evaluation Fairness of Weight Sharing Neural Architecture Search

Introduction

One of the most critical problems in two-stage weight-sharing neural architecture search is the evaluation of candidate models. A faithful ranking certainly leads to accurate searching results. However, current methods are prone to making misjudgments. In this paper, we prove that they inevitably give biased evaluations due to inherent unfairness in the supernet training. In view of this, we propose two levels of constraints: expectation fairness and strict fairness. Particularly, strict fairness ensures equal optimization opportunities for all choice blocks throughout the training, which neither overestimates nor underestimates their capacity. We demonstrate this is crucial to improving confidence in models’ ranking (See Figure 1). Incorporating our supernet trained under fairness constraints with a multi-objective evolutionary search algorithm, we obtain various state-of-the-art models on ImageNet. Especially, FairNAS-A attains 77.5% top-1 accuracy.

Figure 1: Supernet Ranking Ability & Cost

Figure 2: FairNAS Supernet Training

FairNAS-A,B,C Architectures

Requirements

  • Python 3.6 +
  • Pytorch 1.0.1 +

Updates

  • Jul-3-2019: Model release of FairNAS-A, FairNAS-B, FairNAS-C.
  • May-19-2020:Model release of FairNAS-A-SE, FairNAS-B-SE, FairNAS-C-SE and transfered models on CIFAR-10.

Performance Result

Preprocessing

We have reorganized all validation images of the ILSVRC2012 ImageNet by their classes.

  1. Download ILSVRC2012 ImageNet dataset.

  2. Change to ILSVRC2012 directory and run the preprocessing script with

     ./preprocess_val_dataset.sh
    

Evaluate

To evaluate,

python3 verify.py --model [FairNAS_A|FairNAS_B|FairNAS_C] --device [cuda|cpu] --val-dataset-root [ILSVRC2012 root path] --pretrained-path [pretrained model path]

Validate Transferred Model Accuracy

python transfer_verify.py --model [fairnas_a|fairnas_b|fairnas_c] --model-path pretrained/fairnas_[a|b|c]_transfer.pt.tar --gpu_id 0 --se-ratio 1.0 

Results:

FairNAS-A-SE-1.0: flops: 403.36264M, params: 5.835322M, top1: 98.3, top5: 99.99
FairNAS-B-SE-1.0: flops: 370.921184M, params: 5.603242M top1: 98.08, top5: 99.99
FairNAS-C-SE-1.0: flops: 345.228096M, params: 5.42953M  top1: 98.01, top5: 99.99
FairNAS-A-SE-0.5: flops: 414.305856M, params: 4.61373M top1: 98.15, top5: 99.98
FairNAS-B-SE-0.5: flops: 358.330632M, params: 4.42485M, top1: 98.15, top5: 99.99
FairNAS-C-SE-0.5: flops: 333.272088M, params: 4.283586M, top1: 97.99, top5: 99.99

Validate FairNAS-SE models

python verify_se.py --val-dataset-root [ILSVRC2012 root path] --device cuda --model [fairnas_a|fairnas_b|fairnas_c] --model-path pretrained/fairnas_[a|b|c]_se.pth.tar 

Results:

FairNAS-A-SE: mTop1: 77.5480	mTop5: 93.674000
FairNAS-B-SE: mTop1: 77.1900	mTop5: 93.494000
FairNAS-C-SE: mTop1: 76.6700	mTop5: 93.258000
FairNAS-A-SE-0.5: mTop1: 77.3960	mTop5: 93.650000
FairNAS-B-SE-0.5: mTop1: 77.1060	mTop5: 93.528000
FairNAS-C-SE-0.5: mTop1: 76.7600	mTop5: 93.318000

Citation

Your kind citations are welcomed!

@inproceedings{chu2021fairnas,
    title={FairNAS: Rethinking Evaluation Fairness of Weight Sharing Neural Architecture Search},
    author={Chu, Xiangxiang and Zhang, Bo and Xu, Ruijun},
    booktitle={International Conference on Computer Vision},
    year={2021}
}

fairnas's People

Contributors

fairnas avatar miautoml 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fairnas's Issues

参数为什么要一起更新?

你好,
我对FairNAS的理解是,在训练超网的时候,每个batch是等待所有路径 反向传播 梯度相加之后,统一进行参数更新。 我的问题是,对于超网中的每个节点,它只存在于一条路劲中,所以只会接收到一次梯度,没有相加的过程,也没有必要等所有梯度反传之后一起更新参数,请问算法中提到的梯度相加是指什么?
另外,FariNAS虽然解决了很多公平性的问题,但是是否依然存在路径先后问题?就是说对于有相同节点noda P的路径L1和L2,先训练L1的时候,节点P已经被改变,再训练L2的时候,该节点是否会影响到L2的效果?
谢谢!

Kendall Tau in FAIRNAS

Another paper EVALUATING THE SEARCH PHASE OF NEURAL ARCHITECTURE SEARCH tested FairNAS on NASBench101 but get the Kendall Tau of -0.23.

FairNAS using 13 models to evaulate the rank and get the Kendall Tau of 0.9487.

I think the number of models used in FairNAS is the way too little and can not really reflect the rank ability of FairNAS

How do you deal with the tail and head in FairNAS

Hi,

Thanks for your work. I was wondering how do you deal with gradient updates on the non-searchable stages of the model.
The searchable layers will only be updated once, but multiple forward and backward passess would then go through the tail/stem and the detection head. Would you perhaps average the gradients ? or perhaps freeze the parameters of the non-searchable stages ?

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.