Portable Hyperspectral Imaging Combined with Interpretable PLS-DA-SHAP for Geographical Origin Traceability and Authenticity Discrimination of Poria cocos (Fushen)
研究利用便携式高光谱成像结合可解释机器学习实现茯苓产地溯源与真伪鉴别,方法新颖,数据详实,对中药材质量监管有参考价值,但属细分领域进展,影响范围有限。
本文提出便携式高光谱成像结合可解释PLS-DA-SHAP方法,用于茯苓(Fushen,Poria cocos)的地理来源溯源与真实性鉴别。研究展示了如何将机器学习与SHAP可解释性相结合,应用于中药材产地溯源。原文标题:Portable hyperspectral imaging combined with interpretable PLS-DA-SHAP for geographical origin traceability and authenticity discrimination of Poria cocos (Schw.) Wolf (Fushen),作者:Xing W、Zhang Y、Wei X、Nie S、Cheng X、Cai M、Yang Q、Wang Y,发表于Frontiers in Sustainable Food Systems 2026年第10卷doi:10.3389/fsufs.2026.1891249,2026年7月15日接收,8月7日发表。本研究为基于光谱成像的农产品/中药材产地溯源提供了可解释AI方法范式。
Abstract
Introduction:
Poria cocos (Schw.) Wolf (Fushen) is a fungus that is edible and has medicinal value. The quality of the fungus varies with geographical origin and its commercial substitution by Chuanshen.
Methods:
This study developed a rapid, non-destructive approach for the geographical origin traceability and authenticity discrimination of Fushen using portable hyperspectral imaging (HSI; 400–1,000 nm) combined with interpretable machine learning. The discriminatory potential of four Fushen regions was assessed. Partial least-squares discriminant analysis (PLS-DA), support vector machine, and multilayer perceptron were compared, while the successive projections algorithm and SHapley Additive exPlanations (SHAP) algorithms were applied for feature wavelength selection and model interpretation.
Results:
The PLS-DA-SHAP strategy exhibited the best overall performance. After SHAP-based wavelength selection, PLS-DA combined with first derivative (D1) preprocessing achieved 92.33% accuracy for geographical origin traceability, whereas PLS-DA using raw spectra achieved 100% accuracy for authenticity discrimination. The outer layer of white Fushen (M2) provided the highest regional discrimination accuracy of 100%. Wavelengths of 893 nm, 896 nm, and 881 and 423 nm were identified as key contributors to geographical origin traceability, authenticity discrimination using the All dataset, and authenticity discrimination using M2, respectively.
Discussion:
These findings can support the use of portable HSI as a practical tool for on-site quality assessment of Fushen and related edible and medicinal materials.
1 Introduction
Poria cocos (Schw.) Wolf (Fushen) is a saprotrophic fungus of the Polyporaceae family. It commonly parasitizes the roots of Pinus species and forms dense white sclerotia that naturally enclose the growing portions of pine roots. This material is commonly referred to as Fushen in China (). Fushen is distributed mainly in Asia, America, Oceania, and parts of Africa, with China serving as the major cultivator (). Fushen is commonly regarded as one of the representative species with both medicinal and edible properties. In addition to recording its therapeutic properties, ancient medical texts have emphasized its nutritional value and suitability for long-term consumption (). Therefore, Fushen has a long history of use in the food industry, with a wide range of products such as porridge, pastries, herbal teas, and tonic soups, which are well accepted by consumers and reflect its edible value (). Modern studies have shown that Fushen is rich in bioactive constituents, including polysaccharides and triterpenoids, and exhibits sleep-improving and anxiolytic effects, indicating its promising potential as a functional food ingredient (; ).
Fushen has a long cultivation history in China and is widely produced in Anhui, Yunnan, Hubei, and Hunan. Its quality is affected by production area conditions (e.g., soil, climate, and cultivation practices), which may lead to variations in key functional components (; ). In addition, counterfeit Fushen products that closely resemble genuine products are present in the market and are difficult to identify visually. These counterfeit products, commonly known as Chuanshen (CS), are produced by artificially inserting pine roots into the sclerotium during the later growth stage of Poria cocos (PC) (; ). In genuine Fushen, the lignocellulose of pine roots undergoes biological transformation with the mycelium of PC during development of the sclerotia, resulting in changes in the active components. In CS, the symbiotic period between pine roots and PC is relatively short, contributing to the marked compositional differences from genuine Fushen (). Previous studies have also shown that Fushen blocks can be divided into four regions, namely Fushen wood, the inner layer of white Fushen, the outer layer of white Fushen, and skin Fushen, each with distinct chemical compositions (; ). However, whether genuine and counterfeit products differ across these regions and whether such regional differences can be effectively used for counterfeit discrimination remain unclear. Therefore, a reliable detection method is required to identify the geographical origin, authenticity, and regional characteristics of Fushen, thereby supporting product quality control.
Traditional food detection methods mainly rely on analytical techniques such as liquid chromatography–mass spectrometry (; ), gas chromatography–mass spectrometry (), and ultra-high-performance liquid chromatography–quadrupole time-of-flight mass spectrometry (; ; ). Although these methods provide high analytical accuracy, they require complex procedures, long analysis times, high costs, and destructive pretreatment, which limit their suitability for rapid market screening (; ). As a rapid analytical technique, near-infrared spectroscopy still faces limitations related to low sensitivity, dependence on chemometric models, and insufficient model interpretability ().
Hyperspectral imaging (HSI) integrates spectral analysis with imaging acquisition and has become an effective, rapid, and non-destructive detection technique. Without requiring complex chemical pretreatment, HSI can simultaneously capture the spatial and spectral characteristics of samples. Moreover, the integration of HSI with machine learning algorithms has further improved both accuracy and efficiency, and this combined approach has now been widely adopted in food safety applications (; ; ). However, conventional HSI systems are generally bulky and require controlled operating environments, limiting their suitability for portable deployment and on-site detection. Conversely, portable spectral instruments are compact and more suitable for field-based applications. In recent years, devices such as SPECIM IQ have been successfully used for rapid and non-destructive on-site analysis, including saffron origin identification () and quantitative detection of rice adulteration (), demonstrating their practical value in food quality evaluation. Nevertheless, portable hyperspectral datasets are affected by high dimensionality, limited computational efficiency, and insufficient model interpretability. To address these constraints, the successive projections algorithm (SPA) and SHapley Additive exPlanations (SHAP) can be employed for feature wavelength selection. By removing redundant variables and retaining informative wavelengths, these methods enable dimensionality reduction and improve model efficiency. In addition, SHAP can be integrated with different machine learning models to quantify the marginal contribution of each wavelength and generate global importance rankings, thereby enhancing the interpretability of model decisions (; ).
On this basis, portable HSI combined with interpretable machine learning was used in this study to support the geographical origin traceability and authenticity discrimination of Fushen, with the aim of providing a technical reference for rapid and non-destructive detection of functional food materials. The specific objectives were as follows: (1) to acquire HSI data from Fushen samples collected from different geographical origins, as well as from genuine and counterfeit products, and to divide the genuine and counterfeit samples into four regions; (2) to compare the classification performance of three algorithms, including support vector machine (SVM), partial least-squares discriminant analysis (PLS-DA), and multilayer perceptron (MLP), under six preprocessing methods; and (3) to use SPA and SHAP for characteristic wavelength selection, dimensionality reduction, classification efficiency improvement, and interpretation of the relationship between wavelengths and samples. The methodological workflow is illustrated in Figure 1. For abbreviations see Supplementary Table S1.
Figure 1
2 Materials and methods
2.1 Sample collection
Fushen samples were collected from five authentic production areas in China, namely Jinzhai, Anhui (AJ); Yuexi, Anhui (AY); Hubei (HB); Hunan (HN); and Yunnan (YN). Four independent biological replicates were obtained from each production area, with each replicate derived from different farmer fields. Five blocks were randomly selected from each replicate, yielding 20 blocks per production area and a total of 100 authentic Fushen blocks across the five areas. The counterfeit CS samples were collected from Jinzhai County, Anhui Province, China, with six independent biological replicates and five blocks randomly selected from each replicate, totaling 30 CS blocks. All samples were authenticated as genuine Fushen or counterfeit CS by Associate Professor Yang Qingshan from Anhui University of Chinese Medicine. After collection, the outer skin was removed, and Fushen blocks of similar size were selected for subsequent analysis. Representative sample images are shown in Figure 1, Step 1 Samples collection, and detailed sample information is provided in Supplementary Table S2.
2.2 Data collection using the HSI system
Hyperspectral images were acquired using a portable hyperspectral camera (SPECIM IQ, SPECIM Spectral Imaging Ltd., Oulu, Finland) by scanning one surface of each Fushen block (Figure 1, Step 2 Hyperspectral image acquisition). The camera was fitted with a visible–near-infrared lens covering 400–1,000 nm and provided 204 bands, a spatial resolution of 512 × 512 pixels, a spectral resolution of 7 nm, a sampling interval of approximately 2.94 nm, and band-division capability (). A white reference plate with 90% reflectance was used for reflectance correction during image acquisition.
Images were captured while the samples were stationary. To reduce background interference, the samples and white reference plate were placed on a black background, as described in the literature (). The SPECIM IQ instrument was mounted on a tripod, and the lens was positioned vertically approximately 40 cm above the samples. Because all images were collected outdoors under sunlight, the simultaneous mode was adopted to minimize the effect of illumination variation, following previous research (). The integration and recording times were set to 2 ms and 32 s, respectively, to ensure consistent imaging conditions during HSI data collection. Pixel-level reflectance correction was performed using the black-white reference correction formula reported in the literature (). The corrected hyperspectral images were transferred to a computer for subsequent region of interest (ROI) extraction.
2.3 Spectral data extraction from ROIs
The ROIs were manually delineated using Insight 1.3.1 software provided by the instrument manufacturer for subsequent analysis. For geographical origin traceability, ROIs were extracted from the complete regions of samples from five geographical origins (20 blocks per area, 100 blocks in total), with 15 ROIs per block, yielding 300 ROIs per area and 1,500 ROIs overall. For authenticity discrimination (All), ROIs were extracted from the complete regions of 30 authentic and 30 counterfeit CS blocks, with 10 ROIs per block, resulting in 300 ROIs for authentic samples and 300 for counterfeit samples, totaling 600 ROIs.
Given the differences in bioactive components among the four regions of Fushen, and following previous studies and morphological characteristics (), the authentic and counterfeit CS samples were divided from the inside outward into four regions: Fushen wood (the internal host pine root, abbreviated as FSM), the inner layer of white Fushen (the white sclerotial part near the host pine root, abbreviated as M1), the outer layer of white Fushen (the white part near the outer region, abbreviated as M2), and the peripheral sclerotium (the outermost sclerotial part after peeling, abbreviated as M3), since all samples had their outer skin removed at collection. The division is illustrated in Supplementary Figure S1 and Figure 1, Step 2 Hyperspectral image acquisition. For each region, 10 ROIs were extracted per block from 30 authentic and 30 counterfeit CS blocks, yielding 300 ROIs per region for each category. Across the four regions, a total of 1,200 ROIs from authentic samples and 1,200 from counterfeit samples were obtained, amounting to 2,400 ROIs in total. These data were used to evaluate the spectral differences and the discriminatory ability of each region in authenticity discrimination.
Based on the above strategy, the mean reflectance within each ROI was extracted as spectral information. Subsequently, the three independent datasets were each randomly divided into training and test sets at an 8:2 ratio.
2.4 Spectral preprocessing
Several preprocessing methods were applied to the raw spectral data to reduce the background noise and physical interference generated during HSI acquisition. These methods included multiplicative scatter correction (MSC), first derivative (D1), second derivative (D2), standard normal variate (SNV), Savitzky–Golay smoothing (SG), and wavelet transform (Wave).
2.5 Machine learning classification model
SVM is a supervised learning algorithm with a strong generalization ability. It separates classes by constructing an optimal hyperplane in the feature space, thereby maximizing the margin between categories. For linearly inseparable samples, kernel functions are used to map the original data into a high-dimensional feature space in which linear separation can be achieved (; ). The model classification performance is mainly controlled by the penalty factor and the kernel parameter. In this study, the model parameters were optimized using a grid search combined with 10-fold cross-validation. The candidate values for the penalty factor were 5, 10, 15, 50, and 100, whereas the kernel parameter was searched over 1e-7, 1e-6, 1e-5, 1e-4, 1e-3, 1e-2, 1e-1, and 1. Three kernel functions, namely linear, polynomial, and radial basis function kernels, were systematically compared to determine the optimal model configuration and improve classification performance.
PLS-DA is a supervised pattern recognition method derived from partial least-squares regression. By extracting latent variables with maximum covariance with class labels, PLS-DA enables dimensionality reduction and classification to be achieved simultaneously while balancing the retention of discriminant information with the mitigation of high-dimensional effects (). Its classification performance depends on the selected number of PLS latent components, defined as n_components. In this study, the number of PLS latent components was searched from 1 to 21, and the optimal value was determined using 10-fold cross-validation.
MLP is an artificial neural network with a relatively simple architecture that can learn from sample data and effectively represent classification features (). In this study, the MLP consisted of two hidden layers, with the number of neurons in each layer ranging from 50 to 500. The optimal parameters were determined by grid search. The rectified linear unit function was used as the activation function for hidden layers. The limited-memory Broyden–Fletcher–Goldfarb–Shanno algorithm was used for optimization. The regularization coefficient was set to 0.0001, and the maximum number of iterations was set to 10,000 to ensure sufficient model convergence.
2.6 Feature wavelength selection algorithm
To address the high dimensionality, collinearity, and redundancy of hyperspectral data, SPA and SHAP were used to extract characteristic bands. Through dimensionality reduction and the removal of irrelevant variables, these methods were applied to simplify the models and improve prediction performance.
SPA is based on vector-space projection. It identifies wavelength subsets with low collinearity and high information content by sequentially projecting wavelength vectors onto the orthogonal complement space of the remaining vectors. The optimal wavelength combination was selected according to the root mean square error of cross-validation, thereby achieving spectral dimensionality reduction (; ). To improve the stability and reliability of the selected wavelengths, 10-fold cross-validation was applied, and automatic scaling was used in the preprocessing parameters.
SHAP is an interpretability method derived from Shapley value theory in cooperative game theory (). Each input feature is regarded as a participant in a cooperative game, and its Shapley value is calculated from the weighted average of its marginal contributions across all possible feature subset combinations. The resulting value quantifies the contribution of each feature to the model prediction. The specific calculation formula is provided in .
2.7 Model evaluation and software
A confusion matrix was used for model evaluation, with accuracy, precision, recall, and F1-score as the main metrics for assessing classification performance. The corresponding calculation formula is provided in . All analyses were conducted on a Windows 11 platform equipped with an AMD Ryzen 9 9955HX CPU, 32 GB of memory, and an NVIDIA RTX 5060 Laptop GPU. Data processing and model construction were performed using Python 3.12 (64-bit) and PyCharm Community 2024.1. All scripts were developed by our research group.
3 Results
3.1 Spectral curve analysis of samples
The mean raw spectral curves of Fushen samples from different geographical origins are presented in Figure 2A. Across all origins, the reflectance increased over the 400–900 nm range, reached a maximum at approximately 850–900 nm, and then declined gradually between 900 and 1,000 nm. This pattern indicates an overall spectral trend characterized by an initial increase, followed by a slow decrease. Over the entire wavelength range, the reflectance of the AY and AJ samples was higher than that of the other samples. The HB samples displayed intermediate reflectance, whereas the YN and HN samples had relatively lower reflectance. For genuine Fushen, the four regional spectra showed a similar overall pattern, with the reflectance increasing and decreasing (Figure 2B). However, an evident regional variation was observed, with the reflectance increasing from the inner to the outer region in the order FSM < M1 < M2 < M3. Notably, M2 exhibited a reflectance profile similar to that of All. For counterfeit Fushen, the spectra of M1, M2, and M3 were highly consistent with that of All, whereas FSM showed a different spectral profile (Figure 2C). M2 had the highest reflectance among the four counterfeit regions. In both genuine and counterfeit samples, FSM showed low reflectance and similar curve patterns. Although the spectral reflectance varied among s