NucSegAI is a deep learning model for automated nuclear segmentation and classification in H&E-stained histology images. NucSegAI is based on the HoverNet backbone, and is trained on H&E-stained images with paired multiplex immunofluorescence imaging data. The current model is optimized for non-small-cell lung cancer images.
- Create a new conda environment:
conda create -n nucsegai python=3.9
- Activate the environment:
conda activate nucsegai
- Install the library requirements for HoverNet:
pip install src_hovernet/requirements.txt
- Install the stain-tools:
pip install staintools
-
Images can be either patches/tiles in
.tiff
or whole-slide images (WSI) in.svs
. -
Images are assumed to be captured at 40X magnification, with a resolution of 0.25 um/pixel. Improper resolution will generate suboptimal results.
-
During model development, we found staining normalization is critical for generating accurate and consistent results. It is highly recommended to normalize the H&E staining before applying the model:
python3 stain_norm.py
-
Download the model weights ("NucSegAI_torch.tar") from the HuggingFace.
-
Place it into a
model_bin/
folder under the same directory with this repo. -
Run
src_hovernet/run_tile.sh
for tile inference orsrc_hovernet/run_wsi.sh
for WSI inference.
- StainTools: https://github.com/Peter554/StainTools
- HoverNet: https://github.com/vqdang/hover_net