Home

Awesome

AutoCLINT

KakaoBrain pytorch tensorflow autocv 1st place autocv2 1st place HitCount

Automatic Computationally LIght Network Transfer

A specially designed light version of Fast AutoAugment is implemented to adapt to various tasks under limited resources.

This is our solution to NeurIPS 2019 AutoDL Challenges. We won the 1st place in the final learderboards in both AutoCV and AutoCV2 Challenges.

AutoCV/AutoCV2 Challenge Introduction

Fully Automated Image (and Video) Classification without ANY human intervention

Despite recent successes of deep learning and other machine learning techniques, practical experience and expertise is still required to select models and/or choose hyper-parameters when applying techniques to new datasets. This problem is drawing githincreasing interest, yielding progress towards fully automated solutions. In this challenge your machine learning code is trained and tested on this platform, without human intervention whatsoever, on image or video classification tasks you have never seen before, with time and memory limitations. All problems are multi-label classification problems, coming from various domains including medical imaging, satellite imaging, object recognition, character recognition, face recognition, etc. They lend themselves to deep learning solutions, but other methods may be used. Raw data is provided, but formatted in a uniform manner, to encourage you to submit generic algorithms.

Methods

We employ a network transfer strategy and implement a light version of Fast AutoAugment for the fast adaptation and the efficient search of data augmentation policies.

Network Transfer

The AutoCV Challenges are given limited memory and computational resources. Thus, we considered a small size of architecture that could use the pre-trained models that were transferred.

We have discovered the optimal hyperparameters and architectures to get the best performance in five minutes from five public data sets (Munster, Chuckey, Pedro, Decal and Hammer). In this process, no data augmentation is used.

Due to the variability in image size (median shape 28x28x1 for munster vs. 576x944x3 for decal) the input tensor size of network must be automatically adapted for each dataset to allow for adequate aggregation of spatial information and to keep the aspect ratio of original image. We automatically adapt these parameters to the median size of each dataset, so that the network effectively trains on entire datasets. Due to time constraints, we do not increase the input tensor volume (without channels) beyond 64^2. If the median shape of the dataset is smaller than 64^2 then we use the median shape as original input.

MunsterChuckyPedroDecalHammerKreaturKatzeKraut
<sub>data type</sub>imageimageimageimageimagevideovideovideo
<sub>original median shape</sub>28x28x132x32x1203x74x3576x944x3300x400x346x60x80x346x120x160x146x120x160x1
<sub>input tensor shape</sub>28x28x132x32x1128x48x348x64x348x64x38x48x64x38x48x64x18x48x64x1

Fast AutoAugment

Fast AutoAugment learns augmentation policies using a more efficient search strategy based on density matching. Ideally, Fast AutoAugment should be performed automatically, allowing the training data to adapt to test data.

We modify the search space and implement a light version of Fast AutoAugment algorithm to surmount the restricted computational resources.

As Fast AutoAugment, we search the augmentation policies that match the density of train data with density of augmented valid data. We deviate from the original version in that we replace 5-fold with single-fold search and use random search (within subset of searched policy in original) instead of TPE algorithm.

AutoCV Results

Public

V1.XLARGE

metricsMunsterChuckyPedroDecalHammer
ALC0.94210.80820.79480.86470.8147
<sub>2*AUC-1</sub>0.99920.92970.92410.92330.8863
curves

P1.XLARGE

metricsMunsterChuckyPedroDecalHammer
ALC0.94400.78350.73660.83530.8286
<sub>2*AUC-1</sub>0.99770.93530.92140.93470.9142
curves

Private

metricsbeatrizCaucaseHippoc.Saturnukulele
ALC0.67560.73590.77440.83090.9075
<sub>2*AUC-1</sub>0.80140.94110.95340.98840.9985
curves

AutoCV2 Results

Public (video only)

V1.XLARGE

metricsKreatureKatzeKraut
ALC0.86770.86130.6678
<sub>2*AUC-1</sub>0.96130.95880.7365
curves

