keras-team / keras-cv

Industry-strength Computer Vision workflows with Keras
Other
1.01k stars 330 forks source link

CutOut should support fill_mode="mirror" #336

Open LukeWood opened 2 years ago

LukeWood commented 2 years ago

This is actually a great "research" project in that this should strictly be better than using noise and black pixels.

innat commented 2 years ago

Can you add some references, sounds interesting.

LukeWood commented 2 years ago

There are references out there for mirroring in random translation and rotation, but not random erasing or cut out. The logic should in theory extend to cutout, but I do not have definitive proof. That's why this is also somewhat of a research effort. Happy to collaborate with anyone on benchmarks if they are interested...

bhack commented 2 years ago

Are you talking about (https://arxiv.org/pdf/1708.04552v2.pdf):

immagine

or something else?

Edit: Ok sorry it was in the title but not in the description. It is the "fill_mode"

bhack commented 2 years ago

We have some experimental results with patch gaussian as an alternative "fill_mode" for cutout:

https://arxiv.org/abs/1906.02611

innat commented 2 years ago

The fill_mode="mirror" sounds like a fill_mode="reflect".

bhack commented 2 years ago

The patch gaussian has a good citations threshod (>100).

There is a TF implementation at page 15.

I don't know if It Is better to spent time on something that has already some experimental results.

bhack commented 2 years ago

https://github.com/tensorflow/models/blob/master/research/object_detection/core/preprocessor.py#L2793

innat commented 2 years ago

@bhack Thanks for sharing this information, very useful. It's definitely an effective option.

Cutout, which improves clean accuracy but not robustness, and additive Gaussian noise, which improves robustness but hurts accuracy. To overcome this trade-off, we introduce Patch Gaussian, a simple augmentation scheme that adds noise to randomly selected patches in an input image.

github-actions[bot] commented 8 months ago

This issue is stale because it has been open for 180 days with no activity. It will be closed if no further activity occurs. Thank you.