Dekho UI logo

Dekho UI Classify Medium

Small model for local screen understanding.

Dekho UI Classify Medium ranks English labels for desktop icon crops. Pair it with UI detection and OCR to give a desktop agent a text map of the screen.

Fine-tuned by Shikhar Srivastava from MobileNetV4 Conv Medium. The v1.0.0 release uses the epoch 150 checkpoint.

Dekho uses a multi-label head with independent sigmoid scores. Several learned labels can describe the same icon, such as its shape and its function.

Screenshot examples

Apple Music Apple Music playback controls with detector boxes and model predictions

Spotify Spotify playback controls with detector boxes and model predictions

Highlights

  • UI icon classification. 56.68% recall@1 and 85.18% recall@5.
  • Local inference. The classifier takes 96 × 96 RGB crops and runs on CPU or GPU.
  • Fixed vocabulary. The release includes its ordered class list in labels.json.
  • Weights. The inference weights take 108.4 MB on disk.

Use cases

  • Desktop agents. Combine UI element detection, icon labels, and OCR text into a local screen map.
  • Accessibility fallback. Use visual labels if Windows UI Automation or macOS Accessibility APIs provide incomplete labels.
  • Icon search. Rank known classes for a UI crop.

How to Use/Inference

Install PyTorch, torchvision, timm==1.0.31, Pillow, NumPy, safetensors, and huggingface_hub. Download the versioned bundle.

import sys
from PIL import Image
from huggingface_hub import snapshot_download

release = snapshot_download(
    "shikhar-cs-eng/dekho-ui-classify-medium",
    revision="v1.0.0",
    allow_patterns=[
        "dekho_ui_classify.py", "dekho-ui-classify-medium.safetensors",
        "labels.json", "preprocessing.json", "LICENSE",
    ],
)
sys.path.insert(0, release)
from dekho_ui_classify import DekhoUIClassifier

dekho = DekhoUIClassifier(release, device="cpu")
with Image.open("icon-crop.png") as crop:
    for label, score in dekho.predict(crop, top_k=5):
        print(label, round(score, 3))

The helper fits each RGB crop into 96 × 96 with Lanczos, preserves its aspect ratio and fills unused space with the median corner color. It applies ImageNet normalization and returns ranked classes with uncalibrated sigmoid scores.

ONNX Runtime

Download the FP32 ONNX export (107.9 MB). This single-file, opset 17 export uses the v1.0.0 weights.

  • Input pixels, float32 RGB, shape [1, 3, 96, 96] after applying the preprocessing config.
  • Output logits, one score per label in labels.json order. Apply sigmoid to get the same ranking scores as the Python helper.

Training

  • 150 epochs, 171,100 optimizer steps
  • 14,502 classifier labels
  • Final 50 epochs: ~7.15 million renders, ~143,000 per epoch, including repeats
  • Sources: icon libraries, app artwork, emoji, and selected calculator symbols
  • Renders: one per source per epoch at 16, 24, 48, or 96 px, with cycling backgrounds
  • Model input: 96 × 96 px, batch size 128
  • Final phase: AdamW, 0.0003 starting learning rate, cosine decay
  • Loss: weighted binary cross-entropy with labeled positives, explicit negatives, and weak sampled negatives

Evaluation

UI icon classification performance

The shared benchmark scored 1,386 of 1,881 test icons against 6,098 concepts. Each classifier can rank 6,000 concepts. The denominator includes icons whose accepted concepts the classifiers cannot rank.

Frozen and fine-tuned backbone recall

Model Recall@1 Recall@2 Recall@5
Frozen MobileNet-V4 Medium backbone 23.38% 31.96% 42.21%
Dekho UI Classify Medium 56.68% 71.85% 85.18%

Frozen MobileNet-V4 Medium backbone results

Which release should I use?

  • Choose Dekho UI CLIP for better identifying icons the models have never seen before. It did a better job than both classifiers on the same test.
  • Choose Dekho UI Classify for fast labeling. Use Small for speed or Medium for more accurate labels.
  • Combine them by running Small first and using CLIP to double-check uncertain results.

UI icon recognition performance across the three Dekho releases

Tensor size and CPU and NVIDIA L40S inference latency

Model Recall@1 Recall@2 Recall@5 Tensor bundle CPU mean NVIDIA L40S mean
Dekho UI Classify Small 51.41% 68.09% 75.59% 84.4 MB 6.34 ms 2.93 ms
Dekho UI Classify Medium 56.68% 71.85% 85.18% 108.4 MB 12.01 ms 4.59 ms
Dekho UI CLIP 67.24% 79.73% 88.24% 156.4 MB 113.70 ms 16.18 ms

Recall results · Latency results

Limitations

The classifier ranks only classes it learned during training. Small or clipped crops, different UI themes, and icons whose meaning depends on the app can affect the rankings.

License and attribution

The Dekho UI Classify Medium weights and inference helper are licensed under Apache 2.0, the same license as the pretrained MobileNet-V4 checkpoint. Training asset rights are tracked separately.

Pretrained model: MobileNet-V4 Medium

Citation

Fine-tuned by Shikhar Srivastava. Website · LinkedIn · GitHub

Qin et al., MobileNetV4: Universal Models for the Mobile Ecosystem, ECCV 2024. Paper

Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for shikhar-cs-eng/dekho-ui-classify-medium

Finetuned
(3)
this model

Paper for shikhar-cs-eng/dekho-ui-classify-medium