Corrosion segmentation based on the UNet architecture and the impact of loss functions

Corrosion is a natural phenomenon that causes significant material and economic losses. Timely inspection of corroded assets is vital for preventing such losses. Visual inspection is a non-destructive method that is commonly used for corrosion detection. The ability of deep learning methods to capture corrosion visual information allows for the automation of the manual inspection process. The literature includes several examples of deep learning models to detect metal corrosion. In developing such models, loss functions are crucial and directly influence the models’ performance. Although cross-entropy is a commonly used objective function for corrosion detection, systematic evaluation of alternative loss functions—and the performance gains they may unlock—has been largely neglected. This study uses eight loss functions, namely, cross-entropy loss, Focal loss, Unified Focal loss, Dice loss, Tversky loss, Focal Tversky loss, Combo loss, and Hybrid Focal loss, to train UNet-based models for corrosion segmentation and compares their performance. The results demonstrated that the model trained with the Dice loss achieved higher performance, with a mean Jaccard index value of 64.28%, while the Focal loss exhibited the lowest performance, with a mean Jaccard value of 57.20%. This study contributes to academia and practice by demonstrating the performance gains that can be achieved by tweaking the deep learning models using optimal loss functions. • Corrosion is a phenomenon that considerably impacts the environment and economy. • Deep learning models can be trained for corrosion detection, and loss functions are essential to developing accurate models. • This study evaluates the use of different loss functions, including the Focal loss, Unified Focal loss, Dice loss, Tversky loss, Focal Tversky loss, Combo loss, and Hybrid Focal loss, to train UNet-based models for corrosion segmentation. • On a standard dataset, the models developed with Combo loss, Tversky loss, Unified Focal loss, and Dice loss had higher performance than those developed with cross-entropy loss. • With the hyperparameter tuning, higher performance gains can be achieved.

Authors

Institutions

Publication Details

Journal
Journal of Building Engineering
Published
2026-02-01
DOI
https://doi.org/10.1016/j.jobe.2026.115502
Primary Topic
Infrastructure Maintenance and Monitoring
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Corrosion segmentation based on the UNet architecture and the impact of loss functions

Iraj Esmaeili, José Miguel Castro, João Poças Martins
Journal of Building Engineering
Infrastructure Maintenance and Monitoring
article

Corrosion segmentation based on the UNet architecture and the impact of loss functions

Iraj Esmaeili, José Miguel Castro, João Poças Martins
article en

Abstract

Corrosion is a natural phenomenon that causes significant material and economic losses. Timely inspection of corroded assets is vital for preventing such losses. Visual inspection is a non-destructive method that is commonly used for corrosion detection. The ability of deep learning methods to capture corrosion visual information allows for the automation of the manual inspection process. The literature includes several examples of deep learning models to detect metal corrosion. In developing such models, loss functions are crucial and directly influence the models’ performance. Although cross-entropy is a commonly used objective function for corrosion detection, systematic evaluation of alternative loss functions—and the performance gains they may unlock—has been largely neglected. This study uses eight loss functions, namely, cross-entropy loss, Focal loss, Unified Focal loss, Dice loss, Tversky loss, Focal Tversky loss, Combo loss, and Hybrid Focal loss, to train UNet-based models for corrosion segmentation and compares their performance. The results demonstrated that the model trained with the Dice loss achieved higher performance, with a mean Jaccard index value of 64.28%, while the Focal loss exhibited the lowest performance, with a mean Jaccard value of 57.20%. This study contributes to academia and practice by demonstrating the performance gains that can be achieved by tweaking the deep learning models using optimal loss functions. • Corrosion is a phenomenon that considerably impacts the environment and economy. • Deep learning models can be trained for corrosion detection, and loss functions are essential to developing accurate models. • This study evaluates the use of different loss functions, including the Focal loss, Unified Focal loss, Dice loss, Tversky loss, Focal Tversky loss, Combo loss, and Hybrid Focal loss, to train UNet-based models for corrosion segmentation. • On a standard dataset, the models developed with Combo loss, Tversky loss, Unified Focal loss, and Dice loss had higher performance than those developed with cross-entropy loss. • With the hyperparameter tuning, higher performance gains can be achieved.

Journal of Building EngineeringVol. 120
Universidade do Porto (PT)
Openalex Percentile: Top 69%
Infrastructure Maintenance and Monitoring
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.