Update README.md
Browse files123---license: apache-2.0---123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112---license: apache-2.0library_name: pytorchpipeline_tag: image-segmentationtags:- monai- pytorch- microscopy- image-segmentation- instance-segmentation- roi-segmentation- cochlea- unet- watershed---# Cochlear Synapse ROI Segmentation[](https://github.com/fedeceri85/cochlea-synapses-binary-segmentation-unet2d)MONAI/PyTorch implementation of a two-stage 2D U-Net pipeline for ROI instance segmentation in single-channel cochlear microscopy TIFF images.This model was trained for the segmentation of fluorescently-labelled putative cochlear synaptic boutons.The model uses:- a binary foreground U-Net- a center heatmap U-Net whose peaks are used as watershed markersThe final ROI labels are produced by marker-controlled watershed using the heatmap-derived markers inside the binary foreground prediction.## Model- Input: single-channel 2D TIFF image- Output: instance-label ROI mask (`0 = background`, `1..N = predicted ROIs`)- Optional outputs: binary foreground mask, center heatmap, marker image- Architecture: MONAI U-Net, defined by the two YAML config files- Binary config: `config/binary_model_v5_synaptic.yml`- Heatmap config: `config/heatmap_model_v5_synaptic.yml`- Weights: `best_model_binary_heatmap_v5_synaptic.pth`## UseRun inference on a TIFF image:```bashpython infer_rois.py input_Avg.tif --output input_rois.tif```The script loads:```textbest_model_binary_heatmap_v5_synaptic.pthconfig/binary_model_v5_synaptic.ymlconfig/heatmap_model_v5_synaptic.yml```If `--output` is omitted, the script writes `<input>_rois.tif`.To also save the intermediate binary mask, heatmap, and marker image:```bashpython infer_rois.py input_Avg.tif --output input_rois.tif --save-intermediates```Useful inference parameters can be overridden from the command line:```bashpython infer_rois.py input_Avg.tif \--output input_rois.tif \--binary-threshold 0.5 \--heatmap-threshold 0.3 \--min-size 20 \--min-distance 5```## Training DataThe model was trained on manually annotated cochlear microscopy TIFF images with ROI masks and annotation-filtered center heatmaps generated from those masks.The training pipeline and dataset preparation code are available in the GitHub repository:https://github.com/fedeceri85/cochlea-synapses-binary-segmentation-unet2d## EvaluationThe repository contains notebooks for checking binary predictions, heatmap predictions, and the combined ROI output:```textbinary_check_predictions.ipynbheatmap_check_predictions.ipynbbinary_heatmap_check_predictions.ipynb```The combined ROI check notebook reports binary Dice for the foreground prediction and panoptic-quality components RQ/SQ for final ROI predictions.## Limitations- Manual labels contain subjective decisions, so boundary and ROI-count disagreements can reflect annotation ambiguity.- Research use only.## CodeTraining and inference code:https://github.com/fedeceri85/cochlea-synapses-binary-segmentation-unet2d
README.md+109