All Projects → qubvel → Efficientnet

qubvel / Efficientnet

Licence: apache-2.0
Implementation of EfficientNet model. Keras and TensorFlow Keras.

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to Efficientnet

Imgclsmob
Sandbox for training deep learning networks
Stars: ✭ 2,405 (+25.26%)
Mutual labels:  classification, image-classification, imagenet, pretrained-models
Tf Mobilenet V2
Mobilenet V2(Inverted Residual) Implementation & Trained Weights Using Tensorflow
Stars: ✭ 85 (-95.57%)
Mutual labels:  image-classification, imagenet, mobilenet
super-gradients
Easily train or fine-tune SOTA computer vision models with one open source training library
Stars: ✭ 429 (-77.66%)
Mutual labels:  imagenet, image-classification, pretrained-models
Ghostnet
CV backbones including GhostNet, TinyNet and TNT, developed by Huawei Noah's Ark Lab.
Stars: ✭ 1,744 (-9.17%)
Mutual labels:  imagenet, mobilenet, pretrained-models
Pytorch Mobilenet V3
MobileNetV3 in pytorch and ImageNet pretrained models
Stars: ✭ 616 (-67.92%)
Mutual labels:  classification, imagenet, mobilenet
pigallery
PiGallery: AI-powered Self-hosted Secure Multi-user Image Gallery and Detailed Image analysis using Machine Learning, EXIF Parsing and Geo Tagging
Stars: ✭ 35 (-98.18%)
Mutual labels:  imagenet, image-classification, pretrained-models
Neural Backed Decision Trees
Making decision trees competitive with neural networks on CIFAR10, CIFAR100, TinyImagenet200, Imagenet
Stars: ✭ 411 (-78.59%)
Mutual labels:  image-classification, imagenet, pretrained-models
Regnet
Pytorch implementation of network design paradigm described in the paper "Designing Network Design Spaces"
Stars: ✭ 129 (-93.28%)
Mutual labels:  classification, image-classification, imagenet
Mmclassification
OpenMMLab Image Classification Toolbox and Benchmark
Stars: ✭ 532 (-72.29%)
Mutual labels:  image-classification, imagenet, mobilenet
Classification models
Classification models trained on ImageNet. Keras.
Stars: ✭ 938 (-51.15%)
Mutual labels:  imagenet, pretrained-models, mobilenet
Caffe Model
Caffe models (including classification, detection and segmentation) and deploy files for famouse networks
Stars: ✭ 1,258 (-34.48%)
Mutual labels:  classification, imagenet
Bsconv
Reference implementation for Blueprint Separable Convolutions (CVPR 2020)
Stars: ✭ 84 (-95.62%)
Mutual labels:  image-classification, mobilenet
Pytorch Classification
Classification with PyTorch.
Stars: ✭ 1,268 (-33.96%)
Mutual labels:  classification, imagenet
Hbonet
[ICCV 2019] Harmonious Bottleneck on Two Orthogonal Dimensions
Stars: ✭ 94 (-95.1%)
Mutual labels:  imagenet, pretrained-models
Malware Classification
Towards Building an Intelligent Anti-Malware System: A Deep Learning Approach using Support Vector Machine for Malware Classification
Stars: ✭ 88 (-95.42%)
Mutual labels:  classification, image-classification
Mobilenet Caffe
Caffe Implementation of Google's MobileNets (v1 and v2)
Stars: ✭ 1,217 (-36.61%)
Mutual labels:  imagenet, mobilenet
Pytorch Image Models
PyTorch image models, scripts, pretrained weights -- ResNet, ResNeXT, EfficientNet, EfficientNetV2, NFNet, Vision Transformer, MixNet, MobileNet-V3/V2, RegNet, DPN, CSPNet, and more
Stars: ✭ 15,232 (+693.33%)
Mutual labels:  pretrained-models, efficientnet
Petridishnn
Code for the neural architecture search methods contained in the paper Efficient Forward Neural Architecture Search
Stars: ✭ 112 (-94.17%)
Mutual labels:  image-classification, imagenet
Paddlex
PaddlePaddle End-to-End Development Toolkit(『飞桨』深度学习全流程开发工具)
Stars: ✭ 3,399 (+77.03%)
Mutual labels:  classification, mobilenet
Mobilenet
A Clearer and Simpler MobileNet Implementation in TensorFlow
Stars: ✭ 119 (-93.8%)
Mutual labels:  classification, mobilenet

