OBG-FCN - implementation of 'Object Boundary Guided Semantic Segmentation'

Overview

OBG-FCN

This repository is to reproduce the implementation of 'Object Boundary Guided Semantic Segmentation' in http://arxiv.org/abs/1603.09742

Object Boundary Guided Semantic Segmentation
Qin Huang, Chunyang Xia, Wenchao Zheng, Yuhang Song, Hao Xu, C.-C. Jay Kuo
arXiv:1603.09742

the paper claimed to achieve 87.5% mean IU in PASCAL VOC 2011 validation set with only the training images of VOC 2011 training set.

The code is based on the repository of https://github.com/shelhamer/fcn.berkeleyvision.org, which contains the offical code for the paper:

Fully Convolutional Models for Semantic Segmentation
Jonathan Long*, Evan Shelhamer*, Trevor Darrell
CVPR 2015
arXiv:1411.4038

The implementation is just for test and could not achieve result close to Object Boundary Guided Semantic Segmentation so far. Any suggestion is more than welcome

Mdoels are trained using extra data from Hariharan et al., but excluding SBD val. Mdoels are tested using aug_val set by excluding the overlapping images in VOC train_val dataset.

Here is the result so far:

  • [FCN-32s sbd]: mean IU 0.601230112927 on aug_val
  • [FCN-16s sbd]: mean IU 0.623964674094 on aug_val
  • [FCN-8s sbd]: mean IU 0.625525553796 on aug_val
  • [FCN-16s OBG-8s sbd]: mean IU 0.628746446579 on aug_val
  • [FCN-8s OBG-8s sbd]: mean IU 0.630523623869 on aug_val
  • [FCN-8s OBG-4s sbd]: mean IU 0.593030120308 on aug_val
  • [FCN-8s OBG-2s sbd]: mean IU 0.577085377376 on aug_val

model link:

There must be major bugs in the implementation since the performace decreased when combining pool2 and pool1 for object boundary.

You might also like...
A pytorch-version implementation codes of paper:
A pytorch-version implementation codes of paper: "BSN++: Complementary Boundary Regressor with Scale-Balanced Relation Modeling for Temporal Action Proposal Generation"

BSN++: Complementary Boundary Regressor with Scale-Balanced Relation Modeling for Temporal Action Proposal Generation A pytorch-version implementation

Learning Pixel-level Semantic Affinity with Image-level Supervision for Weakly Supervised Semantic Segmentation, CVPR 2018
Learning Pixel-level Semantic Affinity with Image-level Supervision for Weakly Supervised Semantic Segmentation, CVPR 2018

Learning Pixel-level Semantic Affinity with Image-level Supervision This code is deprecated. Please see https://github.com/jiwoon-ahn/irn instead. Int

Sound-guided Semantic Image Manipulation - Official Pytorch Code (CVPR 2022)
Sound-guided Semantic Image Manipulation - Official Pytorch Code (CVPR 2022)

🔉 Sound-guided Semantic Image Manipulation (CVPR2022) Official Pytorch Implementation Sound-guided Semantic Image Manipulation IEEE/CVF Conference on

Unsupervised Semantic Segmentation by Contrasting Object Mask Proposals.
Unsupervised Semantic Segmentation by Contrasting Object Mask Proposals.

Unsupervised Semantic Segmentation by Contrasting Object Mask Proposals This repo contains the Pytorch implementation of our paper: Unsupervised Seman

This repository allows you to anonymize sensitive information in images/videos. The solution is fully compatible with the DL-based training/inference solutions that we already published/will publish for Object Detection and Semantic Segmentation. FactSeg: Foreground Activation Driven Small Object Semantic Segmentation in Large-Scale Remote Sensing Imagery (TGRS)
FactSeg: Foreground Activation Driven Small Object Semantic Segmentation in Large-Scale Remote Sensing Imagery (TGRS)

FactSeg: Foreground Activation Driven Small Object Semantic Segmentation in Large-Scale Remote Sensing Imagery by Ailong Ma, Junjue Wang*, Yanfei Zhon

A Data Annotation Tool for Semantic Segmentation, Object Detection and Lane Line Detection.(In Development Stage)
A Data Annotation Tool for Semantic Segmentation, Object Detection and Lane Line Detection.(In Development Stage)

Data-Annotation-Tool How to Run this Tool? To run this software, follow the steps: git clone https://github.com/Autonomous-Car-Project/Data-Annotation

Contrastive learning of Class-agnostic Activation Map for Weakly Supervised Object Localization and Semantic Segmentation (CVPR 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

 Segmentation in Style: Unsupervised Semantic Image Segmentation with Stylegan and CLIP
Segmentation in Style: Unsupervised Semantic Image Segmentation with Stylegan and CLIP

Segmentation in Style: Unsupervised Semantic Image Segmentation with Stylegan and CLIP Abstract: We introduce a method that allows to automatically se

Comments
  • opinion on your implementation

    opinion on your implementation

    Hello, When looking into your code, I find that you used the SBDD dataset for training(according to your prototxt, right?). However, it's expressed in the original paper that the author just used the augmented data to train(see below). So could this be a reason for your failure to achieve the results declared in paper?

    Since the labeling of augmented data is not very accurate, we use the full set of 11,685 images to train the OBP-FCN-32s only.

    What's more, I've check your layers.py and observe that your load_contourlabel function seems to not follow the idea in the original paper.

       def load_contourlabel(self, idx):
            """
            Load label image as 1 x height x width integer array of label indices.
            The leading singleton dimension is required by the loss.
            """
            import scipy.io
            mat = scipy.io.loadmat('{}/cls/{}.mat'.format(self.sbdd_dir, idx))
            label = mat['GTcls'][0]['Segmentation'][0].astype(np.uint8)        
                       
            from scipy import ndimage
            edge_horizont = ndimage.sobel(label, 0)
            edge_vertical = ndimage.sobel(label, 1)
            magnitude = np.hypot(edge_horizont, edge_vertical)     
    
            contour_label = np.zeros(label.shape,dtype=np.uint8)
            contour_mask = np.zeros(label.shape,dtype=np.uint8)
            label[label==0]=254
            label[label<254]=1
            
            contour_mask[magnitude>0] = 255            
            kernel = np.ones((5,5),np.uint8)
            import cv2
            #contour_mask = cv2.dilate(contour_mask,kernel,iterations = 1)
            #contour_mask = cv2.erode(contour_mask,kernel,iterations = 1)
            contour_label[label==1]=1   
            contour_label[label==254]=0 
            contour_label[contour_mask==255]=2
    
            contour_label = contour_label[np.newaxis, ...]
            return contour_label
    

    Because according to the Algorithm A for Label Conversion for the PASCAL VOC dataset and the corresponding sentences,

    0

    your order of assignment of label is different from the paper, while the author said

    Note that the order of the assignment is very important so as to keep the completeness of object and the accuracy of the boundary

    I think the order of the assignment matters too.
    Last, I am not very sure your strategy to find the boundary has follows the author's, since theirs adopt a 3 × 3 window for comparison, which I fail to find the action in your code.

    :)

    opened by huangh12 1
  •  87.5% mean IU in PASCAL VOC 2011 validation set ?

    87.5% mean IU in PASCAL VOC 2011 validation set ?

    Hello, you said that the original paper claimed a 87.5% mean IU in PASCAL VOC 2011 validation set. Are you serious? 87.5% is a unbelievably high score.

    I actually find they stated "the OBG-FCN with w = 2 reaches 69.5% mean IU in VOC 2011 test and 69.1% in VOC 2012 test, outperforming the baseline FCN by about 7%."

    So I think it's probably a typo

    :)

    opened by huangh12 1
  • Weird prototxt layer ...

    Weird prototxt layer ...

    Hello,

    where did you got these .prototxt and .caffemodel files?

    for example look at this layer at the FCN-8s-OBG-4s.

    layer {
      name: "obg-fcn-fuse"
      type: "Eltwise"
      bottom: "mask_projection_no_b"
      bottom: "score_fcn"
      top: "score"
      eltwise_param {
        operation: PROD
      }
    }
    
    

    where this top: "score" refers to? there is not layer in the name of score in the whole text. I think the problem of lower accuracy might come from this or possible similar problems inside prototxt files.

    opened by MyVanitar 11
Owner
Jiu XU
Computer Vision Engineering Manager @ Apple
Jiu XU
Another pytorch implementation of FCN (Fully Convolutional Networks)

FCN-pytorch-easiest Trying to be the easiest FCN pytorch implementation and just in a get and use fashion Here I use a handbag semantic segmentation f

Y. Dong 158 Dec 21, 2022
An official PyTorch Implementation of Boundary-aware Self-supervised Learning for Video Scene Segmentation (BaSSL)

An official PyTorch Implementation of Boundary-aware Self-supervised Learning for Video Scene Segmentation (BaSSL)

Kakao Brain 72 Dec 28, 2022
Recall Loss for Semantic Segmentation (This repo implements the paper: Recall Loss for Semantic Segmentation)

Recall Loss for Semantic Segmentation (This repo implements the paper: Recall Loss for Semantic Segmentation) Download Synthia dataset The model uses

null 32 Sep 21, 2022
TorchDistiller - a collection of the open source pytorch code for knowledge distillation, especially for the perception tasks, including semantic segmentation, depth estimation, object detection and instance segmentation.

This project is a collection of the open source pytorch code for knowledge distillation, especially for the perception tasks, including semantic segmentation, depth estimation, object detection and instance segmentation.

yifan liu 147 Dec 3, 2022
BADet: Boundary-Aware 3D Object Detection from Point Clouds (Pattern Recognition 2022)

BADet: Boundary-Aware 3D Object Detection from Point Clouds (Pattern Recognition

Rui Qian 17 Dec 12, 2022
code for `Look Closer to Segment Better: Boundary Patch Refinement for Instance Segmentation`

Look Closer to Segment Better: Boundary Patch Refinement for Instance Segmentation (CVPR 2021) Introduction PBR is a conceptually simple yet effective

H.Chen 143 Jan 5, 2023
Generic Event Boundary Detection: A Benchmark for Event Segmentation

Generic Event Boundary Detection: A Benchmark for Event Segmentation We release our data annotation & baseline codes for detecting generic event bound

null 47 Nov 22, 2022
Code for Boundary-Aware Segmentation Network for Mobile and Web Applications

BASNet Boundary-Aware Segmentation Network for Mobile and Web Applications This repository contain implementation of BASNet in tensorflow/keras. comme

Hamid Ali 8 Nov 24, 2022
[AAAI-2021] Visual Boundary Knowledge Translation for Foreground Segmentation

Trans-Net Code for (Visual Boundary Knowledge Translation for Foreground Segmentation, AAAI2021). [https://ojs.aaai.org/index.php/AAAI/article/view/16

ZJU-VIPA 2 Mar 4, 2022
Tensorflow 2.x implementation of Panoramic BlitzNet for object detection and semantic segmentation on indoor panoramic images.

Deep neural network for object detection and semantic segmentation on indoor panoramic images. The implementation is based on the papers:

Alejandro de Nova Guerrero 9 Nov 24, 2022