ECCV 2024

DHR

Dual Features-Driven Hierarchical Rebalancing in Inter- and Intra-Class Regions for Weakly-Supervised Semantic Segmentation

Sanghyun Jo1 Fei Pan2 In-Jae Yu3 Kyungsu Kim4,†
1OGQ 2University of Michigan 3SamsungElectronics 4Massachusetts General HospitalandHarvard Medical School
† Corresponding author
Left: for one image and its tags, the outputs of Grounding DINO (233MB, box labels), Ferret (13,370MB, LLM prior) and the WSS model DHR (59MB, tags only), before and after HQ-SAM refinement, next to the ground truth. Right: scatter plot of PASCAL VOC 2012 mIoU against MS COCO 2014 mIoU, where DHR with and without SAM lies above the WSS models MARS, WeakTr, CLIP-ES and ToCo and the generalist models Ferret with SAM and Grounded SAM

WSS with image-level tags outperforms large-scale vision models. (a) With only image-level supervision and 25% of the parameters, DHR outperforms large-scale vision models (Grounded SAM, Ferret), bypassing the need for extensive human annotations (image, text, and box pairs). (b) DHR exceeds Grounded SAM, Ferret, and recent WSS models (MARS, CLIP-ES, ToCo, WeakTr) on the PASCAL VOC 2012 and MS COCO 2014 benchmarks.

Key Insight

Conventional seed propagation overlooks class ratios: adjacent pixels from distinct classes merge, and spatially minor classes vanish from the pseudo masks. Unsupervised (USS) features distinguish inter-class regions with dissimilar appearances (person vs. motorbike), while weakly-supervised (WSS) features discern visually similar classes within the same inter-class region (dog vs. cat). DHR rebalances the mask hierarchically, first across inter-class regions with USS features and then across intra-class regions with WSS features, restoring all classes without losing minor ones.

Motivation

Weakly-supervised semantic segmentation (WSS) generates pseudo masks from image-level tags by propagating initial class activation maps (CAMs). Comparing WSS predictions with ground-truth masks uncovers a significant challenge: adjacent pixels from distinct classes often merge, and the spatially minor class disappears. On the VOC dataset, adjacent regions constitute 35% of the total area, with 79% being inter-class regions, while the COCO dataset has 75% adjacent regions, 55% of which are inter-class.

Two examples (a bottle held next to sheep and people, a person on a motorbike) with the image, the ground truth and the masks of ToCo, MARS, DHR and DHR with SAM: red boxes mark the minor class missing in ToCo and MARS, green boxes mark the same class restored by DHR

Vanishing problem of adjacent minor classes in WSS outputs. Red boxes mark the false prediction of minor classes (e.g., bottle and person) in pseudo labels generated from WSS. Green boxes highlight DHR outperforming state-of-the-art baselines (ToCo, MARS) in adjacent class regions.

USS FEATURES

Separate Inter-Class Regions

Unsupervised semantic segmentation (USS) methods learn visual similarities such as color and shape between images without tags, which lets them distinguish inter-class regions with dissimilar appearances (person vs. motorbike).

WSS FEATURES

Separate Intra-Class Regions

WSS methods learn class-specific differences with human-annotated tags, which lets them discern visually similar classes (dog vs. cat) within the same inter-class region (animals).

Cosine-similarity heatmaps of WSS and USS features for a clicked point. (a) Motorbike and person points: the WSS heatmaps fail to separate the two, the USS heatmaps succeed. (b) Cat and dog points: the WSS heatmaps separate the two animals, the USS heatmaps cover both

Heatmaps of WSS and USS features with target points. (a) USS features precisely separate inter-class regions (person vs. motorbike), unlike WSS features. (b) Thanks to training with image-level class labels, WSS features discern specific classes (dog vs. cat) in the same inter-class region (animal).

1Abstract

Weakly-supervised semantic segmentation (WSS) ensures high-quality segmentation with limited data and excels when employed as input seed masks for large-scale vision models such as Segment Anything. However, WSS faces challenges related to minor classes since those are overlooked in images with adjacent multiple classes, a limitation originating from the overfitting of traditional expansion methods like Random Walk.

We first address this by employing unsupervised and weakly-supervised feature maps instead of conventional methodologies, allowing for hierarchical mask enhancement. This method distinctly categorizes higher-level classes and subsequently separates their associated lower-level classes, ensuring all classes are correctly restored in the mask without losing minor ones.

Our approach, validated through extensive experimentation, significantly improves WSS across five benchmarks (VOC: 79.8%, COCO: 53.9%, Context: 49.0%, ADE: 32.9%, Stuff: 37.4%), reducing the gap with fully supervised methods by over 84% on the VOC validation set. Code is available at https://github.com/shjo-april/DHR.

2Contributions

PROBLEM

Vanishing Minor Classes

We identify and tackle the issue of minor classes disappearing in WSS: adjacent pixels from distinct classes merge during propagation, and the spatially minor class is lost from the pseudo mask.

METHOD

Hierarchical Rebalancing

