--- license: apache-2.0 library_name: pytorch pipeline_tag: image-segmentation tags: - semantic-segmentation - semi-supervised-learning - contrastive-learning - dinov2 - pytorch - cityscapes - arxiv:2607.03068 datasets: - cityscapes --- # PixCon — Cityscapes (Clean-Positive Contrastive SSSS) [![arXiv](https://img.shields.io/badge/arXiv-2607.03068-b31b1b.svg)](https://arxiv.org/abs/2607.03068) Cityscapes checkpoint for **PixCon**, a clean-positive pixel-contrastive framework over a DINOv2-Base encoder. PixCon adds one contrastive branch on a UniMatch V2 consistency backbone: a per-class memory bank admitting **only labeled pixels the student already classifies correctly** (contamination-free positive set, ρ_F = 0, by construction), with **no inference-time parameters** and **no bank-specific threshold**. See the [Pascal model](https://huggingface.co/psychofict/pixcon-pascal) and the paper for the method and analysis. - **Backbone:** DINOv2-Base (ViT-B/14) + DPT-lite decoder, 19 Cityscapes classes. - **This checkpoint:** Cityscapes **1/8** split (372 labeled images), **single seed**. ## Results (honest framing) Compute-matched **one-switch** comparison against our DINOv2 UniMatch V2 reproduction (single seed): | Split | PixCon | UniMatch V2 (our repro) | Published UM2-B | |---|---|---|---| | 1/16 | 83.20 | 83.16 | 83.6 | | **1/8** | **83.88** | 83.96 | 84.3 | PixCon **ties** the compute-matched baseline (within seed noise) and sits **at or slightly below the published UniMatch V2-B** figures. Consistent with the paper's thesis: under a foundation-model teacher contamination is already rare, so clean-positive contrast is a **no-cost, robust default** rather than an accuracy booster. These cells are single-seed (see the paper's Cityscapes table). ## Usage ```python import torch from torchvision import transforms as T from PIL import Image from model.segmentor import PixConSegmentor # from the PixCon code from core.inference import whole_inference model = PixConSegmentor(backbone='dinov2_vitb14', nclass=19, pretrained=False).eval() sd = torch.load('pixcon_cityscapes_1_8.pth', map_location='cpu') model.load_state_dict(sd, strict=False) # proj_head is inference-unused norm = T.Compose([T.ToTensor(), T.Normalize((0.485, 0.456, 0.406), (0.229, 0.224, 0.225))]) img = norm(Image.open('example.jpg').convert('RGB')).unsqueeze(0) with torch.no_grad(): pred = whole_inference(model, img).argmax(1) # [1, H, W], 19 Cityscapes classes ``` Interactive demo: [psychofict/pixcon-demo](https://huggingface.co/spaces/psychofict/pixcon-demo). ## Citation ```bibtex @article{tarubinga2026pixcon, title = {PixCon: Clean-Positive Contrastive Learning for Foundation-Model Semi-Supervised Segmentation}, author = {Tarubinga, Ebenezer}, journal = {arXiv preprint arXiv:2607.03068}, year = {2026} } ```