-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MHub / GC - Add the GC Tiger challenge winner LB2 model #38
Conversation
…sions to torch install
…fixed model weights install, updated pipelines
…s call from the pipeline * Fix for the import issue: * Implemented a CLI for the Tiger lb2 runner that takes an input TIFF path and output JSON file path * Integrated the CLI inside the TigerLB2Runner as a subprocess call to the CLI through a fresh Python interpreter * Cleaned the Dockerfile some more * Caveats: * Because of the fix the extra run script for the tiff_pipeline became redundant, can be called directly from the tiff_pipeline.yml through a call of mhubio.run * For the main pipeline the run.py is still required since the TiffPanImgConverter is not automatically picked up * Updated the PanImgConverters, since the returned UnconsumedFilesException e.errors were renamed to e.file_errors
Pushed a fix for the model import issue as suggested by @LennyN95 to this PR. |
Can we use ValueOutput+ReportExporter for this algorithm? |
Dockerfile - fixed to commit for tiger_challenge repo - updated MHubAI/models clone stub - updated entrypoint pipeline default.yml - updated the outputs - use the TiffConverter - Added reportexporter template runner: - Added TIL Score as ValueOutput - Confirmed data output - Added/updated comments removed: - custom panimg converter classes - run.py script to run the pipeline
…s into m-gc-tiger-lb2
This PR has been cleaned and updated to meet the latest requirements:
@LennyN95 I added a ValueOutput for the TIL score for this algorithm, but when I try to export that value with the ReportExporter it outputs an empty report with:
After doing some in-situ debugging, I found that the following line fails:
Then I found out that
It appears that
@LennyN95 Do you know what is going on here? The latest code update in this PR is the code that I used. I only disabled the ReportExporter in the default.yml for now to make this fully functional, but during testing this was enabled. I got it working with similar code before for other model PRs. It doesn't however seem to be caused by codebase changes, because I tried to revert it to older versions of mhubio up until August 3th, but it still had the same output and error. So I guess it is something else. |
Alright, I got it working, this PR can now use the ReportExporter as requested. Apparently it was a mistake in the last |
/test sample:
idc_version: 17.0
data:
- SeriesInstanceUID: 1.3.6.1.4.1.5962.99.1.1334438926.1589741711.1637717011470.2.0
aws_url: s3://idc-open-data/20ab74ef-080b-4975-adad-7507b7b04cb8/*
path: dicom
reference:
url: https://github.com/MHubAI/models/files/14526578/output.zip Test Results (24.03.13_17.52.53_6VEUMKpYVb)id: 7654bec5-0c56-43b5-82db-cee986e4d663
date: '2024-03-13 18:08:50'
checked_files:
- file: gc_tiger_lb2_til_score.json
path: /app/test/src/1.3.6.1.4.1.5962.99.1.1334438926.1589741711.1637717011470.2.0/gc_tiger_lb2_til_score.json
checks:
- checker: DataFileCheck
findings:
- label: Value similar
description: Value of key 'TIL score' is similar in source file
subpath: TIL score
info:
scale: 1
precision: -1
src: 4
ref: 5
- checker: SizeCheck
summary:
files_missing: 0
files_extra: 0
checks:
DataFileCheck:
files: 1
findings:
Value similar: 1
SizeCheck:
files: 1
conclusion: false |
/review We have implemented the requested changes and updated the meta.json. |
@LennyN95 thanks for checking. Small differences in outcome are to be expected when run on different GPUs due to accumulated small numerical differences. If the results only differ by a few points (something in the range of 1-2 points) this is deemed acceptable for this model as discussed with the challenge organizers. |
@LennyN95 I have created a fork of the source model/algorithm repository here: https://github.com/DIAGNijmegen/tiger_vuno_algorithm. In this fork, I have added the reproducibility fix and added the tumor and stroma segmentation mask to the output. I have uploaded a new output.zip file (which includes the segmentation) and updated the URL in the test above. Please check if everything is in order now. I suspect that the segmentation will be different due to GPU hardware/driver differences. |
Thank you @silvandeleemput. I create this as a new test and reverted the modification to keep the test history clean. Test requests should be edited to correct syntax errors only but not touched once one or more tests were performed (and reported in the test request). |
/test sample:
idc_version: 17.0
data:
- SeriesInstanceUID: 1.3.6.1.4.1.5962.99.1.1334438926.1589741711.1637717011470.2.0
aws_url: s3://idc-open-data/20ab74ef-080b-4975-adad-7507b7b04cb8/*
path: dicom
reference:
url: https://github.com/MHubAI/models/files/15091074/gc_tiger_lb2_output.zip Test Results (24.04.25_08.24.29_0ZZ5RYzDlk)id: fa0fa712-4d2b-4f13-adae-56cc312c4209
date: '2024-04-25 08:42:26'
missing_files:
- 1.3.6.1.4.1.5962.99.1.1334438926.1589741711.1637717011470.2.0/gc_tiger_lb2_segmentation.mha
checked_files:
- file: gc_tiger_lb2_til_score.json
path: /app/test/src/1.3.6.1.4.1.5962.99.1.1334438926.1589741711.1637717011470.2.0/gc_tiger_lb2_til_score.json
checks:
- checker: DataFileCheck
findings:
- label: Value similar
description: Value of key 'TIL score' is similar in source file
subpath: TIL score
info:
scale: 1
precision: -1
src: 4
ref: 5
- checker: SizeCheck
summary:
files_missing: 1
files_extra: 0
checks:
DataFileCheck:
files: 1
findings:
Value similar: 1
SizeCheck:
files: 1
conclusion: false Test Results (24.04.25_14.08.51_xHF1bsAg8N)id: 1c55ef8c-8325-4838-898e-63a7ef2b04fe
date: '2024-04-25 14:32:07'
checked_files:
- file: gc_tiger_lb2_segmentation.mha
path: /app/test/src/1.3.6.1.4.1.5962.99.1.1334438926.1589741711.1637717011470.2.0/gc_tiger_lb2_segmentation.mha
checks:
- checker: ImageFileCheck
notes:
- label: Data Type
description: Data type of the reference image
info: uint8
findings:
- label: Exception
description: An exception occurred during check
info: 'could not convert string to float: '''''
- file: gc_tiger_lb2_til_score.json
path: /app/test/src/1.3.6.1.4.1.5962.99.1.1334438926.1589741711.1637717011470.2.0/gc_tiger_lb2_til_score.json
checks:
- checker: DataFileCheck
findings:
- label: Missing key
description: Key 'TIL score' is missing in source file
subpath: TIL score
- checker: SizeCheck
findings:
- label: Size Difference
description: file size is smaller than reference
info:
src_size: 2
ref_size: 22
diff_size: -20
summary:
files_missing: 0
files_extra: 0
checks:
ImageFileCheck:
files: 1
findings:
Exception: 1
DataFileCheck:
files: 1
findings:
Missing key: 1
SizeCheck:
files: 1
findings:
Size Difference: 1
conclusion: false Test Results (24.06.03_10.26.45_9t3n5BDtdf)id: bc76f65a-b934-4712-a8cf-2c5263f357ae
date: '2024-06-03 10:54:38'
checked_files:
- file: gc_tiger_lb2_segmentation.mha
path: /app/test/src/1.3.6.1.4.1.5962.99.1.1334438926.1589741711.1637717011470.2.0/gc_tiger_lb2_segmentation.mha
checks:
- checker: ImageFileCheck
notes:
- label: Data Type
description: Data type of the reference image
info: uint8
findings:
- label: Exception
description: An exception occurred during check
info: 'could not convert string to float: '''''
- file: gc_tiger_lb2_til_score.json
path: /app/test/src/1.3.6.1.4.1.5962.99.1.1334438926.1589741711.1637717011470.2.0/gc_tiger_lb2_til_score.json
checks:
- checker: DataFileCheck
findings:
- label: Value similar
description: Value of key 'TIL score' is similar in source file
subpath: TIL score
info:
scale: 1
precision: -1
src: 4
ref: 5
- checker: SizeCheck
summary:
files_missing: 0
files_extra: 0
checks:
ImageFileCheck:
files: 1
findings:
Exception: 1
DataFileCheck:
files: 1
findings:
Value similar: 1
SizeCheck:
files: 1
conclusion: false Test Results (24.06.07_12.29.30_uTzBQF9Njk)id: 3302c113-2efa-45e3-97db-7e651d4f835f
date: '2024-06-07 12:46:36'
checked_files:
- file: gc_tiger_lb2_segmentation.mha
path: /app/test/src/1.3.6.1.4.1.5962.99.1.1334438926.1589741711.1637717011470.2.0/gc_tiger_lb2_segmentation.mha
checks:
- checker: ImageFileCheck
notes:
- label: Data Type
description: Data type of the reference image
info: uint8
- label: Dice Score
description: Dice score between reference and test image
info: 1.0
- file: gc_tiger_lb2_til_score.json
path: /app/test/src/1.3.6.1.4.1.5962.99.1.1334438926.1589741711.1637717011470.2.0/gc_tiger_lb2_til_score.json
checks:
- checker: DataFileCheck
findings:
- label: Value similar
description: Value of key 'TIL score' is similar in source file
subpath: TIL score
info:
scale: 1
precision: -1
src: 4
ref: 5
- checker: SizeCheck
summary:
files_missing: 0
files_extra: 0
checks:
ImageFileCheck:
files: 1
DataFileCheck:
files: 1
findings:
Value similar: 1
SizeCheck:
files: 1
conclusion: false |
@LennyN95 Regarding the results, the exact same exception as last time shows:
I don't understand the origin of this error yet and it wasn't present two base images ago. I will investigate this further. |
@LennyN95 The results look fine now. |
It took a bit longer than expected, but this PR adds the GC Tiger challenge winner LB2 model to MHub.
default.yml/run.py
(WSI-DICOM in JSON out) <--- This one uses the PanImgConvertertiff_pipeline.yml/run_tiff_pipeline.py
(TIFF in JSON out) <-- This one was added for convenience/comparison/testingm-gc-tiger-lb2
branch, subsequently, the MHub model repo should be properly added to the DockerfileThis is also an interesting model to have a look at because of the following issues/characteristics:
This model suffers from the model import issue, (check the Dockerfile), which required me to perform some ugly hacks that even prevent me from running the pipeline directly from the configuration files.