Skip to content

Commit

Permalink
Replace GeneralizedDiceScore by MonaiDiceScore (#719)
Browse files Browse the repository at this point in the history
  • Loading branch information
nkaenzig authored Dec 9, 2024
1 parent 5c1b376 commit 453a12e
Show file tree
Hide file tree
Showing 32 changed files with 434 additions and 97 deletions.
15 changes: 11 additions & 4 deletions configs/vision/pathology/offline/segmentation/bcss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ trainer:
filename: best
save_last: true
save_top_k: 1
monitor: &MONITOR_METRIC ${oc.env:MONITOR_METRIC, val/GeneralizedDiceScore}
monitor: &MONITOR_METRIC ${oc.env:MONITOR_METRIC, 'val/MonaiDiceScore'}
mode: &MONITOR_METRIC_MODE ${oc.env:MONITOR_METRIC_MODE, max}
- class_path: lightning.pytorch.callbacks.EarlyStopping
init_args:
Expand Down Expand Up @@ -87,11 +87,18 @@ model:
- class_path: torchmetrics.ClasswiseWrapper
init_args:
metric:
class_path: eva.vision.metrics.GeneralizedDiceScore
class_path: eva.vision.metrics.MonaiDiceScore
init_args:
include_background: true
num_classes: *NUM_CLASSES
weight_type: linear
per_class: true
reduction: none
labels:
- outside_roi
- tumor
- stroma
- inflammatory
- necrosis
- other
data:
class_path: eva.DataModule
init_args:
Expand Down
14 changes: 10 additions & 4 deletions configs/vision/pathology/offline/segmentation/consep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ trainer:
filename: best
save_last: true
save_top_k: 1
monitor: &MONITOR_METRIC ${oc.env:MONITOR_METRIC, val/GeneralizedDiceScore}
monitor: &MONITOR_METRIC ${oc.env:MONITOR_METRIC, 'val/MonaiDiceScore'}
mode: &MONITOR_METRIC_MODE ${oc.env:MONITOR_METRIC_MODE, max}
- class_path: lightning.pytorch.callbacks.EarlyStopping
init_args:
Expand Down Expand Up @@ -87,11 +87,17 @@ model:
- class_path: torchmetrics.ClasswiseWrapper
init_args:
metric:
class_path: eva.vision.metrics.GeneralizedDiceScore
class_path: eva.vision.metrics.MonaiDiceScore
init_args:
include_background: true
num_classes: *NUM_CLASSES
weight_type: linear
per_class: true
reduction: none
labels:
- background
- other
- inflammatory
- epithelial
- spindle-shaped
data:
class_path: eva.DataModule
init_args:
Expand Down
15 changes: 11 additions & 4 deletions configs/vision/pathology/offline/segmentation/monusac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ trainer:
filename: best
save_last: true
save_top_k: 1
monitor: &MONITOR_METRIC ${oc.env:MONITOR_METRIC, val/GeneralizedDiceScore}
monitor: &MONITOR_METRIC ${oc.env:MONITOR_METRIC, 'val/MonaiDiceScore'}
mode: &MONITOR_METRIC_MODE ${oc.env:MONITOR_METRIC_MODE, max}
- class_path: lightning.pytorch.callbacks.EarlyStopping
init_args:
Expand Down Expand Up @@ -90,12 +90,19 @@ model:
- class_path: torchmetrics.ClasswiseWrapper
init_args:
metric:
class_path: eva.vision.metrics.GeneralizedDiceScore
class_path: eva.vision.metrics.MonaiDiceScore
init_args:
include_background: true
num_classes: 6
weight_type: linear
reduction: none
ignore_index: *IGNORE_INDEX
per_class: true
labels:
- background
- epithelial
- lymphocyte
- neutrophil
- macrophage
- ambiguous
data:
class_path: eva.DataModule
init_args:
Expand Down
15 changes: 11 additions & 4 deletions configs/vision/pathology/online/segmentation/bcss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ trainer:
filename: best
save_last: true
save_top_k: 1
monitor: &MONITOR_METRIC ${oc.env:MONITOR_METRIC, val/GeneralizedDiceScore}
monitor: &MONITOR_METRIC ${oc.env:MONITOR_METRIC, 'val/MonaiDiceScore'}
mode: &MONITOR_METRIC_MODE ${oc.env:MONITOR_METRIC_MODE, max}
- class_path: lightning.pytorch.callbacks.EarlyStopping
init_args:
Expand Down Expand Up @@ -80,11 +80,18 @@ model:
- class_path: torchmetrics.ClasswiseWrapper
init_args:
metric:
class_path: eva.vision.metrics.GeneralizedDiceScore
class_path: eva.vision.metrics.MonaiDiceScore
init_args:
include_background: true
num_classes: *NUM_CLASSES
weight_type: linear
per_class: true
reduction: none
labels:
- outside_roi
- tumor
- stroma
- inflammatory
- necrosis
- other
data:
class_path: eva.DataModule
init_args:
Expand Down
16 changes: 11 additions & 5 deletions configs/vision/pathology/online/segmentation/consep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ trainer:
filename: best
save_last: true
save_top_k: 1
monitor: &MONITOR_METRIC ${oc.env:MONITOR_METRIC, val/GeneralizedDiceScore}
monitor: &MONITOR_METRIC ${oc.env:MONITOR_METRIC, 'val/MonaiDiceScore'}
mode: &MONITOR_METRIC_MODE ${oc.env:MONITOR_METRIC_MODE, max}
- class_path: lightning.pytorch.callbacks.EarlyStopping
init_args:
Expand Down Expand Up @@ -80,11 +80,17 @@ model:
- class_path: torchmetrics.ClasswiseWrapper
init_args:
metric:
class_path: eva.vision.metrics.GeneralizedDiceScore
class_path: eva.vision.metrics.MonaiDiceScore
init_args:
include_background: true
num_classes: *NUM_CLASSES
weight_type: linear
per_class: true
reduction: none
labels:
- background
- other
- inflammatory
- epithelial
- spindle-shaped
data:
class_path: eva.DataModule
init_args:
Expand All @@ -110,7 +116,7 @@ data:
train:
batch_size: &BATCH_SIZE ${oc.env:BATCH_SIZE, 64}
num_workers: &N_DATA_WORKERS ${oc.env:N_DATA_WORKERS, 4}
shuffle: true
shuffle: false
val:
batch_size: *BATCH_SIZE
num_workers: *N_DATA_WORKERS
15 changes: 11 additions & 4 deletions configs/vision/pathology/online/segmentation/monusac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ trainer:
filename: best
save_last: true
save_top_k: 1
monitor: &MONITOR_METRIC ${oc.env:MONITOR_METRIC, val/GeneralizedDiceScore}
monitor: &MONITOR_METRIC ${oc.env:MONITOR_METRIC, 'val/MonaiDiceScore'}
mode: &MONITOR_METRIC_MODE ${oc.env:MONITOR_METRIC_MODE, max}
- class_path: lightning.pytorch.callbacks.EarlyStopping
init_args:
Expand Down Expand Up @@ -82,12 +82,19 @@ model:
- class_path: torchmetrics.ClasswiseWrapper
init_args:
metric:
class_path: eva.vision.metrics.GeneralizedDiceScore
class_path: eva.vision.metrics.MonaiDiceScore
init_args:
include_background: true
num_classes: 6
weight_type: linear
reduction: none
ignore_index: *IGNORE_INDEX
per_class: true
labels:
- background
- epithelial
- lymphocyte
- neutrophil
- macrophage
- ambiguous
data:
class_path: eva.DataModule
init_args:
Expand Down
12 changes: 8 additions & 4 deletions configs/vision/radiology/offline/segmentation/lits.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ trainer:
filename: best
save_last: true
save_top_k: 1
monitor: &MONITOR_METRIC ${oc.env:MONITOR_METRIC, val/GeneralizedDiceScore}
monitor: &MONITOR_METRIC ${oc.env:MONITOR_METRIC, 'val/MonaiDiceScore'}
mode: &MONITOR_METRIC_MODE ${oc.env:MONITOR_METRIC_MODE, max}
- class_path: lightning.pytorch.callbacks.EarlyStopping
init_args:
Expand Down Expand Up @@ -84,11 +84,15 @@ model:
- class_path: torchmetrics.ClasswiseWrapper
init_args:
metric:
class_path: eva.vision.metrics.GeneralizedDiceScore
class_path: eva.vision.metrics.MonaiDiceScore
init_args:
include_background: true
num_classes: *NUM_CLASSES
weight_type: linear
per_class: true
reduction: none
labels:
- background
- liver
- tumor
data:
class_path: eva.DataModule
init_args:
Expand Down
12 changes: 8 additions & 4 deletions configs/vision/radiology/offline/segmentation/lits_balanced.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ trainer:
filename: best
save_last: true
save_top_k: 1
monitor: &MONITOR_METRIC ${oc.env:MONITOR_METRIC, val/GeneralizedDiceScore}
monitor: &MONITOR_METRIC ${oc.env:MONITOR_METRIC, 'val/MonaiDiceScore'}
mode: &MONITOR_METRIC_MODE ${oc.env:MONITOR_METRIC_MODE, max}
- class_path: lightning.pytorch.callbacks.EarlyStopping
init_args:
Expand Down Expand Up @@ -85,11 +85,15 @@ model:
- class_path: torchmetrics.ClasswiseWrapper
init_args:
metric:
class_path: eva.vision.metrics.GeneralizedDiceScore
class_path: eva.vision.metrics.MonaiDiceScore
init_args:
include_background: true
num_classes: *NUM_CLASSES
weight_type: linear
per_class: true
reduction: none
labels:
- background
- liver
- tumor
data:
class_path: eva.DataModule
init_args:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ trainer:
filename: best
save_last: true
save_top_k: 1
monitor: &MONITOR_METRIC ${oc.env:MONITOR_METRIC, val/GeneralizedDiceScore}
monitor: &MONITOR_METRIC ${oc.env:MONITOR_METRIC, 'val/MonaiDiceScore'}
mode: &MONITOR_METRIC_MODE ${oc.env:MONITOR_METRIC_MODE, max}
- class_path: lightning.pytorch.callbacks.EarlyStopping
init_args:
Expand Down Expand Up @@ -86,11 +86,11 @@ model:
- class_path: torchmetrics.ClasswiseWrapper
init_args:
metric:
class_path: eva.vision.metrics.GeneralizedDiceScore
class_path: eva.vision.metrics.MonaiDiceScore
init_args:
include_background: true
num_classes: *NUM_CLASSES
weight_type: linear
per_class: true
reduction: none
data:
class_path: eva.DataModule
init_args:
Expand Down
12 changes: 8 additions & 4 deletions configs/vision/radiology/online/segmentation/lits.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ trainer:
filename: best
save_last: true
save_top_k: 1
monitor: &MONITOR_METRIC ${oc.env:MONITOR_METRIC, val/GeneralizedDiceScore}
monitor: &MONITOR_METRIC ${oc.env:MONITOR_METRIC, 'val/MonaiDiceScore'}
mode: &MONITOR_METRIC_MODE ${oc.env:MONITOR_METRIC_MODE, max}
- class_path: lightning.pytorch.callbacks.EarlyStopping
init_args:
Expand Down Expand Up @@ -78,11 +78,15 @@ model:
- class_path: torchmetrics.ClasswiseWrapper
init_args:
metric:
class_path: eva.vision.metrics.GeneralizedDiceScore
class_path: eva.vision.metrics.MonaiDiceScore
init_args:
include_background: true
num_classes: *NUM_CLASSES
weight_type: linear
per_class: true
reduction: none
labels:
- background
- liver
- tumor
data:
class_path: eva.DataModule
init_args:
Expand Down
12 changes: 8 additions & 4 deletions configs/vision/radiology/online/segmentation/lits_balanced.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ trainer:
filename: best
save_last: true
save_top_k: 1
monitor: &MONITOR_METRIC ${oc.env:MONITOR_METRIC, val/GeneralizedDiceScore}
monitor: &MONITOR_METRIC ${oc.env:MONITOR_METRIC, 'val/MonaiDiceScore'}
mode: &MONITOR_METRIC_MODE ${oc.env:MONITOR_METRIC_MODE, max}
- class_path: lightning.pytorch.callbacks.EarlyStopping
init_args:
Expand Down Expand Up @@ -78,11 +78,15 @@ model:
- class_path: torchmetrics.ClasswiseWrapper
init_args:
metric:
class_path: eva.vision.metrics.GeneralizedDiceScore
class_path: eva.vision.metrics.MonaiDiceScore
init_args:
include_background: true
num_classes: *NUM_CLASSES
weight_type: linear
per_class: true
reduction: none
labels:
- background
- liver
- tumor
data:
class_path: eva.DataModule
init_args:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ trainer:
filename: best
save_last: true
save_top_k: 1
monitor: &MONITOR_METRIC ${oc.env:MONITOR_METRIC, val/GeneralizedDiceScore}
monitor: &MONITOR_METRIC ${oc.env:MONITOR_METRIC, 'val/MonaiDiceScore'}
mode: &MONITOR_METRIC_MODE ${oc.env:MONITOR_METRIC_MODE, max}
- class_path: lightning.pytorch.callbacks.EarlyStopping
init_args:
Expand Down Expand Up @@ -79,11 +79,11 @@ model:
- class_path: torchmetrics.ClasswiseWrapper
init_args:
metric:
class_path: eva.vision.metrics.GeneralizedDiceScore
class_path: eva.vision.metrics.MonaiDiceScore
init_args:
include_background: true
num_classes: *NUM_CLASSES
weight_type: linear
per_class: true
reduction: none
data:
class_path: eva.DataModule
init_args:
Expand Down
Loading

0 comments on commit 453a12e

Please sign in to comment.