ScoreCLR, ResNet-18 (CIFAR-10 and ImageNet-100)
Pretrained encoders and score networks of the paper Contrastive latent representation learning with denoising score matching. Code: github.com/chris-mrn/ScoreCLR_code.
ScoreCLR replaces the contrastive repulsion of SimCLR with the score of the latent distribution, learned
by a small denoising score-matching network trained jointly with the encoder. The repulsion then costs
O(B) in the batch size instead of O(B²).
Checkpoints
One folder per dataset and seed. These are the runs behind the paper's tables (seeds 1, 2 and 3).
| folder | backbone | pretraining |
|---|---|---|
cifar10/seed{1,2,3} |
ResNet-18, CIFAR stem (3×3 conv, no max-pool), 32×32 inputs | CIFAR-10, 1000 epochs, batch 128 |
imagenet100/seed{1,2,3} |
ResNet-18 | ImageNet-100, 400 epochs, batch 2×128 |
Each folder holds:
model.safetensors: the whole ScoreCLR module.encoder.backbone(512-d features),encoder.projector(2048/256 MLP, 256-d codesz),encoder.classifier(the online linear classifier, used for monitoring only; it is not the paper's linear probe) andscore_net(noise-prediction MLPε̂(z_t, σ), FiLM-conditioned onlog σ, 0.28M parameters).config.json: the training config (config/<dataset>_scoreclr.yamlin the code).results.json: the evaluation of this checkpoint.
Usage
pip install git+https://github.com/chris-mrn/ScoreCLR_code huggingface_hub safetensors
import json
import torch
from huggingface_hub import hf_hub_download
from safetensors.torch import load_file
from scoreclr.data import eval_transforms
from scoreclr.methods import build_method
from scoreclr.utils import Config
repo, run = "chris-mrn/scoreclr-resnet18", "imagenet100/seed1" # or "cifar10/seed1", ...
with open(hf_hub_download(repo, f"{run}/config.json")) as f:
cfg = Config(json.load(f))
model = build_method(cfg)
model.load_state_dict(load_file(hf_hub_download(repo, f"{run}/model.safetensors")))
model.eval()
_, tf = eval_transforms(cfg.data.dataset, cfg.data.crop_size) # the paper's test transform
x = tf(img).unsqueeze(0) # img: an RGB PIL image
with torch.no_grad():
h = model.encoder.backbone(x) # (1, 512) features
z = model.encoder.projector(h) # (1, 256) codes
sigma = torch.full((1,), 0.3)
s = model.score_net.score(z + sigma[:, None] * torch.randn_like(z), sigma) # score of the noised codes
The linear probe and kNN of the paper use the backbone features h.
Results
Linear probe and kNN (top-1, %) on the backbone features, on the validation set. RankMe is the effective
rank of the 256-d codes z.
| seed 1 | seed 2 | seed 3 | mean ± std | |
|---|---|---|---|---|
| CIFAR-10 linear | 89.38 | 88.58 | 88.66 | 88.87 ± 0.44 |
| CIFAR-10 kNN | 88.41 | 88.24 | 88.15 | 88.27 ± 0.13 |
| CIFAR-10 RankMe (z) | 229.5 | 229.3 | 229.3 | 229 / 256 |
| ImageNet-100 linear | 71.22 | 71.18 | 71.30 | 71.23 ± 0.06 |
| ImageNet-100 kNN | 66.50 | 65.78 | 65.88 | 66.05 ± 0.39 |
| ImageNet-100 RankMe (z) | 243.7 | 243.6 | 243.6 | 244 / 256 |
Under the same recipe (AdamW, 2048/256 projector), SimCLR reaches 89.26 ± 0.38 on CIFAR-10 and 72.39 ± 0.62 on ImageNet-100, with RankMe 96 and 143. All baselines are in the code's README.
Notes
- Inputs are normalized with the CIFAR-10 statistics for the CIFAR-10 models and the ImageNet statistics
for the ImageNet-100 models (
eval_transformsdoes both). - ImageNet-100 is the 100-class subset of CMC (the classes of
scripts/make_imagenet100.pyin the code). The models were trained and evaluated on the clane9/imagenet-100 copy. - These are small-scale research checkpoints (ResNet-18, CIFAR-10 and ImageNet-100), released to reproduce the paper, not general-purpose image encoders.
Citation
@misc{marouani2026scoreclr,
title = {Contrastive latent representation learning with denoising score matching},
author = {Marouani, Christopher and Bartosh, Grigory and Naesseth, Christian A.},
year = {2026},
eprint = {2611.18469},
archivePrefix = {arXiv},
primaryClass = {stat.ML}
}