EfficientNet

April 16, 2026 ยท View on GitHub

Use case : Image classification

Model description

EfficientNet was initially introduced in this paper. The authors proposed a method that uniformly scales all dimensions depth/width/resolution using a so-called compound coefficient. Using neural architecture search, the authors created the EfficientNet topology and starting from B0, derived a few variants B1...B7 ordered by increasing complexity. Its main building blocks are a mobile inverted bottleneck MBConv (Sandler et al., 2018; Tan et al., 2019) and a squeeze-and-excitation optimization (Hu et al., 2018).

EfficientNet provides state-of-the art accuracy on imagenet and CIFAR for example while being much smaller and faster than its comparable (ResNet, DenseNet, Inception...). However, for STM32 platforms, B0 is already too large. That's why, we internally derived a custom version tailored for STM32 and modified it to be quantization-friendly (not discussed in the initial paper). This custom model is then quantized in int8 using Tensorflow Lite converter. In the following, the resulting model is called ST EfficientNet LC v1 (LC standing for Low Complexity).

ST EfficientNet LC v1 was obtained after fine-tuning of the original topology. Our goal was to reach around 500 kBytes for RAM and weights. For achieving this, we decided to replace original 'swish' by a simple 'relu6', and search for good expansion factor, depth and width coefficients. Of course, many models could meet the requirement. We selected the one which was better performing on food101 dataset. We made several attempts to quantize the EfficientNet topology, and discover some issues when quantizing activations. The problem was fixed mainly by adding a clipping lambda layer before the sigmoid.

Network information

Network InformationValue
FrameworkTensorFlow Lite
Params517540
Quantizationint8
Paperhttps://arxiv.org/pdf/1905.11946.pdf

The models are quantized using tensorflow lite converter.

Network inputs / outputs

For an image resolution of NxM and P classes :

Input ShapeDescription
(1, N, M, 3)Single NxM RGB image with UINT8 values between 0 and 255
Output ShapeDescription
(1, P)Per-class confidence for P classes
PlatformSupportedRecommended
STM32L0[][]
STM32L4[][]
STM32U5[x][]
STM32H7[x][x]
STM32MP1[x][x]
STM32MP2[x][]
STM32N6[x][]

Performances

Metrics

  • Measures are done with default STM32Cube.AI configuration with enabled input / output allocated option.

  • tfs stands for "training from scratch", meaning that the model weights were randomly initialized before training.

Reference NPU memory footprint on food101 dataset (see Accuracy for details on dataset)

ModelFormatResolutionSeriesInternal RAM (KiB)External RAM (KiB)Weights Flash (KiB)STEdgeAI Core version
ST EfficientNet LC v1 tfsInt8128x128x3STM32N62880559.594.0.0
ST EfficientNet LC v1 tfsInt8224x224x3STM32N6833.050550.394.0.0
ST EfficientNet LC v1 tfsInt8/Int4224x224x3STM32N6833.050481.494.0.0

Reference NPU inference time on food101 dataset (see Accuracy for details on dataset)

ModelFormatResolutionBoardExecution EngineInference time (ms)Inf / secSTEdgeAI Core version
ST EfficientNet LC v1 tfsInt8128x128x3STM32N6570-DKNPU/MCU3.58279.34.0.0
ST EfficientNet LC v1 tfsInt8224x224x3STM32N6570-DKNPU/MCU7.04142.04.0.0
ST EfficientNet LC v1 tfsInt8/Int4224x224x3STM32N6570-DKNPU/MCU6.96143.64.0.0

Reference MCU memory footprints based on Flowers dataset (see Accuracy for details on dataset)

ModelFormatResolutionSeriesActivation RAMRuntime RAMWeights FlashCode FlashTotal RAMTotal FlashSTEdgeAI Core version
ST EfficientNet LC v1 tfsInt8224x224x3STM32H7466.01 KiB15.6 KiB505.29 KiB100.99 KiB481.61 KiB606.28 KiB4.0.0
ST EfficientNet LC v1 tfsInt8128x128x3STM32H7181.01 KiB15.6 KiB505.29 KiB100.62 KiB196.61 KiB605.91 KiB4.0.0

