πŸ“±βš‘ EmbeddingGemma 2 β€” Korean 620 Bird Species On-Device (LiteRT .tflite + WebGPU .onnx) & Binary Index

English | ν•œκ΅­μ–΄


🌍 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-1 100.0%, μ˜€λ””μ˜€ Top-1 99.1%, WebGPU μ΄ˆκ³ μ† μΆ”λ‘ (~30-80ms)
  • 🎯 ν‹°μ–΄ 2 β€” 무증λ₯˜ 원본 740M νŒŒμΈνŠœλ‹ νƒ€μ›Œ (embeddinggemma2_undistilled_{vision,audio}_int8.onnx/.tflite, 합계 53.3 MB): model.safetensors λ‚΄ μ‹€μ œ Gemma4Vision Transformer(22.38 MB) 및 Gemma4Audio Conformer(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
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for jaichang/embeddinggemma2-korean-birds-620-litert

Quantized
(1)
this model