EfficientNet Keras (and TensorFlow Keras)

PyPI version Downloads

This repository contains a Keras (and TensorFlow Keras) reimplementation of EfficientNet, a lightweight convolutional neural network architecture achieving the state-of-the-art accuracy with an order of magnitude fewer parameters and FLOPS, on both ImageNet and five other commonly used transfer learning datasets.

The codebase is heavily inspired by the TensorFlow implementation.

Important!

There was a huge library update on 24th of July 2019. Now efficientnet works with both frameworks: keras and tensorflow.keras. If you have models trained before that date, please use efficientnet of version 0.0.4 to load them. You can roll back using pip install -U efficientnet==0.0.4 or pip install -U git+https://github.com/qubvel/efficientnet/tree/v0.0.4.

Table of Contents

  1. About EfficientNet Models
  2. Examples
  3. Models
  4. Installation
  5. Frequently Asked Questions
  6. Acknowledgements

About EfficientNet Models

EfficientNets rely on AutoML and compound scaling to achieve superior performance without compromising resource efficiency. The AutoML Mobile framework has helped develop a mobile-size baseline network, EfficientNet-B0, which is then improved by the compound scaling method to obtain EfficientNet-B1 to B7.

EfficientNets achieve state-of-the-art accuracy on ImageNet with an order of magnitude better efficiency:

  • In high-accuracy regime, EfficientNet-B7 achieves the state-of-the-art 84.4% top-1 / 97.1% top-5 accuracy on ImageNet with 66M parameters and 37B FLOPS. At the same time, the model is 8.4x smaller and 6.1x faster on CPU inference than the former leader, Gpipe.

  • In middle-accuracy regime, EfficientNet-B1 is 7.6x smaller and 5.7x faster on CPU inference than ResNet-152, with similar ImageNet accuracy.

  • Compared to the widely used ResNet-50, EfficientNet-B4 improves the top-1 accuracy from 76.3% of ResNet-50 to 82.6% (+6.3%), under similar FLOPS constraints.

Examples

  • Initializing the model:
# models can be build with Keras or Tensorflow frameworks
# use keras and tfkeras modules respectively
# efficientnet.keras / efficientnet.tfkeras
import efficientnet.keras as efn 

model = efn.EfficientNetB0(weights='imagenet')  # or weights='noisy-student'
  • Loading the pre-trained weights:
# model use some custom objects, so before loading saved model
# import module your network was build with
# e.g. import efficientnet.keras / import efficientnet.tfkeras
import efficientnet.tfkeras
from tensorflow.keras.models import load_model

model = load_model('path/to/model.h5')

See the complete example of loading the model and making an inference in the Jupyter notebook here.

Models

The performance of each model variant using the pre-trained weights converted from checkpoints provided by the authors is as follows:

Architecture @top1* Imagenet @top1* Noisy-Student
EfficientNetB0 0.772 0.788
EfficientNetB1 0.791 0.815
EfficientNetB2 0.802 0.824
EfficientNetB3 0.816 0.841
EfficientNetB4 0.830 0.853
EfficientNetB5 0.837 0.861
EfficientNetB6 0.841 0.864
EfficientNetB7 0.844 0.869

* - topK accuracy score for converted models (imagenet val set)

Installation

Requirements

  • Keras >= 2.2.0 / TensorFlow >= 1.12.0
  • keras_applications >= 1.0.7
  • scikit-image

Installing from the source

$ pip install -U git+https://github.com/qubvel/efficientnet

Installing from PyPI

PyPI stable release

$ pip install -U efficientnet

PyPI latest release (with keras and tf.keras support)

$ pip install -U --pre efficientnet

Frequently Asked Questions

  • How can I convert the original TensorFlow checkpoints to Keras HDF5?

Pick the target directory (like dist) and run the converter script from the repo directory as follows:

$ ./scripts/convert_efficientnet.sh --target_dir dist

You can also optionally create the virtual environment with all the dependencies installed by adding --make_venv=true and operate in a self-destructing temporary location instead of the target directory by setting --tmp_working_dir=true.

Acknowledgements

I would like to thanks community members who actively contribute to this repository:

  1. Sasha Illarionov (@sdll) for preparing automated script for weights conversion
  2. Björn Barz (@Callidior) for model code adaptation for keras and tensorflow.keras frameworks
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].