Richer Convolutional Features for Edge Detection
Switch branches/tags
Nothing to show
Clone or download
Latest commit bf49602 Oct 2, 2018
Failed to load latest commit information.
cmake first commit Mar 23, 2017
docs first commit Mar 23, 2017
examples/rcf Update train_val.prototxt Dec 30, 2017
include/caffe first commit Mar 23, 2017
matlab first commit Mar 23, 2017
python first commit Mar 23, 2017
scripts first commit Mar 23, 2017
src Update sigmoid_cross_entropy_loss_layer.cpp Aug 23, 2017
tools first commit Mar 23, 2017
.gitignore first commit Mar 23, 2017
CMakeLists.txt first commit Mar 23, 2017
LICENSE first commit Mar 23, 2017
Makefile first commit Mar 23, 2017
Makefile.config.example first commit Mar 23, 2017 Update Oct 2, 2018
caffe.cloc first commit Mar 23, 2017

Richer Convolutional Features for Edge Detection


In this paper, we propose an accurate edge detector using richer convolutional features (RCF). Since objects in natural images possess various scales and aspect ratios, learning the rich hierarchical representations is very critical for edge detection. CNNs have been proved to be effective for this task. In addition, the convolutional features in CNNs gradually become coarser with the increase of the receptive fields. According to these observations, we attempt to adopt richer convolutional features in such a challenging vision task. The proposed network fully exploits multiscale and multilevel information of objects to perform the image-to-image prediction by combining all the meaningful convolutional features in a holistic manner. Using VGG16 network, we achieve state-of-the-art performance on several available datasets. When evaluating on the well-known BSDS500 benchmark, we achieve ODS F-measure of 0.811 while retaining a fast speed (8 FPS). Besides, our fast version of RCF achieves ODS F-measure of 0.806 with 30 FPS.


If you are using the code/model/data provided here in a publication, please consider citing our paper:

  title={Richer Convolutional Features for Edge Detection},
  author={Liu, Yun and Cheng, Ming-Ming and Hu, Xiaowei and Wang, Kai and Bai, Xiang},
  journal={Proceedings of the IEEE conference on computer vision and pattern recognition},

Note: For the pytorch implementation of RCF, please refer to this github repo. Thanks for Yuanyi's contribution!

Evaluation results

Evaluation results for BSDS500 and NYUD datasets are avilable here.

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

Pretrained models

RCF model for BSDS500 dataset is available here.

RCF model for NYUD dataset is available here (Depth and Image).

Testing RCF

  1. Clone the RCF repository

    git clone
  2. Download pretrained models, and put them into $ROOT_DIR/examples/rcf/ folder.

  3. Download the datasets you need as below, and extract these datasets to $ROOT_DIR/data/ folder.

  4. Build Caffe.

  5. Go into the folder $ROOT_DIR/examples/rcf/. Then, you can run RCF-singlescale.ipynb to test single-scale RCF on BSDS500 dataset, or run RCF-multiscale.ipynb to test multiscale RCF on BSDS500 dataset, or run RCF-singlescale-NYUD.ipynb to test single-scale RCF on NYUD dataset.

Note: Before evaluating the predicted edges, you should do the standard non-maximum suppression (NMS) and edge thinning. We used Piotr's Structured Forest matlab toolbox available here.

Training RCF

  1. Download the datasets you need.

  2. Download the pretrained vgg16 model from here.

  3. Start training process by running following commands:

    cd $ROOT_DIR/examples/rcf/


This code is based on HED. Thanks to the contributors of HED.

  title={Holistically-nested edge detection},
  author={Xie, Saining and Tu, Zhuowen},
  booktitle={Proceedings of the IEEE International Conference on Computer Vision},