Skip to content

Example data mode. The sample companies, offers and requests shown here are fictional (AI pictures) and are not counted in the figures below.

Lesson 5 of 8

Reading detection metrics: precision, recall, F1 and mAP

Papers on defect detection report a zoo of numbers. This lesson explains the metrics only as the portal's papers use them, then trains you to read a result table critically. Two sources supply the examples: a YOLOv8m study on beech boards (Wu et al., Forests, 2026, China) and a birch veneer-log study (Magaznieks et al., Forests, 2026, Latvia).

Precision and recall in plain terms

  • Recall: of the defects that the reference (a human scaler) marked, what share did the algorithm find? In the veneer-log paper the algorithm found 44% of the dead and rotten knots the scaler marked, so 56% were missed.
  • Precision: of the defects the algorithm indicated, what share were confirmed by the reference? For core rot the algorithm gave 21 indications, 7 were confirmed: 7 / 21 = 33%.
  • F1: one number combining the two. It is the harmonic combination F1 = 2PR / (P + R). Core discolouration (recall 97%, precision 91%) gives F1 = 0.94.

A system can have high recall and poor precision (many false alarms) or the reverse. Which matters depends on the cost: a missed knot downgrades quality later; a false alarm discards good wood.

mAP and the detection setting

In object detection each defect is a box. The Wu paper reports mAP@50 (mean average precision where a detection counts if it overlaps the true box enough at an IoU threshold of 0.5) and mAP@50-95 (averaged over thresholds from 0.5 to 0.95, a stricter test of localisation). A model can improve the strict measure while the lenient one barely moves.

Worked example: the YOLOv8m ablation

Model P (%) R (%) mAP@50 (%) mAP@50-95 (%) Params (M)
YOLOv8m baseline 93.7 84.8 90.8 67.8 25.86
Full modified model 93.3 85.9 91.8 69.3 34.08

Differences:

  • mAP@50: 91.8 - 90.8 = 1.0 percentage point
  • mAP@50-95: 69.3 - 67.8 = 1.5 points
  • Recall: 85.9 - 84.8 = 1.1 points
  • Precision: 93.3 - 93.7 = -0.4 points (slightly lower)
  • Parameters: 34.08 - 25.86 = 8.22 million more

The data: 5,380 training, 680 validation and only 100 test images of planed, kiln-dried European beech boards under controlled lighting. With 100 test images, a gain of one or two points may lie within normal run-to-run variation, and no repeated runs or confidence intervals were seen. Small knots had the lowest per-class AP@50-95 of the four reported classes (57.0%).

Metrics are not comparable across papers

The portal's reviewed table of detection studies reports F-score, mAP at a threshold, pixel accuracy and species accuracy, results from roughly 82% to 98%. They measure different things on different datasets:

  • Fang et al. (China, 2021): F-score 91.7% and 97.7% on two datasets; in the dataset behind 97.7%, all knot types were grouped as a single category, an easier problem.
  • FDD-YOLO (China, 2025): mAP 82.3% (baseline YOLOv8 78%) on 3,600 images with seven defect types, partly from a sawmill.
  • Skogforsk (Sweden, 2026): mAP@0.5 about 0.75 from 49 training images.

Checklist for reading a detection result

  • Which metric exactly (P, R, F1, mAP@50, mAP@50-95, accuracy)?
  • What is the reference: one scaler, several, a dataset label?
  • How many test images, and are they from the same source as the training set?
  • How many defect classes, and are similar defects merged?
  • Are the images from a line (dust, vibration, rough surfaces) or a laboratory?
  • Is speed measured on target hardware, or only FLOPs? The Wu authors caution that FLOPs for custom operators can be unreliable.

Key points

  • Recall = share of reference-marked defects found; precision = share of the algorithm's indications that were confirmed; F1 combines them.
  • mAP@50-95 is stricter than mAP@50.
  • In the beech study the modified YOLOv8m gained 1.0 point (mAP@50) and 1.5 points (mAP@50-95) but needed 8.22 M more parameters; precision fell 0.4 points.
  • Results across papers use different metrics, datasets and class definitions and cannot be ranked directly.
  • Ask for validation on your own species, surface and line conditions.
Previous Next lesson

Sign in to save your progress and take the quiz. Sign in