DLSR-DFCAN
Deep Learning Super-Resolution for Fluorescence Microscopy (SIM & WF)
This repository provides a generic, modality-agnostic implementation of DFCAN for fluorescence microscopy super-resolution, supporting both Structured Illumination Microscopy (SIM) and Widefield (WF) data.
The codebase is designed to be:
✔ reproducible
✔ system-independent
✔ resume-safe
✔ extensible to multiple scales (2× / 4× / 8×)
✔ suitable for academic and research use
📌 Supported Modalities Mode Input Channels Description SIM 9 Multi-orientation SIM raw frames WF 1 Single-channel widefield image
Both modalities use the same network architecture with dynamic input handling.
📁 Directory Structure DLSR/ │ ├── dataset/ │ ├── train/ │ │ └── F-actin/ │ │ ├── training_sim/ │ │ ├── training_wf/ │ │ └── training_gt/ │ │ │ └── val/ │ └── F-actin/ │ ├── validation_sim/ │ ├── validation_wf/ │ └── validation_gt/ │ ├── src/ │ ├── models/ │ │ └── DFCAN16.py │ │ │ ├── utils/ │ │ └── sim_dataset.py │ │ │ ├── train_DFCAN.py │ └── infer_validate_DFCAN.py │ ├── scripts/ │ ├── train_all.sh │ └── validate_all.sh │ ├── checkpoints/ │ ├── sim/ │ └── wf/ │ ├── results/ │ ├── sim/ │ └── wf/ │ └── README.md
🧠 Model
Architecture: DFCAN (Fourier Channel Attention Network)
Implementation: DFCAN16.py
Fully convolutional
Accepts arbitrary patch sizes
Supports multi-scale super-resolution
⚙️ Installation Requirements
Python ≥ 3.8
TensorFlow ≥ 2.10
NumPy
imageio
scikit-image
Recommended:
conda create -n dlsr python=3.9 conda activate dlsr pip install tensorflow numpy imageio scikit-image
🚀 Training Train SIM and WF together bash scripts/train_all.sh
This will:
Train SIM and WF sequentially
Save checkpoints separately
Resume automatically if checkpoints exist
Manual training (example)
python src/train_DFCAN.py
--data_dir dataset
--mode SIM
--scale_factor 4
--batch_size 2
--max_iters 12000
--lr 5e-5
--ckpt_dir checkpoints
--resume
🔁 Resume & Checkpoints
Checkpoints are saved every save_interval
Resume logic is automatic
Training continues from the latest iteration
Checkpoint layout:
checkpoints/ ├── sim/ckpt-* └── wf/ckpt-*
📊 Validation & Inference Validate SIM and WF bash scripts/validate_all.sh
Manual validation
python src/infer_validate_DFCAN.py
--data_dir dataset
--mode SIM
--scale_factor 4
--ckpt_dir checkpoints/sim
--out_dir results/sim
🖼 Output Format
All inference results are saved as .tif
Outputs include:
LR input
SR prediction
HR ground truth
Error map
This preserves scientific image fidelity (no PNG compression).
📐 Evaluation Metrics
During validation, the following are reported:
MAE (Mean Absolute Error)
PSNR (Peak Signal-to-Noise Ratio)
Example:
========== VALIDATION RESULT ========== Mode : SIM MAE : 0.0465 PSNR : 24.74 dB
🔬 Design Principles
One dataset class for SIM + WF
One model definition
No hard-coded paths
No dataset-specific hacks
Minimal TensorFlow logging (clean stdout)
Explicit error handling for missing data
🔧 Extensibility
The framework supports:
Arbitrary patch sizes
Multi-scale SR (2× / 4× / 8×)
Architecture extensions via DFCAN16.py
Additional modalities via dataset adapter
📚 Citation
If you use this code in your research, please cite:
Wang et al., Fourier Channel Attention Networks for Super-Resolution, ECCV 2020
🧪 Status
✔ SIM training ✔ WF training ✔ Resume support ✔ Checkpointing ✔ Validation ✔ .tif inference
👤 Author
Jami B.Tech, IIIT Sonepat Research focus: Deep Learning for Microscopy Super-Resolution