ScoreCLR ResNet-18: Pretrained Encoders for Contrastive Learning
2 min read
The ScoreCLR model replaces standard contrastive repulsion in SimCLR with latent distribution estimation using denoising score matching. This architecture reduces the computational complexity of repulsion from $O(B^2)$ to linear $O(B)$ relative to batch size. The repository includes ResNet-18-based checkpoints for the CIFAR-10 and ImageNet-100 datasets, reproducing the results of the research paper. The model is useful for researchers and engineers working on self-supervised learning of visual representations.
Key features
- Linear complexity: Replacing SimCLR repulsion with score matching reduces costs to $O(B)$.
- Ready-to-use checkpoints: Weights for CIFAR-10 and ImageNet-100 with three seeds for each dataset.
- Built-in score_net: A small MLP with FiLM conditional normalization at 0.28M parameters.
- Feature optimization: High RankMe metrics for 256-dimensional codes z.
What you can do
- Reproduce experiments: Run linear probe and kNN evaluation on validation datasets.
- Explore embeddings: Use extracted features from the encoder to analyze latent space.
- Integrate into pipelines: Connect the library and pretrained ScoreCLR weights into your own computer vision research projects.
Example
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"
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()Read more
Details• CIFAR-10 linear: 88.87 ± 0.44 (seed 1-3)
• ImageNet-100 linear: 71.23 ± 0.06 (seed 1-3)
• Architecture: ResNet-18 with encoder, projector, and score_net
• Purpose: Research checkpoints for paper reproduction, not for general purpose use










Comments