DemoResearch

Richer Convolutional Features for Edge Detection

Yun Liu1      Ming-Ming Cheng1     Xiaowei Hu1      Jia-Wang Bian1        Le Zhang2       Xiang Bai3      Jinhui Tang4

1Nankai University        2ADSC     3HUST       4NUST

Richer Convolutional Features for Edge Detection

Online demo at https://mc.nankai.edu.cn/edge

A simple demo captured by my phone (网速过慢可以使用西瓜视频观看).

Abstract

Edge detection is a fundamental problem in computer vision. Recently, convolutional neural networks (CNNs) have pushed forward this field significantly. Existing methods which adopt specific layers of deep CNNs may fail to capture complex data structures caused by variations of scales and aspect ratios. In this paper, we propose an accurate edge detector using richer convolutional features (RCF). RCF encapsulates all convolutional features into more discriminative representation, which makes good usage of rich feature hierarchies, and is amenable to training via backpropagation. RCF fully exploits multiscale and multilevel information of objects to perform the image-to-image prediction holistically. 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. We also demonstrate the versatility of the proposed method by applying RCF edges for classical image segmentation.

Papers

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

Motivation

We build a simple network based on VGG16 to produce side outputs of conv3_1, conv3_2, conv3_3, conv4_1, conv4_2 and conv4_3. One can clearly see that convolutional features become coarser gradually, and the intermediate layers conv3_1, conv3_2, conv4_1, and conv4_2 contain lots of useful fine details that do not appear in other layers.

Method

Our RCF network architecture. The input is an image with arbitrary sizes, and our network outputs an edge possibility map in the same size. We combine hierarchical features from all the conv layers into a holistic framework, in which all of the parameters are learned automatically. Since receptive field sizes of conv layers in VGG16 are different from each other, our network can learn multiscale, including low-level and objectlevel, information that is helpful to edge detection.

The pipeline of our multiscale algorithm. The original image is resized to construct an image pyramid. And these multiscale images are input to RCF network for a forward pass. Then, we use bilinear interpolation to restore resulting edge response maps to original sizes. A simple average of these edge maps will output high-quality edges.

Evaluation on BSDS500 dataset

Performance summary of 50+ years edge detection history. Our method achieves the first real-time system with better F-Measure than human annotators.   (Data for this figure can be found here)

The comparison with some competitors on BSDS500 dataset. The top three results are highlighted in red, green and blue respectively.

FAQs:

1. How your system is able to outperform humans, which is used as ground-truth?

We don’t think our method outperforms humans generally. It only achieves better F-Measure score than average human annotators of BSD 500 benchmarks. If given more time and careful training, human annotators could do better.

Related Papers

  • A Simple Pooling-Based Design for Real-Time Salient Object Detection, Jiang-Jiang Liu#, Qibin Hou#, Ming-Ming Cheng*, Jiashi Feng, Jianmin Jiang, IEEE CVPR, 2019. [project|bib|pdf|poster]
(Visited 38,585 times, 1 visits today)
Subscribe
Notify of
guest

207 Comments
Inline Feedbacks
View all comments
Ding

您好,您在github上更新了NYUD数据集的结果,请问新的结果是如何得到的呢?谢谢!

Ding

哦,非常感谢!

wang yi

您提供的NYUD数据集中的测试集,没有groundtruth,这个groundtruth怎么获得

zhangh

您好,想请教一下,用提供的代码训练的时候会报错Cannot copy param 0 weights from layer ‘score-dsn2’; shape mismatch. Source param shape is 1 128 1 1 (128); target param shape is 1 21 1 1 (21). To learn this layer’s parameters from scratch rather than copying from a saved net, rename the layer. 这个要怎么解决呢?score-dsn2、3、4、5都是shape mismatch,谢谢啦:)

zhangh

我知道了!错用了HED vgg16 pretrained模型初始化的,灰常感谢~~

deke

您好,我想请教,为什么你的网络中新添加的层的学习率会设置这么小? 例如 con*_*_down累的层的权重的学习率为基本学习率的0.1, score_dsn*的层的权重的学习率为基本学习率的0.01以及将new_score_weighting的学习率设置为基本学习率的0.001?

deke

