MHubAI / models

Stores the MHub models dockerfiles and scripts.
MIT License
8 stars 16 forks source link

IDC - Implementing the nnUNet Task024 Whole Prostate Gland MR (T2 only) Model #70

Closed ccosmin97 closed 7 months ago

ccosmin97 commented 10 months ago

This is my implementation of the nnUNet Whole Prostate MR (Task024) model, trained on Promise12 challenge data.

The model is single-modality, namely T2, and segments the whole prostate gland.

Building and testing of the model dockerfile is next.

fedorov commented 9 months ago

@LennyN95 we were just discussing this here, it should not be very difficult to have a setup where test data is specified in a config file, we have a utility script that pulls those files from IDC, and run a github action on the PR to build the image and run the tests. As long as the model can run on CPU, it should be quite helpful, since it will be fully automatic. As @ccosmin97 points out, there may be not enough RAM, but maybe this is worth a try? And even if we cannot use GA, this framework can be helpful to simplify regression testing of a given model. Maybe we can discuss at the next meeting.

LennyN95 commented 8 months ago

it should not be very difficult to have a setup where test data is specified in a config file, we have a utility script that pulls those files from IDC, and run a github action on the PR to build the image and run the tests

@fedorov I'm working on a modular pipeline that automates these tasks. I can demonstrate the approach in the next meeting, feedback & suggestions are welcome!

ccosmin97 commented 8 months ago

@LennyN95 I noticed that the checks fail under the last commit, any idea which file causes the issue? is it the meta.json? maybe the "tables" formatting?

LennyN95 commented 8 months ago

I now enabled error-messages for unexpected errors: Expecting property name enclosed in double quotes: line 97 column 17 (char 4076).

Check line 97, the trailing comma might be the problem ;)

ccosmin97 commented 8 months ago

@LennyN95 Here are the test results:

Output segmentation looks fine by me. /test

sample:
  idcv: Data Release 17.0 December 04, 2023
  data:
    - SeriesInstanceUID: 1.3.6.1.4.1.14519.5.2.1.133402083824451909801205388628359333258
        aws: s3://idc-open-data/a4763cd6-341d-4659-bb33-73775e12a0c3
        path: test_data/
reference:
  url: https://www.dropbox.com/scl/fi/zzat1aiorbrqo4p8y5u2o/output.zip?rlkey=5fg38ey0i8986spoj7h2svond&dl=0
  input_data_url: https://www.dropbox.com/scl/fi/druwcayoohb1n5hp57u8u/input.zip?rlkey=t3ju42511h22jrycqh2246lk0&dl=0
notes:
This model takes a single-modality input, namely T2 sequence. Steps below are included to show how to create the input model case folder : 
mkdir -p test_data/
s5cmd --no-sign-request --endpoint-url https://s3.amazonaws.com cp 's3://idc-open-data/a4763cd6-341d-4659-bb33-73775e12a0c3/*' test_data/

mkdir -p out_data

docker build --no-cache --build-arg MHUB_MODELS_REPO=https://github.com/ccosmin97/models.git::nnUNet_task024_promise -t dev/nnunet_task024_promise:latest

docker run -it --rm  -v /home/exouser/Documents/mhub_task024_nnunet/test_dir/test_data/:/app/data/input_data:ro \
-v /home/exouser/Documents/mhub_task024_nnunet/test_dir/out_data/:/app/data/output_data \
dev/nnunet_task024_promise:latest --debug

image

LennyN95 commented 7 months ago

/test

sample:
  idc_version: 17.0
  data:
  - SeriesInstanceUID: 1.3.6.1.4.1.14519.5.2.1.133402083824451909801205388628359333258
    aws_url: s3://idc-open-data/a4763cd6-341d-4659-bb33-73775e12a0c3/*
    path: dicom

reference:
  url: https://www.dropbox.com/scl/fi/zzat1aiorbrqo4p8y5u2o/output.zip?rlkey=5fg38ey0i8986spoj7h2svond&dl=0

Test Results (24.02.28_12.56.22_MnXlLNinpg) ```yaml id: c6fc6832-010e-4143-b500-c20003e90f1a date: '2024-02-28 13:02:21' checked_files: - file: nnunet_mr_prostate.seg.dcm path: /app/test/src/1.3.6.1.4.1.14519.5.2.1.133402083824451909801205388628359333258/nnunet_mr_prostate.seg.dcm checks: - checker: DicomsegContentCheck notes: - label: Segment Count description: The number of segments identified in the inspected dicomseg file. info: 1 summary: files_missing: 0 files_extra: 0 checks: DicomsegContentCheck: files: 1 conclusion: true ```