Method for detecting total flavonoids content of ginkgo biloba leaves by hyperspectral imaging

By using hyperspectral imaging technology and regression models, the time-consuming and labor-intensive problems of traditional detection methods have been solved, enabling non-destructive and rapid detection of total flavonoid content in ginkgo leaves, improving detection accuracy, and supporting the precise production and management of ginkgo leaves.

CN116008225BActive Publication Date: 2026-03-31NANJING FORESTRY UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-13
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Existing methods for detecting total flavonoid content in ginkgo leaves are time-consuming, labor-intensive, and require damaging the leaves, making non-destructive testing impossible.

Method used

Hyperspectral imaging technology was used, combined with partial least squares regression (PLSR) and support vector regression (SVR) to establish a prediction model based on the full band and characteristic bands, and the total flavonoid content of Ginkgo biloba leaves was detected in a non-destructive manner.

Benefits of technology

This method enables rapid and non-destructive detection of total flavonoid content in ginkgo leaves, improving detection accuracy, meeting actual production needs, and providing technical support for the precise production and management of ginkgo leaves.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116008225B_ABST
    Figure CN116008225B_ABST
Patent Text Reader

Abstract

A hyperspectral imaging ginkgo leaf total flavonoid content detection method, steps include: 1) first, the spectral image of ginkgo leaf is collected;2) then, the spectral image is processed;3) finally, the total flavonoid content of leaf is detected by the spectral image of leaf through the total flavonoid content prediction model;The prediction model is the prediction model established based on full wave band and characteristic wave band respectively by using partial least squares regression method PLSR and support vector regression method SVR;The present application can meet the actual production needs, thereby providing technical support and theoretical basis for accurate production and management of leaf ginkgo;The present application provides a new method for rapid, non-destructive and random detection of leaf ginkgo, thereby providing technical support and theoretical basis for accurate production, management and cultivation of leaf ginkgo.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of non-destructive testing technology, specifically a hyperspectral imaging method for detecting the total flavonoid content in ginkgo leaves. Background Technology

[0002] In existing technologies, ginkgo leaves have significant medicinal value, with total flavonoid content being a crucial indicator. Traditional methods for detecting flavonoids in ginkgo leaves involve destroying the leaves and then calculating the total flavonoid content using physicochemical experiments and the methods outlined in the Chinese Pharmacopoeia. This method is time-consuming, labor-intensive, and requires leaf destruction. Summary of the Invention

[0003] To address the aforementioned problems in existing technologies, this invention investigates a detection method based on hyperspectral imaging and proposes a method for detecting the total flavonoid content in ginkgo leaves using hyperspectral imaging, comprising the following steps:

[0004] 1) First, collect spectral images of ginkgo leaves;

[0005] 2) Then process the spectral image;

[0006] 3) Finally, the total flavonoid content prediction model of leaves was used to detect the total flavonoid content of leaves through spectral images;

[0007] The prediction model is based on partial least squares regression (PLSR) and support vector regression (SVR), respectively, and is established based on the full band and characteristic band.

[0008] In establishing the prediction model for this method, the spectral images of Ginkgo biloba leaf samples and the total flavonoid content obtained through physicochemical testing were used as the dataset, which was then divided into a test set and a training set. Partial least square regression (PLSR) and support vector regression (SVR) prediction models based on the full wavelength range and characteristic wavelength ranges were established using these datasets. The models were analyzed, and the optimal PLSR prediction model based on the GA algorithm for extracting characteristic wavelengths was ultimately selected as the spectral feature prediction model used in this detection method.

[0009] During model analysis:

[0010] Compared to the visible near-infrared band, short-wave near-infrared is more suitable for predicting the total flavonoid content of ginkgo leaves;

[0011] Compared to the SVR model, the PLSR model has higher accuracy in predicting the content of flavonoids in ginkgo leaves;

[0012] Selecting feature wavelengths based on SPA can effectively improve the prediction performance of the prediction model, among which the SPA-PLSR model with 40 feature wavelengths has the best performance.

