ResNet v1

April 16, 2026 ยท View on GitHub

Use case : Image classification

Model description

ResNet models perform image classification - they take images as input and classify the major object in the image into a set of pre-defined classes. ResNet models provide very high accuracies with affordable model sizes. They are ideal for cases when high accuracy of classification is required. ResNet models consist of residual blocks and came up to counter the effect of deteriorating accuracies with more layers due to network not learning the initial layers. ResNet v1 uses post-activation for the residual blocks. The models below have 8 and 32 layers with ResNet v1 architecture. (source: https://keras.io/api/applications/resnet/) The model is quantized in int8 using tensorflow lite converter.

Network information

Network InformationValue
FrameworkTensorFlow Lite
Quantizationint8
Provenancehttps://www.tensorflow.org/api_docs/python/tf/keras/applications/resnet
Paperhttps://arxiv.org/abs/1512.03385

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
PlatformSupportedOptimized
STM32L0[][]
STM32L4[x][]
STM32U5[x][]
STM32H7[x][x]
STM32MP1[x][x]*
STM32MP2[x][]
STM32N6[x][]
  • Only for Cifar 100 models

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 MCU memory footprint based on Cifar 10 dataset (see Accuracy for details on dataset)

ModelFormatResolutionSeriesActivation RAMRuntime RAMWeights FlashCode FlashTotal RAMTotal FlashSTEdgeAI Core version
ResNet v1 8 tfsInt832x32x3STM32H762.51 KiB1.26 KiB76.9 KiB36.08 KiB63.77 KiB112.98 KiB4.0.0

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

ModelFormatResolutionBoardExecution EngineFrequencyInference time (ms)STEdgeAI Core version
ResNet v1 8 tfsInt832x32x3STM32H747I-DISCO1 CPU400 MHz28.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
ResNet v1 8 tfsInt832x32x3per-channel**STM32MP257F-DK2NPU/GPU800 MHz2.0621.7678.240v6.1.0OpenVX
ResNet v1 8 tfsInt832x32x3per-channelSTM32MP157F-DK22 CPU800 MHz6.71NANA100v6.1.0TensorFlowLite 2.18.0
ResNet v1 8 tfsInt832x32x3per-channelSTM32MP135F-DK21 CPU1000 MHz10.34NANA100v6.1.0TensorFlowLite 2.18.0

** 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.

Reference MCU memory footprint based on Cifar 100 dataset (see Accuracy for details on dataset)

ModelFormatResolutionSeriesActivation RAMRuntime RAMWeights FlashCode FlashTotal RAMTotal FlashSTEdgeAI Core version
ResNet v1 32 tfsInt832x32x3STM32H745.41 KiB24.98 KiB464.38 KiB78.65 KiB70.39 KiB543.03 KiB4.0.0

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

ModelFormatResolutionBoardExecution EngineFrequencyInference time (ms)STEdgeAI Core version
ResNet v1 32 tfsInt832x32x3STM32H747I-DISCO1 CPU400 MHz177.7 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
ResNet v1 32 tfsInt832x32x3per-channelSTM32MP257F-DK2NPU/GPU800 MHz9.160 ms14.7585.250v6.1.0OpenVX
ResNet v1 32 tfsInt832x32x3per-channelSTM32MP157F-DK22 CPU800 MHz34.78 msNANA100v6.1.0TensorFlowLite 2.11.0
ResNet v1 32 tfsInt832x32x3per-channelSTM32MP135F-DK21 CPU1000 MHz55.32 msNANA100v6.1.0TensorFlowLite 2.11.0

Accuracy with Cifar10 dataset

Dataset details: link , License CC BY 4.0 , Quotation[1] , Number of classes: 10, Number of images: 60 000

ModelFormatResolutionTop 1 Accuracy
ResNet v1 8 tfsFloat32x32x387.01 %
ResNet v1 8 tfsInt832x32x385.59 %

Accuracy with Cifar100 dataset

Dataset details: link , License CC0 4.0, Quotation[2] , Number of classes:100, Number of images: 600 000

ModelFormatResolutionTop 1 Accuracy
ResNet v1 32 tfsFloat32x32x367.75 %
ResNet v1 32 tfsInt832x32x366.58 %

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.