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

Hyperspectral imaging and explainable AI separate four wood species with 99.9% accuracy in the lab

Chinese study of 1,600 wood blocks: SWIR hyperspectral imaging with a CNN-Transformer reached 99.92% mean accuracy; SHAP showed which wavelengths mattered. Lab-only, four species.

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

Species identification is a routine but important task along the timber chain. Buyers need to know that a consignment of a premium species is what it is claimed to be, restorers of historic timber structures need traceability, and processors need to keep look-alike species apart. The authors of a January 2025 open-access paper in Forests argue that high-value species are vulnerable to counterfeiting and improper substitution, which can threaten structural safety and traceability in restoration. Visual and physical inspection still depends heavily on the experience of the inspector.

The paper tests a modern alternative: hyperspectral imaging (HSI) combined with deep learning. Unlike near-infrared (NIR) spectroscopy, which the authors describe as limited in band range and resolution and as measuring only specific points, HSI records a continuous spectrum for every pixel together with spatial information. The authors also address a common objection to deep learning, the "black box" problem, by applying SHAP, an explainable-AI method that estimates how much each spectral band contributed to a model's decisions. The headline is a hybrid CNN-Transformer model that identified four species in the short-wave infrared (SWIR) range with a mean test accuracy of 99.92 percent. This article explains how the experiment was built, what the results do and do not show, and what a mill might take from them.

Research methodology

Samples. The data set contains four species: Golden Phoebe, Hemlock, Cypress and Camphor Pine. For each species there were 400 blocks of 4 x 4 x 3 cm, giving 1,600 samples. The wood came from different regions of China: Golden Phoebe from Ya'an (Sichuan), Hemlock from Shunchang (Fujian), Cypress from Shifang (Sichuan) and Camphor Pine from the Greater Khingan Range (Heilongjiang). Blocks were sanded with 100-grit paper and stored at 20 +/- 2 degrees C and 60 +/- 2 percent relative humidity.

Imaging. Two push-broom hyperspectral cameras from Specim were used: an FX10 for visible and near-infrared (VNIR, 400-1000 nm) and an FX17 for short-wave infrared (SWIR, 900-1700 nm). Samples sat on a motorised stage in a dark chamber lit by 280 W halogen lamps. Images were corrected with black and white references, and regions of interest were extracted from each sample.

Data split and preprocessing. The SPXY algorithm divided the samples 7:3 into 1,120 training and 480 test samples. Preprocessing options included Savitzky-Golay smoothing, normalisation, baseline correction, Standard Normal Variate (SNV) and Multiplicative Scatter Correction (MSC). The authors compared full-band modelling (all wavelengths) with feature-band modelling, where only selected wavelengths are kept using CARS, SPA or RFE (with a decision tree as the base model). The number of selected wavelengths was 15, 11 and 24 for VNIR and 21, 13 and 21 for SWIR, respectively.

Models. Four models were compared: PLS-DA and XGBoost as conventional approaches, a one-dimensional CNN, and a CNN-Transformer in which a Transformer encoder is followed by 1D-CNN refinement. Each experiment was repeated five times and the mean and standard deviation reported. Metrics were accuracy, precision, recall and F1-score, plus parameter count, model size and floating-point operations (FLOPs). SHAP values were used to examine which wavelengths drove the predictions. Software included The Unscrambler and MATLAB for preprocessing and wavelength selection, and Python with PyTorch for modelling.

Key findings

SWIR beat VNIR, and the hybrid model beat the rest. With full spectra, the best test accuracies per model were:

Model VNIR SWIR
PLS-DA 96.67% 98.75%
XGBoost 96.25% 97.71%
1D-CNN 95.46 +/- 1.65% 98.96 +/- 0.71%
CNN-Transformer 98.21 +/- 0.67% 99.92 +/- 0.19%

The best result, 99.92 +/- 0.19 percent, was obtained for the CNN-Transformer on SNV-processed SWIR data. The abstract of the paper quotes 100 percent for SWIR; the body text reports the 99.92 percent mean over five runs, and the 100 percent figure appears to correspond to a best single run. The mean is the more defensible number.

Feature selection mostly hurt. Reducing the spectra to a handful of selected wavelengths simplified the models but usually lowered accuracy, because informative bands were discarded. The CNN-Transformer on SWIR fell from 99.92 +/- 0.19 percent to 91.67 +/- 1.05 percent. There were exceptions for conventional models: XGBoost on VNIR improved to 97.92 percent and PLS-DA on SWIR improved to 99.58 percent. The authors conclude that full-band modelling was more accurate and robust overall.

Preprocessing preferences differ. PLS-DA and XGBoost did best with normalisation on VNIR data, whereas the deep models did best on raw VNIR data (CNN-Transformer) and on SNV-processed SWIR data. The authors reason that deep networks learn features directly while linear models benefit from noise reduction.

The hybrid model is also compact. According to the paper's complexity table, the CNN-Transformer has 1,286,228 parameters, a 4.93 MB model size and about 1.29 million FLOPs, compared with 1,739,092 parameters, 6.64 MB and 1.99 million FLOPs for the plain 1D-CNN. PLS-DA is far smaller (2,280 parameters, 0.01 MB), and XGBoost has 204,700 parameters at 0.78 MB. The authors suggest the CNN-Transformer could therefore suit embedded or portable devices, although the paper does not test any such device.