[0013] Compared to the SPA algorithm, the prediction model built using the GA-based feature extraction method has higher accuracy, and its training set... and The concentrations were 0.8532 and 0.5403 mg / g, respectively, in the training set. and The values ​​were 0.8482 and 0.2967 mg / g, respectively, which is the most ideal method for predicting the flavonoid content in ginkgo leaves.

[0014] Compared with the full-band prediction model, the model based on characteristic wavelengths can better predict the total flavonoid content of Ginkgo biloba leaves, with the extraction of characteristic wavelengths in the range of 1100-1200nm and 1400-1500nm being more ideal.

[0015] This invention can meet the needs of actual production, thus providing technical support and theoretical basis for the precise production and management of Ginkgo biloba leaves.

[0016] This invention provides a novel method for rapid, non-destructive, and random testing of Ginkgo biloba leaves, thus providing technical support and theoretical basis for the precise production, management, and cultivation of Ginkgo biloba leaves. Attached Figure Description

[0017] Figure 1 This is a flowchart illustrating the detection method.

[0018] Figure 2 It is the average gray value of the standard reflectivity plate image;

[0019] Figures 3a-3d It consists of a spectral image and a region of interest image;

[0020] Figure 3a It is the mean spectral curve in the visible and near-infrared bands;

[0021] Figure 3b This is the spectral image of the 50th channel of the near-infrared spectrum;

[0022] Figure 3c It is a visible and near-infrared region of interest template image;

[0023] Figure 3d It is a near-infrared region of interest template image;

[0024] Figure 4a It is the mean spectral curve in the visible and near-infrared bands;

[0025] Figure 4b It is the mean spectral curve of the shortwave near-infrared band;

[0026] Figure 5a and Figure 5b This refers to the optimal performance of the GA-PLSR prediction model and the selected characteristic bands.

[0027] Figure 5a This indicates the change in root mean square error;

[0028] Figure 5b Indicates the characteristic wavelength.

[0029] Specifically, the implementation method

[0030] This invention, based on the construction of a hyperspectral detection system encompassing the visible near-infrared (VIS / NIR) and short-wave near-infrared (SWNIR) bands, acquires spectral images in the 400–1700 nm spectral range, establishes a predictive model for spectral information and the content of flavonoids in ginkgo leaves, and compares and studies models suitable for predicting the flavonoid content in ginkgo leaves. The method for selecting characteristic wavelengths is studied to optimize and improve the predictive performance of the model, thereby establishing a new method for detecting the flavonoid content in ginkgo leaves suitable for practical needs, and providing technical support and theoretical basis for the precise production and management of ginkgo leaves.

[0031] The detection method will be further explained below with reference to specific implementation methods.

[0032] 1. Materials and Methods

[0033] 1.1 Hyperspectral Imaging System

[0034] In this embodiment, the image acquisition platform is built with reference to Chinese patent "2020217166768, Image Acquisition Platform for Hyperspectral Non-destructive Testing of Food in Multi-Light Source Environment".

[0035] The image acquisition platform uses one pushbroom-type visible-near-infrared hyperspectral camera (GaiaField-V10E-AZ4) and one near-infrared hyperspectral camera (GaiaField-N17E), along with two dome lighting systems. It also utilizes an acquisition computer (T570, Lenovo, China), an uninterruptible power supply (C3k, Santak, China), and a transport platform. Each camera is equipped with an identical lighting system containing 12 halogen bulbs (Philips, 50W halogen 12V), powered by a stable UPS.

[0036] The leaf is placed on a black rubber stage, and images are acquired as the sample passes through the camera's line-scanning area. The light source system uses reflective dome illumination, directly shining halogen lamps onto the dome to provide the sample with soft, uniform diffuse illumination, thereby reducing external interference and minimizing moisture loss caused by the high temperature from direct light. This system can acquire reflectance spectral images of the measured object in the range of 400–1700 nm.

[0037] In addition, the data processing and model building in this embodiment were all completed using Matlab R2017b (The MathWorks Inc., USA) software.

[0038] 1.2 Materials

