Instructions to use shikhar-cs-eng/dekho-ui-classify-small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- timm
How to use shikhar-cs-eng/dekho-ui-classify-small with timm:
import timm model = timm.create_model("hf-hub:shikhar-cs-eng/dekho-ui-classify-small", pretrained=True) - Notebooks
- Google Colab
- Kaggle
Dekho UI Classify Small
Small model for local screen understanding.
Dekho UI Classify Small 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 Small. 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
Highlights
- UI icon classification. 51.41% recall@1 and 75.59% 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 84.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-small",
revision="v1.0.0",
allow_patterns=[
"dekho_ui_classify.py", "dekho-ui-classify-small.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 (84.3 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.
![]()
| Model | Recall@1 | Recall@2 | Recall@5 |
|---|---|---|---|
| Frozen MobileNet-V4 Small backbone | 23.16% | 34.63% | 46.90% |
| Dekho UI Classify Small | 51.41% | 68.09% | 75.59% |
Frozen MobileNet-V4 Small 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.
Latency comes from the same 79-crop workload for all three releases. The legend matches the lines at Recall@5 from top to bottom: Dekho UI CLIP, Dekho UI Classify Medium, then Dekho UI Classify Small.
| 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 Small weights and inference helper are licensed under Apache 2.0, the same license as the pretrained MobileNet-V4 checkpoint.
Pretrained model: MobileNet-V4 Small
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
- -
Model tree for shikhar-cs-eng/dekho-ui-classify-small
Base model
timm/mobilenetv4_conv_small.e2400_r224_in1k

