Instructions to use jaichang/embeddinggemma2-korean-birds-620-litert with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LiteRT
How to use jaichang/embeddinggemma2-korean-birds-620-litert 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
π±β‘ EmbeddingGemma 2 β Korean 620 Bird Species On-Device (LiteRT .tflite + WebGPU .onnx) & Binary Index
π English Overview
This repository provides the knowledge-distilled, ultra-compact on-device encoders (LiteRT .tflite and ONNX Runtime WebGPU .onnx) and precomputed Float32 binary vector databases (.f32) distilled from the full 740M teacher model (jaichang/embeddinggemma2-korean-birds-620).
Designed for 100% client-side, zero-server inference in Flutter Mobile (Android / iOS via tflite_flutter) and Flutter Web (WebGPU / WebGL / WASM via onnxruntime-web).
π§ Knowledge Distillation Architecture & Accuracy
Instead of downloading the 1.2 GB model.safetensors onto a phone or browser, we trained lightweight student networks to directly regress the exact 768-dimensional L2-normalized embedding coordinates of EmbeddingGemma 2 (740M) using Cosine + InfoNCE Distillation Loss:
| Student Encoder | Backbone Architecture | Input Tensor Shape | Output Tensor | File Size | Retrieval Accuracy (vs. Teacher Space) |
|---|---|---|---|---|---|
embeddinggemma2_vision_768d.onnx |
MobileNetV3-Small + 768-d L2 Projection (Distilled Student) |
float32[1, 3, 160, 160] ([-1, 1] RGB) |
float32[1, 768] (L2-norm) |
9.24 MB | 100.0% Top-1 (mean_cos = 0.8841) |
embeddinggemma2_audio_768d.onnx |
1D Multi-Scale Spectral ConvNet + 768-d L2 Projection (Distilled Student) |
float32[1, 80000] (5s @ 16kHz) |
float32[1, 768] (L2-norm) |
14.70 MB | 99.1% Top-1 (mean_cos = 0.9086) |
embeddinggemma2_undistilled_vision_int8.{onnx,tflite} |
Un-distilled Gemma4Vision Transformer Tower (model.safetensors INT8) |
float32[1, 3, 160, 160] ([-1, 1] RGB) |
float32[1, 768] (L2-norm) |
22.38 MB | 93.5% Top-1 (100% on field test set) |
embeddinggemma2_undistilled_audio_int8.{onnx,tflite} |
Un-distilled Gemma4Audio Conformer Tower (model.safetensors INT8) |
float32[1, 80000] (5s @ 16kHz) |
float32[1, 768] (L2-norm) |
30.90 MB | 100.0% Top-1 on field audio test set |
π¦ File Inventory
| Filename | Target Platform / Runtime | Purpose & Size |
|---|---|---|
embeddinggemma2_vision_768d.onnx |
Flutter Web (WebGPU $\rightarrow$ WebGL $\rightarrow$ WASM) & ONNX Runtime |
Knowledge-distilled 160x160 RGB bird photo $\rightarrow$ 768-d embedding encoder (9.24 MB) |
embeddinggemma2_audio_768d.onnx |
Flutter Web (WebGPU $\rightarrow$ WebGL $\rightarrow$ WASM) & ONNX Runtime |
Knowledge-distilled 16kHz bird audio $\rightarrow$ 768-d embedding encoder (14.70 MB) |
embeddinggemma2_undistilled_vision_int8.onnx / .tflite |
ONNX Runtime (WASM SIMD) & LiteRT (tflite_flutter) |
Un-distilled Fine-Tuned Gemma4Vision Tower INT8 (22.38 MB) |
embeddinggemma2_undistilled_audio_int8.onnx / .tflite |
ONNX Runtime (WASM SIMD) & LiteRT (tflite_flutter) |
Un-distilled Fine-Tuned Gemma4Audio Conformer Tower INT8 (30.90 MB) |
embeddinggemma2_vision_768d.tflite |
Android / iOS (tflite_flutter) & LiteRT |
Mobile LiteRT vision encoder (160x160 RGB $\rightarrow$ 768-d) |
embeddinggemma2_audio_768d.tflite |
Android / iOS (tflite_flutter) & LiteRT |
Mobile LiteRT audio encoder (16kHz $\rightarrow$ 768-d) |
korean_620_birds_audio_index.f32 |
Mobile & Web (Float32List) |
Precomputed 768-d audio reference vectors for 620 species (1.8 MB) |
korean_620_birds_photo_index.f32 |
Mobile & Web (Float32List) |
Precomputed 768-d photo reference vectors for 620 species (1.8 MB) |
korean_620_birds_catalog.json |
Mobile & Web | Offline encyclopedia metadata (Korean/English/Scientific names, descriptions, image & audio URLs) |
π Quick Start (ONNX Runtime in Python / Web)
import json
import numpy as np
import onnxruntime as ort
from PIL import Image
from huggingface_hub import hf_hub_download
repo_id = "jaichang/embeddinggemma2-korean-birds-620-litert"
onnx_path = hf_hub_download(repo_id=repo_id, filename="embeddinggemma2_vision_768d.onnx")
f32_path = hf_hub_download(repo_id=repo_id, filename="korean_620_birds_photo_index.f32")
cat_path = hf_hub_download(repo_id=repo_id, filename="korean_620_birds_catalog.json")
# 1. Load catalog & flat Float32 vector index
catalog = json.load(open(cat_path, encoding="utf-8"))["species"]
photo_index = np.fromfile(f32_path, dtype=np.float32).reshape(len(catalog), 768)
# 2. Preprocess image to [1, 3, 160, 160] in [0, 1]
img = Image.open("bird.jpg").convert("RGB").resize((160, 160))
x = (np.asarray(img, dtype=np.float32) / 255.0).transpose(2, 0, 1)[None, ...]
# 3. Run distilled ONNX encoder & cosine similarity search
sess = ort.InferenceSession(onnx_path)
emb = sess.run(None, {"image_rgb": x})[0][0]
sims = photo_index @ emb
top1 = int(np.argmax(sims))
print(f"#1: {catalog[top1]['en_name']} ({catalog[top1]['kr_name']}) β similarity={sims[top1]:.4f}")
π°π· νκ΅μ΄ μλ΄ (Korean Overview)
λ³Έ λͺ¨λΈ(jaichang/embeddinggemma2-korean-birds-620, 740M)μ 768μ°¨μ μλ² λ© κ³΅κ°μ **μ§μμ¦λ₯(Knowledge Distillation)**νμ¬, Flutter λͺ¨λ°μΌ μ±(tflite_flutter)κ³Ό Flutter Web λΈλΌμ°μ (WebGPU / WebGL / WASM)μμ μλ² μμ΄ 100% μ¨λλ°μ΄μ€λ‘ ꡬλν μ μλλ‘ κ²½λνν μ μ© λ ν¬μ§ν 리μ
λλ€.
π§ μ§μμ¦λ₯(Knowledge Distillation) vs 무μ¦λ₯ μλ³Έ νμ(Un-distilled 740M Tower)
1.2GBμ λ¬νλ μ 체 model.safetensors μ€ **ν°μ΄ 1(μ΄κ²½λ μ§μμ¦λ₯ νμ λͺ¨λΈ, ν©κ³ 23.9 MB)**κ³Ό ν°μ΄ 2(무μ¦λ₯ μλ³Έ 740M νμΈνλ μλΈνμ INT8 μ§λ³ν, ν©κ³ 53.3 MB) λ κ°μ§λ₯Ό λͺ¨λ μ 곡ν©λλ€:
- β‘ ν°μ΄ 1 β μ§μμ¦λ₯ νμ λͺ¨λΈ (
embeddinggemma2_{vision,audio}_768d.onnx/.tflite, ν©κ³23.9 MB): λΉμ Top-1100.0%, μ€λμ€ Top-199.1%, WebGPU μ΄κ³ μ μΆλ‘ (~30-80ms) - π― ν°μ΄ 2 β 무μ¦λ₯ μλ³Έ 740M νμΈνλ νμ (
embeddinggemma2_undistilled_{vision,audio}_int8.onnx/.tflite, ν©κ³53.3 MB):model.safetensorsλ΄ μ€μ Gemma4VisionTransformer(22.38 MB) λ°Gemma4AudioConformer(30.90 MB) κ°μ€μΉλ₯Ό μ§μμ¦λ₯ μμ΄ κ·Έλλ‘ μΆμΆνμ¬INT8μμνν μλ³Έ μλΈνμ λͺ¨λΈ
π¦ νμΌ κ΅¬μ±
| νμΌλͺ | λμ νλ«νΌ / λ°νμ | μ©λ λ° ν¬κΈ° |
|---|---|---|
embeddinggemma2_vision_768d.onnx / .tflite |
Flutter Web (WebGPU) & λͺ¨λ°μΌ (LiteRT) |
[ν°μ΄ 1: κ²½λ μ¦λ₯] λΉμ μΈμ½λ (160x160 RGB $\rightarrow$ 768-d, 9.24 MB) |
embeddinggemma2_audio_768d.onnx / .tflite |
Flutter Web (WebGPU) & λͺ¨λ°μΌ (LiteRT) |
[ν°μ΄ 1: κ²½λ μ¦λ₯] μ€λμ€ μΈμ½λ (16kHz νν $\rightarrow$ 768-d, 14.70 MB) |
embeddinggemma2_undistilled_vision_int8.onnx / .tflite |
ONNX Runtime (WASM SIMD) & λͺ¨λ°μΌ (LiteRT) |
[ν°μ΄ 2: 무μ¦λ₯ μλ³Έ] νμΈνλλ Gemma4Vision μλ³Έ νμ INT8 (22.38 MB) |
embeddinggemma2_undistilled_audio_int8.onnx / .tflite |
ONNX Runtime (WASM SIMD) & λͺ¨λ°μΌ (LiteRT) |
[ν°μ΄ 2: 무μ¦λ₯ μλ³Έ] νμΈνλλ Gemma4Audio Conformer μλ³Έ νμ INT8 (30.90 MB) |
korean_620_birds_audio_index.f32 |
λͺ¨λ°μΌ & μΉ κ³΅μ© (Float32List) |
μ‘°λ₯ 620μ’
μ€λμ€ κΈ°μ€ λ²‘ν° (1.8 MB) |
korean_620_birds_photo_index.f32 |
λͺ¨λ°μΌ & μΉ κ³΅μ© (Float32List) |
μ‘°λ₯ 620μ’
μ μ¬μ§ κΈ°μ€ λ²‘ν° (1.8 MB) |
korean_620_birds_catalog.json |
λͺ¨λ°μΌ & μΉ κ³΅μ© | μ‘°λ₯ 620μ’ κ΅λͺ Β·μλ¬Έλͺ Β·νλͺ Β·μ€λͺ Β·μ¬μ§Β·μ리 URL λκ° λ©νλ°μ΄ν° |
- Downloads last month
- 15
Model tree for jaichang/embeddinggemma2-korean-birds-620-litert
Base model
google/embeddinggemma-2