[0039] The ginkgo leaves used in this embodiment were harvested from a ginkgo nursery in Pizhou City, Jiangsu Province, and were all from native seedlings aged 2 to 5 years. The leaves were stored in an insulated box at a temperature of 4 degrees Celsius and transported to a non-destructive testing laboratory for image acquisition and total flavonoid content detection.

[0040] 1.3 Determination of total flavonoid content in leaves

[0041] Weigh the ginkgo leaves and place them in an oven until they reach a constant weight. Crush the dried leaves into powder and place them in a round-bottom flask. Add 5 ml of 25% hydrochloric acid and 30 ml of methanol, and reflux in a water bath at 80°C for 1.5 hours. Filter out the residue, take the filtrate into a volumetric flask, and add methanol to 50 ml after the temperature has stabilized.

[0042] The standards used in this embodiment are quercetin, kaempferol, and isorhamnetin. Using a balanced equilibrium, 5.7 mg of quercetin, 5.7 mg of kaempferol, and 2.1 mg of isorhamnetin were weighed and dissolved in 100 ml of methanol solution. 50 ml, 20 ml, 10 ml, 5 ml, 2 ml, and 1 ml of each solution were then diluted to 50 ml, filtered through a filter membrane, and placed in chromatographic vials for analysis. Three replicates of the standards were prepared to ensure the reliability of the experimental data.

[0043] The total flavonoid content of standards and experimental samples was determined using a high-performance liquid chromatograph (Alliance E2695, Waters, USA). The column temperature was 30°C, the detection wavelength was 254 nm, the mobile phase was methanol-0.1% formic acid solution (1:1), the flow rate was 1 ml / min, and the injection volume was 10 μL.

[0044] According to the calculation method of total flavonoid content in the Chinese Pharmacopoeia, the total flavonoid content of ginkgo leaves is expressed by adding the contents of quercetin, kaempferol and isorhamnetin in the leaves and then multiplying by 2.51.

[0045] 1.4 Acquisition and Processing of Spectral Data

[0046] 1.4.1 Acquisition of Spectral Images

[0047] The light source system was turned on for preheating, and the illuminance meter (TES-1339, TES, China) was placed within the camera's field of view. Image acquisition was performed after the illuminance count stabilized. The hyperspectral images acquired by the visible-near-infrared hyperspectral camera had a resolution of 669×800, a spectral range of 336.20–1092.50 nm, and a spectral interval of 5.5 nm, generating a 150-channel spectral image per scan. The spectral images acquired by the short-wave near-infrared hyperspectral camera had a resolution of 550×640 nm, a spectral range of 874.00–1731.00 nm, and a spectral interval of 1.70 nm, generating a spectral image with 512 bands per scan.

[0048] 1.4.2 Spectral Curve Extraction

[0049] The prediction model is built using hyperspectral imaging, primarily by extracting useful spectral information from the spectral image, i.e., the Region of Interest (ROI), for modeling. Obtaining the ROI involves transforming the initial local region into a global region. This invention uses a threshold segmentation method based on the difference in reflectance between the leaf and the background region to obtain the complete ROI of the leaf. The reflectance values ​​of the pixels within the ROI are averaged to obtain an average spectral curve containing all channels of each sample. The calculation formula is as follows:

[0050] (1)

[0051] In the formula Representing the Average reflectance spectrum of each channel Representing the The reflectance spectrum of pixels within each channel Representing the The number of pixels within the region of interest for each channel.

[0052] 1.4.3 Spectral Image Reflectance Correction

[0053] While acquiring the sample spectral images, standard reflectance plates (Labspere, USA) at 2%, 5%, 10%, 20%, 50%, 75%, and 99% reflectance, as well as black frame images, were acquired respectively for reflectance correction of the sample images to eliminate the influence of illumination and camera dark current on the images. The correction formula is as follows:

[0054] (2)

[0055] In the formula This represents the corrected reflectance spectrum image. Represents the original spectral image acquired. The spectral image represents a low-standard reflectivity plate. The spectral image represents a high-standard reflectivity plate. This represents the standard correction factor for the corresponding standard reflectivity plate.

