schmidt-sebastian's picture
Initial upload of MediaPipe-ImageClassifier-EfficientNet-Lite0 from MediaPipe Solutions
a41ac2f
|
Raw History Blame Contribute Delete
11.7 kB
metadata
license: apache-2.0
library_name: litert
pipeline_tag: image-classification
datasets:
  - imagenet-1k
tags:
  - mediapipe
  - litert
  - tflite
  - image-classification
  - on-device
  - android
  - ios
  - web
  - python
  - flutter
  - vision
  - efficientnet
  - int8
  - fp32
  - arxiv:1905.11946

MediaPipe EfficientNet-Lite0 (Image Classifier)

EfficientNet-Lite0 1,000-class ImageNet image classification models in full-integer INT8 (efficientnet_lite0_int8.tflite, 5.4 MB) and FP32 (efficientnet_lite0_float32.tflite, 18.6 MB), packaged with TFLite metadata and embedded class labels for the MediaPipe Image Classifier (ImageClassifier) task and standalone LiteRT inference.

Documentation: MediaPipe Image Classifier Docs

Samples: Android · iOS · Python Colab · Web · Flutter

Try live: Web Demo

EfficientNet-Lite0 adapts the EfficientNet-B0 architecture for on-device edge inference by replacing swish activations with ReLU6, removing squeeze-and-excitation blocks, and fixing the stem and head while scaling width and depth. It is the recommended default model for the MediaPipe ImageClassifier task, balancing compact size, low latency, and 1,000-class ImageNet-1K accuracy.

Which variant should I pick?

  • efficientnet_lite0_int8.tflite (5.4 MB, INT8): Best for CPU execution (XNNPACK) and memory-constrained mobile, web, or embedded targets (≈2.3× faster on Pixel 6 CPU than FP32).
  • efficientnet_lite0_float32.tflite (18.6 MB, FP32): Best when running on a mobile/desktop GPU delegate or when maximum unquantized floating-point fidelity is required.

Embedded vs. Standalone Label Files

Both .tflite files embed labels_without_background.txt (1,000 classes, index 0 = tench through index 999 = toilet tissue) inside their TFLITE_METADATA zip trailer, so MediaPipe ImageClassifier populates category_name automatically with no external label file.

For convenience, this repository also includes labels.txt as linked from the MediaPipe documentation. Note that labels.txt has 1,001 lines (line 1 is background, lines 2–1001 are the 1,000 ImageNet classes); if you run the .tflite graph directly with ai-edge-litert rather than MediaPipe Tasks, map output index i (0..999) to labels.txt line i + 2 (labels.splitlines()[1:][i]).

Files

File in Repo Root Upstream Google Path Precision Size SHA-256
efficientnet_lite0_int8.tflite image_classifier/efficientnet_lite0/int8/latest/efficientnet_lite0.tflite int8 5.43 MB (5,434,517 B) bc2ffe19c1118de0c0c2a9088992da5589722656e0fba81421385300a4a34b16
efficientnet_lite0_float32.tflite image_classifier/efficientnet_lite0/float32/latest/efficientnet_lite0.tflite float32 18.58 MB (18,582,189 B) 6c7ab0a6e5dcbf38a8c33b960996a55a3b4300b36a018c4545801de3a3c8bde0

Companion Files in Repo Root

File Role Size SHA-256
labels.txt Label map 10.5 KB (10,484 B) 536feacc519de3d418de26b2effb4d75694a8c4c0063e36499a46fa8061e2da9

Download

pip install -U huggingface_hub
hf download litert-community/MediaPipe-ImageClassifier-EfficientNet-Lite0 efficientnet_lite0_int8.tflite --local-dir .
hf download litert-community/MediaPipe-ImageClassifier-EfficientNet-Lite0 efficientnet_lite0_float32.tflite --local-dir .

Inputs, Outputs, and Model Specifications

efficientnet_lite0_int8.tflite

  • Embedded TFLITE_METADATA: name EfficientNet-lite image classifier (quantized) · version 1 · author MediaPipe · packed associated files: labels_without_background.txt
