https://github.com/stnava/siq
deep network training within the antspy framework
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (16.9%) to scientific vocabulary
Repository
deep network training within the antspy framework
Basic Info
- Host: GitHub
- Owner: stnava
- License: apache-2.0
- Language: Python
- Default Branch: main
- Size: 303 KB
Statistics
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
SIQ: Super-Resolution Image Quantification
SIQ is a powerful and flexible Python library for deep learning-based image super-resolution, with a focus on medical imaging applications. It provides a comprehensive toolkit for every stage of the super-resolution workflow, from data generation and model training to robust inference and evaluation.
The library is built on TensorFlow/Keras and ANTSpy and is designed to handle complex, real-world challenges such as anisotropic super-resolution (where different upsampling factors are needed for each axis) and multi-task learning (e.g., simultaneously upsampling an image and its segmentation mask).
Function-specific documentation is here.
Key Features
SIQ is more than just an inference tool; it's a complete framework that facilitates:
- Flexible Data Generation: Automatically create paired low-resolution and high-resolution patches for training with
siq.image_generator. Includes support for multi-channel data (e.g., image + segmentation) viasiq.seg_generator. - Advanced Model Architectures: Easily instantiate powerful Deep Back-Projection Networks (DBPN) for 2D and 3D with
siq.default_dbpn, customized for any upsampling factor and multi-task outputs. - Perceptual Loss Training: Go beyond simple Mean Squared Error. SIQ includes tools for using pre-trained feature extractors (
siq.get_grader_feature_network,siq.pseudo_3d_vgg_features_unbiased) to optimize for perceptual quality. - Intelligent Loss Weighting: Automatically balance complex, multi-component loss functions (e.g., MSE + Perceptual + Dice) with a single command (
siq.auto_weight_loss,siq.auto_weight_loss_seg) to ensure stable training. - End-to-End Training Pipelines: Train models from start to finish with the high-level
siq.trainandsiq.train_segfunctions, which handle data generation, validation, and model saving. - Robust Inference: Apply your trained models to new images with
siq.inference, including specialized logic for region-wise and blended super-resolution when guided by a segmentation mask. - Comprehensive Evaluation: Systematically benchmark and compare model performance with
siq.compare_models, which calculates PSNR, SSIM, and Dice metrics against baseline methods.
Installation
You can install the official release directly from PyPI:
bash
pip install siq
To install the latest development version from this repository:
bash
git clone https://github.com/stnava/siq.git
cd siq
pip install .
Quick Start: A 5-Minute Example
The examples demonstrate the core workflow: training a model on publicly available data and using it for inference.
bash
tests/test.py
tests/test_seg.py
Pre-trained Models and Compatibility
We provide a collection of pre-trained models to get you started without requiring you to train from scratch.
Important Note on Keras/TensorFlow Versions
The deep learning ecosystem evolves quickly. Models saved with older versions of TensorFlow/Keras (as .h5 files) may have trouble loading in newer versions (TF >= 2.16) due to the transition to the .keras format.
If you encounter issues loading a legacy .h5 model, we provide a robust conversion script. This utility will convert your old .h5 files into the modern .keras format.
Usage:
```python import siq
Define the directory containing your old .h5 models
sourcedir = "~/.antspymm/" # Or wherever you downloaded the models outputdir = "./convertedkerasmodels"
Convert the models
siq.converth5tokerasformat( searchdirectory=sourcedir, outputdirectory=outputdir, exclude_patterns=["*weights.h5"] # Skips files that are just weights ) ```
After running this, you can load the converted models from the converted_keras_models directory using siq.read_srmodel or tf.keras.models.load_model.
For Developers
Setting Up the Environment
This package is tested with Python 3.11 and TensorFlow 2.17. For optimal CPU performance, especially on Linux, you may want to set these environment variables:
bash
export TF_ENABLE_ONEDNN_OPTS=1
export ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=8
export TF_NUM_INTRAOP_THREADS=8
export TF_NUM_INTEROP_THREADS=8
Publishing a New Release
To publish a new version of siq to PyPI:
```bash
Ensure build and twine are installed
python3 -m pip install build twine
Clean previous builds
rm -rf build/ siq.egg-info/ dist/
Build the package
python3 -m build .
Upload to PyPI
python3 -m twine upload --repository siq dist/* ```
Owner
- Name: stnava
- Login: stnava
- Kind: user
- Location: USA
- Company: stnava
- Website: http://stnava.github.io
- Repositories: 73
- Profile: https://github.com/stnava
GitHub Events
Total
- Issues event: 2
- Watch event: 1
- Issue comment event: 5
- Push event: 17
- Pull request event: 2
- Fork event: 1
Last Year
- Issues event: 2
- Watch event: 1
- Issue comment event: 5
- Push event: 17
- Pull request event: 2
- Fork event: 1
Committers
Last synced: over 3 years ago
All Time
- Total Commits: 115
- Total Committers: 1
- Avg Commits per committer: 115.0
- Development Distribution Score (DDS): 0.0
Top Committers
| Name | Commits | |
|---|---|---|
| stnava | s****a@g****m | 115 |
Issues and Pull Requests
Last synced: 11 months ago
All Time
- Total issues: 1
- Total pull requests: 2
- Average time to close issues: about 20 hours
- Average time to close pull requests: 9 minutes
- Total issue authors: 1
- Total pull request authors: 1
- Average comments per issue: 4.0
- Average comments per pull request: 1.0
- Merged pull requests: 2
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 1
- Pull requests: 2
- Average time to close issues: about 20 hours
- Average time to close pull requests: 9 minutes
- Issue authors: 1
- Pull request authors: 1
- Average comments per issue: 4.0
- Average comments per pull request: 1.0
- Merged pull requests: 2
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- ntustison (1)
Pull Request Authors
- ntustison (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 298 last-month
- Total dependent packages: 1
- Total dependent repositories: 0
- Total versions: 32
- Total maintainers: 1
pypi.org: siq
deep perceptual resampling and super resolution with antspyx
- Homepage: https://github.com/stnava/siq
- Documentation: https://siq.readthedocs.io/
- License: Apache-2.0
-
Latest release: 0.4.1
published about 1 year ago
Rankings
Maintainers (1)
Dependencies
- antspynet >=0.0
- antspyt1w >=0.2.3
- antspyx >=0.2.7
- h5py >=2.10.0
- numpy >=1.19.4
- pandas >=1.0.1
- pathlib *
- tensorflow >=2.2
- python 3.7-slim-buster build
- actions/checkout v3 composite
- actions/setup-python v3 composite
- pypa/gh-action-pypi-publish 27b31702a0e7fc50959f5ad993c78deac1bdfc29 composite