Ordinal Semantic Segmentation Applied to Medical and Odontological Images
Authors: Mariana Dória Prata Lima, Gilson Antonio Giraldi, Jaime S. Cardoso
Organizations: 1, 2National Laboratory for Scientific Computing, Petrópolis, Rio de Janeiro, Brazil. · 3INESC TEC, Faculty of Engineering, University of Porto, Porto, Portugal.
Semantic segmentation consists of assigning a semantic label to each pixel according to predefined classes. This process facilitates the understanding of object appearance and spatial relationships, playing an important role in the global interpretation of image content. Although modern deep learning approaches achieve high accuracy, they often ignore ordinal relationships among classes, which may encode important domain knowledge for scene interpretation. In this work, loss functions that incorporate ordinal relationships into deep neural networks are investigated to promote greater semantic consistency in semantic segmentation tasks. These loss functions are categorized as unimodal, quasi-unimodal, and spatial. Unimodal losses constrain the predicted probability distribution according to the class ordering, while quasi-unimodal losses relax this constraint by allowing small variations while preserving ordinal coherence. Spatial losses penalize semantic inconsistencies between neighboring pixels, encouraging smoother transitions in the image space. In particular, this study adapts loss functions originally proposed for ordinal classification to ordinal semantic segmentation. Among them, the Expanded Mean Squared Error (EXP_MSE), the Quasi-Unimodal Loss (QUL), and the spatial Contact Surface Loss using Signal Distance Function (CSSDF) are investigated. These approaches have shown promising results in medical imaging, improving robustness, generalization, and anatomical consistency.
Figures & tables
Figure 1: Sample images and their corresponding ordinal masks from each dataset. The datasets are organized as follows: (a) Breast Cervix-MobileODT; (b) Mobbio; (c)Teeth-UCV; (d) Teeth-ISBI; and (e) Breast Aesthetics.
Dataset
CE
CE + QUL
CE + EXP_MSE
CE + CSSDF
Breast Aesthetics
0.2±0.2
0.1±0.0
0.1±0.0
0.1±0.1
Cervix-MobileODT
14.5±3.3
1.2±0.5
1.0±0.6
13.2±1.5
Mobbio
12.3±0.5
3.8±0.1
3.8±0.5
12.1±0.3
Teeth-ISBI
30.0±3.9
26.2±2.5
26.8±2.1
27.2±1.5
Teeth-UCV
7.0±1.4
3.1±0.6
5.9±0.9
5.6±0.8
Table 1: Overall results of the contact surface metric (%), a structural metric that evaluates consistency between adjacent pixels. Lower values indicate better performance.
Dataset
CE
CE + QUL
CE + EXP_MSE
CE + CSSDF
Breast Aesthetics
6.2±0.7
7.3±0.6
6.5±2.0
7.0±1.2
Cervix-MobileODT
1.0±0.2
1.0±0.2
1.6±0.3
0.8±0.2
Mobbio
0.8±0.1
0.9±0.2
0.9±0.3
0.7±0.3
Teeth-ISBI
9.6±3.4
12.3±4.2
12.1±3.8
13.7±3.5
Teeth-UCV
18.0±1.8
25.5±7.2
25.8±6.9
20.1±5.0
Table 2: Overall results for the unimodal pixels metric (%), a representation metric that evaluates ordinal consistency at the pixel level. Higher values indicate better performance.
Dataset
CE
CE + QUL
CE + EXP_MSE
CE + CSSDF
Breast Aesthetics
93.8±0.5
94.4±0.4
94.4±0.2
93.7±0.8
Cervix-MobileODT
77.0±0.7
77.2±0.2
77.3±0.2
76.8±0.3
Mobbio
93.8±0.1
93.8±0.5
94.0±0.1
93.8±0.1
Teeth-ISBI
74.0±1.6
75.6±0.3
74.6±0.2
75.3±1.5
Teeth-UCV
90.2±0.5
90.8±0.4
90.2±0.4
90.1±0.1
Table 3: Overall results for the Dice coefficient metric (%). Higher values indicate better performance.
Dataset
CE
CE + O2
CE + QUL
CE + EXP_MSE
Breast Aesthetics
0.2±0.2
0.2±0.2
0.1±0.0
0.1±0.0
Cervix-MobileODT
14.5±3.3
1.1±0.4
1.2±0.5
1.0±0.6
Mobbio
12.3±0.5
4.2±0.2
3.8±0.1
3.8±0.5
Teeth-ISBI
30.0±3.9
26.1±2.4
26.2±2.5
26.8±2.1
Teeth-UCV
7.0±1.4
3.0±0.7
3.1±0.6
5.9±0.9
Table 4: Comparison of the unimodal loss functions proposed in this work with the CE+O2 (Section 2.1.3 ) loss presented in Cruz et al. (2025) , using the contact surface metric ( % ). Again, lower values indicate better performance.
Dataset
CE
CE + O2
CE + QUL
CE + EXP_MSE
Breast Aesthetics
6.2±0.7
8.1±2.6
7.3±0.6
6.5±2.0
Cervix-MobileODT
1.0±0.2
98.9±0.4
1.0±0.2
1.6±0.3
Mobbio
0.8±0.1
97.3±2.6
0.9±0.2
0.9±0.3
Teeth-ISBI
9.6±3.4
97.1±3.8
12.3±4.2
12.1±3.8
Teeth-UCV
18.0±1.8
96.8±1.0
25.5±7.2
25.8±6.9
Table 5: Comparison of the unimodal loss functions investigated in this work with the CE+02 (Section 2.1.3 ) loss presented in Cruz et al. (2025) , using the percentage of unimodal pixels metric ( % ). Again, higher values indicate better performance.
Dataset
CE
CE + O2
CE + QUL
CE + EXP_MSE
Breast Aesthetics
93.8±0.5
94.2±0.6
94.4±0.4
94.4±0.2
Cervix-MobileODT
77.0±0.7
77.2±0.4
77.2±0.2
77.3±0.2
Mobbio
93.8±0.1
94.1±0.0
93.8±0.5
94.0±0.1
Teeth-ISBI
74.0±1.6
74.8±0.4
75.6±0.3
74.6±0.2
Teeth-UCV
90.2±0.5
90.8±0.4
90.8±0.4
90.2±0.4
Table 6: Comparison of the unimodal loss functions investigated in this work with the CE+02 (Section 2.1.3 ) loss presented in Cruz et al. (2025) , using the Dice coefficient metric ( % ). Again, higher values indicate better performance.
Dataset
CE
CE + CSNP
CE + CSDT
CE + CSSDF
Breast Aesthetics
0.2±0.2
0.1±0.1
0.2±0.2
0.1±0.1
Cervix-MobileODT
14.5±3.3
10.8±2.7
13.6±1.7
13.2±1.5
Mobbio
12.3±0.5
12.3±0.4
12.4±0.6
12.1±0.3
Teeth-ISBI
30.0±3.9
28.4±1.4
27.1±1.8
27.2±1.5
Teeth-UCV
7.0±1.4
2.3±1.0
5.5±1.0
5.6±0.8
Table 7: Comparison of the structured loss functions investigated in this work with the CE+CSNP (Section 2.2.2 ) and CE+CSDT (Section 2.1.5 ) losses presented in Cruz et al. (2025) , using the contact surface metric (%). Again, lower values indicate better performance.
Dataset
CE
CE + CSNP
CE + CSDT
CE + CSSDF
Breast Aesthetics
93.8±0.5
94.0±0.5
94.0±0.4
93.7±0.8
Cervix-MobileODT
77.0±0.7
77.4±0.2
76.9±0.7
76.8±0.3
Mobbio
93.8±0.1
93.8±0.0
93.7±0.2
93.8±0.1
Teeth-ISBI
74.0±1.6
74.9±1.4
75.3±1.3
75.3±1.5
Teeth-UCV
90.2±0.5
90.5±0.3
90.3±0.3
90.1±0.1
Table 8: Comparison of the structured loss functions investigated in this work with the CE+CSNP (Section 2.2.2 ) and CE+CSDT (Section 2.1.5 ) losses presented in Cruz et al. (2025) , using the Dice coefficient metric (%). Again, higher values indicate better performance.
Dataset
CE
CE + CSNP
CE + CSDT
CE + CSSDF
Breast Aesthetics
6.2±0.7
5.9±2.1
6.2±1.5
7.0±1.2
Cervix-MobileODT
1.0±0.2
0.5±0.2
0.9±0.3
0.8±0.2
Mobbio
0.8±0.1
0.9±0.2
0.7±0.2
0.7±0.3
Teeth-ISBI
9.6±3.4
11.2±4.6
13.5±3.4
13.7±3.5
Teeth-UCV
18.0±1.8
25.7±6.8
19.7±4.1
20.1±5.0
Table 9: Comparison of the structured loss functions investigated in this work with the CE+CSNP (Section 2.2.2 ) and CE+CSDT (Section 2.1.5 ) losses presented in Cruz et al. (2025) , using the unimodal pixels metric (%). Again, higher values indicate better performance.
In many prediction problems in medical applications, target labels exhibit an inherent ordinal structure, where class ordering reflects clinically meaningful severity levels. The cost associated with misclassification is often non-uniform and asymmetric, as errors between distant ordinal categories may have substantially more severe consequences than errors between adjacent ones, and overestimating disease severity may have different clinical implications than underestimating it. Traditional loss functions such as multi-class cross-entropy treat all misclassifications equally and fail to incorporate this ordering information. Recent advances in ordinal regression aim to address this limitation by integrating rank-based structures into deep learning models. In this work, we introduce the Ordinal Cross-Entropy (OCE) framework, a general and architecture-independent approach for learning from ordinal data. The proposed method extends the standard cross-entropy formulation to account for misclassification severity through an ordinal cost matrix while preserving the probabilistic interpretation and optimization benefits of the conventional loss. We provide a theoretical analysis of the OCE gradient behavior and show that it yields smoother optimization dynamics and improved ordinal consistency. Experiments on benchmark datasets show that our method achieves lower prediction error costs and better calibration compared to existing state-of-the-art ordinal approaches, establishing OCE as a simple yet effective solution for ordinal regression in deep neural networks.
Ordinal regression is widely used in scenarios where labels are discrete yet inherently ordered. In practice, however, ordinal labels are often obtained by discretizing underlying continuous semantics through subjective human judgment, resulting in ambiguous boundaries and annotation noise. Such uncertainty challenges existing methods that rely on fixed supervision targets, which may reinforce biased ordering under subjective annotations. To address this limitation, we propose D3O, a dynamic distribution distillation framework that replaces static supervision with training-driven evolution of ordinal label distributions via self-distillation. Specifically, we introduce a contrastive ordinal-aware label enhancement module that leverages vision-language alignment to recover refined label distributions capturing both inter-class ambiguity and instance-level uncertainty. Furthermore, we design a CDF-based cross-layer interaction distillation mechanism to propagate cumulative ordinal structure across network hierarchy, ensuring consistent ordinal geometry in intermediate representations. Extensive experiments on four general ordinal regression tasks demonstrate that our proposed D3O consistently outperforms existing approaches, particularly under severe class imbalance and noisy supervision. These results highlight the effectiveness of dynamic supervision in learning robust ordinal representations beyond fixed targets. The code will be publicly available.
Medical image segmentation is a fundamental task for medical image processing and computer-assisted intervention, yet data imbalance and small lesion detection pose significant challenges. Dice Loss, which measures the overlap between predicted and ground truth regions, is widely used to mitigate these issues. To further emphasize its properties, we propose Polynomial Dice Loss, a polynomial extension of Dice Loss. Specifically, by leveraging the geometric characteristics of Dice Loss and formulating the loss function as a polynomial representation via Taylor expansion, we enable the adjustment of the contribution of higher-order components to the loss function. In our experiments, we evaluate the proposed method against loss functions derived from conventional Dice and Tversky coefficients. Experimental results and further analysis show that the polynomial formulation provides a simple way to control the loss shape and achieves competitive performance across multiple segmentation settings.
Hiroaki Aizawa
Graduate School of Advanced Science and Engineering Hiroshima University Higashi-Hiroshima, Japan