Home

Awesome

RINDNet

RINDNet: Edge Detection for Discontinuity in Reflectance, Illumination, Normal and Depth
Mengyang Pu, Yaping Huang, Qingji Guan and Haibin Ling
ICCV 2021 (oral)

Please refer to supplementary material (code:p86d) (~60M) for more results.

Benchmark --- 🔥🔥BSDS-RIND🔥🔥

BSDS-RIND is the first public benchmark that dedicated to studying simultaneously the four edge types, namely Reflectance Edge (RE), Illumination Edge (IE), Normal Edge (NE) and Depth Edge (DE). It is created by carefully labeling images from the BSDS500. The datasets can be downloaded from:

<img src="fig/examples.png" width="500">

Abstract

As a fundamental building block in computer vision, edges can be categorised into four types according to the discontinuity in surface-Reflectance, Illumination, surface-Normal or Depth. While great progress has been made in detecting generic or individual types of edges, it remains under-explored to comprehensively study all four edge types together. In this paper, we propose a novel neural network solution, RINDNet, to jointly detect all four types of edges. Taking into consideration the distinct attributes of each type of edges and the relationship between them, RINDNet learns effective representations for each of them and works in three stages. In stage I, RINDNet uses a common backbone to extract features shared by all edges. Then in stage II it branches to prepare discriminative features for each edge type by the corresponding decoder. In stage III, an independent decision head for each type aggregates the features from previous stages to predict the initial results. Additionally, an attention module learns attention maps for all types to capture the underlying relations between them, and these maps are combined with initial results to generate the final edge detection results. For training and evaluation, we construct the first public benchmark, BSDS-RIND, with all four types of edges carefully annotated. In our experiments, RINDNet yields promising results in comparison with state-of-the-art methods.

<img src="fig/illustration.png" width=90%>

Usage

Training

  1. Clone this repository to local
git clone https://github.com/MengyangPu/RINDNet.git
  1. Download the augmented data to the local folder /data

  2. run train

python train_rindnet.py
or
python train_rindnet_edge.py

more train files (train_modelname.py and train_modelname_edge.py) in /train_tools

  1. Note: The imagenet pretrained vgg16 pytorch model for BDCN can be downloaded in [vgg16.pth](link: https://pan.baidu.com/s/10Tgjs7FiAYWjVyVgvEM0mA) code: ab4g. The imagenet pretrained vgg16 pytorch model for HED can be downloaded in 5stage-vgg.py36pickle code: 9po1.

Testing

  1. Download Pre-trained model for four types of edges, including Reflectance Edges (REs), Illumination Edges (IEs), Normal Edges (NEs), and Depth Edges (DEs).
MethodmodelPre-trained Model GoogleDrive
HEDmodeling/hedrun/hed, code:ef18
CEDcodedownload
RCFmodeling/rcfrun/rcf, code:ef18
BDCNmodeling/bdcnrun/bdcn, code:ef18
DexiNedmodeling/dexinedrun/dexined, code:ef18
CASENetmodeling/casenetrun/casenet, code:ef18
DFFmodeling/dffrun/dff, code:ef18
*DeepLabv3+modeling/deeplabrun/deeplab, code:ef18
*DOOBNetmodeling/doobnetrun/doobnet, code:ef18
*OFNetmodeling/ofnetrun/ofnet, code:ef18
DeepLabv3+modeling/deeplab2run/deeplab2, code:ef18
DOOBNetmodeling/doobnet2run/doobnet2, code:ef18
OFNetmodeling/ofnet2run/ofnet2, code:ef18
RINDNetmodeling/rindnetrun/rindnet, code:ef18

Download Pre-trained model for Generic Edges.

MethodmodelPre-trained Model
HEDmodeling/hed_edgerun_edge/hed, code:jhsr
CEDcodedownload
RCFmodeling/rcf_edgerun_edge/rcf, code:jhsr
BDCNmodeling/bdcn_edgerun_edge/bdcn, code:jhsr
DexiNedmodeling/dexined_edgerun_edge/dexined, code:jhsr
CASENetmodeling/casenet_edgerun_edge/casenet, code:jhsr
DFFmodeling/dff_edgerun_edge/dff, code:jhsr
DeepLabv3+modeling/deeplab_edgerun_edge/deeplab, code:jhsr
DOOBNetmodeling/doobnet_edgerun_edge/doobnet, code:jhsr
OFNetmodeling/ofnet_edgerun_edge/ofnet, code:jhsr
RINDNetmodeling/rindnet_edgerun_edge/rindnet, code:jhsr
  1. Setting the path in evaluate.py or evaluate_edge.py.
  2. run
python evaluate.py
or
python evaluate_edge.py

Eval

The .mat format files of testing set can be download here.

cd eval
run eval.m

Main results

BSDS-RIND

MethodmodelReflectance F-measureIllumination F-measureNormal F-measureDepth F-measureAverage F-measure
MethodmodelODSOISAPODSOISAPODSOISAPODSOISAPODSOISAP
HEDmodel0.4120.4660.3430.2560.2900.1670.4570.5050.3950.6440.6790.6670.4420.4850.393
CED-0.4290.4730.3610.2280.2860.1180.4630.5010.3720.6260.6550.6200.4370.4790.368
RCFmodel0.4290.4480.3510.2570.2830.1730.4440.5030.3620.6480.6790.6590.4450.4780.386
BDCNmodel0.3580.4580.2520.1510.2190.0780.4270.4840.3340.6280.6610.5810.3910.4560.311
DexiNedmodel0.4020.4540.3150.1570.1990.0820.4440.4860.3640.6370.6730.6450.4100.4530.352
CASENetmodel0.3840.4390.2750.2300.2730.1190.4340.4770.3270.6210.6510.5740.4170.4600.324
DFFmodel0.4470.4950.3240.2900.3370.1510.4790.5120.3520.6740.6990.6260.4730.5110.363
*DeepLabv3+model0.2970.3380.1650.1030.1500.0490.3660.3980.2320.5350.5790.4490.3250.3660.224
*DOOBNetmodel0.4310.4890.3700.1430.2100.0690.4420.4900.3390.6580.6890.6620.4190.4700.360
*OFNetmodel0.4460.4830.3750.1470.2070.0710.4390.4780.3250.6560.6830.6680.4220.4630.360
DeepLabv3+model0.4440.4870.3560.2410.2910.1480.4560.4950.3680.6440.6710.6170.4460.4860.372
DOOBNetmodel0.4460.5030.3550.2280.2720.1320.4650.4990.3730.6610.6910.6430.4500.4910.376
OFNetmodel0.4370.4830.3510.2470.2770.1500.4680.4980.3820.6610.6870.6370.4530.4860.380
RINDNetmodel0.4780.5210.4140.2800.3370.1680.4890.5220.4400.6970.7240.7050.4860.5260.432

Plot edge PR curves of RIND

We have released the code and data for plotting the edge PR curves of the above edge detectors here.

Precomputed Results

If you want to compare your method with RINDNet and other methods, you can download the precomputed results here (code: ewco).

Acknowledgments

Reference

@InProceedings{Pu_2021ICCV_RINDNet,
    author    = {Pu, Mengyang and Huang, Yaping and Guan, Qingji and Ling, Haibin},
    title     = {RINDNet: Edge Detection for Discontinuity in Reflectance, Illumination, Normal and Depth},
    booktitle = {Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV)},
    month     = {October},
    year      = {2021},
    pages     = {6879-6888}
}