Skip to content

Latest commit

 

History

918 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Self-Supervised Pretraining for Randomized Smoothing

Applying self-supervised and contrastive pretraining methods to improve certified robustness via randomized smoothing.

Overview

This repository is a customized fork of OpenMMLab's mmpretrain toolbox, adapted for research on randomized smoothing — a technique for building classifiers with provable robustness guarantees against adversarial perturbations.

The key idea is that self-supervised pretraining (SimCLR, BYOL, MoCo, BarlowTwins, etc.) can produce representations that lead to tighter certified robustness bounds when combined with randomized smoothing at inference time.

What is Randomized Smoothing?

Randomized smoothing constructs a "smoothed classifier" by averaging the predictions of a base classifier over Gaussian noise perturbations of the input. This provides a certified radius within which the classifier's prediction is guaranteed not to change, regardless of the adversarial perturbation applied.

Project Structure

The repo inherits the full mmpretrain ecosystem:

  • mmpretrain/ — core library (models, datasets, training engine)
  • configs/ — training configurations for 100+ pretrained model architectures
  • tools/ — training, evaluation, and analysis scripts
  • projects/ — standalone research projects built on top of the framework
  • docker/ — containerized environment setup

Supported Self-Supervised Methods

BarlowTwins, BYOL, SimCLR, MoCo v2/v3, MAE, BEiT, DINO, SwAV, and many more — see the full model zoo.

Setup

pip install -r requirements.txt
pip install -e .

Or using Docker:

cd docker && docker build -t selfsup-ransmooth .

Usage

# Pretrain with a self-supervised method (e.g., SimCLR on CIFAR-10)
python tools/train.py configs/simclr/simclr_resnet50_8xb256-coslr-200e_in1k.py

# Evaluate with randomized smoothing
python tools/test.py <config> <checkpoint> --cfg-options ...

Related Work

Tech Stack

  • Python, PyTorch
  • OpenMMLab (mmengine, mmpretrain)
  • CUDA for GPU acceleration
  • WandB for experiment tracking

About

Self-supervised pretraining for certified robustness via randomized smoothing — built on OpenMMLab mmpretrain

Topics

Resources

Contributing

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages