https://github.com/codingfisch/niftiai

Train neural nets on 3D images (e.g. MRIs) 🧠

https://github.com/codingfisch/niftiai

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

brain-imaging brain-mri colab deep-learning fastai gpu imaging machine-learning medical-imaging neuroimaging nifti python pytorch
Last synced: 5 months ago · JSON representation

Repository

Train neural nets on 3D images (e.g. MRIs) 🧠

Basic Info
  • Host: GitHub
  • Owner: codingfisch
  • License: mit
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 57.6 KB
Statistics
  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
brain-imaging brain-mri colab deep-learning fastai gpu imaging machine-learning medical-imaging neuroimaging nifti python pytorch
Created about 1 year ago · Last pushed 8 months ago
Metadata Files
Readme License

README.md

niftiai

niftiai aims to be the easiest framework to train neural nets on 3D images (often NIfTIs), using

  • fastai easy neural net training
  • niftiview easy 3D image viewing
  • mriaug easy 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() and Learner.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 accelerate python from fastai.distributed import * ... with learner.distrib_ctx(): learn.fit(...) # and run with "accelerate launch ..."
  • ...so much more...

Owner

  • Login: codingfisch
  • Kind: user

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) 🧠

  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 20 Last month
Rankings
Dependent packages count: 9.6%
Average: 36.5%
Dependent repos count: 63.3%
Maintainers (1)
Last synced: 6 months ago