geekyutao / RN

Region Normalization for Image Inpainting, accepted by AAAI-2020
MIT License
187 stars 37 forks source link

Batch Region Norm or Instance Region Norm? #12

Closed usherbob closed 4 years ago

usherbob commented 4 years ago

Hi yutao,

Thanks for sharing your inspiring work. I have a question about the specific implementation of Region Norm. As you've mentioned in your paper, Region Norm should be a generation to Instance Norm. However, from your implementation, rn is still based on the distribution of mask/unmask regions in the whole batch. Is there some errors in your implementation, or you've found that performance based on instance regions worse than batch regions.

2020-08-05 14-22-15 的屏幕截图

geekyutao commented 4 years ago

Hi yutao,

Thanks for sharing your inspiring work. I have a question about the specific implementation of Region Norm. As you've mentioned in your paper, Region Norm should be a generation to Instance Norm. However, from your implementation, rn is still based on the distribution of mask/unmask regions in the whole batch. Is there some errors in your implementation, or you've found that performance based on instance regions worse than batch regions.

2020-08-05 14-22-15 的屏幕截图

Hi, thanks for your comments. It's exactly what we are going to make a statement in the future application of RN. First, sorry that we didn't discuss this in the AAAI2020 paper. RN wants to bring an insight that spatially region-wise normalization is better for some CV tasks such as inpainting. Theoretically, RN can be both BN-style or IN-style. Both have pros and cons. IN-style RN gives less blurring results and achieves style consistence to background in some extent, while suffers from spatial inconsistence if the model representation ability is limited. BN-style RN gives higher PSNR on an aligned validation data, but makes regions more blurring and causes much data-bias risk when testing data distribution has a certain shift to training data distribution. One chooses the RN style according to the specific scene. Thanks.

usherbob commented 4 years ago

Thanks for your quick reply. I tried your implementation on my project and found that the generated region is not well blended in background regions. I am actually attempting the IN-style RN now. One more question, have you ever tried to implement the normalization without gamma and beta. As I thought the difference in colors between generated foreground area and background area might come from the gap between gamma_foreground and gamma_background.

geekyutao notifications@github.com 于2020年8月5日周三 下午4:33写道:

Hi yutao,

Thanks for sharing your inspiring work. I have a question about the specific implementation of Region Norm https://github.com/geekyutao/RN/blob/master/rn.py#L8. As you've mentioned in your paper, Region Norm should be a generation to Instance Norm. However, from your implementation, rn is still based on the distribution of mask/unmask regions in the whole batch. Is there some errors in your implementation, or you've found that performance based on instance regions worse than batch regions.

[image: 2020-08-05 14-22-15 的屏幕截图] https://user-images.githubusercontent.com/22768647/89378759-1be65e00-d727-11ea-963b-6871c444296b.png

Hi, thanks for your comments. It's exactly what we are going to make a statement in the future application of RN. First, sorry that we didn't discuss this in the AAAI2020 paper. RN wants to bring an insight that spatially region-wise normalization is better for some CV tasks such as inpainting. Theoretically, RN can be both BN-style or IN-style. Both have pros and cons. IN-style RN gives less blurring results and achieves style consistence to background in some extent, while suffers from spatial inconsistence if the model representation ability is limited. BN-style RN gives higher PSNR on an aligned validation data, but makes regions more blurring and causes much data-bias risk when testing data distribution has a certain shift to training data distribution. One chooses the RN style according to the specific scene. Thanks.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/geekyutao/RN/issues/12#issuecomment-669060942, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFNWYB36QFEBWKMRXBVAFRTR7EKO7ANCNFSM4PVEGM5A .

-- Best Regards, Jiahua Wang 王加华

geekyutao commented 4 years ago

the generated region is not well blended in background regions.

  1. " the generated region is not well blended in background regions": I think there are many possible reasons such as data distribution shift. You can also re-train RN on ImageNet. Maybe the results be better.
  2. I didn't try removing the gamma. But pls share the results on it to me if you gonna do it.

Feel free to ask me if you still have questions.

Best

usherbob commented 4 years ago

Look forward to future discussing.

Best