The binary segmentation of whiteboard strokes is hindered by extreme class imbalance, caused by stroke pixels that constitute only 1.79 of the image on average, and in addition, the thin-stroke subset averages 1.14 in the foreground. Standard region metrics (F1, IoU) can mask thin-stroke failures because the vast majority of the background dominates the score. In contrast, adding boundary-aware metrics and a thin-subset equity analysis changes how loss functions rank and exposes hidden trade-offs. We contribute an evaluation protocol that jointly examines region metrics, boundary metrics (BF1, B-IoU), a core/thin-subset equity analysis, and per-image robustness statistics (median, IQR, worst-case) under seeded, multi-run training with non-parametric significance testing. Five losses -- cross-entropy, focal, Dice, Dice+focal, and Tversky -- are trained three times each on a DeepLabV3-MobileNetV3 model and evaluated on 12 held-out images split into core and thin subsets. Overlap-based losses improve F1 by more than 20 points over cross-entropy (0.663 vs 0.438, p<0.001). In addition, the boundary metrics confirm that the gain extends to the precision of the contour. Adaptive thresholding and Sauvola binarization at native resolution achieve a higher mean F1 (0.787 for Sauvola) but with substantially worse worst-case performance (F1 =0.452 vs 0.565 for Tversky), exposing a consistency-accuracy trade-off: classical baselines lead on mean F1 while the learned model delivers higher worst-case reliability. Doubling training resolution further increases F1 by 12.7 points.
Figures & tables
Property
Value
Original images
34
Augmented images
340
Total training samples
374
Native resolutions
3712×2784 , 3968×2232
Stroke coverage (mean)
1.79%
Stroke coverage (range)
0.52%–4.94%
Table 1. Dataset summary.
Loss
F1
IoU
BF1
B-IoU
CE
0.438±
0.011
0.288±
0.009
0.594±
0.007
0.291±
0.010
Focal
0.430±
0.012
0.283±
0.009
0.589±
0.013
0.285±
0.009
Dice
0.650±
0.004
0.486±
0.005
0.674±
0.002
0.490±
0.005
Dice+Focal
0.657±
0.005
0.494±
0.006
0.676±
0.002
0.497±
0.005
Tversky
0.663±
0.002
0.500±
0.002
0.646±
0.003
0.505±
0.002
Adaptive (baseline)
0.761±
0.112
0.626±
0.132
0.853±
0.231
0.628±
0.130
Table 2. Loss ablation at 1536×1152 on 12 held-out test images (mean ± std across three seeds). Classical baselines (Table 6 ) are evaluated at native resolution. Dice-family losses improve F1 by more than 20 points over CE.
Figure 1. Region and boundary metrics per loss function. Dice-based objectives form a clearly separated, higher-performance cluster.
Loss
Core F1
Thin F1
Gap
CE
0.480±
0.010
0.378±
0.013
0.102
Focal
0.476±
0.010
0.367±
0.015
0.109
Dice
0.674±
0.006
0.618±
0.003
0.056
Dice+Focal
0.685±
0.009
0.618±
0.003
0.067
Tversky
0.689±
0.003
0.628±
0.001
0.061
Table 3. Core vs. thin-subset F1. Dice-family losses halve the performance gap between subsets compared with CE/Focal, indicating better generalization to thin strokes.
Figure 2. Core vs. thin F1 per loss. Dice-family losses narrow the gap, with Tversky showing the most balanced performance.
Figure 3. Core–thin F1 gap per loss. A smaller gap indicates more equitable treatment of thin strokes.
Comparison
Δ F1 (mean)
Δ F1 (median)
p (Wilcoxon)
Sig.
CE vs. Focal
0.0074
0.0063
0.2661
n.s.
CE vs. Dice
−0.2126
−0.2253
0.0005
CE vs. Dice+Focal
−0.2189
−0.2214
0.0005
CE vs. Tversky
−0.2256
−0.2369
0.0005
Focal vs. Dice
−0.2199
−0.2346
0.0005
Focal vs. Dice+Focal
−0.2262
−0.2392
0.0005
Table 4. Pairwise comparisons with mean and median per-image effect sizes (seed-averaged). *** = p<0.001 (Wilcoxon, Bonferroni-corrected, α=0.005 ); n.s. = not significant.
Resolution
F1
IoU
BF1
B-IoU
1024 × 768
0.530±
0.005
0.369±
0.006
0.491±
0.006
0.372±
0.006
1536 × 1152
0.657±
0.005
0.494±
0.006
0.676±
0.002
0.497±
0.005
Table 5. Resolution ablation (Dice+Focal, three seeds). Doubling resolution yields a +13-point F1 gain and an even larger boundary-metric improvement.
Figure 4. Resolution comparison for Dice+Focal. Boundary metrics benefit more than region metrics from higher resolution.
Method
F1
IoU
BF1
B-IoU
Adaptive
0.761±
0.112
0.626±
0.132
0.853±
0.231
0.628±
0.130
Otsu
0.059±
0.027
0.031±
0.014
0.202±
0.067
0.055±
0.021
Sauvola
0.787±
0.112
0.660±
0.131
0.860±
0.229
0.663±
0.131
Table 6. Classical baselines at original resolution. Sauvola and adaptive thresholding achieve high means but show the widest per-image spread in the study; Otsu fails entirely.
Figure 5. Classical baseline failure cases. Rows are the three images where Sauvola binarization scores lowest. Columns: original image, ground truth, Sauvola prediction, Tversky prediction, and error overlays (green = TP, red = FN, blue = FP). The deep model provides more consistent segmentation on challenging boards.
Method
Mean
Median
IQR
Min
Max
Wins/12
CE
0.438
0.413
0.157
0.230
0.667
1/12
Focal
0.430
0.398
0.183
0.223
0.684
1/12
Dice
0.650
0.653
0.054
0.542
0.791
1/12
Dice+Focal
0.657
0.649
0.072
0.528
0.789
2/12
Tversky
0.663
0.651
0.066
0.565
0.795
1/12
Sauvola
0.787
0.800
0.081
0.452
0.893
10/12
Table 7. Robustness profile (per-image F1, seed-averaged). Deep models exhibit tighter IQR and higher worst-case F1 than classical baselines despite a lower mean. “Wins/12” = number of test images where the method’s F1 exceeds the best deep model’s (for classical rows) or Sauvola’s (for deep rows).
Figure 6. Per-image F1: Sauvola (x-axis) vs. Tversky (y-axis). Points below the diagonal are images where Tversky outperforms the baseline. Diamonds = thin-stroke images.
Figure 7. Per-image F1 across losses. Dice-family losses are more consistent; CE/Focal show large per-image variation.
Figure 8. Training curves for each loss. Dice-family losses show a gradual, steady descent; CE/Focal converge early and plateau.
Figure 9. Qualitative predictions on thin-stroke images. Dice-family losses maintain stroke continuity where CE/Focal fragment.
Figure 10. Error maps for thin-stroke images. Green = true positive, red = false negative, blue = false positive. CE/Focal show extensive false negatives on fine strokes.
Figure 11. Qualitative predictions across the full test set. Performance trends observed on thin strokes generalise to standard images.
Figure 12. Error maps for the full test set. Dice-family losses consistently reduce false negatives compared with CE/Focal.
Figure 13. Metric heatmap across losses × seeds. Boundary metrics differentiate models that region metrics rank similarly.