Adaptive Hierarchical Certification for Segmentation using Randomized Smoothing

    Alaa Anani1,2, Tobias Lorenz2, Bernt Schiele1, Mario Fritz2

    1Max Planck Institute for Informatics2CISPA Helmholtz Center for Information Security

    ICML 2024

    TL;DRAdaptiveCertify certifies unstable segmentation pixels at a coarser class, such as vehicle instead of car or truck, rather than abstaining. Compared with SegCertify, it abstains up to 42% less and achieves up to 13% higher Certified Information Gain.

    Figure 1 of Adaptive Hierarchical Certification for Segmentation using Randomized Smoothing
    Figure 1: AdaptiveCertify certifies pixels where SegCertify abstains. For input images (a) and (d), certified segmentations from SegCertify in (b) and (e) and from AdaptiveCertify in (c) and (f), with their Certified Information Gain (CIG) and abstain rate (%⊘). White pixels are abstentions. Colors follow the class hierarchy in Figure 2.

    Introduction

    Certifying a segmentation model means guaranteeing every pixel’s label under bounded input perturbations. The state-of-the-art method, SegCertify, certifies over a flat set of fine-grained classes and abstains on every pixel whose prediction is unstable under noise, which leads to high abstain rates. Yet unstable pixels often fluctuate between related classes: a pixel alternating between car and truck can still be certified as vehicle. AdaptiveCertify certifies each pixel within a class hierarchy, keeping fine-grained labels for stable pixels and relaxing unstable ones to a coarser level. In the first example of Figure 1, this lowers the abstain rate from 19.0% to 8.2%.

    Method

    Classes are organized in a hierarchy: the finest level H₀ holds the original labels, and each coarser level groups related classes. In Cityscapes, bus becomes vehicle at H₁ and dynamic obstacle at H₂ (Figure 2).

    Figure 2: semantic hierarchy over the 19 Cityscapes classes
    Figure 2: Class hierarchy for Cityscapes. The 19 Cityscapes classes are grouped into progressively coarser parent classes. Node colors are the palette used in the segmentation results.

    AdaptiveCertify first draws a small set of noisy samples to measure how confident the model is at each pixel: the smaller the gap between its top two classes, the coarser the level the pixel is assigned. It then draws n fresh noisy samples, maps each prediction to the pixel’s assigned level, and certifies the top label with a statistical test, abstaining if the test fails.

    With confidence 1 − α, certified labels stay unchanged under ℓ₂ perturbations smaller than R = σ Φ⁻¹(τ), where σ is the noise level and τ the required label probability. The abstain rate is never higher than that of SegCertify.

    Certified Information Gain

    Coarser labels are easier to certify but less informative, so certified accuracy alone would reward certifying everything as a broad class. Certified Information Gain (CIG) scores a correct fine-grained label as 1, a correct coarser label progressively lower the more classes it covers, and abstentions or errors as 0. For a flat hierarchy, CIG equals certified accuracy.

    Results

    We compare AdaptiveCertify with SegCertify using HRNetV2 on Cityscapes, ACDC, PASCAL-Context, and COCO-Stuff-10K.

    Overall Performance

    AdaptiveCertify achieves higher CIG and lower abstention on all four datasets, at every noise level and sampling setting. At σ = 0.50 with n = 100 and τ = 0.75, Cityscapes abstention falls from 26% to 15%, and COCO-Stuff-10K CIG rises from 0.31 to 0.35 (Table 1).

    Table 1: CIG and abstention on four datasets across noise and sampling settings
    Table 1: Certified segmentation results on four datasets. Certified Information Gain (CIG) and abstain rate (%⊘) over 200 images per dataset, for three noise levels σ with certified radius R and two sampling settings. The percentages next to the AdaptiveCertify values are relative improvements over SegCertify.

    Per-Class Performance

    Almost all classes gain in both CIG and certification rate. The largest gains are on COCO-Stuff-10K: +0.23 CIG for hair drier and +65 percentage points certified for toaster (Figure 3).

    Figure 3(a–c): per-class differences in CIG and certification rate
    Figure 3: Per-class gains over SegCertify. Difference in CIG (ΔCIG) and in certification rate (Δ%certified) between AdaptiveCertify and SegCertify for the top classes of (a) ACDC, (b) PASCAL-Context, and (c) COCO-Stuff-10K. Overall is the class average.

    Certification Across Hierarchy Levels

    Both methods certify a similar share of pixels at the finest level. AdaptiveCertify additionally certifies pixels at coarser levels where SegCertify abstains: on ACDC, 12.6% at H₁ and 1.9% at H₂ (Figure 4).

    Figure 4: certified pixels by hierarchy level and abstentions on four datasets
    Figure 4: Certified pixels by hierarchy level. Percentage of pixels certified at each hierarchy level and percentage abstained, for AdaptiveCertify (Ours) and SegCertify (Baseline). SegCertify only uses the finest level H₀.

    Boundary and Non-Boundary Pixels

    Object boundaries are the hardest pixels to certify. On ACDC boundaries, AdaptiveCertify lowers abstention from 35.0% to 25.0%, and it improves both boundary and non-boundary pixels on all four datasets (Table 2).

    Table 2: boundary and non-boundary certification results over 100 images per dataset
    Table 2: Boundary and non-boundary pixels. Abstain rate (⊘%) and CIG over the first 100 images of each dataset, for all pixels, boundary pixels only, and non-boundary pixels only. %Δ is the relative improvement of AdaptiveCertify (Ours) over SegCertify (Baseline).

    Fluctuating Class Sets

    Where SegCertify abstains, the model typically fluctuates among related classes, such as grass, mountain, and sky in PASCAL-Context, which share the parent nature. These recurring sets support certifying a shared parent rather than abstaining (Figure 5).

    Figure 5: frequent fluctuating class sets on COCO-Stuff-10K and PASCAL-Context
    Figure 5: Classes the model fluctuates between. The most frequent sets of classes among pixels where SegCertify abstains, on COCO-Stuff-10K and PASCAL-Context.

    Conclusion

    AdaptiveCertify certifies unstable pixels at a coarser hierarchy level instead of abstaining. It never abstains more than non-adaptive certification and retains more certified information across datasets, noise levels, and boundary and non-boundary pixels.

    Citation

    @inproceedings{anani2024adaptive,
        author    = {Alaa Anani and Tobias Lorenz and Bernt Schiele and Mario Fritz},
        title     = {Adaptive Hierarchical Certification for Segmentation using Randomized Smoothing},
        booktitle = {Proceedings of the 41st International Conference on Machine Learning},
        series    = {Proceedings of Machine Learning Research},
        volume    = {235},
        pages     = {1531--1556},
        year      = {2024},
    }