Compact twice fusion network for edge detection
摘要
The significance of multi-scale features has been gradually recognized by the edge detection community. However, the fusion of multi-scale features increases the complexity of the model, which is not friendly to practical application. In this work, we propose a Compact Twice Fusion Network (CTFN) to fully integrate multi-scale features while maintaining the compactness of the model. CTFN includes two lightweight feature fusion modules: a Semantic Enhancement Module (SEM) that can utilize the semantic information contained in coarse-scale features to guide the learning of fine-scale features, and a Pseudo Pixel-level Weighting (PPW) module that aggregates the complementary merits of features by assigning weights to all features. Furthermore, we propose a novel loss function, coined Dynamic Focal Loss, which reshapes the standard cross-entropy loss and dynamically adjusts the weights to correct the distribution of hard samples. We evaluate our method on three datasets, i.e., BSDS500, NYUDv2, and BIPEDv2. CTFN achieves competitive accuracy with fewer parameters and computational costs than state-of-the-art methods. With the exception of the backbone, CTFN only requires 0.1M extra parameters, making the computation 40% less expensive than other state-of-the-art methods. The codes are available at https://github.com/Li-yachuan/CTFN-pytorch-master.