Weakly-Supervised Semantic Segmentation Network with Deep Seeded Region Growing (CVPR 2018).

Overview

Weakly-Supervised Semantic Segmentation Network with Deep Seeded Region Growing (CVPR2018)

By Zilong Huang, Xinggang Wang, Jiasi Wang, Wenyu Liu and Jingdong Wang.

This code is a implementation of the weakly-supervised semantic segmentation experiments in the paper DSRG. The code is developed based on the Caffe framework.

Introduction

Overview of DSRG Overview of the proposed approach. The Deep Seeded Region Growing module takes the seed cues and segmentation map as input to produces latent pixel-wise supervision which is more accurate and more complete than seed cues. Our method iterates between reļ¬ning pixel-wise supervision and optimizing the parameters of a segmentation network.

License

DSRG is released under the MIT License (refer to the LICENSE file for details).

Citing DSRG

If you find DSRG useful in your research, please consider citing:

@inproceedings{huang2018dsrg,
    title={Weakly-Supervised Semantic Segmentation Network with Deep Seeded Region Growing},
    author={Huang, Zilong and Wang, Xinggang and Wang, Jiasi and Liu, Wenyu and Wang, Jingdong},
    booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},
    pages={7014--7023},
    year={2018}
}

Installing dependencies

  • Python packages:
      $ pip install -r python-dependencies.txt
  • caffe (deeplabv2 version): deeplabv2 caffe installation instructions are available at https://bitbucket.org/aquariusjay/deeplab-public-ver2. Note, you need to compile caffe with python wrapper and support for python layers. Then add the caffe python path into training/tools/findcaffe.py.

  • Fully connected CRF wrapper (requires the Eigen3 package).

      $ pip install CRF/

Training the DSRG model

  • Go into the training directory:
      $ cd training
      $ mkdir localization_cues
  • Download the initial VGG16 model pretrained on Imagenet and put it in training/ folder.

  • Download CAM seed and put it in training/localization_cues folder. We use CAM for localizing the foreground seed classes and utilize the saliency detection technology DRFI for localizing background seed. We provide the python interface to DRFI here for convenience if you want to generate the seed by yourself.

      $ cd training/experiment/seed_mc
      $ mkdir models
  • Set root_folder parameter in train-s.prototxt, train-f.prototxt and PASCAL_DIR in run-s.sh to the directory with PASCAL VOC 2012 images

  • Run:

      $ bash run.sh

The trained model will be created in models

Acknowledgment

This code is heavily borrowed from SEC.