Direction Tensor Shape Type Notes
Input images [1, 224, 224, 3] uint8 image — Input image to be classified. The expected image is 224 x 224, with three channels (red, blue, and green) per pixel. Each element in the tensor is a value between min and max, where (per-channel) min is [0] and max is [255]. — Normalization: mean=[127.0], std=[128.0] — Quantization: scale=0.012566, zero_point=131
Output Softmax [1, 1000] uint8 probability — Probabilities of the 1000 labels respectively. — Quantization: scale=0.00390625, zero_point=0 — Labels: labels_without_background.txt

efficientnet_lite0_float32.tflite

  • Embedded TFLITE_METADATA: name EfficientNet-lite image classifier · version 1 · author MediaPipe · packed associated files: labels_without_background.txt
Direction Tensor Shape Type Notes
Input images [1, 224, 224, 3] float32 image — Input image to be classified. The expected image is 224 x 224, with three channels (red, blue, and green) per pixel. Each element in the tensor is a value between min and max, where (per-channel) min is [-0.9921875] and max is [1.0]. — Normalization: mean=[127.0], std=[128.0]
Output Softmax [1, 1000] float32 probability — Probabilities of the 1000 labels respectively. — Labels: labels_without_background.txt

Use with MediaPipe Tasks

Python Quickstart

pip install -U mediapipe huggingface_hub
import mediapipe as mp
from huggingface_hub import hf_hub_download

model_path = hf_hub_download(
    repo_id="litert-community/MediaPipe-ImageClassifier-EfficientNet-Lite0",
    filename="efficientnet_lite0_int8.tflite",
)

BaseOptions = mp.tasks.BaseOptions
ImageClassifier = mp.tasks.vision.ImageClassifier
ImageClassifierOptions = mp.tasks.vision.ImageClassifierOptions
VisionRunningMode = mp.tasks.vision.RunningMode

options = ImageClassifierOptions(
    base_options=BaseOptions(model_asset_path=model_path),
    running_mode=VisionRunningMode.IMAGE,
    max_results=5,
)

with ImageClassifier.create_from_options(options) as runner:
    mp_image = mp.Image.create_from_file("input.jpg")
    result = runner.classify(mp_image)
    for category in result.classifications[0].categories:
        print(f"{category.category_name}: {category.score:.3f}")

Cross-Platform Guides & Samples

Latency Benchmarks

End-to-end MediaPipe Task pipeline average latency reported by the Image Classifier documentation:

Model Variant Device CPU Latency GPU Latency
EfficientNet-Lite0 (int8) Pixel 6 10.08 ms —
EfficientNet-Lite0 (float 32) Pixel 6 23.52 ms 18.90 ms

Intended Use, Limitations, and Fairness

  • Intended applications: General-purpose single-label classification of prominent everyday objects, animals, plants, vehicles, and scenes across the 1,000 ImageNet-1K categories on mobile, web, desktop, and embedded devices.
  • Limitations & considerations:
    • Closed-vocabulary classifier restricted to the 1,000 ImageNet-1K synsets; inputs outside those classes will still receive probability mass over the closest training categories.
    • Assumes a single dominant subject near the center of a 224×224 crop; for multi-object scenes with localization, use an object detector such as MediaPipe-ObjectDetector-EfficientDet-Lite0.
    • Not intended for safety-critical, medical, biometric, or high-stakes decision-making without task-specific fine-tuning and validation.
    • Google does not publish a separate standalone fairness PDF for EfficientNet-Lite0 on the MediaPipe documentation page.

Provenance

Every model binary in this repository is byte-identical (unmodified FlatBuffer weights and embedded TFLITE_METADATA bytes) to the official artifact served by Google from storage.googleapis.com/mediapipe-models.

Repo File Upstream URL GCS Generation Upstream Last-Modified Pinned Bucket Version
efficientnet_lite0_int8.tflite efficientnet_lite0.tflite 1682480009628520 Wed, 26 Apr 2023 03:33:29 GMT /1/
efficientnet_lite0_float32.tflite efficientnet_lite0.tflite 1682480007624226 Wed, 26 Apr 2023 03:33:27 GMT /1/

License and Citation

  • License: apache-2.0 — Stated as Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) in the embedded TFLITE_METADATA block of the .tflite model file(s).

Citation

@inproceedings{tan2019efficientnet,
  title     = {EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks},
  author    = {Tan, Mingxing and Le, Quoc V.},
  booktitle = {International Conference on Machine Learning (ICML)},
  year      = {2019},
  url       = {https://arxiv.org/abs/1905.11946}
}