Coder Social home page Coder Social logo

mnasnet_tensorflow's Introduction

MNASNET Tensorflow

An unofficial implementation of MNASNet. Use Tensorflow Slim. MNASNet is a CNN model proposed by Google for mobile devices.It is faster and more accurate than previous models, such as Mobilenet V2 and Shufflenet V2.

References: MnasNet: Platform-Aware Neural Architecture Search for Mobile by Mingxing Tan, et. al.

Object Detection

We tested the replacement of ResNet with MNASNet-b1 as the backbone of RetinaNet.Evaluation on the MSCOCO17 val after training on the MSCOCO17 train dataset.We have achieved a mAP of 33.7.We have achieved a mAP of 33.7, which is slightly better than using MobileNet V2 as the backbone(33.7 vs 33.4).All work on object detection uses the object detection api of tensorflow.We just wrote a feature extractor and related configuration files.

How To Use

The basic implementation of Mnasnet is in the /mnasnet directory. If you want to use it, copy it to the /slim/nets directory, then add mnasnet to nets_factory.py.

networks_map = {
                #......
                'mnasnet_a1':mnasnet.mnasnet_a1,
                'mnasnet_b1':mnasnet.mnasnet_b1
               }

arg_scopes_map = {
                  #......
                  'mnasnet_a1':mnasnet.training_scope,
                  'mnasnet_b1':mnasnet.training_scope,
                 }

If you want to use mnasnet in the object detection api, we provide the implementation of retinanet.Copy the files in the /object_detection/models directory to where the object detection api is located, then add the model to model_builder.py.The configuration file is provided in the /object_detection/samples/configs/ directory

SSD_FEATURE_EXTRACTOR_CLASS_MAP = {
    #......
    'ssd_mnasnet_a1_fpn':SSDMNASNetA1FpnFeatureExtractor,
    'ssd_mnasnet_b1_fpn':SSDMNASNetB1FpnFeatureExtractor,
}

Pretrained models

Imagenet Model

Model Input Size Depth Multiplier Top-1 Accuracy Top-5 Accuracy Pixel 1 latency (ms) DownLoad Link
mnasnet-b1 224*224 1.0 74.094 92.002 TBA mnasnet_b1_1.0_224.tar
mnasnet-a1 224*224 1.0 TBA TBA TBA TBA

MSCOCO17 Model

Model Input Size Depth Multiplier mAP(IOU 0.05:0.95) mAP.L mAP.M mAP.S Pixel 1 latency (ms) DownLoad Link
ssd-mnasnet-b1-fpn 640*640 1.0 33.7 47.7 30.5 11.7 TBA ssd_mnasnet_b1_fpn_shared_box_predictor_640x640_coco17_2019_03_21.tar
ssd-mobilenet-v1-fpn 640*640 1.0 32.5 46.0 29.2 10.1 TBA ssd_mobilenet_v1_fpn_shared_box_predictor_640x640_coco17_2019_03_21.tar
ssd-mobilenet-v2-fpn 640*640 1.0 33.4 47.2 30.5 10.7 TBA ssd_mobilenet_v2_fpn_shared_box_predictor_640x640_coco17_2019_03_21.tar

System Requirement

Tensorflow 1.X

TODO List

  • Upload the code for object detection
  • Freeze the object detection model and upload it
  • Training the MNASNet A1 model (in progress, estimated to take 60 days)
  • Evaluation on mobile devices (I am sorry that I don't have a Google Pixel 1 phone, I might buy a newer phone for evaluation)
  • Provide more pre-trained models (our limited computing power)
  • Send PR to tensorflow

License

Apache License 2.0

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.