-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add DropBlock regularization layer. #137
Comments
Hey @sebastian-sz - what would this API look like for users? some of the implementation details for this preprocessing technique are a bit nuanced to me. Does it rely on passing bounding boxes or segmentation maps to perform augmentation? Does it rely on activations of specific layers of your CNN? Please provide these details and comment back. Thanks! |
I thought it could be used similary to x = tf.keras.layers.Conv2D(...)(x)
x = tf.keras.layers.BatchNormalization()(x)
x = tf.keras.layers.ReLU()(x)
x = DropBlock(keep_probability=0.9, block_size=7)(x) The user's would have to worry only about passing
No, as far as I know it can be treated as a "bonus" block, as it only performs regularization. For example, the paper mentions adding it to backbone of RetinaNet, to boost final mAP.
The paper suggest's to use DropBlock for groups 3 and 4 in ResNet. The implementation uses DropBlock after ReLU in Conv->BatchNorm->ReLU block. Limitations:Sadly, this can get complicated:
This complicates proposed solution a lot, but I'm not sure how crucial these are for this layer to provide better results. Let me know what do you think. |
It could be nice If we could support Google Autodropout that generally performed better then the "fixed" Dropblock: https://arxiv.org/abs/2101.01761 google-research/google-research#727 Also I don't think, as you can see in the above paper, that this is strictly preprocessing/CV specific:
What we will do if we want to reuse this in keras-nlp? |
See also my previous comment at #30 (comment) |
Seems like this is a useful layer to me. As for what to do with reuse for KerasNLP so far: Transparently, we don't know yet. |
Yes, let’s wait for the preprocessing layer refactor on this one. It should be available soon |
I will need to read about the differences in detail before answering that one. I’m not familiar enough with the techniques yet |
As I've mentioned the Github link of the reference implementaton in the Google paper is broken. Both are landing in Pytorch vision: |
Interesting, I didn't know about torchvision PR. Their proposed API looks similar to what I described above. I think it would be beneficial to also have Dropblock implemented here. |
Thanks for providing so many references. This looks like a great contribution. I've added the contributions welcome label. |
@sebastian-sz have you looked at the increasing DropBlock schedule that the paper recommends? |
Just a reminder in the case we want to extend to the 3d case: |
@LukeWood @bhack |
As you like. |
@bhack I'd prefer 3D variant to be added in a separate PR (perhaps separate issue). There is still some work with 2D variant. |
DropBlock is a regularization technique that is more suitable for CNN's than regular dropout. Perhaps it would be beneficial to have it available in keras-cv?
Paper
Example TF Implementation
The text was updated successfully, but these errors were encountered: