From c8ce759e9924d992e96faf3cac7e0aef68ea4040 Mon Sep 17 00:00:00 2001 From: Ajey Pai K Date: Mon, 5 Aug 2024 11:50:13 +0200 Subject: [PATCH] Add documentation for training tissue foreground --- docs/model_zoo.rst | 58 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/docs/model_zoo.rst b/docs/model_zoo.rst index b62455a..4533b27 100644 --- a/docs/model_zoo.rst +++ b/docs/model_zoo.rst @@ -36,3 +36,61 @@ Segmentation models - H&E - `download `_ - v0.1.1 + +Training tissue foreground segmentation model +============================================= + +Introduction +------------ +This file documents the training of a tissue foreground segmentation model. The model is trained on a dataset consisting of whole slide images (WSIs) of Camelyon16 and TCGA-BRCA datasets. + +The following steps are necessary to train the model: +1. Creation of a manifest file containing the paths to the WSIs and their corresponding annotations. +2. Configuration of ahcore to train the foreground segmentation model. + +Create a manifest file +---------------------- +In order to create a manifest file to train a segmentation model, use the cli utility provided here ``_. + +Configure ahcore for training the model +--------------------------------------- +Use the following data_description to train the model: + +``` +_target_: ahcore.utils.data.DataDescription +data_dir: ${oc.env:DATA_DIR} +annotations_dir: ${oc.env:ANNOTATIONS_DIR} # specify in .env +manifest_database_uri: sqlite:////${oc.env:MANIFEST_PATH}/tcga_database.db +mask_label: null +mask_threshold: null +manifest_name: "v20231115_tcga_camelyon_bg" +split_version: "v1" +roi_name: null # This is the name of the label that carries the ROI +use_roi: False +apply_color_profile: False +# Eg. 512 x 512 is: tile_size 726 x 726 and tile_overlap 107 x 107 +# Tiles are cropped in the transforms downstream, to ensure the patch is completely visible, they are extracted +# slightly larger qrt 2) with sufficient overlap so we have a 512 stride. +training_grid: + mpp: 8 + output_tile_size: [726, 726] + tile_overlap: [0, 0] + tile_size: [512, 512] +inference_grid: + mpp: 8 + tile_size: [512, 512] + tile_overlap: [128, 128] + +num_classes: 2 +use_class_weights: false # Use the class weights in the loss + +remap_labels: + specimen: specimen + +index_map: + specimen: 1 + +color_map: + 0: "yellow" + 1: "red" +```