Official implementation of the paper:
Delving into Crispness: Guided Label Refinement for Crisp Edge Detection [arXiv] [Video].
Yunfan Ye, Renjiao Yi, Zhirui Gao, Zhiping Cai, Kai Xu.
- [July 2023] Initial release of code and models.
Learning-based edge detection usually suffers from predicting thick edges. Through extensive quantitative study with a new edge crispness measure, we find that noisy human-labeled edges are the main cause of thick predictions. Based on this observation, we advocate that more attention should be paid on label quality than on model design to achieve crisp edge detection. To this end, we propose an effective Canny-guided refinement of human-labeled edges whose result can be used to train crisp edge detectors. Essentially, it seeks for a subset of over-detected Canny edges that best align human labels. We show that several existing edge detectors can be turned into a crisp edge detector through training on our refined edge maps. Experiments demonstrate that deep models trained with refined edges achieve significant performance boost of crispness from 17.4% to 30.6%. With the PiDiNet backbone, our method improves ODS and OIS by 12.2% and 12.6% on the Multicue dataset, respectively, without relying on non-maximal suppression. We further conduct experiments and show the superiority of our crisp edge detection for optical flow estimation and image segmentation.
This code has been tested with Ubuntu 18.04, one 3080Ti GPU with CUDA 11.4, Python 3.8, Pytorch 1.12 and Matlab 2019a.
Ealier versions may also work.
To refine human-annotated labels, simply run (example):
python refine_label.py
The EdgeModel_gen.pth and networks.py are borrowed from EdgeConnect.
To evaluate the proposed new metric Crispness
of predicted edge maps , see eval_crispness/eval_crispness.m
and run with Matlab.
To evaluate ODS and OIS, see Structured Edge Detection Toolbox for more details.
To test with pre-trained PiDiNet model, simply run:
python pidinet/test_pidinet.py
The model named BSDS_refine_dice.pth
is trained on BSDS dataset using refined labels and dice loss.
(using both dice loss and refined labels are highly recommanded for crisp edge detection).
For your convenience, the refined datasets can be directly downloaded at BSDS and BIPED.
@article{ye2023delving,
title={Delving into Crispness: Guided Label Refinement for Crisp Edge Detection},
author={Ye, Yunfan and Yi, Renjiao and Gao, Zhirui and Cai, Zhiping and Xu, Kai},
journal={IEEE Transactions on Image Processing},
year={2023},
publisher={IEEE}
}