OpenLSR-X implements a Learnable Super-Resolution Generative Adversarial Network (SRGAN) for X-Ray Computed Tomography (XCT) data using PyTorch and PyTorch Lightning. It is based on Ledig et al. (CVPR 2017) and adapted from Aladdin Persson's implementation.
- Stable Training: Uses a mixture of MSE loss and VGG loss for improved stability.
- High-Quality Results: Employs 'reflect' padding in convolutional layers to reduce border artifacts.
- Modular Design: Easily extendable for new XCT datasets and tasks.
- Batch Job Support: Includes scripts for HPC environments.
- Configurable: All hyperparameters and data paths are set via YAML config files.
- Clone the repository:
git clone <repo-url> cd OpenLSR-X
- Create the environment:
conda create --name openlsr-x_env --file requirements.txt conda activate openlsr-x_env
Train a model using the provided config:
python3 main.py fit -c config.yamlOverride parameters from the command line:
python3 main.py fit -c config.yaml --model.learning_rate 0.0001 --data.batch_size 16For dataset-specific training or prediction, use the corresponding entry points, e.g.:
python3 LabXCT/bentsand.py fit -c LabXCT/bs_config.yaml
python3 PoreSpy/porespy_xct.py fit -c PoreSpy/High_Noise/ps_hn_hf_config.yamlThe project provides several PyTorch Lightning DataModules for handling different XCT datasets:
- PoreSpy3D_Volume: Loads 3D PoreSpy volumes, processes orthogonal slices, and creates train/validation/test splits.
- I13XCTDataModule: Handles Diamond Light Source I13 XCT datasets, including normalization, alignment, and manual axis selection.
- IndLimeDataModule: For Indiana Limestone data, loads and aligns 2D images, supports orthogonal predictions.
- BentSandDataModule: For Bentheimer Sandstone, processes and aligns images, supports orthogonal predictions.
- PoreSpyDataModule: Loads PoreSpy data for all three axes, supports parallel and perpendicular test splits.
Each DataModule supports configuration of batch size, patch size, and augmentation via YAML files. All modules use the core DatasetObject class for paired data.
main.py— CLI entry point for trainingsrgan.py— SRGAN LightningModule implementationsubmodels.py— Generator and Discriminator architecturesdataset.py— Data processing and LightningDataModulesLabXCT/,PoreSpy/,I13-XCT/— Dataset-specific modules and configsblocks.py— Model building blocksloss.py— Loss functions*.sh— Batch job scripts for cluster environments
- For issues, use the repository's GitHub Issues page.
- For advanced usage and API details, see code comments and docstrings.
Maintained by Calum Green.
- Contributions are welcome! Please see the repository's CONTRIBUTING guidelines (if available) or open an issue to discuss your ideas.
BSD 3-Clause License
See LICENSE for details.
This README was generated using AI.