Coder Social home page Coder Social logo

nasnet-keras's Introduction

Build Status

NASNetA-Keras

Keras implementation of NASNet-A. The best performing model from the paper Learning Transferable Architectures for Scalable Image Recognition [1]. An extension of AutoML [2].

Demo

demo.ipynb shows how to load a pretrained model and use it to classify an image.

Other versions

As of version 2.1.3 keras includes two versions of NASNet.

If you are

  • Only interested in NASNet-mobile (4 @ 1056) and/or NASNet-large (6 @ 4032).

  • Only interested in using channel last data format.

I would recommend upgrading keras and using the built in version.

This version

Even after the addition of the built in models, there are still some uses for this project, since it is more general.

  • It allows you to create any NASNet-A model. If you want something faster than large and more accurate than mobile.

  • It allows you to load pretrained models using either channel last or channel first data format.

  • It allows you to load any model trained with Googles' implementation (the weights will be converted).

Install

System requirements on Ubuntu 16.04

sudo apt-get install python3-pip python3-tk

Install python requirements and the package

pip3 install https://github.com/johannesu/NASNet-keras/archive/master.zip

You can now use the package in python

from nasnet import mobile
model = mobile()
model.summary()

Reference implementation

Googles' tensorflow-slim implementation: https://github.com/tensorflow/models/tree/master/research/slim/nets/nasnet.

Pretrained weights

Models trained with the reference implementation can be convert to this model. This includes the two trained models provided by Google https://github.com/tensorflow/models/tree/master/research/slim/nets/nasnet.

  • Setup models, download tensorflow checkpoints and convert them to Keras.
import nasnet

# NASNet-A_Mobile_224
model = nasnet.mobile(weights='imagenet')

# NASNet-A_Large_331
model = nasnet.large(weights='imagenet')

Converting the checkpoints can take a few minutes, the work is cached and will be fast the second call.

Model visualization

NASNet-A (6 @ 768) from the paper, visualized in tensorboard:

NASNet-A (6 @ 768)

References

[1] Learning Transferable Architectures for Scalable Image Recognition. https://arxiv.org/abs/1707.07012 Barret Zoph, Vijay Vasudevan, Jonathon Shlens, Quoc V. Le.

[2] AutoML for large scale image classification and object detection https://research.googleblog.com/2017/11/automl-for-large-scale-image.html Barret Zoph, Vijay Vasudevan, Jonathon Shlens, Quoc V. Le.

nasnet-keras's People

Contributors

johannesu avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.