[0056] 1.5 Feature Wavelength Extraction

[0057] Hyperspectral images exhibit high correlation between adjacent bands, leading to collinearity and data redundancy issues. To shorten the time required to build a prediction model, reduce the dimensionality of spectral data, and improve model prediction performance, this invention employs a genetic algorithm (GA) and a successive projection algorithm (SPA) for feature wavelength selection to obtain more ideal feature wavelengths and find suitable wavelengths for detecting the content of flavonoids in ginkgo biloba leaves. The SPA algorithm is a forward loop feature variable selection method that can analyze collinearity between various bands to find the most representative feature wavelengths. The GA algorithm is a method that searches for optimal solutions by simulating a natural evolutionary process. This method encodes each channel, establishes a corresponding fitness function, and obtains the band with the best fitness through selection, crossover, and mutation.

[0058] 1.6 Model and Evaluation

[0059] 1.6.1 Model

[0060] This invention employs Partial Least Squares Regression (PLSR) and Support Vector Regression (SVR) to establish predictive models based on the full wavelength range and characteristic wavelength ranges, respectively. Through comparison, an ideal predictive model for the flavonoid content of Ginkgo biloba leaves was determined. PLSR is a linear regression model widely used in spectral analysis, capable of simultaneously extracting variable features, analyzing correlations between variables, and performing regression modeling; it is one of the most widely used methods in the field of spectral analysis. SVR is a regression method that uses kernel functions to transform nonlinear problems into linear problems, solving the problem by minimizing the support vector margin. This method can be applied to the study of both linear and nonlinear problems.

[0061] 1.6.2 Model Evaluation

[0062] This invention uses the root mean square error (RMSE). ) and the coefficient of determination As a metric for evaluating model performance, the root mean square error of the training set is used as the model loss function. Generally speaking, The smaller the value, the smaller the overall deviation between the predicted and actual values; The larger the value, the better the fit between the predicted and actual values.

[0063] 2 Results and Analysis

[0064] 2.1 Physicochemical Testing and Dataset Division

[0065] A total of 140 ginkgo leaf samples were collected in this embodiment, with 138 valid samples. The total flavonoid content of the leaves in the four years is shown in Table 1. The mean value of the leaves in the four years ranged from 2.0652 to 2.8128 mg / g, which is within the normal range for total flavonoid content in ginkgo leaves. The hold-out method was used to divide the ginkgo leaf data from the four years into two parts: a training set and a test set. 104 samples were used in the training set, and 34 samples were used in the test set, as shown in Table 2. The mean and standard deviation of the training set and the test set remained at similar numerical levels and distributions.

[0066] Table 1. Statistical results of total flavonoid content in ginkgo leaf samples from different years.

[0067]

[0068] Table 2. Statistical results of total flavonoid content in Ginkgo leaf samples from training and test sets.

[0069]

[0070] 2.2 Spectral Data Analysis

[0071] 2.2.1 System reflectivity calibration

[0072] This method acquired spectral images of various standard reflectivity plates. During image acquisition, the standard reflectivity plate filled the entire field of view to ensure the acquired data was not interfered with by other factors. The average grayscale value (e.g., the average grayscale value of the standard reflectivity plate image and the black frame from the short-wave near-infrared camera) was calculated. Figure 2 As shown (in the diagram), under consistent illumination, the average grayscale value of the image steadily increases with the reflectivity value of the standard reflectivity plate. However, this increasing trend does not apply to the head and tail bands; the grayscale value of the black frame is significantly higher than that of the reflectivity plate image. To enable the use of more standardized data for reflectivity correction, this embodiment selects 2% and 75% reflectivity plates as standard data for reflectivity correction.

[0073] 2.2.2 Spectral Analysis of Ginkgo Leaves

