How to reduce FP detections?

Hello. I train yolo to detect people. I get good metrics on the val subset, but on the production I came across FP detections of pillars, lanterns, elongated structures like people. How can such FP detections be fixed?

Hi Denis — classic domain gap. A few quick wins to cut those pole/lantern FPs:

Calibrate inference on production and raise the confidence just for person. For example:

yolo predict model=yolo11m.pt source=your_video.mp4 classes=0 conf=0.65

Hard‑negative mine: run your model on production, collect FP frames of pillars/lanterns, add them to training as negatives (no labels), or label a new pole class and ignore it at inference. Retrain a few epochs; this is usually the biggest improvement.

If video, add simple gating: require motion/tracking persistence; stationary vertical structures will drop. You can also add a tiny post‑filter by geometry or ROI. Example:

from ultralytics import YOLO
m = YOLO('yolo11m.pt')
for r in m.predict('your_video.mp4', conf=0.65, classes=[0]):
    xywh = r.boxes.xywh.cpu().numpy()
    keep = [(h/w) < 3.0 and h > 40 for (_,_,w,h) in xywh]  # drop ultra-thin, tiny boxes
    r.boxes = r.boxes[keep]

If needed, try a larger YOLO11 size or a cascade with YOLO11‑pose to confirm people via keypoints. Also create a small “production val” split and pick the conf that gives the FP rate you need. For quick tips on filtering predictions, see the short notes in the Ultralytics guide to common YOLO issues.