--- license: apache-2.0 library_name: litert pipeline_tag: image-feature-extraction datasets: - imagenet-1k tags: - mediapipe - litert - tflite - image-feature-extraction - on-device - android - ios - web - python - flutter - vision - mobilenet-v3 - image-embeddings - fp32 - arxiv:1905.02244 --- # MediaPipe MobileNet-V3 (Small) Image Embedder MobileNet-V3 Small image feature extractor (`mobilenet_v3_small.tflite`, 4.1 MB, 0.75 depth multiplier, FP32 weights) producing **1024-dimensional** embedding vectors for visual similarity search and deduplication in the [MediaPipe Image Embedder (`ImageEmbedder`)](https://developers.google.com/edge/mediapipe/solutions/vision/image_embedder) task.

Documentation: MediaPipe Image Embedder Docs

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

Try live: Web Demo

Trained on ImageNet with a `0.75` channel depth multiplier to balance accuracy and edge latency. Takes normalized `224 x 224` RGB images and outputs a `1024`-element feature vector (`StatefulPartitionedCall:0`), optionally L2-normalized (`l2_normalize=True`) and scalar-quantized (`quantize=True`) by MediaPipe `ImageEmbedder`. ## Files | File | Precision | Size | SHA-256 | |---|---|---:|---| | [`mobilenet_v3_small.tflite`](https://huggingface.co/litert-community/MediaPipe-ImageEmbedder-MobileNet-V3-Small/blob/main/mobilenet_v3_small.tflite) | `float32` | 4.12 MB (4,117,670 B) | `bbbb4c51a55a53905af1daec995ca1aae355046f8839bb8c9f5ce9271394bc40` | ### Download ```bash pip install -U huggingface_hub hf download litert-community/MediaPipe-ImageEmbedder-MobileNet-V3-Small mobilenet_v3_small.tflite --local-dir . ``` ## Inputs, Outputs, and Model Specifications ### `mobilenet_v3_small.tflite` - Embedded `TFLITE_METADATA`: name `MobileNetV3 image classifier` · version `1` · author `MediaPipe` · packed associated files: `labels.txt` | Direction | Tensor | Shape | Type | Notes | |---|---|---|---|---| | Input | `serving_default_inputs:0` | `[-1, 224, 224, 3]` | `float32` | image — Input image to be embedded. 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.0] and max is [1.0]. — Normalization: `mean=[0.0], std=[255.0]` | | Output | `StatefulPartitionedCall:0` | `[-1, 1024]` | `float32` | feature — Feature vector of the input image. | ## Use with MediaPipe Tasks ### Python Quickstart ```bash pip install -U mediapipe huggingface_hub ``` ```python import mediapipe as mp from huggingface_hub import hf_hub_download model_path = hf_hub_download(repo_id="litert-community/MediaPipe-ImageEmbedder-MobileNet-V3-Small", filename="mobilenet_v3_small.tflite") BaseOptions = mp.tasks.BaseOptions ImageEmbedder = mp.tasks.vision.ImageEmbedder ImageEmbedderOptions = mp.tasks.vision.ImageEmbedderOptions VisionRunningMode = mp.tasks.vision.RunningMode options = ImageEmbedderOptions( base_options=BaseOptions(model_asset_path=model_path), running_mode=VisionRunningMode.IMAGE, l2_normalize=True, ) with ImageEmbedder.create_from_options(options) as embedder: e1 = embedder.embed(mp.Image.create_from_file("input.jpg")).embeddings[0] e2 = embedder.embed(mp.Image.create_from_file("other.jpg")).embeddings[0] print("Cosine similarity:", ImageEmbedder.cosine_similarity(e1, e2)) ``` ### Cross-Platform Guides & Samples - **Task overview & options:** [Image Embedder documentation](https://developers.google.com/edge/mediapipe/solutions/vision/image_embedder) - **Platform setup guides:** [Python](https://developers.google.com/edge/mediapipe/solutions/setup_python) · [Web / JavaScript](https://developers.google.com/edge/mediapipe/solutions/setup_web) · [Android (Kotlin / Java)](https://developers.google.com/edge/mediapipe/solutions/setup_android) · [iOS (Swift)](https://developers.google.com/edge/mediapipe/solutions/setup_ios) · [Flutter (Dart)](https://developers.google.com/edge/mediapipe/solutions/setup_flutter) - **Runnable sample apps:** [Web Demo](https://google-ai-edge.github.io/mediapipe-samples-web/#/vision/image_embedder) · [Web Source](https://github.com/google-ai-edge/mediapipe-samples-web/blob/main/src/tasks/image-embedder.ts) · [Android](https://github.com/google-ai-edge/mediapipe-samples/tree/main/examples/image_embedder/android) · [iOS](https://github.com/google-ai-edge/mediapipe-samples/tree/main/examples/image_embedder/ios) · [Python Notebook](https://colab.research.google.com/github/google-ai-edge/mediapipe-samples/blob/main/examples/image_embedder/python/image_embedder.ipynb) · [Flutter](https://github.com/google/flutter-mediapipe/tree/main/samples/vision/image_embedder) ## Latency Benchmarks End-to-end MediaPipe Task pipeline average latency reported by the [Image Embedder documentation](https://developers.google.com/edge/mediapipe/solutions/vision/image_embedder#benchmarks): | Model Variant | Device | CPU Latency | GPU Latency | |---|---|---:|---:| | MobileNet-V3 (small) | Pixel 6 | 3.94 ms | 7.83 ms | ## Intended Use, Limitations, and Fairness - **Intended applications:** Generating dense feature vectors for on-device image similarity comparison, visual search, clustering, and near-duplicate detection via cosine similarity. - **Limitations & considerations:** Pretrained on ImageNet-1K natural photographs; fine-grained domains (medical scans, OCR, specialized industrial parts) or biometric matching are outside its training distribution. No standalone Google fairness PDF is published for this model 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 | |---|---|---|---|---| | `mobilenet_v3_small.tflite` | [`mobilenet_v3_small.tflite`](https://storage.googleapis.com/mediapipe-models/image_embedder/mobilenet_v3_small/float32/latest/mobilenet_v3_small.tflite) | `1682480014603937` | Wed, 26 Apr 2023 03:33:34 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 ```bibtex @inproceedings{howard2019searching, title = {Searching for MobileNetV3}, author = {Howard, Andrew and Sandler, Mark and Chu, Grace and Chen, Liang-Chieh and Chen, Bo and Tan, Mingxing and Wang, Weijun and Zhu, Yukun and Pang, Ruoming and Vasudevan, Vijay and Le, Quoc V. and Adam, Hartwig}, booktitle = {Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV)}, year = {2019}, url = {https://arxiv.org/abs/1905.02244} } ```