Comments
  • Loss calculation is too slow

    Loss calculation is too slow

    Hi,

    First of all, thank you very much for providing the implementation of your paper. I am trying to recreate the results in PyTorch, but I have very slow training time due to the consistency loss computation, which uses pydensecrf, and it takes a lot of time for a moderately sized images (~ 356). Do you have any recommendations on how to speed things up, and can you please provide the time it took to train the network for in your case.

    Thank you very much.

    opened by yassouali 2
  • Failed to install CRF

    Failed to install CRF

    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:c:\users\appdata\local\continuum\anaconda3\libs /LIBPATH:c:\users\appdata\local\continuum\anaconda3\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.14393.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.14393.0\um\x64" /EXPORT:PyInit_krahenbuhl2013/wrapper build\temp.win-amd64-3.5\Release\krahenbuhl2013/wrapper.obj build\temp.win-amd64-3.5\Release\src/densecrf.obj build\temp.win-amd64-3.5\Release\src/labelcompatibility.obj build\temp.win-amd64-3.5\Release\src/pairwise.obj build\temp.win-amd64-3.5\Release\src/permutohedral.obj build\temp.win-amd64-3.5\Release\src/unary.obj build\temp.win-amd64-3.5\Release\src/util.obj build\temp.win-amd64-3.5\Release\src/densecrf_wrapper.obj /OUT:build\lib.win-amd64-3.5\krahenbuhl2013/wrapper.cp35-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.5\Release\krahenbuhl2013\wrapper.cp35-win_amd64.lib LINK : error LNK2001: unresolved external symbol PyInit_krahenbuhl2013/wrapper build\temp.win-amd64-3.5\Release\krahenbuhl2013\wrapper.cp35-win_amd64.lib : fatal error LNK1120: 1 unresolved externals error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe' failed with exit status 1120

    ----------------------------------------
    

    Command "c:\users\appdata\local\continuum\anaconda3\python.exe -u -c "import setuptools, tokenize;file='C:\Users\AppData\Local\Temp\pip-req-build-1u64fmyp\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\AppData\Local\Temp\pip-record-blyy3smc\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\AppData\Local\Temp\pip-req-build-1u64fmyp\

    opened by laukun 2
  • About Loss Function

    About Loss Function

    Hi! Thanks for you work! In you parer, the seed loss and boundry loss are combined to a single loss: image However, I haven't found this process neither in you code or in prototxt file: image

    Is there anything I have missed or misunderstood?

    opened by Albelt 1
  • why there exist two different solver.prototxt

    why there exist two different solver.prototxt

    In the experiment folder, there exist two different solver.prototxt: solver-f and solver-s, may I ask how to use them? solver-s seems use the 41x41 seeds for training, while solver-f seems to use the DSRG output for training. Is solver-s represents the main procedure to train DSRG, and solver-f means 'Retrain' procedure refered in your paper? THX!

    opened by yaoqi-zd 1
  • Localization cues

    Localization cues

    HI, I cannot successfully install your module DRFI so I use another code by (https://github.com/playerkk/drfi_matlab), and set the value < 0.06 as background seeds as what you write in the paper. However, I cannot reproduce the same results in your paper, the baseline (only with improved localization cues) in your paper is 52.5 mIou, but I only achieved 50.2% mIOU. btw, did the baseline you achieved not include the expand loss? what's the training hyperparamters in the Table 2? and Can you upload the localization cues with bg and fg please ? Thanks a lot

    opened by Ferenas 3
  • Question about seed dynamic updating

    Question about seed dynamic updating

    It's a very interesting work. We are conducting a similar segmentation task without initial cues file, and I hope to generate seeds in the first epoch and update them in subsequent epoches. However, in pylayers.py I think the grown seeds (through SRG method) that load from the outside pickel file are directly used to compute seed loss, meaning the cues pickle file needed to be imported at every epoch, which seems different from the paper saying that current seeds map are obtained through the last epoch generated seeds map. I don't know when and where the previous seeds (not the loaded pickle file) are substituted with the updated seeds and used as the newest seeds, can you help me? Thank you.

    opened by DotWang 4
  • Understanding the data in `localization-cues.pickle` file

    Understanding the data in `localization-cues.pickle` file

    I am trying to understand the data stored in the pickle file. I see that each key with img_file_cues have different shapes and values from nearly 0 to 40. Can you please help me in understanding these values.

    opened by sreesindhu-sabbineni 3
  • Failed to load caffe layers

    Failed to load caffe layers

    Hi,

    I have got this error: F0730 17:42:12.306586 5815 layer_factory.hpp:81] Check failed: registry.count(type) == 1 (0 vs. 1) Unknown layer type: ImageData (known types: AbsVal, Accuracy, ArgMax, BNLL, BatchNorm, BatchReindex, Bias, Clip, Concat, ContrastiveLoss, Convolution, Crop, Data, Deconvolution, Dropout, DummyData, ELU, Eltwise, Embed, EuclideanLoss, Exp, Filter, Flatten, HDF5Data, HDF5Output, HingeLoss, Im2col, InfogainLoss, InnerProduct, Input, LRN, LSTM, LSTMUnit, Log, MVN, MemoryData, MultinomialLogisticLoss, PReLU, Parameter, Pooling, Power, Python, RNN, ReLU, Reduction, Reshape, SPP, Scale, Sigmoid, SigmoidCrossEntropyLoss, Silence, Slice, Softmax, SoftmaxWithLoss, Split, Swish, TanH, Threshold, Tile)

    I have build caffe (make all and make pycaffe) successfully but still got this error. Any ideas?

    BTW, I have uncommented WITH_PYTHON_LAYER := 1 in the caffe make file.

    MANY THANKS!!!

    opened by xuehaouwa 0
Owner
Zilong Huang
HUSTer
Zilong Huang
Discriminative Region Suppression for Weakly-Supervised Semantic Segmentation

Discriminative Region Suppression for Weakly-Supervised Semantic Segmentation (AAAI 2021) Official pytorch implementation of our paper: Discriminative

Beom 74 Dec 27, 2022
Weakly Supervised Dense Event Captioning in Videos, i.e. generating multiple sentence descriptions for a video in a weakly-supervised manner.

WSDEC This is the official repo for our NeurIPS paper Weakly Supervised Dense Event Captioning in Videos. Description Repo directories ./: global conf

Melon(Xuguang Duan) 96 Nov 1, 2022
Anti-Adversarially Manipulated Attributions for Weakly and Semi-Supervised Semantic Segmentation (CVPR 2021)

Anti-Adversarially Manipulated Attributions for Weakly and Semi-Supervised Semantic Segmentation Input Image Initial CAM Successive Maps with adversar

Jungbeom Lee 110 Dec 7, 2022
Code for the paper One Thing One Click: A Self-Training Approach for Weakly Supervised 3D Semantic Segmentation, CVPR 2021.

One Thing One Click One Thing One Click: A Self-Training Approach for Weakly Supervised 3D Semantic Segmentation (CVPR2021) Code for the paper One Thi

