资源算法Mobilenet-ssd-keras

Mobilenet-ssd-keras

2020-02-27 | |  51 |   0 |   0

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 onVOC2007 test
trained on
IoU rule
07+12
0.5
07+12+COCO
0.5

MobileNet-SSD30068.572.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 ModelPorted WeightsTrained from Scratch
MobileNet-SSD300 "07+12"72.572.772.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 TiNvidia Jetson TX1
Batch Size11
MobileNet-SSD30017036

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.

图片.png

图片.png

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.tarwget http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtrainval_06-Nov-2007.tarwget 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-detection-example

下一篇:retrain-mobilenet-for-the-web

用户评价
全部评价

热门资源

  • Keras-ResNeXt

    Keras ResNeXt Implementation of ResNeXt models...

  • seetafaceJNI

    项目介绍 基于中科院seetaface2进行封装的JAVA...

  • spark-corenlp

    This package wraps Stanford CoreNLP annotators ...

  • capsnet-with-caps...

    CapsNet with capsule-wise convolution Project ...

  • inferno-boilerplate

    This is a very basic boilerplate example for pe...