谢谢您的回复! 对于您的观点我不是很理解, 您设置更小学习率的另一原因是否是这些层都离loss层较近? 也就是说, 如果参数较少的层出现在主体网络中而不是进行预测的分支中的话, 即使是设置为基础学习率也没关系?

deke

了解, 谢谢您的回复.
祝好.

SHY

您好,我想请教一下关于实验结果计算的问题,在边缘提取的结果图中绝大部分像素其实都是非边缘的,那么在计算准确率的时候,您是针对整张图计算的(标记为非边缘的点也参与),还是只计算了标记为边缘的像素点的准确率呢?谢谢!

好名字

老师您好,我训练的时候stage5 deconv出来的图总是十分模糊,这是为什么

好名字

就是几乎看不清物体的轮廓。

好名字

抱歉才回复您。 之前回复,网站显示“无效的验证码”。我尝试用tensorflow复现您的结果,改动是用Adam优化器代替了SGD。 发现side_outpot的结果中,1-4和您的很像(目测),但side_output 5 却大大不如您的结果。 就是看起来特别模糊,几乎没有物体的轮廓。

Yan

您好,能分享下您tf的代码给我学习么?

湛家明

您好,我在运行NMS文件后的得到的边缘图也没有变细不知道什么情况,然后用这个得到边缘图进行评价,性能指标差很多是不是这个边缘未变细的原因。

湛家明

试了好多次,NMS后还是未变细,可能是我定义的函数并未调用edgesNmsmex函数,希望您能详细说下是怎么定义这个函数的,万分感谢!!!

Alex

您好,上面那个问题已经解决啦。。。但是在运行nms文件时遇到找不到edgesNms这个函数,,在toolbox里面也确实没有该文件。。。其他的我也都照着tutorial做了。。。不知道为什么还是报这样的错误。
In edge_nms (line 10)
未定义函数或变量 ‘edgesNms’。

谢谢

Alex

您好,感谢您的回复,,,可是我用nms处理后得到边界还是跟之前一样是粗的,,想请问一下这是什么原因呢,谢谢

湛家明

您好,您用了nms边缘未变细问题解决了吗?我也遇到了同样的问题求帮助。

Arlene

您好?请问您怎样进行的nms?

岳增友

您好,能否出一个NMS细化的教程?

Alex

您好,我运行测试代码遇到如下错误:
F1228 15:16:32.198122 20695 layer_factory.cpp:69] Layer conv1_1 has unknown engine.
*** Check failure stack trace: ***
[I 15:17:54.551 NotebookApp] KernelRestarter: restarting kernel (1/5), keep random ports
WARNING:root:kernel 988b18e8-175a-48c0-a26c-9cd06c83a5e0 restarted

还请帮忙看一下,谢谢

feifei

我也遇到了此问题,请问您解决了吗?是cudnn的问题吗?我是win10 ,GTX1050显卡,vs2015, cuda8.0,cudnn5.1,我跟您出现了同样的问题!所以在此请求您的帮助,谢谢!

Jiaxin Zuo

您好,看了您的论文和代码后对于loss function有几个问题,
1 您文章中说忽略(0,阈值)中的点,我看了源码中的loss function是只有在target==1或者0时才计算的loss,那请问此时的阈值是不是就是1呢,还是说我对这个阈值的理解有问题?
2 target数组是不是就是论文中所说的average所有标注者的标注后的数组呢?如果是的话我想请问从label图片是如何转换成这个数组的呢?
刚刚入门图像处理,比较小白,请您指教!

曹以隽

您好,看了您的论文有几个问题。
1、VOC2012和NYUD-V2的 训练label是怎么生成的?具体方法是啥?
2、训练的label和测试的label是用SegmentationClass 还是SegmentationObject 生成的还是两者都用?
3、我看到有些论文还用了非极大值抑制做后续处理,不过模型跑出来是没有方向图的,这点很让人困惑。另外,您的RCF用了后续处理吗,如果用了是什么呢?
非常感谢~

曹以隽

非常感谢~

youmi

您好,我用BSDS500 benchmark里的seg2bdry.m函数从segmentation转换成boundary.结果是即使我用训练集里的图片的segmentation生成boundary.和您提供的训练集里的boundary ground-truth仍然相差很大.我想知道您是怎么处理的呢?或者能发布一下测试集的边缘ground-truth吗?蟹蟹

