{'fraction_non_alphanumeric': 0.028797265541550952, 'fraction_numerical': 0.008203375347148045, 'mean_word_length': 5.001538461538462, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Polysaccharide determination and habitat classification for fresh Dendrobiums with hyperspectral imagery and modified RBFNN

This research aimed to study the visual and nondestructive detection of mannose (MN) and Dendrobium polysaccharides (DP) in Dendrobiums by using hyperspectral imaging technology. In order to determine the MN and DP concentrations nondestructively, we built radial basis function neural network (RBFNN) models based on NIR spectra (874–1734 nm) with a novel chemometric method to calculate the radial bases. And excellent results with the RP2 coefficients of 0.906 and 0.913 were obtained by the MN and DP detection models, respectively. In order to simplify the detection models based on full-range spectra, we designed an innovative genetic algorithm-successive projections algorithm (GA-SPA) strategy to extract the feature bands efficiently in two stages. Based on the feature bands selected by GA-SPA, we established the simplified detection models with the same high performance as those based on full-range spectra. By importing the feature bands of every pixel in the hyperspectral image into the simplified detection models, we successfully generated the distribution maps of MN and DP. Moreover, we also built an RBFNN classifier to categorize the habitats of Dendrobium. And the total classification accuracy reached 0.887. This research makes progress in Dendrobium quality evaluation and spectral detection technology.


Introduction
Dendrobium is called the 'gold of herbs' in China to illustrate its great value. It has been treated as a rare tonic with a long story, and many medical experiments have proven its powers in health and disease prevention. 1,2 In the natural environment, Dendrobium is hard to harvest because it is rare and grows on cliff crevices. To satisfy the consumption requirement, people plant Dendrobiums by simulating the natural growth environment with modern cultivation techniques. 3 But the quality of different Dendrobium products varies distinctly. The mannose (MN) and Dendrobium polysaccharides (DP) are most representative to assess the Dendrobium quality. 4 However, the traditional method used to determine MN and DP concentrations is HPLC. It is low-efficiency, destructive, regent consuming, and laborious. 5 A real-time and nondestructive detection method is urgently needed.
Hyperspectral imaging technology takes advantage of spectral and spatial information simultaneously. It fullls the requirement of nondestructive detection because the spectral information can express internal chemical characteristics. 6 Furthermore, the concentration of the internal chemical compounds can be determined rapidly by importing the feature spectral information into the regression models constructed previously. So, the detection method with hyperspectral imaging technology also satises the real-time requirement. Beyond the above merits, the chemical distribution characteristics can be observed visually by hyperspectral imaging. As it is so capable, hyperspectral imaging technology has been widely applied in the quality detection of food, 7 medicine, 8 and agriculture. 9 But no research on Dendrobium detection with hyperspectral imaging has been reported.
Throughout the processes of hyperspectral imaging technology, the core is to build precise and robust detection models. Up to now, there have been many classical modeling methods for employment, such as principal component regression (PCR), partial least squares regression (PLSR), 10 backpropagation neural network (BPNN), and radial basis function neural network (RBFNN). Among these classical methods, RBFNN and BPNN have the stronger ability to mine the nonlinear relationship between the input and output variables. 11,12 Both BPNN and RBFNN are qualied for the task of regression and classication simultaneously. And, RBFNN is more efficient in coefficients learning compared to BPNN. 13 Although RBFNN is an efficient tool, it is hard to identify the radial basis in the application with great quantity samples because both sparsity and completeness of radial basis must be guaranteed. 14 Besides the ingenious operation in model construction, the simplicity and representativeness of input variables also greatly affect modeling performance. Hence, it is necessary to select representative bands and eliminate the redundant information of spectra. Similar to the situation of modeling, many feature selection methods can be referenced. Some are intelligent swarm algorithms, such as genetic algorithm (GA) 15 and articial immune algorithm (AIA). 16 And some are mathematical methods, such as successive projections algorithm (SPA) 17 and uninformative variable elimination (UVE). 18 The intelligent swarm algorithms and mathematical methods have different places they are good at. In the traditional operation way, different feature selection methods are adopted individually or combined ramblingly. It is not conducive to exploiting the comprehensive advantages of the two kinds of methods.
This research focuses on the visual detection of MN and DP and categorization in Dendrobiums. During the mission of feature selection and model establishment, novel schemes were designed to improve performance. In addition, the inuence of habitat factors on MN and DP, and Dendrobium habitats clas-sication were studied.

Sample preparation and data acquisition
The Dendrobiums were collected from Anhui province (AH), Zhejiang province (ZJ), Guangxi province (GX), Yunnan province (YN), and Hunan province (HN) in April 2020. A total of 268 fresh samples were obtained. Before data acquisition, the leaves and roots of the Dendrobium samples were removed from the plants as the stem is the edible part. 19 Subsequently, the hyperspectral images of the stems were captured. Then, the stems were destroyed to determine their MN and DP concentrations.
A hyperspectral image acquisition system was used to capture the hyperspectral images. The system's illumination is provided by a linear light resource (Fiber-Lite DC 950, Dolan Jenner Industries Co., Ltd, USA). The system's hyperspectral camera (ImSpector V10E, SPECIM Spectral Imaging Oy Co., Ltd, Finland) worked in the range of 874-1734 nm, and the spectral resolution is 5 nm. The system captures hyperspectral images in a linear scanning mode, and the spatial resolution of each line is 320 pixels. During the hyperspectral image acquisition, the distance between the sample and the lens was set to 300 mm, the scanning speed was set to 17 mm s À1 , and the exposure time was set to 3 ms. The reference values of the MN and DP concentrations were determined by a high-performance liquid chromatography (HPLC) instrument (LC-16P, Shimadzu Co., Ltd, Japan). The purity of MN and DP standards (China Pharmaceutical Group Co., Ltd, China) is greater than 99%. Before HPLC determination, the stem esh was ground fully.
At last, 268 hyperspectral images and 268 Â 2 (chemical indexes) concentration values were acquired for analysis.

Model establishment and evaluation
PLSR and RBFNN were adopted to establish detection models. PLSR ts the relationship between the spectra and the concentration values by minimizing the square sum of tting errors. Specically, multiple regression analysis, principal component analysis, and correlation analysis are executed in the PLSR model establishing. 20 Aer principal component analysis and correlation analysis, the principal components with low collinearity and high representativeness were gured out by comprehensively taking the spectral information and concentration values into consideration. The multiple regression analysis of PLSR works on calculating the mapping coefficients from principal components to concentration values. However, RBFNN constructs the relationship between the spectra and the concentration values based on radial basis functions. The key parameters of the radial basis functions are function center C, function width s, and the number of the centers N. The parameters C and s shape the function with the formula B(X) ¼ exp(ÀkX À C 2 k/s), X is the input variable. All the radial basis functions synergistically determine the performance of RBFNN. The parameter s is generally determined by the location of the function centers with the formula s ¼ d/2N, d is the distance between different centers. According to the above description and formulas, it can be found that the parameters C and N are the most important. And some classical methods, such as K-means clustering, random selection, and orthogonal least squares, were proposed to get the function center C. For K-means clustering, it is hard to set the number of clustering centers properly. 21 For random selection, it is short of guidance. For orthogonal least squares, the number of function centers is set without reference either. 22 In an objective opinion, the function centers should be identied according to the distribution characteristics, and the distribution of the centers should be measured by the distance between the spectra of all samples. 23 Therefore, the Euclidean distances are calculated between all samples in this research, and a distance matrix is generated rst. Based on the distance matrix, the total distance to other samples is calculated for each sample. Then, all the samples are sorted according to their total distances. In light of the samples that clustering together in the vector space may have similar total distances and adjacent ranking points, the similarity of every two adjacent samples in the sorted sequence is calculated with the cosine formula, so a corresponding similarity sequence is generated. The samples with short total distance and sharply changed similarity are selected in turn to form the bases. Meanwhile, the modeling performance of RBFNN is evaluated continuously with the increase of centers, and the optimal number of function centers is identied according to the performance evaluation. The modied RBFNN with the above strategy can be applied to regression and classication tasks, so the classier of Dendrobium habitats is also established by the RBFNN.
During regression analysis, RMSE, R 2 , RPD are adopted to evaluate the modeling performance. The RMSE C and R C 2 are used to describe the model stability, while the RMSE P , R P 2 , and RPD are used to describe the model's predictive performance. For RMSE, the smaller, the better. For R 2 , the closer to 1, the better. For RPD, the bigger, the better. During classication analysis, the confusion matrix was adopted to evaluate the performance of classication models.

Feature bands selection
GA was proposed in the 1970s, and it has been applied in feature band selection of spectra for a long time. In GA, the spectrum of each sample is treated as a chromosome, and each band in the spectrum is treated as a gene. 24 Some chromosomes coded in binary form are selected to construct the initial population. The RBFNN model is introduced as the tness function to evaluate the chromosomes of the initial population. According to the evaluation results, the worst individuals are eliminated. The rest individuals exchange their gene sequences for renewing the population. In order to increase the genetic diversity, the mutation is performed on some genes aer chromosomal crossover. Then, the new population aer mutation is re-evaluated to select suitable individuals. The above operations are circularly executed until the population is satis-ed or the circular times run out. As each gene corresponds to a band, the genes in the nal population are counted to gure out the bands' importance. According to the bands' importance, the feature bands are nally identied. SPA is also a typical method to select feature bands, but it is quite different from the GA. It begins by identifying an initial feature band randomly, then projections from the rest bands to this initial feature band are calculated. 25 The band with the largest projection value is chosen to join the feature bands group. The projection will be circularly calculated until enough feature bands are selected.
The GA and SPA play different roles in the feature bands selection. GA is good at identifying the feature bands explicable in chemical groups. But, the incident of abundance oen occurs as the multiple adjacent bands may be assigned to the same function group. SPA has an inherent talent to eliminate the adjacency of feature bands as the projection distance between the adjacent bands is short. But, it is sensitive to the initial feature band.

Overview on spectra and chemical concentrations
The spectra of all samples are basically consistent in waveform (Fig. 1a). Namely, all the spectra own the same peaks and troughs. The NIR spectra are the overlap curves of the sum of overtones and combination bands from vibrational bands. Therefore, the similar NIR curves reect that the chemical compositions of all the samples are similar to each other. 26 The spectra of different samples show gradients at reectance. It means that the concentrations of the contents inside the samples are different. The average spectra from different habitats (Fig. 1b) exhibit different features at the spectral reectance. It illustrates that there are differences in concentrations of the functional contents between different habitats. Besides, the average spectra from different habitats are not equally spaced. In other words, there are obvious differences in the spectral waveforms between different habitats. This will contribute to classifying the habitats of the Dendrobiums. The statistics on MN (Fig. 1c) and DP (Fig. 1d) testify to the inference from Fig. 1b. The average chemical concentrations of different habitats are obviously different. In terms of MN concentration, the habitats are sorted as AH, ZJ, GX, HN, YN in descending order. In terms of DP concentration, the habitats are sorted as AH, ZJ, HN, GX, YN in descending order. As a whole, the Dendrobiums from AH are the best at both MN and DP concentrations. In contrast, the Dendrobiums from YN are not so satised. According to the above analysis, it is necessary to determine the concentration of the functional contents and classify the category for Dendrobium, and the spectral information provides the probability to accomplish the task.

Modeling analysis based on full-range spectra
The improper operation, instrument fault, or wrong record will cause outliers. And the outliers have a negative effect on the model establishment. So, outliers should be detected and eliminated rst. The common Monte Carlo sampling algorithm 27 was adopted to detect the outliers. The number of iterations was set to 20 000 in the execution of the algorithm. Aer all the iterations ran out, the mean and standard deviation (STD) of residuals were calculated for every sample. The sample with unnormal mean and STD was marked as the potential outlier (Fig. 2). If the model performance improves by eliminating the marked sample, the sample will be identied as the true outlier. Before outlier detection, we numbered every sample to nd out the outliers conveniently. By testing, the 142nd sample was le out in the regression model establishment of MN. Then the remained samples were divided into calibration set and prediction set at a ratio of 2 : 1 according to the K-S algorithm. 28 The PLSR models were rst built by the calibration set and tested by the prediction set to testify the feasibility of spectral detection on Dendrobiums. For both MN and DP, the R P 2 values of PLSR models are greater than 0.84 (Table 1). That means there's a strong relationship between the spectra and the concentrations. With the consideration that random noise and baseline dri is common in spectra acquisition, wavelet transform smooth 29 and rst derivative differential 30 were carried out on the spectra, respectively (Fig. 3). However, the modeling performance has not improved aer the pretreatments. Therefore, there is no apparent interference in the spectra acquisition, and further analysis is performed based on the raw spectra and RBFNN modeling method. Compared to PLSR models, the RBFNN models are better at stability and predictability. And, the better modeling performance of RBFNN mainly results from its powerful ability to dig out the nonlinear relationship between the spectra and the two chemical concentrations. Moreover, the RBFNN-modied models show evidently better performance than RBFNN-normal, so the scheme about function centers identication proposed in Section 2.2 is effective.

Modeling analysis based on feature bands and hyperspectral imaging
GA was rst carried out on the raw spectra to select the feature bands of MN and DP. The initial population was set to 50, and each chromosome was encoded in binary mode. The length of the binary string is equal to the number of spectral bands. In the binary string, '0' denotes the band at the corresponding position is not employed and '1' denotes the band is employed.
The crossover probability was set to 0.6, and a two-point crossover operator was adopted. The mutation rate was set to 0.01 to maintain the population diversity. Besides, the individual with the best performance was retained to the next generation directly by using external memory with elitism strategy. Aer 10 000 iterations, the feature bands of MN and DP are distributed as Fig. 4a and b. For both MN and DP, the phenomenon of feature bands adjacency can be observed. This principally results from that the feature bands selected by GA   (Fig. 4c), and the feature bands number of DP decreased from 57 ( Fig. 4b) to 14 (Fig. 4d). Compared with the RBFNN-modied modeling results based on full-range spectra (Table 1), the RBFNN-modied modeling results based on feature bands (Table 2) remain stable. For MN, the modeling performance improved slightly. While, for DP, the modeling performance decreased slightly. But due to the input variables' number decreasing greatly, the work efficiency of the model was deeply improved.
In the interest of obtaining the high-quality distribution maps of MN and DP concentrations, the raw hyperspectral image was masked with its binary image (Fig. 5a) rst to remove the background. Aer background segmentation, the average spectrum of each single-connected region (Fig. 5b) was calculated to compress the tremendous uctuation of the spectra belonging to different pixels. Then the GA-SPA feature bands of the adjusted spectra were input into the corresponding RBFNN model. At last, the distribution maps of MN (Fig. 5c) and DP (Fig. 5d) concentrations were generated. The difference in MN and DP concentrations between different Dendrobiums can be observed clearly. Besides, differences in different parts of the same individual are also exhibited.

Habitats classication analysis
PCA was rst performed to evaluate the feasibility of habitats classication. The rst three PCs were employed to construct a 3-D scatter plot (Fig. 6a). It can be found that the distribution of samples from HN is rather dispersed in the space. For the rest four habitats, the samples cluster together. Even though the 3-D space was rotated at different angles, it is hard to divide the samples from different habitats in vision. Therefore, more PCs need to be employed to build the classier. Before the classier establishment, the samples were divided into calibration set and prediction set at a ratio of 2 : 1 for each habitat. The calibration set was used to train the classier, and the prediction set was used to test the classier. RBFNN method was adopted to build the classier. But unlike the regression task, the centers of the RBFNN used for classication consisted from the PCs of the spectra. By increasing the PCs one by one, the optimal PCs number is identied as 12. Finally, the total classication accuracy of the calibration set got 0.966, and the total classication accuracy of the prediction set got 0.887. The confusion matrix of the prediction set is shown in Fig. 6b. The HN and GX are easily confused with each other. Four HN samples were incorrectly classied as GX, and one GX sample was wrongly  classied as HN. There is misclassication between AH and ZJ. These two cases can be explained by the statistics of MN and DP concentrations ( Fig. 1c and d). The HN and GX are close at the concentrations, and AN and ZJ are close. As exceptions, one ZJ sample was misclassied as YN, and two YN samples were misclassied as AH. But, taken as a whole, it is feasible to classify the habitats of Dendrobiums based on RBFNN and spectral information. On the whole, the classication accuracy is not so excellent. It mainly results from that the habitat factor actually contains many sub-factors. And, each sub-factor, such   as irrigation, fertilization, or soil condition, may vary highly. So, plant conditions need to be studied precisely to improve the classication accuracy.

Conclusion
This research provides a complete scheme to determine the mannose and Dendrobium polysaccharides in Dendrobiums visually and nondestructively. The scheme will make signicance to optimize the postharvest pretreatment, like processing, storage, and transportation of Dendrobiums. In the nondestructive detection scheme, some specic issues of chemometrics were studied. For the Dendrobiums with various factors, the matrix is quite different at chemical composition, especially the concentration of the main components. As the spectra can reect the internal chemical features of plant, the Dendrobiums will exhibit individual spectral characteristics. That will bias the determination of the mannose and Dendrobium polysaccharides. Therefore, we designed a creative radial bases identication method for RBFNN to build the accurate mapping relationship between the spectra and the polysaccharide components. Moreover, we developed a novel strategy that used GA and SPA comprehensively to select the feature bands efficiently, and the model was greatly simplied, but the modeling performance still keeps stable. These will enrich the theory in RBFNN construction and feature bands selection. In addition, the habitats classication of Dendrobiums was also investigated. As the habitats have a strong connection to the products' quality and brand protection, the investigation of habitats classication will make assistance in standardizing the market of Dendrobiums.
Although some creative work has been done, there are many other issues need to be researched to perfect the scheme and promote the practical application. First, we didn't set an experiment to explore the upper and lower bounds of detection range and the minimum variance of polysaccharide components which can be captured by the detection model. But, in some situations, such as drug development which needs to control the concentration of MNs and DPs precisely, it is important to clarify the sensitivity of the method proposed in this research. Second, we didn't discuss the interference from detection environment and sample discrepancy. In the real production, the detection environment is complicate and the categories of Dendrobiums are far more than three. We need to optimize the scheme to reduce the environment interference and improve the model transferability on different categories.

Conflicts of interest
There are no conicts of interest to declare.