openvinotoolkit / anomalib

An anomaly detection library comprising state-of-the-art algorithms and features such as experiment management, hyper-parameter optimization, and edge inference.
https://anomalib.readthedocs.io/en/latest/
Apache License 2.0
3.66k stars 652 forks source link

❓ Data augmentation in Padim training #1550

Closed baldellimtt closed 8 months ago

baldellimtt commented 9 months ago

What is the motivation for this task?

I would like to know if image augmentation could improve my padim training algorithm.

Describe the solution you'd like

I'm training a padim anomaly detector with this wonderful repository. I'm wondering if data augmentation will improve or decrease my detector performances; for example I have objects that theorically should be placed exactly in the same place, but in reality probably not. I have to slightly rotate and translate my objects to make the algorithm more robust? The same apply with exposure and contrast. Thank you,

Additional context

No response

LenaMetzen commented 9 months ago

Hey, there is an artical covering that topic called What Makes a Good Data Augmentation for Few-Shot Unsupervised Image Anomaly Detection?

abc-125 commented 9 months ago

It depends on the images and the algorithm; trying to see how it works in your case can be the best solution.

As the article mentioned in the previous comment says, some augmentations can be beneficial if you have a low number of images for training:

What Makes a Good Data Augmentation for Few-Shot Unsupervised Image Anomaly Detection?

margalordyzd commented 8 months ago

Hi, I'm also testing the effect of augmentations in an anomaly detection system. Is there any code/documentation on how to apply augmentations into different models. I see there is some related code under pre_process.PreProcessor to "Applies pre-processing and data augmentations to the input and returns the transformed output." but its not fully clear to me how to choose the augmentation parameters, etc. Thanks a lot!

samet-akcay commented 8 months ago

Hi @margalordyzd, we currently do not have such documentation. The main reason being that we would like to switch to torchvision transforms and remove albumentations. Until we finish the migration, you could perhaps refer to #542?