Reference MCU inference time based on Flowers dataset (see Accuracy for details on dataset)

ModelFormatResolutionBoardExecution EngineFrequencyInference time (ms)STEdgeAI Core version
ST EfficientNet LC v1 tfsInt8224x224x3STM32H747I-DISCO1 CPU400 MHz459.99 ms4.0.0
ST EfficientNet LC v1 tfsInt8128x128x3STM32H747I-DISCO1 CPU400 MHz155.22 ms4.0.0
ST EfficientNet LC v1 tfsInt8224x224x3STM32F769I-DISCO1 CPU216 MHz871.7 ms4.0.0
ST EfficientNet LC v1 tfsInt8128x128x3STM32F769I-DISCO1 CPU216 MHz259.5 ms4.0.0

Reference MPU inference time based on Flowers dataset (see Accuracy for details on dataset)

ModelFormatResolutionQuantizationBoardExecution EngineFrequencyInference time (ms)%NPU%GPU%CPUX-LINUX-AI versionFramework
ST EfficientNet LC v1 tfsInt8224x224x3per-channel**STM32MP257F-DK2NPU/GPU800 MHz36.82 ms14.7285.280v6.1.0OpenVX
ST EfficientNet LC v1 tfsInt8128x128x3per-channel**STM32MP257F-DK2NPU/GPU800 MHz14.81 ms29.6870.320v6.1.0OpenVX
ST EfficientNet LC v1 tfsInt8224x224x3per-channelSTM32MP157F-DK22 CPU800 MHz137.34 msNANA100v6.1.0TensorFlowLite 2.18.0
ST EfficientNet LC v1 tfsInt8128x128x3per-channelSTM32MP157F-DK22 CPU800 MHz45.80 msNANA100v6.1.0TensorFlowLite 2.18.0
ST EfficientNet LC v1 tfsInt8224x224x3per-channelSTM32MP135F-DK21 CPU1000 MHz195.25 msNANA100v6.1.0TensorFlowLite 2.18.0
ST EfficientNet LC v1 tfsInt8128x128x3per-channelSTM32MP135F-DK21 CPU1000 MHz65.14 msNANA100v6.1.0TensorFlowLite 2.18.0

** To get the most out of MP25 NPU hardware acceleration, please use per-tensor quantization

Accuracy with Flowers dataset

Dataset details: http://download.tensorflow.org/example_images/flower_photos.tgz , License CC - BY 2.0 Number of classes: 5, 3670 files

ModelFormatResolutionTop 1 Accuracy (%)
ST EfficientNet LC v1 tfsFloat224x224x390.19
ST EfficientNet LC v1 tfsInt8224x224x389.92
ST EfficientNet LC v1 tfsFloat128x128x387.19
ST EfficientNet LC v1 tfsInt8128x128x386.78

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

ModelFormatResolutionTop 1 Accuracy (%)
ST EfficientNet LC v1 tfsFloat224x224x399.86
ST EfficientNet LC v1 tfsInt8224x224x399.78
ST EfficientNet LC v1 tfsFloat128x128x399.76
ST EfficientNet LC v1 tfsInt8128x128x399.63

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

ModelFormatResolutionTop 1 Accuracy (%)
ST EfficientNet LC v1 tfsFloat224x224x374.59
ST EfficientNet LC v1 tfsInt8224x224x374.02
ST EfficientNet LC v1 tfsFloat128x128x364.11
ST EfficientNet LC v1 tfsInt8128x128x363.21
ST EfficientNet LC v1 tfsInt8/Int4224x224x373.12

Retraining and Integration in a simple example:

Please refer to the stm32ai-modelzoo-services GitHub here

References

[1] "Tf_flowers : tensorflow datasets," TensorFlow. [Online]. Available: https://www.tensorflow.org/datasets/catalog/tf_flowers.

[2] 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

[3] L. Bossard, M. Guillaumin, and L. Van Gool, "Food-101 -- Mining Discriminative Components with Random Forests." European Conference on Computer Vision, 2014.