Feature Extraction
Transformers
Safetensors
siglip2_vision_model
siglip2
vision-encoder
i-jepa
self-supervised-learning
web-ui
random-masking
packed-predictor
Run this model with HF Jobs
Run Wix/ui-encoder-random-plus on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/Wix/ui-encoder-random-plus. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/Wix/ui-encoder-random-plus on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use Wix/ui-encoder-random-plus with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Wix/ui-encoder-random-plus with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="Wix/ui-encoder-random-plus")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("Wix/ui-encoder-random-plus") model = AutoModel.from_pretrained("Wix/ui-encoder-random-plus", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Expand model card with packed I-JEPA training details
Browse files123456789101112131415161718192021222324---library_name: transformersbase_model: google/siglip2-so400m-patch16-naflextags:- siglip2- vision-encoder- jepa- web-ui- random-masking---# UI-JEPA SigLIP2 — random+Seed-0 context encoder from the original `random+` arm: sixteen randomly positioned target blocks per page, each covering 2–8% of the page.These settings reflect the dataset’s average component count and typical component sizes.Test macro F1: **64.07**. Across the three paper seeds: **64.64 ± 0.51**.```pythonfrom transformers import AutoImageProcessor, Siglip2VisionModelprocessor = AutoImageProcessor.from_pretrained("Wix/ui-comp-mask-random-plus")model = Siglip2VisionModel.from_pretrained("Wix/ui-comp-mask-random-plus").eval()```123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115---library_name: transformerspipeline_tag: feature-extractionbase_model: google/siglip2-so400m-patch16-naflextags:- siglip2- vision-encoder- i-jepa- self-supervised-learning- web-ui- random-masking- packed-predictor---# SigLIP2 + efficient packed I-JEPA — random+This repository contains the seed-0 **context encoder** from the paper's`random+` masking arm. Starting from[`google/siglip2-so400m-patch16-naflex`](https://huggingface.co/google/siglip2-so400m-patch16-naflex),we continued pretraining on webpage screenshots for 17,000 steps with theI-JEPA latent-prediction objective and an efficient packed predictor.## What was trainedI-JEPA learns by predicting representations of hidden image patches from thevisible patches:- the **context encoder** sees the visible patches and is updated by training;- a frozen **target encoder**, initialized from the same SigLIP2 checkpoint,supplies the target patch representations; and- a randomly initialized six-layer ViT predictor (width 384, six attentionheads) predicts the hidden representations from the visible context.Training minimizes smooth-L1 distance in feature space. This repositoryreleases the trained context encoder only—the target encoder and predictor aretraining-time components and are not required for feature extraction ordownstream fine-tuning.## Efficient packed I-JEPAThe training implementation predicts all target blocks from a page in onepacked predictor pass. One sequence contains the visible context followed bythe queries for every target block. A block-aware attention mask lets eachtarget query attend to the shared context and to queries from its own block,but not to queries from other blocks. The visible context is therefore encodedonce per page instead of being repeated for every target block. Packing changesthe execution cost, not the I-JEPA learning objective or the released encoderarchitecture.## Masking variant: `random+`Each training page uses sixteen randomly positioned rectangular target blocks,each covering 2–8% of the page. These global hyperparameters reflect thetraining corpus's average of 15.6 mapped components per page and the typicalrange of component sizes. They are **not** matched separately to the componentson each page: component rectangles and class labels do not determine targetplacement in this arm. The full page outside the union of the target blocksremains available as context.## Shared training setup| Setting | Value ||---|---|| Starting encoder | SigLIP2 SO400M, patch size 16, NaFlex || Maximum image tokens | 1,024 patches || Training pages | 118,583 webpage screenshots || Training length | 17,000 steps (approximately 9 epochs) || Effective batch size | 64 pages || Target encoder | Frozen || Predictor | 6-layer ViT, width 384, 6 heads || Context-encoder delay | Frozen for the first 500 steps while the predictor warms up || Optimizer | AdamW, cosine schedule, peak learning rate 5e-5 || Loss | Plain smooth-L1 latent prediction loss |## EvaluationThe encoder is frozen and evaluated with a 12-class linear probe overcomponent representations. A component representation is the mean of theencoder patch features overlapping its rectangle. The probe is trained fromthe 4,000-page seed split and evaluated on the held-out 5,000-page test split.| Result | Test macro F1 ||---|---:|| This checkpoint (seed 0) | **64.07** || Three-pretraining-seed mean ± standard deviation | **64.64 ± 0.51** |## Usage```pythonfrom PIL import Imagefrom transformers import AutoImageProcessor, Siglip2VisionModelrepo_id = "Wix/ui-comp-mask-random-plus"processor = AutoImageProcessor.from_pretrained(repo_id)model = Siglip2VisionModel.from_pretrained(repo_id).eval()image = Image.open("page.png").convert("RGB")inputs = processor(images=image, return_tensors="pt")outputs = model(**inputs)patch_features = outputs.last_hidden_state```Use the bundled image processor so that preprocessing and NaFlex patching matchthe checkpoint. This is a vision encoder, not a component detector or a12-class classifier; downstream tasks require their own pooling and predictionhead.## Intended use and limitationsThe model is intended for research on webpage and user-interfacerepresentations, frozen feature extraction, and downstream fine-tuning. It wascontinued-pretrained on screenshots from a single website-building platform,so performance may not transfer unchanged to other platforms, mobile UIs, ornatural images. The reported score is specific to the paper's component-levellinear-probe protocol.
README.md+98-7