-
Notifications
You must be signed in to change notification settings - Fork 101
oir_flatmount_segmentation - Hartnett Lab - A MONAI bundle for automated rat and mouse oxygen-induced retinopathy flatmount segmentation (total retina/avascular area/intravitreal neovascularization) #778
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
Open
hartnettlabteam
wants to merge
53
commits into
Project-MONAI:dev
Choose a base branch
from
hartnettlabteam:dev
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+851
−0
Open
Changes from 5 commits
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
c467064
Create oir_flatmount_segmentation
hartnettlabteam dfa852e
Delete models/oir_flatmount_segmentation
hartnettlabteam db0cee3
Create README.md
hartnettlabteam e078b53
Add files via upload
hartnettlabteam 7e0fbc8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] c71dbde
Update models/oir_flatmount_segmentation/configs/inference.json
hartnettlabteam 6f3f0bc
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 94f5a1e
Delete models/oir_flatmount_segmentation/docs/POST_TRAINING_CHECKLIST.md
hartnettlabteam c3ccdd1
Delete models/oir_flatmount_segmentation/docs/RELEASE_RESULTS.md
hartnettlabteam 922a14f
Update inference.json
hartnettlabteam 38cea7f
Update data_license.txt
hartnettlabteam 2cb2646
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 946f71a
Update thresholds.json
hartnettlabteam 4a3445f
Update thresholds.json
hartnettlabteam a829416
Update thresholds.json
hartnettlabteam 51cf33e
Update thresholds.json
hartnettlabteam 06bc42f
Update thresholds.json
hartnettlabteam adabc06
Update thresholds.json
hartnettlabteam 568ef27
Update release_manifest.json
hartnettlabteam 4c2b7ac
Update metadata.json
hartnettlabteam 83275b4
Update train.json
hartnettlabteam 431cce8
Update README.md
hartnettlabteam 64aeef8
Update train.json
hartnettlabteam 480a988
Update model_transformer.py
hartnettlabteam 29a8b48
Update inference.json
hartnettlabteam 1f4ebe6
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 10149b0
Merge branch 'dev' into dev
hartnettlabteam dc06747
Update model_transformer.py
hartnettlabteam 61bfdb6
Update plot_learning_curves.py
hartnettlabteam 5c2dd84
Update metadata.json
hartnettlabteam 583f500
Merge branch 'dev' into dev
ericspod 6e84bb6
Update models/oir_flatmount_segmentation/configs/metadata.json
hartnettlabteam 18a22ce
Update models/oir_flatmount_segmentation/model_transformer.py
hartnettlabteam 955ce78
Update models/oir_flatmount_segmentation/scripts/plot_learning_curves.py
hartnettlabteam a081f82
Rename models/oir_flatmount_segmentation/model.py to models/oir_flatm…
hartnettlabteam 6d4e2c9
Rename models/oir_flatmount_segmentation/model_transformer.py to mode…
hartnettlabteam a66a0f1
Update README.md
hartnettlabteam a5abb24
Update README.md
hartnettlabteam 80b3c79
Update README.md
hartnettlabteam 7f41544
Delete models/oir_flatmount_segmentation/docs/README.md
hartnettlabteam b1e2db6
Update and rename models/oir_flatmount_segmentation/README.md to mode…
hartnettlabteam 6c01a1b
Update README.md
hartnettlabteam c4f88b4
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] eab79b5
Rename models/oir_flatmount_segmentation/cv_summary.csv to models/oir…
hartnettlabteam 7f217ed
Rename models/oir_flatmount_segmentation/release_manifest.json to mod…
hartnettlabteam cf634b7
Rename models/oir_flatmount_segmentation/requirements.txt to models/o…
hartnettlabteam 2081871
Update metadata.json
hartnettlabteam 178619f
Update README.md
hartnettlabteam 9028f37
Update README.md
hartnettlabteam 132ac07
Update README.md
hartnettlabteam 7151e7e
Update README.md
hartnettlabteam 99b4835
Merge branch 'dev' into dev
ericspod 0eaa0c8
Merge branch 'dev' into dev
ericspod File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| MIT License | ||
|
|
||
| Copyright (c) 2026 Hartnett Lab | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| # OIR Flatmount Segmentation (Hartnett Lab) | ||
|
|
||
| ### **Authors** | ||
| Neal S. Shah*, Aniket Ramshekar*, Bright Asare-Bediako, Morgan P. Tankersley, Heng-Chiao Huang, Shreya Beri, Eric Kunz, Aaron Y. Lee, M. Elizabeth Hartnett | ||
|
|
||
| Byers Eye Institute Department of Ophthalmology, Stanford University School of Medicine, Stanford, CA, USA | ||
|
|
||
| ### **Tags** | ||
| Segmentation, Retinal Flatmount, Oxygen-Induced Retinopathy, OIR, Mouse, Rat, Intravitreal Neovascularization, Avascular Area | ||
|
|
||
| ## **Model Description** | ||
| This model performs automated segmentation of oxygen-induced retinopathy (OIR) retinal flatmount images into three regions: total retina (TR), intravitreal neovascularization (IVNV), and avascular area (AVA). | ||
| The architecture is a multi-task Attention U-Net with a ConvNeXt-Tiny encoder [1] and deep supervision (~8.7M trainable parameters). | ||
| For inference, the final release uses an ensemble of 5 cross-validation models, with test-time augmentation and per-class thresholding, to improve robustness across mouse and rat OIR images. | ||
|
|
||
| ## **Data** | ||
| Model development used three datasets: | ||
|
|
||
| 1. **Rat IVNV pretraining dataset:** 72 rat OIR flatmount images with IVNV-only annotations (used in intermediate Stage 2 training). | ||
| 2. **Final development dataset:** 345 annotated images total (267 mouse, 78 rat), including: | ||
| - 127 expert human-annotated images (49 mouse, 78 rat) | ||
| - 218 curated open-source mouse images [2] with reviewed masks generated from a prior published model [3] | ||
| 3. **Independent test dataset:** 37 images (18 mouse OIR, 19 rat OIR), held out from training/validation/model selection. | ||
|
|
||
| For final model development, a modified 5-fold cross-validation strategy was used, with expert-annotated images serving as fold-level validation references and curated open-source mouse images used in training only. | ||
|
|
||
| #### **Preprocessing** | ||
| Input retinal flatmount images were converted to grayscale, resized to 512×512, and intensity-normalized. | ||
| During training, joint image-mask augmentation was applied using random horizontal/vertical flips, random rotations (up to 180 degrees), brightness/contrast perturbation, CLAHE, Gaussian noise, elastic/grid/optical distortions, coarse dropout, motion blur, and random gamma adjustments. | ||
|
|
||
| ## **Performance** | ||
|
|
||
| Dice agreement between model masks and human consensus masks was high for total retina (TR) and AVA, and moderate for IVNV in both species: | ||
| - Rat: TR Dice=0.983, AVA Dice=0.924, IVNV Dice=0.612 | ||
| - Mouse: TR Dice=0.975, AVA Dice=0.912, IVNV Dice=0.601 | ||
|
|
||
| At the metric level, the deep learning model showed strong correlation with the mean of three graders for rat percent AVA (r=0.979) and rat percent IVNV (r=0.943). In mouse OIR, correlation was strong for percent AVA (r=0.957) but weak for percent IVNV (r=0.265), likely due to high inter-grader variability for mouse IVNV scoring. | ||
|
|
||
| (For full analysis please refer to the manuscript.) | ||
|
|
||
| ## **System Configuration** | ||
| This model was trained on an Apple M2 pro 16GB Macbook. 5-fold cross-validation was run sequentially with batch size 4 and a maximum of 120 epochs per fold. The folds ran for 86, 88, 120, 61, and 80 epochs, with total training time of approximately 24 hours. | ||
|
|
||
| ## **Additional Usage Steps** | ||
| Model checkpoints are hosted externally and linked through `large_files.yml` (not committed directly in the repo due to file size limits). | ||
|
|
||
| ## **References** | ||
| 1. Liu Z, Mao H, Wu CY, Feichtenhofer C, Darrell T, Xie S. A ConvNet for the 2020s. 2022:11966-11976. | ||
| 2. Marra KV, Chen JS, Robles-Holmes HK, et al. Development of an Open-Source Dataset of Flat-Mounted Images for the Murine Oxygen-Induced Retinopathy Model of Ischemic Retinopathy. Transl Vis Sci Technol. Dec 2 2024;13(12):4. | ||
| 3. Xiao S, Bucher F, Wu Y, et al. Fully automated, deep learning segmentation of oxygen-induced retinopathy images. JCI Insight. Dec 21 2017;2(24)doi:10.1172/jci.insight.97585 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| { | ||
| "bundle_root": ".", | ||
| "device": "$torch.device('cuda' if torch.cuda.is_available() else 'cpu')", | ||
| "output_dir": "$@bundle_root + '/infer_output'", | ||
| "input_dir": "$@bundle_root + '/inputs'", | ||
| "network_def": { | ||
| "_target_": "model_transformer.AttentionUNetTransformer", | ||
| "in_ch": 1, | ||
| "out_ch": 3, | ||
| "backbone": "convnext_tiny", | ||
| "pretrained": false | ||
| }, | ||
| "inferer": { | ||
| "_target_": "monai.inferers.SimpleInferer" | ||
| }, | ||
| "preprocessing": { | ||
| "_target_": "monai.transforms.Compose", | ||
| "transforms": [ | ||
| { | ||
| "_target_": "monai.transforms.LoadImaged", | ||
| "keys": [ | ||
| "image" | ||
| ], | ||
| "ensure_channel_first": true | ||
| }, | ||
| { | ||
| "_target_": "monai.transforms.ScaleIntensityRanged", | ||
| "keys": [ | ||
| "image" | ||
| ], | ||
| "a_min": 0, | ||
| "a_max": 255, | ||
| "b_min": -1.0, | ||
| "b_max": 1.0, | ||
| "clip": true | ||
| }, | ||
| { | ||
| "_target_": "monai.transforms.Resized", | ||
| "keys": [ | ||
| "image" | ||
| ], | ||
| "spatial_size": [ | ||
| 512, | ||
| 512 | ||
| ], | ||
| "mode": "area" | ||
| } | ||
| ] | ||
| }, | ||
| "postprocessing": { | ||
| "_target_": "monai.transforms.Compose", | ||
| "transforms": [] | ||
| }, | ||
| "notes": "This config defines required MONAI keys. For production inference, use infer.py from the parent codebase for ensemble and threshold logic." | ||
| } | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| { | ||
| "version": "0.1.0", | ||
| "changelog": { | ||
| "0.1.0": "Initial MONAI bundle packaging for OIR flatmount segmentation." | ||
| }, | ||
| "monai_version": "1.4.0", | ||
| "pytorch_version": "2.3.0", | ||
| "numpy_version": "1.26.4", | ||
| "name": "OIR Flatmount Segmentation (Hartnett Lab)", | ||
| "task": "pathology_segmentation", | ||
| "description": "Multi-task segmentation of total retina, intravitreal neovascularization, and avascular area in OIR flatmount images.", | ||
| "authors": "Neal Shah, Aniket Ramshekar, Bright Asare-Bediako, Morgan Tankersley, Heng-Chiao Huang, Shreya Beri, Eric Kunz, Aaron Y. Lee, M. Elizabeth Hartnett", | ||
| "copyright": "Hartnett Lab", | ||
| "data_source": "Hartnett Lab OIR flatmount datasets", | ||
| "data_type": "image", | ||
| "image_classes": "retinal_flatmount", | ||
| "intended_use": "Research", | ||
| "network_data_format": { | ||
| "inputs": { | ||
| "image": { | ||
| "type": "image", | ||
| "format": "png/jpg/tif/bmp", | ||
|
hartnettlabteam marked this conversation as resolved.
Outdated
|
||
| "dtype": "float32", | ||
| "num_channels": 1, | ||
| "spatial_shape": [ | ||
| 512, | ||
| 512 | ||
| ] | ||
| } | ||
| }, | ||
| "outputs": { | ||
| "pred": { | ||
| "type": "image", | ||
| "dtype": "float32", | ||
| "num_channels": 3, | ||
| "channels": [ | ||
| "retina", | ||
| "ivnv", | ||
| "ava" | ||
| ] | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| } | ||
| } | ||
| }, | ||
| "schema": "https://raw.githubusercontent.com/Project-MONAI/model-zoo/dev/monai_bundle_schemas/metadata_schema.json", | ||
| "optional_packages_version": { | ||
|
ericspod marked this conversation as resolved.
|
||
| "timm": "", | ||
|
hartnettlabteam marked this conversation as resolved.
Outdated
|
||
| "albumentations": "", | ||
| "opencv-python": "", | ||
| "pandas": "", | ||
| "matplotlib": "", | ||
| "openpyxl": "" | ||
| } | ||
| } | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| { | ||
| "bundle_root": ".", | ||
| "dataset_dir": "/workspace/data/oir_flatmount_segmentation", | ||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
| "output_dir": "$@bundle_root + '/train_output'", | ||
| "device": "$torch.device('cuda' if torch.cuda.is_available() else 'cpu')", | ||
| "network_def": { | ||
| "_target_": "model_transformer.AttentionUNetTransformer", | ||
| "in_ch": 1, | ||
| "out_ch": 3, | ||
| "backbone": "convnext_tiny", | ||
| "pretrained": true | ||
| }, | ||
| "train": { | ||
| "trainer": { | ||
| "_target_": "monai.engines.SupervisedTrainer" | ||
| }, | ||
| "trainer#max_epochs": 120, | ||
| "dataset": { | ||
| "_target_": "dataset.OIRSegmentationDataset" | ||
| }, | ||
| "dataset#data": "$@dataset_dir", | ||
| "preprocessing": { | ||
| "_target_": "monai.transforms.Compose", | ||
| "transforms": [] | ||
| }, | ||
| "postprocessing": { | ||
| "_target_": "monai.transforms.Compose", | ||
| "transforms": [] | ||
| }, | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| "inferer": { | ||
| "_target_": "monai.inferers.SimpleInferer" | ||
| }, | ||
| "key_metric": { | ||
| "mean_dice": { | ||
| "_target_": "monai.metrics.DiceMetric", | ||
| "include_background": true | ||
| } | ||
| }, | ||
| "handlers": [] | ||
| }, | ||
| "validate": { | ||
| "evaluator": { | ||
| "_target_": "monai.engines.SupervisedEvaluator" | ||
| }, | ||
| "dataset": { | ||
| "_target_": "dataset.OIRSegmentationDataset" | ||
| }, | ||
| "dataset#data": "$@dataset_dir", | ||
| "preprocessing": { | ||
| "_target_": "monai.transforms.Compose", | ||
| "transforms": [] | ||
| }, | ||
| "postprocessing": { | ||
| "_target_": "monai.transforms.Compose", | ||
| "transforms": [] | ||
| }, | ||
| "inferer": { | ||
| "_target_": "monai.inferers.SimpleInferer" | ||
| }, | ||
| "key_metric": { | ||
| "mean_dice": { | ||
| "_target_": "monai.metrics.DiceMetric", | ||
| "include_background": true | ||
| } | ||
| }, | ||
| "handlers": [] | ||
| }, | ||
| "val_interval": 1, | ||
| "notes": "Primary training is executed via retrain_kfold_v2.py and train_with_split.py in the parent project. This file exists to satisfy MONAI preferred train-config keys." | ||
| } | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| fold,epochs_ran,best_val_dice,last_val_dice_retina,last_val_dice_nv,last_val_dice_vo,thr_retina,thr_nv,thr_vo | ||
| 0,86,0.803034,0.954282,0.455693,0.872625,0.3,0.95,0.85 | ||
| 1,88,0.830743,0.974396,0.569426,0.907811,0.8,0.6,0.65 | ||
| 2,120,0.825497,0.966939,0.591886,0.916625,0.75,0.65,0.85 | ||
| 3,61,0.852035,0.980751,0.545412,0.932191,0.35,0.95,0.5 | ||
| 4,80,0.815581,0.977167,0.534101,0.897727,0.9,0.75,0.4 |
33 changes: 33 additions & 0 deletions
33
models/oir_flatmount_segmentation/docs/POST_TRAINING_CHECKLIST.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # Post-Training Checklist (v2_20260317) | ||
|
|
||
| ## Completed | ||
|
|
||
| - 5-fold CV retraining finished successfully with joint TR/IVNV/AVA optimization. | ||
| - Finalized production method: 5-fold ensemble of `best.pth` with per-fold calibrated thresholds. | ||
| - Per-fold outputs confirmed: | ||
| - `best.pth`, `final.pth`, `thresholds.json` | ||
| - `training_history.csv`, `learning_curves.png` | ||
| - `dataset_log.xlsx`, `run_manifest.json` | ||
| - Cross-fold summary generated: | ||
| - `output_kfold_v2/cv_summary.csv` | ||
| - `output_kfold_v2/cv_summary.json` | ||
| - Release package created: | ||
| - `/Users/nealshah/Documents/OIR_segmentation_images/oir_flatmount_segmentation_release_v2_20260317` | ||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
| - includes copied fold weights, thresholds, CV summary, hashes (`release_manifest.json`) | ||
| - MONAI bundle local check: | ||
| - `verify_net_in_out` passed for `configs/inference.json` | ||
| - Publication repository handoff complete: | ||
| - copied fold weights and thresholds to `/Users/nealshah/Documents/OIR model/weights/fold_*` | ||
| - Default inference ensemble path switched to v2 in `infer.py`. | ||
|
|
||
| ## Pending (for external submission) | ||
|
|
||
| - Upload fold model files to public artifact hosting and replace placeholder URLs in `large_files.yml`. | ||
| - Decide and add final dataset license/legal wording in `docs/data_license.txt`. | ||
| - Run full MONAI metadata validation from the MONAI model-zoo repository context (the schema URL currently referenced by metadata in this environment resolves to 404, so local `verify_metadata` cannot complete against official schema here). | ||
| - Optional: add TorchScript export artifact and config if required by deployment target. | ||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
|
|
||
| ## Key Aggregate CV Result | ||
|
|
||
| - Mean best validation Dice (across folds): `0.8254` | ||
| - Standard deviation: `0.0183` | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| # OIR Flatmount Segmentation (Hartnett Lab) | ||
|
|
||
| ## Overview | ||
|
|
||
| This bundle provides automated segmentation of oxygen-induced retinopathy (OIR) flatmount images for: | ||
|
|
||
| - Total Retina (TR) | ||
| - Intravitreal Neovascularization (IVNV) | ||
| - Avascular Area (AVA) | ||
|
|
||
| The model is a multi-task Attention U-Net with a ConvNeXt-Tiny encoder and deep supervision, trained with fold-wise threshold calibration and ensemble inference. | ||
|
|
||
| ## Intended Use | ||
|
|
||
| - Research use in preclinical retinal OIR image analysis. | ||
| - Automated quantification support for TR, IVNV, and AVA area measurements. | ||
| - Batch processing workflows for publication and reproducible analytics. | ||
|
|
||
| ## Not Intended For | ||
|
|
||
| - Clinical diagnosis, triage, or autonomous treatment decisions. | ||
| - Use outside domain conditions (non-flatmount, unrelated species, unrelated disease context) without additional validation. | ||
|
|
||
| ## Input and Output | ||
|
|
||
| - **Input**: Single-channel retinal flatmount image. RGB inputs are converted to grayscale. | ||
| - **Output**: | ||
| - Binary masks for TR, IVNV, AVA | ||
| - Overlay visualizations | ||
| - Per-image quantitative metrics (areas and percentages) | ||
|
|
||
| ## Training Summary | ||
|
|
||
| - Data split strategy: | ||
| - Deduplicated by basename to avoid `.jpg/.tif` leakage. | ||
| - HQ expert annotations reserved for validation folds. | ||
| - Auto-generated images included only in training. | ||
| - Loss: | ||
| - BCE + Dice (all channels) | ||
| - Focal Tversky (TR/IVNV/AVA channel-weighted) | ||
| - Boundary Dice with Sobel gradients | ||
| - Deep supervision loss at decoder intermediates | ||
| - Optimization: | ||
| - AdamW + warmup cosine LR | ||
| - Discriminative learning rates (backbone vs decoder/heads) | ||
| - EMA weights | ||
| - Gradient clipping | ||
| - Early stopping | ||
| - Strong augmentation | ||
|
|
||
| ## Inference Summary | ||
|
|
||
| - Ensemble over fold checkpoints (`fold_*/best.pth`) | ||
| - D4 test-time augmentation (rotations and flips) | ||
| - Threshold calibration and post-processing: | ||
| - mask binarization by per-class threshold | ||
| - retina-constrained IVNV/AVA | ||
| - optional component filtering and morphological closing | ||
|
|
||
| ## Reproducibility Artifacts | ||
|
|
||
| Each training fold is expected to emit: | ||
|
|
||
| - `training_history.csv` | ||
| - `learning_curves.png` | ||
| - `dataset_log.xlsx` | ||
| - `run_manifest.json` | ||
| - `best.pth`, `final.pth`, `thresholds.json` | ||
|
|
||
| ## Authors | ||
|
|
||
| Neal Shah1*, Aniket Ramshekar1*, Bright Asare-Bediako1, Morgan Tankersley1, Heng-Chiao Huang1,2, Shreya Beri1, Eric Kunz3, Aaron Y. Lee4, M. Elizabeth Hartnett1,# | ||
|
|
||
| 1 Byers Eye Institute Department of Ophthalmology, Stanford University School of Medicine, Stanford, California, USA | ||
| 2 Department of Ophthalmology, Chang Gung Memorial Hospital, Chiayi, Taiwan | ||
| 3 John A. Moran Eye Center, University of Utah, Salt Lake City, Utah, USA | ||
| 4 John F. Hardesty Department of Ophthalmology and Visual Sciences, Washington University in St. Louis, St. Louis, Missouri, USA | ||
|
|
||
| ## Contacts | ||
|
|
||
| - Neal Shah: neals1@stanford.edu | ||
| - Aniket Ramshekar: aniket.ramshekar@stanford.edu | ||
| - M. Elizabeth Hartnett: me.hartnett@stanford.edu | ||
|
|
||
| ## Citation | ||
|
|
||
| If you use this model, please cite the associated TVST publication (to be updated after acceptance) and acknowledge the Hartnett Lab. | ||
|
|
||
| ## Known Limitations | ||
|
|
||
| - Performance may degrade for out-of-distribution scanners/prep protocols. | ||
| - Small IVNV lesions are sensitive to threshold and component filtering settings. | ||
| - Cross-species domain shift (mouse vs rat) should be evaluated explicitly per cohort. |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.