Aller au contenu

Mode données d'exemple. Les entreprises, offres et demandes d'exemple affichées sont fictives (images IA) et ne sont pas comptées dans les chiffres ci-dessous.

AI and automation

BPN-YOLO: a modified YOLOv7 reaches 81.8% mAP on wood surface defects, but only in a laboratory test

A 2024 Forests paper from Guangxi, China, adds partial convolution, Biformer attention and an NWD loss to YOLOv7 and reports 81.8% mAP on a seven-class wood defect image set, 7.4 points above the baseline; speed and model size remain open issues.

Country / region of the study or data: China (study: stored public image dataset from VSB Technical University of Ostrava, Czechia, processed in China; authors: Guangxi Normal University, Guilin, and Hechi University, Yizhou)

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

Surface defects such as knots, cracks and resin pockets decide how a board is graded, trimmed or rejected, and in most mills that judgement is still made by people looking at boards moving past at line speed. A group of six authors from Guangxi Normal University (Guilin) and Hechi University (Yizhou), China, has published an open-access paper in the journal Forests in June 2024 that proposes a deep-learning detector for wood surface defects, named BPN-YOLO. It is built on the YOLOv7 object-detection network and is aimed at what the authors describe as a key quality-control step in wood processing.

The authors point to three weaknesses of the standard YOLOv7 for this task: it detects small targets poorly, it carries a large number of parameters and a complex structure, and its bounding-box loss, which is based on intersection over union (IoU), is sensitive to small offsets in the box position, which matters when the defect itself is only a few pixels wide. The paper's response is to modify the network in three places and to test each change on a public wood-defect image set.

For a sawmill audience the paper is interesting less as a finished product than as a benchmark of what current lightweight detectors achieve on lumber surface images. It is a laboratory study on a stored image dataset. It does not report an installation on a production line, and it should be read in that light. The figures quoted below are those reported by the authors; the portal has not repeated the experiments.

Research methodology

Dataset. The images come from a wood surface defect dataset published by VSB Technical University of Ostrava (cited as reference 28 in the paper). According to the authors, the original set contains 20,275 images of 2800 x 1024 pixels, of which 18,283 show defects and 1,992 show none. The authors removed three categories with very few samples (Quartzity, Blue stain and Overgrown) and kept 3,600 images in seven classes: live knot, dead knot, knot with crack, missing knot, crack, resin and marrow. The images were split 9:1 into training and test data, and a further 10 percent of the training data was used for validation. The paper's text mentions ten defect types in the original dataset, while the class table lists seven plus a "without defects" row; the authors' final experiments use the seven classes.

Network changes. BPN-YOLO combines three modifications to YOLOv7:

  • P-ELAN: the 3 x 3 regular convolutions inside the ELAN blocks of the backbone are replaced with partial convolution (Pconv). The authors state that this reduces redundant computation and memory access.
  • Biformer attention: a dynamic, query-aware sparse attention mechanism inserted after the SPPCSPC module. It first filters key-value pairs at a coarse region level and only then applies token-level attention, so the network can concentrate on small defect regions.
  • NWD loss: the IoU measure is replaced by the Normalized Wasserstein Distance, in which each box is modelled as a two-dimensional Gaussian. The motivation given is that this is less sensitive to small positional deviations of small objects.

Training set-up. Training used PyTorch 1.7.1 with CUDA 11.0 and Python 3.8 on Windows 11, with an Intel Core i9-13900HX processor and an NVIDIA GeForce RTX 4060 Laptop GPU. The batch size was 4, training ran for 200 epochs and took about 9.788 hours, and images were scaled to 640 x 640 pixels. The text does not report the optimiser, learning rate, augmentation settings, the IoU threshold used for mean average precision, or parameter and floating-point-operation counts for the models.

