Skip to main content

This is the MML toolkit, targeting lifelong/continual/meta learning in Surgical Data Science.

Project description

Medical Meta Learner

mml_logo.png

(Please note: badges are not yet finalized and are currently prepared for GitHub transition)

docs status build status pypi Badge license docker status
Python pytorch lightning hydra
Ruff isort CodeCov Pylint


About

mml is a research-oriented Python package which aims to provide an easy and scalable way of performing deep learning on multiple image tasks (see Meta-Learning).

It features:

  • a clear methodology to store, load, refer, modify and combine RGB image datasets across task types (classification, segmentation, ...)
  • a highly configurable CLI for the full deep learning pipeline
  • a dedicated file management system, capable of continuing aborted experiments, reuse previous results and parallelize runs
  • an api for interactive pre- and post-experiment exploration
  • smooth integration of latest deep learning libraries (lightning, hydra, optuna, ...)
  • easy expandability via plugins or directly hooking into runtime objects via scripts or notebooks
  • good documentation, broad testing and ambitious goals

Please read the official documentation page for more. Main author: Patrick Godau, Deutsches Krebsforschungszentrum (DKFZ) Heidelberg

Division of Intelligent Medical Systems

Contact: patrick.godau@dkfz-heidelberg.de

Setup

Create a virtual environment (e.g. using conda) as follows:

conda create -n mml python=3.10
conda activate mml

Now create a gitlab access token via this link, everything is already pre-filled, simply create and copy the token. Afterward within your projects virtual environment you can call

pip install --index-url https://mmlToken:<personal_access_token>@git.dkfz.de/api/v4/projects/89/packages/pypi/simple mml-core

and replace <personal_access_token> with your actual token. You may add extras appended to mml as described below.

plugins

Plugins extend mml functionality. See here for a list of available plugins. Use the previous pip and replace mml-core with one of the plugins to install.

local environment variables

mml relies on a mml.env file for relevant environment variables. There are multiple possibilities to locate this:

  • within your project folder (e.g. for separation of mml installations),
  • within your home folder or similar (e.g. for shared mml configs across installations)

You can use mml-env-setup from the command line at the location you want to place your mml.env file:

mml-env-setup

Now you only need to pinpoint mml to your mml.env file. This can be done via an environment variable MML_ENV_PATH that needs to be present in the environment before starting MML. If you use conda this simplifies to

conda env config vars set MML_ENV_PATH=/path/to/your/mml.env
# if your file is located at the current working directory, you may instead use
# pwd | conda env config vars set MML_ENV_PATH=$(</dev/stdin)/mml.env
# either way this requires re-activation of environment
conda activate mml
# test if the path is set
echo $MML_ENV_PATH

You should see your path printed - if yes, continue providing the actual variables:

  • open mml.env in your preferred editor
  • set MML_DATA_PATH to the path you want to store downloaded or generated datasets later on
  • set MML_RESULTS_PATH to be the location you want to save your experiments in later on (plots, trained network parameters, caluclated distances, etc.).
  • set MML_LOCAL_WORKERS to be the number of usable (virtual) cpu cores
  • all other variables are optional for now

Confirm installation

You can confirm that mml was installed successful via running mml in the terminal, which should result in a display of an MML logo.

License

This library is licensed under the permissive MIT license, which is fully compatible with both academic and commercial applications.

Copyright German Cancer Research Center (DKFZ) and contributors. Please make sure that your usage of this code is in compliance with its license. This project is/was supported by

If you use this code in a research paper, please cite:

@InProceedings{Godau2021TaskF,
    author="Godau, Patrick and Maier-Hein, Lena",
    editor="de Bruijne, Marleen and Cattin, Philippe C. and Cotin, St{\'e}phane and Padoy, Nicolas and Speidel, Stefanie and Zheng, Yefeng and Essert, Caroline",
    title="Task Fingerprinting for Meta Learning inBiomedical Image Analysis",
    booktitle="Medical Image Computing and Computer Assisted Intervention -- MICCAI 2021",
    year="2021",
    publisher="Springer International Publishing",
    pages="436--446"
}

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mml_core-1.0.1.tar.gz (448.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mml_core-1.0.1-py3-none-any.whl (538.0 kB view details)

Uploaded Python 3

File details

Details for the file mml_core-1.0.1.tar.gz.

File metadata

  • Download URL: mml_core-1.0.1.tar.gz
  • Upload date:
  • Size: 448.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for mml_core-1.0.1.tar.gz
Algorithm Hash digest
SHA256 6908a87d8bc599fcccad672572ed35a98d9b1111a65f5f9604a5958a4f7b907c
MD5 c1c80e0606f3fd4063d1cf32f1f56101
BLAKE2b-256 24dce5ea87b1de3cf637dc3dcafee0eef1d40e1a397b48f59d97e7e06eb98af2

See more details on using hashes here.

Provenance

The following attestation bundles were made for mml_core-1.0.1.tar.gz:

Publisher: publish.yml on IMSY-DKFZ/mml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mml_core-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: mml_core-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 538.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for mml_core-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9982b00ab9df56b7cfa7d8520582d9c483ff0e1f8fbf160533cf94c094c7e88c
MD5 b7a4192c53eb35cf5338dbcfa0d89d4c
BLAKE2b-256 322c50c98047d9f2448261daed7e707c92ecf0b7c5b61fe807578308802a48fb

See more details on using hashes here.

Provenance

The following attestation bundles were made for mml_core-1.0.1-py3-none-any.whl:

Publisher: publish.yml on IMSY-DKFZ/mml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page