yun-liu / RCF

Richer Convolutional Features for Edge Detection
Other
753 stars 259 forks source link

Question about RCF-ResNet #89

Open trungpv88 opened 5 years ago

trungpv88 commented 5 years ago

Hello,

I have a question about RCF-ResNet. As you said in a post: " For ResNet, we use all the 3x3 conv layers, excluding the 1x1 conv layers. We also change the stride of "conv1" layer from 2 to 1". I try to do that with ResNet50 and ResNet101, but it does not work (the final result is always 0.5). It seems that the weights from 3x3 conv layers are almost zero. I think when I load the pretrained model of ResNet, the residual mappings are already optimized to zero. That's why the weights cannot be changed. I also try to use the last layers (1x1 conv) from each stage in ResNet. It works but the contour quality is not good as RCF-VGG16.

Can you share me how to implement RCF with ResNet (structures, hyperparameters ...) , please?

Thank you very much.

yun-liu commented 5 years ago

Thank you for your question! I have not met your problem, but I have pretrained the backbone on the ImageNet to further improve the results. Since I think people will not be interested in RCF-ResNet that is slower than RCF-VGG, I did not release it. I will release the code tomorrow.

trungpv88 commented 4 years ago

OK. Thank you very much. I think I have a problem with some hyperparameters (ex, lr_mult).

yun-liu commented 4 years ago

I have uploaded the RCF-ResNet code into the folder of examples/rcf/. The pretrained ImageNet and BSDS500 models are available here. I didn't test the code thoroughly. I add two 3x3 conv layers after each conv layer of ResNet, but I'm not sure if it will help or only help for low layers (e.g., conv1). I will do this evaluation as soon as possible.

trungpv88 commented 4 years ago

Thank you so much. I tested your model and it gives much better results that I trained. I will try modify the structure to see how the 3x3 conv layers help improve the contour quality; because when I extract directly the features from the 1x1 conv layers or 3x3 conv layers in residual blocks, it seems that the contours are more blurries.

yun-liu commented 4 years ago

I will appreciate it if you could share the evaluation results about the function of the additional 3x3 conv layers in the future : ) I'll test it, too.

yun-liu commented 4 years ago

I have tested the ResNet101 version of RCF. The RCF without 3x3 conv layers achieves only 0.1%-0.2% lower ODS F-measure than RCF with 3x3 conv layers. I'll release the new models.

trungpv88 commented 4 years ago

Thanks for this information. I guess the reason why I got the more blurry contours is the training dataset. In fact, I used the SBD dataset (less accurate than BSDS500 and used for semantic boundaries) to train RCF-VGG16 and RCF-ResNet101 (with your prototxt files). When comparing the results, I find that RCF-VGG16 gives the better contours than RCF-ResNet101 (which gives more blurry contour) and the quality of contours obtained by my trained model RCF-VGG16 is as good as your trained models (RCF-VGG16 and RCF-ResNet101).

yun-liu commented 4 years ago

Yeah, it sounds reasonable.