Skip to content
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

How to use data augmentation during training process (especially PatchCore)? #155

Closed
james77777778 opened this issue Mar 22, 2022 · 3 comments · Fixed by #156
Closed

How to use data augmentation during training process (especially PatchCore)? #155

james77777778 opened this issue Mar 22, 2022 · 3 comments · Fixed by #156

Comments

@james77777778
Copy link

james77777778 commented Mar 22, 2022

Is your feature request related to a problem? Please describe.
I successfully trained PatchCore with custom dataset, but I find that the threshold is too sensitive and the model is hard to generalize. Maybe some extra data augmentation (like color jittering, rotation, etc.) will help the generalization?

#119 (comment)

Describe the solution you'd like
I know anomalib uses albumentations for preprocessing, but I cannot found an easy way (without hard-coding) to configure it.

Describe alternatives you've considered

Additional context

Thanks for the great work. If there are some plans to make this possible, I can try to contribute.

@samet-akcay
Copy link
Contributor

Hi @james77777778, you could use albumentations to serialize an augmentation pipeline into a yaml file. I've created a PR #156 that reads this augmentation yaml file and applies these custom augmentations to the input images. Following this, you don't need to hardcode anything.

@james77777778
Copy link
Author

james77777778 commented Mar 23, 2022

Thanks for the quick response!

But I have a question. Since PatchCore extracts features only once, how the augmentation pipeline works in this scenario?
It makes random augmentation for each image only once (if epoch=1)? It is recommended to set more epochs?

@samet-akcay
Copy link
Contributor

There is already an ongoing discussion here in #119 you could refer to. Maybe we could continue from there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants