Skip to main content

Agentic Medical Deep Learning Engineer

Project description

Med-DLE: Agentic Medical Deep Learning Engineer

MedDLE is designed to be a codegen agentic system for medical deep learning tasks.

Quick Start

Setup environment

  1. we recommand use conda to create a virtual environment:
conda create --name meddle python=3.11 
conda activate meddle
  1. Then install meddle via:
pip install -r requirements.txt
pip install -e .

optional: use uv to speedup installation

pip install uv
uv pip install -r requirements.txt
uv pip install -e .
  1. Get data from link and move the data into med_dl_tasks

  2. remember to set up your private api key of OPENAI/ANTROPIC/OPENROUNTER

export OPENAI_BASE_URL="<your base url>" # (e.g. https://api.openai.com/v1)
export OPENAI_API_KEY="<your key>"

Basic codegen

Use bash run.sh to run the demo experiment.

MONAI-enhanced codegen

We highlight MONAI as a helpful candidate for medical DL codegen with Prompt/RAG mode:

Prompt mode

meddle data_dir="meddle/med_dl_tasks/odir5k_2d_mlc" exp_name="monai_prompt-odir5k_2d_mlc"\
     goal="Classify 2D Medical images into different categories in a multi-label setting" \
     eval="Use the average of kappa score, F-1 score, and AUC value metric between the predicted and ground-truth values." \
     agent.steps=20 agent.force_monai_with_prompt=true 

RAG mode

1. Create the knowledge database

Firstly, download the persisted database into meddle/monai_rag from link. Or you can create the db with this cmd:

cd meddle/monai_rag
python create_monai_rag_db.py

You could use python -m meddle.monai_rag.query_rag_db to check whether the creation succeeds.

2. enable the feature in agent

Here's some example:

meddle data_dir="meddle/med_dl_tasks/odir5k_2d_mlc" exp_name="monai_prompt_kb-odir5k_2d_mlc"\
     goal="Classify 2D Medical images into different categories in a multi-label setting" \
     eval="Use the average of kappa score, F-1 score, and AUC value metric between the predicted and ground-truth values." \
     agent.steps=20 agent.force_monai_with_prompt=false agent.enable_monai_knowledge_base=true

meddle data_dir="meddle/med_dl_tasks/odir5k_2d_mlc" exp_name="monai_prompt_kb_q2d-odir5k_2d_mlc"\
     goal="Classify 2D Medical images into different categories in a multi-label setting" \
     eval="Use the average of kappa score, F-1 score, and AUC value metric between the predicted and ground-truth values." \
     agent.steps=20 agent.force_monai_with_prompt=false agent.enable_monai_knowledge_base=true agent.enable_query2doc=true

🙏 Acknowledgement

  • We thank all medical workers and dataset owners for making public datasets available to the community.
  • Thanks to the open-source of the following projects, our code is developed based on their contributions:

Project details


Download files

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

Source Distribution

meddle-0.1.0.tar.gz (40.3 kB view details)

Uploaded Source

Built Distribution

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

meddle-0.1.0-py3-none-any.whl (46.4 kB view details)

Uploaded Python 3

File details

Details for the file meddle-0.1.0.tar.gz.

File metadata

  • Download URL: meddle-0.1.0.tar.gz
  • Upload date:
  • Size: 40.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for meddle-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2f4ffa4bfd0295d5bbd96aec55996063dfc18e9f57bb49378b3778d9df710f6c
MD5 3fb0d99171e5f7de41989ce23d145c43
BLAKE2b-256 2399e1619e7d2a11ee6d9cb258c535e077c37c6b402e95a2df46cc3bf217280b

See more details on using hashes here.

File details

Details for the file meddle-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: meddle-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 46.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for meddle-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4794c2155462fc1307d77411a9b21cb4fd0e5edbb8ce4ed03902b00a30d09a04
MD5 c2a8326609da48ad144ba906a19363b3
BLAKE2b-256 0b7370edbd19b2d4312ff023986bf930aabb657f99063cbd634dde868695791a

See more details on using hashes here.

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