Official implementation of ResMatching, accepted at ISBI 2026.
ResMatching: Noise-Resilient Computational Super-Resolution via Guided Conditional Flow Matching
Anirban Ray, Vera Galinova, Florian Jug [arXiv] | [Interactive Results]
Computational Super-Resolution (CSR) in fluorescence microscopy has, despite being an ill-posed problem, a long history. At its very core, CSR is about finding a prior that can be used to extrapolate frequencies in a micrograph that have never been imaged by the image-generating microscope. It stands to reason that, with the advent of better data-driven machine learning techniques, stronger prior can be learned and hence CSR can lead to better results. Here, we present ResMatching, a novel CSR method that uses guided conditional flow matching to learn such improved data-priors. We evaluate ResMatching on 4 diverse biological structures from the BioSR dataset and compare its results against 7 baselines. ResMatching consistently achieves competitive results, demonstrating in all cases the best trade-off between data fidelity and perceptual realism. We observe that CSR using ResMatching is particularly effective in cases where a strong prior is hard to learn, e.g. when the given low-resolution images contain a lot of noise. Additionally, we show that ResMatching can be used to sample from an implicitly learned posterior distribution and that this distribution is calibrated for all tested use-cases, enabling our method to deliver a pixel-wise data-uncertainty term that can guide future users to reject uncertain predictions.
pip install uv
uv syncStart here for the quickest hands-on introduction: notebooks/resmatching_walkthrough.ipynb
This beginner-friendly notebook is aimed at biologists and microscopists and is the easiest way to get a feel for the full ResMatching workflow.
The notebook explains each cell in detail, includes a tiny 2 to 3 epoch training demo, runs small-sample inference with a pre-trained model, computes lightweight metrics, plots calibration, and visualizes the input / ground truth / MMSE / posterior samples.
Experiments use the BioSR dataset. The following subsets are supported:
| Subset | Structure |
|---|---|
ccp |
Clathrin-Coated Pits |
er |
Endoplasmic Reticulum |
factin |
F-actin |
mt |
Microtubules |
mt_noisy |
Microtubules data with additional noise added |
There are two workflows depending on whether you want to train from scratch or use pre-trained checkpoints.
By default,
scripts/metrics.pyevaluates the current local inference outputs indata/<subset>/<split>_results/. Use--paper-resultsto download and evaluate the exact saved prediction stacks used for the paper metrics from Zenodo. Full retraining may produce slight variance due to non-deterministic operations.
Step 1. Download data
# Download all subsets
uv run python scripts/download_data.py
# Or download a specific subset
uv run python scripts/download_data.py --subset ccpData is saved to data/<subset>/ by default.
Step 2. Train
uv run python scripts/train.py ccpThe best checkpoint is saved to checkpoints/ccp/best_model.pth. Training runs for 200 epochs by default.
Step 3. Run inference
uv run python scripts/infer.py ccp --checkpoint checkpoints/ccp/best_model.pthWrites multi-sample TIFFs to data/ccp/test_results/ and data/ccp/val_results/.
Step 4. Compute metrics
# Evaluate the current local inference outputs
uv run python scripts/metrics.py ccp
# Or evaluate the exact paper result stacks from Zenodo
uv run python scripts/metrics.py ccp --paper-resultsThe default command reads from data/ccp/test_results/. With --paper-results, the script downloads the archive to data/ccp/paper_result_samples/, reads test_result_samples/, and prints PSNR, MicroMS3IM, LPIPS, and FID. Add --split val to evaluate the validation stacks. The Zenodo archive for mt_noisy is named mtNoisy, which the script handles automatically.
Step 5. (Optional) Calibration
uv run python scripts/calibrate.py ccp --results-dir data/ccpReads val_results/ and test_results/ under data/ccp/ and saves a calibration curve to data/ccp/calibration.pdf.
Step 1. Download data
uv run python scripts/download_data.py --subset ccpStep 2. Download pre-trained checkpoints
# Download all checkpoints
uv run python scripts/download_models.py
# Or download a specific checkpoint
uv run python scripts/download_models.py --subset ccpCheckpoints are saved to checkpoints/<subset>/best_model.pth by default.
Step 3. Run inference
uv run python scripts/infer.py ccp --checkpoint checkpoints/ccp/best_model.pthStep 4. Compute metrics
# Evaluate the current local inference outputs
uv run python scripts/metrics.py ccp
# Or evaluate the exact paper result stacks from Zenodo
uv run python scripts/metrics.py ccp --paper-resultsStep 5. (Optional) Calibration
uv run python scripts/calibrate.py ccp --results-dir data/ccpIf downloading the datasets or pretrained models using the provided script results in an error, you can download them manually from the following link:
Datasets and pretrained models: Zenodo download link
After downloading, extract the files and place them in the appropriate dataset and model directories used by ResMatching.
The downloaded best-model checkpoints may include the dataset name as a prefix. For example:
ccp_best_model.pth
Before placing a checkpoint in its corresponding model directory, remove the dataset-name prefix so that the file is named:
best_model.pth
For example:
ccp_best_model.pth → best_model.pth
Place each renamed checkpoint inside the directory corresponding to that dataset. Do not place all renamed best_model.pth files in the same directory, as they would overwrite one another.
Similarly, place each manually downloaded dataset in the appropriate dataset directory expected by the project.
If you find this work useful in your research, please consider citing:
@article{resmatching2025,
title={ResMatching: Noise-Resilient Computational Super-Resolution via Guided Conditional Flow Matching},
author={Anirban Ray and Vera Galinova and Florian Jug},
journal={2026 IEEE 23rd International Symposium on Biomedical Imaging (ISBI)},
year={2026}
}MIT
