Measured on device (edge-compat): Galaxy S26 · LiteRT 2.2.0 · GPU (ML Drift) · 3.49 ms p50 (2026-08-26); Galaxy S26 · LiteRT 2.2.0 · NPU (QNN/HTP) · 0.92 ms p50 (2026-08-26); Raspberry Pi 5 · LiteRT 2.2.0.dev20260804 · CPU/XNNPACK, 4 threads · 34.0 ms p50 (2026-08-31); browser · Chromium 151 on M4 Max · LiteRT.js 2.5.3 · WebGPU · 2.72 ms p50 · output matches CPU (2026-08-11). Record: https://github.com/john-rocky/edge-compat/blob/main/cards/places365-resnet18/CARD.md
0
8 commits
4 linked in READMEs
updated Sep 8, 2026
Measured on device (edge-compat): Galaxy S26 · LiteRT 2.2.0 · GPU (ML Drift) · 3.49 ms p50 (2026-08-26); Galaxy S26 · LiteRT 2.2.0 · NPU (QNN/HTP) · 0.92 ms p50 (2026-08-26); Raspberry Pi 5 · LiteRT 2.2.0.dev20260804 · CPU/XNNPACK, 4 threads · 34.0 ms p50 (2026-08-31); browser · Chromium 151 on M4 Max · LiteRT.js 2.5.3 · WebGPU · 2.72 ms p50 · output matches CPU (2026-08-11). Record: https://github.com/john-rocky/edge-compat/blob/main/cards/places365-resnet18/CARD.md
ResNet18 trained on Places365 (CSAILVision), converted to LiteRT and
running fully on the CompiledModel GPU (ML Drift) on Android. Scene/place recognition across 365
categories (beach, kitchen, forest, office, restaurant, …) — a distinct task from object classification.