Where errors occur. In VNIR, Golden Phoebe was never misclassified, while Hemlock, Cypress and Camphor Pine were confused with one another by several models. In SWIR, the conventional models' errors came from overlapping features at roughly 1200-1600 nm, and the CNN confused Hemlock and Cypress; the authors report no misclassifications for the CNN-Transformer in SWIR. Principal component analysis showed the same picture: in VNIR the first three components explained 98.1 percent of variance and separated Golden Phoebe clearly, whereas in SWIR Hemlock, Cypress and Camphor Pine overlapped heavily, so PCA alone was not sufficient.

What SHAP highlighted. For the CNN-Transformer in VNIR, the most influential wavelengths lay around 640-660 nm, 700-720 nm and 790-800 nm, which the authors relate to pigments, lignin and cellulose. In SWIR they lay around 1040-1070 nm, 1280-1320 nm and 1350-1370 nm, associated by the authors with C-H and O-H vibrations in lignin and hemicellulose. PLS-DA and XGBoost looked at narrower regions (for example about 440-480 nm in VNIR and about 1430-1480 nm and 1660-1720 nm in SWIR), while the CNN-Transformer in SWIR used a broader range including 1000-1400 nm. The chemical interpretations are the authors' associations and were not tested directly, and the SHAP results are for the models overall rather than per species.

Practical applications for sawmills

From the paper: The authors position SWIR hyperspectral imaging with a CNN-Transformer as a reliable approach for automated wood processing and species identification. They point to the model's modest size as a basis for deployment on portable or embedded hardware, and they present the SHAP analysis as a way to make the classification more transparent. Their own future-work list is to test wood from different regions, ages and moisture levels, to explore domain adaptation, and to develop feature extraction that keeps information useful to deep networks.

Portal interpretation (not claims of the paper):

  • The most plausible near-term use for a sawmill is in goods-in or dispatch checks, for example confirming species on mixed consignments of lumber or flooring blanks, rather than in the high-speed sawline.
  • The test objects were small, sanded blocks measured in a dark chamber under controlled lamps. Rough-sawn, wet or dirty lumber moving on a conveyor will behave differently, so any pilot should be run on real production surfaces and conditions.
  • Four species with quite different origins is a small, forgiving problem compared with the dozens of species a trading yard may handle. Buyers should ask suppliers of such systems how many species, how many regions and what moisture states their models have been validated on.
  • The finding that feature selection lowers deep-model accuracy is a reminder that cheaper, narrow-band sensors may not match the performance reported here for full-spectrum cameras.
  • Explainability outputs such as SHAP are useful for building trust with quality managers, but they do not replace validation on independent samples.

Limitations

The authors name several limitations. The samples came from a relatively homogeneous set of sources, which limits how far the results generalise, and regional ecological and environmental conditions may change spectral properties; the models were not tested on other sources. Ageing, degradation and moisture content can shift spectra, especially in SWIR, and were not studied systematically. Feature selection lost information that the deep models needed, and the internal decision process of the CNN-Transformer remains only partly transparent even with SHAP.

Further caveats follow from the design. Only four species were included. The samples were small, sanded, clear blocks stored under controlled conditions, so surface roughness, knots, discolouration and mixed moisture were not part of the challenge. Test accuracy was measured on a held-out split of the same sample population (480 test samples drawn from the same blocks as the training samples), not on an independent external collection. The abstract's 100 percent figure differs from the 99.92 percent mean in the results. Finally, this summary relied on the portions of the article text that could be read; the full-band and feature-band tables for the individual models were not all legible, so only the values quoted above are reported.

Conclusions

The study shows that hyperspectral imaging combined with a CNN-Transformer can separate four wood species almost perfectly under laboratory conditions, with the SWIR range (900-1700 nm) giving the best results at 99.92 +/- 0.19 percent mean test accuracy. Full-spectrum input outperformed selected-band input for the deep models, and the hybrid architecture was smaller than a plain 1D-CNN. SHAP analysis pointed to specific regions linked by the authors to wood chemistry. The step from laboratory blocks to industrial lumber, with more species and variable surfaces and moisture, remains to be demonstrated, as the authors themselves recognise in their future-work plans.

Original research

  • Authors: Yicong Qi, Yin Zhang, Shuqi Tang, Zhen Zeng (corresponding author)
  • Title: Synergizing Wood Science and Interpretable Artificial Intelligence: Detection and Classification of Wood Species Through Hyperspectral Imaging
  • Journal: Forests (MDPI), volume 16, issue 1, article 186
  • Year: 2025 (published 19 January 2025)
  • DOI: 10.3390/f16010186
  • Link: https://www.mdpi.com/1999-4907/16/1/186
  • Licence: Creative Commons Attribution (CC BY; page metadata lists CC BY 3.0)

This article is an independent summary written by Sawmill Network Europe; the original paper should be consulted for full methods, tables and caveats.

Sources

Last updated 2026-10-24

More in this category