youmi

NYUD数据集
1. 我下载的官方NYUD-V2数据集,然后用它的segmentation label 通过 seg2bdry.m函数提取边缘,但是提取的边缘和您提供的NYUD训练集的边缘ground-truth相差较大,两个物体重合部分会检测出两条并列的边缘,而在您提供的ground-truth一般只有一条边缘.不知道您是怎么解决的?或者能否开放NYUD测试集的ground-truth方便做评测.不甚感激!
2. BSDS和PASCAL数据集混起来的训练集内图片的最小分辨率是71,经过16倍下采样后图像分辨率只有4,这样大的信息损失然后双线性插值 恢复全分辨率的图片,我感觉问题蛮大的?不知道您怎么看. 而且我训练出的边缘过于丰富,参数是按照您论文里提到的设置的….感觉是不是theta阈值设小了…..

youmi

好的,十分感谢您的回复,非常有用!
我的邮箱: youmi@buaa.edu.cn
十分感谢!

youmi

收到,谢谢

dayu

想请问一下,为什么NYUD数据集在你发的链接里找不着呢?

Albert

您好,请问您是如何用seg2bdry.m提取边缘的呢?

Ang LI

您好,请问solve.py中如果使用了solver.restore之后每一次迭代的Loss都是-nan,但是下面的每一小部分输出dsn1_loss,fuse_loss这几个都是正确的呢?请问是哪个地方出现了问题呢

Ang LI

非常感谢,我多试了几次果然好了

chengzhen

针对loss=-nan的情况,除了多试几次没有其他方法了吗?

洪昭立

你好,我在用你们的网络进行训练时,没迭代20次需要30秒左右,也就是说按照.Prototext里的超参数设置需要迭代100W次,那需要训练一个月。请问是这个时间长度,还是我的程序没真正调用cuda加速。

洪昭立

谢谢你的回复。但是昨天我将solve.py中的solver.step(40000)改成solver.step(100000),但是今天早上已经训练到了100260了还没停止,这是为什么。然后我用rcf_bsds_iter_100000.caffemodel来测试数据集,发现效果不是很好。这个时候应该怎么办?

chengzhen

针对训练速度问题,我也有同感,除了减少训练次数,可有其他方法能提高训练速度?

Bob

为什么要忽略边缘概率低于阈值的点呢?

张明琦

你好,我也在做边缘检测这方面的工作,有些问题不太明白,能给个邮箱请教一下吗,谢谢了。

MM Cheng

有问题请直接留言,方便类似问题其他人也能参考。

张明琦

您好,请问在做NMS时,下载了Piotr Dollar的Matlab toobox并加入路径,运行edge_nms.m时,找不到edgesNms函数,这个函数在哪呢?

湛家明

您好!我使用RCF-singlescale.ipynb 在BSDS500上进行了简单的测试,速度只有12fps,测试代码中也没有生成F-measure性能指标的代码,这个性能指标是怎么得到的?谢谢!

湛家明

嗯,谢谢您的指导!

张松龙

程明明老师,您好,我跑您rcf代码时出现这样的错误,是什么原因导致的呢?F1027 13:05:30.217037 5997 net.cpp:775] Cannot copy param 0 weights from layer ‘score-dsn2’; shape mismatch. Source param shape is 1 128 1 1 (128); target param shape is 1 21 1 1 (21). To learn this layer’s parameters from scratch rather than copying from a saved net, rename the layer.

王洲涛

程明明老师,您好,请教您一个问题。如果想用自己标记的数据去训练RCF,请问是否有快速准确的标记方法或者软件可以推荐。谢谢~

MM Cheng

这个暂时没有。

周文璋

我有个问题想请您指导下,我下了你们的代码,在windows10平台基于vs2015进行caffe编译,报有std::tuple 系列错误,我想问下,你们编译caffe的具体环境有哪些

MM Cheng

我们是在Ubuntu下的环境。关于Caffe在不同操作系统的问题,建议Google去找,我们也不太有经验。

hhh

您好,哪里可以下载其他算法的评价指标呢?

miao

程明明老师:

您好,您的RCF工作非常好!请问在每个level卷积时为何1×1的kernel要设置为21种?

1 2 3