[0074] After reflectance correction of the sample spectral images, considering the significant difference in spectral reflectance characteristics between the sample background region and the region of interest at specific wavelengths, this paper employs a threshold segmentation algorithm to extract the leaf region of interest from the image. For example... Figure 3a As shown, the spectral images of the background region and the region of interest in the near-infrared band exhibit significant differences between bands 70 and 150. The spectral reflectance of the background region is less than 0.1, while the spectral reflectance of the region of interest is between 0.2 and 0.4. Therefore, the region of interest is extracted in channel 90 with a threshold of 0.2. Similarly, as... Figure 3b As shown, in the shortwave near-infrared band, the background and region of interest differ significantly between channels 1 to 150. Therefore, channel 50 was selected for region of interest extraction with a threshold of 0.2. Figure 3c and Figure 3d These are region-of-interest template images extracted from the visible near-infrared and short-wave near-infrared bands, respectively.

[0075] Using a region-of-interest template, the 3D hyperspectral image was converted into a mean spectral curve. After removing the noisy beginning and end spectra in the short-wave near-infrared band, the remaining 1058–1599 nm range was shown in Figure 4. The figure shows that the overall mean spectral trend of the leaves remains consistent, indicating good consistency among the collected spectral images. Furthermore, the mean spectral values ​​of different samples show some differences, indicating that there are variations among the collected samples and that the data has strong generalization ability.

[0076] 2.3 Establishment of a predictive model for total flavonoid content in Ginkgo biloba leaves

[0077] 2.3.1 Full-band prediction model

[0078] Partial least squares regression and support vector regression were used to establish prediction models for total flavonoid content on visible near-infrared and short-wave near-infrared spectral data, respectively. The performance of the best regression model is shown in Table 3.

[0079] Table 3 Performance of the full-band prediction model

[0080]

[0081] In the modeling process, partial least squares regression (PLSR) uses k-fold cross-validation to validate the training set. To reduce overfitting during training, the number of cross-validations is set to 5. PLSR prediction models with principal component counts ranging from 1 to 50 are established, and the performance of models with different principal component counts is compared to select the best result. As shown in Table 3, in the visible and near-infrared bands, the model's fitting effect on the training set gradually improves with increasing principal component count, and on the test set... First increase, then decrease; the model performance peaks when the principal component count is 4. Therefore, the optimal principal component count for the visible and near-infrared bands is 4, and the training set... and The concentrations were 0.4329 and 0.6771 mg / g, respectively, for the test set. and The concentrations were 0.3013 and 0.8758 mg / g, respectively. In the short-wave near-infrared band, the same method was used to select the optimal number of principal components; the optimal model had 10 principal components. The training set... and The concentrations were 0.6180 and 0.6371 mg / g, respectively, for the test set. and The values ​​were 0.5496 and 0.6384 mg / g, respectively. It can be observed that in the visible and near-infrared bands, the model reaches its optimal state with a principal component count of 4. As the principal component count increases further, the model gradually begins to overfit. The fact that the PLSR model enters an overfitting state in the initial stage indicates that this model has difficulty predicting the total flavonoid content in the visible and near-infrared bands (the accuracy of predicting flavonoid content in the visible and near-infrared bands is low). In the short-wave near-infrared band, the model reaches its optimal state with a principal component count of 13. Compared to the former, this method can extract more principal components and utilize more spectral information when building the model. Therefore, spectral data in the short-wave near-infrared band are more suitable for building a PLSR model for total flavonoid content.

[0082] In building a prediction model based on support vector regression, a grid search method is used to obtain the optimal performance model parameters. In the visible and near-infrared bands, the training set... and The concentrations were 0.5322 and 0.5879 mg / g, respectively, for the test set. and The concentrations were 0.2312 and 0.9354 mg / g, respectively. In the short-wave near-infrared band, the training set... and The concentrations were 0.5567 and 0.5063 mg / g, respectively, in the training set. and The values ​​were 0.3113 and 0.6836 mg / g, respectively. This demonstrates that the short-wave near-infrared band prediction model established based on this method has higher accuracy.

[0083] In summary, the PLSR model outperforms the SVR model in both the visible and near-infrared bands, making the PLSR model more suitable for predicting total flavonoid content. Comparative studies show that the short-wave near-infrared band is superior to the visible and near-infrared band in predicting the flavonoid content of Ginkgo biloba leaves.

