keras-cv icon indicating copy to clipboard operation
keras-cv copied to clipboard

CutOut should support fill_mode="mirror"

Open LukeWood opened this issue 3 years ago • 9 comments

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

LukeWood avatar Apr 20 '22 17:04 LukeWood

Can you add some references, sounds interesting.

innat avatar Apr 20 '22 17:04 innat

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...

LukeWood avatar Apr 20 '22 20:04 LukeWood

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 avatar Apr 20 '22 20:04 bhack

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

https://arxiv.org/abs/1906.02611

bhack avatar Apr 20 '22 21:04 bhack

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

innat avatar Apr 24 '22 08:04 innat

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 avatar Apr 24 '22 10:04 bhack

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

bhack avatar Apr 24 '22 17:04 bhack

@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.

innat avatar Apr 24 '22 19:04 innat

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.

github-actions[bot] avatar Feb 01 '24 01:02 github-actions[bot]

Thanks for reporting the issue! We have consolidated the development of KerasCV into the new KerasHub package, which supports image, text, and multi-modal models. Please read https://github.com/keras-team/keras-hub/issues/1831. KerasHub will support all the core functionality of KerasCV.

KerasHub can be installed with !pip install -U keras-hub. Documentation and guides are available at keras.io/keras_hub.

With our focus shifted to KerasHub, we are not planning any further development or releases in KerasCV. If you encounter a KerasCV feature that is missing from KerasHub, or would like to propose an addition to the library, please file an issue with KerasHub.

sachinprasadhs avatar Jan 15 '25 22:01 sachinprasadhs

@sachinprasadhs

If you encounter a KerasCV feature that is missing from KerasHub, or would like to propose an addition to the library, please file an issue with KerasHub.

Firstly, identifying which feature is required or missing can be done effectively, either by practitioners or the Keras team. Tickets in keras-cv were created only when such features were NOT available or when a specific need was encountered. Commenting after a significant delay and requesting the recreation of the same issue is neither efficient nor appropriate. Kindly move this ticket (and any other similar tickets with the same context) from keras-cv to keras-hub.

innat avatar Jan 16 '25 16:01 innat

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

github-actions[bot] avatar Apr 22 '25 02:04 github-actions[bot]

This issue was closed because it has been inactive for 28 days. Please reopen if you'd like to work on this further.

github-actions[bot] avatar May 06 '25 02:05 github-actions[bot]