1. Introduction
Potholes are a persistent road-safety and infrastructure-management problem. Beyond reducing ride quality and accelerating vehicle deterioration, they can contribute to sudden maneuvers, loss of control, and traffic disruption [
1,
2,
3]. Conventional inspection is labor-intensive, time-consuming, and difficult to apply consistently across large road networks [
1,
2]. Vision-based assessment offers a scalable alternative, and semantic segmentation is particularly useful because it estimates the complete damaged region rather than only a bounding box, thereby supporting localization, shape analysis, and area-based maintenance decisions [
4,
5,
6,
7,
8].
The principal deployment challenge is reliable operation after the imaging domain changes. Road material, surface texture, illumination, shadows, moisture, camera characteristics, viewing geometry, pothole scale, and annotation style can differ substantially across datasets. Dark stains, repaired asphalt, cracks, and cast shadows may also resemble pothole regions. Unsupervised domain-adaptation methods can mitigate such shifts when target-domain samples are available [
9,
10,
11,
12,
13]; however, target images may be unavailable before deployment or unsuitable for model calibration. The target-free setting considered here is, therefore, closer to single-source domain generalization: no target image is used for training, validation, threshold selection, fine-tuning, or post-processing calibration [
14,
15,
16,
17].
A related architectural limitation occurs in encoder–decoder networks. Skip connections restore spatial detail lost during downsampling, but they can also transmit source-specific texture responses directly into the decoder. Attention, Transformer context modeling, and boundary-aware supervision improve feature selectivity or contour quality [
18,
19,
20,
21,
22,
23,
24,
25,
26]; nevertheless, they do not necessarily regulate, at every decoder stage, the relative contribution of boundary-relevant encoder detail and higher-level decoder semantics. Under domain shift, unrestricted low-level features may strengthen responses to shadows, stains, and pavement patterns even when the global context does not support a pothole prediction.
To address this gap, PotholeBAF-Net combines an EfficientNet-B3 encoder, a Low-Rank Transformer Bridge, a four-stage BAF decoder, and a lightweight Boundary Refinement Head. The central novelty is stage-wise regulation of skip-feature transfer rather than the isolated use of attention or boundary cues. At each decoder stage, a learned soft boundary prior and lightweight channel–spatial attention precondition the encoder feature. A spatial–channel gate then performs pointwise interpolation between the refined skip and decoder representations, allowing semantic context to suppress unreliable detail while retaining boundary evidence. The refinement head subsequently improves local mask consistency using residual depthwise-separable operations.
The main contributions are as follows:
A BAF decoder that explicitly regulates skip transfer through boundary-conditioned enhancement, channel–spatial attention, and spatial–channel gated interpolation with decoder semantics. Unlike fixed concatenation or addition, the mechanism learns where and in which channels encoder detail should be retained or suppressed.
A compact Transformer bridge whose pre-softmax per-head attention affinity is rank-bounded by the query/key dimension. Applied to 144 bottleneck tokens, it supplies global road-scene context without full-resolution attention; the precise scope of the rank claim is established in
Section 3.5.2.
A lightweight residual depthwise-separable refinement design integrated with the regulated decoder output to improve spatial consistency while maintaining a practical parameter and computation budget.
The remainder of the paper is organized as follows.
Section 2 critically reviews pothole segmentation, boundary-aware learning, and cross-domain robustness.
Section 3 presents the datasets, architecture, theoretical formulation, training protocol, and evaluation criteria.
Section 4 reports the quantitative, statistical, computational, ablation, and failure-case analyses.
Section 5 concludes the paper and identifies limitations and future directions.
3. Materials and Methods
This section presents the methodological framework used for pothole segmentation under a strict zero-shot cross-dataset setting. All models are trained and validated on a public source dataset and externally tested on an independently collected target dataset. No target-domain images are used for training, validation, checkpoint selection, threshold calibration, fine-tuning, or post-processing calibration. The framework includes problem formulation, dataset preparation, annotation processing, preprocessing and augmentation, the proposed PotholeBAF-Net architecture, baseline models, training strategy, and evaluation metrics.
3.1. Problem Formulation
Pothole segmentation is formulated as a binary semantic segmentation problem. Given an RGB road image,
, the objective is to predict a pixel-wise mask,
, where foreground pixels correspond to pothole regions and background pixels correspond to the remaining road surface. The segmentation model
produces a single-channel logit map, which is converted into a probability map using the sigmoid function:
The final binary mask is obtained by applying a validation-selected threshold
:
where
is the predicted mask, and
denotes the indicator function.
Let
denote the Large Public Dataset (LPD), which is used for training and validation, and let
denote the Collected Taiz Dataset (CTD), which is used only for external testing. The model parameters are learned by minimizing the segmentation loss over the LPD training split:
After training, the optimized model is evaluated on the CTD without using any CTD image during training, validation, threshold selection, fine-tuning, or post-processing. This protocol ensures that the external test results reflect cross-dataset generalization rather than target-domain adaptation.
3.2. Datasets and Cross-Dataset Evaluation Protocol
Two datasets are used to evaluate pothole segmentation under source-to-target domain shift. The first dataset is the Pothole Segmentation YOLOv8 dataset obtained from Roboflow Universe [
52]. In this study, it is referred to as the Large Public Dataset (LPD) and is used as the source domain for training and validation. The dataset contains RGB pothole images with a spatial resolution of
pixels. Its annotations are provided in YOLOv8 segmentation format as normalized polygon coordinates stored in TXT files. During data loading, these polygon annotations are rasterized into binary masks, where pothole regions are assigned to the foreground class, and all remaining pixels are assigned to the background class. The LPD is divided into 720 training images and 60 validation images. The public dataset record does not provide standardized camera-model, camera-to-road distance, or acquisition-height metadata; this missing information limits a controlled attribution of source-to-target differences. Representative LPD samples are shown in
Figure 1.
The second dataset is the Collected Taiz Dataset (CTD), acquired specifically for this study on urban streets in Taiz, Yemen, and used only as the external target-domain test set. It contains 188 daytime RGB images captured with the 108 MP mode of a Samsung Galaxy S21 Ultra (Samsung, Suwon, Republic of Korea). The camera-to-pothole distance was not fixed or measured; the photographer varied the viewpoint and distance so that the complete pothole remained inside the frame. Consequently, CTD includes variation in apparent defect scale, perspective, illumination, asphalt texture, and boundary visibility. One annotator delineated each pothole as a polygon using LabelMe, after which an author visually reviewed every polygon mask against its source image and corrected evident omissions or boundary errors. The reviewed polygons were exported to normalized coordinates and rasterized into binary masks during evaluation. Representative samples are shown in
Figure 2.
A strict target-free cross-dataset protocol is adopted. All models are trained and validated only on the LPD, while CTD is used exclusively for external testing. No CTD image is used for training, validation, checkpoint selection, hyperparameter tuning, threshold calibration, fine-tuning, or post-processing calibration. Although CTD was stored in two folders for file management, all 188 images are merged during inference and treated as one external set. This protocol is closer to single-source domain generalization than to unsupervised domain adaptation because target images are unavailable during learning.
3.3. Annotation Processing and Binary Mask Generation
Both datasets use polygon-based pothole annotations. For consistency, all annotations are converted into binary segmentation masks during data loading. For an image with original width,
, and height,
, each normalized polygon vertex,
, is converted into pixel coordinates as
The resulting polygon is rasterized to form the binary mask:
where
P denotes the filled pothole polygon region. If an image contains multiple pothole polygons, all regions are filled into the same mask. This binary representation is used consistently for training, validation, and external testing.
3.4. Preprocessing and Data Augmentation
All images and masks are resized to
pixels. RGB images are normalized using ImageNet statistics:
where
and
denote the ImageNet channel-wise mean and standard deviation values.
Data augmentation is applied only to LPD training images. Horizontal flip, vertical flip, and random rotation are applied with probabilities 0.5, 0.2, and 0.3, respectively. Shift–scale–rotate augmentation ( translation, scaling, and rotation) is applied with probability 0.5. One of brightness–contrast adjustment (), CLAHE, or gamma correction (80–120) is selected with probability 0.6. One blur operation (Gaussian, motion, or median) and one color operation (hue–saturation–value shift, RGB shift, or grayscale conversion) are independently selected with probability 0.25; Gaussian noise is applied with probability of 0.20. These transformations expose the network to variations related to viewpoint, illumination, color response, shadow intensity, and road texture. No augmentation is applied during validation or CTD testing.
3.5. Proposed PotholeBAF-Net
The proposed PotholeBAF-Net is a boundary-aware encoder–decoder network designed for pothole segmentation under cross-dataset domain shift. The model is motivated by two practical challenges. First, pothole boundaries are often irregular, fragmented, weakly contrasted, and visually similar to surrounding asphalt. Second, road images contain confusing background patterns such as shadows, stains, cracks, repaired patches, loose gravel, and a heterogeneous texture. In conventional encoder–decoder networks, these low-level patterns may be transferred directly through skip connections, increasing false positives under source-to-target domain shift.
To address this limitation, PotholeBAF-Net regulates encoder–decoder skip transfer instead of directly concatenating encoder and decoder features. The architecture consists of four components: an ImageNet-pretrained EfficientNet-B3 encoder, a Low-Rank Transformer Bridge, a Boundary-Aware Fusion (BAF) decoder, and a lightweight Boundary Refinement Head. The Transformer embedding dimension is 256. The four decoder stages use 192, 128, 80, and 48 output channels, with alternating dilation factors of 1 and 2 in their residual refinement blocks. The final head reduces the 48-channel decoder output to 24 channels before the one-channel logit projection. The complete model is expressed as
where
is the EfficientNet-B3 encoder,
is the Low-Rank Transformer Bridge,
is the proposed Boundary-Aware Fusion decoder,
is the Boundary Refinement Head, and
is the sigmoid activation function. The overall architecture is shown in
Figure 3.
3.5.1. EfficientNet-B3 Encoder
The input image is first processed by an ImageNet-pretrained EfficientNet-B3 encoder to extract hierarchical multi-scale representations:
where
to
are used as skip features, and
is passed to the Transformer bridge. For an input size of
, the encoder produces feature maps at progressively reduced spatial resolutions, with the deepest feature map having an approximate resolution of
. The skip features are denoted as
This encoder design preserves local spatial detail in shallow layers while providing high-level semantic information in deeper layers.
3.5.2. Low-Rank Transformer Bridge
Although CNN encoders are effective for local feature extraction, their local operators do not directly model long-range relationships. The bridge, therefore, applies two pre-norm Transformer encoder layers only to the
bottleneck. A
convolution projects
to
channels, producing
tokens:
where
denotes channel projection. The tokens are processed by a Transformer encoder and reshaped back into a spatial feature map:
where
denotes the Transformer encoder, and
is a residual depthwise-separable refinement with dilation of 2. Each Transformer layer uses four heads, a head dimension of
, a feed-forward width of 512, GELU activation, and dropout of 0.05. For head
h, the pre-softmax attention affinity is
Thus, “low-rank” refers specifically to the rank-bounded factorization of the pre-softmax affinity logits, while computational efficiency also follows from applying attention to 144 bottleneck tokens rather than
image locations. The subsequent row-wise softmax is not claimed to preserve this rank bound, and the module is not a Linformer-style token-projection approximation. The bridge is used as a lightweight context component; the principal architectural novelty lies in the boundary-regulated skip fusion described next.
Figure 4 summarizes the implementation.
3.5.3. Boundary-Aware Fusion Decoder
The Boundary-Aware Fusion decoder is the main component of PotholeBAF-Net. Conventional decoders often concatenate skip and decoder features directly. Here, each skip is first refined using a learned boundary prior and channel–spatial attention and is then fused adaptively with the decoder feature through a learnable gate. This design aims to preserve boundary-relevant information while reducing the transfer of source-specific road texture.
The decoder contains four BAF stages. The Transformer bridge output
initializes the decoder, and the encoder skip features
are progressively fused as follows:
where ↑ denotes bilinear upsampling by a factor of two. For the
i-th BAF block, the decoder input and skip feature are denoted as
and
, respectively.
The decoder feature is first projected to a common channel dimension:
where
is implemented using a
convolution, followed by batch normalization and SiLU activation.
In parallel, the encoder skip feature is refined using two complementary operations. First, a soft boundary prior is estimated from the skip feature:
where
consists of a
convolution, batch normalization, SiLU activation, and a
convolution. The map
acts as a learned spatial guide that highlights regions likely to contain pothole boundaries.
Second, the skip feature is processed using lightweight channel–spatial attention:
where
denotes the LiteCBAM attention module. The boundary prior and attention-refined skip feature are then combined as
where ⊙ denotes element-wise multiplication. The term
amplifies boundary-relevant responses while preserving the original skip information. The enhanced skip feature is then projected as
where
is a
convolution followed by batch normalization and SiLU activation.
Instead of fixed concatenation, the proposed BAF block uses a learnable gate to balance decoder semantics and boundary-enhanced skip details:
where
denotes channel-wise concatenation, and
is implemented using a
convolution and batch normalization. The gated fusion output is computed as
When
is high, the block gives more weight to the decoder semantic feature; when
is low, it gives more weight to the boundary-enhanced skip feature. The fused representation is finally refined using a residual depthwise-separable block and LiteCBAM:
where
denotes the local residual refinement module.
The complete BAF operation can be summarized as
with
Because the sigmoid gives
for channel
c and location
p, Equation (
23) is a pointwise convex interpolation of the two projected streams. Before the nonlinear refinement
, each fused activation, therefore, lies between the corresponding decoder and skip activations:
This bounded mixture provides a clearer mechanism than unconstrained concatenation: the gate can reduce the direct contribution of a skip response without requiring the subsequent convolution to first disentangle two stacked streams. The gate is data-dependent and learned jointly with the segmentation loss; it is not asserted to guarantee domain invariance or shadow removal.
The formulation differs from direct concatenation because both streams are first projected to a common dimension, the skip is modulated by a learned boundary prior and channel–spatial attention, and the mixture is selected independently at each channel and spatial location. It can, therefore, attenuate source-specific texture when decoder context does not support it while retaining boundary evidence where the two streams agree. The detailed BAF block is shown in
Figure 5.
3.5.4. Boundary Refinement Head
The final decoder feature
contains high-resolution information, but it may still include noisy responses from shadows, stains, cracks, repaired patches, or heterogeneous asphalt texture. Therefore, a lightweight Boundary Refinement Head is used to improve local mask consistency before producing the final pothole probability map. The refinement head applies a residual depthwise-separable block followed by an additional lightweight convolutional refinement:
where
denotes the residual depthwise-separable block and
denotes a DSConvBNAct operation. Each depthwise-separable convolution is defined as
where
denotes depthwise convolution,
denotes pointwise convolution, BN denotes batch normalization, and
denotes the SiLU activation function.
The refined feature is projected into a single-channel logit map and upsampled to the input resolution:
where
is a
output projection and
denotes bilinear upsampling. The final binary mask is obtained using the validation-selected threshold
:
The Boundary Refinement Head improves the final prediction by applying residual local refinement, preserving decoder semantics, enhancing boundary-sensitive details, and maintaining low computational overhead. Its detailed architecture is shown in
Figure 6.
3.6. Baseline Models
To evaluate PotholeBAF-Net, the baselines include U-Net, U-Net++, FPN, LinkNet, DeepLabV3+, PSPNet, MA-Net, and SegFormer. They represent direct and nested skip fusion, pyramid aggregation, atrous context, attention-based decoding, and Transformer encoding.
All models follow the same source-to-target split, preprocessing, optimizer, loss, augmentation, validation-based checkpoint and threshold selection, and metrics. The disclosed epoch-budget difference remains a comparison limitation; accordingly, the results evaluate the complete experimental configurations rather than isolating architecture under a perfectly matched training duration.
3.7. Loss Function
Pothole segmentation is affected by foreground–background imbalance because pothole regions usually occupy a much smaller area than the road background. Therefore, the training objective combines binary cross-entropy loss and focal Tversky loss:
where
provides stable pixel-wise supervision, and
improves overlap-based foreground recovery.
The binary cross-entropy loss is defined as
where
denotes the set of image pixels,
is the ground-truth label, and
is the predicted pothole probability.
The Tversky index is computed as
where
,
, and
denote true positives, false positives, and false negatives, respectively. The focal Tversky loss is then given by
where
is the focusing parameter, and
s is used for numerical stability.
The loss-function hyperparameters are summarized in
Table 1. A larger mixture weight is assigned to the focal Tversky term to emphasize region overlap under foreground–background imbalance. Within the Tversky denominator,
places a larger penalty on false positives than
places on false negatives.
3.8. Training Strategy and Threshold Selection
All models are trained using the AdamW optimizer with a cosine annealing learning-rate scheduler. Mixed-precision training is enabled when a CUDA-compatible GPU is available to reduce memory usage and improve computational efficiency. For each model, the checkpoint with the highest IoU on the LPD validation set is selected:
where
denotes the model parameters at epoch
t.
After training, the best checkpoint is reloaded, and the decision threshold is selected only on the LPD validation set. The threshold is searched over
with a step size of
, and the optimal threshold is selected as
The selected threshold is then used for both LPD validation evaluation and CTD zero-shot testing. No threshold optimization or morphological post-processing is performed on the CTD, ensuring that the external test results reflect the direct segmentation ability of each model under the strict zero-shot protocol.
3.9. Experimental Setup and Reproducibility
The experimental framework is implemented in Python 3.10 using PyTorch 2.5.1. Image loading, polygon rasterization, and mask processing are performed using OpenCV, while data augmentation is implemented using Albumentations. CNN-based segmentation baselines and transformer-based components are implemented using PyTorch-compatible libraries and pretrained backbones.
All experiments are conducted on a Lenovo laptop equipped with an Intel Core i7-10750H CPU, 32 GB RAM, and an NVIDIA GeForce RTX 2060 GPU with 6 GB VRAM using CUDA 11.8. Automatic mixed precision is enabled. Independent runs use seeds 42, 123, and 2026; each seed is applied to Python, NumPy 2.2.6, and PyTorch, with deterministic cuDNN execution and benchmarking disabled. The proposed model, every ablation, and all baselines have three runs with different seeds.
All architectures, including the proposed model, its ablations, and all baseline models, were trained for a maximum of 40 epochs. They use the same input size, batch size, optimizer, learning-rate scheduler, loss function, data augmentation, validation protocol, threshold-selection procedure, and evaluation metrics. For every run, the checkpoint achieving the highest validation IoU on the LPD validation set was selected for evaluation. Thus, the training budget and checkpoint-selection criterion were consistent across all models. No target-domain images were used for training, validation, checkpoint selection, threshold selection, fine-tuning, or post-processing calibration.
Table 2 summarizes the complete experimental configuration.
3.10. Performance Evaluation
Segmentation performance is evaluated using pixel-level metrics derived from true positives (
), true negatives (
), false positives (
), and false negatives (
). The primary metric is Intersection over Union (IoU), which measures the spatial overlap between the predicted pothole region and the ground-truth mask:
Precision and recall are computed as
The F1-score is computed as
The Dice coefficient is computed as
The Matthews correlation coefficient (MCC) is also reported because it accounts for all four confusion-matrix components and is informative under class imbalance:
For the principal validation, external-test, and ablation tables, confusion counts are pooled over all pixels in the evaluated dataset for each run; metrics are then reported as the mean ± sample standard deviation across valid seeds. F1 and Dice are algebraically identical under the binary definitions above, but both are retained to match common reporting conventions in the pothole literature.
To quantify source-to-target degradation, the validation-to-test generalization gap is computed for each metric
as
where a smaller gap indicates stronger cross-dataset robustness.
For paired statistical analysis, a per-image Dice score is first computed for each CTD image and seed and then averaged across the valid seeds for that model. The full model and each single-component ablation are paired by the same 188 image names. The mean paired difference (full minus ablation) is accompanied by a 95% paired-bootstrap confidence interval using 5000 image-level resamples and a two-sided Wilcoxon signed-rank test. Holm adjustment is applied across the five component comparisons. This image-macro analysis weights every image equally and, therefore, need not equal the dataset-level pixel-pooled Dice in the principal tables.
Boundary-level overlays are used to examine contour structure qualitatively. Failure analysis uses the 20 images with the lowest full-model mean per-image IoU and reports their precision–recall pattern without assigning visual causes that cannot be verified from the images. This distinction is important because weak boundaries, shadows, heterogeneous asphalt, repairs, and small defects can produce similar metric signatures.
Finally, computational efficiency is assessed using the number of trainable parameters, floating-point operations (FLOPs), inference time, frames per second (FPS), and GPU memory usage. Parameters and FLOPs are computed using an input size of , while inference time and FPS are measured using batch size 1 and repeated runs to report mean and standard deviation.
4. Results and Discussion
This section presents the experimental results of PotholeBAF-Net and the baseline segmentation models under the adopted strict zero-shot cross-dataset protocol. All models were trained and validated on the Large Public Dataset (LPD), while external testing was performed on the independently collected Collected Taiz Dataset (CTD). No CTD image was used for training, validation, checkpoint selection, threshold selection, fine-tuning, or post-processing calibration. Therefore, the CTD results provide a realistic assessment of external-domain generalization rather than intra-dataset fitting.
4.1. Quantitative Performance on the LPD and CTD
Table 3 reports LPD validation performance over the available independent runs. PotholeBAF-Net achieves the highest mean IoU (
), F1/Dice (
), and MCC (
). FPN is the strongest baseline on mean IoU (
), although its estimate is based on two runs. The small source-domain margin motivates external evaluation rather than a claim based only on the in-distribution split.
Table 4 reports target-free external performance on CTD. The proposed model has the highest mean for all six metrics, but its variability is larger than on LPD, especially for precision, indicating sensitivity to initialization under domain shift.
To make the uncertainty of the external-test comparison explicit, approximate 95% confidence intervals were computed from the independent runs using the Student
t distribution. Because the number of runs is small, these intervals are used as conservative uncertainty indicators rather than as definitive proof of superiority. For CTD IoU, PotholeBAF-Net obtained an approximate 95% confidence interval of 0.326–0.507, while FPN, the strongest baseline by mean IoU, obtained 0.329–0.479. The overlap between these intervals indicates that the small IoU margin over FPN should be interpreted descriptively. However, PotholeBAF-Net maintains the highest mean value across all six reported CTD metrics, and the component-level paired analysis in
Section 4.5 further supports the contribution of the regulated decoding pathway, particularly the boundary-prior component. PotholeBAF-Net exceeds the FPN mean by 0.0123 IoU and 0.0441 F1/Dice, while its recall is higher by 0.0123. Nevertheless, the overlapping uncertainty intervals and the limited number of independent runs prevent a strong claim of statistically significant superiority over FPN. The comparison is, therefore, interpreted descriptively: the proposed model provides the best observed overall metric profile, but the remaining variability confirms the difficulty of segmentation under unseen-road conditions.
4.2. Validation-to-Test Generalization Gap
To examine domain shift without duplicating the four overlap metrics in
Figure 7,
Figure 8 compares precision and F1/Dice between LPD validation and CTD testing. Their gaps are
For PotholeBAF-Net, mean precision changes from 0.8755 to 0.8562 (gap 0.0193), whereas F1 decreases from 0.8650 to 0.6196 (gap 0.2454). The small precision change combined with the larger F1 change indicates that the external-domain difficulty primarily appears as missed pothole pixels rather than uncontrolled foreground expansion. FPN, U-Net++, and PSPNet show F1 gaps of approximately 0.277, 0.296, and 0.286, respectively. Thus, the proposed model retains the highest external F1, but the remaining recall loss is substantial and motivates the failure analysis below.
4.3. Qualitative and Boundary-Level Analysis
Figure 9 compares probability maps and binary predictions on a CTD image containing strong cast shadows. PotholeBAF-Net concentrates its highest response on the annotated defect, whereas several baselines activate on surrounding texture or fragment the mask. The BAF mechanism addresses shadows indirectly: photometric augmentation exposes the network to illumination changes, the boundary prior emphasizes spatial transitions, channel–spatial attention reweights skip responses, and the fusion gate can favor decoder context over a shadow-sensitive skip. None of these operations supplies an explicit shadow class, so the architecture attenuates rather than guarantees removal of shadow responses.
To provide direct visual evidence of the behavior learned by the proposed BAF decoder,
Figure 10 shows representative CTD samples together with the corresponding learned boundary-prior and fusion-gate maps. The boundary-prior maps exhibit stronger responses around pothole contours, damaged regions, and high-transition road-surface structures, indicating that this branch learns a spatial guide related to boundary-sensitive skip information rather than applying uniform enhancement across the image. The fusion-gate maps are also spatially non-uniform. In these maps, brighter values indicate stronger reliance on decoder semantic features, whereas darker values indicate stronger reliance on the boundary-enhanced encoder skip stream. The gate responses, therefore, show that encoder details are not transferred uniformly; instead, the decoder adaptively regulates the contribution of local skip information according to the surrounding semantic context.
These visualizations support the role of BAF as a selective skip-fusion mechanism. They show that the decoder does not simply concatenate high-resolution encoder features with decoder features; rather, it learns where boundary-sensitive local evidence should be preserved and where skip information should be moderated by decoder semantics. This behavior is consistent with the quantitative ablation results, where removing the boundary prior and adaptive fusion gate reduces external CTD performance. At the same time, these maps are interpreted as qualitative diagnostic evidence rather than causal proof; they indicate how the trained network distributes boundary emphasis and skip regulation, but they do not by themselves establish the physical cause of every success or failure case.
Boundary-level analysis is further conducted to examine whether the predicted masks preserve pothole contour structure. This analysis is important because pothole boundaries are often weak, irregular, fragmented, and visually similar to surrounding asphalt.
Figure 11 shows representative boundary-level comparisons between ground-truth masks and predicted masks on CTD samples.
The overlays show both successes and limitations. Coherent contours are recovered when the defect has a visible rim, whereas low-contrast or fragmented regions are smoothed or omitted. A metric-based audit of the 20 lowest-IoU CTD images further shows that 15 have precision greater than recall, four have recall greater than precision, and one is missed completely; false negatives, therefore, dominate most severe failures. For example, image A_train/20241024_064201.png has precision 0.9911 but recall 0.0707, whereas A_validation/20240722_091908.png has precision 0.0374 and recall 0.3095, representing a false-positive-dominated exception. The complete miss and very low-recall cases generally contain small, weak, or spatially diffuse annotations. These observations agree with the external precision–recall imbalance and prevent attributing all errors to one cause such as shadows.
The model has no semantic representation of “shadow” as an object. A possible extension is to use a vision–language model or world-model teacher to provide semantic nuisance concepts (shadow, stain, repair patch, and loose aggregate), followed by knowledge distillation into the lightweight segmenter. Such a system would require an additional dataset and controlled evaluation; it is, therefore, proposed as future work rather than claimed as part of the present method.
Figure 12 complements the numerical audit with representative severe errors: a near-complete miss, strong under-segmentation, false activation on shadowed or textured pavement, and a boundary-mismatch case. These examples show that high precision on some images can coexist with substantial missed pothole area, whereas other scenes produce spatially misplaced responses.
4.4. Ablation and Component Interaction Analysis
Table 5 reports three-seed CTD results for single-component removals and interaction configurations. All five removals reduce dataset-level mean IoU relative to the complete network. The largest decreases occur without the boundary prior (0.0763), Transformer bridge (0.0685), and Boundary Refinement Head (0.0675). Removing channel–spatial attention or the adaptive fusion gate produces smaller decreases of 0.0280 and 0.0317. Because F1 and Dice are algebraically identical for binary masks under the reported definition, their columns match; both are retained for consistency with the main tables.
The modules are not additive in isolation. A basic encoder–decoder obtains
IoU; adding only the Transformer gives
, and adding only BAF gives
, whereas their coordinated use with refinement reaches
. This interaction indicates that global context, controlled skip transfer, and final local refinement function as a coupled decoding pathway rather than independent plug-ins.
Figure 13 relates the performance decreases to cost. The full model requires 4.779 GMACs; the boundary prior, Transformer, and refinement-head removals require 4.482, 4.665, and 4.519 GMACs, respectively. The largest IoU gains, therefore, do not simply follow the largest computation increase.
4.5. Paired Statistical Analysis
Table 6 reports the paired image-macro Dice analysis defined in
Section 3.10. The boundary prior has the clearest independent effect: its removal decreases mean per-image Dice by 0.0358, the bootstrap interval excludes zero, and the comparison remains significant after Holm adjustment. The unadjusted Transformer and refinement-head comparisons are significant, but their Holm-adjusted
p-values are 0.0618 and 0.0661, respectively. Removing channel–spatial attention or the adaptive gate does not significantly reduce image-macro Dice in isolation.
The statistical and dataset-level ablation summaries answer different questions.
Table 5 pools all CTD pixels within each seed and shows lower mean IoU for every removal.
Table 6 weights each image equally and shows that the smaller channel-attention and gate effects are not independently robust after multiplicity correction. Together with the interaction configurations, this result supports a coupled-pathway interpretation and avoids attributing the full improvement to every module separately.
4.6. Computational Complexity and Inference Efficiency
Table 7 distinguishes multiply–accumulate operations (GMACs) from profiler FLOPs. PotholeBAF-Net contains 12.463 M parameters, requires 4.779 GMACs (9.557 profiler GFLOPs), and uses
MB peak GPU memory. It is less computation-intensive than U-Net, U-Net++, FPN, DeepLabV3+, and MA-Net, but more intensive than PSPNet and LinkNet; SegFormer has substantially fewer parameters.
The proposed model records
ms latency and
FPS. The large variation is caused by the constrained laptop-GPU measurement environment and precludes a strong real-time claim. PSPNet and SegFormer are faster but have a lower external IoU.
Figure 14, therefore, presents the result as an accuracy–complexity trade-off, not as universal dominance in efficiency. Deployment latency should be re-profiled on the intended hardware with a standardized warm-up and timing protocol.
4.7. Overall Discussion
The available-run results support two main interpretations. First, the proposed network preserves strong source performance and has the highest observed external mean for all six reported metrics. The small IoU margin over FPN remains descriptive because FPN has only two valid runs and the uncertainty bands overlap. Second, the improvement is associated with the complete decoding pathway rather than one isolated plug-in: removing the boundary prior, Transformer, or refinement head causes the largest dataset-level IoU decreases, while adding only the Transformer or BAF to a basic decoder does not reproduce the full result. Global context appears most useful when paired with regulated high-resolution transfer and local refinement.
The improved external behavior of PotholeBAF-Net can be explained by controlled feature transfer under domain shift. In cross-dataset pothole segmentation, high-resolution encoder skips are necessary for recovering irregular boundaries, but they also carry low-level appearance cues that may be dataset-specific, including asphalt granularity, illumination patterns, stains, shadows, and repaired-road texture. Direct skip concatenation can, therefore, pass both useful contour evidence and unreliable source-domain texture into the decoder. The proposed BAF pathway reduces this risk by conditioning the skip stream with a learned boundary prior and then using a spatial–channel gate to interpolate between boundary-enhanced local detail and decoder semantic context. This mechanism allows the decoder to preserve fine structure where local evidence agrees with the predicted pothole region while moderating skip responses that are less consistent with the higher-level representation. The observed generalization improvement is, therefore, interpreted as the result of regulated skip transfer and complementary bottleneck context, rather than as a simple increase in model capacity.
The paired image-macro analysis refines this interpretation. Only the boundary-prior removal remains significant after Holm correction; the Transformer and refinement-head comparisons are suggestive but do not pass the adjusted 0.05 threshold, and the smaller attention and gate effects are not independently significant. Thus, the evidence supports the complete regulated pathway and a particularly important boundary-prior contribution but not a claim that every component produces an independently significant gain.
The shadow example clarifies the mechanism and its boundary. BAF can attenuate an encoder response when decoder context disagrees, but the model has no explicit nuisance label and still fails on some shadows, repairs, stains, and low-contrast defects. The 20-case audit shows that severe failures are predominantly recall-limited. Thus, the principal remaining problem is incomplete recovery of ambiguous pothole extent, not merely false-positive texture propagation.
The evidence is limited by the 188-image external dataset, only three proposed-model runs, two FPN runs, one polygon annotator followed by author review, an unmeasured acquisition distance, missing acquisition metadata for the public source dataset, and mixed retained baseline epoch histories. The wide uncertainty intervals mean that small margins should not be generalized beyond the studied datasets. Computational measurements also show high latency variance on the laptop GPU. Future studies should use multiple external cities and annotators, a uniform training budget, repeated hardware profiling, explicit shadow/repair labels, and temporal, depth, uncertainty, or vision–language teacher information.
5. Conclusions
This study shows that encoder detail should not be transferred uncritically when deployment appearance differs from the source domain. PotholeBAF-Net operationalizes this principle by conditioning each skip on a learned boundary prior and attention, then interpolating it with decoder semantics. Across three seeds, the model achieved IoU and F1/Dice on an independently collected dataset excluded from all training and calibration. Component removal identifies the boundary prior, bottleneck context, and final refinement as the largest dataset-level contributors, whereas the interaction and multiplicity-adjusted analyses show that the modules should be interpreted as a coupled pathway rather than a collection of independently significant plug-ins.
The result is promising but not definitive. CTD contains only 188 images from one city, uses one annotator with author review, and was acquired without measured camera distance; FPN has two valid runs, baseline checkpoint histories are mixed, and severe failures are predominantly recall-limited. Future work will, therefore, prioritize uniform-budget multi-site and multi-annotator evaluation, explicit shadow and repair-patch labels, and temporal or depth cues. Vision–language or world-model teachers may also provide nuisance concepts such as shadow, stain, and repaired asphalt, but their value must be tested through controlled distillation experiments rather than assumed.