Deep learning library to encode multiple brain images and other electronic health record data in disease detection.
Project description
Multi-Input Medical Image Machine Learning Toolkit
The Multi-Input Medical Image Machine Learning Toolkit (MultiMedImageML) is a library of Pytorch functions that can encode multiple 3D images (designed specifically for brain images) and offer a single- or multi-label output, such as a disease detection.
Thus, with a dataset of brain images and labels, you can train a model to predict dementia or multiple sclerosis from multiple input brain images.
To install Multi Med Image ML, simply type into a standard UNIX terminal
pip install multi-med-image-ml
Overview
The core deep learning architecture is a Pytorch model that can take in variable numbers of 3D images (between one and 14 by default), then encodes them into a numerical vector and, through an adversarial training process, creates an intermediate representation that contains information about disease biomarkers but not confounds, like patient age and scanning site.
The confound regression process essentially disguises the intermediary representation to have disease biomarker features while imitating the confounding features of other groups.
Getting Started
See the Documentation.
Datasets
This may be used with either public benchmark datasets of brain images or internal hospital records, so long as they're represented as DICOM or NIFTI images. It was largely tested on ADNI and data internal to MGH. If they're represented as DICOM images, they are converted to NIFTI with metadata represented as a JSON file using dcm2niix. They may be further converted to NPY files, which are resized to a specific dimension, with the metadata represented in a pandas dataframe.
The MedImageLoader builds up this representation automatically, but it is space-intensive to do so.
Data may be represented with a folder structure.
.
└── control
├── 941_S_7051
│ ├── Axial_3TE_T2_STAR
│ │ └── 2022-03-07_11_03_03.0
│ │ ├── I1553008
│ │ │ ├── I1553008_Axial_3TE_T2_STAR_20220307110304_5_e3_ph.json
│ │ │ └── I1553008_Axial_3TE_T2_STAR_20220307110304_5_e3_ph.nii.gz
│ │ └── I1553014
│ │ ├── I1553014_Axial_3TE_T2_STAR_20220307110304_5_ph.json
│ │ └── I1553014_Axial_3TE_T2_STAR_20220307110304_5_ph.nii.gz
│ ├── HighResHippocampus
│ │ └── 2022-03-07_11_03_03.0
│ │ └── I1553013
│ │ ├── I1553013_HighResHippocampus_20220307110304_11.json
│ │ └── I1553013_HighResHippocampus_20220307110304_11.nii.gz
│ └── Sagittal_3D_FLAIR
│ └── 2022-03-07_11_03_03.0
│ └── I1553012
│ ├── I1553012_Sagittal_3D_FLAIR_20220307110304_3.json
│ └── I1553012_Sagittal_3D_FLAIR_20220307110304_3.nii.gz
└── 941_S_7087
├── Axial_3D_PASL__Eyes_Open_
│ └── 2022-06-15_14_38_03.0
│ └── I1591322
│ ├── I1591322_Axial_3D_PASL_(Eyes_Open)_20220615143803_6.json
│ └── I1591322_Axial_3D_PASL_(Eyes_Open)_20220615143803_6.nii.gz
└── Perfusion_Weighted
└── 2022-06-15_14_38_03.0
└── I1591323
├── I1591323_Axial_3D_PASL_(Eyes_Open)_20220615143803_7.json
└── I1591323_Axial_3D_PASL_(Eyes_Open)_20220615143803_7.nii.gz
In the case of the above folder structure, "/path/to/control" may simply be input into the MedImageLoader function. For multiple labels, "/path/to/test", "/path/to/test2", and so on, may also be input.
Labels and Confounds
MIMIM enables for the representation of labels to classify by and confounds to regress. Confounds are represented as strings and labels can be represented as either strings or the input folder structure to MedImageLoader.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file multi_med_image_ml-1.0.1.tar.gz.
File metadata
- Download URL: multi_med_image_ml-1.0.1.tar.gz
- Upload date:
- Size: 4.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4cb8b32d8828c7d6f0027f9bc0009008f1ebc002bfe396146dd05e8ccc8b84b1
|
|
| MD5 |
378e05228f7b7ea13a34d5811f044fc5
|
|
| BLAKE2b-256 |
cb9ff919cb27a106a97c4495beea5952e8cac5c154400e6483c40982d72b31fc
|
Provenance
The following attestation bundles were made for multi_med_image_ml-1.0.1.tar.gz:
Publisher:
publish-to-pypi.yml on mleming/MultiMedImageML
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
multi_med_image_ml-1.0.1.tar.gz -
Subject digest:
4cb8b32d8828c7d6f0027f9bc0009008f1ebc002bfe396146dd05e8ccc8b84b1 - Sigstore transparency entry: 155690675
- Sigstore integration time:
-
Permalink:
mleming/MultiMedImageML@003c4ba0b5d7dc2bf11b61e55dd1e3d85e0d3f6a -
Branch / Tag:
refs/tags/1.0.2 - Owner: https://github.com/mleming
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@003c4ba0b5d7dc2bf11b61e55dd1e3d85e0d3f6a -
Trigger Event:
push
-
Statement type:
File details
Details for the file multi_med_image_ml-1.0.1-py3-none-any.whl.
File metadata
- Download URL: multi_med_image_ml-1.0.1-py3-none-any.whl
- Upload date:
- Size: 739.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3237ff560ef9350a06e15b3aaec1a8016e39cca79cfcbaaa6ab8955e5d608d6e
|
|
| MD5 |
c17e86b3278e50f61f249c1189ca5233
|
|
| BLAKE2b-256 |
9a52711ffbea58ad83beb7c85fa4b52aea783101c8aad647f0a42297984c0b3e
|
Provenance
The following attestation bundles were made for multi_med_image_ml-1.0.1-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on mleming/MultiMedImageML
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
multi_med_image_ml-1.0.1-py3-none-any.whl -
Subject digest:
3237ff560ef9350a06e15b3aaec1a8016e39cca79cfcbaaa6ab8955e5d608d6e - Sigstore transparency entry: 155690676
- Sigstore integration time:
-
Permalink:
mleming/MultiMedImageML@003c4ba0b5d7dc2bf11b61e55dd1e3d85e0d3f6a -
Branch / Tag:
refs/tags/1.0.2 - Owner: https://github.com/mleming
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@003c4ba0b5d7dc2bf11b61e55dd1e3d85e0d3f6a -
Trigger Event:
push
-
Statement type: