Anomaly detection on high resolution images #770
Replies: 2 comments 4 replies
-
You could experiment with Anomalib's tiling mechanism, which was designed for this purpose. Tiling subdivides the images into a grid of tiles, which are each processed by the model separately. This would allow you to retain more of the original image resolution without running into memory constraints. During testing and inference, the model predictions for each of the tile locations are stitched back together to form a single anomaly map for the pixel-level predictions. Tiling is configured from the For example, you could use the following configuration to tile your images into a 6x4 grid of tiles with a width and height of 500 pixels and no overlap between the tile locations:
Instead of resizing the full image to the dimensions specified in Please note that tiling is in experimental state and we do not have any benchmarking results to show. In our experience, tiling works best with models like STFPM and DRAEM, which involve fine-tuning of neural network weights. This is because a single model is trained on all tile locations combined. This makes tiling less suited for patch-based models like Padim and PatchCore, which assume that the contents of each spatial location within the image is fairly consistent across the dataset. If you do want to use tiling with patch-based models, you could try to train an ensemble of models, where each model is trained on a distinct tile location. At the moment, Anomalib does not support this type of tiling, so you would have to implement your own wrapper utilities that perform the tiling and untiling separately. |
Beta Was this translation helpful? Give feedback.
-
My project is also PCB and PCBA But my picture size Annotation file Camera loading, picture clipping, inference and prediction |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I want to train an anomaly detection model on high resolution images. The problem is that the images in this repo have a relatively low resolution (224x244 or 256x256). If I now have an input of 3000x2000px (for example of a PCB) and want to detect anomalies in it, the anomaly may simply disappear by scaling the image down.
Does anyone have an idea/suggestion how I can best implement this?
Beta Was this translation helpful? Give feedback.
All reactions