跳到正文
DEV Community· Todd Sullivan·· 3 小時前AI 評分54

新款 YOLO 模型 mAP 較高,羊羣計數卻更差

The Newer YOLO Model Had Better mAP. It Counted Sheep Worse.

AI 導讀

作者以 iOS 應用實際採用的影像流程比較 YOLOv8n、YOLO11n 和 YOLO26n,發現 YOLO26n 整體相對誤差較低,但羊羣計數誤差更高。在 300 張 COCO 驗證影像中,YOLO26n 的整體相對誤差為 41.2%,羊羣計數相對誤差為 60.3%,高於現用 YOLOv8n 的 46.2%;作者因此決定不更換模型。

正文

Todd Sullivan

I nearly shipped a newer YOLO model because the headline benchmark said it was better.

The iOS app already bundled yolov8n. I exported yolo11n, yolo26n, yolo11s and yolo26s to CoreML. All five had the same usable interface: 640×640 input, 80 COCO classes, NMS built into the model, and matching output shapes. From the app's point of view, the upgrade was a file swap and one model-name change.

That made the tempting test simple: compare COCO mAP and pick the newest model.

I tested the behaviour the app actually depends on instead.

The benchmark ported the production photo pipeline to Python:

  • full-frame inference
  • a 3×3 grid of overlapping tiles
  • edge-fragment rejection
  • class-agnostic duplicate merging
  • the app's 0.25 confidence threshold

I ran 300 COCO validation images through each nano model and scored count error rather than detection mAP.

Model Overall relative error Sheep Cattle Birds
YOLOv8n, current 43.8% 46.2% 28.0% 56.7%
YOLO11n 44.1% 70.7% 29.1% 47.5%
YOLO26n 41.2% 60.3% 23.2% 46.8%

The newer models improved some categories. YOLO26n was better on cattle and birds. But both regressed sheep, the main use case.

Across the evaluated sheep images there were 230 animals. The current model predicted 262. YOLO26n predicted 278. YOLO11n predicted 301. The newer models were not just missing differently; the tiled pipeline amplified their over-counting.

The first benchmark run also took 37 minutes because I ran it beside a simulator build and starved the machine. Serialising the work restored normal inference speed. The clean baseline remained 71 tests with zero failures.

So the release decision was deliberately boring: no model swap.

A model upgrade is not an architecture name or a better aggregate metric. It is an improvement after preprocessing, tiling, thresholds, merging and the product's actual error function have all had their say.

Measure the deployed pipeline, not the model card.

來源:DEV Community · dev.to