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.