[0084] 2.3.2 Prediction Model Based on Characteristic Wavelength

[0085] To improve the running speed and further enhance the prediction accuracy of the prediction model, this invention establishes a prediction model based on characteristic wavelengths using the least squares method, and studies the impact of characteristic wavelength extraction methods on prediction accuracy. In the short-wave near-infrared band, this invention sets a specified wavelength of 60 nm and selects characteristic wavelengths based on the GA and SPA methods. Modeling is performed when the number of characteristic wavelengths is 20, 30, 40, 50, and 60, respectively. The model performance is shown in Table 4.

[0086] Table 4 Performance of the Feature Band Prediction Model

[0087]

[0088] The SPA algorithm is a method for eliminating redundant information between bands. As shown in the table, on both the training and test sets, the performance of the five SPA-PLSR models is improved compared to the PLSR model. Extracting feature wavelengths through SPA can reduce data redundancy and improve the performance of the prediction model. Among them, the SPA-PLSR model using 40 feature wavelengths performs best, and its training set... and The concentrations were 0.6533 and 0.5857 mg / g, respectively, for the test set. and The values ​​were 0.6286 and 0.6944 mg / g, respectively.

[0089] Compared to SPA, the GA algorithm is a supervised learning algorithm that minimizes the prediction model. To extract feature wavelengths, this invention employs the GA algorithm to select feature wavelengths and establish a PLSR model. In each iteration, the PLSR model with the best principal components is selected. The cost function is used for 2000 iterations. The data in the table shows that the model performance is worst when the number of feature wavelengths is 20. As the number of feature wavelengths increases, the model performance gradually improves, reaching its optimal value when the number of feature wavelengths is 50. and The concentrations were 0.8532 and 0.5403 mg / g, respectively, for the test set. and The values ​​were 0.8482 and 0.2967 mg / g, respectively. This indicates that when using GA-PLSR to predict the total flavonoid content of Ginkgo biloba leaves, the number of characteristic wavelengths should not be too small. Compared with the prediction model established by PLSR, the performance of the GA-PLSR model is significantly improved. Figure 5a For the test set of GA-PLSR with genetic evolution The model's accuracy increases with the number of iterations, stabilizing at 1700 iterations. Figure 5b The characteristic bands selected for the final GA-PLSR prediction model show that they are mainly concentrated in the ranges of 1100–1200 nm and 1400–1500 nm. Spectral data within these bands can effectively predict the total flavonoid content of Ginkgo biloba leaves.

[0090] Although GA is a very time-consuming and computationally intensive algorithm, and this experiment took a total of 7 days to complete the calculation of 5 characteristic wavelengths, the characteristic wavelength prediction model based on GA has a significantly improved accuracy compared to the full-band prediction based on PLSR and the characteristic wavelength prediction based on SPA extraction. It is the most ideal model for predicting the total flavonoid content of Ginkgo biloba leaves.

[0091] 3. Conclusion

[0092] This invention proposes a novel non-destructive method for detecting the total flavonoid content in Ginkgo biloba leaves based on hyperspectral imaging, and draws the following conclusions:

[0093] 1) Compared with the visible and near-infrared bands, the short-wave near-infrared band is better at predicting the content of flavonoids in ginkgo leaves;

[0094] 2) Compared to the SVR model, the PLSR model has higher accuracy in predicting the content of flavonoids in ginkgo leaves. On shortwave near-infrared spectral data, the PLSR model training set... and The concentrations were 0.7683 and 0.5563 mg / g, respectively, in the training set. and The concentrations were 0.5496 and 0.6384 mg / g, respectively.

[0095] 3) Compared with the full-band prediction model, the model based on characteristic wavelength can better predict the total flavonoid content of Ginkgo biloba leaves. Among them, the extraction of characteristic wavelengths in the range of 1100-1200nm and 1400-1500nm is more ideal.

[0096] 4) Selecting feature wavelengths based on SPA can effectively improve the prediction performance of the prediction model. Among them, the SPA-PLSR model with 40 feature wavelengths has the best performance, and its training set... and The concentrations were 0.6533 and 0.5857 mg / g, respectively, for the test set. and The values ​​were 0.6286 and 0.6944 mg / g, respectively.

