CW-BASS: Confidence-Weighted Boundary-Aware Learning for Semi-Supervised Semantic Segmentation

July 6, 2026 ยท View on GitHub

Paper arXiv Project Page License: MIT PyTorch

Official PyTorch implementation of our IJCNN 2025 paper:

CW-BASS: Confidence-Weighted Boundary-Aware Learning for Semi-Supervised Semantic Segmentation Ebenezer Tarubinga, Jenifer Kalafatovich, Seong-Whan Lee โ€” Pattern Recognition & Machine Learning Lab, Korea University

๐Ÿ“„ Paper (IEEE Xplore) ยท ๐Ÿ“ arXiv ยท ๐ŸŒ Project Page

CW-BASS Framework


Table of Contents

Abstract

Semi-supervised semantic segmentation (SSSS) aims to improve segmentation performance by utilizing large amounts of unlabeled data with limited labeled samples. Existing methods often suffer from coupling, where over-reliance on initial labeled data leads to suboptimal learning; confirmation bias, where incorrect predictions reinforce themselves repeatedly; and boundary blur caused by limited boundary-awareness and ambiguous edge cues. To address these issues, we propose CW-BASS, a novel framework for SSSS. We assign confidence weights to pseudo-labels to mitigate the impact of incorrect predictions, and leverage boundary-delineation techniques that remain underutilized in SSSS. Extensive experiments on Pascal VOC 2012 and Cityscapes demonstrate that CW-BASS achieves state-of-the-art performance. Notably, CW-BASS achieves a 65.9% mIoU on Cityscapes under a challenging 1/30 split (100 images), highlighting its effectiveness in limited-label settings.

Key Contributions

  1. Confidence-Weighted Loss โ€” reduces coupling by adjusting pseudo-label influence based on predicted confidence scores, downweighting unreliable predictions.
  2. Dynamic Thresholding โ€” mitigates confirmation bias with an adaptive mechanism that filters pseudo-labels based on model performance.
  3. Boundary-Aware Module โ€” tackles boundary blur using explicit (Sobel-based) boundary supervision to refine segmentation near object edges.
  4. Confidence Decay โ€” reduces label noise through a progressive strategy that refines pseudo-label confidence during training.

Results

All experiments use DeepLabV3+ with a ResNet backbone. mIoU (%) on the standard SSSS splits:

SettingSplitLabeled imagesmIoU
Cityscapes1/30100 (3.3%)65.9
Cityscapes1/4โ€”78.4
Pascal VOC 20121/4โ€”76.2

See the project page and the paper for the full comparison against prior methods and all label partitions.

Quantitative Results

Qualitative comparison โ€” CW-BASS produces sharper object boundaries.

Qualitative Results

Installation

git clone https://github.com/psychofict/CW-BASS.git
cd CW-BASS
pip install -r requirements.txt

Requirements: Python โ‰ฅ 3.8, PyTorch โ‰ฅ 1.10 with a CUDA-capable GPU (multi-GPU training is supported via DataParallel). See requirements.txt for the full list.

Data Preparation

Pre-trained backbones

ResNet-50 | DeepLabv2-ResNet-101

Datasets

Pascal JPEGImages | Pascal SegmentationClass | Cityscapes leftImg8bit | Cityscapes gtFine

File organization

โ”œโ”€โ”€ ./pretrained
โ”‚   โ”œโ”€โ”€ resnet50.pth
โ”‚   โ””โ”€โ”€ deeplabv2_resnet101_coco_pretrained.pth
โ”‚
โ”œโ”€โ”€ [Your Pascal Path]
โ”‚   โ”œโ”€โ”€ JPEGImages
โ”‚   โ””โ”€โ”€ SegmentationClass
โ”‚
โ””โ”€โ”€ [Your Cityscapes Path]
    โ”œโ”€โ”€ leftImg8bit
    โ””โ”€โ”€ gtFine

The labeled/unlabeled ID splits for every partition ship with the repo under dataset/splits/ โ€” no extra setup required.

Training

export semi_setting='pascal/1_8/split_0'

CUDA_VISIBLE_DEVICES=0,1 python -W ignore main.py \
  --dataset pascal --data-root [Your Pascal Path] \
  --batch-size 16 --backbone resnet50 --model deeplabv3plus \
  --labeled-id-path dataset/splits/$semi_setting/labeled.txt \
  --unlabeled-id-path dataset/splits/$semi_setting/unlabeled.txt \
  --pseudo-mask-path outdir/pseudo_masks/$semi_setting \
  --save-path outdir/models/$semi_setting

Dataset-specific defaults (epochs, learning rate, crop size) are applied automatically; the CW-BASS hyper-parameters can be overridden on the command line:

FlagDefaultDescription
--gamma1.0Confidence-weighting exponent in the weighted CE loss
--base-threshold0.6Base value for the dynamic confidence threshold
--beta0.5Sensitivity of the dynamic threshold to mean confidence
--decay-factor0.9Multiplicative confidence-decay factor
--use-confidence-decayoffEnable progressive confidence decay
--confignoneOptional YAML (see configs/) to override defaults

The best checkpoint (by validation mIoU) is written to --save-path. Use --resume <ckpt> to continue training from a saved checkpoint.

Pseudo-Labeling & Retraining

main.py also provides ST++-style utilities to select reliable unlabeled images, generate pseudo-masks, and retrain on the labeled + pseudo-labeled union (see select_reliable, label, and retrain_on_pseudo_labeled_data).

Repository Structure

CW-BASS/
โ”œโ”€โ”€ main.py                 # Training / pseudo-labeling entry point
โ”œโ”€โ”€ utils.py                # mIoU metric, param counting, color maps
โ”œโ”€โ”€ configs/                # Per-dataset YAML configs
โ”œโ”€โ”€ dataset/
โ”‚   โ”œโ”€โ”€ semi.py             # SemiDataset (labeled / unlabeled / val)
โ”‚   โ”œโ”€โ”€ transform.py        # Augmentations (crop, flip, resize, blur, cutout)
โ”‚   โ””โ”€โ”€ splits/             # Labeled / unlabeled ID lists per partition
โ”œโ”€โ”€ model/
โ”‚   โ”œโ”€โ”€ backbone/           # ResNet backbones
โ”‚   โ””โ”€โ”€ semseg/             # DeepLabV3+, DeepLabV2, PSPNet
โ”œโ”€โ”€ entropy_cityscapes.py   # Analysis: entropy maps
โ”œโ”€โ”€ entropy_map_pascal.py
โ”œโ”€โ”€ gt_vs_pred_cityscapes.py# Analysis: GT vs prediction visualizations
โ”œโ”€โ”€ gt_vs_pred_pascal.py
โ””โ”€โ”€ docs/                   # Project page (GitHub Pages)

Acknowledgements

The image partitions are borrowed from Context-Aware-Consistency and PseudoSeg. Part of the training hyper-parameters and network structures are adapted from ST++ and PyTorch-Encoding.

Citation

If you find this project useful, please consider citing:

@inproceedings{tarubinga2025cwbass,
  author={Tarubinga, Ebenezer and Kalafatovich, Jenifer and Lee, Seong-Whan},
  booktitle={2025 International Joint Conference on Neural Networks (IJCNN)},
  title={CW-BASS: Confidence-Weighted Boundary-Aware Learning for Semi-Supervised Semantic Segmentation},
  year={2025},
  pages={1-8},
  doi={10.1109/IJCNN64981.2025.11227871}
}

License

Released under the MIT License.