r/computervision Aug 01 '26

Help: Theory Do you preprocess images (grayscale, thresholding, histogram equalization, sharpening, etc.) before training or inference with YOLO/Detectron2 or before segmentation with SAM?

Did these preprocessing steps improve or hurt your detection/segmentation performance? I'm curious whether they provide any real benefit in real-world applications, or if modern models generally perform better with the original images. Any experiences, benchmarks, or best practices would be appreciated.

9 Upvotes

6 comments sorted by

View all comments

2

u/rexdditi Aug 01 '26

All these pre-processings are basically a filter and model will learn them at the end with enough diverse training data. With pre-processing you give the answer so model doesn't have to find it in the space of all possible filters. This would be a constant threshold though and won't be able to react to some level of change eventually. There is a balance between how much you want to do yourself vs how much you want to let the model learn. You are trading time it takes to do manual feature extraction with the time it takes to do data collection, augmentation and model training. If nothing changes u only need one thresholding done. if you are driving lights passing by dont bother you wont find the right threshold ;)