Boundary Sharpening in Computer Vision
- Boundary sharpening is a set of methods that enhance the clarity of discontinuities in visual outputs by addressing challenges like low resolution, feature mixing, and annotation noise.
- Techniques include post-processing refinements, specialized loss functions, and geometric corrections that deliver measurable improvements in segmentation, depth maps, and DSMs.
- Advanced strategies also employ localized feature routing and teacher–student distillation to preserve high-frequency details, ensuring sharper boundaries and improved overall model performance.
Boundary sharpening denotes a family of methods that increase the spatial precision of predicted discontinuities, contours, and interfaces in structured visual outputs such as instance masks, semantic segmentations, monocular depth maps, digital surface models, semantic boundary maps, and cellular interfaces. Across these settings, the motivating failure mode is closely related: predictions are often over-smoothed near object or region transitions because low spatial resolution, local feature mixing, class or pixel imbalance, noisy annotations, or self-supervised ambiguity suppress high-frequency structure. The literature therefore treats boundary sharpening either as a post-processing refinement problem, a training-objective design problem, a representation problem, or a physical fluctuation-suppression phenomenon, depending on the domain (Tang et al., 2021, Yang et al., 2021, Zhu et al., 2022, Acuna et al., 2019, Yue et al., 2024).
1. Boundary sharpening as a technical problem
In computer vision, boundary degradation is repeatedly attributed to two recurring causes. First, encoder–decoder or detection pipelines often operate on low-resolution feature maps, so boundary localization is weakened by downsampling and coarse upsampling. Second, boundary pixels form an extremely small fraction of the image, so standard losses emphasize interiors more than transitions. These issues are stated explicitly for instance segmentation and monocular depth estimation, where mask contours and depth discontinuities become imprecise or blurred (Tang et al., 2021, Yang et al., 2021).
A related formulation appears in self-supervised and monocular depth estimation. There, a single per-pixel regressor may “hedge its bets” between foreground and background, producing intermediate depths at occlusion edges rather than crisp discontinuities. One response is to interpret boundary blur as a multi-modal prediction problem rather than merely a missing-detail problem (Cecille et al., 19 Sep 2025). Another response is to treat boundaries as zones requiring geometric relocation rather than scalar correction, which motivates displacement-field approaches (Ramamonjisoa et al., 2020).
In semantic segmentation under domain shift, the same difficulty is framed as a generalization problem concentrated along class boundaries. Synthetic-to-real adaptation can preserve coarse region semantics while failing at edge placement, so sharpening is cast as low-level adaptation and pseudo-label denoising near class transitions (Cardace et al., 2021). In semantic boundary detection, the issue is further complicated by annotation noise: precise edge labels are laborious to obtain, and label jitter can be comparable to the width of the structure being predicted. Methods in this regime aim not only to sharpen predictions but also to reason about the latent true boundary during training (Acuna et al., 2019).
Outside standard vision benchmarks, the same concept appears in two distinct senses. In DSM post-processing, sharpening refers to restoring straight building edges that were blurred by Semi-Global Matching smoothness penalties, using orthophoto line segments as geometric constraints (Lu et al., 2019). In shape-based models of dense cellular sheets, sharpening refers to suppression of interfacial fluctuations, especially at short wavelengths, due to cusp-like restoring forces associated with four-fold vertices; here the object of study is not a prediction map but the spectrum of a fluctuating interface itself (Yue et al., 2024).
2. Localized refinement and geometric correction
One major line of work sharpens boundaries by restricting computation to narrow regions around predicted contours. Boundary Patch Refinement (BPR) is a post-processing framework for instance segmentation that extracts dense, overlapping square boxes centered on predicted boundary pixels, prunes them with NMS using boundary-coverage scores, and refines each surviving RGB-plus-mask crop with a small segmentation network. The refined logits replace the coarse mask logits inside the covered boundary neighborhood, while untouched interior pixels retain the original prediction (Tang et al., 2021). The stated mechanism is not a special boundary-weighted loss but the combination of local field-of-view concentration and a more balanced ratio of boundary to interior pixels within each patch. On Cityscapes val, Mask R-CNN rises from AP , AF to AP , AF ; on the Cityscapes test set, Mask R-CNN + BPR reaches AP versus $36.8$ baseline (Tang et al., 2021).
SharpContour adopts a different localized strategy: instead of pixel-wise refinement, it represents each instance boundary as a polygon and iteratively deforms vertices along discrete searches on their unit outward normals. The update is
with , , and
where 0 and 1 is an Instance-aware Point Classifier. The central claim is that treating vertices more independently than prior contour-evolution methods reduces oversmoothing and preserves corners (Zhu et al., 2022). On COCO val2017, Mask R-CNN improves from AP 2 to 3, and Boundary AP improves from 4 to 5; the reported overhead is 6 ms on a V100 for R50-FPN (Zhu et al., 2022).
Depth-map sharpening can also be formulated as geometric correction by resampling a coarse prediction at displaced coordinates. In the displacement-field formulation,
7
where 8 is a learned per-pixel displacement field and the sampling is implemented by bilinear interpolation (Ramamonjisoa et al., 2020). The intuition is that, near a depth discontinuity, the network can “pull” the sampling coordinate toward the correct side of the step. On NYUv2, the reported depth RMSE improves from 9 m to 0 m and 1 from 2 to 3; boundary quality improves from ODS F4, OIS 5, AP 6 to ODS F7, OIS 8, AP 9 (Ramamonjisoa et al., 2020).
A domain-specific geometric variant appears in DSM sharpening. There, blurred SGM-derived building boundaries are corrected by either graph-cut label assignment over 2D contour offsets or plane fitting on both sides of orthophoto-detected line segments. The graph-cut energy
0
encodes attraction to buffered orthophoto lines and smoothness along the contour; the plane-fitting alternative solves least squares for local planar heights and blends the result back into the DSM (Lu et al., 2019). Reported RMSE reductions are concentrated near boundary buffers rather than the full tile, which underscores that sharpening is often a localized geometric correction rather than a global reconstruction change.
3. Boundary-aware supervision and loss design
A second major family of methods sharpens boundaries by modifying the training objective so that errors on discontinuities receive explicit emphasis. In monocular depth estimation with sharp boundaries, the Boundary-Aware Depth loss is
1
with 2 and
3
where 4 and 5 are Sobel gradients of true and predicted depth, respectively (Yang et al., 2021). This design up-weights pixels with large true gradients and further emphasizes locations where predicted gradients deviate from ground truth. The complete objective is
6
and the reported NYU-Depth V2 test metrics are 7, 8, 9, AbsRel 0, RMSE 1, 2, with boundary F3 at threshold 4 (Yang et al., 2021).
Semantic boundary learning from noisy annotations introduces a different kind of supervision: the model is trained to produce a maximum response along the boundary normal while regularizing the direction of that normal. STEAL adds a thinning layer that constructs a soft-NMS distribution
5
with 6 and 7, and combines class-balanced BCE, an NMS loss, and a direction loss into
8
using 9, $36.8$0, $36.8$1 (Acuna et al., 2019). The same work further introduces a level-set formulation that alternates between optimizing network parameters and evolving a latent aligned boundary via geodesic active contour flow. On the re-annotated SBD test set, MF(ODS) improves from $36.8$2 to $36.8$3 and AP from $36.8$4 to $36.8$5; on Cityscapes val, MF(ODS) improves from $36.8$6 to $36.8$7, and AP from $36.8$8 to $36.8$9 (Acuna et al., 2019).
Self-supervised depth estimation offers another loss-centric perspective, but the supervision is probabilistic rather than explicitly edge-labeled. A two-component Gaussian mixture is predicted per pixel,
0
and the method propagates uncertainty through warping and photometric error to compute competitive weights 1 that select the better component at each location (Cecille et al., 19 Sep 2025). The final estimated disparity is
2
so inference avoids the boundary blur that would result from averaging mixture components. On KITTI, the reported edge-entropy sharpness improves from 3 to 4 for Monodepth2 (M), described as approximately 5 sharper, and point-cloud metrics also improve (Cecille et al., 19 Sep 2025).
4. Feature routing, global context, and distilled priors
Boundary sharpening is not always driven primarily by explicit losses; several methods instead modify the feature pipeline so that boundary cues survive through decoding or adaptation. In monocular depth estimation with sharp boundaries, the Scene Understanding module aggregates low- and high-level encoder features into a global feature map 6 with 7 channels at the second encoder scale, while Scale Transform modules resize and re-weight 8 for each decoder stage using channel attention: 9 followed, per decoder scale 0, by
1
2
3
The paper states that this “fuse-once, adapt-everywhere” design uses only 4 resampling operations versus 5 in a cited multi-scale fusion pyramid (Yang et al., 2021).
Under unsupervised domain adaptation for semantic segmentation, low-level feature routing is used to sharpen class boundaries. A shallow feature extractor 6 provides 7, from which a semantic edge map 8 and a displacement field 9 are predicted. The deep features 0 are upsampled and then backward-warped: 1 so that ambiguous boundary locations are shifted toward less mixed semantic interiors (Cardace et al., 2021). Training combines
2
with 3, and a class-wise erosion copy–paste augmentation that explicitly removes pseudo-label boundary pixels before mixing target interiors with source images. On GTA4Cityscapes, mIoU increases from 5 to 6, with gains of approximately 7–8 points of mIoU inside 9–0 pixel trimaps around true class boundaries (Cardace et al., 2021).
Distillation-based sharpening has recently been formulated as transferring high-frequency priors from large or generative teachers while preserving coarse metric or semantic correctness. SharpDepth starts from a metric depth estimator 1 and a diffusion-based depth model 2, computes a difference map
3
and uses this map both to gate selective noise injection into the diffusion pipeline and to weight a reconstruction loss (Pham et al., 2024). The two principal losses are the SDS objective
4
and the reconstruction term
5
combined as
6
with 7, 8 (Pham et al., 2024). On iBims, DBE9 improves from 00 for UniDepth to 01, and DBE02 from 03 to 04; on KITTI, SharpDepth reports 05, A.Rel 06, RMSE 07 m while remaining close to the metric baseline (Pham et al., 2024).
A related teacher–student strategy appears in polyp segmentation. LiteBounD disentangles semantic and boundary latents 08, aligns them to low- and high-frequency teacher features extracted from VFMs, and injects the distilled priors into a boundary-aware decoder (Agnihotri et al., 20 Apr 2026). Its frequency-aware alignment uses FFT/IFFT decompositions such as
09
and MSE losses against low- and high-frequency inverse transforms, while the second-phase loss is
10
with 11, 12 (Agnihotri et al., 20 Apr 2026). On seen datasets, U-Net improves from mDice 13 to 14 and 15 from 16 to 17; on unseen CVC-300, U-Net improves from mDice 18 to 19 (Agnihotri et al., 20 Apr 2026).
5. Metrics, protocols, and empirical signatures
Boundary sharpening is not reducible to a single metric, and the literature uses task-specific evaluation protocols to isolate edge quality from global accuracy. In instance segmentation, BPR reports boundary F-score AF, where boundary samples are matched to GT boundaries within 20 px on Cityscapes and averaged over true-positive instances under mask-IoU thresholds 21: 22 The same study includes an upper-bound sanity check: if all pixels within 23 px of the boundary are corrected using GT, AP increases by 24; with 25 px, AP increases by 26, indicating that boundary errors dominate AP loss in that setting (Tang et al., 2021).
SharpContour evaluates both conventional AP and Boundary AP on COCO, which makes it possible to distinguish generic mask improvements from boundary-localized gains. Its results show that gains in Boundary AP are larger than gains in standard AP, consistent with its contour-evolution objective (Zhu et al., 2022). In semantic adaptation, trimap mIoU around true class boundaries serves a comparable purpose by measuring performance in narrow bands of 27–28 pixels around boundaries, rather than over whole images (Cardace et al., 2021).
Depth sharpening employs multiple complementary criteria. The supervised monocular depth work evaluates boundary accuracy via edge recovery on depth maps with threshold 29, reporting Precision 30, Recall 31, F32 (Yang et al., 2021). SharpDepth uses DBE accuracy and completion on iBims and Pseudo-DBE on synthetic data; lower is better for both (Pham et al., 2024). The self-supervised mixture model introduces an entropy-based sharpness score in which lower values indicate crisper transitions. For each Canny edge pixel, the 33 neighborhood is normalized to 34, and the Bernoulli entropy
35
is averaged locally and then over all edge pixels to obtain
36
On VKITTIv2, edge completeness is additionally measured as the average pixel distance between predicted and ground-truth edges (Cecille et al., 19 Sep 2025).
Semantic boundary detection uses MF(ODS), OIS, and AP, in line with boundary-detection benchmarks. DSM sharpening uses RMSE not only over the full tile but also over boundary buffers of width 37, 38, and 39 pixels, which reveals improvements that would be diluted in global averages (Lu et al., 2019). In cellular-sheet models, the relevant observable is the fluctuation spectrum
40
whose deviation from a simple capillary-wave law quantifies scale-dependent suppression of interface motion (Yue et al., 2024).
A recurring empirical pattern is that sharpening methods often improve specialized boundary metrics more strongly than aggregate task metrics. This suggests that boundary quality is a partially orthogonal axis of performance rather than a simple proxy for overall accuracy. That interpretation is explicit in works that show large AF, Boundary AP, DBE, or edge-entropy gains with more modest changes in AP, mIoU, RMSE, or AbsRel (Tang et al., 2021, Zhu et al., 2022, Pham et al., 2024, Cecille et al., 19 Sep 2025).
6. Conceptual unification, limitations, and open distinctions
Despite their diversity, existing methods can be organized by the mechanism through which they sharpen boundaries. One class reallocates computation to boundary neighborhoods through patches, polygons, or offset searches (Tang et al., 2021, Zhu et al., 2022). A second class increases optimization pressure on discontinuities through explicit edge-aware weighting, thinning, or probabilistic competition (Yang et al., 2021, Acuna et al., 2019, Cecille et al., 19 Sep 2025). A third class preserves or injects high-frequency structure via feature routing, warping, diffusion priors, or foundation-model distillation (Cardace et al., 2021, Pham et al., 2024, Agnihotri et al., 20 Apr 2026). A fourth class treats sharpening as geometric or physical realignment of an interface, as in DSM post-processing and tissue-interface fluctuation analysis (Lu et al., 2019, Yue et al., 2024).
The literature also identifies several cautions. Some contour-based methods tend to generate over-smoothed contours and fail on corners, motivating SharpContour’s discrete per-vertex evolution (Zhu et al., 2022). In depth refinement via displacement fields, removing the smoothness loss increases depth gains but also increases boundary jitter (Ramamonjisoa et al., 2020). In DSM sharpening, graph-cut can yield lower boundary RMSE but may introduce slight edge waviness, while plane fitting may oversmooth subtle façade variations (Lu et al., 2019). In semantic boundary learning, label noise is not peripheral; it is treated as a central obstacle requiring active alignment rather than merely a regularization nuisance (Acuna et al., 2019).
A common misconception is that sharper outputs must be produced by stronger global backbones alone. Several studies argue against this by showing that specialized boundary modules remain effective when attached to strong baselines or are necessary precisely because standard architectures dilute edge information (Tang et al., 2021, Yang et al., 2021, Agnihotri et al., 20 Apr 2026). Another misconception is that sharpening simply means hallucinating detail. Some methods explicitly anchor predictions to coarse but metrically reliable estimates or preserve untouched interior regions, as in BPR reassembly and SharpDepth’s reconstruction loss, to prevent drift away from global correctness (Tang et al., 2021, Pham et al., 2024). Conversely, the cellular-interface work emphasizes that “sharpening” can describe a scale-dependent physical suppression of fluctuations rather than a visual post-processing effect, so the term is not restricted to image-prediction pipelines (Yue et al., 2024).
A plausible implication is that boundary sharpening is best understood as a localized treatment of ambiguity. The ambiguity may stem from feature resolution, class mixing, pseudo-label noise, metric-versus-generative disagreement, multi-modal depth hypotheses, or topological transitions. The corresponding technical responses differ, but each seeks to prevent the system from averaging across an inherently discontinuous structure. In that sense, boundary sharpening is less a single algorithmic trick than a cross-domain design principle for preserving discontinuities without degrading the surrounding field.