Siglip2 Large LoRA v1
LoRA fine-tune of google/siglip2-large-patch16-384 for material/surface visual-similarity retrieval. Trained with Supervised Contrastive loss on catalog↔in-room segment pairs.
Fonte do modelo
- Tipo
- Other
- Tamanho do arquivo
- 12,2 MB
- Modelo base
- google/siglip2-large-patch16-384
- Versão
- vAdapter model
- Atualizado
- 22 de out. de 2026
- Fonte
- Hugging Face
Descrição da fonte
SigLIP2-Large LoRA v1
LoRA fine-tune of google/siglip2-large-patch16-384
for material/surface visual-similarity retrieval. Trained with Supervised
Contrastive loss on catalog↔in-room segment pairs.
Best validation metrics
| recall@1 | recall@5 | recall@10 |
|---|---|---|
| 0.2795 | 0.5486 | 0.6562 |
Training configuration
- Base model:
google/siglip2-large-patch16-384(vision encoder) - Adapter: LoRA, α=32, r=16, dropout=0.1
- Target modules:
q_proj,k_proj,v_proj,out_proj(attention) - Loss: Supervised Contrastive (SupCon)
- Temperature: 0.07
- Batch size: 32 (×1 grad accum)
- Images per class: 2
- Optimizer: AdamW, lr=1e-4, weight_decay=0.01
- Schedule: cosine, 10% warmup
- Epochs trained: 4
- Final train loss: 0.2828
Per-epoch metrics
| epoch | train_loss | recall@1 | recall@5 | recall@10 | intra | inter | sep |
|---|---|---|---|---|---|---|---|
| 1 | 0.4293 | 0.2674 | 0.5486 | 0.6562 | 0.7547 | 0.2508 | 3.0096 |
| 2 | 0.3911 | 0.2795 | 0.5365 | 0.6562 | 0.7380 | 0.2304 | 3.2032 |
| 3 | 0.3208 | 0.2604 | 0.5312 | 0.6562 | 0.7273 | 0.1999 | 3.6388 |
| 4 | 0.2828 | 0.2691 | 0.5434 | 0.6562 | 0.7238 | 0.1936 | 3.7391 |
intra— mean cosine similarity for same-class pairsinter— mean cosine similarity for cross-class pairssep— intra / inter (higher = better class separation)
Companion dataset
subhrokomol/siglip2-large-lora-v1-dataset
Load
from peft import PeftModel
from transformers import AutoModel, AutoProcessor
base = AutoModel.from_pretrained("google/siglip2-large-patch16-384")
processor = AutoProcessor.from_pretrained("google/siglip2-large-patch16-384")
model = PeftModel.from_pretrained(base, "subhrokomol/siglip2-large-lora-v1")
model.eval()
# image embedding (1024-dim)
import torch
from PIL import Image
img = Image.open("your_image.jpg").convert("RGB")
inputs = processor(images=img, return_tensors="pt")
with torch.no_grad():
embed = model.get_image_features(**inputs)
embed = embed / embed.norm(dim=-1, keepdim=True) # L2-normalize
Intended use
Visual-similarity retrieval over materials, surfaces, and textures — e.g. given a crop from an interior photo, retrieve catalog products with similar visual appearance. Cross-domain (in-the-wild photo ↔ catalog studio photo) is the primary use case.
License
Apache 2.0.
Fontes
1 fonte
Fontes
1 fonteVerificado 22 de out.
Artefatos de modelo
1 artefato
Artefatos de modelo
1 artefatoadapter_model.safetensors
safetensors · 12,2 MB · SHA-256 afde10b09175…3faf · Hugging Face
Download fileTrechos de fonte
2 trechos
Trechos de fonte
2 trechos--- license: apache-2.0 base_model: google/siglip2-large-patch16-384 library_name: peft tags: - siglip - siglip2 - lora - peft - embedding - visual-similarity - material-recognition - contrastive-learning - supervised-contrastive pipeline_tag: image-feature-extraction --- # SigLIP2-Large LoRA v1 LoRA fine-tune of [`google/siglip2-large-patch16-384`](https://huggingface.co/google/siglip2-large-patch16-384) for material/surface visual-similarity retrieval. Trained with Supervised Contrastive loss on catalog↔in-room segment pairs. ## Best validation metrics | recall@1 | recall@5 | recall@10 | |---:|---:|---:| | 0.2795 | 0.5486 | 0.6562 | ## Training configuration - **Base model**: `google/siglip2-large-patch16-384` (vision encoder) - **Adapter**: LoRA, α=32, r=16, dropout=0.1 - **Target modules**: `q_proj`, `k_proj`, `v_proj`, `out_proj` (attention) - **Loss**: Supervised Contrastive (SupCon) - **Temperature**: 0.07 - **Batch size**: 32 (×1 grad accum) - **Images per class**: 2 - **Optimizer**: AdamW, lr=1e-4, weight_decay=0.01 - **Schedule**: cosine, 10% warmup - **Epochs trained**: 4 - **Final train loss**: 0.2828 ## Per-epoch metrics | epoch | train_loss | recall@1 | recall@5 | recall@10 | intra | inter | sep | |------:|-----------:|---------:|---------:|----------:|------:|------:|----:| | 1 | 0.4293 | 0.2674 | 0.5486 | 0.6562 | 0.7547 | 0.2508 | 3.0096 | | 2 | 0.3911 | 0.2795 | 0.5365 | 0.6562 | 0.7380 | 0.2304 | 3.2032 | | 3 | 0.3208 | 0.2604 | 0.5312 | 0.6562 | 0.7273 | 0.1999 | 3.6388 | | 4 | 0.2828 | 0.2691 | 0.5434 | 0.6562 | 0.7238 | 0.1936 | 3.7391 | - `intra` — mean cosine similarity for same-class pairs - `inter` — mean cosine similarity for cross-class pairs - `sep` — intra / inter (higher = better class separation) ## Companion dataset [`subhrokomol/siglip2-large-lora-v1-dataset`](https://huggingface.co/datasets/subhrokomol/siglip2-large-lora-v1-dataset) ## Load ```python from peft import PeftModel from transformers import AutoModel, AutoProcessor base = AutoModel.from_pretrained("google/siglip2-large-patch16-384") processor = AutoProcessor.from_pretrained("google/siglip2-large-patch16-384") model = PeftModel.from_pretrained(base, "subhrokomol/siglip2-large-lora-v1") model.eval() # image embedding (1024-dim) import torch from PIL import Image img = Image.open("your_image.jpg").convert("RGB") inputs = processor(images=img, retur...
Source context: 3 downloads · 0 likes · Pipeline image-feature-extraction · Library peft · Repo subhrokomol/siglip2-large-lora-v1