P1.XLARGE

metricsKreatureKatzeKraut
ALC0.86750.87570.6883
<sub>2*AUC-1</sub>0.95870.95720.7559
curves

Private

metricsIdealfreddyHomerIsaac2Formula
ALC0.82290.75160.38430.70640.7661
<sub>2*AUC-1</sub>0.96050.99450.55000.98450.9661
curves

Final (blind)

metricsApollonloukooumFionaMonica1Kitsune
ALC0.55930.92560.40740.44910.2132
<sub>2*AUC-1</sub>0.80220.99780.53120.86170.2467
curves

Environment Setup & Experiments

$ apt update
$ apt install python3-tk
$ git clone https://github.com/kakaobrain/autoclint.git && cd autoclint
$ # 3rd parties libarary
$ git submodule init
$ git submodule update
$ # download pretrained models
$ wget https://download.pytorch.org/models/resnet18-5c106cde.pth -O ./models/resnet18-5c106cde.pth
$ # download public datasets
$ cd autodl && python download_public_datasets.py && cd ..
$ # images
$ python autodl/run_local_test.py -time_budget=1200 -code_dir='./' -dataset_dir='autodl/AutoDL_public_data/Munster/'; cp autodl/AutoDL_scoring_output/learning-curve-*.png ./results
$ python autodl/run_local_test.py -time_budget=1200 -code_dir='./' -dataset_dir='autodl/AutoDL_public_data/Chucky/'; cp autodl/AutoDL_scoring_output/learning-curve-*.png ./results
$ python autodl/run_local_test.py -time_budget=1200 -code_dir='./' -dataset_dir='autodl/AutoDL_public_data/Pedro/'; cp autodl/AutoDL_scoring_output/learning-curve-*.png ./results
$ python autodl/run_local_test.py -time_budget=1200 -code_dir='./' -dataset_dir='autodl/AutoDL_public_data/Decal/'; cp autodl/AutoDL_scoring_output/learning-curve-*.png ./results
$ python autodl/run_local_test.py -time_budget=1200 -code_dir='./' -dataset_dir='autodl/AutoDL_public_data/Hammer/'; cp autodl/AutoDL_scoring_output/learning-curve-*.png ./results
$ # videos
$ python autodl/run_local_test.py -time_budget=1200 -code_dir='./' -dataset_dir='autodl/AutoDL_public_data/Kreatur/'; cp autodl/AutoDL_scoring_output/learning-curve-*.png ./results
$ python autodl/run_local_test.py -time_budget=1200 -code_dir='./' -dataset_dir='autodl/AutoDL_public_data/Katze/'; cp autodl/AutoDL_scoring_output/learning-curve-*.png ./results
$ python autodl/run_local_test.py -time_budget=1200 -code_dir='./' -dataset_dir='autodl/AutoDL_public_data/Kraut/'; cp autodl/AutoDL_scoring_output/learning-curve-*.png ./results
$ # item2 utils to visualize learning curve
$ wget https://www.iterm2.com/utilities/imgcat -O bin/imgcat; chmod 0677 bin/imgcat
$ bin/imgcat ./results/learning-curve-*.png

Authors and Licensing

This project is developed by Woonhyuk Baek, Ildoo Kim and Sungbin Lim at Kakao Brain. It is distributed under Apache License 2.0.

Citation

If you apply this library to any project and research, please cite our code:

@article{baek2020autoclint,
  title         = {AutoCLINT: The Winning Method in AutoCV Challenge 2019}
  author        = {Woonhyuk Baek and Ildoo Kim and Sungwoong Kim and Sungbin Lim},
  year          = {2020},
  eprint        = {2005.04373},
  archivePrefix = {arXiv}
}

References & Open sources

  1. Fast AutoAugment
  2. Pretrained models for Pytorch
  3. TorchVision models
  4. TQDM: Progress Bar for Python and CLI
  5. AutoCV/AutoDL startking kit