Home

Awesome

Accepted at ICCV 2019 (oral talk) !!

CutMix: Regularization Strategy to Train Strong Classifiers with Localizable Features

Official Pytorch implementation of CutMix regularizer | Paper | Pretrained Models

Sangdoo Yun, Dongyoon Han, Seong Joon Oh, Sanghyuk Chun, Junsuk Choe, Youngjoon Yoo.

Clova AI Research, NAVER Corp.

Our implementation is based on these repositories:

Abstract

Regional dropout strategies have been proposed to enhance the performance of convolutional neural network classifiers. They have proved to be effective for guiding the model to attend on less discriminative parts of objects (e.g. leg as opposed to head of a person), thereby letting the network generalize better and have better object localization capabilities. On the other hand, current methods for regional dropout removes informative pixels on training images by overlaying a patch of either black pixels or random noise. Such removal is not desirable because it leads to information loss and inefficiency during training. We therefore propose the CutMix augmentation strategy: patches are cut and pasted among training images where the ground truth labels are also mixed proportionally to the area of the patches. By making efficient use of training pixels and retaining the regularization effect of regional dropout, CutMix consistently outperforms the state-of-the-art augmentation strategies on CIFAR and ImageNet classification tasks, as well as on the ImageNet weakly-supervised localization task. Moreover, unlike previous augmentation methods, our CutMix-trained ImageNet classifier, when used as a pretrained model, results in consistent performance gains in Pascal detection and MS-COCO image captioning benchmarks. We also show that CutMix improves the model robustness against input corruptions and its out-of-distribution detection performances.

Overview of the results of Mixup, Cutout, and CutMix.

<img width="600" alt="teaser" src="./img1.PNG">

Updates

23 May, 2019: Initial upload

Getting Started

Requirements

Train Examples

python train.py \
--net_type pyramidnet \
--dataset cifar100 \
--depth 200 \
--alpha 240 \
--batch_size 64 \
--lr 0.25 \
--expname PyraNet200 \
--epochs 300 \
--beta 1.0 \
--cutmix_prob 0.5 \
--no-verbose
python train.py \
--net_type resnet \
--dataset imagenet \
--batch_size 256 \
--lr 0.1 \
--depth 50 \
--epochs 300 \
--expname ResNet50 \
-j 40 \
--beta 1.0 \
--cutmix_prob 1.0 \
--no-verbose

Test Examples using Pretrained model

python test.py \
--net_type pyramidnet \
--dataset cifar100 \
--batch_size 64 \
--depth 200 \
--alpha 240 \
--pretrained /set/your/model/path/model_best.pth.tar
python test.py \
--net_type resnet \
--dataset imagenet \
--batch_size 64 \
--depth 50 \
--pretrained /set/your/model/path/model_best.pth.tar
<h2 id="experiments">Experimental Results and Pretrained Models</h2>
MethodTop-1 ErrorModel file
PyramidNet-200 [CVPR'17] (baseline)16.45model
PyramidNet-200 + CutMix14.23model
PyramidNet-200 + Shakedrop [arXiv'18] + CutMix13.81-
PyramidNet-200 + Mixup [ICLR'18]15.63model
PyramidNet-200 + Manifold Mixup [ICML'19]16.14model
PyramidNet-200 + Cutout [arXiv'17]16.53model
PyramidNet-200 + DropBlock [NeurIPS'18]15.73model
PyramidNet-200 + Cutout + Labelsmoothing15.61model
PyramidNet-200 + DropBlock + Labelsmoothing15.16model
PyramidNet-200 + Cutout + Mixup15.46model
MethodTop-1 ErrorModel file
ResNet-50 [CVPR'16] (baseline)23.68model
ResNet-50 + CutMix21.40model
ResNet-50 + Feature CutMix21.80model
ResNet-50 + Mixup [ICLR'18]22.58model
ResNet-50 + Manifold Mixup [ICML'19]22.50model
ResNet-50 + Cutout [arXiv'17]22.93model
ResNet-50 + AutoAugment [CVPR'19]22.40*-
ResNet-50 + DropBlock [NeurIPS'18]21.87*-
ResNet-101 + CutMix20.17model
ResNet-152 + CutMix19.20model
ResNeXt-101 (32x4d) + CutMix19.47model

* denotes results reported in the original papers

Transfer Learning Results

BackboneImageNet Cls (%)ImageNet Loc (%)CUB200 Loc (%)Detection (SSD) (mAP)Detection (Faster-RCNN) (mAP)Image Captioning (BLEU-4)
ResNet5023.6846.349.4176.775.622.9
ResNet50+Mixup22.5845.8449.376.673.923.2
ResNet50+Cutout22.9346.6952.7876.87524.0
ResNet50+CutMix21.6046.2554.8177.676.724.9

Third-party Implementations

Citation

@inproceedings{yun2019cutmix,
    title={CutMix: Regularization Strategy to Train Strong Classifiers with Localizable Features},
    author={Yun, Sangdoo and Han, Dongyoon and Oh, Seong Joon and Chun, Sanghyuk and Choe, Junsuk and Yoo, Youngjoon},
    booktitle = {International Conference on Computer Vision (ICCV)},
    year={2019},
    pubstate={published},
    tppubtype={inproceedings}
}

License

Copyright (c) 2019-present NAVER Corp.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.