Instructions to use soodoku/piedomains-image with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use soodoku/piedomains-image with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="soodoku/piedomains-image") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# Load model directly from transformers import AutoProcessor, AutoModelForImageClassification processor = AutoProcessor.from_pretrained("soodoku/piedomains-image") model = AutoModelForImageClassification.from_pretrained("soodoku/piedomains-image", device_map="auto") - Notebooks
- Google Colab
- Kaggle
piedomains-image
Classifies a website from a screenshot of its homepage, for callers who have a picture and
no text. Companion to piedomains-text.
0.501 accuracy / 0.370 macro-F1 over 39 classes. Temperature 1.6669, ECE 0.1769 to 0.0139.
Read the number before using it
The text model gets 0.818 on the same task. Screenshots are much weaker than text, and that is a fact about the problem, not a defect here: at 224px a page's words are unreadable, so this sees layout, colour and imagery only. Use it when text is unavailable -- a render you cannot scrape, a page that is entirely an image -- and prefer text when you have it.
It is nonetheless a real improvement on its predecessor, which scored 0.429. That model
also divided pixels by 255 before a graph that already applied resnet50.preprocess_input,
and labelled Khan Academy and Yahoo as porn in production while reporting 52.9% at
training time.
Preprocessing must match, and it is one function
That failure is why every path -- corpus preparation, live inference, evaluation capture --
calls piedomains.images.resize_for_model and nothing re-implements it. A test asserts no
copy exists, because three had already drifted: training centre-cropped, serving squashed,
and a third path cropped from the left.
The resize squashes rather than crops, deliberately. SigLIP 2 (arXiv:2502.14786 §2.4.2) pretrains "with non-aspect preserving resize", so squashing reproduces the distribution the encoder saw and cropping is the domain shift -- the reverse of what "distortion is bad" suggests.
The backbone is SigLIP 2 because it was measured against ViT-base-in21k on this corpus: 0.531 / 0.397 versus 0.335 / 0.140.
39 classes, not 44
No parked, unavailable, library, military or homestyle. The screenshot corpus was
captured in 2022 and predates those labels, so no examples exist -- notably parked and
unavailable, which a screenshot would identify easily. Fusion has to source them from
text.
Splits are sha256(domain) % 100, the same pure function the text model uses, so the two
corpora cannot disagree about which domains are held out.
Where it works and where it does not
Strongest: pets 0.72, religion 0.67,
education 0.63, gamble 0.57,
adult 0.55 -- categories with a visual signature.
Near zero: searchengines 0.00 (n=13),
urlshortener 0.00 (n=5),
government 0.08 (n=10). A search page
and a URL shortener are both a logo above a text box; there is not much for this to see.
- Downloads last month
- 19
Model tree for soodoku/piedomains-image
Base model
google/siglip2-base-patch16-224