Towards High-Quality Image Segmentation: Improving Topology Accuracy by Penalizing Neighbor Pixels
Organizations: Technical University of Denmark
Abstract
Standard deep learning models for image segmentation cannot guarantee topology accuracy, failing to preserve the correct number of connected components or structures. This, in turn, affects the quality of the segmentations and compromises the reliability of the subsequent quantification analyses. Previous works have proposed to enhance topology accuracy with specialized frameworks, architectures, and loss functions. However, these methods are often cumbersome to integrate into existing training pipelines, they are computationally very expensive, or they are restricted to structures with tubular morphology. We present SCNP, an efficient method that improves topology accuracy by penalizing the logits with their poorest-classified neighbor, forcing the model to improve the prediction at the pixels' neighbors before allowing it to improve the pixels themselves. We show the effectiveness of SCNP across 13 datasets, covering different structure morphologies and image modalities, and integrate it into three frameworks for semantic and instance segmentation. Additionally, we show that SCNP can be integrated into several loss functions, making them improve topology accuracy. Our code can be found at https://jmlipman.github.io/SCNP-SameClassNeighborPenalization.
Figures & tables
| ( 9.69) | ( 7.23) | ( 4.70) | |
| 3 | 6.94 1.47 | 7.12 1.80 | 8.57 1.98 |
| 5 | 5.64 1.34 | 5.96 1.51 | 7.79 1.63 |
| 7 | 4.87 1.20 | 5.45 1.61 | 7.78 1.90 |
| 9 | 4.79 1.31 | 7.14 2.86 | 7.89 2.34 |
| 11 | 7.80 1.87 | 11.02 2.55 | 18.65 3.72 |
| Loss | Dice | clDice | |
| CE | 0.92 0.0 | 11.93 2.92 | 0.92 0.0 |
| ( ours ) | 0.92 0.0 | 7.53 1.74 | 0.92 0.0 |
| Dice | 0.92 0.0 | 12.03 3.4 | 0.92 0.0 |
| ( ours ) | 0.92 0.0 | 7.88 2.03 | 0.92 0.0 |
| CEDice | 0.92 0.0 | 10.82 2.71 | 0.92 0.0 |
| CEDice+ ( ours ) | 0.92 0.0 | 6.94 1.47 | 0.92 0.0 |
Appendix figures & tables20 assets
Supplementary material from the paper’s appendix.
Appendix
| Loss | Epoch time (sec.) | GPU (MiB) |
| CEDice | 54.85 | 5350 |
| clDice ( ) | 181.78 | 19340 |
| SkelRecall | 115.59 | 5334 |
| TopoLoss | 1505 | 5334 |
| RWLoss | 56.59 | 5778 |
| Tversky ( ) | 54.76 | 5326 |
| Loss | Iteration time (sec.) | GPU (MiB) |
| CEDice | 72.79 | 6644 |
| clDice ( ) | 199.10 | 38672 |
| SkelRecall | 157.17 | 7784 |
| TopoLoss | 12960 | 6632 |
| RWLoss | 79.42 | 6864 |
| Tversky ( ) | 73.02 | 6644 |
| Dataset | CEDice | •(CEDice) | SCNP ( ) |
| FIVES | 10.82 2.71 | 8.79 2.47 | 6.94 1.47 |
| DeepGlobeRoads | 11.77 3.17 | 9.92 2.83 | 6.56 2.25 |
| CirrMRI600 | 0.27 0.26 | 0.19 0.13 | 0.12 0.05 |
| NuInsSeg | 8.18 2.39 | 8.17 2.40 | 7.53 2.20 |
| FIVES | • Blood vessels in fundus retina images • Semantic segmentation • R,G,B • 2048 2048 pixels | Splits: 480-120-200 (train, validation, test) | |
| PulmonaryVA | • Pulmonary arteries and veins in chest CT scans • Semantic segmentation • CT • 184 235 262.5 voxels (median) | Dataset size: 106 (five-fold cross validation) | |
| Axons | • Axons in mouse brain • Semantic segmentation • Electron-microscopy • 1062.5 1067 285 voxels (median) | Dataset size: 10 (five-fold cross validation) Sham_HM_25_contra—ipsi, Sham_HM_49_contra—ipsi, TBI_HM_24_contra—ipsi, TBI_HM_28_contra—ipsi, TBI_HM_2_contra—ipsi |
| TopoMortar | • Mortar in red brick wall images • Semantic segmentation • R,G,B • 512 512 pixels | Splits: 50-20-350 (train, validation, test) | |
| Crack500 | • Cracks in concrete images • Semantic segmentation • R,G,B • 640 896 Pixels (median) | Splits: 250-50-200 (train, validation, test) | |
| DeepGlobeRoads | • Roads in satellite images • Semantic segmentation • R,G,B • 1024 1024 pixels (median) | Splits: 4357-623-1246 (train, validation, test) |
| CirrMRI600 | • Cirrhotic liver in MRI • Semantic segmentation • T2w • 320 260 80 voxels (median) | Splits: 198-50-31 (train, validation, test) | |
| ATLAS2 | • Lesion in brain MRI • Semantic segmentation • T1w • 197 233 189 voxels (median) | Dataset size: 655 (five-fold cross validation) | |
| ISLES24 | • Ischemic lesion in brain MRI • Semantic segmentation • ADC, DWI • 512 581 69 voxels (median) | Dataset size: 149 (five-fold cross validation) | |
| MSLesSeg | • Multiple sclerosis lesion in brain MRI • Semantic segmentation • T1w, T2w, FLAIR • 182 218 182 voxels (median) | Splits: 74-19-22 (train, validation, test) |
| NuInsSeg | • Cell nuclei in H&E-stained histological images • Instance segmentation • R,G,B • 512 512 pixels (median) | Splits: 532-66-67 (train, validation, test) | |
| IHC_TMA | • Cell nuclei in immunohistochemical tissue microarray images • Instance segmentation • R,G,B • 256 256 pixels (median) | Splits: 212-27-27 (train, validation, test) | |
| LyNSeC | • Lymphoma nuclei in H&E-stained histological images • Instance segmentation • R,G,B • 512 512 pixels (median) | Splits: 559-70-70 (train, validation, test) |
| Dataset | Eps. w/ TopoLoss | % of train time |
| FIVES | 38 (1000) | 44.20% |
| PulmonaryVA | 3 (1000) | 34.30% |
| Axons | 5 (1000) | 51.88% |
| TopoMortar | 3600 (12000) | 87.86% |
| Crack500 | 3600 (12000) | 62.65% |
| DeepGlobeRoads | 3600 (12000) | 41.50% |
| Loss | Dice | clDice | ||
| FIVES | CEDice | 0.92 0.0 | 10.82 2.71 | 0.92 0.0 |
| clDice ( ) | 0.91 0.0 | 36.55 10.70 | 0.91 0.01 | |
| SkelRecall | 0.91 0.0 | 12.45 4.25 | 0.91 0.0 | |
| TopoLoss | 0.92 0.0 | 8.09 2.45 | 0.92 0.0 | |
| RWLoss | 0.92 0.0 | 15.99 5.35 | 0.92 0.0 | |
| Tversky ( ) | 0.92 0.0 | 12.22 3.45 | 0.92 0.0 |
| Loss | Dice | clDice | ||
| TopoMortar | CEDice | 0.67 0.03 | 25.06 9.26 | 0.75 0.03 |
| clDice ( ) | 0.68 0.02 | 21.40 5.86 | 0.75 0.02 | |
| SkelRecall | 0.68 0.02 | 23.64 7.30 | 0.76 0.02 | |
| TopoLoss | 0.67 0.02 | 27.22 7.64 | 0.74 0.02 | |
| RWLoss | 0.54 0.30 | 19.40 13.80 | 0.76 0.03 | |
| Tversky ( ) | 0.68 0.02 | 22.59 6.46 | 0.75 0.02 |
| Loss | Dice | ||
| CirrMRI600 | CEDice | 0.97 0.01 | 0.27 0.26 |
| TopoLoss | 0.97 0.01 | 0.32 0.28 | |
| RWLoss | 0.96 0.01 | 0.43 0.31 | |
| Tversky ( ) | 0.95 0.0 | 1.39 1.49 | |
| Focal | 0.97 0.01 | 0.51 0.30 | |
| CEDice+ | 0.97 0.01 | 0.17 0.09 |
| Loss | Dice | |||
| NuInsSeg | CEDice | 0.76 0.04 | 8.18 2.39 | 0.91 0.01 |
| TopoLoss | 0.28 0.01 | 13.35 9.23 | 0.76 0.04 | |
| RWLoss | 0.72 0.04 | 8.42 3.04 | 0.90 0.01 | |
| Tversky ( ) | 0.77 0.03 | 7.94 2.91 | 0.90 0.01 | |
| Focal | 0.71 0.03 | 9.25 2.05 | 0.89 0.01 | |
| CEDice+ | 0.76 0.04 | 7.95 2.21 | 0.91 0.01 |
| 9.69 | 7.23 | 4.70 | |
| 3 | 0.92 0.0 | 0.92 0.0 | 0.92 0.0 |
| 5 | 0.92 0.0 | 0.92 0.0 | 0.92 0.0 |
| 7 | 0.92 0.0 | 0.91 0.0 | 0.91 0.0 |
| 9 | 0.9 0.0 | 0.89 0.0 | 0.9 0.0 |
| 11 | 0.92 0.0 | 0.91 0.0 | 0.92 0.0 |
| 9.69 | 7.23 | 4.70 | |
| 3 | 0.92 0.0 | 0.92 0.0 | 0.92 0.0 |
| 5 | 0.91 0.0 | 0.91 0.0 | 0.92 0.0 |
| 7 | 0.9 0.0 | 0.89 0.0 | 0.9 0.0 |
| 9 | 0.88 0.0 | 0.87 0.0 | 0.88 0.0 |
| 11 | 0.91 0.0 | 0.91 0.0 | 0.92 0.0 |
Topology-Preserving Image Segmentation
Topology-preserving image segmentation models image regions while maintaining structural properties such as connectivity, branches, and holes.
See all 43 papers