Downloads · 30 days
0
ZhihaoZhao/SwinMSI-weights
SwinMSI-weights is a machine learning model from ZhihaoZhao. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for pytorch. The card lists the license as cc-by-4.0.
Trained checkpoints for the paper "SwinMSI: Window-Attention Super-Resolution Exploiting Long-Range Self-Similarity for Mass Spectrometry Imaging."
Downloads · 30 days
0
Access
Public
Updated Jul 17, 2026
Repo size
1.8 GB
Likes
0
Public
Click a slice to open those files.
.pth1.8 GB · 100%
From the Hugging Face model README
Trained checkpoints for the paper "SwinMSI: Window-Attention Super-Resolution Exploiting Long-Range Self-Similarity for Mass Spectrometry Imaging."
SwinMSI reconstructs a full high-resolution MSI dataset (all m/z channels) from a single fast, low-resolution acquisition, so that high spatial resolution can be traded for far shorter acquisition time (≈7–8× in our DESI experiments). Its Swin-Transformer (window-attention) backbone exploits the long-range self-similarity of MSI ion images to recover fine detail, operating on the MSI data alone (no co-registered optical modality).
| File | Method | Params | Size | Notes |
|---|---|---|---|---|
swinmsi_best.pth | SwinMSI (proposed) | 11.9 M | ~156 MB | SwinIR backbone, single Charbonnier loss, parameter-free pixel-space residual connection; 300 epochs @ 1e-4 then 100 epochs @ 1e-5 |
unet.pth | U-Net baseline | 31.2 M | ~357 MB | Convolutional encoder–decoder, identical training protocol |
bbdm.pth | BBDM (Brownian-bridge diffusion) | ~78 M | ~607 MB | 1000-step training, 250-step DDIM sampling at inference |
ldm.pth | LDM (latent diffusion) | ~81 M | ~617 MB | VAE + conditional latent diffusion U-Net |
The interpolation baselines (bilinear, bicubic) are parameter-free and require no weights. MOSR is an external, pretrained model released by its original authors and is not redistributed here (see the MOSR paper and its official release).
Download a checkpoint and run 4× super-resolution on a low-resolution .imzML file:
from huggingface_hub import hf_hub_download
weights = hf_hub_download("ZhihaoZhao/SwinMSI-weights", "swinmsi_best.pth")
# from the code repository
python evaluation/apply_superres_unet.py \
--input LR.imzML \
--output SR.imzML \
--model swinmsi_best.pth \
--device cuda
A one-click Colab demo that downloads a sample dataset and a checkpoint is provided in the
code repository at examples/quickstart_colab.ipynb.
All models were trained from scratch on 70 public METASPACE MSI datasets (60 rodent-brain and 10 kidney sections), with low-resolution inputs synthesized by Gaussian point-spread-function blur followed by 4× bicubic downsampling. Training used PyTorch with BF16 mixed precision on a single NVIDIA RTX 4090. See the code repository for the full pipeline and configuration.
@article{zhao2026swinmsi,
title = {SwinMSI: Window-Attention Super-Resolution Exploiting Long-Range Self-Similarity for Mass Spectrometry Imaging},
author = {Zhao, Zhihao and Lv, Yuanxia and Zhuang, Yaoyu and Zhang, Zhimin and Wu, Qian and Lu, Hongmei},
year = {2026},
note = {Manuscript under review}
}
These weights are released under the Creative Commons Attribution 4.0 International (CC-BY-4.0) license, matching the accompanying dataset.