We are deploying a parking lot occupancy sensor using outdoor cameras. The model works great at noon but fails during sunrise, sunset, and rainy weather. Should I be focusing on better hardware, or are there specific pre-processing techniques like Histogram Equalization that can help?
3 answers
Lighting invariance is a classic challenge. Before jumping to hardware, try "CLAHE" (Contrast Limited Adaptive Histogram Equalization). It’s much better than standard equalization because it doesn't over-amplify noise in dark areas. However, the most robust "modern" fix is actually in your training pipeline. You should use heavy "Color Jitter" and "Random Brightness" augmentations. This forces the neural network to learn the "shape" of the cars rather than the specific pixel intensity. If that still fails, switching to cameras with high Dynamic Range (HDR) sensors will give you more detail in the shadows and highlights that no amount of software can recover once it's "clipped."
What about IR (Infrared) cameras for nighttime? Do I need to train a completely separate model for the night footage, or can one model handle both day and night?
Don't overlook the physical setup. Sometimes a simple polarizing filter on the lens or a small hood to block direct sun glare can solve 50% of your false-positive problems.
Karen makes a great point. A $20 physical lens hood is often more effective and cheaper than spending 40 hours trying to code a custom glare-reduction algorithm.
You usually need a "Multi-Modal" approach, Scott. IR images look very different (grayscale, high contrast) compared to RGB. If you try to use one model, it might become a "jack of all trades, master of none." We use "Domain Adaptation" techniques where we train on both datasets simultaneously. Alternatively, you can use a CycleGAN to "translate" your night images into a day-like format before passing them to your main detector. This allowed our parking model to maintain 90% accuracy even in total darkness without having to manually label a whole new set of nighttime images.