Module google/‌imagenet/‌mobilenet_v1_100_160/‌quantops/‌classification/1

Imagenet (ILSVRC-2012-CLS) classification with MobileNet V1 (depth multiplier 1.00).

Module URL: https://tfhub.dev/google/imagenet/mobilenet_v1_100_160/quantops/classification/1

Overview

MobileNet V1 is a family of neural network architectures for efficient on-device image classification, originally published by

Mobilenets come in various sizes controlled by a multiplier for the depth (number of features) in the convolutional layers. They can also be trained for various sizes of input images to control inference speed. This TF-Hub module uses the TF-Slim implementation of mobilenet_v1_v1, instrumented for quantization, with a depth multiplier of 1.0 and an input size of 160x160 pixels.

The module contains a trained instance of the network, packaged to do the image classification that the network was trained on. If you merely want to transform images into feature vectors, use module google/imagenet/mobilenet_v1_100_160/quantops/feature_vector/1 instead, and save the space occupied by the classification layer.

Quantization

This module is meant for use in models whose weights will be quantized to uint8 by TensorFlow Lite for deployment to mobile devices.

The trained weights of this module are shipped as float32 numbers, but its graph has been augmented by tf.contrib.quantize with extra ops that simulate the effect of quantization already during training, so that the model can adjust to it.

Training

The checkpoint exported into this module was mobilenet_v1_2018_02_22/mobilenet_v1_1.0_160_quant/mobilenet_v1_1.0_160_quant.ckpt downloaded from MobileNet pre-trained models. Its weights were originally obtained by training on the ILSVRC-2012-CLS dataset for image classification ("Imagenet"), with simulated quantization.

Usage

This module implements the common signature for image classification. It can be used like

module = hub.Module("https://tfhub.dev/google/imagenet/mobilenet_v1_100_160/quantops/classification/1")
height, width = hub.get_expected_image_size(module)
images = ...  # A batch of images with shape [batch_size, height, width, 3].
logits = module(images)  # Logits with shape [batch_size, num_classes].

...or using the signature name image_classification. The indices into logits are the num_classes = 1001 classes of the classification from the original training (see above).

This module can also be used to compute image feature vectors, using the signature name image_feature_vector.

For this module, the size of the input image is fixed to height x width = 160 x 160 pixels. The input images are expected to have color values in the range [0,1], following the common image input conventions.

Fine-tuning

The current version of this module only provides an inference graph and cannot be fine-tuned.