All Projects → ildoonet → Cutmix

ildoonet / Cutmix

Licence: mit
a Ready-to-use PyTorch Extension of Unofficial CutMix Implementations with more improved performance.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Cutmix

All Conv Keras
All Convolutional Network: (https://arxiv.org/abs/1412.6806#) implementation in Keras
Stars: ✭ 115 (+16.16%)
Mutual labels:  data-augmentation, convolutional-neural-networks
Pba
Efficient Learning of Augmentation Policy Schedules
Stars: ✭ 461 (+365.66%)
Mutual labels:  data-augmentation, convolutional-neural-networks
Aaltd18
Data augmentation using synthetic data for time series classification with deep residual networks
Stars: ✭ 124 (+25.25%)
Mutual labels:  data-augmentation, convolutional-neural-networks
Torchio
Medical image preprocessing and augmentation toolkit for deep learning
Stars: ✭ 708 (+615.15%)
Mutual labels:  data-augmentation, convolutional-neural-networks
Deepconvsep
Deep Convolutional Neural Networks for Musical Source Separation
Stars: ✭ 424 (+328.28%)
Mutual labels:  data-augmentation, convolutional-neural-networks
All Classifiers 2019
A collection of computer vision projects for Acute Lymphoblastic Leukemia classification/early detection.
Stars: ✭ 22 (-77.78%)
Mutual labels:  data-augmentation, convolutional-neural-networks
Fast Autoaugment
Official Implementation of 'Fast AutoAugment' in PyTorch.
Stars: ✭ 1,297 (+1210.1%)
Mutual labels:  convolutional-neural-networks
Fakeimagedetector
Image Tampering Detection using ELA and CNN
Stars: ✭ 93 (-6.06%)
Mutual labels:  convolutional-neural-networks
Trained Ternary Quantization
Reducing the size of convolutional neural networks
Stars: ✭ 90 (-9.09%)
Mutual labels:  convolutional-neural-networks
Deep Learning For Beginners
videos, lectures, blogs for Deep Learning
Stars: ✭ 89 (-10.1%)
Mutual labels:  convolutional-neural-networks
Bayesian cnn
Bayes by Backprop implemented in a CNN in PyTorch
Stars: ✭ 98 (-1.01%)
Mutual labels:  convolutional-neural-networks
Pytorch Learners Tutorial
PyTorch tutorial for learners
Stars: ✭ 97 (-2.02%)
Mutual labels:  convolutional-neural-networks
Projectaiai
AiAi.care project is teaching computers to "see" chest X-rays and interpret them how a human Radiologist would. We are using 700,000 Chest X-Rays + Deep Learning to build an FDA 💊 approved, open-source screening tool for Tuberculosis and Lung Cancer. After an MRMC clinical trial, AiAi CAD will be distributed for free to emerging nations, charitable hospitals, and organizations like WHO 🌏 We will also release our pretrained models and weights as Medical Imagenet.
Stars: ✭ 92 (-7.07%)
Mutual labels:  convolutional-neural-networks
Image Quality Assessment
Convolutional Neural Networks to predict the aesthetic and technical quality of images.
Stars: ✭ 1,300 (+1213.13%)
Mutual labels:  convolutional-neural-networks
Cardiac Segmentation
Convolutional Neural Networks for Cardiac Segmentation
Stars: ✭ 94 (-5.05%)
Mutual labels:  convolutional-neural-networks
Kerasr
R interface to the keras library
Stars: ✭ 90 (-9.09%)
Mutual labels:  convolutional-neural-networks
Mongolian Speech Recognition
Mongolian speech recognition with PyTorch
Stars: ✭ 97 (-2.02%)
Mutual labels:  convolutional-neural-networks
Textattack
TextAttack 🐙 is a Python framework for adversarial attacks, data augmentation, and model training in NLP
Stars: ✭ 1,291 (+1204.04%)
Mutual labels:  data-augmentation
Incremental Learning
Pytorch implementation of ACCV18 paper "Revisiting Distillation and Incremental Classifier Learning."
Stars: ✭ 92 (-7.07%)
Mutual labels:  convolutional-neural-networks
Cnniqa
CVPR2014-Convolutional neural networks for no-reference image quality assessment
Stars: ✭ 96 (-3.03%)
Mutual labels:  convolutional-neural-networks

cutmix

a Ready-to-use PyTorch Extension of Unofficial CutMix Implementations.

This re-implementation is improved in some parts,

  • Fixing issue #1 in the original repository
  • issue #3 : Random crop regions are randomly chosen, even within the same batch.
  • issue #4 : Different lambda values(sizes of crop regions) are randomly chosen, even within the same batch.
  • Images to be cropped are randomly chosen in the whole dataset. Original implementation selects images only inside the same batch(shuffling).
  • Easy to install and use on your existing project.
  • With additional augmentations(fast-autoaugment), the performances are improved further.

Hence, there may be slightly-improved training results also.

Requirements

  • python3
  • torch >= 1.1.0

Install

This repository is pip-installable,

$ pip install git+https://github.com/ildoonet/cutmix

or you can copy 'cutmix' folder to your project to use it.

Usage

Our CutMix is inhereted from the PyTorch Dataset class so you can wrap your own dataset(eg. cifar10, imagenet, ...). Also we provide CutMixCrossEntropyLoss, soft version of cross-entropy loss, which accept soft-labels required by cutmix.

from cutmix.cutmix import CutMix
from cutmix.utils import CutMixCrossEntropyLoss
...

dataset = datasets.CIFAR100(args.cifarpath, train=True, download=True, transform=transform_train)
dataset = CutMix(dataset, num_class=100, beta=1.0, prob=0.5, num_mix=2)    # this is paper's original setting for cifar.
...

criterion = CutMixCrossEntropyLoss(True)
for _ in range(num_epoch):
    for input, target in loader:    # input is cutmixed image's normalized tensor and target is soft-label which made by mixing 2 or more labels.
        output = model(input)
        loss = criterion(output, target)
    
        loss.backward()
        optimizer.step()
        optimizer.zero_grad()

Result

PyramidNet-200 + ShakeDrop + CutMix \w CIFAR-100

Top-1 Error(@300epoch) Top-1 Error(Best) Model File
Paper's Reported Result N/A 13.81 N/A
Our Re-implementation 13.68 13.15 Download(12.88)
+ Fast AutoAugment 13.3 12.95

We ran 6 indenpendent experiments with our re-implemented codes and got top-1 errors of 13.09, 13.29, 13.27, 13.24, 13.15 and 12.88, using below command. (Converged at 300epoch with the top-1 errors of 13.55, 13.66, 13.95, 13.9, 13.8 and 13.32.)

$ python train.py -c conf/cifar100_pyramid200.yaml

ResNet + CutMix \w ImageNet

Top-1 Error
(@300epoch)
Top-1 Error
(Best)
Model File
ResNet18 Reported Result \wo CutMix N/A 30.43
Ours 29.674 29.56
ResNet34 Reported Result \wo CutMix N/A 26.456
Ours 24.7 24.57 Download
ResNet50 Paper's Reported Result N/A 21.4 N/A
Author's Code(Our Re-run) 21.768 21.586 N/A
Our Re-implementation 21.524 21.340 Download(21.25)
ResNet200 Our Re-implementation
+ Fast AutoAugment 19.058 18.858
$ python train.py -c conf/imagenet_resnet50.yaml

We ran 5 independent experiments on ResNet50.

  • Author's codes

    • 300epoch : 21.762, 21.614, 21.762, 21.644, 21.810
    • best : 21.56, 21.556, 21.666, 21.498, 21.648
  • Our Re-implementation

    • 300epoch : 21.53, 21.408, 21.55, 21.4, 21.73
    • best : 21.392, 21.328, 21.386, 21.256, 21.34

Reference

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].