YOLO11x 推理时偶发背景高置信度误检,bbox 远大于真实目标且多发于右下角

大家好,

我使用YOLO11x时遇到一个问题:使用模型推理时发现部分标签偶尔会将背景召回,且置信度大于0.99。

1、我已经检查训练集,并没有误标

2、之前是不存在这个问题的,是最近大概8月开始发现

3、并不是全部标签都这样,只有部分标签;并不是总是出现此类误检,是偶尔

4、误检位置大多数发生在图片右下角。有时误检是矩形,且bbox的大小是对应标签真实大小的好几倍;有时是一条线,即y值相等。

请不吝赐教,不胜感激。

Can you provide the output after running this command in terminal: `yolo checks`?

What’s your dataset size?

What’s your inference code or command? Are you using Ultralytics for inference or your own custom code?

1、Here is the output of yolo checks from my environment:

(wzz_test_env) ubuntu@ubun:~/Awzz/code/infer/review/inference_service$ yolo checks
Ultralytics 8.4.50 :rocket: Python-3.10.12 torch-2.8.0+cu128 CUDA:0 (NVIDIA GeForce RTX 4090, 48508MiB)
Setup complete :white_check_mark: (32 CPUs, 125.6 GB RAM, 862.4/983.2 GB disk)

OS Linux-6.8.0-87-generic-x86_64-with-glibc2.35
Environment Linux
Python 3.10.12
Install pip
Path /home/ubuntu/.local/lib/python3.10/site-packages/ultralytics
RAM 125.56 GB
Disk 862.4/983.2 GB
CPU Intel Core i9-14900K
CPU count 32
GPU NVIDIA GeForce RTX 4090, 48508MiB
GPU count 1
CUDA 12.8

numpy :white_check_mark: 2.2.6>=1.23.0
matplotlib :white_check_mark: 3.10.6>=3.3.0
opencv-python :white_check_mark: 4.12.0.88>=4.6.0
pillow :white_check_mark: 11.3.0>=7.1.2
pyyaml :white_check_mark: 6.0.2>=5.3.1
requests :white_check_mark: 2.32.5>=2.23.0
scipy :white_check_mark: 1.15.3>=1.4.1
torch :white_check_mark: 2.8.0>=1.8.0
torch :white_check_mark: 2.8.0!=2.4.0,>=1.8.0; sys_platform == “win32”
torchvision :white_check_mark: 0.23.0>=0.9.0
psutil :white_check_mark: 7.1.0>=5.8.0
polars :white_check_mark: 1.33.1>=0.20.0
ultralytics-thop :white_check_mark: 2.0.19>=2.0.18

2、My training dataset details:

  • Total training images: approximately 36,000, of which approximately 24,000 are augmented data
  • Number of classes: 14
  • Negative samples: approximately 500

3、I use Ultralytics official Python API as the core inference engine, and wrap it with custom batch processing logic for video frame inference. The core predict call is as follows:

with torch.no_grad():
    chunk_results = self.model.predict(
        source=frame_chunk,
        conf=self.conf_threshold,
        iou=self.iou_threshold,
        half=self.use_half_precision,
        verbose=False,
        workers=0,
        save=False,
        show=False,
        stream=False,
    )

The custom code only handles batch splitting and CUDA OOM auto-degradation. All inference computation, NMS and post-processing are implemented by Ultralytics internally.

Augmenting the same few images multiple times will cause the model to overfit. Also Ultralytics supports augmentations during training. You should avoid augmenting your original dataset or disable all Ultralytics augmentations.

Also you should update to latest Ultralytics and you can try adding this before your code:

import torchvision

Thank you very much for your proposal. I will proceed with testing.

感谢反馈!如果测试后仍出现误检,请保存一帧未绘制预测框的原始图像,用同一权重对比单帧推理和当前批量推理,并试一下 half=False。届时分享这几种情况下的预测结果和更新后的 ultralytics 版本,就能进一步缩小排查范围。