Performance Evaluation of U-Net for Semantic Segmentation of Surface Defects in the Casting Surface Defect Dataset

Keywords: Casting Surface Defect Dataset, Class imbalance, Defect-aware sampling, Semantic segmentation, U-Net

Abstract

Accurate segmentation of casting surface defects is challenging because high-resolution images contain small and severely imbalanced defect regions. This study evaluates U-Net with a ResNet34 encoder for semantic segmentation of scratch, spot, and rust defects using the Casting Surface Defect Dataset (CSDD). The dataset comprises 2,100 RGB images (3,648 × 3,648 pixels), partitioned into 1,343 training, 335 validation, and 422 test images. The model was trained on 768 × 768-pixel patches using defect-aware sampling and a combined cross-entropy and soft Dice loss. A validation-based learning-rate search preceded three independent training runs with random seeds 2027, 2028, and 2029. Full-resolution predictions were reconstructed using overlapping sliding windows and uniform logit averaging. On the official test set, the model achieved a mean defect-mIoU of 60.004 ± 0.264%, four-class mIoU of 69.978 ± 0.198%, and macro Dice of 74.539 ± 0.205%. Class-wise IoU was 72.857% for scratch, 58.084% for spot, and 49.072% for rust. Qualitative results revealed missed rust regions and inaccuracies in defect boundaries. These findings identify rust segmentation as a priority for further improvement.

Downloads

Download data is not yet available.
Published
2026-11-17