Evaluation. Precision, recall, average precision (AP) per class and mean average precision (mAP) over the seven classes were used. The authors ran an ablation study (each module alone and all three together), compared six attention mechanisms, and compared BPN-YOLO against Faster R-CNN, RT-DETR and YOLOv5, v7, v8 and v9. They also report per-class inference times.

Key findings

Overall accuracy. The baseline YOLOv7 reached an mAP of 0.744 on this dataset. The full BPN-YOLO reached 0.818, an improvement of 7.4 percentage points.

Ablation. Adding each module on its own to YOLOv7 gave the following mAP values, as reported in the ablation table:

Model mAP
YOLOv7 0.744
+ Biformer 0.772
+ Pconv (P-ELAN) 0.772
+ NWD 0.791
BPN-YOLO (all three) 0.818

The NWD loss produced the largest single gain (4.7 points), and the three changes together were better than any one alone.

Per-class results. The full model's class-level AP values were 0.844 for live knot, 0.839 for dead knot, 0.857 for marrow, 0.812 for resin, 0.797 for crack, 0.654 for knot with crack and 0.922 for missing knot. Knot with crack was the weakest class for every model in the ablation (0.560 for the YOLOv7 baseline, 0.654 for BPN-YOLO). Not every class improved with every module; for example the missing-knot AP of the Pconv-only variant (0.731) was lower than that of the baseline (0.816), and dead-knot AP was nearly flat across all variants.

Attention comparison. Among the attention mechanisms the authors tried inside YOLOv7, Biformer gave the best mAP (0.772), ahead of ECA (0.767), CBAM (0.751), SK (0.729), SSA (0.735) and EMA (0.713).

Comparison with other detectors. The reported mAP values were 0.606 for Faster R-CNN, 0.683 for RT-DETR, 0.700 for YOLOv5, 0.744 for YOLOv7, 0.765 for YOLOv8, 0.750 for YOLOv9 and 0.818 for BPN-YOLO. The authors summarise the margins as 11.8 points over YOLOv5, 7.4 over YOLOv7, 5.3 over YOLOv8, 6.8 over YOLOv9, 13.5 over RT-DETR and 21.2 over Faster R-CNN, which match the table values.

Speed. The paper's inference-time table gives per-class times in seconds per image of 0.005 to 0.017 for YOLOv5, 0.007 to 0.010 for YOLOv7 and 0.005 to 0.007 for BPN-YOLO. How the timing was measured is not described. The authors state in the results that BPN-YOLO is faster than YOLOv5 and YOLOv7, yet their discussion concedes that Biformer adds parameters and lowers speed and that the final model is not yet fully optimised for speed. Because no parameter or FLOP totals are given, the portal could not reconcile these two statements.

Comparison with literature. In the discussion, the authors compare their crack AP of 79.7 percent with 77.21 percent reported in a cited YOLOv3 study and their mAP of 81.8 percent with 76.5 percent for a cited YOLOv8 variant. These comparisons involve different studies and are not controlled experiments.

Internal inconsistencies noticed by the portal. A few details in the text do not line up: the gain from the CBAM attention is given as 0.9 percent in one place and 0.7 percent in another (the table supports 0.7), a class-level margin over YOLOv5 is quoted in the text as 32.2 percent while the comparison table implies a slightly larger difference, and one ablation row is labelled "YOLO + NWD" in the text and "YOLOv7 + NWD" in the table. None of these changes the overall ranking, but they are a reminder to consult the original tables.

Practical applications for sawmills

