Nuclear segmentation, classification and quantification in H&E stained images of colon
The CoNIC grand challenge, and what our model actually scored.
Published 12 December 2022 · PRR.AI research team
The Colon Nuclei Identification and Counting (CoNIC) challenge asked entrants to segment, classify and count six types of nuclei across the largest publicly available nuclei-level dataset in computational pathology — roughly half a million labelled nuclei. We entered. This is the method and the result, including where we placed.
The objective
Nuclear segmentation, classification and quantification in H&E-stained histology images produce interpretable, cell-level features that downstream computational pathology models can use. CoNIC set two tasks:
- Task 1 — nuclear segmentation and classification. Segment each nucleus within the tissue and classify it as epithelial, lymphocyte, plasma, eosinophil, neutrophil or connective tissue.
- Task 2 — cellular composition. Predict how many nuclei of each class are present in each input image. Task 1’s output can feed Task 2 directly, but the two can also be treated independently.
Dataset
We used the Lizard dataset, the largest publicly available dataset for instance segmentation in computational pathology. It holds H&E-stained histology images at 20× objective magnification (roughly 0.5 microns per pixel) drawn from six different sources, with an instance segmentation mask and a classification mask provided for every image.
Training
Lizard provides 238 images of varying size, from which we extracted patches. We split 204 images for training and 34 for validation, extracted 244×244 patches with a random overlap between 150 and 200 pixels per image, and applied mirror padding at the edges to bring each patch to 256×256.
Two preprocessing decisions mattered more than the rest. We applied Reinhard colour normalisation at patch level to address stain variation across the six sources. And we added a hematoxylin branch.
The reasoning behind that second choice: H&E staining has a useful property we can exploit as guidance rather than treat as noise. We apply colour decomposition (Ruifrok et al., 2001) to separate the hematoxylin component from the original RGB image — a technique normally used for colour normalisation, because it is robust to the colour inconsistency endemic to H&E whole slide images. Assuming grey level in each RGB channel is linear with the light transmission rate, each stain is characterised by a specific absorption factor per channel, and the relationship between stain quantity and absorption follows the Beer–Lambert law.
Augmentation was affine transformation, rotation, flipping and Gaussian blur. We introduced some background-free images using the instance map label, containing only nuclei of the different classes. Optimisation used Adam with a StepLR scheduler, trained on a single split for 70 epochs, at which point the loss rate flattened.
Architecture
The model has two encoder channels and five decoder channels, several of them interconnected by PDFA blocks. We used Preact-ResNet as the encoder backbone rather than ResNet, it being the updated variant for classification.
Encoder channels
- RGB image channel — extracts raw image features.
- Hematoxylin channel — collects hematoxylin-aware contour features.
- PDFA blocks — as defined in the Triple U-Net models, combining raw image features into the hematoxylin-aware branch.
Decoder channels
- Nuclei pixel segmentation
- Horizontal and vertical map segmentation
- Nuclei classification
- Hematoxylin output
Post-processing
We combine the nuclei pixel prediction with the horizontal and vertical map result to produce the final segmentation, similar to HoVer-Net post-processing. The hematoxylin and RGB output channels are discarded at this stage — during training they share feature extraction information with the other channels through the PDFA blocks, which is their purpose. For cellular composition, the classification branch supplies the class and the pixel prediction branch supplies the counts.
Evaluation
Task 1 was scored on multi-class panoptic quality (mPQ). For each type, PQ matches predicted instances to ground truth where IoU > 0.5, splitting instances into matched pairs, unmatched ground truth and unmatched predictions. We calculate the statistics over all images rather than per image, so a class absent from a particular patch causes no problem — CoNIC refers to this variant as mPQ+. Task 2 was scored on the multi-class coefficient of determination between predicted and true counts, calculated per class and averaged.
Results
We trained multiple models across different preprocessing, hyperparameters and patch samples. On training data we reached a PQ of 0.68 and an mPQ of 0.51. On the challenge’s unseen test data, in the final submission:
Conclusion
The cellular composition result is the more useful of the two for the work that followed. Counting nuclei by class accurately is what makes downstream quantitative features — immune infiltration, stromal composition, tumour heterogeneity — worth computing at all. The segmentation placing was mid-field; the composition placing was not, and that is the part the Computer Vision AI platform builds on.
References
- Graham S, Jahanifar M, Vu QD, et al. CoNIC: Colon Nuclei Identification and Counting Challenge 2022.
- Graham S, Jahanifar M, Azam A, et al. Lizard: A Large-Scale Dataset for Colonic Nuclear Instance Segmentation and Classification. ICCV Workshops, 2021.
- Ruifrok AC, Johnston DA. Quantification of histochemical staining by color deconvolution. Anal Quant Cytol Histol. 2001;23(4):291–299.
- Graham S, Vu QD, Raza SEA, et al. HoVer-Net: Simultaneous segmentation and classification of nuclei in multi-tissue histology images. Med Image Anal. 2019;58:101563.
- Reinhard E, Adhikhmin M, Gooch B, Shirley P. Color transfer between images. IEEE Comput Graph Appl. 2001;21(5):34–41.
See PRR.AI on your data
Bring a workflow, an interface list and a compliance question. We will show you what the platform already does and what it would take to fit yours.
Request a demo