DHR enhances class distinction through seed initialization based on optimal transport, then leverages USS and WSS features to separate inter- and intra-class regions.

RESULTS

Five Benchmarks

DHR achieves a state-of-the-art mIoU of 79.8% on the PASCAL VOC 2012 test set, proves effective as a seeding technique for SAM, and is evaluated with recent WSS methods on three additional benchmarks (Context, ADE, Stuff).

How DHR Differs

Table comparing ACR, ToCo, WeakTr, CLIP-ES, QA-CLIMS, FMA, MARS and DHR on five properties: solving the vanishing issue of adjacent minor classes, utilizing WSS features, utilizing USS features, no external datasets and models, and following a model-agnostic manner. Only DHR has all five

Conceptual comparison with recent approaches. DHR is the only method in the comparison that solves the vanishing issue of adjacent minor classes. It utilizes both WSS and USS features to improve WSS masks, needs no external datasets or models, and follows a model-agnostic manner.

3Method

To integrate easily with other WSS methods, DHR refines pre-propagated WSS masks during the segmentation learning phase rather than replacing existing propagation tools. It comprises three steps, and the rebalanced masks train the segmentation model recursively.

Overview of DHR: a frozen USS encoder and a learnable WSS encoder and decoder process the input image; the input WSS mask goes through OT-based seed initialization (Step 1, for vanished minor classes), USS rebalancing (Step 2, for inter-class regions) and WSS rebalancing (Step 3, for intra-class regions), and the resulting mask supervises the segmentation loss next to the classification loss

Overview of DHR. The framework unfolds in three steps. It recovers vanished classes by replacing pixels of the input WSS mask with OT-based CAMs for seed initialization. It then propagates the restored seeds hierarchically, using unsupervised feature maps for inter-class segregation (e.g., kitchenware) and weakly-supervised features for intra-class differentiation (e.g., bottle and cup). Finally, the balanced masks are used to train the segmentation model recursively.

Step 1: Optimal Transport-based Seed Initialization

To restore minor-class regions that vanish during the traditional propagation process, DHR revisits the CAMs utilized before the propagation. Optimal transport (OT) minimizes the occurrence of false positives in regions adjacent to the target classes, and the recovered minor-class regions are integrated with the input WSS mask to initialize the mask.

Step 2: USS Feature-based Rebalancing for Inter-class Regions

Class-level average pooling of the unsupervised feature map with the initial mask produces a USS centroid for each class. Clustering the pixels around these centroids by cosine similarity, followed by OT-based optimization, aids the distinct categorization of inter-class regions (e.g., kitchenware and furniture).

Step 3: WSS Feature-based Rebalancing for Intra-class Regions

WSS centroids are generated in the same way from the weakly-supervised feature map, and the WSS-based clustered mask refines the USS-based mask for precise intra-class segregation. A pruning operator applies WSS rebalancing only to highly correlated USS centroids (similarity above τ), that is, to classes that USS cannot distinguish.

Hierarchical Clustering with Dual Features

Left: correlation matrix of USS features between object classes, in which three blocks stand out: vehicle, animal and indoor thing. Right: tree in which USS clustering forms the inter classes vehicle, animal and indoor, and WSS clustering separates the intra classes of each, such as boat, bus, car, train, bicycle and bike under vehicle

Conceptual illustration of the hierarchical clustering. Left: the USS feature correlation automatically groups inter classes. Right: USS features categorize all inter classes (e.g., vehicle and animal), and WSS features then separate the intra classes (e.g., car and bus) of each inter class (e.g., vehicle).

Step 1: Recovering Minor-Class Regions

(a) CAMs of bicycle and bottle without OT, the optimal transport matrix, and the CAMs with OT, where the false positives in the adjacent class are reduced. (b) The input WSS mask of a motorbike image misses the rider; the OT seed replaces pixels of the mask, and the initialized mask restores the person region

Recovering minor-class regions from CAMs with OT. (a) OT reduces false positives in adjacent class regions (e.g., bottle vs. bicycle). (b) The input WSS mask often misses most minor-class areas (the person in the red box). Refining CAM seeds with OT eliminates overlapping areas and restores the minor-class regions that had vanished, as indicated in the green box.

Steps 2 and 3: Hierarchical Rebalancing

Diagram of hierarchical rebalancing: class-level average pooling turns WSS and USS features into class centroids, pixel-wise cosine similarity gives the WSS and USS maps, the USS correlation matrix thresholded by tau selects the classes to cluster for WSS rebalancing, and Step 2 (USS rebalancing), Step 3 (WSS rebalancing with the OT plan) and CRF produce the result mask

Hierarchical rebalancing based on dual features. Starting from the initialized seeds with restored minor-class regions, USS features are used for inter-class grouping, and WSS features are then applied for intra-class separation within each inter-class region. WSS rebalancing is applied conditionally, to classes with high USS correlation that USS cannot distinguish.

4Results

79.8%
PASCAL VOC 2012 test
mIoU with ResNet-101, image-level labels only
53.9%
MS COCO 2014 val
mIoU in the same setting, 49.4% for MARS
84%
Gap reduction
gap with fully supervised methods on the VOC validation set
5
Benchmarks
VOC, COCO, Context, ADE, and Stuff