null 44 Dec 12, 2022
Contrastive learning of Class-agnostic Activation Map for Weakly Supervised Object Localization and Semantic Segmentation (CVPR 2022)

CCAM (Unsupervised) Code repository for our paper "CCAM: Contrastive learning of Class-agnostic Activation Map for Weakly Supervised Object Localizati

Computer Vision Insitute, SZU 113 Dec 27, 2022
[CVPR'22] Weakly Supervised Semantic Segmentation by Pixel-to-Prototype Contrast

wseg Overview The Pytorch implementation of Weakly Supervised Semantic Segmentation by Pixel-to-Prototype Contrast. [arXiv] Though image-level weakly

Ye Du 96 Dec 30, 2022
A Comprehensive Analysis of Weakly-Supervised Semantic Segmentation in Different Image Domains (IJCV submission)

wsss-analysis The code of: A Comprehensive Analysis of Weakly-Supervised Semantic Segmentation in Different Image Domains, arXiv pre-print 2019 paper.

Lyndon Chan 48 Dec 18, 2022
Context Decoupling Augmentation for Weakly Supervised Semantic Segmentation

Context Decoupling Augmentation for Weakly Supervised Semantic Segmentation The code of: Context Decoupling Augmentation for Weakly Supervised Semanti

null 54 Dec 12, 2022
DiscoBox: Weakly Supervised Instance Segmentation and Semantic Correspondence from Box Supervision

The Official PyTorch Implementation of DiscoBox: Weakly Supervised Instance Segmentation and Semantic Correspondence from Box Supervision

Shiyi Lan 3 Oct 15, 2021
Reducing Information Bottleneck for Weakly Supervised Semantic Segmentation (NeurIPS 2021)

Reducing Information Bottleneck for Weakly Supervised Semantic Segmentation (NeurIPS 2021) The implementation of Reducing Infromation Bottleneck for W

Jungbeom Lee 81 Dec 16, 2022
The PyTorch implementation of DiscoBox: Weakly Supervised Instance Segmentation and Semantic Correspondence from Box Supervision.

DiscoBox: Weakly Supervised Instance Segmentation and Semantic Correspondence from Box Supervision The PyTorch implementation of DiscoBox: Weakly Supe

Shiyi Lan 1 Oct 23, 2021
Perturbed Self-Distillation: Weakly Supervised Large-Scale Point Cloud Semantic Segmentation (ICCV2021)

Perturbed Self-Distillation: Weakly Supervised Large-Scale Point Cloud Semantic Segmentation (ICCV2021) This is the implementation of PSD (ICCV 2021),

null 12 Dec 12, 2022
[CVPR22] Official codebase of Semantic Segmentation by Early Region Proxy.

RegionProxy Figure 2. Performance vs. GFLOPs on ADE20K val split. Semantic Segmentation by Early Region Proxy Yifan Zhang, Bo Pang, Cewu Lu CVPR 2022

Yifan 54 Nov 29, 2022
Codes for TS-CAM: Token Semantic Coupled Attention Map for Weakly Supervised Object Localization.

TS-CAM: Token Semantic Coupled Attention Map for Weakly SupervisedObject Localization This is the official implementaion of paper TS-CAM: Token Semant

vasgaowei 112 Jan 2, 2023
The official implementation of CVPR 2021 Paper: Improving Weakly Supervised Visual Grounding by Contrastive Knowledge Distillation.

Improving Weakly Supervised Visual Grounding by Contrastive Knowledge Distillation This repository is the official implementation of CVPR 2021 paper:

null 9 Nov 14, 2022
Hybrid CenterNet - Hybrid-supervised object detection / Weakly semi-supervised object detection

Hybrid-Supervised Object Detection System Object detection system trained by hybrid-supervision/weakly semi-supervision (HSOD/WSSOD): This project is

null 5 Dec 10, 2022
PointNetVLAD: Deep Point Cloud Based Retrieval for Large-Scale Place Recognition, CVPR 2018

PointNetVLAD: Deep Point Cloud Based Retrieval for Large-Scale Place Recognition PointNetVLAD: Deep Point Cloud Based Retrieval for Large-Scale Place

Mikaela Uy 294 Dec 12, 2022
Leveraging Instance-, Image- and Dataset-Level Information for Weakly Supervised Instance Segmentation

Leveraging Instance-, Image- and Dataset-Level Information for Weakly Supervised Instance Segmentation This paper has been accepted and early accessed

Yun Liu 39 Sep 20, 2022
Code for weakly supervised segmentation of a single class

SingleClassRL Implementation of weak single object segmentation from paper "Regularized Loss for Weakly Supervised Single Class Semantic Segmentation"

null 16 Nov 14, 2022