Showing preview only (578K chars total). Download the full file or copy to clipboard to get everything.
Repository: RichardObi/medigan
Branch: main
Commit: db39b901f1d1
Files: 74
Total size: 551.0 KB
Directory structure:
gitextract_6gg4b5eb/
├── .github/
│ └── workflows/
│ └── python-ci.yml
├── .gitignore
├── .readthedocs.yaml
├── CONTRIBUTING.md
├── LICENSE
├── Pipfile
├── README.md
├── config/
│ ├── candidates.json
│ └── global.json
├── docs/
│ ├── Makefile
│ ├── make.bat
│ ├── requirements.txt
│ └── source/
│ ├── adding_models.rst
│ ├── api/
│ │ ├── medigan.config_manager.ConfigManager.rst
│ │ ├── medigan.contribute_model.model_contributor.ModelContributor.rst
│ │ ├── medigan.contribute_model.rst
│ │ ├── medigan.execute_model.model_executor.ModelExecutor.rst
│ │ ├── medigan.execute_model.rst
│ │ ├── medigan.generators.Generators.rst
│ │ ├── medigan.model_visualizer.ModelVisualizer.rst
│ │ ├── medigan.rst
│ │ ├── medigan.select_model.model_selector.ModelSelector.rst
│ │ ├── medigan.select_model.rst
│ │ └── modules.rst
│ ├── code_doc.rst
│ ├── code_examples.rst
│ ├── conf.py
│ ├── description.rst
│ ├── index.rst
│ ├── model_documentation.md
│ ├── models.rst
│ ├── modules_overview.rst
│ └── tests.rst
├── examples/
│ └── tutorial.ipynb
├── models/
│ └── __init__.py
├── pyproject.toml
├── setup.py
├── src/
│ └── medigan/
│ ├── __init__.py
│ ├── config_manager.py
│ ├── constants.py
│ ├── contribute_model/
│ │ ├── __init__.py
│ │ ├── base_model_uploader.py
│ │ ├── github_model_uploader.py
│ │ ├── model_contributor.py
│ │ └── zenodo_model_uploader.py
│ ├── exceptions.py
│ ├── execute_model/
│ │ ├── __init__.py
│ │ ├── install_model_dependencies.py
│ │ ├── model_executor.py
│ │ └── synthetic_dataset.py
│ ├── generators.py
│ ├── model_visualizer.py
│ ├── select_model/
│ │ ├── __init__.py
│ │ ├── matched_entry.py
│ │ ├── model_match_candidate.py
│ │ └── model_selector.py
│ └── utils.py
├── templates/
│ ├── examples/
│ │ ├── 500.pt.txt
│ │ ├── LICENSE
│ │ ├── __init__.py
│ │ ├── metadata.json
│ │ ├── requirements.txt
│ │ └── test.sh
│ ├── raw_examples/
│ │ ├── LICENSE
│ │ ├── __init__.py
│ │ ├── metadata.json
│ │ └── model.pt
│ └── template.json
└── tests/
├── __init__.py
├── fid.py
├── model_contribution_test_manual.py
├── model_integration_test_manual.py
├── test_model_executor.py
└── test_model_selector.py
================================================
FILE CONTENTS
================================================
================================================
FILE: .github/workflows/python-ci.yml
================================================
# This GitHub Action workflow will
# - Format code using Black
# - Build project with all dependencies
# - Check code with flake8 linter
# - Run tests with pytest
# ubuntu-latest has 7GB RAM and 14GB SSD. macos-latest has 14GB RAM and 14GB SSD. Using macos assuming more RAM -> faster tests -> less timeouts
# Nonetheless, our tests seem to need >10 GB RAM and >16,7 GB SSD Space. Test refactoring needed.
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
name: Build and test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
formatting:
outputs:
new_sha: ${{ steps.sha.outputs.SHA }}
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }} # ${{ github.event.pull_request.head.sha }}
- name: Setup Python 3.8
uses: actions/setup-python@v2
with:
python-version: "3.8"
cache: 'pip'
- name: Setup isort and Black
run: |
python -m pip install --upgrade pip
pip install isort black
- name: Run isort
run: |
isort --profile black .
- name: Run Black formatter
run: |
black .
- name: Commit changes
uses: EndBug/add-and-commit@v8
with:
message: 'Fix styling'
add: '*.py'
- name: Get commit hash
id: sha
run: |
sha_new=$(git rev-parse HEAD)
echo $sha_new
echo "::set-output name=SHA::$sha_new"
build:
if: always()
needs: formatting
runs-on: macos-latest
steps:
- name: Checkout to latest changes
uses: actions/checkout@v3
with:
ref: ${{ needs.formatting.outputs.new_sha }}
fetch-depth: 0
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: "3.8"
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest pytest-cov pytest-github-actions-annotate-failures
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install -e .
- name: Install model dependencies
run: |
python src/medigan/execute_model/install_model_dependencies.py
lint:
needs: build
runs-on: macos-latest
steps:
- name: Checkout to latest changes
uses: actions/checkout@v3
with:
ref: ${{ needs.formatting.outputs.new_sha }}
fetch-depth: 0
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: "3.8"
cache: 'pip'
- name: Install cached dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install flake8
pip install -e .
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --max-line-length=88 --extend-ignore=E203,E501
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=88 --extend-ignore=E203,E501 --statistics
test:
needs: build
runs-on: macos-latest #windows-latest
steps:
- name: Checkout to latest changes
uses: actions/checkout@v3
with:
ref: ${{ needs.formatting.outputs.new_sha }}
fetch-depth: 0
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: "3.8"
cache: 'pip'
- name: Install cached dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install pytest pytest-cov pytest-github-actions-annotate-failures
pip install -e .
python src/medigan/execute_model/install_model_dependencies.py
# for windows: pip install -r requirements.txt
# for mac/linux: if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Test with pytest
run: |
pytest tests -W ignore::DeprecationWarning --verbose --failed-first --log-cli-level=INFO #--cov=. --cov-report html #--capture=tee-sys
================================================
FILE: .gitignore
================================================
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
.python-version
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/
# Celery stuff
celerybeat-schedule
celerybeat.pid
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# Further (custom)
.idea/
*.DS_Store
# config/
output/
models/*/**
!models/00007_BEZIERCURVE_TUMOUR_MASK/**
models/00007_BEZIERCURVE_TUMOUR_MASK/.DS_Store
models/00007_BEZIERCURVE_TUMOUR_MASK/__pycache__/
================================================
FILE: .readthedocs.yaml
================================================
# File: .readthedocs.yaml (see example: https://docs.readthedocs.io/en/stable/config-file/v2.html)
# Required (see https://blog.readthedocs.com/migrate-configuration-v2/)
version: 2
# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.8"
# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/source/conf.py
# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: docs/requirements.txt
================================================
FILE: CONTRIBUTING.md
================================================
This file is Work in Progress
# Contributing
## How to Add New Models to medigan:
- `medigan` motivates the reuse of trained generative models.
- Models can be added via pull request by adding a model to the config in https://github.com/RichardObi/medigan-models (link stored in `medigan.constants.CONFIG_FILE_URL`).
- Model contributors need to specify a link to their model package in the config. We recommend to host and link model packages on Zenodo. Reasons:
- Zenodo model packages get a static DOI. This provides clarity as to who the contributors and IP owners of each generative model in `medigan` are.
- File modification/updates under the same DOI are not possible in Zenodo. This helps to avoid security issues as package content remains static after the model is tested, verified, and added to `medigan`.
- Examples of how `medigan` model packages should be hosted on Zenodo can be found here: https://doi.org/10.5281/zenodo.5187715 and here: https://doi.org/10.5281/zenodo.5188558
## Architectural Overview

================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2021 Richard Osuala, Grzegorz Skorupko, Noussair Lazrak
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
================================================
FILE: Pipfile
================================================
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
requests = "*"
opencv-contrib-python-headless = "*"
torch = "*"
pyyaml = "*"
union = "*"
path = "*"
numpy = "*"
scikit-image = "*"
scipy = "*"
sphinx = "*"
sphinx-rtd-theme = "*"
pillow = ">=9.2.0"
visdom = "*"
dominate = "*"
torchvision = "*"
tqdm = "*"
sphinx-automodapi = "*"
[requires]
python_version = "3.9"
[dev-packages]
================================================
FILE: README.md
================================================
<!-- # MEDIGAN -->
<!--  -->

[](https://opensource.org/licenses/MIT)

[](https://badge.fury.io/py/medigan)
[](https://github.com/conda-forge/medigan-feedstock)
[](https://doi.org/10.5281/zenodo.6327625)
[](https://arxiv.org/abs/2209.14472)
`medigan` stands for **medi**cal **g**enerative (**a**dversarial) **n**etworks. `medigan` provides user-friendly medical image synthesis and allows users to choose from a range of pretrained generative models to `generate` synthetic datasets. These synthetic datasets can be used to train or adapt AI models that perform clinical tasks such as lesion classification, segmentation or detection.
See below how medigan can be run from the command line to generate synthetic medical images.

## Features:
- :x: **Problem 1:** Data scarcity in medical imaging.
- :x: **Problem 2:** Scarcity of readily reusable generative models in medical imaging.
- :white_check_mark: **Solution:** `medigan`
1. dataset sharing via generative models :gift:
2. data augmentation :gift:
3. domain adaptation :gift:
4. synthetic data evaluation method testing with multi-model datasets :gift:
Instead of training your own, use one of the generative models from `medigan` to generate synthetic data.
Search and find a model in `medigan` using search terms (e.g. "Mammography" or "Endoscopy").
Contribute your own generative model to `medigan` to increase its visibility, re-use, and impact.
## Available models
| Output type | Modality | Model type | Output size | Base dataset | Output examples | `model_id` | Hosted on | Reference |
|-------------------------------------------------------------|:-----------------------------:|:-----------------------------:|:-----------------------:|:--------------------------------------------------------------------------------------------------------------------------:|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:----------------------------------------------------------------------------------------------------------------------------------------------:|:-------------------------------------------------------------------------------:|:------------------------------------------------------------------------------------:|
| <sub> Breast Calcification </sub> | <sub> mammography </sub> | <sub> dcgan </sub> | <sub> 128x128 </sub> | <sub> [Inbreast](https://www.academicradiology.org/article/S1076-6332(11)00451-X/fulltext) </sub> |  | <sub> [`00001_DCGAN_MMG_CALC_ROI`](https://medigan.readthedocs.io/en/latest/models.html#dcgan-mmg-calc-roi) </sub> | <sub>[Zenodo (5187714)](https://doi.org/10.5281/zenodo.5187714) </sub> | |
| <sub> Breast Mass </sub> | <sub> mammography </sub> | <sub> dcgan </sub> | <sub> 128x128 </sub> | <sub> [Optimam](https://doi.org/10.48550/arXiv.2004.04742) </sub> |  | <sub> [`00002_DCGAN_MMG_MASS_ROI`](https://medigan.readthedocs.io/en/latest/models.html#dcgan-mmg-mass-roi) </sub> | <sub>[Zenodo (5188557)](https://doi.org/10.5281/zenodo.5188557) </sub> | <sub>[Alyafi et al (2019)](https://doi.org/10.48550/arXiv.1909.02062) </sub> |
| <sub> Breast Density Transfer </sub> | <sub> mammography </sub> | <sub> cyclegan </sub> | <sub>1332x800 </sub> | <sub> [BCDR](https://bcdr.eu/information/about) </sub> |  | <sub> [`00003_CYCLEGAN_MMG_DENSITY_FULL`](https://medigan.readthedocs.io/en/latest/models.html#cyclegan-mmg-density-full) </sub> | <sub>[Zenodo (5547263)](https://doi.org/10.5281/zenodo.5547263) </sub> | <sub> [Garrucho et al (2022)](https://doi.org/10.48550/arXiv.2209.09809) </sub> |
| <sub> Breast Mass with Mask </sub> | <sub> mammography </sub> | <sub> pix2pix </sub> | <sub> 256x256 </sub> | <sub> [BCDR](https://bcdr.eu/information/about) </sub> |  <br>  | <sub><sub> [`00004_PIX2PIX_MMG_MASSES_W_MASKS`](https://medigan.readthedocs.io/en/latest/models.html#pix2pix-mmg-masses-w-masks) </sub></sub> | <sub>[Zenodo (7093759)](https://doi.org/10.5281/zenodo.7093759) </sub> | |
| <sub> Breast Mass </sub> | <sub> mammography </sub> | <sub> dcgan </sub> | <sub> 128x128 </sub> | <sub> [BCDR](https://bcdr.eu/information/about) </sub> |  | <sub> [`00005_DCGAN_MMG_MASS_ROI`](https://medigan.readthedocs.io/en/latest/models.html#id1) </sub> | <sub>[Zenodo (6555188)](https://doi.org/10.5281/zenodo.6555188) </sub> | <sub>[Szafranowska et al (2022)](https://doi.org/10.48550/arXiv.2203.04961) </sub> |
| <sub> Breast Mass </sub> | <sub> mammography </sub> | <sub> wgan-gp </sub> | <sub> 128x128 </sub> | <sub> [BCDR](https://bcdr.eu/information/about) </sub> |  | <sub> [`00006_WGANGP_MMG_MASS_ROI`](https://medigan.readthedocs.io/en/latest/models.html#wgangp-mmg-mass-roi) </sub> | <sub>[Zenodo (6554713)](https://doi.org/10.5281/zenodo.6554713) </sub> | <sub>[Szafranowska et al (2022)](https://doi.org/10.48550/arXiv.2203.04961) </sub> |
| <sub> Brain Tumors on Flair, T1, T1c, T2 with Masks </sub> | <sub> brain MRI </sub> | <sub> inpaint GAN </sub> | <sub> 256x256 </sub> | <sub> [BRATS 2018](https://wiki.cancerimagingarchive.net/pages/viewpage.action?pageId=37224922) </sub> |  <br>  <br>  <br>  <br>  <br>  | <sub> [`00007_INPAINT_BRAIN_MRI`](https://medigan.readthedocs.io/en/latest/models.html#inpaint-brain-mri) </sub> | <sub> [Zenodo (7041737)](https://doi.org/10.5281/zenodo.7041737) </sub> | <sub>[Kim et al (2020)](https://doi.org/10.1002/mp.14701) </sub> |
| <sub> Breast Mass (Mal/Benign) </sub> | <sub> mammography </sub> | <sub> c-dcgan </sub> | <sub> 128x128 </sub> | <sub> [CBIS-DDSM](https://wiki.cancerimagingarchive.net/display/Public/CBIS-DDSM) </sub> |  | <sub> [`00008_C-DCGAN_MMG_MASSES`](https://medigan.readthedocs.io/en/latest/models.html#c-dcgan-mmg-masses) </sub> | <sub>[Zenodo (6647349)](https://doi.org/10.5281/zenodo.6647349) </sub> | <sub>[Osuala et al (2024)](https://doi.org/10.48550/arXiv.2407.12669) </sub> |
| <sub> Polyp with Mask </sub> | <sub> endoscopy </sub> | <sub> pggan </sub> | <sub> 256x256 </sub> | <sub> [HyperKvasir](https://osf.io/mh9sj/) </sub> |  <br>  | <sub> [`00009_PGGAN_POLYP_PATCHES_W_MASKS`](https://medigan.readthedocs.io/en/latest/models.html#pggan-polyp-patches-w-masks) </sub> | <sub>[Zenodo (6653743)](https://doi.org/10.5281/zenodo.6653743) </sub> | <sub>[Thambawita et al (2022)](https://doi.org/10.1371/journal.pone.0267976) </sub> |
| <sub> Polyp with Mask </sub> | <sub> endoscopy </sub> | <sub> fastgan </sub> | <sub> 256x256 </sub> | <sub> [HyperKvasir](https://osf.io/mh9sj/) </sub> |  <br>  | <sub> [`00010_FASTGAN_POLYP_PATCHES_W_MASKS`](https://medigan.readthedocs.io/en/latest/models.html#fastgan-polyp-patches-w-masks) </sub> | <sub>[Zenodo (6660711)](https://doi.org/10.5281/zenodo.6660711) </sub> | <sub>[Thambawita et al (2022)](https://doi.org/10.1371/journal.pone.0267976) </sub> |
| <sub> Polyp with Mask </sub> | <sub> endoscopy </sub> | <sub> singan </sub> | <sub> ≈250x250 </sub> | <sub> [HyperKvasir](https://osf.io/mh9sj/) </sub> |  <br>  | <sub> [`00011_SINGAN_POLYP_PATCHES_W_MASKS`](https://medigan.readthedocs.io/en/latest/models.html#singan-polyp-patches-w-masks) </sub> | <sub>[Zenodo (6667944)](https://doi.org/10.5281/zenodo.6667944) </sub> | <sub>[Thambawita et al (2022)](https://doi.org/10.1371/journal.pone.0267976) </sub> |
| <sub> Breast Mass (Mal/Benign) </sub> | <sub> mammography </sub> | <sub> c-dcgan </sub> | <sub> 128x128 </sub> | <sub> [BCDR](https://bcdr.eu/information/about) </sub> |  | <sub> [`00012_C-DCGAN_MMG_MASSES`](https://medigan.readthedocs.io/en/latest/models.html#id2) </sub> | <sub>[Zenodo (6755693)](https://doi.org/10.5281/zenodo.6818095) </sub> | |
| <sub> Breast Density Transfer MLO </sub> | <sub> mammography </sub> | <sub> cyclegan </sub> | <sub>1332x800 </sub> | <sub> [OPTIMAM](https://doi.org/10.48550/arXiv.2004.04742) </sub> |  | <sub> [`00013_CYCLEGAN_MMG_DENSITY_OPTIMAM_MLO`](https://medigan.readthedocs.io/en/latest/models.html#cyclegan-mmg-density-optimam-mlo) </sub> | <sub>[Zenodo (6818095)](https://doi.org/10.5281/zenodo.6818095) </sub> | <sub> [Garrucho et al (2022)](https://doi.org/10.48550/arXiv.2209.09809) </sub> |
| <sub> Breast Density Transfer CC </sub> | <sub> mammography </sub> | <sub> cyclegan </sub> | <sub>1332x800 </sub> | <sub> [OPTIMAM](https://doi.org/10.48550/arXiv.2004.04742) </sub> |  | <sub> [`00014_CYCLEGAN_MMG_DENSITY_OPTIMAM_CC`](https://medigan.readthedocs.io/en/latest/models.html#cyclegan-mmg-density-optimam-cc) </sub> | <sub>[Zenodo (6818103)](https://doi.org/10.5281/zenodo.6818103) </sub> | <sub> [Garrucho et al (2022)](https://doi.org/10.48550/arXiv.2209.09809) </sub> |
| <sub> Breast Density Transfer MLO </sub> | <sub> mammography </sub> | <sub> cyclegan </sub> | <sub>1332x800 </sub> | <sub> [CSAW](https://link.springer.com/article/10.1007/s10278-019-00278-0) </sub> |  | <sub> [`00015_CYCLEGAN_MMG_DENSITY_CSAW_MLO`](https://medigan.readthedocs.io/en/latest/models.html#cyclegan-mmg-density-csaw-mlo) </sub> | <sub>[Zenodo (6818105)](https://doi.org/10.5281/zenodo.6818105) </sub> | <sub> [Garrucho et al (2022)](https://doi.org/10.48550/arXiv.2209.09809) </sub> |
| <sub> Breast Density Transfer CC </sub> | <sub> mammography </sub> | <sub> cyclegan </sub> | <sub>1332x800 </sub> | <sub> [CSAW](https://link.springer.com/article/10.1007/s10278-019-00278-0) </sub> |  | <sub> [`00016_CYCLEGAN_MMG_DENSITY_CSAW_CC`](https://medigan.readthedocs.io/en/latest/models.html#cyclegan-mmg-density-csaw-cc) </sub> | <sub>[Zenodo (6818107)](https://doi.org/10.5281/zenodo.6818107) </sub> | <sub> [Garrucho et al (2022)](https://doi.org/10.48550/arXiv.2209.09809) </sub> |
| <sub> Lung Nodules </sub> | <sub> chest x-ray </sub> | <sub> dcgan </sub> | <sub>128x128 </sub> | <sub> [NODE21](https://zenodo.org/record/4725881#.YxNmNuxBwXA) </sub> |  | <sub> [`00017_DCGAN_XRAY_LUNG_NODULES`](https://medigan.readthedocs.io/en/latest/models.html#dcgan-xray-lung-nodules) </sub> | <sub>[Zenodo (6943691)](https://doi.org/10.5281/zenodo.6943691) </sub> | |
| <sub> Lung Nodules </sub> | <sub> chest x-ray </sub> | <sub> wgan-gp </sub> | <sub>128x128 </sub> | <sub> [NODE21](https://zenodo.org/record/4725881#.YxNmNuxBwXA) </sub> |  | <sub> [`00018_WGANGP_XRAY_LUNG_NODULES`](https://medigan.readthedocs.io/en/latest/models.html#wgangp-xray-lung-nodules) </sub> | <sub>[Zenodo (6943761)](https://doi.org/10.5281/zenodo.6943761) </sub> | |
| <sub> Chest Xray Images </sub> | <sub> chest x-ray </sub> | <sub> pggan </sub> | <sub>1024x1024 </sub> | <sub> [ChestX-ray14](https://nihcc.app.box.com/v/ChestXray-NIHCC/folder/36938765345) </sub> |  | <sub> [`00019_PGGAN_CHEST_XRAY`](https://medigan.readthedocs.io/en/latest/models.html#pggan-chest-xray) </sub> | <sub>[Zenodo (6943803)](https://doi.org/10.5281/zenodo.6943803) </sub> | |
| <sub> Chest Xray Images </sub> | <sub> chest x-ray </sub> | <sub> pggan </sub> | <sub>1024x1024 </sub> | <sub> [ChestX-ray14](https://nihcc.app.box.com/v/ChestXray-NIHCC/folder/36938765345) </sub> |  | <sub> [`00020_PGGAN_CHEST_XRAY`](https://medigan.readthedocs.io/en/latest/models.html#id3) </sub> | <sub>[Zenodo (7046280)](https://doi.org/10.5281/zenodo.7046280) </sub> | <sub> [Segal et al (2021)](https://doi.org/10.1007/s42979-021-00720-7) </sub> |
| <sub> Brain T1-T2 MRI Modality Transfer </sub> | <sub> brain MRI </sub> | <sub> cyclegan </sub> | <sub>224x192 </sub> | <sub> [CrossMoDA 2021](https://arxiv.org/abs/2201.02831) </sub> |  | <sub> [`00021_CYCLEGAN_BRAIN_MRI_T1_T2`](https://medigan.readthedocs.io/en/latest/models.html#cyclegan-brain-mri-t1-t2) </sub> | <sub>[Zenodo (7074555)](https://doi.org/10.5281/zenodo.7074555) </sub> | <sub> [Joshi et al (2022)](https://doi.org/10.1007/978-3-031-09002-8_47) </sub> |
| <sub> Cardiac MRI Age Transfer </sub> | <sub> cardiac MRI </sub> | <sub> wgan </sub> | <sub>256x256 </sub> | <sub> [UK Biobank](https://www.ukbiobank.ac.uk/) </sub> |  | <sub> [`00022_WGAN_CARDIAC_AGING`](https://medigan.readthedocs.io/en/latest/models.html#wgan-cardiac-aging) </sub> | <sub>[Zenodo (7446930)](https://doi.org/10.5281/zenodo.74469305) </sub> | <sub> [Campello et al (2022)](https://doi.org/10.3389/fcvm.2022.983091) </sub> |
| <sub> Breast DCE-MRI Contrast Injection </sub> | <sub> breast DCE-MRI </sub> | <sub> pix2pixHD </sub> | <sub>512x512 </sub> | <sub> [Duke Dataset](https://sites.duke.edu/mazurowski/resources/breast-cancer-mri-dataset/) </sub> |  | <sub> [`00023_PIX2PIXHD_BREAST_DCEMRI`](https://medigan.readthedocs.io/en/latest/models.html#pix2pixhd-breast-dcemri) </sub> | <sub>[Zenodo (10210944)](https://zenodo.org/doi/10.5281/zenodo.10210944) </sub> | <sub> [Osuala et al (2023)](https://doi.org/10.48550/arXiv.2311.10879) </sub> |
Model information can be found in:
- [model documentation](https://medigan.readthedocs.io/en/latest/models.html) (e.g. the parameters of the models' generate functions)
- [global.json](https://github.com/RichardObi/medigan/blob/main/config/global.json) file (e.g. metadata for model description, selection, and execution)
- [medigan paper](https://arxiv.org/abs/2209.14472) (e.g. analysis and comparisons of models and FID scores)
## Installation
To install the current release, simply run:
```console
pip install medigan
```
Or, alternatively via conda:
```console
conda install -c conda-forge medigan
```
## Getting Started
Examples and notebooks are located at [examples](examples) folder
Documentation is available at [medigan.readthedocs.io](https://medigan.readthedocs.io/en/latest/)
### Generation example
#### DCGAN
Create mammography masses with labels (malignant or benign) using a [class-conditional DCGAN model](https://arxiv.org/abs/2407.12669).
```python
# import medigan and initialize Generators
from medigan import Generators
generators = Generators()
# generate 8 samples with model 8 (00008_C-DCGAN_MMG_MASSES).
# Also, auto-install required model dependencies.
generators.generate(model_id=8, num_samples=8, install_dependencies=True)
```

The synthetic images in the top row show malignant masses (breast cancer) while the images in the bottom row show benign masses.
Given such images with class information, [image classification models](https://arxiv.org/abs/2407.12669) can be (pre-)trained.
#### CYCLEGAN
Create mammograms translated from Low-to-High Breast Density using CYCLEGAN model
```python
from medigan import Generators
generators = Generators()
# model 3 is "00003_CYCLEGAN_MMG_DENSITY_FULL"
generators.generate(model_id=3, num_samples=1)
```

→

### Search Example
Search for a [model](https://medigan.readthedocs.io/en/latest/models.html) inside medigan using keywords
```python
# import medigan and initialize Generators
from medigan import Generators
generators = Generators()
# list all models
print(generators.list_models())
# search for models that have specific keywords in their config
keywords = ['DCGAN', 'Mammography', 'BCDR']
results = generators.find_matching_models_by_values(keywords)
```
### Get Model as Dataloader
We can directly receive a [torch.utils.data.DataLoader](https://pytorch.org/docs/stable/data.html#torch.utils.data.DataLoader) object for any of medigan's generative models.
```python
from medigan import Generators
generators = Generators()
# model 4 is "00004_PIX2PIX_MMG_MASSES_W_MASKS"
dataloader = generators.get_as_torch_dataloader(model_id=4, num_samples=3)
```
Visualize the contents of the dataloader.
```python
from matplotlib import pyplot as plt
import numpy as np
plt.figure()
# subplot with 2 rows and len(dataloader) columns
f, img_array = plt.subplots(2, len(dataloader))
for batch_idx, data_dict in enumerate(dataloader):
sample = np.squeeze(data_dict.get("sample"))
mask = np.squeeze(data_dict.get("mask"))
img_array[0][batch_idx].imshow(sample, interpolation='nearest', cmap='gray')
img_array[1][batch_idx].imshow(mask, interpolation='nearest', cmap='gray')
plt.show()
```

## Visualize A Model
With our interface, it is possible to generate sample by manually setting the conditional inputs or latent vector values. The sample is updated in realtime, so it's possible to observe how the images changes when the parameters are modified. The visualization is available only for models with accessible input latent vector. Depending on a model, a conditional input may be also available or synthetic segmentation mask.
```python
from medigan import Generators
generators = Generators()
# model 10 is "00010_FASTGAN_POLYP_PATCHES_W_MASKS"
generators.visualize(10)
```

## Contribute A Model
Create an [__init__.py](templates/examples/__init__.py) file in your model's root folder.
Next, run the following code to contribute your model to medigan.
- Your model will be stored on [Zenodo](https://zenodo.org/).
- Also, a Github [issue](https://github.com/RichardObi/medigan/issues) will be created to add your model's metadata to medigan's [global.json](https://github.com/RichardObi/medigan/blob/main/config/global.json).
- To do so, please provide a github access token ([get one here](https://github.com/settings/tokens)) and a zenodo access token ([get one here](https://zenodo.org/account/settings/applications/tokens/new/)), as shown below. After creation, the zenodo access token may take a few minutes before being recognized in zenodo API calls.
```python
from medigan import Generators
generators = Generators()
# Contribute your model
generators.contribute(
model_id = "00100_YOUR_MODEL", # assign an ID
init_py_path ="path/ending/with/__init__.py",
model_weights_name = "10000",
model_weights_extension = ".pt",
generate_method_name = "generate", # in __init__.py
dependencies = ["numpy", "torch"],
creator_name = "YOUR_NAME",
creator_affiliation = "YOUR_AFFILIATION",
zenodo_access_token = 'ZENODO_ACCESS_TOKEN',
github_access_token = 'GITHUB_ACCESS_TOKEN',
```
Thank you for your contribution!
You will soon receive a reply in the Github [issue](https://github.com/RichardObi/medigan/issues) that you created for your model by running ```generators.contribute()```.
## Contributions in General
We welcome contributions to medigan. Please send us an email or read the [contributing guidelines](CONTRIBUTING.md) regarding contributing to the medigan project.
## Reference
If you use a medigan model in your work, please cite its respective publication ([see references](#available-models)).
Please also consider citing the medigan paper:
> [Osuala, R., Skorupko, G., Lazrak, N., Garrucho, L., García, E., Joshi, S., ... & Lekadir, K. (2023). medigan: a Python library of pretrained generative models for medical image synthesis. Journal of Medical Imaging, 10(6), 061403.](https://doi.org/10.1117/1.JMI.10.6.061403)
BibTeX entry:
```bibtex
@article{osuala2023medigan,
title={medigan: a Python library of pretrained generative models for medical image synthesis},
author={Osuala, Richard and Skorupko, Grzegorz and Lazrak, Noussair and Garrucho, Lidia and Garc{\'\i}a, Eloy and Joshi, Smriti and Jouide, Socayna and Rutherford, Michael and Prior, Fred and Kushibar, Kaisar and others},
journal={Journal of Medical Imaging},
volume={10},
number={6},
pages={061403},
year={2023},
publisher={SPIE}
}
```
================================================
FILE: config/candidates.json
================================================
{
"00007_DCGAN_CT_spine_inpaint": {
"execution": {
"package_name": "bone-cement-injection-planning2",
"package_link": "https://zenodo.org/record/5898666/files/bone-cement-injection-planning2.zip?download=1",
"model_name": "inpaint_modelCor",
"extension": ".pt",
"image_size": [
128,
128
],
"dependencies": [
"dipy",
"dcmstack",
"simpleitk",
"napari",
"torch",
"torchvision",
"nibabel",
"opencv-python",
"scikit-image",
"scikit-learn",
"nilearn",
"pandas",
"matplotlib"
],
"generate_method": {
"name": "generate",
"args": {
"base": [
"model_file",
"num_samples",
"output_path",
"save_images"
],
"custom": {
"save_intermediate_outputs": "False",
"patient_dir": "00005_DCGAN_CT_spine_inpaint/src/data/dataset-verse19test/rawdata/",
"fracture": 22
}
}
}
},
"selection": {
"performance": {},
"use_cases": [
"segmentation"
],
"organ": [
"spine",
"vertebra"
],
"modality": [
"CT",
"computerised tomography",
"CAT scans",
"computed tomography scans"
],
"vendors": [],
"centres": [],
"function": [
"image generation"
],
"condition": [],
"dataset": [
"https://github.com/anjany/verse"
],
"augmentations": [],
"generates": [
"regions of interest",
"ROI",
"CT",
"measures",
"inpainted image"
],
"height": 128,
"width": 128,
"depth": null,
"type": "inpainting",
"license": "MIT",
"dataset_type": "public",
"privacy_preservation": null,
"tags": [
"Deformable Registration",
"VCFs",
"CT",
"GAN",
"Spine Osteoplasty",
"Inpainting"
],
"year": "2021"
},
"description": {
"title": "Patient-specific virtual spine straightening and vertebra inpainting: An automatic framework for osteoplasty plannings",
"provided_date": null,
"trained_date": null,
"provided_after_epoch": null,
"version": "0.0.1",
"publication": null,
"doi": [
"10.5281/zenodo.5838222"
],
"comment": "BICEPS takes a CT image of a patient with one or more Vertebral Compression Fractures and generates an estimation of the healthy state of the patients spine to enable treatment planning. The uploaded ZIP file contains the model weights,the __init__.py (image generation method and utils), a README.md, and the GAN model architecture (in pytorch) below the /src folder."
}
}
}
================================================
FILE: config/global.json
================================================
{
"00001_DCGAN_MMG_CALC_ROI": {
"execution": {
"package_name": "00001_DCGAN_MMG_CALC_ROI",
"package_link": "https://zenodo.org/record/7031735/files/00001_DCGAN_MMG_CALC_ROI.zip?download=1",
"model_name": "DCGAN",
"extension": ".pt",
"image_size": [
128,
128
],
"dependencies": [
"numpy",
"Path",
"torch",
"opencv-contrib-python-headless"
],
"generate_method": {
"name": "generate",
"args": {
"base": [
"model_file",
"num_samples",
"output_path",
"save_images"
],
"custom": {
"image_size": 128
}
},
"input_latent_vector_size": 100
}
},
"selection": {
"performance": {
"SSIM": null,
"MSE": null,
"NSME": null,
"PSNR": null,
"IS": null,
"turing_test": null,
"FID_no_images": 1000,
"FID": 67.60,
"FID_ratio": 0.497,
"FID_RADIMAGENET": 1.27,
"FID_RADIMAGENET_ratio": 0.197,
"CLF_delta": null,
"SEG_delta": null,
"CLF": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
},
"SEG": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
},
"DET": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
}
},
"use_cases": [
"classification"
],
"organ": [
"breast",
"breasts",
"chest"
],
"modality": [
"MMG",
"Mammography",
"Mammogram",
"full-field digital",
"full-field digital MMG",
"full-field MMG",
"full-field Mammography",
"digital Mammography",
"digital MMG",
"x-ray mammography"
],
"vendors": [],
"centres": [],
"function": [
"noise to image",
"image generation",
"unconditional generation",
"data augmentation"
],
"condition": [],
"dataset": [
"INbreast"
],
"augmentations": [
"crop and resize",
"horizontal flip",
"vertical flip"
],
"generates": [
"calcification",
"calcifications",
"calcification roi",
"calcification ROI",
"calcification images",
"calcification region of interest"
],
"height": 128,
"width": 128,
"depth": null,
"type": "DCGAN",
"license": "MIT",
"dataset_type": "public",
"privacy_preservation": null,
"tags": [
"Mammogram",
"Mammography",
"Digital Mammography",
"Full field Mammography",
"Full-field Mammography",
"128x128",
"128 x 128",
"MammoGANs",
"Microcalcification",
"Microcalcifications"
],
"year": "2021"
},
"description": {
"title": "DCGAN Model for Mammogram Calcification Region of Interest Generation (Trained on INbreast)",
"provided_date": "12th May 2021",
"trained_date": "May 2021",
"provided_after_epoch": 300,
"version": "0.0.1",
"publication": null,
"doi": [
"10.5281/zenodo.5187714"
],
"inputs": [
"image_size: default=128, help=128 is the image size that works with the supplied checkpoint."
],
"comment": "A deep convolutional generative adversarial network (DCGAN) that generates regions of interest (ROI) of mammograms containing benign and/or malignant calcifications. Pixel dimensions are 128x128. The DCGAN was trained on ROIs from the INbreast dataset (Moreira et al, 2012). The uploaded ZIP file contains the files dcgan.pt (model weights), __init__.py (image generation method and utils), a README.md, and the GAN model architecture (in pytorch) below the /src folder. Kernel size=6 used in DCGAN discriminator."
}
},
"00002_DCGAN_MMG_MASS_ROI": {
"execution": {
"package_name": "MALIGN_DCGAN",
"package_link": "https://zenodo.org/record/6647242/files/MALIGN_DCGAN.zip?download=1",
"model_name": "malign_mass_gen",
"extension": "",
"image_size": [
128,
128
],
"dependencies": [
"numpy",
"torch",
"opencv-contrib-python-headless"
],
"generate_method": {
"name": "generate",
"args": {
"base": [
"model_file",
"num_samples",
"output_path",
"save_images"
],
"custom": {}
},
"input_latent_vector_size": 200
}
},
"selection": {
"performance": {
"SSIM": null,
"MSE": null,
"NSME": null,
"PSNR": null,
"IS": null,
"turing_test": {
"number_radiologists": 2,
"AUC": [
0.56,
0.45
],
"accuracy": [
0.48,
0.61
],
"years_experience": [
7,
25
]
},
"FID_no_images": 1000,
"FID": 80.51,
"FID_ratio": 0.358,
"FID_RADIMAGENET": 6.19,
"FID_RADIMAGENET_ratio": 0.036,
"CLF_delta": 0.06,
"SEG_delta": null,
"CLF": {
"trained_on_fake": {},
"trained_on_real_and_fake": {
"f1": 0.96
},
"trained_on_real": {
"f1": 0.90
}
},
"SEG": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
},
"DET": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
}
},
"use_cases": [
"classification"
],
"organ": [
"breast",
"breasts",
"chest"
],
"modality": [
"MMG",
"Mammography",
"Mammogram",
"full-field digital",
"full-field digital MMG",
"full-field MMG",
"full-field Mammography",
"digital Mammography",
"digital MMG",
"x-ray mammography"
],
"vendors": [
"Hologic Inc"
],
"centres": [],
"function": [
"noise to image",
"image generation",
"unconditional generation",
"data augmentation"
],
"condition": [],
"dataset": [
"Optimam"
],
"augmentations": [],
"generates": [
"mass",
"masses",
"breast masses",
"mass rois",
"mass ROIs",
"mass images",
"breast mass ROIs"
],
"height": 128,
"width": 128,
"depth": null,
"type": "DCGAN",
"dataset_type": "public",
"license": "MIT",
"privacy_preservation": null,
"year": "2019",
"tags": [
"Turing Test",
"Visual Turing Test",
"Mammogram",
"Mammography",
"Digital Mammography",
"Full field Mammography",
"Full-field Mammography",
"128 x 128",
"128x128",
"MammoGANs",
"Nodule",
"Nodules",
"Breast mass"
]
},
"description": {
"title": "DCGAN Model for Mammogram Mass Region of Interest Generation (Trained on OPTIMAM)",
"provided_date": null,
"trained_date": null,
"provided_after_epoch": null,
"version": null,
"publication": null,
"doi": [
"10.5281/zenodo.5188557",
"10.1117/12.2543506",
"10.1117/12.2560473"
],
"inputs": [],
"comment": "A deep convolutional generative adversarial network (DCGAN) that generates regions of interest (ROI) of mammograms containing benign and/or malignant masses. Pixel dimensions are 128x128. The DCGAN was trained on ROIs from the Optimam dataset (Halling-Brown et al, 2014). The uploaded ZIP file contains the files malign_mass_gen (model weights), and __init__.py (image generation method and pytorch GAN model architecture). Kernel size=6 used in DCGAN discriminator."
}
},
"00003_CYCLEGAN_MMG_DENSITY_FULL": {
"execution": {
"package_name": "00003_CYCLEGAN_MMG_DENSITY_FULL",
"package_link": "https://zenodo.org/record/7093550/files/00003_CYCLEGAN_MMG_DENSITY_FULL.zip?download=1",
"model_name": "CycleGAN_high_density",
"extension": ".pth",
"image_size": [
1332,
800
],
"dependencies": [
"numpy",
"Path",
"pyyaml",
"opencv-contrib-python-headless",
"torch",
"torchvision",
"dominate",
"visdom",
"Pillow"
],
"generate_method": {
"name": "generate",
"args": {
"base": [
"model_file",
"output_path",
"save_images",
"num_samples"
],
"custom": {
"translate_all_images": false,
"input_path": "models/00003_CYCLEGAN_MMG_DENSITY_FULL/images",
"image_size": [
1332,
800
],
"gpu_id": 0
}
}
}
},
"selection": {
"performance": {
"SSIM": null,
"MSE": null,
"NSME": null,
"PSNR": null,
"IS": null,
"turing_test": null,
"FID_no_images": 74,
"FID": 150.16,
"FID_ratio": 0.439,
"FID_RADIMAGENET": 3.00,
"FID_RADIMAGENET_ratio": 0.265,
"CLF_delta": null,
"SEG_delta": null,
"DET_delta": 0.06,
"CLF": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
},
"SEG": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
},
"DET": {
"trained_on_fake": {},
"trained_on_real_and_fake": {
"AUC": 0.89
},
"trained_on_real": {
"AUC": 0.83
}
}
},
"use_cases": [
"classification",
"detection",
"domain-translation"
],
"organ": [
"breast",
"breasts",
"chest"
],
"modality": [
"MMG",
"Mammography",
"Mammogram",
"full-field digital",
"full-field digital MMG",
"full-field MMG",
"full-field Mammography",
"digital Mammography",
"digital MMG",
"x-ray mammography"
],
"vendors": [],
"centres": [],
"function": [
"image to image",
"image generation",
"data augmentation"
],
"condition": [],
"dataset": [
"BCDR"
],
"augmentations": [
"resize"
],
"generates": [
"full images",
"mammograms",
"full-field digital mammograms"
],
"height": 1332,
"width": 800,
"depth": null,
"type": "CycleGAN",
"license": "BSD",
"dataset_type": "public",
"privacy_preservation": null,
"tags": [
"Mammogram",
"Mammography",
"Digital Mammography",
"Full field Mammography",
"Full-field Mammography",
"CycleGANs",
"CycleGAN",
"Density",
"Breast Density",
"High Density",
"Low Density",
"ACR"
],
"year": "2021"
},
"description": {
"title": "CycleGAN Model for Low-to-High Brest Density Mammograms Translation (Trained on BCDR)",
"provided_date": "12th Sep 2021",
"trained_date": "Sep 2021",
"provided_after_epoch": 100,
"version": "0.0.1",
"publication": null,
"doi": [
"https://doi.org/10.48550/arXiv.2209.09809"
],
"inputs": [
"input_path: default=models/00003_CYCLEGAN_MMG_DENSITY_FULL/images, help=the path to .png mammogram images that are translated from low to high breast density or vice versa",
"image_size: default=[1332, 800], help=list with image height and width. Images are rescaled to these pixel dimensions.",
"gpu_id: default=0, help=the gpu to run the model on.",
"translate_all_images: default=False, help=flag to override num_samples in case the user wishes to translate all images in the specified input_path folder."
],
"comment": "A cycle generative adversarial network (CycleGAN) that generates mammograms with high breast density from an original mammogram e.g. with low-breast density. The CycleGAN was trained using normal (without pathologies) digital mammograms from BCDR dataset (Lopez, M. G., et al. 2012). The uploaded ZIP file contains the files CycleGAN_high_density.pth (model weights), __init__.py (image generation method and utils) and the GAN model architecture (in pytorch) below the /src folder."
}
},
"00004_PIX2PIX_MMG_MASSES_W_MASKS": {
"execution": {
"package_name": "00004_PIX2PIX_MMG_MASSES_W_MASKS",
"package_link": "https://zenodo.org/record/7093760/files/00004_PIX2PIX_MMG_MASSES_W_MASKS.zip?download=1",
"model_name": "pix2pix_mask_to_mass_model",
"extension": ".pth",
"image_size": [
256,
256
],
"dependencies": [
"numpy",
"Path",
"pyyaml",
"opencv-contrib-python-headless",
"torch",
"torchvision",
"dominate",
"visdom",
"Pillow",
"imageio",
"scikit-image"
],
"generate_method": {
"name": "generate_GAN_images",
"args": {
"base": [
"model_file",
"output_path",
"save_images",
"num_samples"
],
"custom": {
"input_path": "models/00004_PIX2PIX_MMG_MASSES_W_MASKS/images",
"image_size": [
256,
256
],
"patch_size": [
32,
32
],
"shapes": [
"oval",
"lobulated"
],
"ssim_threshold": 0.2,
"gpu_id": 0
}
}
}
},
"selection": {
"performance": {
"SSIM": null,
"MSE": null,
"NSME": null,
"PSNR": null,
"IS": null,
"turing_test": null,
"FID_no_images": 199,
"FID": 161.17,
"FID_ratio": 0.423,
"FID_RADIMAGENET": null,
"FID_RADIMAGENET_ratio": null,
"CLF_delta": null,
"SEG_delta": null,
"DET_delta": null,
"CLF": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
},
"SEG": {
"trained_on_fake": {
"Dice": 0.737
},
"trained_on_real_and_fake": {},
"trained_on_real": {
"Dice": 0.865
}
},
"DET": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
}
},
"use_cases": [
"segmentation"
],
"organ": [
"breast",
"breasts",
"chest"
],
"modality": [
"MMG",
"Mammography",
"Mammogram",
"full-field digital",
"full-field digital MMG",
"full-field MMG",
"full-field Mammography",
"digital Mammography",
"digital MMG",
"x-ray mammography"
],
"vendors": [],
"centres": [],
"function": [
"mask to image",
"image generation",
"data augmentation"
],
"condition": [],
"dataset": [
"BCDR"
],
"augmentations": [
"resize"
],
"generates": [
"regions of interest",
"ROI",
"mammograms",
"patches",
"full-field digital mammograms"
],
"height": 256,
"width": 256,
"depth": null,
"type": "pix2pix",
"license": "BSD",
"dataset_type": "public",
"privacy_preservation": null,
"tags": [
"Mammogram",
"Mammography",
"Digital Mammography",
"Full field Mammography",
"Full-field Mammography",
"pix2pix",
"Pix2Pix",
"Mass segmentation",
"Breast lesion"
],
"year": "2021"
},
"description": {
"title": "Generates synthetic patches given a random mask tiled with texture patches extracted from real images (Trained on BCDR)",
"provided_date": "5th Oct 2021",
"trained_date": "Sep 2021",
"provided_after_epoch": 200,
"version": "0.0.1",
"publication": null,
"doi": [
"10.5281/zenodo.5863095"
],
"inputs": [
"input_path: default=models/00004_PIX2PIX_MMG_MASSES_W_MASKS/images help=inputs that are used in the pix2pix input image pool (e.g. for tiled image generation) ",
"image_size: default=[256, 256] help=height and width of images.",
"patch_size: default=[32, 32] help=height and width of patches (annotation size on image).",
"shapes: default=['oval', 'lobulated'] help=the type of the mask curve shapes generated via bezier curves.",
"ssim_threshold: default=0.2, help=the SSIM threshold that images must surpass to be output.",
"gpu_id: default=0 help=the gpu to run the model."
],
"comment": "Generates synthetic patches given a random mask tiled with texture patches extracted from real images. The texture patches should be extracted from within the mass an outside the mass of a real image. Hence, some real ROIs are required to start with and its ideal for data augmentation purposes for mass segmentation."
}
},
"00005_DCGAN_MMG_MASS_ROI": {
"execution": {
"package_name": "00005_DCGAN_MMG_MASS_ROI",
"package_link": "https://zenodo.org/record/7031758/files/00005_DCGAN_MMG_MASS_ROI.zip?download=1",
"model_name": "500",
"extension": ".pt",
"image_size": [
128,
128
],
"dependencies": [
"numpy",
"torch",
"opencv-contrib-python-headless"
],
"generate_method": {
"name": "generate",
"args": {
"base": [
"model_file",
"num_samples",
"output_path",
"save_images"
],
"custom": {}
},
"input_latent_vector_size": 100
}
},
"selection": {
"performance": {
"SSIM": null,
"MSE": null,
"NSME": null,
"PSNR": null,
"IS": null,
"turing_test": null,
"FID_no_images": 199,
"FID": 180.04,
"FID_ratio": 0.379,
"FID_RADIMAGENET": 1.67,
"FID_RADIMAGENET_ratio": 0.593,
"CLF_delta": 0.029,
"SEG_delta": null,
"DET_delta": null,
"CLF": {
"trained_on_fake": {},
"trained_on_real_and_fake": {
"f1": 0.920,
"AUC": 0.959,
"AUPRC": 0.992
},
"trained_on_real": {
"f1": 0.891,
"AUC": 0.928,
"AUPRC": 0.986
}
},
"SEG": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
},
"DET": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
}
},
"use_cases": [
"classification"
],
"organ": [
"breast",
"breasts",
"chest"
],
"modality": [
"MMG",
"Mammography",
"Mammogram",
"full-field digital",
"full-field digital MMG",
"full-field MMG",
"full-field Mammography",
"digital Mammography",
"digital MMG",
"x-ray mammography"
],
"vendors": [],
"centres": [],
"function": [
"noise to image",
"image generation",
"unconditional generation",
"data augmentation"
],
"condition": [],
"dataset": [
"BCDR"
],
"augmentations": [
"horizontal flip",
"vertical flip"
],
"generates": [
"mass",
"masses",
"mass roi",
"mass ROI",
"mass images",
"mass region of interest",
"nodule",
"nodule",
"nodule roi",
"nodule ROI",
"nodule images",
"nodule region of interest"
],
"height": 128,
"width": 128,
"depth": null,
"type": "DCGAN",
"license": "MIT",
"dataset_type": "public",
"privacy_preservation": null,
"tags": [
"Breast",
"Mammogram",
"Mammography",
"Digital Mammography",
"Full field Mammography",
"Full-field Mammography",
"128x128",
"128 x 128",
"MammoGANs",
"Masses",
"Nodules"
],
"year": "2021"
},
"description": {
"title": "DCGAN Model for Mammogram MASS Patch Generation (Trained on BCDR)",
"provided_date": "Dec 2021",
"trained_date": "Nov 2021",
"provided_after_epoch": 500,
"version": "0.0.1",
"publication": "IWBI2022",
"doi": [
"10.48550/arXiv.2203.04961"
],
"inputs": [],
"comment": "A deep convolutional generative adversarial network (DCGAN) that generates mass patches of mammograms. Pixel dimensions are 128x128. The DCGAN was trained on MMG patches from the BCDR dataset (Lopez et al, 2012). The uploaded ZIP file contains the files 500.pt (model weight), __init__.py (image generation method and utils), a requirements.txt, and the GAN model architecture (in pytorch) below the /src folder."
}
},
"00006_WGANGP_MMG_MASS_ROI": {
"execution": {
"package_name": "00006_WGANGP_MMG_MASS_ROI",
"package_link": "https://zenodo.org/record/7031763/files/00006_WGANGP_MMG_MASS_ROI.zip?download=1",
"model_name": "10000",
"extension": ".pt",
"image_size": [
128,
128
],
"dependencies": [
"numpy",
"torch",
"opencv-contrib-python-headless"
],
"generate_method": {
"name": "generate",
"args": {
"base": [
"model_file",
"num_samples",
"output_path",
"save_images"
],
"custom": {}
},
"input_latent_vector_size": 100
}
},
"selection": {
"performance": {
"SSIM": null,
"MSE": null,
"NSME": null,
"PSNR": null,
"IS": null,
"turing_test": null,
"FID_no_images": 199,
"FID": 221.30,
"FID_ratio": 0.308,
"FID_RADIMAGENET": 1.80,
"FID_RADIMAGENET_ratio": 0.550,
"CLF_delta": 0.078,
"SEG_delta": null,
"DET_delta": null,
"CLF": {
"trained_on_fake": {},
"trained_on_real_and_fake": {
"f1": 0.969,
"AUC": 0.978,
"AUPRC": 0.996
},
"trained_on_real": {
"f1": 0.891,
"AUC": 0.928,
"AUPRC": 0.986
}
},
"SEG": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
},
"DET": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
}
},
"use_cases": [
"classification"
],
"organ": [
"breast",
"breasts",
"chest"
],
"modality": [
"MMG",
"Mammography",
"Mammogram",
"full-field digital",
"full-field digital MMG",
"full-field MMG",
"full-field Mammography",
"digital Mammography",
"digital MMG",
"x-ray mammography"
],
"vendors": [],
"centres": [],
"function": [
"noise to image",
"image generation",
"unconditional generation",
"data augmentation"
],
"condition": [],
"dataset": [
"BCDR"
],
"augmentations": [
"horizontal flip",
"vertical flip"
],
"generates": [
"mass",
"masses",
"mass roi",
"mass ROI",
"mass images",
"mass region of interest",
"nodule",
"nodule",
"nodule roi",
"nodule ROI",
"nodule images",
"nodule region of interest"
],
"height": 128,
"width": 128,
"depth": null,
"type": "WGAN-GP",
"license": "MIT",
"dataset_type": "public",
"privacy_preservation": null,
"tags": [
"Breast",
"Mammogram",
"Mammography",
"Digital Mammography",
"Full field Mammography",
"Full-field Mammography",
"128x128",
"128 x 128",
"MammoGANs",
"Masses",
"Nodules"
],
"year": "2022"
},
"description": {
"title": "WGAN-GP Model for Mammogram MASS Patch Generation (Trained on BCDR)",
"provided_date": "Mar 2022",
"trained_date": "Mar 2022",
"provided_after_epoch": 10000,
"version": "1.0.0",
"publication": "IWBI2022",
"doi": [
"10.48550/arXiv.2203.04961"
],
"inputs": [],
"comment": "A wasserstein generative adversarial network with gradient penalty (WGAN-GP) that generates mass patches of mammograms. Pixel dimensions are 128x128. The DCGAN was trained on MMG patches from the BCDR dataset (Lopez et al, 2012). The uploaded ZIP file contains the files 10000.pt (model weight), __init__.py (image generation method and utils), a requirements.txt, and the GAN model architecture (in pytorch) below the /src folder."
}
},
"00007_INPAINT_BRAIN_MRI": {
"execution": {
"package_name": "00007_INPAINT_BRAIN_MRI",
"package_link": "https://zenodo.org/records/10214796/files/00007_INPAINT_BRAIN_MRI.zip?download=1",
"model_name": "inp_gen",
"extension": ".pth",
"image_size": [
256,
256
],
"dependencies": [
"matplotlib",
"albumentations",
"torch",
"torchvision",
"numpy",
"pillow",
"opencv-contrib-python"
],
"generate_method": {
"name": "generate",
"args": {
"base": [
"model_file",
"num_samples",
"output_path",
"save_images"
],
"custom": {
"image_size": 256,
"num_inpaints_per_sample": 2,
"randomize_input_image_order": true,
"F_img_path": null,
"T1_img_path": null,
"T1c_img_path": null,
"T2_img_path": null,
"add_variations_to_mask": true,
"x_center": 130,
"y_center": 130,
"radius_1": 10,
"radius_2": 15,
"radius_3": 30
}
}
}
},
"selection": {
"performance": {
"SSIM": null,
"MSE": null,
"NSME": null,
"PSNR": null,
"IS": null,
"turing_test": null,
"FID_no_images": 1000,
"FID": 140.02,
"FID_ratio": 0.219,
"FID_RADIMAGENET": 5.31,
"FID_RADIMAGENET_ratio": 0.012,
"CLF_delta": null,
"SEG_delta": 0.018,
"DET_delta": null,
"CLF": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
},
"SEG": {
"trained_on_fake": {},
"trained_on_real_and_fake": {
"dice": 0.814
},
"trained_on_real": {
"dice": 0.796
}
},
"DET": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
}
},
"use_cases": [
"segmentation",
"classification",
"detection"
],
"organ": [
"brain",
"cranial",
"head"
],
"modality": [
"MRI",
"Cranial MRI",
"Brain MRI",
"Flair",
"T1",
"T1c",
"T1 contrast-enhanced",
"T2"
],
"vendors": [],
"centres": [],
"function": [
"image inpainting",
"mask to image",
"circle to tumor grade",
"tumor grade to image",
"cross-modal synthesis",
"data augmentation",
"domain-adaptation"
],
"condition": [],
"dataset": [
"BRATS"
],
"augmentations": [],
"generates": [
"brain MRI",
"Flair",
"T1",
"T1c",
"T2",
"binary mask",
"tumor grade mask"
],
"height": 256,
"width": 256,
"depth": 1,
"type": "Inpaint Generator",
"license": null,
"dataset_type": "public",
"privacy_preservation": null,
"tags": [
"Brain",
"Tumor",
"MRI Generation",
"Inpainting",
"Brain MRI Synthesis",
"Concentric Circle",
"Tumor Inpainting",
"Tumor Grade",
"Tumor Grading",
"Cross-Modality",
"Multi-modal synthesis"
],
"year": "2022"
},
"description": {
"title": "Tumor Inpainting Model for Generation of Flair, T1, T1c, T2 Brain MRI Images (Trained on BRATS)",
"provided_date": "August 2022",
"trained_date": "2020",
"provided_after_epoch": null,
"version": null,
"publication": "Medical Physics Journal",
"doi": [
"https://doi.org/10.48550/arXiv.2003.07526",
"https://doi.org/10.1002/mp.14701"
],
"inputs": [
"image_size: default=256, help=the size if height and width of the generated images.",
"num_inpaints_per_sample: default=2, help=the number of tumor inpaint images per MRI modality that is generated from the same input sample",
"randomize_input_image_order: default=True, help=input image order is randomized. This helps to not exclude input images if batch generation is used.",
"F_img_path: default=None, help=The path to the folder were the input Flair MRI images are stored.",
"T1_img_path: default=None, help=The path to the folder were the input T1 MRI images are stored.",
"T1c_img_path: default=None, help=The path to the folder were the input T1c MRI images are stored.",
"T2_img_path: default=None, help=The path to the folder were the input T2 MRI images are stored.",
"add_variations_to_mask: default=True, help=This slightly varies the values of x_center, y_center, radius_1, radius_2, radius_3. If True, the same segmentation masks is still used to generate each of the 4 modality images. This is recommended as it results in higher image diversity.",
"x_center: default=130, help=the x coordinate of the concentric circle upon which the binary mask, the tumor grade mask, and, ultimately, the generated images are based.",
"y_center: default=130, help=the y coordinate of the concentric circle upon which the binary mask, the tumor grade mask, and, ultimately, the generated images are based.",
"radius_1: default=10, help=the radius of the first (inside second) of three concentric circles (necrotic and non-enhancing tumor) upon which the binary mask, the tumor grade mask, and, ultimately, the generated images are based.",
"radius_2: default=15, help=the radius of the second (inside third) of three concentric circles (enhancing tumor) upon which the binary mask, the tumor grade mask, and, ultimately, the generated images are based.",
"radius_3: default=30, help=the radius of the third of three concentric circles (edema) upon which the binary mask, the tumor grade mask, and, ultimately, the generated images are based."
],
"comment": "A Generative adversarial network (GAN) for Inpainting tumors (based on concentric circle-based tumor grade masks) into multi-modal MRI images (Flair, T1, T1c, T2) with dimensions 256x256. Model was trained on BRATS MRI Dataset (Menze et al). For more information, see publication (https://doi.org/10.1002/mp.14701). Model comes with example input image folders. Apart from that, the uploaded ZIP file contains the model checkpoint files .pth (model weight), __init__.py (image generation method and utils), a requirements.txt, the MEDIGAN metadata.json. The proposed method synthesizes brain tumor images from normal brain images and concentric circles that are simplified tumor masks. The tumor masks are defined by complex features, such as grade, appearance, size, and location. Thus, these features of the tumor masks are condensed and simplified to concentric circles. In the proposed method, the user-defined concentric circles are converted to various tumor masks through deep neural networks. The normal brain images are masked by the tumor mask, and the masked region is inpainted with the tumor images synthesized by the deep neural networks. Also see original repository at: https://github.com/KSH0660/BrainTumor"
}
},
"00008_C-DCGAN_MMG_MASSES": {
"execution": {
"package_name": "00008_C-DCGAN_MMG_MASSES",
"package_link": "https://zenodo.org/record/7382545/files/00008_C-DCGAN_MMG_MASSES.zip?download=1",
"model_name": "1400_ckpt_train_cbis_ddsm",
"extension": ".pt",
"image_size": [
128,
128
],
"dependencies": [
"numpy",
"torch",
"opencv-contrib-python-headless"
],
"generate_method": {
"name": "generate",
"args": {
"base": [
"model_file",
"num_samples",
"output_path",
"save_images"
],
"custom": {
"condition": null,
"z": null,
"is_cbisddsm_training_data": true
}
},
"input_latent_vector_size": 100
}
},
"selection": {
"performance": {
"SSIM": null,
"MSE": null,
"NSME": null,
"PSNR": null,
"IS": null,
"turing_test": null,
"FID_no_images": 379,
"FID": 137.75,
"FID_ratio": 0.272,
"FID_RADIMAGENET": 3.05,
"FID_RADIMAGENET_ratio": 0.151,
"CLF_delta": null,
"SEG_delta": null,
"DET_delta": null,
"CLF": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
},
"SEG": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
},
"DET": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
}
},
"use_cases": [
"classification",
"malignant versus benign classification"
],
"organ": [
"breast",
"breasts",
"chest"
],
"modality": [
"MMG",
"Mammography",
"Mammogram",
"full-field digital",
"full-field digital MMG",
"full-field MMG",
"full-field Mammography",
"digital Mammography",
"digital MMG",
"x-ray mammography"
],
"vendors": [],
"centres": [],
"function": [
"noise to image",
"image generation",
"unconditional generation",
"data augmentation"
],
"condition": [],
"dataset": [
"CBIS-DDSM"
],
"augmentations": [
"horizontal flip",
"vertical flip"
],
"generates": [
"mass",
"masses",
"mass roi",
"mass ROI",
"mass images",
"mass region of interest",
"nodule",
"nodule",
"nodule roi",
"nodule ROI",
"nodule images",
"nodule region of interest"
],
"height": 128,
"width": 128,
"depth": null,
"type": "Conditional DCGAN",
"license": "MIT",
"dataset_type": "public",
"privacy_preservation": null,
"tags": [
"Breast",
"Mammogram",
"Mammography",
"Digital Mammography",
"Full field Mammography",
"Full-field Mammography",
"128x128",
"128 x 128",
"MammoGANs",
"Masses",
"Nodules"
],
"year": "2022"
},
"description": {
"title": "Conditional DCGAN Model for Patch Generation of Mammogram Masses Conditioned on Biopsy Proven Malignancy Status (Trained on CBIS-DDSM)",
"provided_date": "November 2022",
"trained_date": "November 2022",
"provided_after_epoch": [
1400,
1750
],
"version": "1.0.1",
"publication": null,
"doi": [],
"inputs": [
"condition: default=None, help=Either 0, 1 or None. Condition indicates whether a generated mass is malignant (0) or benign (1). If None, a balanced set of malignant and benign tumor images is created.",
"z: default=None, help=the input noise torch tensor for the generator. If None, this option is ignored (e.g. random input vector generation)",
"is_cbisddsm_training_data: default=True, help=Boolean indicating whether a GAN checkpoint trained on the predefined test or train dataset (predefined by cbis-ddsm dataset creators) should be used."
],
"comment": "A class-conditional deep convolutional generative adversarial network that generates mass patches of mammograms that are conditioned to either be benign (1) or malignant (0). Pixel dimensions are 128x128. The Cond-DCGAN was trained on MMG patches from the CBIS-DDSM (Sawyer Lee et al, 2016). The uploaded ZIP file contains the files 1750.pt (model weight), __init__.py (image generation method and utils), a requirements.txt, a LICENSE file, the MEDIGAN metadata, the used GAN training config file, a test.sh file to run the model, and two folders with a few generated images."
}
},
"00009_PGGAN_POLYP_PATCHES_W_MASKS": {
"execution": {
"package_name": "ProGAN-4ch",
"package_link": "https://zenodo.org/record/6653744/files/ProGAN-4ch.zip?download=1",
"model_name": "ProGAN_300000_g",
"extension": ".model",
"image_size": [
256,
256,
4
],
"dependencies": [
"torch",
"torchvision",
"numpy",
"pillow",
"glob2",
"opencv-contrib-python",
"scikit-image",
"natsort",
"matplotlib"
],
"generate_method": {
"name": "generate",
"args": {
"base": [
"model_file",
"num_samples",
"output_path",
"save_images"
],
"custom": {
"z_dim": 128,
"save_option": "image_and_mask",
"gpu_id": null,
"channel": 128,
"pixel_norm": false,
"img_channels": 4,
"tanh": false,
"step": 6,
"alpha": 1
}
},
"input_latent_vector_size": 128
}
},
"selection": {
"performance": {
"SSIM": null,
"MSE": null,
"NSME": null,
"PSNR": null,
"IS": null,
"turing_test": null,
"FID_no_images": 1000,
"FID": 225.85,
"FID_ratio": 0.192,
"FID_RADIMAGENET": null,
"FID_RADIMAGENET_ratio": null,
"CLF_delta": null,
"SEG_delta": null,
"DET_delta": null,
"CLF": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
},
"SEG": {
"trained_on_fake": {
"dice_loss": 0.137
},
"trained_on_real_and_fake": {},
"trained_on_real": {
"dice_loss": 0.112
}
},
"DET": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
}
},
"use_cases": [
"classification",
"segmentation"
],
"organ": [
"polyps",
"colon"
],
"modality": [
"endoscopy",
"gastrointestinal endoscopy"
],
"vendors": [],
"centres": [],
"function": [
"noise to image and mask",
"noise to image",
"noise to mask",
"image generation",
"unconditional generation",
"data augmentation"
],
"condition": [],
"dataset": [
"HyperKvasir"
],
"augmentations": [
"resize",
"Albumentations library augmentations"
],
"generates": [
"masks",
"segmentation masks",
"polyp masks",
"endoscopy masks",
"endoscopy roi",
"endoscopy ROI",
"endoscopy images",
"endoscopy region of interest",
"polyp",
"polyps",
"polyp roi",
"polyp ROI",
"polyp images",
"polyp region of interest"
],
"height": 256,
"width": 256,
"depth": 4,
"type": "Progressively-growing GAN (PGGAN)",
"license": "MIT",
"dataset_type": "public",
"privacy_preservation": null,
"tags": [
"Endoscopy",
"Colonoscopy",
"Polyps",
"Polyp",
"Polyp Segmentation",
"Segmentation",
"256x256",
"256 x 256"
],
"year": "2022"
},
"description": {
"title": "PGGAN Model for Patch Generation of Polyps with Corresponding Segmentation Masks (Trained on HyperKvasir)",
"provided_date": "June 2022",
"trained_date": "June 2022",
"provided_after_epoch": 1750,
"version": "1.0.0",
"publication": null,
"doi": [
"https://doi.org/10.1371/journal.pone.0267976"
],
"inputs": [
"gpu_id: type=int, default=None, help=0 is the first gpu, 1 is the second gpu, etc.",
"channel: type=int, default=128, help=determines how big the model is, smaller value means faster training, but less capacity of the model",
"z_dim: type=int, default=128, help=the initial latent vectors dimension, can be smaller such as 64, if the dataset is not diverse",
"pixel_norm: default=False, action=store_true, help=a normalization method inside the model, you can try use it or not depends on the dataset",
"img_channels: default=4, help=Number of channels in input data., for rgb images=3, gray=1 etc.",
"tanh: default=False, action=store_true, help=an output non-linearity on the output of Generator, you can try use it or not depends on the dataset",
"step: default=6, help=step to generate fake data. # can be 1 = 8, 2 = 16, 3 = 32, 4 = 64, 5 = 128, 6 = 256",
"alpha: default=1, help=Progressive gan parameter to set, 0 or 1",
"save_option: default=image_only, help=Options to save output, image_only, mask_only, image_and_mask, choices=[image_only,mask_only, image_and_mask]",
"num_fakes: default=1000, help=Number of fakes to generate, type=int"
],
"comment": "A Progressively-growing generative adversarial network that generates a 4 dimensional output containing an RGB image (channels 1-3) and a segmentation mask (channel 4). The RGB images are images of polyps and the segmentation mask indicates the location and shape of the polyp on the image. Pixel dimensions are 256x256. The model was trained on gastrointestinal endoscopy imaging data from the HyperKvasir dataset by Borgli et al (2020, 'https://doi.org/10.1038/s41597-020-00622-y'). The uploaded ZIP file contains the files ProGAN_300000_g.model (model weight), __init__.py (image generation method and utils), a requirements.txt, a LICENSE file, the MEDIGAN metadata, the source code from the official repository ('https://github.com/vlbthambawita/singan-seg-polyp'), and a test.sh file to run the model, and a folder 'examples/' with a few generated images."
}
},
"00010_FASTGAN_POLYP_PATCHES_W_MASKS": {
"execution": {
"package_name": "00010_FASTGAN_POLYP_PATCHES_W_MASKS",
"package_link": "https://zenodo.org/record/7051328/files/00010_FASTGAN_POLYP_PATCHES_W_MASKS.zip?download=1",
"model_name": "FastGAN_all_50000",
"extension": ".pth",
"image_size": [
256,
256,
4
],
"dependencies": [
"torch",
"scipy",
"torchvision",
"opencv-contrib-python",
"pandas",
"easing-functions",
"scikit-image",
"matplotlib",
"ipdb",
"lmdb",
"numpy"
],
"generate_method": {
"name": "generate",
"args": {
"base": [
"model_file",
"num_samples",
"output_path",
"save_images"
],
"custom": {
"save_option": "image_and_mask",
"gpu_id": null
}
},
"input_latent_vector_size": 256
}
},
"selection": {
"performance": {
"SSIM": null,
"MSE": null,
"NSME": null,
"PSNR": null,
"IS": null,
"turing_test": null,
"FID_no_images": 1000,
"FID": 63.99,
"FID_ratio": 0.677,
"FID_RADIMAGENET": 7.32,
"FID_RADIMAGENET_ratio": 0.015,
"CLF_delta": null,
"SEG_delta": null,
"DET_delta": null,
"CLF": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
},
"SEG": {
"trained_on_fake": {
"IoU": 0.798
},
"trained_on_real_and_fake": {},
"trained_on_real": {
"IoU": 0.827
}
},
"DET": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
}
},
"use_cases": [
"classification",
"segmentation"
],
"organ": [
"polyps",
"colon"
],
"modality": [
"endoscopy",
"gastrointestinal endoscopy"
],
"vendors": [],
"centres": [],
"function": [
"noise to image and mask",
"noise to image",
"noise to mask",
"image generation",
"unconditional generation",
"data augmentation"
],
"condition": [],
"dataset": [
"HyperKvasir"
],
"augmentations": [
"resize",
"Albumentations library augmentations"
],
"generates": [
"masks",
"segmentation masks",
"polyp masks",
"endoscopy masks",
"endoscopy roi",
"endoscopy ROI",
"endoscopy images",
"endoscopy region of interest",
"polyp",
"polyps",
"polyp roi",
"polyp ROI",
"polyp images",
"polyp region of interest"
],
"height": 256,
"width": 256,
"depth": 4,
"type": "FastGAN",
"license": "GNU GENERAL PUBLIC LICENSE",
"dataset_type": "public",
"privacy_preservation": null,
"tags": [
"Endoscopy",
"Colonoscopy",
"Polyps",
"Polyp",
"Polyp Segmentation",
"Segmentation",
"256x256",
"256 x 256"
],
"year": "2022"
},
"description": {
"title": "FastGAN Model for Patch Generation of Polyps with Corresponding Segmentation Masks (Trained on HyperKvasir)",
"provided_date": "June 2022",
"trained_date": "June 2022",
"provided_after_epoch": null,
"version": null,
"publication": null,
"doi": [
"https://doi.org/10.1371/journal.pone.0267976"
],
"inputs": [
"gpu_id: type=int, default=None, help=0 is the first gpu, 1 is the second gpu, etc.",
"save_option: default=image_only, help=Options to save output, image_only, mask_only, image_and_mask, choices=[image_only,mask_only, image_and_mask]"
],
"comment": "A Fast generative adversarial network (FastGAN) that generates a 4 dimensional output containing an RGB image (channels 1-3) and a segmentation mask (channel 4). FASTGAN is from the paper 'Towards Faster and Stabilized GAN Training for High-fidelity Few-shot Image Synthesis' in ICLR 2021. The RGB images are images of polyps and the segmentation mask indicates the location and shape of the polyp on the image. Pixel dimensions are 256x256. The model was trained on gastrointestinal endoscopy imaging data from the HyperKvasir dataset by Borgli et al (2020, 'https://doi.org/10.1038/s41597-020-00622-y'). The uploaded ZIP file contains the files FastGAN_all_50000.pth (model weight), __init__.py (image generation method and utils), a requirements.txt, a LICENSE file, the MEDIGAN metadata, the source code from the repository ('https://github.com/vlbthambawita/singan-seg-polyp'), and a test.sh file to run the model, and a folder 'examples/' with a few generated images."
}
},
"00011_SINGAN_POLYP_PATCHES_W_MASKS": {
"execution": {
"package_name": "00011_SINGAN_POLYP_PATCHES_W_MASKS",
"package_link": "https://zenodo.org/record/7117187/files/00011_SINGAN_POLYP_PATCHES_W_MASKS.zip?download=1",
"model_name": "singan_seg_polyp/SinGAN-Generated/TrainedModels_1_clean/1/Gs",
"extension": ".pth",
"image_size": [
250,
250,
3
],
"dependencies": [
"numpy",
"tqdm",
"torch",
"torchvision",
"pandas",
"PyYAML",
"scipy",
"scikit-image",
"scikit-learn",
"requests",
"natsort",
"matplotlib"
],
"generate_method": {
"name": "generate",
"args": {
"base": [
"model_file",
"num_samples",
"output_path",
"save_images"
],
"custom": {
"model_files": "models/00011_SINGAN_POLYP_PATCHES_W_MASKS/singan_seg_polyp/SinGAN-Generated",
"gen_start_scale": 0,
"checkpoint_ids": null,
"multiple_checkpoints": false
}
}
}
},
"selection": {
"performance": {
"SSIM": null,
"MSE": null,
"NSME": null,
"PSNR": null,
"IS": null,
"turing_test": null,
"FID_no_images": 1000,
"FID": 171.15,
"FID_ratio": 0.253,
"FID_RADIMAGENET": null,
"FID_RADIMAGENET_ratio": null,
"CLF_delta": null,
"SEG_delta": null,
"DET_delta": null,
"CLF": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
},
"SEG": {
"trained_on_fake": {
"f1": 0.863
},
"trained_on_real_and_fake": {},
"trained_on_real": {
"f1": 0.888
}
},
"DET": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
}
},
"use_cases": [
"classification",
"segmentation"
],
"organ": [
"polyps",
"colon"
],
"modality": [
"endoscopy",
"gastrointestinal endoscopy"
],
"vendors": [],
"centres": [],
"function": [
"noise to image and mask",
"noise to image",
"noise to mask",
"image generation",
"unconditional generation",
"data augmentation"
],
"condition": [],
"dataset": [
"HyperKvasir"
],
"augmentations": [
"resize",
"Albumentations library augmentations"
],
"generates": [
"masks",
"segmentation masks",
"polyp masks",
"endoscopy masks",
"endoscopy roi",
"endoscopy ROI",
"endoscopy images",
"endoscopy region of interest",
"polyp",
"polyps",
"polyp roi",
"polyp ROI",
"polyp images",
"polyp region of interest"
],
"height": 250,
"width": 250,
"depth": 3,
"type": "SinGAN",
"license": "MIT",
"dataset_type": "public",
"privacy_preservation": null,
"tags": [
"Endoscopy",
"Colonoscopy",
"Polyps",
"Polyp",
"Polyp Segmentation",
"Segmentation"
],
"year": "2022"
},
"description": {
"title": "SinGAN Model for Patch Generation of Polyps with Corresponding Segmentation Masks (Trained on HyperKvasir)",
"provided_date": "June 2022",
"trained_date": "June 2022",
"provided_after_epoch": null,
"version": null,
"publication": null,
"doi": [
"https://doi.org/10.1371/journal.pone.0267976"
],
"inputs": [
"model_files: default=models/00011_SINGAN_POLYP_PATCHES_W_MASKS/singan_seg_polyp/SinGAN-Generated help=the folder where the checkpoints are stored | ",
"gen_start_scale: default=0 help=The start for scaling (progressively increasing generator input size) in SinGAN.",
"checkpoint_ids: default=None help=A list of checkpoint ids that will be used for polyp generation. If None, all available checkpoints (i.e. 1000) or one random one (depending on 'multiple_checkpoints' arg) will be used.",
"multiple_checkpoints: default=False help=A boolean indicating if all checkpoint_ids or one random one is used for generating images, but only in case 'checkpoint_ids'==None"
],
"comment": "A SinGAN generative adversarial network that generates a 2dimensional output image tuple containing a 3-channel RGB image and a 3-channel segmentation mask. SinGAN is from the paper 'SinGAN: Learning a Generative Model from a Single Natural Image' in ICCV 2019. The width of the outputted images varies depending on the corresponding original image. The RGB images are images of polyps and the segmentation mask indicates the location and shape of the polyp on the image. Pixel dimensions are 213x256. The model was trained on gastrointestinal endoscopy imaging data from the HyperKvasir dataset by Borgli et al (2020, 'https://doi.org/10.1038/s41597-020-00622-y'). The uploaded ZIP file contains the checkpoints in folder 'SinGAN-Generated' (model weights), __init__.py (image generation method and utils), a requirements.txt, a LICENSE file, the MEDIGAN metadata, the source code from the repository ('https://github.com/vlbthambawita/singan-seg-polyp'), and a test.sh file to run the model, and a folder 'examples/' with a few generated images."
}
},
"00012_C-DCGAN_MMG_MASSES": {
"execution": {
"package_name": "00012_C-DCGAN_MMG_MASSES",
"package_link": "https://zenodo.org/record/7031755/files/00012_C-DCGAN_MMG_MASSES.zip?download=1",
"model_name": "1250",
"extension": ".pt",
"image_size": [
128,
128
],
"dependencies": [
"numpy",
"torch",
"opencv-contrib-python-headless"
],
"generate_method": {
"name": "generate",
"args": {
"base": [
"model_file",
"num_samples",
"output_path",
"save_images"
],
"custom": {
"condition": null,
"z": null
}
},
"input_latent_vector_size": 100
}
},
"selection": {
"performance": {
"SSIM": null,
"MSE": null,
"NSME": null,
"PSNR": null,
"IS": null,
"turing_test": null,
"FID_no_images": 199,
"FID": 205.29,
"FID_ratio": 0.332,
"FID_RADIMAGENET": 5.69,
"FID_RADIMAGENET_ratio": 0.080,
"CLF_delta": null,
"SEG_delta": null,
"DET_delta": null,
"CLF": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
},
"SEG": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
},
"DET": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
}
},
"use_cases": [
"classification",
"malignant versus benign classification"
],
"organ": [
"breast",
"breasts",
"chest"
],
"modality": [
"MMG",
"Mammography",
"Mammogram",
"full-field digital",
"full-field digital MMG",
"full-field MMG",
"full-field Mammography",
"digital Mammography",
"digital MMG",
"x-ray mammography"
],
"vendors": [],
"centres": [],
"function": [
"noise to image",
"image generation",
"unconditional generation",
"data augmentation"
],
"condition": [],
"dataset": [
"CBIS-DDSM"
],
"augmentations": [
"horizontal flip",
"vertical flip"
],
"generates": [
"mass",
"masses",
"mass roi",
"mass ROI",
"mass images",
"mass region of interest",
"nodule",
"nodule",
"nodule roi",
"nodule ROI",
"nodule images",
"nodule region of interest"
],
"height": 128,
"width": 128,
"depth": null,
"type": "Conditional DCGAN",
"license": "MIT",
"dataset_type": "public",
"privacy_preservation": null,
"tags": [
"Breast",
"Mammogram",
"Mammography",
"Digital Mammography",
"Full field Mammography",
"Full-field Mammography",
"128x128",
"128 x 128",
"MammoGANs",
"Masses",
"Nodules"
],
"year": "2022"
},
"description": {
"title": "Conditional DCGAN Model for Patch Generation of Mammogram Masses Conditioned on Biopsy Proven Malignancy Status (Trained on BCDR)",
"provided_date": "June 2022",
"trained_date": "June 2022",
"provided_after_epoch": 1250,
"version": "1.0.0",
"publication": null,
"doi": [],
"inputs": [
"condition: default=None, help=Either 0, 1 or None. Condition indicates whether a generated mass is malignant (0) or benign (1). If None, a balanced set of malignant and benign tumor images is created.",
"z: default=None, help=the input noise torch tensor for the generator. If None, this option is ignored (e.g. random input vector generation)"
],
"comment": "A class-conditional deep convolutional generative adversarial network that generates mass patches of mammograms that are conditioned to either be benign (1) or malignant (0). Pixel dimensions are 128x128. The Cond-DCGAN was trained on MMG patches from the BCDR dataset (Lopez et al, 2012). The uploaded ZIP file contains the files 1250.pt (model weight), __init__.py (image generation method and utils), a requirements.txt, a LICENSE file, the MEDIGAN metadata, the used GAN training config file, a test.sh file to run the model, and two folders with a few generated images."
}
},
"00013_CYCLEGAN_MMG_DENSITY_OPTIMAM_MLO": {
"execution": {
"package_name": "00013_CYCLEGAN_MMG_DENSITY_OPTIMAM_MLO",
"package_link": "https://zenodo.org/record/7093556/files/00013_CYCLEGAN_MMG_DENSITY_OPTIMAM_MLO.zip?download=1",
"model_name": "latest_net_G_A",
"extension": ".pth",
"image_size": [
1332,
800
],
"dependencies": [
"numpy",
"Path",
"pyyaml",
"opencv-contrib-python-headless",
"torch",
"torchvision",
"dominate",
"visdom",
"Pillow"
],
"generate_method": {
"name": "generate",
"args": {
"base": [
"model_file",
"output_path",
"save_images",
"num_samples"
],
"custom": {
"translate_all_images": false,
"input_path": "models/00013_CYCLEGAN_MMG_DENSITY_OPTIMAM_MLO/images",
"image_size": [
1332,
800
],
"gpu_id": 0,
"low_to_high": true
}
}
}
},
"selection": {
"performance": {
"SSIM": null,
"MSE": null,
"NSME": null,
"PSNR": null,
"IS": null,
"turing_test": null,
"FID_no_images": 358,
"FID": 101.01,
"FID_ratio": 0.650,
"FID_RADIMAGENET": 1.14,
"FID_RADIMAGENET_ratio": 0.153,
"CLF_delta": null,
"SEG_delta": null,
"DET_delta": null,
"CLF": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
},
"SEG": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
},
"DET": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
}
},
"use_cases": [
"classification",
"detection",
"domain-translation"
],
"organ": [
"breast",
"breasts",
"chest"
],
"modality": [
"MMG",
"Mammography",
"Mammogram",
"full-field digital",
"full-field digital MMG",
"full-field MMG",
"full-field Mammography",
"digital Mammography",
"digital MMG",
"x-ray mammography"
],
"vendors": [],
"centres": [],
"function": [
"image to image",
"image generation",
"data augmentation"
],
"condition": [],
"dataset": [
"OPTIMAM"
],
"augmentations": [
"resize"
],
"generates": [
"full images",
"mammograms",
"full-field digital mammograms"
],
"height": 1332,
"width": 800,
"depth": null,
"type": "CycleGAN",
"license": "BSD",
"dataset_type": "public",
"privacy_preservation": null,
"tags": [
"Mammogram",
"Mammography",
"Digital Mammography",
"Full field Mammography",
"Full-field Mammography",
"CycleGANs",
"CycleGAN",
"Density",
"Breast Density",
"High Density",
"Low Density",
"ACR"
],
"year": "2021"
},
"description": {
"title": "CycleGAN Model for Low-to-High Brest Density Mammograms Translation of MLO VIEW (Trained on OPTIMAM)",
"provided_date": "2022",
"trained_date": "2022",
"provided_after_epoch": null,
"version": "0.0.1",
"publication": null,
"doi": [
"https://doi.org/10.48550/arXiv.2209.09809"
],
"inputs": [
"input_path: default=models/00013_CYCLEGAN_MMG_DENSITY_OPTIMAM_MLO/images, help=the path to .png mammogram images that are translated from low to high breast density or vice versa",
"image_size: default=[1332, 800], help=list with image height and width. Images are rescaled to these pixel dimensions.",
"gpu_id: default=0, help=the gpu to run the model on.",
"translate_all_images: default=False, help=flag to override num_samples in case the user wishes to translate all images in the specified input_path folder.",
"low_to_high: default=True, help=if true, breast density is added. If false, it is removed from the input image. A different generator of the cycleGAN is used based on this flag."
],
"comment": "A cycle generative adversarial network (CycleGAN) that generates mammograms with high breast density from an original mammogram e.g. with low-breast density. The CycleGAN was trained using normal (without pathologies) digital mammograms from OPTIMAM dataset (Halling-Brown et al, 2014). The uploaded ZIP file contains the files CycleGAN_high_density.pth (model weights), __init__.py (image generation method and utils) and the GAN model architecture (in pytorch) below the /src folder."
}
},
"00014_CYCLEGAN_MMG_DENSITY_OPTIMAM_CC": {
"execution": {
"package_name": "00014_CYCLEGAN_MMG_DENSITY_OPTIMAM_CC",
"package_link": "https://zenodo.org/record/7093553/files/00014_CYCLEGAN_MMG_DENSITY_OPTIMAM_CC.zip?download=1",
"model_name": "latest_net_G_A",
"extension": ".pth",
"image_size": [
1332,
800
],
"dependencies": [
"numpy",
"Path",
"pyyaml",
"opencv-contrib-python-headless",
"torch",
"torchvision",
"dominate",
"visdom",
"Pillow"
],
"generate_method": {
"name": "generate",
"args": {
"base": [
"model_file",
"output_path",
"save_images",
"num_samples"
],
"custom": {
"translate_all_images": false,
"input_path": "models/00014_CYCLEGAN_MMG_DENSITY_OPTIMAM_CC/images",
"image_size": [
1332,
800
],
"gpu_id": 0,
"low_to_high": true
}
}
}
},
"selection": {
"performance": {
"SSIM": null,
"MSE": null,
"NSME": null,
"PSNR": null,
"IS": null,
"turing_test": null,
"FID_no_images": 350,
"FID": 73.77,
"FID_ratio": 0.564,
"FID_RADIMAGENET": 0.83,
"FID_RADIMAGENET_ratio": 0.190,
"CLF_delta": null,
"SEG_delta": null,
"DET_delta": 0.02,
"CLF": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
},
"SEG": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
},
"DET": {
"trained_on_fake": {},
"trained_on_real_and_fake": {
"AUC": 0.85
},
"trained_on_real": {
"AUC": 0.83
}
}
},
"use_cases": [
"classification",
"detection",
"domain-translation"
],
"organ": [
"breast",
"breasts",
"chest"
],
"modality": [
"MMG",
"Mammography",
"Mammogram",
"full-field digital",
"full-field digital MMG",
"full-field MMG",
"full-field Mammography",
"digital Mammography",
"digital MMG",
"x-ray mammography"
],
"vendors": [],
"centres": [],
"function": [
"image to image",
"image generation",
"data augmentation"
],
"condition": [],
"dataset": [
"OPTIMAM"
],
"augmentations": [
"resize"
],
"generates": [
"full images",
"mammograms",
"full-field digital mammograms"
],
"height": 1332,
"width": 800,
"depth": null,
"type": "CycleGAN",
"license": "BSD",
"dataset_type": "public",
"privacy_preservation": null,
"tags": [
"Mammogram",
"Mammography",
"Digital Mammography",
"Full field Mammography",
"Full-field Mammography",
"CycleGANs",
"CycleGAN",
"Density",
"Breast Density",
"High Density",
"Low Density",
"ACR"
],
"year": "2021"
},
"description": {
"title": "CycleGAN Model for Low-to-High Brest Density Mammograms Translation of CC VIEW (Trained on OPTIMAM)",
"provided_date": "2022",
"trained_date": "2022",
"provided_after_epoch": null,
"version": "0.0.1",
"publication": null,
"doi": [
"https://doi.org/10.48550/arXiv.2209.09809"
],
"inputs": [
"input_path: default=models/00014_CYCLEGAN_MMG_DENSITY_OPTIMAM_CC/images, help=the path to .png mammogram images that are translated from low to high breast density or vice versa",
"image_size: default=[1332, 800], help=list with image height and width. Images are rescaled to these pixel dimensions.",
"gpu_id: default=0, help=the gpu to run the model on.",
"translate_all_images: default=False, help=flag to override num_samples in case the user wishes to translate all images in the specified input_path folder.",
"low_to_high: default=True, help=if true, breast density is added. If false, it is removed from the input image. A different generator of the cycleGAN is used based on this flag."
],
"comment": "A cycle generative adversarial network (CycleGAN) that generates mammograms with high breast density from an original mammogram e.g. with low-breast density. The CycleGAN was trained using normal (without pathologies) digital mammograms from OPTIMAM dataset (Halling-Brown et al, 2014). The uploaded ZIP file contains the files CycleGAN_high_density.pth (model weights), __init__.py (image generation method and utils) and the GAN model architecture (in pytorch) below the /src folder."
}
},
"00015_CYCLEGAN_MMG_DENSITY_CSAW_MLO": {
"execution": {
"package_name": "00015_CYCLEGAN_MMG_DENSITY_CSAW_MLO",
"package_link": "https://zenodo.org/record/7093566/files/00015_CYCLEGAN_MMG_DENSITY_CSAW_MLO.zip?download=1",
"model_name": "latest_net_G_A",
"extension": ".pth",
"image_size": [
1332,
800
],
"dependencies": [
"numpy",
"Path",
"pyyaml",
"opencv-contrib-python-headless",
"torch",
"torchvision",
"dominate",
"visdom",
"Pillow"
],
"generate_method": {
"name": "generate",
"args": {
"base": [
"model_file",
"output_path",
"save_images",
"num_samples"
],
"custom": {
"translate_all_images": false,
"input_path": "models/00015_CYCLEGAN_MMG_DENSITY_CSAW_MLO/images",
"image_size": [
1332,
800
],
"gpu_id": 0,
"low_to_high": true
}
}
}
},
"selection": {
"performance": {
"SSIM": null,
"MSE": null,
"NSME": null,
"PSNR": null,
"IS": null,
"turing_test": null,
"FID_no_images": 192,
"FID": 162.67,
"FID_ratio": 0.461,
"FID_RADIMAGENET": 4.07,
"FID_RADIMAGENET_ratio": 0.076,
"CLF_delta": null,
"SEG_delta": null,
"DET_delta": 0.02,
"CLF": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
},
"SEG": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
},
"DET": {
"trained_on_fake": {},
"trained_on_real_and_fake": {
"AUC": 0.85
},
"trained_on_real": {
"AUC": 0.83
}
}
},
"use_cases": [
"classification",
"detection",
"domain-translation"
],
"organ": [
"breast",
"breasts",
"chest"
],
"modality": [
"MMG",
"Mammography",
"Mammogram",
"full-field digital",
"full-field digital MMG",
"full-field MMG",
"full-field Mammography",
"digital Mammography",
"digital MMG",
"x-ray mammography"
],
"vendors": [],
"centres": [],
"function": [
"image to image",
"image generation",
"data augmentation"
],
"condition": [],
"dataset": [
"CSAW"
],
"augmentations": [
"resize"
],
"generates": [
"full images",
"mammograms",
"full-field digital mammograms"
],
"height": 1332,
"width": 800,
"depth": null,
"type": "CycleGAN",
"license": "BSD",
"dataset_type": "public",
"privacy_preservation": null,
"tags": [
"Mammogram",
"Mammography",
"Digital Mammography",
"Full field Mammography",
"Full-field Mammography",
"CycleGANs",
"CycleGAN",
"Density",
"Breast Density",
"High Density",
"Low Density",
"ACR"
],
"year": "2021"
},
"description": {
"title": "CycleGAN Model for Low-to-High Brest Density Mammograms Translation of MLO VIEW (Trained on CSAW)",
"provided_date": "2022",
"trained_date": "2022",
"provided_after_epoch": null,
"version": "0.0.1",
"publication": null,
"doi": [
"https://doi.org/10.48550/arXiv.2209.09809"
],
"inputs": [
"input_path: default=models/00015_CYCLEGAN_MMG_DENSITY_CSAW_MLO/images, help=the path to .png mammogram images that are translated from low to high breast density or vice versa",
"image_size: default=[1332, 800], help=list with image height and width. Images are rescaled to these pixel dimensions.",
"gpu_id: default=0, help=the gpu to run the model on.",
"translate_all_images: default=False, help=flag to override num_samples in case the user wishes to translate all images in the specified input_path folder.",
"low_to_high: default=True, help=if true, breast density is added. If false, it is removed from the input image. A different generator of the cycleGAN is used based on this flag."
],
"comment": "A cycle generative adversarial network (CycleGAN) that generates mammograms with high breast density from an original mammogram e.g. with low-breast density. The CycleGAN was trained using normal (without pathologies) digital mammograms from CSAW dataset (Dembrower et al., 2020, https://doi.org/10.1007/s10278-019-00278-0). The uploaded ZIP file contains the files CycleGAN_high_density.pth (model weights), __init__.py (image generation method and utils) and the GAN model architecture (in pytorch) below the /src folder."
}
},
"00016_CYCLEGAN_MMG_DENSITY_CSAW_CC": {
"execution": {
"package_name": "00016_CYCLEGAN_MMG_DENSITY_CSAW_CC",
"package_link": "https://zenodo.org/record/7093559/files/00016_CYCLEGAN_MMG_DENSITY_CSAW_CC.zip?download=1",
"model_name": "latest_net_G_A",
"extension": ".pth",
"image_size": [
1332,
800
],
"dependencies": [
"numpy",
"Path",
"pyyaml",
"opencv-contrib-python-headless",
"torch",
"torchvision",
"dominate",
"visdom",
"Pillow"
],
"generate_method": {
"name": "generate",
"args": {
"base": [
"model_file",
"output_path",
"save_images",
"num_samples"
],
"custom": {
"translate_all_images": false,
"input_path": "models/00016_CYCLEGAN_MMG_DENSITY_CSAW_CC/images",
"image_size": [
1332,
800
],
"gpu_id": 0,
"low_to_high": true
}
}
}
},
"selection": {
"performance": {
"SSIM": null,
"MSE": null,
"NSME": null,
"PSNR": null,
"IS": null,
"turing_test": null,
"FID_no_images": 202,
"FID": 98.38,
"FID_ratio": 0.434,
"FID_RADIMAGENET": 2.71,
"FID_RADIMAGENET_ratio": 0.142,
"CLF_delta": null,
"SEG_delta": null,
"DET_delta": null,
"CLF": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
},
"SEG": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
},
"DET": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
}
},
"use_cases": [
"classification",
"detection",
"domain-translation"
],
"organ": [
"breast",
"breasts",
"chest"
],
"modality": [
"MMG",
"Mammography",
"Mammogram",
"full-field digital",
"full-field digital MMG",
"full-field MMG",
"full-field Mammography",
"digital Mammography",
"digital MMG",
"x-ray mammography"
],
"vendors": [],
"centres": [],
"function": [
"image to image",
"image generation",
"data augmentation"
],
"condition": [],
"dataset": [
"CSAW"
],
"augmentations": [
"resize"
],
"generates": [
"full images",
"mammograms",
"full-field digital mammograms"
],
"height": 1332,
"width": 800,
"depth": null,
"type": "CycleGAN",
"license": "BSD",
"dataset_type": "public",
"privacy_preservation": null,
"tags": [
"Mammogram",
"Mammography",
"Digital Mammography",
"Full field Mammography",
"Full-field Mammography",
"CycleGANs",
"CycleGAN",
"Density",
"Breast Density",
"High Density",
"Low Density",
"ACR"
],
"year": "2021"
},
"description": {
"title": "CycleGAN Model for Low-to-High Brest Density Mammograms Translation of CC VIEW (Trained on CSAW)",
"provided_date": "2022",
"trained_date": "2022",
"provided_after_epoch": null,
"version": "0.0.1",
"publication": null,
"doi": [
"https://doi.org/10.48550/arXiv.2209.09809"
],
"inputs": [
"input_path: default=models/00016_CYCLEGAN_MMG_DENSITY_CSAW_CC/images, help=the path to .png mammogram images that are translated from low to high breast density or vice versa",
"image_size: default=[1332, 800], help=list with image height and width. Images are rescaled to these pixel dimensions.",
"gpu_id: default=0, help=the gpu to run the model on.",
"translate_all_images: default=False, help=flag to override num_samples in case the user wishes to translate all images in the specified input_path folder.",
"low_to_high: default=True, help=if true, breast density is added. If false, it is removed from the input image. A different generator of the cycleGAN is used based on this flag."
],
"comment": "A cycle generative adversarial network (CycleGAN) that generates mammograms with high breast density from an original mammogram e.g. with low-breast density. The CycleGAN was trained using normal (without pathologies) digital mammograms from CSAW dataset (Dembrower et al., 2020, https://doi.org/10.1007/s10278-019-00278-0). The uploaded ZIP file contains the files CycleGAN_high_density.pth (model weights), __init__.py (image generation method and utils) and the GAN model architecture (in pytorch) below the /src folder."
}
},
"00017_DCGAN_XRAY_LUNG_NODULES": {
"execution": {
"package_name": "00017_DCGAN_NODE21",
"package_link": "https://zenodo.org/record/6943692/files/00017_DCGAN_NODE21.zip?download=1",
"model_name": "model",
"extension": ".pt",
"image_size": [
128,
128,
1
],
"dependencies": [
"numpy",
"tqdm",
"torch"
],
"generate_method": {
"name": "generate",
"args": {
"base": [
"model_file",
"num_samples",
"output_path",
"save_images"
],
"custom": {}
},
"input_latent_vector_size": 120
}
},
"selection": {
"performance": {
"SSIM": null,
"MSE": null,
"NSME": null,
"PSNR": null,
"IS": null,
"turing_test": null,
"FID_no_images": 1476,
"FID": 126.78,
"FID_ratio": 0.192,
"FID_RADIMAGENET": null,
"FID_RADIMAGENET_ratio": null,
"CLF_delta": null,
"SEG_delta": null,
"DET_delta": null,
"CLF": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
},
"SEG": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
},
"DET": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
}
},
"use_cases": [
"classification"
],
"organ": [
"lung",
"chest",
"thorax"
],
"modality": [
"x-ray",
"xray",
"CXR"
],
"vendors": [],
"centres": [],
"function": [
"noise to image",
"unconditional generation",
"data augmentation"
],
"condition": [],
"dataset": [
"Node21"
],
"augmentations": [
"horizontal flip",
"vertical flip"
],
"generates": [
"lung nodules",
"nodules",
"lung roi",
"lung region of interest",
"patches"
],
"height": 128,
"width": 128,
"depth": 1,
"type": "DCGAN",
"license": "MIT",
"dataset_type": "public",
"privacy_preservation": null,
"tags": [
"Thoracic xray",
"xray",
"x-ray",
"Thorax",
"Lung",
"Nodules",
"Lung Cancer",
"Lung Tumor"
],
"year": "2022"
},
"description": {
"title": "DCGAN Model for Patch Generation of Lung Nodules (Trained on Node21)",
"provided_date": "June 2022",
"trained_date": "June 2022",
"provided_after_epoch": null,
"version": null,
"publication": null,
"doi": [],
"inputs": [],
"comment": "An unconditional deep convolutional generative adversarial network (DCGAN) that generates lung nodule regions-of-interest patches based on chest xray (CXR) images. The pixel dimension of the generated patches is 128x128. The WGANGP was trained on cropped patches from CXR images from the NODE21 dataset (Sogancioglu et al, 2021). The uploaded ZIP file contains the files model.pt (model weight), __init__.py (image generation method and utils), a requirements.txt, a LICENSE file, the MEDIGAN metadata.json file, the used GAN training config file, a test.sh file to run the model, and an /image folder with a few generated example images."
}
},
"00018_WGANGP_XRAY_LUNG_NODULES": {
"execution": {
"package_name": "00018_WGANGP_NODE21",
"package_link": "https://zenodo.org/record/6943762/files/00018_WGANGP_NODE21.zip?download=1",
"model_name": "model",
"extension": ".pt",
"image_size": [
128,
128,
1
],
"dependencies": [
"numpy",
"tqdm",
"torch"
],
"generate_method": {
"name": "generate",
"args": {
"base": [
"model_file",
"num_samples",
"output_path",
"save_images"
],
"custom": {}
},
"input_latent_vector_size": 100
}
},
"selection": {
"performance": {
"SSIM": null,
"MSE": null,
"NSME": null,
"PSNR": null,
"IS": null,
"turing_test": null,
"FID_no_images": 1476,
"FID": 211.47,
"FID_ratio": 0.115,
"FID_RADIMAGENET": null,
"FID_RADIMAGENET_ratio": null,
"CLF_delta": null,
"SEG_delta": null,
"DET_delta": null,
"CLF": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
},
"SEG": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
},
"DET": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
}
},
"use_cases": [
"classification"
],
"organ": [
"lung",
"chest",
"thorax"
],
"modality": [
"x-ray",
"xray",
"CXR"
],
"vendors": [],
"centres": [],
"function": [
"noise to image",
"unconditional generation",
"data augmentation"
],
"condition": [],
"dataset": [
"Node21"
],
"augmentations": [
"horizontal flip",
"vertical flip"
],
"generates": [
"lung nodules",
"nodules",
"lung roi",
"lung region of interest",
"patches"
],
"height": 128,
"width": 128,
"depth": 1,
"type": "WGANGP",
"license": "MIT",
"dataset_type": "public",
"privacy_preservation": null,
"tags": [
"Thoracic xray",
"xray",
"x-ray",
"Thorax",
"Lung",
"Nodules",
"Lung Cancer",
"Lung Tumor"
],
"year": "2022"
},
"description": {
"title": "WGANGP Model for Patch Generation of Lung Nodules (Trained on Node21)",
"provided_date": "June 2022",
"trained_date": "June 2022",
"provided_after_epoch": null,
"version": null,
"publication": null,
"doi": [],
"inputs": [],
"comment": "An unconditional wasserstein generative adversarial network with gradient penalty (WGAN_GP) that generates lung nodule regions-of-interest patches based on chest xray (CXR) images. The pixel dimension of the generated patches is 128x128. The WGANGP was trained on cropped patches from CXR images from the NODE21 dataset (Sogancioglu et al, 2021). The uploaded ZIP file contains the files model.pt (model weight), __init__.py (image generation method and utils), a requirements.txt, a LICENSE file, the MEDIGAN metadata.json file, the used GAN training config file, a test.sh file to run the model, and an /image folder with a few generated example images."
}
},
"00019_PGGAN_CHEST_XRAY": {
"execution": {
"package_name": "00019_PGGAN_NODE21",
"package_link": "https://zenodo.org/record/7047097/files/00019_PGGAN_CHEST_XRAY.zip?download=1",
"model_name": "model",
"extension": ".pt",
"image_size": [
1024,
1024,
1
],
"dependencies": [
"numpy",
"tqdm",
"torch"
],
"generate_method": {
"name": "generate",
"args": {
"base": [
"model_file",
"num_samples",
"output_path",
"save_images"
],
"custom": {}
},
"input_latent_vector_size": 1024
}
},
"selection": {
"performance": {
"SSIM": null,
"MSE": null,
"NSME": null,
"PSNR": null,
"IS": null,
"turing_test": null,
"FID_no_images": 1000,
"FID": 96.74,
"FID_ratio": 0.297,
"FID_RADIMAGENET": 0.77,
"FID_RADIMAGENET_ratio": 0.243,
"CLF_delta": null,
"SEG_delta": null,
"DET_delta": null,
"CLF": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
},
"SEG": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
},
"DET": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
}
},
"use_cases": [
"classification",
"detection"
],
"organ": [
"lung",
"chest",
"thorax"
],
"modality": [
"x-ray",
"xray",
"CXR"
],
"vendors": [],
"centres": [],
"function": [
"noise to image",
"unconditional generation",
"data augmentation"
],
"condition": [],
"dataset": [
"Node21"
],
"augmentations": [
"horizontal flip",
"vertical flip"
],
"generates": [
"chest xray",
"CXR",
"thoracic xray",
"lung xray",
"lung xray"
],
"height": 1024,
"width": 1024,
"depth": 1,
"type": "PGGAN",
"license": "MIT",
"dataset_type": "public",
"privacy_preservation": null,
"tags": [
"Thoracic xray",
"xray",
"x-ray",
"Thorax",
"Lung",
"Nodules",
"Lung Cancer",
"Lung Tumor"
],
"year": "2022"
},
"description": {
"title": "PGGAN Model for Generation of Chest XRAY (CXR) Images (Trained on the ChestX-ray14 Dataset)",
"provided_date": "June 2022",
"trained_date": "June 2022",
"provided_after_epoch": null,
"version": null,
"publication": null,
"doi": [],
"inputs": [],
"comment": "An unconditional Progressively-growing generative adversarial network (PGGAN) that generates chest xray (CXR) images with pixel dimensions 1024x1024. The PGGAN was trained on CXR images from the ChestX-ray14 dataset (Wang et al., 2017, Paper: https://arxiv.org/pdf/1705.02315.pdf, Data: https://nihcc.app.box.com/v/ChestXray-NIHCC). The uploaded ZIP file contains the files model.pt (model weight), __init__.py (image generation method and utils), a requirements.txt, a LICENSE file, the MEDIGAN metadata.json file, the used GAN training config file, a test.sh file to run the model, and an /image folder with a few generated example images."
}
},
"00020_PGGAN_CHEST_XRAY": {
"execution": {
"package_name": "00020_PGGAN_CHEST_XRAY",
"package_link": "https://zenodo.org/record/7047295/files/00020_PGGAN_CHEST_XRAY.zip?download=1",
"model_name": "Final_Full_Model",
"extension": ".pth",
"image_size": [
1024,
1024,
3
],
"dependencies": [
"pytorch-lightning==1.2.10",
"torch",
"torchvision",
"matplotlib",
"pillow",
"numpy"
],
"generate_method": {
"name": "generate",
"args": {
"base": [
"model_file",
"num_samples",
"output_path",
"save_images"
],
"custom": {
"image_size": 1024,
"resize_pixel_dim": null
}
},
"input_latent_vector_size": 512
}
},
"selection": {
"performance": {
"SSIM": null,
"MSE": null,
"NSME": null,
"PSNR": null,
"IS": null,
"turing_test": null,
"FID_no_images": 1000,
"FID": 52.17,
"FID_ratio": 0.543,
"FID_RADIMAGENET": 2.83,
"FID_RADIMAGENET_ratio": 0.071,
"CLF_delta": null,
"SEG_delta": null,
"DET_delta": null,
"CLF": {
"trained_on_fake": {
"AUC": 0.878
},
"trained_on_real_and_fake": {},
"trained_on_real": {
"AUC": 0.947
}
},
"SEG": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
},
"DET": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
}
},
"use_cases": [
"classification",
"detection"
],
"organ": [
"lung",
"chest",
"thorax"
],
"modality": [
"x-ray",
"xray",
"CXR"
],
"vendors": [],
"centres": [],
"function": [
"noise to image",
"unconditional generation",
"data augmentation"
],
"condition": [],
"dataset": [
"ChestX-ray14"
],
"augmentations": [],
"generates": [
"chest xray",
"CXR",
"thoracic xray",
"lung xray",
"lung xray"
],
"height": 1028,
"width": 1028,
"depth": 3,
"type": "PGGAN",
"license": "MIT",
"dataset_type": "public",
"privacy_preservation": null,
"tags": [
"Thoracic xray",
"xray",
"x-ray",
"Thorax",
"Lung",
"Nodules",
"Lung Cancer",
"Lung Tumor"
],
"year": "2022"
},
"description": {
"title": "PGGAN Model for Generation of Chest XRAY (CXR) Images (Trained on ChestX-ray14 Dataset)",
"provided_date": "September 2022",
"trained_date": "2021",
"provided_after_epoch": null,
"version": null,
"publication": null,
"doi": [
"https://doi.org/10.1007/s42979-021-00720-7"
],
"inputs": [
"image_size: default=1024, help=the size if height and width of the generated images",
"resize_pixel_dim: default=None, help=Resizing of generated images via the pillow PIL image library."
],
"comment": "An unconditional Progressively-growing generative adversarial network (PGGAN) that generates chest xray (CXR) images with pixel dimensions 1024x1024. The PGGAN was trained on CXR images based on ChestX-ray14 dataset (Wang et al. 2017, Paper: https://arxiv.org/pdf/1705.02315.pdf, Data: https://nihcc.app.box.com/v/ChestXray-NIHCC). The uploaded ZIP file contains the model weights checkpoint file, __init__.py (image generation method and utils), a requirements.txt, the MEDIGAN metadata.json file, a test.sh file to run the model, and an /image folder with a few generated example images."
}
},
"00021_CYCLEGAN_BRAIN_MRI_T1_T2": {
"execution": {
"package_name": "00021_CYCLEGAN_BRAIN_MRI_T1_T2",
"package_link": "https://zenodo.org/record/7113464/files/00021_CYCLEGAN_BRAIN_MRI_T1_T2.zip?download=1",
"model_name": "netG_T1toT2_checkpoint",
"extension": ".pth.tar",
"image_size": [
"224",
"192"
],
"dependencies": [
"matplotlib",
"Pillow",
"torch",
"torchvision"
],
"generate_method": {
"name": "generate",
"args": {
"base": [
"model_file",
"num_samples",
"output_path",
"save_images"
],
"custom": {
"input_path": "models/00021_CYCLEGAN_BRAIN_MRI_T1_T2/inputs/T1",
"gpu_id": "0",
"translate_all_images": false,
"T1_to_T2": true
}
}
}
},
"selection": {
"performance": {
"SSIM": null,
"MSE": null,
"NSME": null,
"PSNR": null,
"IS": null,
"turing_test": null,
"FID_no_images": 1000,
"FID": 59.49,
"FID_ratio": 0.410,
"FID_RADIMAGENET": 1.45,
"FID_RADIMAGENET_ratio": 0.014,
"CLF_delta": null,
"SEG_delta": null,
"DET_delta": null,
"CLF": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
},
"SEG": {
"trained_on_fake": {
"dice": 0.712,
"dice_tumor": 0.712,
"dice_cochlea": 0.478
},
"trained_on_real_and_fake": {},
"trained_on_real": {}
},
"DET": {
"trained_on_fake": {},
"trained_on_real_and_fake": {},
"trained_on_real": {}
}
},
"use_cases": [
"segmentation"
],
"organ": [
"Brain"
],
"modality": [
"T1",
"T2"
],
"vendors": [],
"centres": [],
"function": [],
"condition": [],
"dataset": [
"CrossMoDA 2021"
],
"augmentations": [
"HorizontalFlip",
"Rotation"
],
"generates": [
"Brain",
"2D",
"MRI",
"T1",
"T2"
],
"height": 224.0,
"width": 192.0,
"depth": null,
"type": "CycleGAN",
"license": null,
"dataset_type": "public",
"privacy_preservation": null,
"tags": [
"Domain Adaptation",
"Brain MRI",
"Vestibular Schwanomma",
"Segmentation",
"Cross Modal Domain Translation"
],
"year": 2021
},
"description": {
"title": "CycleGAN Brain MRI T1-T2 translation (trained on CrossMoDA 2021 dataset)",
"provided_date": "2022",
"trained_date": "2021",
"provided_after_epoch": 65,
"version": "1",
"publication": "BrainLes 2022 MICCAI workshop paper",
"doi": [
"10.1007/978-3-031-09002-8_47"
],
"inputs": [
"input_path: default=models/00021_CYCLEGAN_BRAIN_MRI_T1_T2/inputs/T1, help=the path to .png brain MRI images that are translated from T1 to T2 or vice versa. ",
"image_size: default=[224, 192], help=list with image height and width. ",
"gpu_id: default=0, help=the gpu to run the model on.",
"translate_all_images: default=False, help=flag to override num_samples in case the user wishes to translate all images in the specified input_path folder.",
"T1_to_T2: default=True, help=if true, generator for T1 to T2 translation is used. If false, the translation is done from T2 to T1 instead. Need to adjust input path in this case e.g. models/00021_CYCLEGAN_BRAIN_MRI_T1_T2/inputs/T2 instead of models/00021_CYCLEGAN_BRAIN_MRI_T1_T2/inputs/T1. A different generator of the cycleGAN is used based on this flag."
],
"comment": "In recent years, deep learning models have considerably advanced the performance of segmentation tasks on Brain Magnetic Resonance Imaging (MRI). However, these models show a considerable performance drop when they are evaluated on unseen data from a different distribution. Since annotation is often a hard and costly task requiring expert supervision, it is necessary to develop ways in which existing models can be adapted to the unseen domains without any additional labelled information. In this work, we explore one such technique which extends the CycleGAN [2] architecture to generate label-preserving data in the target domain. The synthetic target domain data is used to train the nn-UNet [3] framework for the task of multi-label segmentation. The experiments are conducted and evaluated on the dataset [1] provided in the ‘Cross-Modality Domain Adaptation for Medical Image Segmentation’ challenge [23] for segmentation of vestibular schwannoma (VS) tumour and cochlea on contrast enhanced (ceT1) and high resolution (hrT2) MRI scans. In the proposed approach, our model obtains dice scores (DSC) 0.73 and 0.49 for tumour and cochlea respectively on the validation set of the dataset. This indicates the applicability of the proposed technique to real-world problems where data may be obtained by different acquisition protocols as in [1] where hrT2 images are more reliable, safer, and lower-cost alternative to ceT1."
}
},
"00022_WGAN_CARDIAC_AGING": {
"execution": {
"package_name": "00022_WGAN_CARDIAC_AGING",
"package_link": "https://zenodo.org/record/7494368/files/00022_WGAN_CARDIAC_AGING.zip?download=1",
"model_name": "model",
"extension": ".ckpt",
"image_size": [
256,
256
],
"dependencies": [
"nibabel==3.2.1",
"pytorch-lightning==1.4.7",
"pandas",
"comet-ml",
"monai<=1.0.1",
"grad-cam",
"matplotlib",
"monai[skimage]",
"munch==2.5.0",
"pillow>=7.0.0",
"ffmpeg-python==0.2.0",
"torchmetrics==0.6.0"
],
"generate_method": {
"name": "generate",
"args": {
"base": [
"model_file",
"output_path",
"save_images",
"num_samples"
],
"custom": {
"image_paths_input": [
"models/00022_WGAN_CARDIAC_AGING/sample_image.png",
"models/00022_WGAN_CARDIAC_AGING/sample_image.png",
"models/00022_WGAN_CARDIAC_AGING/sample_image.png"
],
"aging_input": [
-4,
10,
2
],
"data_type": "2d",
"view": "la",
"subcat": "2ch"
}
}
}
},
"selection": {
"performance": {},
"use_cases": [
"classification",
"segmentation"
],
"organ": [
"heart",
"chest"
],
"modality": [
"MRI",
"Cardiac imaging",
"Cardiography",
"full-field digital"
],
"vendors": [],
"centres": [],
"function": [
"image to image",
"image generation",
"data augmentation"
],
"condition": [
"age"
],
"dataset": [
"UK Biobank"
],
"augmentations": [
"resize"
],
"generates": [
"cardiac image",
"full-field digital"
],
"height": 256,
"width": 256,
"depth": null,
"type": "pix2pix",
"license": null,
"dataset_type": "non-public",
"privacy_preservation": null,
"tags": [
"Cardiac imaging",
"pix2pix",
"Pix2Pix"
],
"year": "2022"
},
"description": {
"title": "Generates cardiac images with age offset from real images (Trained on UK Biobank)",
"provided_date": "2022",
"trained_date": "2022",
"provided_after_epoch": 299,
"version": "0.0.1",
"publication": "https://www.frontiersin.org/articles/10.3389/fcvm.2022.983091",
"doi": [
""
],
"inputs": [
"input_image_paths: default=[\"models/00022_WGAN_CARDIAC_AGING/sample_image.png\"] help=List of image paths to apply aging.",
"aging_input: default=[-4] help=List of age offset values for each image.",
"data_type: default=\"2d\" help=",
"view: default=\"la\" help=",
"subcat: default=\"2ch\", help="
],
"comment": "Conditional WGAN-GP Model for Cardiac Image generation with age offset (Trained on UK Biobank). A conditional wasserstein generative adversarial network with gradient penalty (WGAN_GP) that generates MRI cardiac images. The pixel dimension of the generated images is 256x256. The uploaded ZIP file contains the files model.ckpt (model weights), __init__.py (image generation method and utils), a requirements.txt, and the used GAN training config file. A sample_image.png is provided for example generation."
}
},
"00023_PIX2PIXHD_BREAST_DCEMRI": {
"execution": {
"package_name": "00023",
"package_link": "https://zenodo.org/records/10215478/files/00023.zip?download=1",
"model_name": "30_net_G",
"extension": ".pth",
"image_size": [
512, 512
],
"dependencies": [
"numpy",
"torch",
"torchvision",
"pillow"
],
"generate_method": {
"name": "generate",
"args": {
"base": [
"model_file",
"num_samples",
"output_path",
"save_images"
],
"custom": {
"input_path": "input/",
"image_size": "512",
"gpu_id": "0"
}
}
}
},
"selection": {
"performance": {
"SSIM": 0.726,
"MSE": 34.88,
"NSME": null,
"PSNR": 32.91,
"IS": null,
"FID": 28.71,
"turing_test": "",
"downstream_task": {
"CLF": {
"trained_on_fake": {
"accuracy": null,
"precision": null,
"recall": null,
"f1": null,
"specificity": null,
"AUROC": null,
"AUPRC": null
},
"trained_on_real_and_fake": {},
"trained_on_real": {}
},
"SEG": {
"trained_on_fake": {
"dice": 0.687,
"jaccard": null,
"accuracy": null,
"precision": null,
"recall": null,
"f1": null
},
"trained_on_real_and_fake": {
"dice": "0.797"
},
"trained_on_real": {
"dice": "0.790"
}
}
}
},
"use_cases": [
"segmentation",
"tumour localization",
"classification",
"simulation"
],
"organ": [
"breast"
],
"modality": [
"dce-mri",
"mri",
"t1",
"t1-weighted",
"fat-saturated"
],
"vendors": [],
"centres": [
"Duke Hospital"
],
"function": [],
"condition": [],
"dataset": [
"DUKE"
],
"augmentations": [],
"generates": [],
"height": 512,
"width": 512,
"depth": 1,
"type": "pix2pixHD",
"license": "BSD License",
"dataset_type": "DCE-MRI",
"privacy_preservation": "",
"tags": [
"dce-mri",
"postcontrast",
"synthesis",
"breast",
"mri",
"treatment",
"i2i",
"pix2pixHD",
"SPIE"
],
"year": 2023
},
"description": {
"title": "Pre- to Post-Contrast Breast MRI Synthesis for Enhanced Tumour Segmentation",
"provided_date": "11.2023",
"trained_date": "2023",
"provided_after_epoch": 30,
"version": "1.0",
"publication": "https://doi.org/10.48550/arXiv.2311.10879",
"doi": [
"https://doi.org/10.48550/arXiv.2311.10879"
],
"inputs": [
"input_path: default=input/, help=the path to .png breast DCE-MRI images that are translated from pre-contrast to the first DCE post-contrast sequence. ",
"image_size: default=[512, 512], help=list with image height and width. ",
"gpu_id: default=0, help=the gpu to run the model on."
],
"comment": "Pix2Pix model for DCE-MRI slice generation from pre-contrast image input (Trained on Duke Breast MRI Dataset). A pix2pixHD mmodel that generates DCE-MRI axial slices based on checkpoint after 30 training epochs. \nThe pixel dimension of the generated images is 512x512. Several generated 2d slices can be merged together to create a 3D MRI volume with tumour tissue highlighted by synthetic contrast. \nThe uploaded ZIP file contains the files 30_net_G.pth (model weights), __init__.py (image generation method and utils), a requirements.txt, and further code below the /src folder for handling of model, data, and training utils. Sample input images are provided as an example for image generation."
}
}
}
================================================
FILE: docs/Makefile
================================================
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = medigan
SOURCEDIR = source
BUILDDIR = build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
================================================
FILE: docs/make.bat
================================================
@ECHO OFF
pushd %~dp0
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build
set SPHINXPROJ=medigan
if "%1" == "" goto help
%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
goto end
:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
:end
popd
================================================
FILE: docs/requirements.txt
================================================
# File: docs/requirements.txt
sphinx-rtd-theme==1.0.0
Sphinx==4.5.0
sphinx-automodapi==0.14.1
tqdm==4.64.0
requests==2.31.0
torch==1.13.1
PyGithub==1.55
numpy==1.22.4
matplotlib==3.4.3
myst-parser
================================================
FILE: docs/source/adding_models.rst
================================================
Model Contributions
=====================
We are happy that you are considering contributing your model to `medigan`.
This will make your model accessible to the community and our users can easily integrate your synthetic data into their training pipelines and experiments.
Guide: Automated Model Contribution
_________________________________________
Create an `__init__.py <templates/examples/__init__.py>`_ file in your model's root folder.
Next, run the following code to contribute your model to `medigan`.
- Your model will be stored on `Zenodo <https://zenodo.org/>`_.
- Also, a Github `issue <https://github.com/RichardObi/medigan/issues>`_ will be created to add your model's metadata to medigan's `global.json <https://github.com/RichardObi/medigan/blob/main/config/global.json>`_.
- To do so, please provide a github access token (`get one here <https://github.com/settings/tokens>`_) and a zenodo access token (`get one here <https://zenodo.org/account/settings/applications/tokens/new/>`_), as shown below. After creation, the zenodo access token may take a few minutes before being recognized in zenodo API calls.
.. code-block:: Python
from medigan import Generators
gen = Generators()
# Contribute your model
gen.contribute(
model_id = "00100_YOUR_MODEL", # assign an ID
init_py_path ="path/ending/with/__init__.py",
model_weights_name = "10000",
model_weights_extension = ".pt",
generate_method_name = "generate", # in __init__.py
dependencies = ["numpy", "torch"],
creator_name = "YOUR_NAME",
creator_affiliation = "YOUR_AFFILIATION",
zenodo_access_token = 'ZENODO_ACCESS_TOKEN',
github_access_token = 'GITHUB_ACCESS_TOKEN',
)
Guide: Manual Model Contribution
______________________________________
In the following, you find a step-by-step guide on how to contribute your generative model to `medigan`.
In case you encounter problems during this process feel free to reach out by creating an issue `here <https://github.com/RichardObi/medigan-models/issues>`_ and we will try to help.
Checkout the figure below that shows the main components of the model contribution workflow depicted in yellow (d).
.. figure:: _static/medigan-workflows.png
:alt: Architectural overview and main workflows
Architectural overview including main workflows consisting of (a) library import and initialisation, (b) generative model search and ranking, (c) sample generation, and (d) generative model contribution.
If you are here, you have recently developed a generative model such as a GAN, VAE, Diffusion Model, etc and you would like to boost your model's impact, reusability, dissemination by uploading it to `medigan`.
We are delighted and will assist you in adding your model.
#. **Firstly, let's create the needed files:**
To add your model you will need the following files.
#. A checkpoint file that contains your trained model weights (e.g., the ``state_dict`` in pytorch)
#. An ``__init__.py`` file that contains functions that
- load the weights file (let's call that one ``weights.pt``)
- initialize your model with these weights
- generate samples with the initialized model.
#. Now that you have the ``weights.pt`` and the ``__init__.py``, let's check if we can make them work together.
#. Run your ``__init__.py``'s generate function using e.g. ``python -m __init__.py generate``
#. Check whether your model did load the weights effectively and whether synthetic samples were generated as expected.
#. Apply some necessary adjustments to your model package, particularly to your ``__init__.py``:
#. We have some templates that you can use to guide the adjustments described below
- If you are using a model that generates samples **without** image input (e.g., noise-to-image): Download Model `00002 <https://doi.org/10.5281/zenodo.5188557>`_ from `here <https://zenodo.org/record/5548158/files/MALIGN_DCGAN.zip?download=1>`_. Unzip it and open the ``__init__.py`` that contains an example ``generate()`` method.
- If you are using a model that generates samples **with** image input (e.g., image-to-image): Download Model `00003 <https://doi.org/10.5281/zenodo.5547263>`_ from `here <https://zenodo.org/record/5555010/files/CycleGAN_high_density.zip?download=1>`_. Unzip it and open the ``__init__.py`` that contains an example ``generate()`` method.
#. Please note that user's of `medigan` models may add your model to their preprocessing or AI training pipelines. Please make sure that your model, hence, runs efficiently. For instance, your model should load the weights only once even though the generate() function is called multiple times.
#. Please make sure your model is able to run both on gpu and on cpu and your code automatically detects on which one to run.
#. Please replace all ``print()`` functions from your code with ``logging.debug()`` (for this you need to ``import logging``).
#. Please add appropriate error handling using ``try, except`` blocks on each possible source of error in your code. ``raise`` the error in your ``generate()`` function to allow `medigan` to handle it and pass it to the user.
#. If your generative model needs some input images, provide a few example images in a folder called ``/images``. Users may test your model with these example images before feeding their own input images to your model.
#. There are a few parameters of the ``generate()`` that are mandatory in `medigan` and others that you can set optionally.
- Mandatory:
- ``model_file``: string, the path where your ``generate()`` method will find its weight file
- ``output_path``: string, the path where our ``generate()`` method should store the generated images
- ``save_images``: boolean, whether your ``generate()`` method should store generated samples in ``output_path`` or return them as numpy arrays.
- ``num_samples``: int, the number of samples that should be generated.
- Optional:
- ``input_path``: string, the path where our ``generate()`` method finds images that should be used as input into the generative model (i.e. in image-to-image translation).
- ``image_size``: array, that contains image height, width, and, optionally, also depth.
- ``translate_all_images``: boolean, in image-to-image translation, if ``True``, this overwrites the ``num_samples`` and instead translates all images found in ``input_path``.
- ``gpu_id``: int, if a user has various GPUs available, the user can specify which one of them to use to run your generative model.
#. **Secondly, test your model locally:**
Okay, now that we know which files we need, let's test them using a local version of `medigan`.
#. Let's start by cloning `medigan` e.g. using the command line: ``git clone https://github.com/RichardObi/medigan.git``
#. Next, cd into `medigan`, install the dependencies of `medigan`, and create a virtual environment.
You can do so running these commands:
- ``cd medigan``
- ``pip install pipenv``
- ``pipenv install``
- ``pipenv shell``
#. Now that you have your environment up and running, please run the following command to download the config file.
- ``python -m tests.tests TestMediganMethods.test_init_generators``
#. In the folder ``/config``, you should now see a file called `global.json <https://raw.githubusercontent.com/RichardObi/medigan-models/main/global.json>`_. In this file each model's metadata is stored.
* Please add the metadata for your model at the bottom of the `global.json` file.
* To add the metadata, you can use the metadata of model `00001 <https://doi.org/10.5281/zenodo.5187714>`_ in `global.json <https://raw.githubusercontent.com/RichardObi/medigan-models/main/global.json>`_ as example.
* Copy the metadata of model 00001 and add it to the bottom of ``global.json``. Then adjust each entry in that part of the json so that it represents your own model.
- The ``model_id`` should follow the convention ``NNNNN_TTTTTT_MMMM_AAAAA_GGGG`` (N = Number of model, T = Type of model, M = Modality, A = Anatomic/Ailment Information, G = Generated Sample Type information i.e. full for full image or roi for region of interest)
- The field ``package_link`` (under ``execution``) should point to a local zip file ``NAME_OF_YOUR_MODEL_PACKAGE.zip`` of your model package.
- json entries below ``execution`` are important and needed to run the model in `medigan`, e.g. the name and parameters of a ``generate()`` function in the ``__init__.py``
- json entries below ``selection`` are important to enable users to search and rank the model compared to other models in `medigan`, e.g. the performance indicators such as SSIM, MSE, PSNR, etc.
- json entries below ``description`` are to allow tracing back the origin and metadata of the model and allow users to get further information about the model, e.g. license, related publications, etc.
#. You are almost done! It's Testing Time!
- Run a local test using the following code:
.. code-block:: Python
from medigan import Generators
gen = Generators()
gen.generate(model_id="YOUR_MODEL_ID")
# Test a few variations.
test_dict = {"translate_all_images": True, "SOME_OTHER_OPTIONAL_PARAMS": True}
gen.generate(model_id="YOUR_MODEL_ID", num_samples=100, output_path="here", save_images=True, **test_dict)
- If you are code runs well with different settings/params, congratulations, you have made it! You integrated your model as a package into `medigan` and are now ready for the final steps.
#. **Thirdly, upload your model:**
#. Package and upload your model to Zenodo - home to your model's code and documentation.
#. First, check if your model package folder contains an ``__init__.py``, a ``weights`` file, a ``license`` file, and optionally other files.
#. The next step is to zip this folder. To do so (e.g., on MACOS) you may ``cd`` into the folder and use the following commands (while removing hidden OS system files):
.. code-block:: Python
find . -name ".DS_Store" -delete
zip -r NAME_OF_YOUR_MODEL_PACKAGE.zip . -x ".*" -x "__MACOSX"
Now that you have your model package zipped and ready, note that `medigan` model's are commonly stored in Zenodo, as in Zenodo
* they get a DOI
* the content of their package is non editable i.e. no file modifications/updates without new DOI.
* This helps to avoid security issues as package content remains static after the model is tested, verified, and added to `medigan`.
* Zenodo has a close to unlimited storage capacity for research data/software.
* Also, the authorship/ownership of the model are clear
* There is transparent licensing.
* Each model is versioned in Zenodo with different DOIs.
* A model documentation and contact information can be added.
#. Checkout this example of our model `00001 <https://doi.org/10.5281/zenodo.5187714>`_ on Zenodo. You can use the Zenodo documentation of this model as template for your own model upload.
#. Now, let's go to the `Zenodo <https://zenodo.org/>`_ website.
#. Click on ``New Upload`` (if you don't have an account, you can quickly create one e.g., using your `ORCID <https://orcid.org/>`_)
#. Fill in the metadata fields for your model and upload the model package zip file (i.e. drag and drop).
#. Click on ``Save`` and ``Submit``. Congratulations your model is now on Zenodo! Good job!
#. **Finally, add your model to `medigan's` model metadata:**
Last step!!! Your model is on Zenodo and tested locally. Now we can officially add it to `medigan`. Remember the ``global.json`` that you created locally to test your model? It is time for glory for this file.
#. Now, clone the `medigan-models` repository (the home of `medigan's global.json <https://github.com/RichardObi/medigan-models/blob/main/global.json>`_) e.g. by using ``git clone https://github.com/RichardObi/medigan-models.git``
#. Create and checkout a new local branch ``git checkout -b mynewbranch``
#. Open the ``global.json`` in your cloned local `medigan-models`
#. Edit the ``global.json`` file and add your model's entry at the bottom, and save.
#. Note that this is the time to replace the value of ``package_link`` from your local model file path to your new Zenodo model URL. To get this URL, go to the Zenodo page of your model, and scroll down to ``Files``, where you see a download button. Copy the url link that this button points to, which is your ``package_link``.
#. Commit the new file (``git add .``, ``git commit -m "added model YOUR_MODEL_ID."``) and push your branch (``git push``).
#. Lastly, go to the repository `medigan-models <https://github.com/RichardObi/medigan-models/>`_ and create a pull request that merges your recently pushed branch into ``main``.
#. That's it!!! Your pull request will be evaluated asap. Once approved your model is officially part of `medigan`!
If you have suggestions on improvements for our model contribution process, please take a minute and let us know `here <https://github.com/RichardObi/medigan-models/issues>`_.
Conventions that your model should follow
______________________________________________
* Your model should have a ``generate`` method with the params model_file:str, num_samples:int, save_images:bool, and output_path:str (see `template (templates/examples/__init__.py>`_)
* Also, the model should do simple error handling, run flexibly on either gpu or cpu, use ``logging`` instead of ``prints``, and create some sort of synthetic data.
We hope to welcome you model soon to `medigan`! If you need support, please let us now `here <https://github.com/RichardObi/medigan/issues>`_.
================================================
FILE: docs/source/api/medigan.config_manager.ConfigManager.rst
================================================
ConfigManager
=============
.. currentmodule:: medigan.config_manager
.. autoclass:: ConfigManager
:show-inheritance:
.. rubric:: Methods Summary
.. autosummary::
~ConfigManager.add_model_to_config
~ConfigManager.get_config_by_id
~ConfigManager.is_model_in_config
~ConfigManager.is_model_metadata_valid
~ConfigManager.load_config_file
.. rubric:: Methods Documentation
.. automethod:: add_model_to_config
.. automethod:: get_config_by_id
.. automethod:: is_model_in_config
.. automethod:: is_model_metadata_valid
.. automethod:: load_config_file
================================================
FILE: docs/source/api/medigan.contribute_model.model_contributor.ModelContributor.rst
================================================
ModelContributor
================
.. currentmodule:: medigan.contribute_model.model_contributor
.. autoclass:: ModelContributor
:show-inheritance:
.. rubric:: Methods Summary
.. autosummary::
~ModelContributor.add_metadata_from_file
~ModelContributor.add_metadata_from_input
~ModelContributor.is_value_for_key_already_set
~ModelContributor.load_metadata_template
~ModelContributor.push_to_github
~ModelContributor.push_to_zenodo
~ModelContributor.validate_and_update_model_weights_path
~ModelContributor.validate_init_py_path
~ModelContributor.validate_local_model_import
~ModelContributor.validate_model_id
.. rubric:: Methods Documentation
.. automethod:: add_metadata_from_file
.. automethod:: add_metadata_from_input
.. automethod:: is_value_for_key_already_set
.. automethod:: load_metadata_template
.. automethod:: push_to_github
.. automethod:: push_to_zenodo
.. automethod:: validate_and_update_model_weights_path
.. automethod:: validate_init_py_path
.. automethod:: validate_local_model_import
.. automethod:: validate_model_id
================================================
FILE: docs/source/api/medigan.contribute_model.rst
================================================
medigan.contribute\_model package
=================================
Submodules
----------
medigan.contribute\_model.base\_model\_uploader module
------------------------------------------------------
.. automodule:: medigan.contribute_model.base_model_uploader
:members:
:undoc-members:
:show-inheritance:
medigan.contribute\_model.github\_model\_uploader module
--------------------------------------------------------
.. automodule:: medigan.contribute_model.github_model_uploader
:members:
:undoc-members:
:show-inheritance:
medigan.contribute\_model.model\_contributor module
--------------------
gitextract_6gg4b5eb/
├── .github/
│ └── workflows/
│ └── python-ci.yml
├── .gitignore
├── .readthedocs.yaml
├── CONTRIBUTING.md
├── LICENSE
├── Pipfile
├── README.md
├── config/
│ ├── candidates.json
│ └── global.json
├── docs/
│ ├── Makefile
│ ├── make.bat
│ ├── requirements.txt
│ └── source/
│ ├── adding_models.rst
│ ├── api/
│ │ ├── medigan.config_manager.ConfigManager.rst
│ │ ├── medigan.contribute_model.model_contributor.ModelContributor.rst
│ │ ├── medigan.contribute_model.rst
│ │ ├── medigan.execute_model.model_executor.ModelExecutor.rst
│ │ ├── medigan.execute_model.rst
│ │ ├── medigan.generators.Generators.rst
│ │ ├── medigan.model_visualizer.ModelVisualizer.rst
│ │ ├── medigan.rst
│ │ ├── medigan.select_model.model_selector.ModelSelector.rst
│ │ ├── medigan.select_model.rst
│ │ └── modules.rst
│ ├── code_doc.rst
│ ├── code_examples.rst
│ ├── conf.py
│ ├── description.rst
│ ├── index.rst
│ ├── model_documentation.md
│ ├── models.rst
│ ├── modules_overview.rst
│ └── tests.rst
├── examples/
│ └── tutorial.ipynb
├── models/
│ └── __init__.py
├── pyproject.toml
├── setup.py
├── src/
│ └── medigan/
│ ├── __init__.py
│ ├── config_manager.py
│ ├── constants.py
│ ├── contribute_model/
│ │ ├── __init__.py
│ │ ├── base_model_uploader.py
│ │ ├── github_model_uploader.py
│ │ ├── model_contributor.py
│ │ └── zenodo_model_uploader.py
│ ├── exceptions.py
│ ├── execute_model/
│ │ ├── __init__.py
│ │ ├── install_model_dependencies.py
│ │ ├── model_executor.py
│ │ └── synthetic_dataset.py
│ ├── generators.py
│ ├── model_visualizer.py
│ ├── select_model/
│ │ ├── __init__.py
│ │ ├── matched_entry.py
│ │ ├── model_match_candidate.py
│ │ └── model_selector.py
│ └── utils.py
├── templates/
│ ├── examples/
│ │ ├── 500.pt.txt
│ │ ├── LICENSE
│ │ ├── __init__.py
│ │ ├── metadata.json
│ │ ├── requirements.txt
│ │ └── test.sh
│ ├── raw_examples/
│ │ ├── LICENSE
│ │ ├── __init__.py
│ │ ├── metadata.json
│ │ └── model.pt
│ └── template.json
└── tests/
├── __init__.py
├── fid.py
├── model_contribution_test_manual.py
├── model_integration_test_manual.py
├── test_model_executor.py
└── test_model_selector.py
SYMBOL INDEX (206 symbols across 18 files)
FILE: src/medigan/config_manager.py
class ConfigManager (line 35) | class ConfigManager:
method __init__ (line 59) | def __init__(self, config_dict: dict = None, is_new_download_forced: b...
method load_config_file (line 65) | def load_config_file(self, is_new_download_forced: bool = False) -> bool:
method get_config_by_id (line 110) | def get_config_by_id(self, model_id: str, config_key: str = None) -> d...
method add_model_to_config (line 136) | def add_model_to_config(
method is_model_in_config (line 195) | def is_model_in_config(self, model_id: str) -> bool:
method is_model_metadata_valid (line 215) | def is_model_metadata_valid(
method match_model_id (line 314) | def match_model_id(self, provided_model_id: str) -> bool:
method __str__ (line 348) | def __str__(self):
method __repr__ (line 351) | def __repr__(self):
method __len__ (line 354) | def __len__(self):
method __getitem__ (line 357) | def __getitem__(self, idx: int):
FILE: src/medigan/contribute_model/base_model_uploader.py
class BaseModelUploader (line 8) | class BaseModelUploader:
method __init__ (line 26) | def __init__(
method push (line 34) | def push(self):
method __repr__ (line 37) | def __repr__(self):
method __len__ (line 40) | def __len__(self):
method __getitem__ (line 43) | def __getitem__(self, idx: int):
FILE: src/medigan/contribute_model/github_model_uploader.py
class GithubModelUploader (line 23) | class GithubModelUploader(BaseModelUploader):
method __init__ (line 42) | def __init__(
method push (line 50) | def push(
method add_package_link_to_metadata (line 115) | def add_package_link_to_metadata(
method __repr__ (line 176) | def __repr__(self):
method __len__ (line 181) | def __len__(self):
method __getitem__ (line 184) | def __getitem__(self, idx: int):
FILE: src/medigan/contribute_model/model_contributor.py
class ModelContributor (line 31) | class ModelContributor:
method __init__ (line 59) | def __init__(
method validate_model_id (line 77) | def validate_model_id(
method validate_init_py_path (line 113) | def validate_init_py_path(self, init_py_path) -> bool:
method validate_and_update_model_weights_path (line 134) | def validate_and_update_model_weights_path(self) -> dict:
method validate_local_model_import (line 204) | def validate_local_model_import(self):
method push_to_zenodo (line 224) | def push_to_zenodo(
method push_to_github (line 268) | def push_to_github(
method load_metadata_template (line 320) | def load_metadata_template(self) -> dict:
method add_metadata_from_file (line 346) | def add_metadata_from_file(self, metadata_file_path) -> dict:
method add_metadata_from_input (line 378) | def add_metadata_from_input(
method is_value_for_key_already_set (line 457) | def is_value_for_key_already_set(
method _recursively_fill_metadata (line 492) | def _recursively_fill_metadata(
method __repr__ (line 592) | def __repr__(self):
method __len__ (line 595) | def __len__(self):
method __getitem__ (line 598) | def __getitem__(self, idx: int):
FILE: src/medigan/contribute_model/zenodo_model_uploader.py
class ZenodoModelUploader (line 26) | class ZenodoModelUploader(BaseModelUploader):
method __init__ (line 44) | def __init__(
method create_upload_description (line 53) | def create_upload_description(
method create_upload_json_data (line 84) | def create_upload_json_data(
method locate_or_create_model_zip_file (line 118) | def locate_or_create_model_zip_file(
method empty_upload (line 159) | def empty_upload(self) -> dict:
method upload (line 182) | def upload(self, file_path: str, filename: str, bucket_url: str) -> dict:
method upload_descriptive_data (line 212) | def upload_descriptive_data(self, deposition_id: str, data: dict) -> d...
method publish (line 240) | def publish(self, deposition_id: str) -> dict:
method push (line 284) | def push(
method __repr__ (line 370) | def __repr__(self):
method __len__ (line 373) | def __len__(self):
method __getitem__ (line 376) | def __getitem__(self, idx: int):
FILE: src/medigan/execute_model/install_model_dependencies.py
function parse_args (line 22) | def parse_args() -> argparse.Namespace:
function install_model (line 35) | def install_model(
FILE: src/medigan/execute_model/model_executor.py
class ModelExecutor (line 45) | class ModelExecutor:
method __init__ (line 94) | def __init__(
method _setup_model_package (line 119) | def _setup_model_package(self):
method _check_package_resources (line 147) | def _check_package_resources(self):
method _get_and_store_package (line 172) | def _get_and_store_package(self):
method is_model_already_unpacked (line 201) | def is_model_already_unpacked(self) -> bool:
method _import_package_as_lib (line 222) | def _import_package_as_lib(self):
method generate (line 286) | def generate(
method _prepare_generate_method_args (line 396) | def _prepare_generate_method_args(
method __repr__ (line 486) | def __repr__(self):
method __len__ (line 494) | def __len__(self):
method __getitem__ (line 497) | def __getitem__(self, idx: int):
FILE: src/medigan/execute_model/synthetic_dataset.py
class SyntheticDataset (line 8) | class SyntheticDataset(Dataset):
method __init__ (line 38) | def __init__(
method __getitem__ (line 52) | def __getitem__(self, index):
method __len__ (line 83) | def __len__(self):
FILE: src/medigan/generators.py
class Generators (line 25) | class Generators:
method __init__ (line 52) | def __init__(
method get_config_by_id (line 87) | def get_config_by_id(self, model_id: str, config_key: str = None) -> d...
method is_model_metadata_valid (line 114) | def is_model_metadata_valid(
method add_model_to_config (line 140) | def add_model_to_config(
method list_models (line 186) | def list_models(self) -> list:
method get_selection_criteria_by_id (line 196) | def get_selection_criteria_by_id(
method get_selection_criteria_by_ids (line 220) | def get_selection_criteria_by_ids(
method get_selection_values_for_key (line 250) | def get_selection_values_for_key(self, key: str, model_id: str = None)...
method get_selection_keys (line 275) | def get_selection_keys(self, model_id: str = None) -> list:
method get_models_by_key_value_pair (line 293) | def get_models_by_key_value_pair(
method rank_models_by_performance (line 322) | def rank_models_by_performance(
method find_matching_models_by_values (line 351) | def find_matching_models_by_values(
method find_models_and_rank (line 388) | def find_models_and_rank(
method find_models_rank_and_generate (line 447) | def find_models_rank_and_generate(
method find_model_and_generate (line 527) | def find_model_and_generate(
method add_all_model_executors (line 608) | def add_all_model_executors(self):
method add_model_executor (line 624) | def add_model_executor(self, model_id: str, install_dependencies: bool...
method _add_model_executor (line 650) | def _add_model_executor(
method is_model_executor_already_added (line 678) | def is_model_executor_already_added(self, model_id) -> bool:
method find_model_executor_by_id (line 701) | def find_model_executor_by_id(self, model_id: str) -> ModelExecutor:
method get_model_executor (line 722) | def get_model_executor(
method generate (line 756) | def generate(
method get_generate_function (line 804) | def get_generate_function(
method add_model_contributor (line 846) | def add_model_contributor(
method get_model_contributor_by_id (line 880) | def get_model_contributor_by_id(self, model_id: str) -> ModelContributor:
method add_metadata_from_file (line 901) | def add_metadata_from_file(self, model_id: str, metadata_file_path: st...
method add_metadata_from_input (line 927) | def add_metadata_from_input(
method push_to_zenodo (line 977) | def push_to_zenodo(
method push_to_github (line 1021) | def push_to_github(
method test_model (line 1074) | def test_model(
method contribute (line 1144) | def contribute(
method get_as_torch_dataloader (line 1266) | def get_as_torch_dataloader(
method get_as_torch_dataset (line 1388) | def get_as_torch_dataset(
method visualize (line 1448) | def visualize(
method __repr__ (line 1483) | def __repr__(self):
method __len__ (line 1489) | def __len__(self):
method __getitem__ (line 1492) | def __getitem__(self, idx: int):
FILE: src/medigan/model_visualizer.py
class ModelVisualizer (line 10) | class ModelVisualizer:
method __init__ (line 36) | def __init__(self, model_executor, config: None):
method visualize (line 64) | def visualize(self, slider_grouper: int = 10, auto_close=False):
method _unpack_output (line 281) | def _unpack_output(self, output) -> tuple:
FILE: src/medigan/select_model/matched_entry.py
class MatchedEntry (line 11) | class MatchedEntry:
method __init__ (line 33) | def __init__(
method __str__ (line 46) | def __str__(self):
method __repr__ (line 55) | def __repr__(self):
method __len__ (line 58) | def __len__(self):
method __getitem__ (line 61) | def __getitem__(self, idx: int):
FILE: src/medigan/select_model/model_match_candidate.py
class ModelMatchCandidate (line 15) | class ModelMatchCandidate:
method __init__ (line 55) | def __init__(
method add_matched_entry (line 75) | def add_matched_entry(self, matched_entry: MatchedEntry) -> None:
method get_all_matching_elements (line 79) | def get_all_matching_elements(self) -> list:
method check_if_is_match (line 94) | def check_if_is_match(self) -> bool:
method __str__ (line 136) | def __str__(self):
method __repr__ (line 153) | def __repr__(self):
method __len__ (line 156) | def __len__(self):
method __getitem__ (line 159) | def __getitem__(self, idx: int):
FILE: src/medigan/select_model/model_selector.py
class ModelSelector (line 18) | class ModelSelector:
method __init__ (line 34) | def __init__(
method _init_model_selector_data (line 46) | def _init_model_selector_data(self):
method get_selection_criteria_by_id (line 62) | def get_selection_criteria_by_id(
method get_selection_criteria_by_ids (line 95) | def get_selection_criteria_by_ids(
method get_selection_keys (line 128) | def get_selection_keys(self, model_id: str = None) -> list:
method get_selection_values_for_key (line 158) | def get_selection_values_for_key(self, key: str, model_id: str = None)...
method get_models_by_key_value_pair (line 193) | def get_models_by_key_value_pair(
method rank_models_by_performance (line 259) | def rank_models_by_performance(
method find_models_and_rank (line 330) | def find_models_and_rank(
method find_matching_models_by_values (line 375) | def find_matching_models_by_values(
method recursive_search_for_values (line 435) | def recursive_search_for_values(
method __repr__ (line 530) | def __repr__(self):
method __len__ (line 533) | def __len__(self):
method __getitem__ (line 536) | def __getitem__(self, idx: int):
FILE: src/medigan/utils.py
class Utils (line 22) | class Utils:
method __init__ (line 25) | def __init__(
method mkdirs (line 31) | def mkdirs(path_as_string: str) -> bool:
method is_file_located_or_downloaded (line 46) | def is_file_located_or_downloaded(
method download_file (line 85) | def download_file(
method read_in_json (line 140) | def read_in_json(path_as_string) -> dict:
method unzip_archive (line 154) | def unzip_archive(source_path: Path, target_path: str = "./"):
method unzip_and_return_unzipped_path (line 165) | def unzip_and_return_unzipped_path(package_path: str):
method copy (line 187) | def copy(source_path: Path, target_path: str = "./"):
method dict_to_lowercase (line 200) | def dict_to_lowercase(target_dict: dict, string_conversion: bool = Tru...
method list_to_lowercase (line 213) | def list_to_lowercase(target_list: list) -> list:
method deep_get (line 222) | def deep_get(base_dict: dict, key: str):
method is_url_valid (line 236) | def is_url_valid(the_url: str) -> bool:
method has_more_than_n_diff_pixel_values (line 247) | def has_more_than_n_diff_pixel_values(img: np.ndarray, n: int = 4) -> ...
method split_images_masks_and_labels (line 263) | def split_images_masks_and_labels(
method split_images_and_masks_no_ordering (line 313) | def split_images_and_masks_no_ordering(
method order_dict_by_value (line 359) | def order_dict_by_value(
method is_file_in (line 380) | def is_file_in(folder_path: str, filename: str) -> bool:
method store_dict_as (line 394) | def store_dict_as(
method call_without_removable_params (line 412) | def call_without_removable_params(
method __len__ (line 436) | def __len__(self):
method __getitem__ (line 439) | def __getitem__(self, idx: int):
FILE: templates/examples/__init__.py
class BaseGenerator (line 17) | class BaseGenerator(nn.Module):
method __init__ (line 18) | def __init__(
method forward (line 36) | def forward(self, input):
class Generator (line 40) | class Generator(BaseGenerator):
method __init__ (line 41) | def __init__(
method forward (line 164) | def forward(self, x, conditions=None):
function interval_mapping (line 185) | def interval_mapping(image, from_min, from_max, to_min, to_max):
function image_generator (line 196) | def image_generator(model_path, device, nz, ngf, nc, ngpu, num_samples):
function save_generated_images (line 234) | def save_generated_images(image_list, path):
function return_images (line 245) | def return_images(image_list):
function generate (line 255) | def generate(model_file, num_samples, output_path, save_images: bool):
FILE: tests/fid.py
function parse_args (line 31) | def parse_args() -> argparse.Namespace:
function load_images (line 65) | def load_images(directory, normalize=False, split=False, limit=None):
function check_model_weights (line 105) | def check_model_weights(model_name):
function _radimagenet_fn (line 122) | def _radimagenet_fn(images):
function get_classifier_fn (line 137) | def get_classifier_fn(model_name="imagenet"):
function calculate_fid (line 151) | def calculate_fid(
FILE: tests/test_model_executor.py
class TestMediganExecutorMethods (line 104) | class TestMediganExecutorMethods:
method setup_class (line 105) | def setup_class(self):
method test_imports_and_init_generators (line 125) | def test_imports_and_init_generators(self):
method test_sample_generation_methods (line 141) | def test_sample_generation_methods(self, models_with_args: list):
method test_find_model_and_generate_method (line 175) | def test_find_model_and_generate_method(
method test_find_and_rank_models_then_generate_method (line 200) | def test_find_and_rank_models_then_generate_method(self, values_list, ...
method test_generate_method (line 218) | def test_generate_method(self, model_id):
method test_generate_method_with_additional_args (line 230) | def test_generate_method_with_additional_args(
method test_get_generate_method (line 246) | def test_get_generate_method(self, model_id):
method test_get_dataloader_method (line 259) | def test_get_dataloader_method(self, model_id):
method test_visualize_method (line 294) | def test_visualize_method(self, model_id):
method _check_if_samples_were_generated (line 310) | def _check_if_samples_were_generated(
method _remove_dir_and_contents (line 335) | def _remove_dir_and_contents(self):
method _remove_model_dir_and_zip (line 349) | def _remove_model_dir_and_zip(
method teardown_class (line 403) | def teardown_class(self):
FILE: tests/test_model_selector.py
class TestMediganSelectorMethods (line 31) | class TestMediganSelectorMethods:
method setup_method (line 32) | def setup_method(self):
method test_init_generators (line 47) | def test_init_generators(self):
method test_search_for_models_method (line 59) | def test_search_for_models_method(self, values_list):
method test_find_and_rank_models_by_performance (line 82) | def test_find_and_rank_models_by_performance(self, models, values_list...
method test_rank_models_by_performance (line 119) | def test_rank_models_by_performance(self, models, metric, order):
method test_rank_models_by_performance_with_given_ids (line 149) | def test_rank_models_by_performance_with_given_ids(self, models, metri...
method test_get_models_by_key_value_pair (line 170) | def test_get_models_by_key_value_pair(self, key1, value1, expected):
Condensed preview — 74 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (593K chars).
[
{
"path": ".github/workflows/python-ci.yml",
"chars": 4526,
"preview": "# This GitHub Action workflow will\n\n# - Format code using Black\n# - Build project with all dependencies\n# - Check code w"
},
{
"path": ".gitignore",
"chars": 2005,
"preview": "# Byte-compiled / optimized / DLL files\n__pycache__/\n*.py[cod]\n*$py.class\n\n# C extensions\n*.so\n\n# Distribution / packagi"
},
{
"path": ".readthedocs.yaml",
"chars": 640,
"preview": "# File: .readthedocs.yaml (see example: https://docs.readthedocs.io/en/stable/config-file/v2.html)\n\n# Required (see http"
},
{
"path": "CONTRIBUTING.md",
"chars": 1122,
"preview": "This file is Work in Progress\n# Contributing\n\n## How to Add New Models to medigan:\n\n- `medigan` motivates the reuse of t"
},
{
"path": "LICENSE",
"chars": 1106,
"preview": "MIT License\n\nCopyright (c) 2021 Richard Osuala, Grzegorz Skorupko, Noussair Lazrak\n\nPermission is hereby granted, free o"
},
{
"path": "Pipfile",
"chars": 417,
"preview": "[[source]]\nurl = \"https://pypi.org/simple\"\nverify_ssl = true\nname = \"pypi\"\n\n[packages]\nrequests = \"*\"\nopencv-contrib-pyt"
},
{
"path": "README.md",
"chars": 32709,
"preview": "<!-- # MEDIGAN -->\n<!--  -->\n\n\n[![License]"
},
{
"path": "config/candidates.json",
"chars": 2865,
"preview": "{\n \"00007_DCGAN_CT_spine_inpaint\": {\n \"execution\": {\n \"package_name\": \"bone-cement-injection-planning2\",\n "
},
{
"path": "config/global.json",
"chars": 134161,
"preview": "{\n \"00001_DCGAN_MMG_CALC_ROI\": {\n \"execution\": {\n \"package_name\": \"00001_DCGAN_MMG_CALC_ROI\",\n "
},
{
"path": "docs/Makefile",
"chars": 608,
"preview": "# Minimal makefile for Sphinx documentation\n#\n\n# You can set these variables from the command line.\nSPHINXOPTS =\nSPHI"
},
{
"path": "docs/make.bat",
"chars": 815,
"preview": "@ECHO OFF\r\n\r\npushd %~dp0\r\n\r\nREM Command file for Sphinx documentation\r\n\r\nif \"%SPHINXBUILD%\" == \"\" (\r\n\tset SPHINXBUILD=sp"
},
{
"path": "docs/requirements.txt",
"chars": 198,
"preview": "# File: docs/requirements.txt\n\nsphinx-rtd-theme==1.0.0\nSphinx==4.5.0\nsphinx-automodapi==0.14.1\ntqdm==4.64.0\nrequests==2."
},
{
"path": "docs/source/adding_models.rst",
"chars": 14346,
"preview": "Model Contributions\n=====================\n\nWe are happy that you are considering contributing your model to `medigan`.\nT"
},
{
"path": "docs/source/api/medigan.config_manager.ConfigManager.rst",
"chars": 610,
"preview": "ConfigManager\n=============\n\n.. currentmodule:: medigan.config_manager\n\n.. autoclass:: ConfigManager\n :show-inheritanc"
},
{
"path": "docs/source/api/medigan.contribute_model.model_contributor.ModelContributor.rst",
"chars": 1147,
"preview": "ModelContributor\n================\n\n.. currentmodule:: medigan.contribute_model.model_contributor\n\n.. autoclass:: ModelCo"
},
{
"path": "docs/source/api/medigan.contribute_model.rst",
"chars": 1132,
"preview": "medigan.contribute\\_model package\n=================================\n\nSubmodules\n----------\n\nmedigan.contribute\\_model.ba"
},
{
"path": "docs/source/api/medigan.execute_model.model_executor.ModelExecutor.rst",
"chars": 380,
"preview": "ModelExecutor\n=============\n\n.. currentmodule:: medigan.execute_model.model_executor\n\n.. autoclass:: ModelExecutor\n :s"
},
{
"path": "docs/source/api/medigan.execute_model.rst",
"chars": 861,
"preview": "medigan.execute\\_model package\n==============================\n\nSubmodules\n----------\n\nmedigan.execute\\_model.install\\_mo"
},
{
"path": "docs/source/api/medigan.generators.Generators.rst",
"chars": 2781,
"preview": "Generators\n==========\n\n.. currentmodule:: medigan.generators\n\n.. autoclass:: Generators\n :show-inheritance:\n\n .. rub"
},
{
"path": "docs/source/api/medigan.model_visualizer.ModelVisualizer.rst",
"chars": 286,
"preview": "ModelVisualizer\n===============\n\n.. currentmodule:: medigan.model_visualizer\n\n.. autoclass:: ModelVisualizer\n :show-in"
},
{
"path": "docs/source/api/medigan.rst",
"chars": 1174,
"preview": "medigan package\n===============\n\nSubpackages\n-----------\n\n.. toctree::\n :maxdepth: 4\n\n medigan.contribute_model\n m"
},
{
"path": "docs/source/api/medigan.select_model.model_selector.ModelSelector.rst",
"chars": 1075,
"preview": "ModelSelector\n=============\n\n.. currentmodule:: medigan.select_model.model_selector\n\n.. autoclass:: ModelSelector\n :sh"
},
{
"path": "docs/source/api/medigan.select_model.rst",
"chars": 822,
"preview": "medigan.select\\_model package\n=============================\n\nSubmodules\n----------\n\nmedigan.select\\_model.matched\\_entry"
},
{
"path": "docs/source/api/modules.rst",
"chars": 50,
"preview": "src\n===\n\n.. toctree::\n :maxdepth: 4\n\n medigan\n"
},
{
"path": "docs/source/code_doc.rst",
"chars": 95,
"preview": "Full Code Documentation\n=========================\n\n.. toctree::\n :maxdepth: 5\n\n api/medigan"
},
{
"path": "docs/source/code_examples.rst",
"chars": 3667,
"preview": "Code Examples\n==============\n\n.. contents:: Table of Contents\n\nInstall\n__________________________\nInstall `medigan` libr"
},
{
"path": "docs/source/conf.py",
"chars": 6038,
"preview": "# -*- coding: utf-8 -*-\n#\n# Configuration file for the Sphinx documentation builder.\n#\n# This file does only contain a s"
},
{
"path": "docs/source/description.rst",
"chars": 2989,
"preview": "Description\n==============\n\nWelcome to `medigan`: **medi**\\ cal **g**\\ enerative (\\ **a**\\ dversarial) **n**\\ etworks\n\n"
},
{
"path": "docs/source/index.rst",
"chars": 1229,
"preview": "\nGetting started\n=========================\nWelcome to `medigan`: **medi**\\ cal **g**\\ enerative (\\ **a**\\ dversarial) *"
},
{
"path": "docs/source/model_documentation.md",
"chars": 51575,
"preview": "\n\n## 00001_DCGAN_MMG_CALC_ROI\n\nDCGAN Model for Mammogram Calcification Region of Interest Generation (Trained on INbreas"
},
{
"path": "docs/source/models.rst",
"chars": 1149,
"preview": "Generative Models\n=======================\n\nThis section provides an overview of the generative models in `medigan`.\n\nFin"
},
{
"path": "docs/source/modules_overview.rst",
"chars": 795,
"preview": "Modules Overview\n=============\n\n.. contents:: Table of Contents\n :depth: 2\n\nGenerators\n__________________________\n.. a"
},
{
"path": "docs/source/tests.rst",
"chars": 5725,
"preview": "Tests\n==============\n\n.. contents:: Table of Contents\n\nAutomated continuous integration (CI) tests (`GitHub actions <htt"
},
{
"path": "examples/tutorial.ipynb",
"chars": 6096,
"preview": "{\n \"cells\": [\n {\n \"cell_type\": \"markdown\",\n \"metadata\": {},\n \"source\": [\n \"# MEDIGAN Quick start\\n\",\n \"Quic"
},
{
"path": "models/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "pyproject.toml",
"chars": 100,
"preview": "[build-system]\nrequires = [\"setuptools\", \"wheel\"]\nbuild-backend = \"setuptools.build_meta:__legacy__\""
},
{
"path": "setup.py",
"chars": 999,
"preview": "# coding: utf-8\nimport setuptools\n\nwith open(\"README.md\", \"r\") as fh:\n long_description = fh.read()\n\nsetuptools.setup"
},
{
"path": "src/medigan/__init__.py",
"chars": 515,
"preview": "# -*- coding: utf-8 -*-\n# ! /usr/bin/env python\n\"\"\" `medigan` is a modular Python library for automating synthetic datas"
},
{
"path": "src/medigan/config_manager.py",
"chars": 15444,
"preview": "# -*- coding: utf-8 -*-\n# ! /usr/bin/env python\n\"\"\" Config manager class that downloads, ingests, parses, and prepares t"
},
{
"path": "src/medigan/constants.py",
"chars": 7855,
"preview": "# -*- coding: utf-8 -*-\n# ! /usr/bin/env python\n\"\"\" Global constants of the medigan library \"\"\"\n\n\"\"\" Folder path that wi"
},
{
"path": "src/medigan/contribute_model/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "src/medigan/contribute_model/base_model_uploader.py",
"chars": 1118,
"preview": "# -*- coding: utf-8 -*-\n# ! /usr/bin/env python\n\"\"\"Base Model uploader class that uploads models to medigan associated d"
},
{
"path": "src/medigan/contribute_model/github_model_uploader.py",
"chars": 6947,
"preview": "# -*- coding: utf-8 -*-\n# ! /usr/bin/env python\n\"\"\"Github Model uploader class that uploads the metadata of a new model "
},
{
"path": "src/medigan/contribute_model/model_contributor.py",
"chars": 25454,
"preview": "# -*- coding: utf-8 -*-\n# ! /usr/bin/env python\n\"\"\"Model contributor class that tests models, creates metadata entries, "
},
{
"path": "src/medigan/contribute_model/zenodo_model_uploader.py",
"chars": 14369,
"preview": "# -*- coding: utf-8 -*-\n# ! /usr/bin/env python\n\"\"\"Zenodo Model uploader class that uploads models to medigan associated"
},
{
"path": "src/medigan/exceptions.py",
"chars": 247,
"preview": "# -*- coding: utf-8 -*-\n#! /usr/bin/env python\n\"\"\"Custom exceptions to handle module specific error and facilitate bug f"
},
{
"path": "src/medigan/execute_model/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "src/medigan/execute_model/install_model_dependencies.py",
"chars": 1945,
"preview": "# -*- coding: utf-8 -*-\n# ! /usr/bin/env python\n\"\"\" Functionality for automated installation of a model's python package"
},
{
"path": "src/medigan/execute_model/model_executor.py",
"chars": 22174,
"preview": "# -*- coding: utf-8 -*-\n# ! /usr/bin/env python\n\"\"\"Model executor class that downloads models, loads them as python pack"
},
{
"path": "src/medigan/execute_model/synthetic_dataset.py",
"chars": 3048,
"preview": "# -*- coding: utf-8 -*-\n# ! /usr/bin/env python\n\"\"\" `SyntheticDataset` allows to return a generative model as torch data"
},
{
"path": "src/medigan/generators.py",
"chars": 61891,
"preview": "# -*- coding: utf-8 -*-\n# ! /usr/bin/env python\n\"\"\" Base class providing user-library interaction methods for config man"
},
{
"path": "src/medigan/model_visualizer.py",
"chars": 10212,
"preview": "# -*- coding: utf-8 -*-\n# ! /usr/bin/env python\n\"\"\" `ModelVisualizer` class providing visualizing corresponding model in"
},
{
"path": "src/medigan/select_model/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "src/medigan/select_model/matched_entry.py",
"chars": 1724,
"preview": "# -*- coding: utf-8 -*-\n# ! /usr/bin/env python\n\"\"\"MatchedEntry class that represents one match of a key value pair of a"
},
{
"path": "src/medigan/select_model/model_match_candidate.py",
"chars": 6680,
"preview": "# -*- coding: utf-8 -*-\n# ! /usr/bin/env python\n\"\"\"ModelMatchCandidate class that holds data to evaluate if a generative"
},
{
"path": "src/medigan/select_model/model_selector.py",
"chars": 24765,
"preview": "# -*- coding: utf-8 -*-\n# ! /usr/bin/env python\n\"\"\" Model selection class that describes, finds, compares, and ranks gen"
},
{
"path": "src/medigan/utils.py",
"chars": 17395,
"preview": "# -*- coding: utf-8 -*-\n# ! /usr/bin/env python\n\"\"\" `Utils` class providing generalized reusable functions for I/O, pars"
},
{
"path": "templates/examples/500.pt.txt",
"chars": 109,
"preview": "Download 500.pt file from: https://drive.google.com/file/d/1C9vVPymsKJ5i5gpwQM6cpX0y1G89vcpk/view?usp=sharing"
},
{
"path": "templates/examples/LICENSE",
"chars": 1087,
"preview": "MIT License\n\nCopyright (c) 2021 Richard Osuala, Noussair Lazrak\n\nPermission is hereby granted, free of charge, to any pe"
},
{
"path": "templates/examples/__init__.py",
"chars": 9852,
"preview": "\"\"\"\nauthors: Richard Osuala, Zuzanna Szafranowska\nBCN-AIM 2021\n\"\"\"\n\nimport logging\nimport os\nfrom pathlib import Path\n\ni"
},
{
"path": "templates/examples/metadata.json",
"chars": 3702,
"preview": "{\n \"00005_DCGAN_MMG_MASS_ROI\": {\n \"execution\": {\n \"package_name\": \"MMG_MASS_BCDR_DCGAN\",\n \"package_link\": "
},
{
"path": "templates/examples/requirements.txt",
"chars": 42,
"preview": "numpy\ntorch\nopencv-contrib-python-headless"
},
{
"path": "templates/examples/test.sh",
"chars": 840,
"preview": "#! /bin/bash\n\necho \"Running a test: Generate method of this medigan model module.\"\n\necho \"If not done already, please do"
},
{
"path": "templates/raw_examples/LICENSE",
"chars": 18,
"preview": "copy license here\n"
},
{
"path": "templates/raw_examples/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "templates/raw_examples/metadata.json",
"chars": 2076,
"preview": "{\n \"MODEL_ID\": {\n \"execution\": {\n \"package_name\": null,\n \"package_link\": null,\n \"model_name\": null,\n "
},
{
"path": "templates/raw_examples/model.pt",
"chars": 0,
"preview": ""
},
{
"path": "templates/template.json",
"chars": 2063,
"preview": "{\n \"MODEL_ID\": {\n \"execution\": {\n \"package_name\": \"\",\n \"package_link\": \"\",\n \"model_name\": \"\",\n \""
},
{
"path": "tests/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "tests/fid.py",
"chars": 6061,
"preview": "\"\"\"\nCalculates the Frechet Inception Distance between two distributions, using chosen feature extractor model.\n\nRadImage"
},
{
"path": "tests/model_contribution_test_manual.py",
"chars": 4219,
"preview": "# -*- coding: utf-8 -*-\n# ! /usr/bin/env python\n\"\"\" script for quick local testing if a new model can be added and works"
},
{
"path": "tests/model_integration_test_manual.py",
"chars": 1477,
"preview": "# -*- coding: utf-8 -*-\n# ! /usr/bin/env python\n\"\"\" script for quick local testing if a model works inside medigan.\"\"\"\n#"
},
{
"path": "tests/test_model_executor.py",
"chars": 17960,
"preview": "# -*- coding: utf-8 -*-\n# ! /usr/bin/env python\n\"\"\" main test script to test the primary functions/classes/methods. \"\"\"\n"
},
{
"path": "tests/test_model_selector.py",
"chars": 6679,
"preview": "# -*- coding: utf-8 -*-\n# ! /usr/bin/env python\n\"\"\" main test script to test the primary functions/classes/methods. \"\"\"\n"
}
]
About this extraction
This page contains the full source code of the RichardObi/medigan GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 74 files (551.0 KB), approximately 125.0k tokens, and a symbol index with 206 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.