[0097] 5) Compared to the SPA algorithm, the prediction model built using the GA-based feature extraction method has higher accuracy, and its training set... and The concentrations were 0.8532 and 0.5403 mg / g, respectively, in the training set. and The values ​​were 0.8482 and 0.2967 mg / g, respectively, which is the most ideal method for predicting the flavonoid content in ginkgo leaves.

[0098] This invention provides a novel method for rapid, non-destructive, and random testing of Ginkgo biloba leaves, thus providing technical support and theoretical basis for the precise production, management, and cultivation of Ginkgo biloba leaves.

Claims

1. A hyperspectral imaging method for detecting the content of total ginkgo leaf flavonoids in ginkgo leaves, characterized by the following steps The method comprises the following steps: 1) collecting spectral images of ginkgo leaves; 2) processing the spectral images; 3) detecting the total flavonoid content of the leaves by using a total flavonoid content prediction model and the spectral images of the leaves; The prediction model is a prediction model established based on full wave band and characteristic wave band by using partial least squares regression (PLSR) and support vector regression (SVR); In the process of establishing the prediction model, the model evaluation is using the root mean square error and the coefficient of determination As an index to evaluate the performance of the model, the root mean square error of the training set is used as the model loss function; The smaller, the overall deviation between the predicted value and the actual value is smaller; The greater, the higher the fitting degree of the predicted value and the actual value; The steps of establishing and evaluating the prediction model comprise: 3.1) full wave band prediction model and evaluation The total flavonoid content prediction model is established on the spectral data of visible near-infrared and short wave near-infrared by using PLSR and SVR; a, PLSR prediction model In the modeling process, the training set is verified by using k-fold cross-validation, and the number of cross-validation is set to 5; the PLSR prediction model with the principal component number from 1 to 50 is established, and the best result is selected by comparing the performance of the models with different principal component numbers; In the visible and near-infrared band, with the increase of the number of principal components, the fitting effect of the training set of PLSR prediction model gradually improves, and on the test set First increase and then decrease; when the number of principal components is 4, the performance of the PLSR model is the highest, so the optimal model principal component number selected in the visible and near-infrared band is 4, and the and and the test set and ; In the short wave near infrared band, the same method as in the visible near infrared band was used to select the optimal principal component number, the principal component number of the optimal model was 10, the training set was obtained and and the test set was obtained and ; After analysis and comparison: In the visible near-infrared wave band, the PLSR prediction model reaches the best when the principal component number is 4, and when the principal component number is further increased, the PLSR prediction model gradually starts to tend to overfitting, and the PLSR prediction model enters the overfitting state in the initial stage, which indicates that the model is difficult to predict the total flavonoid content in the visible near-infrared wave band; In the short wave near-infrared wave band, the PLSR prediction model reaches the best when the principal component number is 13, and relatively, the PLSR prediction model extracts more principal components, and more spectral information can be applied when the model is established; Conclusion: The spectral data of the short wave near-infrared wave band is more suitable for establishing the PLSR model of the total flavonoid content; b, SVR prediction model In the modeling process, the best performance model parameters are obtained by using grid search; In the visible near-infrared band, the training set is obtained and and the test set is obtained and ; In the short-wave near-infrared band, the training set is obtained and The test set is obtained and ; After analysis and comparison: The SVR prediction model in the short wave near-infrared wave band has higher precision; In the visible near-infrared and short wave near-infrared wave bands, the performance of the PLSR prediction model is better than that of the SVR prediction model, and the PLSR prediction model is more suitable for the prediction of the total flavonoid content; at the same time, the performance of the short wave near-infrared wave band in predicting the flavonoid content of the ginkgo leaves is better than that of the visible near-infrared wave band; 3.2) prediction model based on characteristic wavelength The prediction model based on characteristic wavelength is established by selecting PLSR based on least squares in step 3.1); In the short wave near infrared band, the specified wavelength is set as 60, the characteristic wavelengths are screened based on the GA and SPA methods, the PLSR prediction models are established when the number of characteristic wavelengths is 20, 30, 40, 50 and 60 respectively, the PLSR and SVR prediction models established based on the GA and SPA methods are defined as the SPA-PLSR prediction model and the GA-PLSR prediction model respectively, the and of the training set of each prediction model are obtained and of the test set are obtained. After analysis and comparison: The performance of the SPA-PLSR model with 5 characteristic wavelength numbers is better than that of the PLSR model; and the performance of the SPA-PLSR model with 40 characteristic wavelength numbers is optimal; The GA algorithm is used to select characteristic wavelengths and establish a PLSR model to obtain a GA-PLSR prediction model. In each iteration process, the PLSR model of the best principal component in step 3.1) is selected as the cost function; Comparative analysis: GA-PLSR prediction model performance is the worst when the number of characteristic wavelengths is 20, and the model performance gradually improves with the increase of the number of characteristic wavelengths, and the best performance is achieved when the number of characteristic wavelengths is 50; compared with the GA-PLSR model, the performance of the GA-PLSR model is greatly improved; the GA-PLSR prediction model changes with the test set of genetic evolution With the increase of the number of iterations, the accuracy of the model is constantly improved until it is stable; for the GA-PLSR prediction model, the selected characteristic wavelength range is 1100-1200 nm and 1400-1500 nm, and the effect of predicting ginkgo leaf total flavonoids is optimal.