| nodes on GPU | 61 / 61 LITERT_CL (full residency) |
| inference | ~2 ms (224×224) |
| size | 22.8 MB (fp16) |
| accuracy | device-vs-PyTorch corr 1.0, top-1 match |
image[1,3,224,224] (ImageNet-normalized) →[GPU: ResNet18]→ logits[1,365]
Android (Kotlin, CompiledModel GPU)
val model = CompiledModel.create(context.assets, "places_fp16.tflite",
CompiledModel.Options(Accelerator.GPU), null)
val inputs = model.createInputBuffers()
val outputs = model.createOutputBuffers()
inputs[0].writeFloat(chw) // [1,3,224,224] ImageNet-normalized, NCHW
model.run(inputs, outputs)
val logits = outputs[0].readFloat() // [1,365] scene logits -> softmax top-k
Python (desktop verification)
MEAN = np.array([0.485, 0.456, 0.406], np.float32)
STD = np.array([0.229, 0.224, 0.225], np.float32)
import numpy as np
from PIL import Image
from ai_edge_litert.interpreter import Interpreter
# labels: https://raw.githubusercontent.com/CSAILVision/places365/master/categories_places365.txt
labels = [l.split(" ")[0][3:] for l in open("categories_places365.txt")]
img = Image.open("scene.jpg").convert("RGB").resize((224, 224))
x = ((np.asarray(img, np.float32) / 255 - MEAN) / STD).transpose(2, 0, 1)[None]
it = Interpreter(model_path="places_fp16.tflite"); it.allocate_tensors()
it.set_tensor(it.get_input_details()[0]["index"], x); it.invoke()
z = it.get_tensor(it.get_output_details()[0]["index"])[0] # [365]
p = np.exp(z - z.max()); p /= p.sum()
for i in p.argsort()[-5:][::-1]:
print(f"{labels[i]}: {p[i]:.3f}")
AdaptiveAvgPool2d(1) → mean(3).mean(2) (multi-axis-pool fix).MaxPool2d(3,s2,p1) → zero-pad + valid max-pool. PyTorch's max-pool pads with -inf →
a PADV2 op the Mali delegate won't delegate (splits the graph → compile fail). Since the pool follows a
ReLU (inputs ≥ 0), a 0-pad is exactly equivalent and emits a delegatable PAD → full GPU residency.Result: banned ops NONE, all tensors ≤4D, tflite-vs-torch corr 1.0, device-vs-torch corr 1.0.
Center-crop to square, resize to 224×224, /255, ImageNet mean/std, NCHW. Output 365-class scene logits; softmax + argmax for top-k.
Measured on a Pixel 8a (Tensor G3, Android 16) with the standard TFLite benchmark_model tool — 10 warm-up runs then 50 timed runs, reported as the tool's mean.
| Runtime | Backend | Graph on GPU | Latency |
|---|---|---|---|
LiteRT CompiledModel (LITERT_CL) | GPU | 61 / 61 | ~2 ms |
TFLite benchmark_model (TfLiteGpuDelegateV2) | GPU (OpenCL) | 61 / 61 | 12.5 ms |
TFLite benchmark_model | CPU (XNNPACK, 4 threads) | — | 62.0 ms |
The two GPU rows are different runtimes, not a contradiction. The LITERT_CL figure is the one recorded when this model shipped, taken through LiteRT's own CompiledModel accelerator — the path the Kotlin sample app and the LiteRT API use. The TfLiteGpuDelegateV2 figure is the classic TFLite OpenCL delegate, measured with a tool anyone can download and re-run. They agree on how much of the graph the GPU takes; they disagree on speed, and the classic delegate is the slower of the two here. Read the TfLiteGpuDelegateV2 row as a reproducible floor, not as this model's speed on LiteRT.
The NPU is 3.80x faster than the GPU (0.918 ms against 3.49 ms) and loads 4.86x faster (104 ms against 507 ms).
| backend | compiled | inference (median / min) | load |
|---|---|---|---|
| NPU (Hexagon v81) | on-device JIT | 0.918 ms / 0.900 ms | 104 ms |
| GPU (Adreno) | — | 3.49 ms / 3.16 ms | 507 ms |
Measured on a Samsung Galaxy S26 (Snapdragon 8 Elite Gen 5 / SM8850, Hexagon v81, Android 16) with LiteRT CompiledModel 2.2.0, one accelerator per process, 5 warm-up runs then N=50 timed runs, median reported. Every run held thermal status NONE throughout. Headroom 0.80, where 1.0 is the throttling threshold.
The NPU rows ran the published file unchanged. LiteRT compiled it for the Hexagon on the device at first load. That first compile took 508 ms here. The load column above is the cached load every later run pays. Recipe and the runtime libraries it needs: NPU guide.
GPU wiring: GPU guide.
Measured on a Raspberry Pi 5 Model B Rev 1.1 (8 GB, Raspberry Pi OS 64-bit) with the LiteRT benchmark_model tool from litert-cli-nightly 0.2.0.dev20260805: CPU inference (XNNPACK, 4 threads), 3 invocations per file of 10 warm-up plus 50 timed runs (the tool caps a phase at 150 s, so very slow graphs run fewer — the Runs column is the actual timed total). The latency is the median across invocations; the spread is the min–max over all timed runs. No thermal throttling occurred during these runs (vcgencmd get_throttled stayed 0x0).
| File | Inference (median) | Spread (min–max) | Runs | Peak memory |
|---|---|---|---|---|
places_fp16.tflite | 34.0 ms | 33.8–34.9 ms | 150 | 138 MB |
MIT. Upstream: CSAILVision/places365.
Measured on device (edge-compat): Galaxy S26 · LiteRT 2.2.0 · GPU (ML Drift) · 3.49 ms p50 (2026-08-26); Galaxy S26 · LiteRT 2.2.0 · NPU (QNN/HTP) · 0.92 ms p50 (2026-08-26); Raspberry Pi 5 · LiteRT 2.2.0.dev20260804 · CPU/XNNPACK, 4 threads · 34.0 ms p50 (2026-08-31); browser · Chromium 151 on M4 Max · LiteRT.js 2.5.3 · WebGPU · 2.72 ms p50 · output matches CPU (2026-08-11). Record: https://github.com/john-rocky/edge-compat/blob/main/cards/places365-resnet18/CARD.md
0
8 commits
4 linked in READMEs
updated Sep 8, 2026
Measured on device (edge-compat): Galaxy S26 · LiteRT 2.2.0 · GPU (ML Drift) · 3.49 ms p50 (2026-08-26); Galaxy S26 · LiteRT 2.2.0 · NPU (QNN/HTP) · 0.92 ms p50 (2026-08-26); Raspberry Pi 5 · LiteRT 2.2.0.dev20260804 · CPU/XNNPACK, 4 threads · 34.0 ms p50 (2026-08-31); browser · Chromium 151 on M4 Max · LiteRT.js 2.5.3 · WebGPU · 2.72 ms p50 · output matches CPU (2026-08-11). Record: https://github.com/john-rocky/edge-compat/blob/main/cards/places365-resnet18/CARD.md
ResNet18 trained on Places365 (CSAILVision), converted to LiteRT and
running fully on the CompiledModel GPU (ML Drift) on Android. Scene/place recognition across 365
categories (beach, kitchen, forest, office, restaurant, …) — a distinct task from object classification.

