ResNet50 v2

April 16, 2026 ยท View on GitHub

Use case : Image classification

Model description

ResNets family is a well known architecture that uses skip connections to enable stronger gradients in much deeper networks. This variant has 50 layers.

The model is quantized in int8 using tensorflow lite converter. A mixed precision version is also provided using onnx-runtime and our own quantization scripts.

Network information

Network InformationValue
FrameworkTensorFlow Lite
MParams25.6 M
Quantizationint8
Provenancehttps://www.tensorflow.org/api_docs/python/tf/keras/applications/ResNet50V2
Paperhttps://arxiv.org/abs/1603.05027

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 in FLOAT32
PlatformSupportedRecommended
STM32L0[][]
STM32L4[][]
STM32U5[][]
STM32H7[x][]
STM32MP1[x][]
STM32MP2[x][x]
STM32N6[x][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.
  • tl stands for "transfer learning", meaning that the model backbone weights were initialized from a pre-trained model, then only the last layer was unfrozen during the training.
  • fft stands for "full fine-tuning", meaning that the full model weights were initialized from a transfer learning pre-trained model, and all the layers were unfrozen during the training.

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

ModelDatasetFormatResolutionSeriesInternal RAMExternal RAMWeights FlashSTEdgeAI Core version
ResNet50 v2 fftfood101Int8224x224x3STM32N62308.06313623833.674.0.0
ResNet50 v2 fftfood101Int8/Int4224x224x3STM32N62308.06235213268.394.0.0
ResNet50 v2imagenetInt8224x224x3STM32N62308.063136.025633.614.0.0
ResNet50 v2imagenetInt8/Int4224x224x3STM32N62308.06235221154.534.0.0

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

ModelDatasetFormatResolutionBoardExecution EngineInference time (ms)Inf / secSTEdgeAI Core version
ResNet50 v2 fftfood101Int8224x224x3STM32N6570-DKNPU/MCU238.494.194.0.0
ResNet50 v2 fftfood101Int8/Int4224x224x3STM32N6570-DKNPU/MCU267.333.744.0.0
ResNet50 v2imagenetInt8224x224x3STM32N6570-DKNPU/MCU243.044.114.0.0
ResNet50 v2imagenetInt8/Int4224x224x3STM32N6570-DKNPU/MCU286.063.54.0.0

Reference MCU memory footprint based on Food-101 and imagenet dataset (see Accuracy for details on dataset)

ModelDatasetFormatResolutionSeriesActivation RAMRuntime RAMWeights FlashCode FlashTotal RAMTotal FlashSTEdgeAI Core version
ResNet50 v2 fftfood101Int8224x224x3STM32H71816.2 KiB14.56 KiB23240.96 KiB169.12 KiB1830.76 KiB23410.08 KiB4.0.0
ResNet50 v2imagenetInt8224x224x3STM32H72142.07 KiB41.03 KiB25042.47 KiB225.32 KiB2183.1 KiB25267.79 KiB4.0.0

Reference MCU inference time based on Food-101 and imagenet dataset (see Accuracy for details on dataset)

ModelDatasetFormatResolutionBoardExecution EngineFrequencyInference time (ms)STEdgeAI Core version
ResNet50 v2 fftfood101Int8224x224x3STM32H747I-DISCO1 CPU400 MHz11306.44.0.0
ResNet50 v2imagenetInt8224x224x3STM32H747I-DISCO1 CPU400 MHz11370.074.0.0

Accuracy with Food-101 dataset

Dataset details: link, Quotation[1] , Number of classes: 101 , Number of images: 101 000

ModelFormatResolutionTop 1 Accuracy
ResNet50 v2 fftFloat224x224x382.2 %
ResNet50 v2 fftInt8224x224x381.03 %
ResNet50 v2 fftInt8/Int4224x224x380.17 %

Accuracy with imagenet dataset

Dataset details: link, Quotation[4]. Number of classes: 1000. To perform the quantization, we calibrated the activations with a random subset of the training set. For the sake of simplicity, the accuracy reported here was estimated on the 50000 labelled images of the validation set.

modelFormatResolutionTop 1 Accuracy
ResNet50 v2 Float224x224x368.73 %
ResNet50 v2 Int8224x224x367.99 %
ResNet50 v2Int8/Int4224x224x367.45 %

Retraining and Integration in a simple example:

Please refer to the stm32ai-modelzoo-services GitHub here

References

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