Repository navigation
Conversation
Test CoverageTotal: 88.87% (62610 / 70451 lines)
|
dhtrg
force-pushed
the
medmod-ihm-images-examples
branch
from
November 27, 2026 22:35
c798297 to
984974f
Compare
Part 1 of 4 of sunlabuiuc#1609. Co-authored-by: rainiehu <57816421+Rainie-Hu@users.noreply.github.com>
The task page now says the image transform belongs to the model's image loader; the task returns image_path only. A custom itemid_map adds a digest of its file to dataset_name, so each map gets its own PyHealth cache, with a test that builds two maps on one cache_dir. Co-authored-by: rainiehu <57816421+Rainie-Hu@users.noreply.github.com>
The dataset drops events outside its item map before caching, so a task whose item map has other ids would silently miss their events. set_task now raises a ValueError naming them, with a test. This is the second half of the AI review's item-map comment. Co-authored-by: rainiehu <57816421+Rainie-Hu@users.noreply.github.com>
dhtrg
force-pushed
the
medmod-ihm-images-examples
branch
from
November 30, 2026 22:01
984974f to
6aaf1b9
Compare
Starting and stopping PyHealth's local Dask cluster took about 5 s per event-table build on 28 fake rows. The dataset tests now run the same Dask graph in the test process, and the custom item map test checks its cache key and row filter without a second build. The slowest step is now the module's one shared build (about 1.7 s); every test takes under 0.5 s. Co-authored-by: rainiehu <57816421+Rainie-Hu@users.noreply.github.com>
…ples Part 3 of 4 of sunlabuiuc#1609. Builds on parts 1 and 2. Co-authored-by: rainiehu <57816421+Rainie-Hu@users.noreply.github.com>
resize_cxr leaves a .tmp_*.jpg file behind if it is killed while saving. list_images now skips it, as existing_basenames already does. Co-authored-by: rainiehu <57816421+Rainie-Hu@users.noreply.github.com>
dhtrg
force-pushed
the
medmod-ihm-images-examples
branch
from
November 30, 2026 23:53
f82df5f to
c04b28b
Compare
Rainie-Hu
marked this pull request as ready for review
December 1, 2026 00:37
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contributors: Yuqing Hu (GT username yhu672, yhu672@gatech.edu) and Hanh Trang Do (GT username hdo61, hdo61@gatech.edu), Georgia Tech CSE 6250
Contribution Type: Full Pipeline, part 3 of 4 (#1609): the example scripts that run dataset → task → model → evaluation, and the MedSigLIP extension
**Part 3 of 4 of #1609. Depends on #1637 (#1638 is merged). Until #1637 merges, this diff also shows its files. After it merges, this branch will be rebased so it shows only part 3. The split: 1. dataset, task and processor (#1637); 2. models (#1638); 3. this PR; 4. runner scripts and Colab notebook (#1640, after this one).
Paper: Elsharief, S., et al. (2025). MedMod: Multimodal Benchmark for Medical Prediction Tasks with Electronic Health Records and Chest X-Ray Scans. CHIL 2025, PMLR 287. https://proceedings.mlr.press/v287/elsharief25a.html (code: https://github.com/nyuad-cai/MedMod)
What it adds:
image_presets(the chest X-ray transforms each model uses,get_preset,load_cxr) andresize_cxr(MedFuse's 512-px resize of MIMIC-CXR-JPG images).medsiglipcomputes and looks up stored embeddings from a frozen MedSigLIP image encoder (google/medsiglip-448). In both examples, the option--embeddingsuses them instead of the ResNet-34.pretrainingbuilds them from the output of MedMod's extraction scripts and the MIMIC-CXR-JPG metadata.syntheticcreates synthetic samples with the same format. Both examples run end to end on them with--synthetic, including the extension (--embeddings synthetic).examples/mimic4_medmod_ihm_early_fusion.pyandexamples/mimic4_medmod_convirt.py, plusexamples/mimic4_medmod_ihm_results.mdwith the results, all settings and the deviations.Results on MedMod's test split (1,241 stays, 187 deaths), mean ± sample standard deviation over MedMod's five seeds:
Each ConVIRT probe uses the pretraining epoch with the highest validation AUROC, as the paper describes.
Deviations from the paper and our proposal (
examples/mimic4_medmod_ihm_results.mdhas the details, our hypotheses and all settings):Trainer, which has no learning-rate scheduler.Links to other components: this part uses only our own components from #1637 and #1638 (the task, the EHR processor and both models). It does not import or change existing PyHealth components.
Files to review (part 3 only):
pyhealth/datasets/medmod/image_presets.py,resize_cxr.py,medsiglip.py,pretraining.py,synthetic.pytests/core/test_medmod_mimic4_images.py,test_medmod_medsiglip.py,test_medmod_pretraining.py,test_medmod_mimic4_synthetic.pyexamples/README.mdpyhealth/datasets/medmod/__init__.py,files/NOTICE, thesplit_by_medmodexample inmedmod_mimic4.pyand the task'simage_dirdocstringTesting: on this branch, all 142 tests pass (our 121 plus upstream's 21 MedMod decompensation tests), on synthetic data only, with no network access.
python tools/check_pr_rules.pypasses.Data: no MIMIC data, identifiers or trained weights are in this PR. The results page shows only aggregate scores and counts.
🤖 Generated with Claude Code