This repo is a PyTorch implementation for digital staining (DS) model training/testing in paper:
Cheng, S., Chang, S., Li, Y., Novoseltseva, A., Lin, S., Wu, Y., ... & Tian, L. (2025). Enhanced multiscale human brain imaging by semi-supervised digital staining and serial sectioning optical coherence tomography. Light: Science & Applications, 14(1), 57.
We propose to solve the weakly-paired dataset problem in digital staining by a semi-supervised approach, which combines contrastive unpaired learning (CUT), pseudo-label learning, and learnable registration.
The generator and registration network training consists of pre-training and fine-tuning stages. We perform alternate optimization of the generator and the learnable registration in the fine-tuning stage at different image scales.
Please consider citing this paper if you found this repo useful: https://doi.org/10.1038/s41377-024-01658-0
- Python 3.8.10
- PyTorch 1.13.1
- CUDA 12.2
- JupyterLab (optional)
Refer to JupyterLab notebook "train-CUT+REG+Pseudo.ipynb" or convert it to .py file to run
Refer to JupyterLab notebook "test-G_and_R.ipynb" or convert it to .py file to run
Given the large data volume in this study, we've shared partial example training and testing data under folders: dataset/example_training_data and dataset/example_testing_data. Please contact authors for more available data given reasonable request.