MK Unified SSL Toolbox

Your all-in-one playground for self-supervised learning — from raw data to smart embeddings in audio, vision, graphs, and cross-modal magic under one roof.

Vision
Audio
Multimodal
Graph

About the Library

Say hello to MK_SSL — a library born from late-night debugging, too much coffee, and the realization that SSL shouldn’t feel like solving a Rubik’s cube in the dark. It’s a unified playground and command center where you can test state-of-the-art methods, swap modalities with a single line, and keep your sanity intact. Everything is modular, transparent, and reproducible.

Whether you’re a student, researcher, or practitioner, MK_SSL has your back. With HuggingFace and PyTorch Lightning baked in—plus distributed training, hyperparameter tuning, and lightweight fine-tuning—you’ll spend less time wrestling with setup and more time exploring ideas. In short: rigor meets playfulness. It also consolidates the earlier AK_SSL project; everything from AK_SSL is now accessible directly from MK_SSL with the same syntax in one unified framework.

3
Domains
15+
Methods
100%
Modular

Supported Methods

Vision

MAE (Masked AutoEncoder)
barlowtwins
byol
dino
mocov2
mocov3
simclr
simsiam
swav

Audio

Wav2Vec2
HuBERT
SpeechSimCLR
COLA
EAT

Multimodal

CLAP
AudioCLIP
Wav2CLIP
clip
albef
simvlm
slip
uniter
vse

Graph

GraphCL

Features

High-level APIs

High-level APIs for rapid experimentation

PyTorch Lightning

Integrated with PyTorch Lightning

HuggingFace

Compatibility with pretrained transformers & backbones

Distributed Training

Multi-GPU/multi-node deep learning

LoRA Fine-tuning

Parameter-efficient fine-tuning support

Optuna HPO

Hyperparameter optimization with Optuna

Embedding Visualizations

Dynamic visualizations for embeddings (text only)

Clean Logging

Clean, customizable logging system

License

MIT License

Trainer Utilities

Training API

Use trainer.train(...) to launch experiments with clear, composable arguments.

Parameters at a Glance

Control datasets, batch size, epochs, optimizer, HPO, and logging from a single call.

Results & Logging

Track runs with WandB and text-based embedding summaries out of the box.

Example Usage
trainer.train(
    train_dataset=train_dataset,
    val_dataset=val_dataset,
    batch_size=16,
    epochs=100,
    lr=1e-4,
    weight_decay=1e-2,
    optimizer="adamw",
    use_hpo=True,
    n_trials=20,
    tuning_epochs=5,
    use_embedding_logger=True,
    logger_loader=logger_loader
)

Evaluation Tools

Linear Probing

Evaluate learned representations with linear classifiers

Full Fine-tuning

Complete model fine-tuning for downstream tasks

Embedding Analysis

Dimensionality reduction for embedding analysis (text summaries only)

UMAP Projection

Non-linear dimensionality reduction (text summaries only)

Embedding Summaries

Dynamic summaries of training progress

evaluate() Functions

Standardized evaluation across all domains

Installation

pip

pip install mk-ssl

Roadmap

Distributed Training

DDP and DeepSpeed integration for large-scale training

CLI Launcher Tools

Command-line interface for easy experiment management

Web-based Monitoring

Real-time experiment monitoring dashboard

More Evaluation Benchmarks

Comprehensive benchmark suite for SSL methods

Credits & Acknowledgment

Special Thanks

Thanks to Dr. Peyman Adibi and Dr. Hossein Karshenas for their invaluable guidance and support throughout this project.