All Projects → clovaai → Assembled Cnn

clovaai / Assembled Cnn

Licence: apache-2.0
Tensorflow implementation of "Compounding the Performance Improvements of Assembled Techniques in a Convolutional Neural Network"

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Assembled Cnn

Artificio
Deep Learning Computer Vision Algorithms for Real-World Use
Stars: ✭ 326 (+2.19%)
Mutual labels:  convolutional-neural-networks, image-classification, transfer-learning
Skin Lesions Classification DCNNs
Transfer Learning with DCNNs (DenseNet, Inception V3, Inception-ResNet V2, VGG16) for skin lesions classification
Stars: ✭ 47 (-85.27%)
Mutual labels:  imagenet, image-classification, transfer-learning
Rexnet
Official Pytorch implementation of ReXNet (Rank eXpansion Network) with pretrained models
Stars: ✭ 319 (+0%)
Mutual labels:  image-classification, transfer-learning, imagenet
Computer Vision
Programming Assignments and Lectures for Stanford's CS 231: Convolutional Neural Networks for Visual Recognition
Stars: ✭ 408 (+27.9%)
Mutual labels:  convolutional-neural-networks, image-classification, imagenet
Keras transfer cifar10
Object classification with CIFAR-10 using transfer learning
Stars: ✭ 120 (-62.38%)
Mutual labels:  convolutional-neural-networks, image-classification, transfer-learning
Iresnet
Improved Residual Networks (https://arxiv.org/pdf/2004.04989.pdf)
Stars: ✭ 163 (-48.9%)
Mutual labels:  convolutional-neural-networks, image-classification, imagenet
super-gradients
Easily train or fine-tune SOTA computer vision models with one open source training library
Stars: ✭ 429 (+34.48%)
Mutual labels:  imagenet, image-classification, transfer-learning
Big transfer
Official repository for the "Big Transfer (BiT): General Visual Representation Learning" paper.
Stars: ✭ 1,096 (+243.57%)
Mutual labels:  convolutional-neural-networks, transfer-learning, imagenet
Tf Mobilenet V2
Mobilenet V2(Inverted Residual) Implementation & Trained Weights Using Tensorflow
Stars: ✭ 85 (-73.35%)
Mutual labels:  convolutional-neural-networks, image-classification, imagenet
Image classifier
CNN image classifier implemented in Keras Notebook 🖼️.
Stars: ✭ 139 (-56.43%)
Mutual labels:  convolutional-neural-networks, image-classification, transfer-learning
Transfer Learning Suite
Transfer Learning Suite in Keras. Perform transfer learning using any built-in Keras image classification model easily!
Stars: ✭ 212 (-33.54%)
Mutual labels:  convolutional-neural-networks, image-classification, transfer-learning
img classification deep learning
No description or website provided.
Stars: ✭ 19 (-94.04%)
Mutual labels:  imagenet, image-classification
BottleneckTransformers
Bottleneck Transformers for Visual Recognition
Stars: ✭ 231 (-27.59%)
Mutual labels:  imagenet, image-classification
backprop
Backprop makes it simple to use, finetune, and deploy state-of-the-art ML models.
Stars: ✭ 229 (-28.21%)
Mutual labels:  image-classification, transfer-learning
favorite-research-papers
Listing my favorite research papers 📝 from different fields as I read them.
Stars: ✭ 12 (-96.24%)
Mutual labels:  image-classification, transfer-learning
Parametric-Contrastive-Learning
Parametric Contrastive Learning (ICCV2021)
Stars: ✭ 155 (-51.41%)
Mutual labels:  imagenet, image-classification
deep-learning
Projects include the application of transfer learning to build a convolutional neural network (CNN) that identifies the artist of a painting, the building of predictive models for Bitcoin price data using Long Short-Term Memory recurrent neural networks (LSTMs) and a tutorial explaining how to build two types of neural network using as input the…
Stars: ✭ 43 (-86.52%)
Mutual labels:  image-classification, transfer-learning
LegoBrickClassification
Repository to identify Lego bricks automatically only using images
Stars: ✭ 57 (-82.13%)
Mutual labels:  image-classification, transfer-learning
image-classification
A collection of SOTA Image Classification Models in PyTorch
Stars: ✭ 70 (-78.06%)
Mutual labels:  imagenet, image-classification
etiketai
Etiketai is an online tool designed to label images, useful for training AI models
Stars: ✭ 63 (-80.25%)
Mutual labels:  imagenet, image-classification

Compounding the Performance Improvements of Assembled Techniques in a Convolutional Neural Network

What's New

July 11, 2020

  • We reimplemented assemble-resnet with tensorflow 2.1. If you want to see the code with better readability, refer to this branch.

paper v2 | pretrained model

Official Tensorflow implementation

Jungkyu Lee, Taeryun Won, Tae Kwan Lee, Hyemin Lee, Geonmo Gu, Kiho Hong
@NAVER/LINE Vision

Abstract

Recent studies in image classification have demonstrated a variety of techniques for improving the performance of Convolutional Neural Networks (CNNs). However, attempts to combine existing techniques to create a practical model are still uncommon. In this study, we carry out extensive experiments to validate that carefully assembling these techniques and applying them to basic CNN models (e.g., ResNet and MobileNet) can improve the accuracy and robustness of the models while minimizing the loss of throughput. Our proposed assembled ResNet-50 shows improvements in top-1 accuracy from 76.3% to 82.78%, mCE from 76.0% to 48.9% and mFR from 57.7% to 32.3% on ILSVRC2012 validation set. With these improvements, inference throughput only decreases from 536 to 312. To verify the performance improvement in transfer learning, fine grained classification and image retrieval tasks were tested on several public datasets and showed that the improvement to backbone network performance boosted transfer learning performance significantly. Our approach achieved 1st place in the iFood Competition Fine-Grained Visual Recognition at CVPR 2019

Main Results

Summary of key results

Ablation Study

Transfer learning

Honor

Related links

Thankfully some people have written testimonial and posts related to our paper.

Tutorial: Fine-Tuning on Oxford-flower102

As first try, you can fine-tune your flower classifier in colab.

Open In Colab

Getting Started

  • This work was tested with Tensorflow 1.14.0, CUDA 10.0, python 3.6.

Requirements

pip install Pillow sklearn requests Wand tqdm

Data preparation

We assume you already have the following data:

  • ImageNet2012 raw images and tfrecord. For this data, please refer to here
  • For knowledge distillation, you need to add the teacher's logits to the TFRecord according to here
  • For transfer learing datasets, refer to scripts in here
  • To download pretrained model, visit here
  • To make mCE evaluation dataset. refer to here

Reproduce Results

First, download pretrained models from here.

For Assemble-ResNet50,

DATA_DIR=/path/to/imagenet2012/tfrecord
MODEL_DIR=/path/Assemble-ResNet50/checkpoint
CUDA_VISIBLE_DEVICES=1 python main_classification.py \
--eval_only=True \
--dataset_name=imagenet \
--data_dir=${DATA_DIR} \
--model_dir=${MODEL_DIR} \
--preprocessing_type=imagenet_224_256 \
--resnet_version=2 \
--resnet_size=50 \
--use_sk_block=True \
--use_resnet_d==False \
--anti_alias_type=sconv \
--anti_alias_filter_size=3 

Note that use_resnet_d==False. We have implemented BigLittleNet with reference to the official implementation of BigLittleNet We found that BigLittleNet's official implementation already includes the concept of resnet-d. that is, in both resnet_d_projection_shortcut and bl_projection_shortcut, a average pooling layer has been added with a stride of 2 before the convolution(except pooling size is different). So we described it in the paper as D + BL. However, when using BL, we did not use tweak that replaces 7x7 convolution with three 3x3 conv(so it become use_resnet_d=False) because it made training unstable. I thought it was a little tricky. We will further explain it in the v2 version of our paper.

For Assemble-ResNet152,

DATA_DIR=/path/to/imagenet2012/tfrecord
MODEL_DIR=/path/Assemble-ResNet152/checkpoint
CUDA_VISIBLE_DEVICES=1 python main_classification.py \
--eval_only=True \
--dataset_name=imagenet \
--data_dir=${DATA_DIR} \
--model_dir=${MODEL_DIR} \
--preprocessing_type=imagenet_224_256a \
--resnet_version=2 \
--resnet_size=152 \
--bl_alpha=1 \
--bl_beta=2 \
--use_sk_block=True \
--anti_alias_type=sconv \
--anti_alias_filter_size=3 

For Assemble-ResNet 152, preprocessing_type=imagenet_224_256a(resize the shorter size of each image to 257 pixels while the aspect ratio is maintained. Next, we center crop the image to the 256x256 size) performed better.

The expected final output is`

...
| accuracy:   0.841860 |
...

Training a model from scratch.

For training parameter information, refer to here

Train vanila ResNet50 on ImageNet from scratch.

$ ./scripts/train_vanila_from_scratch.sh

Train all-assemble ResNet50 on ImageNet from scratch.

$ ./scripts/train_assemble_from_scratch.sh

Fine-tuning the model.

In the previous section, you train the pretrained model from scratch. You can also download pretrained model to finetune from here.

Fine-tune vanila ResNet50 on Food101.

$ ./scripts/finetuning_vanila_on_food101.sh

Train all-assemble ResNet50 on Food101.

$ ./scripts/finetuning_assemble_on_food101.sh

mCE evaluation

You can calculate mCE on the trained model as follows:

$ ./eval_assemble_mCE_on_imagenet.sh

Acknowledgements

This implementation is based on these repository:

Contact

Feel free to create a issue or contact me if there is any question (Jungkyu Lee [email protected]).

Citation

@misc{lee2020compounding,
    title={Compounding the Performance Improvements of Assembled Techniques in a Convolutional Neural Network},
    author={Jungkyu Lee, Taeryun Won, Tae Kwan Lee, Hyemin Lee, Geonmo Gu, Kiho Hong},
    year={2020},
    eprint={2001.06268v2},
    archivePrefix={arXiv},
    primaryClass={cs.CV}
}

License

   Copyright 2020-present NAVER Corp.

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
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].