buptlr / OFNet

Code and model for OFNet paper
MIT License
18 stars 9 forks source link

Orientation estimation loss #2

Closed tim885 closed 4 years ago

tim885 commented 4 years ago

Hi, Thanks for your results about occlusion edge, it' s very helpful! In fact, I'd like to re-implement your work by pytorch as I'm not familar with Caffe. According to the architecture and your paper, I have reproduced your results about occlusion edge but not occlusion orientation. If I'm right, the smoothL1 loss you used is conditioned by threshold 1 instead of 1 / sigma**2, which result in a discontinuity for loss function. Could you kindly tell me the details about regression loss and whether there are other things to pay attention to? Thanks a lot!

yuzhegao commented 4 years ago

Hi! @tim885 I think you can refer to the code https://github.com/buptlr/OFNet/blob/master/src/caffe/layers/orientation_smooth_L1_loss_layer.cu to figure out the implement detail. According to the source code, the smoothL1 loss is conditioned by threshold 1 / sigma**2. image

Besides, from the evaluate matlab code, you can see that 'Orientation result is depend on the Edge result', so I think if you get high result of edge, you can get high orient result as well. (such as, edge ODS=0.75 ,so the orient ODS=0.73, a little lower than edge) By the way, I also want to re-implement the pytorch-version of OF-Net. However, I couldn't get the performance as good as this caffe-version (e.g. my edge ODS=0.67, much lower than edge-ODS=0.751 of origin version). So could you please share some experience about how to reproduced the edge results in paper (edge ODS=0.751)? Wish to have more communication :)

tim885 commented 4 years ago

Thanks for your explanation, when reading DOOBNet paper, I was also confused about the L1 loss discontinuity, now I get a reasonable answer. Concerning about re-implementation using PyTorch, I reproduced results in BSDS instead of PIOD(I didn' train on it) with version 0.4 following all details of your code. So perhaps your should firstly check all the training phases(data preparation, net arch, ...), I think edge detection is very sensitive to small modifications.

yuzhegao commented 4 years ago

Thanks for your sharing. I'm not author of OF-Net and now do some research based on caffe-version OF-Net, but I still want to re-implement a pytorch-version because pytorch is much more flexible. Could you please release your pytorch code? I 'm very confused because I have tried to check out all detail but still couldn't find any difference. Thanks:)

tim885 commented 4 years ago

Currently I can't because it's still a project in progress, I'll release it once project finished. Perhaps you can ask the author for more details.

yuzhegao commented 4 years ago

Thanks! It's very kind of you!

buptlr commented 4 years ago

Hi @tim885 , Like @yuzhegao has discussed, the ori loss is actually conditioned by threshold 1 / sigma**2, which I have followed DOOBNet's work https://github.com/GuoxiaWang/DOOBNet. Wish to have more communications with you about architecture of occlusion detection network. Good luck.

tim885 commented 4 years ago

Thanks a lot!