Git Product home page Git Product logo

mobilenet-ssd-keras's Introduction

MobileNet-SSD300-Keras

SSD: A keras implementation of Mobilenet Single-Shot MultiBox Detector

Contents

  1. Overview
  2. Performance
  3. Examples
  4. Dependencies
  5. Repository Content
  6. Download the convolutionalized MobileNet-V1 weights
  7. Download the original trained model weights
  8. Terminology

Overview

This is a Keras port of the Mobilenet SSD model architecture introduced by Wei Liu et al. in the paper SSD: Single Shot MultiBox Detector.

Weights are ported from caffe implementation of MobileNet SSD. MAP comes out to be same if we train the model from scratch and the given this implies that implementation is correct.

The repository currently provides the following network architectures:

  • SSD300_mobilenet: ssd_mobilenet.py Mobilebet-V1 is used as a backbone for feature extyraction. This Network has capibility to train faster and results in increment in fps while deployment.

Performance

Here are the mAP evaluation results of the ported weights and below that the evaluation results of a model trained from scratch using this implementation. All models were evaluated using the official Pascal VOC test server (for 2007 test). In all cases the results match those of the original Caffe models. Download links to all ported weights are available further below.

Mean Average Precision
evaluated on VOC2007 test
trained on
IoU rule
07+12
0.5
07+12+COCO
0.5
MobileNet-SSD300 68.5 72.7

Training an SSD300 from scratch to MS-COCO and then fine tune on Pascal VOC 2007 trainval and 2012 trainval produces the same mAP on Pascal VOC 2007 test as the original Caffe MobileNet SSD300 "07+12+COCO" model.

Mean Average Precision
Original Caffe Model Ported Weights Trained from Scratch
MobileNet-SSD300 "07+12" 72.5 72.7 72.2

The models achieve the following average number of frames per second (FPS) on Pascal VOC on an NVIDIA GeForce GTX 1080 Ti(i.e. the laptop version) and cuDNN v6 and on Nvidia Jetson Tx1.Batch Size is kept 1 for getting the prediction time which is meaningful.

Frames per Second
Nvidia 1080 Ti Nvidia Jetson TX1
Batch Size 1 1
MobileNet-SSD300 170 36

Examples

Below are some prediction examples of the fully trained original MobileNet-SSD300 "07+12" model (i.e. trained on Pascal VOC2007 trainval and VOC2012 trainval). The predictions were made on Pascal VOC2007 test.

img01 img01
img01 img01

Dependencies

  • Python 2.x or 3.x
  • Numpy
  • TensorFlow 1.x
  • Keras 2.x
  • OpenCV

Repository Content

This repository provides python files that explain training, inference and evaluation.

How to use a trained model for inference:

How to train a model:

How to evaluate a trained model:

How to use the data generator:

Training details

The general training setup is layed out and explained in train_mobilenet_ssd.

To train the original MobileNet-SSD300 model on Pascal VOC:

  1. Download the datasets:
wget http://host.robots.ox.ac.uk/pascal/VOC/voc2012/VOCtrainval_11-May-2012.tar
wget http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtrainval_06-Nov-2007.tar
wget http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtest_06-Nov-2007.tar
  1. Download the weights for the convolutionalized MobileNet-V1 or for one of the trained original models provided below.
  2. Set the file paths for the datasets and model weights accordingly in train_mobilenet_ssd and execute it.

Download the convolutionalized MobileNet-V1 weights

In order to train an MobileNet-SSD300 from scratch, download the weights of the fully convolutionalized MobileNet-V1 model trained to convergence on ImageNet classification here:

MobileNet-v1.h5.

As with all other weights files below, this is a direct port of the corresponding .caffemodel file that is provided in the repository of the original Caffe implementation.

Download the original trained model weights

Here are the ported weights for all the original trained models. The filenames correspond to their respective .caffemodel counterparts. The asterisks and footnotes refer to those in the README of the original Caffe implementation.

  1. PASCAL VOC models:

ToDo

The following things are on the to-do list, ranked by priority. Contributions are welcome, but please read the contributing guidelines.

  1. Add model definitions and trained weights for SSDs based on other base networks such as MobileNet, InceptionResNetV2, or DenseNet.
  2. Add support for the Theano and CNTK backends. Requires porting the custom layers and the loss function from TensorFlow to the abstract Keras backend.

Special Mention to pierluigiferrari and chuanqi305, which helped to build this repository.

mobilenet-ssd-keras's People

Contributors

abhinavrai44 avatar manishsoni1908 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.