https://github.com/codingfisch/niftiai
Train neural nets on 3D images (e.g. MRIs) 🧠
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (8.0%) to scientific vocabulary
Keywords
Repository
Train neural nets on 3D images (e.g. MRIs) 🧠
Basic Info
Statistics
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Topics
Metadata Files
README.md
niftiai
niftiai aims to be the easiest framework to train neural nets on 3D images (often NIfTIs), using
fastaieasy neural net trainingniftivieweasy 3D image viewingmriaugeasy 3D image (+MRI-specific) augmentation
pip install niftiai to simplify your code and skip complex frameworks like MONAI and torchio!
Quick Start 🚀
Study the beginner tutorial to understand how 15 lines of code can train a neural net to classify 🧠 MRIs...
```python import openneuro as on from deepmriprep import runpreprocess from fastai.basics import pd, accuracy, CategoryBlock from niftiai import cnnlearner3d, Scale, ImageDataLoaders3d DATA_DIR = 'data/ds000005'
on.download(dataset=DATADIR[-8:], targetdir=DATADIR, include='/anat/T1w.*') df = runpreprocess(bidsdir=DATADIR, outputs=['brain']) table = pd.readtable(f'{DATADIR}/participants.tsv') df = pd.concat([table, df.resetindex()], axis=1) dls = ImageDataLoaders3d.fromdf(df, fncol='brain', itemtfms=[Scale()], labelcol='sex', yblock=CategoryBlock()) learner = cnnlearner3d(dls, metrics=[accuracy]) learner.fit(3) learner.showresults() # add plt.show() if not in Jupyter notebook ```
...and the intermediate tutorial to see how 12 lines of code train a UNet to do MR image segmentation 🤯
```python import openneuro as on from deepmriprep import runpreprocess from niftiai import unetlearner3d, augtransforms3d, Scale, SegmentationDataLoaders3d DATADIR = 'data/ds000001'
on.download(dataset=DATADIR[-8:], targetdir=DATADIR, include='/anat/T1w.*') df = runpreprocess(bidsdir=DATADIR, outputs=['mask']).resetindex() augtfms = augtransforms3d() dls = SegmentationDataLoaders3d.fromdf(df, fncol='t1', itemtfms=Scale(), labelcol='mask', batchtfms=augtfms) learner = unetlearner3d(dls, cout=2, linknet=True) learner.fit(3, lr=1e-2) learner.showresults() # add plt.show() if not in Jupyter notebook ```
👩💻 Also study the fastai tutorials to understand the underlying framework that is
... approachable and rapidly productive, while also being deeply hackable...
and discover its wide range of features like
- mixed precision training for reduced VRAM usage via
Learner.to_fp16()andLearner.to_bf16()python learner = learner.to_fp16() # to enable FP16, use this line before training learner = learner.to_bf16() # to enable BF16, use this line before training - 1cycle scheduled training for faster convergence via
Learner.fit_one_cycle()python from fastai.callback.all import * ... learner.fit_one_cycle(...) # instead of learner.fit(...) to enable 1cycle scheduled training - distributed training to use multiple GPUs via
acceleratepython from fastai.distributed import * ... with learner.distrib_ctx(): learn.fit(...) # and run with "accelerate launch ..." - ...so much more...
Owner
- Login: codingfisch
- Kind: user
- Repositories: 1
- Profile: https://github.com/codingfisch
GitHub Events
Total
- Watch event: 1
- Push event: 20
- Create event: 3
Last Year
- Watch event: 1
- Push event: 20
- Create event: 3
Issues and Pull Requests
Last synced: 7 months ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 20 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 5
- Total maintainers: 1
pypi.org: niftiai
Train neural nets on 3D images (e.g. MRIs) 🧠
- Homepage: https://github.com/codingfisch/niftiai
- Documentation: https://niftiai.readthedocs.io/
- License: MIT
-
Latest release: 0.2.0
published 8 months ago