Loss Function Evaluation

Published:

We present a twofold contribution to improving grain-tracing U-nets.

  • First, we introduce a systematic data augmentation pipeline that uses GIMP to crop each image and its corresponding ground-truth tracing into aligned sub-images. This approach expands the training set while preserving trace integrity.
  • Second, we examine binary cross-entropy (BCE) loss and demonstrate its tendency to double-penalize slight misalignments.

To address that, we develop two evaluation metrics: a binary “top-hat” criterion that rewards traces within a fixed-pixel dilation and a continuous normalized Gaussian dilation loss that smoothly interpolates reward and penalty based on distance.

By constructing dilated reward masks and computing point-wise products within network outputs, we obtain loss curves that decrease monotonically over 0-300 training epochs, consistent with the trend of qualitative visual improvements. These methods offer a robust framework for data generation and performance evaluation in U-net tasks.

Download Slides