Portal interpretation (these are not claims made by the paper):

  • Where such a model would sit. A detector of this kind is a candidate for a grading or trimming station that images boards after planing or at the sorting line. The paper itself describes the model as a possible option for wood processing and quality inspection but does not test it in a mill.
  • Which defects are easy and which are hard. The class-level results suggest that large, high-contrast defects such as knots are detected more reliably than defect combinations such as knot with crack, which stayed near 0.65 AP. A mill planning to use automated detection for downgrading decisions should ask for per-class results on its own species and surface condition, not only a headline mAP.
  • Hardware expectations. The experiments ran on a laptop-class GPU, and the authors report short per-image times. That points to modest hardware requirements for inference, but the paper gives no information on line speed, camera set-up or image acquisition, so no throughput claim for a production line can be made from it.
  • Benchmarking value. The study shows that, on one public set, adding attention, a lighter convolution and a different loss lifted a YOLOv7 baseline by several points. A mill or integrator evaluating vendor claims could use such published figures as a rough yardstick, bearing in mind that mAP values depend heavily on the dataset and the evaluation settings.
  • Data matters more than architecture. Because the dataset comes from another institution and was reduced to 3,600 images, a mill would still need to collect and label its own images under its own lighting, species mix and surface finish before trusting any result.

Limitations

The authors state that detection speed and network size still need optimisation, and that the Biformer module increases the number of parameters and reduces detection speed, partly cancelling the savings obtained from partial convolution. They plan further work on speed and structure.

Further limitations that follow from the information in the paper, and which are the portal's observations:

  • All results come from one public image set, reduced to seven classes and 3,600 images, with a 9:1 split. The paper does not describe cross-validation, repeated runs or variance, so the size of the improvements cannot be put into a statistical context.
  • Key training details (optimiser, learning rate, augmentation, IoU threshold for mAP) are not given, which limits reproducibility.
  • The dataset origin is a university collection, and the paper does not discuss how the images were acquired or whether the conditions resemble an industrial line.
  • Inference times are listed without a description of the timing method, and parameter or FLOP counts are not reported.
  • Several figures could not be read in the text version used for this summary: the precision-recall curves, the detection-comparison images and the Grad-CAM heat maps are images only, and the architecture diagrams were partly garbled. Statements that depend on these figures are not verified here. All five tables were readable.

Conclusions

BPN-YOLO is a modified YOLOv7 that combines a partial-convolution backbone block, Biformer sparse attention and an NWD loss. On a seven-class wood surface defect set of 3,600 images it reaches 81.8 percent mAP, 7.4 points higher than the unmodified YOLOv7 and higher than the other detectors the authors compared, from Faster R-CNN to YOLOv9. The authors present it as a practical option for wood-processing quality inspection, while acknowledging that speed and model size need more work. For the sawmill sector the paper is best read as one more data point on the accuracy that lightweight detectors can reach on stored lumber images, not as evidence of line-ready performance.

Original research

  • Authors: Rijun Wang, Yesheng Chen, Fulong Liang, Bo Wang, Xiangwei Mou, Guanghao Zhang
  • Title: BPN-YOLO: A Novel Method for Wood Defect Detection Based on YOLOv7
  • Journal: Forests, volume 15, article 1096
  • Year: 2024 (published 25 June 2024)
  • DOI: 10.3390/f15071096
  • Affiliations: Guangxi Normal University (Guilin) and Hechi University (Yizhou), China
  • Licence: open access, Creative Commons Attribution (CC BY), as stated in the article PDF

This article is an independent summary prepared by the portal; the original paper should be consulted for full methods, tables and figures.

How this text was checked · checked 2026-10-26

Full text of the MDPI PDF was opened once (via WebFetch extraction) and numbers, methods, affiliations, dates and licence compared with the summary; tables 1-5 were readable.

Could not be verified

  • Figures 2-8 (architecture diagrams, PR curves, detection and Grad-CAM images) not readable in the extracted text.
  • Optimiser, learning rate, augmentation, IoU threshold, parameter/FLOP counts not reported in the paper.
  • Text-vs-table inconsistencies (CBAM 0.9% vs 0.7%; class-level margin over YOLOv5 32.2% vs table; speed claims) not resolved.
  • Article landing page was not opened; DOI link used for the URL.
  • Dataset licence and acquisition conditions not checked.

Sources

Last updated 2026-10-26

More in this category