Abstract
Contour detection is a fundamental computer vision task that requires distinguishing semantic object boundaries from cluttered backgrounds. This paper introduces DeepContour, a novel framework that addresses the inherent geometric diversity of contours through shape subclassing and a specialized positive-sharing loss function. By partitioning contours into distinct geometric categories and prioritizing the distinction between contours and background over subclass classification, the model learns highly discriminative deep features. Experimental results on the BSDS500 benchmark demonstrate that DeepContour achieves state-of-the-art performance and exhibits strong generalization across diverse datasets.
Introduction
Identifying the semantic boundaries of objects—contour detection—is significantly more challenging than standard edge detection. While edge detection focuses on local changes in brightness or color, contour detection must navigate the vast diversity of boundary patterns, such as straight lines, T-junctions, and parallel structures.
Standard Convolutional Neural Networks (CNNs) typically treat all these variations as a single "positive" class. This monolithic approach makes it difficult for a network to learn representative features for such a varied category. Furthermore, traditional loss functions like Softmax penalize the model for confusing one type of contour with another, even though both are valid detections. DeepContour addresses these issues by explicitly modeling the internal structure of the contour class.
Methodology
The authors propose a two-pronged strategy to manage the complexity of contour patterns: shape subclassing and a positive-sharing loss function.
Shape Subclassing
Instead of treating all contours as a single class, the method uses unsupervised clustering to partition contour patches into $K$ distinct "shape classes" (e.g., $K=50$). This "divide-and-conquer" approach allows the model parameters to fit specific geometric structures more effectively, capturing the nuanced mid-level geometry of object boundaries.
CNN Architecture and Positive-sharing Loss
The core of the system is a 6-layer CNN designed to extract discriminative features from local image patches.
As shown in the architecture diagram, the network processes $45 \times 45$ pixel patches. The primary innovation lies in the positive-sharing loss function. Unlike standard Softmax, which treats misclassification between contour subclasses as a major error, this loss function introduces a regularizer that shares the loss among all positive subclasses. It prioritizes the distinction between contour vs. background over the distinction between specific subclasses.
Once trained, the 128-dimensional vector from the first fully-connected layer (FC1) is extracted as the "DeepContour" feature. These features are then fed into a Structured Forest classifier to produce the final contour map.
Experimental Results
DeepContour was evaluated on the Berkeley Segmentation Dataset (BSDS500), the gold standard for contour detection.
As illustrated in the Precision-Recall curves, DeepContour achieved an Optimal Dataset Scale (ODS) F-measure of 0.76, outperforming contemporary deep learning methods like DeepNet (0.74) and various hand-crafted feature approaches.
Beyond the BSDS500, the model demonstrated robust cross-dataset generalization. When trained on outdoor images from BSDS and tested on the indoor scenes of the NYU Depth Dataset v2 (NYUD), the model maintained a high accuracy (ODS 0.55), significantly outperforming traditional methods like gPb-owt-ucm. This suggests that the learned features capture fundamental structural properties of object boundaries that are not dataset-specific.
Conclusion
DeepContour demonstrates that modeling the internal geometric structure of complex semantic classes can significantly improve feature learning. By combining shape subclassing with a flexible positive-sharing loss, the network learns to ignore cluttered textures in favor of structural boundaries. While the current implementation relies on a separate Structured Forest classifier, future work could explore end-to-end trainable frameworks and the incorporation of global context to further refine detection accuracy.
Summary updated