CW-BASS: Confidence-Weighted Boundary-Aware Learning for Semi-Supervised Semantic Segmentation
July 6, 2026 ยท View on GitHub
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

Table of Contents
- Abstract
- Key Contributions
- Results
- Installation
- Data Preparation
- Training
- Pseudo-Labeling & Retraining
- Repository Structure
- Acknowledgements
- Citation
- License
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
- Confidence-Weighted Loss โ reduces coupling by adjusting pseudo-label influence based on predicted confidence scores, downweighting unreliable predictions.
- Dynamic Thresholding โ mitigates confirmation bias with an adaptive mechanism that filters pseudo-labels based on model performance.
- Boundary-Aware Module โ tackles boundary blur using explicit (Sobel-based) boundary supervision to refine segmentation near object edges.
- 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:
| Setting | Split | Labeled images | mIoU |
|---|---|---|---|
| Cityscapes | 1/30 | 100 (3.3%) | 65.9 |
| Cityscapes | 1/4 | โ | 78.4 |
| Pascal VOC 2012 | 1/4 | โ | 76.2 |
See the project page and the paper for the full comparison against prior methods and all label partitions.

Qualitative comparison โ CW-BASS produces sharper object boundaries.

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:
| Flag | Default | Description |
|---|---|---|
--gamma | 1.0 | Confidence-weighting exponent in the weighted CE loss |
--base-threshold | 0.6 | Base value for the dynamic confidence threshold |
--beta | 0.5 | Sensitivity of the dynamic threshold to mean confidence |
--decay-factor | 0.9 | Multiplicative confidence-decay factor |
--use-confidence-decay | off | Enable progressive confidence decay |
--config | none | Optional 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.
- ST++: https://github.com/LiheYoung/ST-PlusPlus
- Context-Aware-Consistency: https://github.com/dvlab-research/Context-Aware-Consistency
- PyTorch-Encoding: https://github.com/zhanghang1989/PyTorch-Encoding
- OpenSelfSup: https://github.com/open-mmlab/OpenSelfSup
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.