CoBra π : Complementary Branch Fusing Class and Semantic Knowledge for Robust Weakly Supervised Semantic Segmentation
We propose Complementary Branch (CoBra), a novel dual branch framework consisting of two distinct architectures which provide valuable complementary knowledge of class (from CNN) and semantic (from vision transformer) to each branch. In particular, we learn Class-Aware Projection (CAP) for the CNN branch and Semantic-Aware Projection (SAP) for the vision transformer branch to explicitly fuse their complementary knowledge and facilitate a new type of extra patch-level supervision. Extensive experiments qualitatively and quantitatively investigate how CNN and vision transformer complement each other on the PASCAL VOC 2012 dataset showing a state-of-the-art WSSS result.
- Download PASCAL VOC2012 devkit
- Ubuntu 20.04, with Python 3.10 and the following python dependencies.
pip install -r requirements.txt
Step1:
-
Run the run.sh script for training Cobra, it makes Seed and elements for making better Mask.
-
We train IRNet to generate mask to refine Seed.
-
change
title
andpascal_dataset_path
in run shell script.
bash run.sh
CAK Branch | ep19_cnn_checkpoint.pth | link |
SAK Branch | ep19_tran_checkpoint.pth | link |
Step2: For the Segmentation part, we used DeepLabV2 with resnet101 backbone and MiT-B2 backbone.
- DeepLabV2 (https://github.com/kazuto1011/deeplab-pytorch)
This repository has been developed based on the IRNet repository. Thanks for the good work!