Quantitative Comparison

Table of mIoU on VOC val and test, COCO, Context, ADE and Stuff for weakly-supervised segmentation models and open-vocabulary segmentation models. DHR with ResNet-101 and DeepLabv3+: 79.6, 79.8, 53.9, 49.0, 32.9, 37.4. DHR with Swin-L and Mask2Former: 82.3, 82.3, 56.8, 53.6, 36.9, 41.1. MARS: 77.7, 77.2, 49.4, 39.8, 22.0, 35.7

Performance comparison of WSS methods across five benchmarks (mIoU, %). Depending solely on image-level supervision, DHR with ResNet-101 and DeepLabv3+ reaches 79.6 and 79.8 on the VOC val and test sets, surpassing MARS, the previous state of the art, by at least 1.9 in the same configuration. With Swin-L and Mask2Former it reaches 82.3 on both sets. DHR also stays above the open-vocabulary models (MaskCLIP, TCL, Ferret with SAM, Grounded SAM) on all five benchmarks.

Qualitative Comparison

One example each from VOC 2012, COCO 2014, Pascal Context, ADE 2016 and COCO-Stuff: image, ground truth, and the masks of TCL, Grounded SAM, ToCo, MARS and DHR for the listed tags

Qualitative comparison on the five benchmarks. With the same tag inputs as TCL, Grounded SAM, ToCo, and MARS, DHR delineates the semantic boundaries between adjacent classes more accurately.

5Analysis

Flexibility Across USS Methods

Table of mIoU on the PASCAL VOC 2012 validation set with ResNet-101: RSEPM 74.4, with MARS and STEGO 77.7 (+3.3), with DHR and STEGO 79.2 (+4.8), with DHR and CAUSE 79.6 (+5.2)

Two USS methods on the PASCAL VOC 2012 validation set. On the RSEPM baseline (74.4% mIoU), DHR gains +4.8 with STEGO and +5.2 with CAUSE: both USS methods give a comparable improvement of approximately 5%.

Flexibility Across WSS Methods

Table of mIoU and gap reduction on the PASCAL VOC 2012 validation set for four WSS methods with and without model-agnostic add-ons. IRNet 63.5, with DHR 72.7 (72%). SEAM 64.5, with DHR 73.6 (67%). AdvCAM 68.1, with DHR 73.6 (56%). RSEPM 74.4, with DHR 79.6 (84%)

Four WSS methods on the PASCAL VOC 2012 validation set. Δ is the percentage improvement in the gap between WSS and fully supervised segmentation (FSS). On IRNet, SEAM, AdvCAM, and RSEPM alike, DHR outperforms the other model-agnostic approaches (ADELE, W-OoD, MARS) and reduces the gap by 56% to 84%.

Effect of Key Components

Table of pseudo-mask mIoU on the VOC, COCO, Context, ADE and Stuff training sets. Baseline: 81.8, 52.6, 51.3, 30.2, 50.0. With OT-based seed initialization: 82.6, 55.1, 53.6, 32.4, 50.6. With OT-based seed initialization and DHR: 83.9, 58.6, 64.9, 48.1, 53.7

Quality of pseudo masks (mIoU) on all training datasets. OT-based seed initialization alone enhances the performance by recovering vanished classes, and adding DHR has a notably larger effect. On Context and ADE, which are composed solely of adjacent classes, the improvement is at least 13.6.

Detailed Ablation on MS COCO 2014

Ablation table on the MS COCO 2014 training dataset: baseline 52.6; optimal transport 54.3; refinement 53.4; both 55.1; adding USS balancing 56.8; adding WSS balancing only 55.3; USS and WSS balancing together 58.6 mIoU

Each component on the MS COCO 2014 training dataset. Optimal transport with CRF refinement for seed initialization adds +2.5 over the baseline (MARS, 52.6). USS balancing followed by WSS balancing reaches +6.0, above USS balancing alone (+4.2) and WSS balancing alone (+2.7), which supports the sequential application of USS followed by WSS.

Sensitivity to the Hyperparameter τ

Line chart of pseudo-mask mIoU on the COCO training dataset for tau from 0.5 to 1.0: DHR stays above 58 from 0.5 to 0.9 and drops to about 57 at 1.0, while the baseline is a flat line below 53

Sensitivity to τ on the COCO training dataset. Setting τ to 1.0, which bypasses WSS balancing, results in only a slight improvement over the baseline (red line). Adjusting τ between 0.5 and 0.9 has minimal impact on segmentation accuracy.

6Citation

BibTeX
@inproceedings{jo2024dhr,
  title     = {DHR: Dual Features-Driven Hierarchical Rebalancing in Inter- and Intra-Class Regions for Weakly-Supervised Semantic Segmentation},
  author    = {Jo, Sanghyun and Pan, Fei and Yu, In-Jae and Kim, Kyungsu},
  booktitle = {European Conference on Computer Vision (ECCV)},
  year      = {2024}
}