2. The method for detecting the content of total ginkgo leaf flavonoids in ginkgo leaves for foliage according to claim 1, characterized in that In step 1), when the image is collected, the spectral image reflectivity is calibrated first, and the method is as follows: while collecting the spectral images of the samples, 2%, 5%, 10%, 20%, 50%, 75% and 99% standard reflectivity plates and a black frame image are collected respectively, which are used for reflectivity correction of the sample images to eliminate the influence of light and camera dark current on the images, and the correction formula is as follows: , wherein represents the corrected reflectance spectral image, represents the acquired original spectral image, represents the acquired spectral image of the low standard reflectance plate, represents the acquired spectral image of the high standard reflectance plate, represents the standard correction coefficient corresponding to the standard reflectance plate.

3. The hyperspectral imaging method for total ginkgo leaf flavone content detection according to claim 1, characterized in that In step 3), the selection method of the training set c and the test set p data required for establishing the prediction model is as follows: Physicochemical detection is performed on the ginkgo leaf sample to obtain the total flavonoid content of the sample; meanwhile, the ginkgo leaf sample is subjected to image acquisition by steps 1) and 2) to obtain the spectral image of the sample; The ginkgo leaf sample is divided into a training set c and a test set p, which are used for the establishment of the prediction model in step 3).

4. The method for detecting the content of total ginkgo leaf flavonoids in ginkgo leaves for foliage according to claim 1, characterized in that In step 2), the processing of the spectral image comprises: obtaining a region of interest (ROI) by threshold segmentation according to the difference in reflectivity between the leaf and the background region. The reflectivity values of the pixels in the region of interest are averaged to obtain an average spectral curve containing all channels for each sample , , In the formula representing the average reflectance spectrum of the first channel, representing the reflectance spectrum of the pixel in the first channel, representing the number of pixels in the region of interest in the first channel.

5. The hyperspectral imaging method for total ginkgo leaf flavone content detection of ginkgo leaves for tea according to claim 1, characterized in that In step 1), the visible near-infrared spectral image is acquired by a near-infrared hyperspectral camera, and the spectral range is 336.20-1092.50 nm; the short-wave near-infrared spectral image is acquired by a short-wave near-infrared hyperspectral camera, and the spectral range is 874.00-1731.00 nm.

6. The method for detecting the content of total ginkgo leaf flavonoids in ginkgo leaves for foliage according to claim 1, characterized in that In step 3), the spectral feature prediction model based on characteristic wavelength screening is a PLSR prediction model based on GA algorithm for extracting characteristic wavelengths, which is defined as a GA-PLSR model.