I am currently working on a security project using YOLOv8 for real-time monitoring. The model performs well during the day, but at night, the precision for small objects like bags or handheld items drops significantly. I’ve tried basic data augmentation, but the false negatives are still too high. Has anyone successfully tuned hyperparameters or used specific pre-processing to fix this?
3 answers
To address the precision drop at night, you should implement Histogram Equalization or CLAHE (Contrast Limited Adaptive Histogram Equalization) during your pre-processing stage to enhance visibility without adding noise. Additionally, ensure your training dataset includes a heavy mix of synthetic "night-time" images created through brightness reduction and Gaussian noise injection. In your YOLOv8 config, try increasing the 'imgsz' (input image size) to 1280 to help the model perceive smaller pixel clusters. Using a larger model version like YOLOv8x can also capture more complex features.
Are you using a custom dataset for the night-time training, or are you relying solely on the pre-trained COCO weights? If you haven't labeled specific low-light frames from your own cameras, the domain gap might be too large for the model to generalize effectively.
You might want to experiment with Mosaic augmentation. It’s built into YOLOv8 and helps the model recognize objects at various scales, which is vital for detecting small items in cluttered scenes.
I agree with David. Mosaic augmentation is a game-changer. I also found that adding a "no-object" class for empty dark frames helps reduce the false positive rate in surveillance.
Michael makes a great point. I switched to a custom dataset of 2,000 infra-red frames and the mAP increased by 15%. I also recommend adjusting the 'iou' threshold in your validation settings. Sometimes the default 0.7 is too strict for grainy footage; dropping it to 0.5 helped me reduce those frustrating false negatives significantly in my project.