Instructions to use nxp/efficientnet-lite0-imx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LiteRT
How to use nxp/efficientnet-lite0-imx with LiteRT:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
EfficientNet-lite0
Overview
EfficientNet is a family of image classification models that scale network depth, width, and resolution together using a single compound coefficient [1]. EfficientNet-lite is a variant optimized for mobile and edge devices. Given an RGB image, the network returns a vector of 1001 class probabilities (1000 ImageNet classes plus a background class) [2].
This repository contains the EfficientNet-lite0 variant, quantized to int8 and compiled for NXP platforms:
i.MX 8M Plus, i.MX 93, i.MX 95, and i.MX 952. It also contains the script used to download and compile these
assets (recipe.sh) and an inference example (example.py).
Key Features
- Mobile/edge-optimized EfficientNet variant with a fixed stem and head across scales.
- Squeeze-and-excite blocks removed and all swish activations replaced with RELU6 for better hardware support and easier post-training quantization.
- 1000-class ImageNet image classification (the model exposes 1001 output logits; index 0 is a background class).
- Small footprint: ~4.7M parameters, ~814 MOPS.
- Fully quantized int8 model with uint8 input and uint8 output for accelerated NPU inference on NXP i.MX platforms.
Model Description
This is a quantized and compiled version of EfficientNet-lite0 from the TensorFlow EfficientNet-lite repository, optimized for NXP i.MX 8M Plus, i.MX 93, i.MX 95, and i.MX 952 processors.
- Base Model: tensorflow/tpu - EfficientNet-lite
- Original Model Authors: Mingxing Tan, Quoc V. Le (Google / The TensorFlow Authors)
- Original License: Apache-2.0
- Modified by: NXP
Modifications
This model is a derivative work with the following changes from the original:
- Quantization: No local re-quantization is performed. The int8 TFLite model (uint8 input, uint8 output) is downloaded directly from the pre-quantized checkpoint published by the TensorFlow authors.
- Compilation (i.MX 93): compiled for the Ethos-U65 NPU using Vela,
tags
lf-6.18.20_2.0.0andlf-6.18.37_2.1.0. - Compilation (i.MX 95 / i.MX 952): converted for the eIQ Neutron NPU using the eIQ Neutron SDK versions
3.1.3,3.2.1, and3.2.3.
Original model available at: https://github.com/tensorflow/tpu/blob/master/models/official/efficientnet/lite/README.md.
Model Information
| Information | Value |
|---|---|
| Input shape | RGB image (1, 224, 224, 3), uint8 |
| Input example | (Picture by Shizhao under CC BY-SA 3.0 license) |
| Output shape | Vector of class probabilities (1, 1001), uint8 quantized; dequantize with the tensor's scale / zero point. 1000 ImageNet classes offset by 1 background class, see labels.py. |
| Output example | [[0, 0, 255, 0, ..., 0]] -> Top class: giant panda |
| FLOPS | 814 MOPS |
| Number of parameters | 4.7 M |
| File size (int8) | 5.3 MB (assets/quantized_tflite_model/efficientnet-lite0-int8.tflite) |
| Source framework | TensorFlow |
Supported Hardware and Software Configurations
All models run with the eIQ LiteRT (TensorFlow Lite) runtime and the corresponding NPU delegate (VX for i.MX 8M Plus, Ethos-U for i.MX 93, Neutron for i.MX 95 / i.MX 952). The same information is captured in release_manifest.json.
| Asset | Runtime | Precision | HW target | BSP & SDK versions | Link to asset |
|---|---|---|---|---|---|
| i.MX 8M Plus Quantized | LiteRT | INT8 | i.MX 8M Plus | - | Download |
| i.MX 93 Precompiled | LiteRT | INT8 | i.MX 93 | BSP lf-6.18.20_2.0.0, VELA_TAG = lf-6.18.20_2.0.0 | Download |
| i.MX 93 Precompiled | LiteRT | INT8 | i.MX 93 | BSP lf-6.18.37_2.1.0, VELA_TAG = lf-6.18.37_2.1.0 | Download |
| i.MX 95 Precompiled | LiteRT | INT8 | i.MX 95 | BSP lf-6.18.20_2.0.0, Neutron SDK v3.1.3 | Download |
| i.MX 95 Precompiled | LiteRT | INT8 | i.MX 95 | BSP lf-6.18.37_2.1.0, Neutron SDK v3.2.1 | Download |
| i.MX 95 Precompiled | LiteRT | INT8 | i.MX 95 | BSP lf-6.18.37_2.1.0, Neutron SDK v3.2.3 | Download |
| i.MX 952 Precompiled | LiteRT | INT8 | i.MX 952 | BSP lf-6.18.20_2.0.0, Neutron SDK v3.1.3 | Download |
| i.MX 952 Precompiled | LiteRT | INT8 | i.MX 952 | BSP lf-6.18.37_2.1.0, Neutron SDK v3.2.1 | Download |
| i.MX 952 Precompiled | LiteRT | INT8 | i.MX 952 | BSP lf-6.18.37_2.1.0, Neutron SDK v3.2.3 | Download |
The hardware-independent int8 model is also provided for host (x86) inference and as the input to the
compilers: assets/quantized_tflite_model/efficientnet-lite0-int8.tflite (identical to the i.MX 8M Plus asset).
Limitations and Biases
This model inherits all limitations from the original EfficientNet-lite0 model. Additional limitations:
- Task scope: Image classification only. The model exposes 1001 logits (1000 ImageNet classes plus a background class at index 0); it does not perform object localization or detection.
- Input resolution: The model is fixed at 224x224 input resolution.
- Dataset bias: The model is trained on ImageNet, so classification quality may vary for object classes, contexts, or demographic groups that are under-represented in that dataset.
Training
The model was trained by the original authors on the ImageNet dataset [2], according to the model source. No retraining is performed by NXP; the published int8 checkpoint is used as-is. The original training procedure is described in the EfficientNet TPU tutorial.
Download and Run
Running the example
An example of how to use the model on a host PC is in example.py:
python example.py -m assets/quantized_tflite_model/efficientnet-lite0-int8.tflite -i example_input.jpg
To run the models on an i.MX MPU target with the NPU delegates, see the i.MX Machine Learning User Guide.
Regenerating the assets with recipe.sh
The recipe installs the eIQ Neutron SDK from the NXP eIQ PyPI Distribution Portal. Configure pip once to use it:
python -m pip config --user set global.index https://eiq.nxp.com/repository
python -m pip config --user set global.index-url https://eiq.nxp.com/repository
python -m pip config --user set global.trusted-host eiq.nxp.com
python -m pip config --user set global.extra-index-url https://pypi.org/simple
python -m pip config --user set global.find-links https://eiq.nxp.com/repository/
To download the pre-quantized int8 model and compile it for all supported platforms, run:
bash recipe.sh
The Vela tag and eIQ Neutron SDK version can be passed as positional arguments (defaulting to
lf-6.18.20_2.0.0 and 3.2.3 respectively):
bash recipe.sh [IMX_ETHOS_U_VELA_TAG] [EIQ_NEUTRON_SDK_VERSION]
The generated files are:
assets/quantized_tflite_model/efficientnet-lite0-int8.tflite- hardware-independent int8 modelassets/imx8mplus/efficientnet-lite0-int8.tflite- int8 model for i.MX 8M Plus (identical to the hardware-independent int8 model)assets/imx93/<IMX_ETHOS_U_VELA_TAG>/efficientnet-lite0-int8_vela.tflite- Vela-compiled for i.MX 93assets/imx95/<EIQ_NEUTRON_SDK_VERSION>/efficientnet-lite0-int8_converted.tflite- Neutron-converted for i.MX 95assets/imx952/<EIQ_NEUTRON_SDK_VERSION>/efficientnet-lite0-int8_converted.tflite- Neutron-converted for i.MX 952
License
This model is released under the Apache License 2.0, the same license as the original EfficientNet-lite model.
Citation
If you use this model, please cite both this work and the original model:
- M. Tan and Q. V. Le, "EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks," International Conference on Machine Learning (ICML), 2019. arXiv:1905.11946.
- J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li and L. Fei-Fei, "ImageNet: A large-scale hierarchical image database," 2009 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2009.
@inproceedings{tan2019efficientnet,
title={Efficientnet: Rethinking model scaling for convolutional neural networks},
author={Tan, Mingxing and Le, Quoc},
booktitle={International conference on machine learning},
pages={6105--6114},
year={2019},
organization={PmLR}
}
@inproceedings{deng2009imagenet,
title={Imagenet: A large-scale hierarchical image database},
author={Deng, Jia and Dong, Wei and Socher, Richard and Li, Li-Jia and Li, Kai and Fei-Fei, Li},
booktitle={2009 IEEE conference on computer vision and pattern recognition},
pages={248--255},
year={2009},
organization={Ieee}
}
- Downloads last month
- 52
(