| nodes on GPU | 61 / 61 LITERT_CL (full residency) |
| inference | ~2 ms (224×224) |
| size | 22.8 MB (fp16) |
| accuracy | device-vs-PyTorch corr 1.0, top-1 match |
image[1,3,224,224] (ImageNet-normalized) →[GPU: ResNet18]→ logits[1,365]
Android (Kotlin, CompiledModel GPU)
val model = CompiledModel.create(context.assets, "places_fp16.tflite",
CompiledModel.Options(Accelerator.GPU), null)
val inputs = model.createInputBuffers()
val outputs = model.createOutputBuffers()
inputs[0].writeFloat(chw) // [1,3,224,224] ImageNet-normalized, NCHW
model.run(inputs, outputs)
val logits = outputs[0].readFloat() // [1,365] scene logits -> softmax top-k
Python (desktop verification)
MEAN = np.array([0.485, 0.456, 0.406], np.float32)
STD = np.array([0.229, 0.224, 0.225], np.float32)
import numpy as np
from PIL import Image
from ai_edge_litert.interpreter import Interpreter
# labels: https://raw.githubusercontent.com/CSAILVision/places365/master/categories_places365.txt
labels = [l.split(" ")[0][3:] for l in open("categories_places365.txt")]
img = Image.open("scene.jpg").convert("RGB").resize((224, 224))
x = ((np.asarray(img, np.float32) / 255 - MEAN) / STD).transpose(2, 0, 1)[None]
it = Interpreter(model_path="places_fp16.tflite"); it.allocate_tensors()
it.set_tensor(it.get_input_details()[0]["index"], x); it.invoke()
z = it.get_tensor(it.get_output_details()[0]["index"])[0] # [365]
p = np.exp(z - z.max()); p /= p.sum()
for i in p.argsort()[-5:][::-1]:
print(f"{labels[i]}: {p[i]:.3f}")
AdaptiveAvgPool2d(1) → mean(3).mean(2) (multi-axis-pool fix).MaxPool2d(3,s2,p1) → zero-pad + valid max-pool. PyTorch's max-pool pads with -inf →
a PADV2 op the Mali delegate won't delegate (splits the graph → compile fail). Since the pool follows a
ReLU (inputs ≥ 0), a 0-pad is exactly equivalent and emits a delegatable PAD → full GPU residency.Result: banned ops NONE, all tensors ≤4D, tflite-vs-torch corr 1.0, device-vs-torch corr 1.0.
Center-crop to square, resize to 224×224, /255, ImageNet mean/std, NCHW. Output 365-class scene logits; softmax + argmax for top-k.
Measured on a Pixel 8a (Tensor G3, Android 16) with the standard TFLite benchmark_model tool — 10 warm-up runs then 50 timed runs, reported as the tool's mean.
| Runtime | Backend | Graph on GPU | Latency |
|---|---|---|---|
LiteRT CompiledModel (LITERT_CL) | GPU | 61 / 61 | ~2 ms |
TFLite benchmark_model (TfLiteGpuDelegateV2) | GPU (OpenCL) | 61 / 61 | 12.5 ms |
TFLite benchmark_model | CPU (XNNPACK, 4 threads) | — | 62.0 ms |
The two GPU rows are different runtimes, not a contradiction. The LITERT_CL figure is the one recorded when this model shipped, taken through LiteRT's own CompiledModel accelerator — the path the Kotlin sample app and the LiteRT API use. The TfLiteGpuDelegateV2 figure is the classic TFLite OpenCL delegate, measured with a tool anyone can download and re-run. They agree on how much of the graph the GPU takes; they disagree on speed, and the classic delegate is the slower of the two here. Read the TfLiteGpuDelegateV2 row as a reproducible floor, not as this model's speed on LiteRT.
The NPU is 3.80x faster than the GPU (0.918 ms against 3.49 ms) and loads 4.86x faster (104 ms against 507 ms).
| backend | compiled | inference (median / min) | load |
|---|---|---|---|
| NPU (Hexagon v81) | on-device JIT | 0.918 ms / 0.900 ms | 104 ms |
| GPU (Adreno) | — | 3.49 ms / 3.16 ms | 507 ms |
Measured on a Samsung Galaxy S26 (Snapdragon 8 Elite Gen 5 / SM8850, Hexagon v81, Android 16) with LiteRT CompiledModel 2.2.0, one accelerator per process, 5 warm-up runs then N=50 timed runs, median reported. Every run held thermal status NONE throughout. Headroom 0.80, where 1.0 is the throttling threshold.
The NPU rows ran the published file unchanged. LiteRT compiled it for the Hexagon on the device at first load. That first compile took 508 ms here. The load column above is the cached load every later run pays. Recipe and the runtime libraries it needs: NPU guide.
GPU wiring: GPU guide.
Measured on a Raspberry Pi 5 Model B Rev 1.1 (8 GB, Raspberry Pi OS 64-bit) with the LiteRT benchmark_model tool from litert-cli-nightly 0.2.0.dev20260805: CPU inference (XNNPACK, 4 threads), 3 invocations per file of 10 warm-up plus 50 timed runs (the tool caps a phase at 150 s, so very slow graphs run fewer — the Runs column is the actual timed total). The latency is the median across invocations; the spread is the min–max over all timed runs. No thermal throttling occurred during these runs (vcgencmd get_throttled stayed 0x0).
| File | Inference (median) | Spread (min–max) | Runs | Peak memory |
|---|---|---|---|---|
places_fp16.tflite | 34.0 ms | 33.8–34.9 ms | 150 | 138 MB |
MIT. Upstream: CSAILVision/places365.