Vai al contenuto

Modalità dati di esempio. Le aziende, offerte e richieste di esempio mostrate sono fittizie (immagini IA) e non sono incluse nelle cifre sotto.

AI and automation

A tuned YOLOv8m for lumber defects: modest gains on beech boards, open questions for the mill

A modified YOLOv8m reaches 91.8% mAP@50 and 69.3% mAP@50-95 on a public beech lumber dataset, about 1.0 and 1.5 points above baseline; not yet validated on a production line.

This article was drafted with AI assistance and has not yet been reviewed by an expert. Check important figures against a standard or your contract before relying on them.

Introduction

Visual grading of sawn lumber is a repetitive, tiring task in which defects such as knots, splits and wavy grain have to be found quickly and consistently. Automated vision systems promise to do this faster, but small or elongated defects with irregular outlines remain difficult for general-purpose object detectors. A knot may be only a few dozen pixels wide, a split is long and thin, and a bounding box drawn around either contains plenty of background.

A research team led by Longhai Wu and Kun Zhang took a widely used detector, YOLOv8m, and modified it with several components aimed at exactly these difficulties. Their paper, published in Forests in July 2026, reports on a public lumber image set and shows modest but consistent improvements over the unmodified baseline. This article explains what they did and what the results do, and do not, tell a sawmill.

Research methodology

Data

The study used a public dataset by Golden Y, archived on Zenodo. According to the paper it consists of images of planed, kiln-dried European beech (Fagus sylvatica) boards between 26 and 50 mm thick. They were captured with a DALSA line-scan camera (model LA-GC-02K05B) with a 50 mm lens under controlled diffuse LED lighting. The split was 5,380 images for training, 680 for validation and 100 for testing. Six defect classes were annotated: dry knot, edge knot, small knot, sound knot, wavy defect and split. Images were resized to 640 x 640 pixels, and augmentation (flipping, scaling, colour changes and Mosaic) was applied to the training subset only.

The modified network

The baseline was YOLOv8m. The authors changed several parts of it:

  • Backbone: an efficient channel attention block (ECA) in the C2f module of the shallow stage; SPD-Conv (a space-to-depth operation that downsamples without discarding fine detail) at the P3 and P4 stages; and deformable convolution (DCN) in the C2f modules of the deep stage. Deformable convolution lets the sampling grid shift to follow irregular shapes.
  • Neck: C2f modules combining deformable convolution with an efficient multi-scale attention block (EMA), and DySample, a dynamic upsampling operator, in place of the standard upsampling.
  • Head: the usual three-scale detection head of YOLOv8m.
  • Loss: SIoU replaced CIoU as the bounding box regression loss.

Training and evaluation

Training ran for 200 epochs with batch size 16 on 640 x 640 input, using SGD with an initial learning rate of 0.01, momentum 0.937, weight decay 0.0005 and a cosine annealing schedule. The hardware was an NVIDIA RTX 5080 (16 GB) with an Intel Core i9-14900K and 32 GB of RAM. The authors report precision (P), recall (R), mean average precision at an IoU threshold of 0.5 (mAP@50) and averaged over thresholds from 0.5 to 0.95 (mAP@50-95), plus parameters and FLOPs. They ran an ablation study that adds the modifications step by step and compared the final model with other YOLO versions.

Key findings

Overall result

The full model achieved 91.8 percent mAP@50 and 69.3 percent mAP@50-95, against 90.8 and 67.8 percent for the YOLOv8m baseline: gains of 1.0 and 1.5 percentage points. Recall rose from 84.8 to 85.9 percent, while precision dipped slightly from 93.7 to 93.3 percent. These are incremental improvements and should be understood as such.

Ablation: what each step contributed

Model variant P (%) R (%) mAP@50 (%) mAP@50-95 (%) Params (M) FLOPs (G)
YOLOv8m baseline 93.7 84.8 90.8 67.8 25.86 78.9
+ DCN 92.3 85.2 90.2 68.2 34.47 76.6
+ DCN + ECA/EMA 93.7 85.0 91.4 68.1 34.50 77.7
+ DySample + SPD-Conv 93.3 85.8 91.9 68.8 34.08 75.4
Full model (+ SIoU) 93.3 85.9 91.8 69.3 34.08 75.4

