STMicroelectronics/fdmobilenet
Fd-MobileNet
Use case : Image classification
Model description
Fd-MobileNet stands for Fast-downsampling MobileNet. It was initially introduced in this paper. This family of networks, inspired from Mobilenet, provides a good accuracy on various image classification tasks for very limited computational budgets. Thus it is an interesting solution for deep learning at the edge. As stated by the authors, the key idea is to apply a fast downsampling strategy to MobileNet framework with only half the layers of the original MobileNet. This design remarkably reduces the computational cost as well as the inference time.
The hyperparameter 'alpha' controls the width of the network, also denoted as width multiplier. It proportionally adjusts each layer width. Authorized values for 'alpha' are 0.25, 0.5, 0.75, 1.0. The model is quantized in int8 using Tensorflow Lite converter.
Performances of a ST custom model derived from Fd-MobileNet is also proposed below. It is named ST FdMobileNet v1. It is inspired from original FdMobilenet. Instead of having one unique 'alpha' dimensioning the width of the network, we use a list of 'alpha' values in order to give more or less importance to each of the individual sub-blocks. It is slightly more complex than FdMobilenet 0.25 due to higher number of channels for some sub-blocks but provides better accuracies. We believe it is a good compromise between size, complexity and accuracy for this family of networks.
Network information
The models are quantized using tensorflow lite converter.
Network inputs / outputs
For an image resolution of NxM and P classes and 0.25 alpha parameter :
Recommended platform
Performances
Metrics
- Measures are done with default STM32Cube.AI configuration with enabled input / output allocated option.
tfsstands for "training from scratch", meaning that the model weights are randomly initialized before the training and all layers are actually trained.
Reference NPU memory footprint on food101 dataset (see Accuracy for details on dataset)
Reference NPU inference time on food101 dataset (see Accuracy for details on dataset)
Reference MCU memory footprints based on Flowers dataset (see Accuracy for details on dataset)
Reference MCU inference time based on Flowers dataset (see Accuracy for details on dataset)
Reference MPU inference time based on Flowers dataset (see Accuracy for details on dataset)
To get the most out of MP25 NPU hardware acceleration, please use per-tensor quantization**
Note:** On STM32MP2 devices, per-channel quantized models are internally converted to per-tensor quantization by the compiler using an entropy-based method. This may introduce a slight loss in accuracy compared to the original per-channel models.
Accuracy with Flowers dataset
Dataset details: http://download.tensorflow.org/exampleimages/flowerphotos.tgz , License CC - BY 2.0 Number of classes: 5, 3670 files
Accuracy with Plant dataset
Dataset details: https://data.mendeley.com/datasets/tywbtsjrjv/1 , License CC0 1.0 Number of classes: 39, number of files: 55448
Accuracy with Food-101 dataset
Dataset details: https://data.vision.ee.ethz.ch/cvl/datasets_extra/food-101/, Number of classes: 101, number of files: 101000
Retraining and Integration in a simple example:
Please refer to the stm32ai-modelzoo-services GitHub here
References
<a id="1">[1]</a> "Tfflowers : tensorflow datasets," TensorFlow. [Online]. Available: https://www.tensorflow.org/datasets/catalog/tfflowers.
<a id="2">[2]</a> J, ARUN PANDIAN; GOPAL, GEETHARAMANI (2019), "Data for: Identification of Plant Leaf Diseases Using a 9-layer Deep Convolutional Neural Network", Mendeley Data, V1, doi: 10.17632/tywbtsjrjv.1
<a id="3">[3]</a> L. Bossard, M. Guillaumin, and L. Van Gool, "Food-101 -- Mining Discriminative Components with Random Forests." European Conference on Computer Vision, 2014.