Deformable convolution alone raised mAP@50-95 slightly but lowered precision and mAP@50. The attention blocks recovered mAP@50 to 91.4 percent. The upsampling and downsampling changes added further gains, and the SIoU loss improved the stricter mAP@50-95 measure while leaving mAP@50 almost unchanged. In the authors' per-class results for the final model, AP@50-95 was 57.0 percent for small knots, 67.8 percent for edge knots, 77.9 percent for wavy defects and 63.3 percent for splits, so small knots remain the hardest class.

Comparison with other detectors

Against YOLOv3m, v5m, v8m, v10m, v11m, v12m and v26m trained in the same way, the proposed model had the highest mAP@50-95 (69.3 percent; the nearest was YOLOv3m with 68.5 percent). On mAP@50 it was highest at 91.8 percent, just ahead of YOLOv3m at 91.5 percent and YOLOv11m at 91.4 percent. Its precision of 93.3 percent was slightly below the YOLOv8m baseline, and a few models had higher recall (YOLOv12m 86.5 percent, YOLOv11m 86.2 percent and YOLOv3m 86.0 percent).

Model size and speed

The modified model has 34.08 million parameters against 25.86 million for the baseline, an increase of about 8 million, although the profiler reports slightly fewer FLOPs (75.4 G versus 78.9 G). The authors caution that FLOPs counts for custom deformable and dynamic-sampling operators can be unreliable and do not demonstrate faster inference in practice. No hardware-specific latency or throughput was measured.

Practical applications for sawmills

Points from the paper

  • Combining deformable sampling, attention modules, a detail-preserving downsampling and a better localisation loss gave consistent, if modest, accuracy gains over a standard detector on this beech dataset.
  • The harder classes are small knots and splits; the design targets small, elongated and irregularly shaped defects.
  • The authors recommend further work on larger multi-source datasets, validation under industrial conditions, model compression and real-time deployment tests.

Portal interpretation (not claims of the paper)

  • The headline gain, about one percentage point of mAP@50, is unlikely on its own to change a mill's grading outcome. The value of the paper for a mill is mainly as an indication of which design ideas are worth trying for small-defect detection.
  • Any such system must be judged at the mill's own line speed, with the mill's own species, surface condition (sawn, planed, wet or dry) and lighting. The study images were of planed, kiln-dried beech under controlled lighting, which is a more favourable situation than rough-sawn green softwood on a moving chain.
  • A model with more parameters needs more computing. Mills planning inline inspection should ask for measured latency on the target hardware, not FLOPs.
  • Detection of a defect is only one part of grading: converting detections into grade decisions and cutting instructions according to the applicable standard is a separate step that this paper does not address.

Limitations

The authors state that the evaluation uses a single public dataset, that no independent field or factory images were tested, that acquisition and production-line conditions are only partly documented, and that no latency or throughput tests on specific hardware were made. They also state that dust, shadows, vibration and occlusion typical of a production line were not part of the optimised data, and that the model has not yet been validated under real production-line conditions. The method addresses visible surface defects only, not internal defects or strength properties.

Additional cautions from the portal: the test set contains only 100 images, so differences of one or two percentage points may be within normal run-to-run variation, and in the material we reviewed we did not see repeated runs or confidence intervals reported. The text also refers to a different number of comparison models than the table lists, a minor inconsistency. The dataset covers one species, and conclusions for softwoods such as spruce or pine cannot be drawn from it.

Conclusions

The paper presents a carefully engineered variant of YOLOv8m that detects visible lumber defects slightly better than the baseline and other YOLO versions on one public beech dataset, particularly on the stricter localisation measure. It is a useful illustration of how attention and deformable sampling can help with small and irregular defects, but it is not yet evidence of industrial performance: the authors themselves point to the need for testing under real factory conditions, measuring real inference speed and extending the data. Sawmills interested in this technology should treat it as promising research and ask suppliers and research partners for validation on their own material.

Original research

  • Authors: Longhai Wu, Kun Zhang, Lu Leng, Hongqing Zhang, Han Wang, Rui Zeng, Mengting Wang
  • Title: A Lumber Surface Defect Detection Network Integrating Deformable Convolution and Multi-Scale Attention
  • Journal/publisher: Forests (MDPI), vol. 17, article 839
  • Year: 2026
  • DOI: 10.3390/f17070839
  • Link: https://doi.org/10.3390/f17070839
  • Licence: Creative Commons Attribution (CC BY)

This article is an independent summary written by the portal; the original paper should be consulted for full details, tables and the authors' own wording.

Sources

Last updated 2026-10-24

More in this category