A method for nondestructive identification of under-forest ginseng age based on convolutional neural network model and near-infrared hyperspectrum
By using convolutional neural network models and near-infrared hyperspectral technology, the high cost and destructive nature of identifying the age of ginseng under forest cover have been solved, enabling rapid, non-destructive, and accurate identification of the age of ginseng under forest cover.
Patent Information
- Application Number
- CN202310476219.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-28
- Publication Date
- 2025-12-30
- Estimated Expiration
- 2043-04-28
AI Technical Summary
Existing methods for identifying the age of ginseng from forests are costly, time-consuming, and highly destructive to the samples, with poor repeatability. Traditional appearance identification is highly subjective and cannot achieve high-precision, non-destructive identification.
A convolutional neural network model based on near-infrared hyperspectral imaging was used to establish a convolutional neural network model for non-destructive identification of forest ginseng through radiometric correction, region of interest extraction, hybrid noise reduction, and feature band extraction.
It enables rapid, non-destructive, and accurate identification of the age of ginseng grown in forests, improving identification accuracy and reducing costs and time consumption.
Smart Images

Figure CN116503653B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of non-destructive identification technology of forest ginseng age, specifically involving a non-destructive identification method for forest ginseng age based on a convolutional neural network model and near-infrared hyperspectral imaging. Background Technology
[0002] Ginseng is a precious traditional Chinese medicine, mainly divided into Asian ginseng, Korean ginseng, Siberian ginseng, and American ginseng. All these species belong to the Araliaceae family, and each has specific effects on the body. Besides species classification, the classification of ginseng by age is also very important. Cultivated ginseng, commonly known as garden ginseng, is generally no more than 10 years old; ginseng sown in forests and allowed to grow freely is called forest ginseng, generally around 15 years old, not exceeding 20 years, and is the most common variety on the market. Ginseng grown in wild conditions is called wild ginseng, generally over 20 years old, and is extremely rare. Ginseng has a long history of use, and the phenomenon of inferior ginseng being passed off as superior ginseng frequently occurs in the market. Age is an important indicator for distinguishing the quality of different ginseng. Taking the commonly seen forest ginseng on the market as an example, the price of forest ginseng from different years varies by several times. For example, in 2022, the price of forest ginseng differed by 2-3 times for a difference of 2-3 years of age; and by 4-10 times for a difference of 3-7 years of age.
[0003] Traditional methods for determining the age of ginseng grown in forests rely on visual observation. However, identification based on appearance or rhizome characteristics cannot be standardized due to subjective differences. Current techniques primarily involve grinding and extracting ginseng powder, followed by various chemical tests to determine its age. However, this method is expensive, time-consuming, and can damage samples. Furthermore, it requires highly skilled operators and precise control of experimental conditions, resulting in low repeatability. Therefore, there is an urgent need for a high-precision, non-destructive, and rapid method for determining the age of ginseng grown in forests to meet actual market demands.
[0004] Hyperspectral imaging (HSI) has been widely used in fields such as food safety, medical diagnostics, aerospace, and geological structures. However, HSI methods are often affected by noise during data acquisition, which impacts the visualization of the spectrum and reduces the accuracy of subsequent applications. Furthermore, as the sample size increases, the interference from various noise sources, such as stripe noise and dark current, in the data acquisition working area becomes increasingly severe. Summary of the Invention
[0005] To address the problems of time-consuming, costly, and poorly repeatable identification and judgment of the age of forest ginseng in existing technologies, which often involve damage to the ginseng, this invention provides a non-destructive identification method for forest ginseng based on a convolutional neural network model and near-infrared hyperspectral imaging. This method can quickly and non-destructively classify forest ginseng by age, thereby achieving non-destructive identification of the age of forest ginseng.
[0006] The technical solution adopted by the present invention to solve the above-mentioned technical problems is as follows.
[0007] A non-destructive method for identifying the age of forest ginseng based on a convolutional neural network model and near-infrared hyperspectral imaging includes the following steps;
[0008] Step 1: Take forest ginseng from different years that have been marked with their original year and obtain near-infrared hyperspectral images of the forest ginseng from different years;
[0009] Step 2: Perform radiometric correction, region of interest (ROI) extraction, and format conversion on the near-infrared hyperspectral images of forest ginseng from different years to obtain the original near-infrared hyperspectral curves of forest ginseng;
[0010] Step 3: Use MATLAB software to perform hybrid noise reduction on the original near-infrared hyperspectral curve of the forest ginseng to obtain the hybrid noise-reduced near-infrared hyperspectral curve of the forest ginseng.
[0011] The hybrid noise reduction process uses the MSC model, SG smoothing model, and first derivative model.
[0012] Step 4: In MATLAB software, the Uninformation Variable Elimination (UVE) method is used to extract the feature bands of the near-infrared hyperspectral curve of the mixed noise reduction forest ginseng, establish a convolutional neural network model, and use the year data as labels to iteratively train the convolutional neural network to obtain the trained neural network model.
[0013] Step 5: Use the trained neural network model to perform non-destructive identification of the ginseng under the forest cover to obtain the year of the ginseng under the forest cover.
[0014] Furthermore, in step one, the different years are 10 years, 15 years, and 20 years.
[0015] Furthermore, in step one, near-infrared hyperspectral images of two sides of each ginseng under the forest canopy are collected.
[0016] Furthermore, in step one, the wavelength range of the near-infrared hyperspectral image is 900-1700 nm.
[0017] Furthermore, in step two, the radiation correction uses the following formula:
[0018]
[0019] In the formula, I is the corrected near-infrared hyperspectral image of forest ginseng, I0 is the uncorrected near-infrared hyperspectral image of forest ginseng, B is the near-infrared hyperspectral image of forest ginseng obtained when the reflectance is 0%, and W is the near-infrared hyperspectral image of forest ginseng obtained when the reflectance is 99.9%.
[0020] Furthermore, in step two, the five regions of interest in the radiometrically corrected near-infrared hyperspectral image of the forest ginseng are extracted pixel by pixel in ENVI software according to a point-centered strategy. These regions are the rhizome, the round rhizome, the upper part of the main root, the lower part of the main root, and the fibrous roots.
[0021] Furthermore, in step three, the decomposition formula of the MSC model is as follows:
[0022]
[0023] In the formula, The value represents the average of the raw near-infrared hyperspectral data of all forest-grown ginseng, where n is the number of forest-grown ginseng trees, and K is the mean value. i For offset, b i I represents the baseline translation. i For the raw near-infrared hyperspectral data of the i-th forest ginseng, I i(MSC) Near-infrared hyperspectral data of the i-th forest ginseng after denoising for the MSC model.
[0024] Furthermore, in step three, the decomposition formula of the SG smoothing model is as follows:
[0025] Y (2m+1)×1 =X (2m+1)×k ×A k×1 +E (2m+1)×1
[0026] In the formula, Y is the near-infrared hyperspectral data of forest ginseng after denoising using the SG smoothing model, m is the band length, n is the width of the filter window, 2m+1=n, X is the set of five points with equal wavelength intervals in a segment of the original near-infrared hyperspectral data of forest ginseng, A is the least squares fitting result, k is the number of fittings, and E is the original near-infrared hyperspectral data of forest ginseng.
[0027] Furthermore, in step three, the decomposition formula of the first derivative model is as follows:
[0028] X - (i, 1st) = (X) - i+X - (i+g)-2X - i) / g 2
[0029] In the formula, X_(i, 1st) represents the near-infrared hyperspectral data of forest understory parameters after denoising using the first-order derivative model, and X - i represents the transmittance in the i-th band of the original near-infrared hyperspectral data of *Gynostemma pentaphyllum*, and X represents... - (i+g) represents the transmittance of the i+g bands in the original near-infrared hyperspectral data of the forest ginseng, and g is the window width.
[0030] Furthermore, in step four, the formula for extracting feature spectral bands using the non-information variable elimination method is as follows:
[0031]
[0032] In the formula, X(i) is the quotient of the average spectral coefficient and standard deviation of the near-infrared hyperspectral curve of the forest ginseng after mixed noise reduction, P(i) is the average spectral coefficient of the near-infrared hyperspectral curve of the forest ginseng after mixed noise reduction, and R(i) is the standard deviation of the spectral coefficient of the near-infrared hyperspectral curve of the forest ginseng after mixed noise reduction.
[0033] Furthermore, in step four, the first layer of the convolutional neural network model contains one convolutional layer and one pooling layer. The convolutional layer uses 104 convolutional kernels of size 28*28 with a stride of 4 to filter the near-infrared hyperspectral curve of the input forest ginseng; the pooling layer uses a pooling window of size 6*6 with a stride of 2 for pooling. The second layer contains one convolutional layer and one pooling layer. The convolutional layer uses 256 convolutional kernels of size 14*14 with a stride of 4 to filter the pooling result of the previous layer; the pooling layer uses a pooling window of size 6*6 with a stride of 2 for pooling. The third layer consists of a convolutional layer, using 364 convolutional kernels of size 3*3 with a stride of 1 to filter the pooling result of the previous layer; the fourth layer consists of a convolutional layer, using 364 convolutional kernels of size 3*3 with a stride of 1 to filter the pooling result of the previous layer; the fifth layer contains a convolutional layer and a pooling layer, the convolutional layer using 256 convolutional kernels of size 6*6 with a stride of 2 to filter the convolution result of the previous layer, and the pooling layer using a pooling window of size 6*6 with a stride of 2; the sixth layer is a fully connected layer, and the seventh layer is a softmax layer.
[0034] Furthermore, in step four, the trained model for iterative training is:
[0035]
[0036] In the formula, fi(w) represents the loss function of a single sample in the training set of the training neural network model, n represents the number of samples in the training set of the training neural network model, and w represents the parameters of the convolutional neural network model.
[0037] Furthermore, in step four, the iterative training is performed 100 times with a learning rate of 0.001.
[0038] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0039] The present invention provides a non-destructive identification method for forest ginseng based on a convolutional neural network model and near-infrared hyperspectral imaging. This method utilizes near-infrared hyperspectral imaging technology to simultaneously acquire spectral energy values reflecting the target's radiation and image features reflecting the target's spatial information. By comprehensively utilizing spectral and spatial features, and through a convolutional neural network model, the accuracy of forest ginseng age classification is improved. Through the established convolutional neural network, rapid, real-time, non-destructive, and accurate identification of forest ginseng from different years can be achieved. Attached Figure Description
[0040] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0041] Figure 1 Near-infrared hyperspectral images of the front and back sides of ginseng from different years obtained in Embodiment 1 of the present invention. In the figure, a1 and a2 are ginseng from 10 years old; b1 and b2 are ginseng from 15 years old; and c1 and c2 are ginseng from 20 years old.
[0042] Figure 2 This is a schematic diagram of the region of interest of the forest ginseng extracted in Embodiment 1 of the present invention.
[0043] Figure 3 This is the original near-infrared hyperspectral curve of the forest ginseng in Example 1 of the present invention.
[0044] Figure 4 This is a near-infrared hyperspectral curve of forest ginseng after noise reduction using the MSC model in Embodiment 1 of the present invention.
[0045] Figure 5 This is the near-infrared hyperspectral curve of the forest ginseng after noise reduction using the SG smoothing model in Embodiment 1 of the present invention.
[0046] Figure 6 This is the near-infrared hyperspectral curve of the forest ginseng after noise reduction using the first derivative model in Embodiment 1 of the present invention.
[0047] Figure 7 This is a near-infrared hyperspectral curve of the forest ginseng after hybrid noise reduction processing in Example 1 of the present invention.
[0048] Figure 8The feature bands are those extracted using the UVE method in Embodiment 1 of this invention.
[0049] Figure 9 This describes the process of establishing the convolutional neural network model in Embodiment 1 of the present invention.
[0050] Figure 10 This is a training progress diagram of the convolutional neural network model in Embodiment 1 of the present invention. Detailed Implementation
[0051] To further understand the present invention, preferred embodiments of the present invention are described below. However, it should be understood that these descriptions are only for further illustrating the features and advantages of the present invention, and not for limiting the scope of the claims of the present invention.
[0052] The present invention provides a non-destructive method for identifying the age of forest ginseng based on a convolutional neural network model and near-infrared hyperspectroscopy, comprising the following steps:
[0053] Step 1: Take forest ginseng from different years that have been marked with their original year and obtain near-infrared hyperspectral images of the forest ginseng from different years;
[0054] Step 2: Perform radiometric correction, region of interest extraction, and format conversion on the near-infrared hyperspectral images of forest ginseng from different years to obtain the original near-infrared hyperspectral curves of forest ginseng;
[0055] Step 3: Use MATLAB software to perform hybrid noise reduction on the original near-infrared hyperspectral curve of the forest ginseng to obtain the hybrid noise-reduced near-infrared hyperspectral curve of the forest ginseng.
[0056] Step 4: In MATLAB software, the non-information variable elimination method is used to extract the feature bands of the near-infrared hyperspectral curve of the mixed noise reduction forest ginseng, establish a convolutional neural network model, and use the year data as labels to iteratively train the convolutional neural network to obtain the trained neural network model.
[0057] Step 5: Use the trained neural network model to perform non-destructive identification of the ginseng under the forest cover to obtain the year of the ginseng under the forest cover.
[0058] In the above technical solution, in step one, the preferred ages of the forest-grown ginseng are 10, 15, and 20 years. It should be noted that the age range of the forest-grown ginseng is set according to the actual situation (the range of ages of the forest-grown ginseng to be tested).
[0059] In the first step of the above technical solution, near-infrared hyperspectral images of two sides are collected for each ginseng under the forest canopy.
[0060] In the above technical solution, step one involves acquiring near-infrared hyperspectral images of forest ginseng using a near-infrared hyperspectral platform. The near-infrared hyperspectral platform includes a conveyor belt, a conveyor table, a black background plate, a white plate, two limiting plates, an artificial light source, a near-infrared hyperspectral camera, a power supply, and a host computer. The conveyor table is mounted on the conveyor belt and moves under its influence. At least two artificial light sources are located diagonally above the irradiation position, forming a 45° angle with the forest ginseng sample. The near-infrared hyperspectral camera is located directly above the irradiation position, 1 meter away from the forest ginseng sample. The two limiting plates are fixed to both sides of the conveyor table, and the black background plate is fixed to both sides of the two limiting plates. The white plate is fixed to the black background plate and used to hold the forest ginseng sample. The power supply provides power to the conveyor belt, artificial light source, near-infrared hyperspectral camera, and host computer. Both the near-infrared hyperspectral camera and the conveyor belt are connected to the PC. The PC controls the movement of the conveyor belt and receives the near-infrared hyperspectral images transmitted by the near-infrared hyperspectral camera.
[0061] In the above technical solution, step two uses the following formula for radiation correction:
[0062]
[0063] In the formula, I is the corrected near-infrared hyperspectral image of the forest ginseng, I0 is the uncorrected near-infrared hyperspectral image of the forest ginseng, B is the near-infrared hyperspectral image of the forest ginseng obtained when the light source is turned off (reflectivity is 0%), and W is the near-infrared hyperspectral image of the forest ginseng obtained when a white board is used (reflectivity is 99.9%).
[0064] In step three of the above technical solution, the five regions of interest in the corrected near-infrared hyperspectral image of the forest ginseng are obtained pixel by pixel in ENVI software according to the point-centered strategy. These regions are the rhizome, the round rhizome, the upper part of the main root, the lower part of the main root, and the fibrous roots.
[0065] In the above technical solution, step three involves hybrid noise reduction processing, which includes the MSC model, the SG smoothing model, and the first derivative model, as detailed below:
[0066] (1) The decomposition formula of the MSC model is as follows:
[0067]
[0068] In the formula, I represents the average of the raw near-infrared hyperspectral data of all forest-grown ginseng. i For the raw near-infrared hyperspectral data of the i-th forest ginseng, I j For the raw near-infrared hyperspectral data of the j-th ginseng understory tree, where n is the number of ginseng understory trees, the vector reconstruction spectra of the first n ginseng understory trees are selected, and then the raw near-infrared hyperspectral data of the i-th ginseng understory tree is used. i and Perform univariate linear regression and solve the least squares problem to obtain the baseline shift b for each forest ginseng. i and offset K i Finally, the near-infrared hyperspectral data of each forest ginseng were corrected, and the baseline shift b was subtracted. i Divide by the offset K i The near-infrared hyperspectral data I of the i-th forest ginseng after denoising using the MSC model were obtained. i(MSC)
[0069] (2) The decomposition formula of the SG smoothing model is as follows:
[0070] y = ∝0 + ∝1x + ∝2x 2 +...+∝ k-1 x k-1
[0071] The near-infrared hyperspectral data of the region of interest for *Gynostemma pentaphyllum* are denoted by x, and are x = (-m, -m+1, 0, ..., 0, 1, ..., m-1, m). A polynomial of degree k-1 is used to fit the data points within the filter window, resulting in n equations, which constitute a system of k linear equations. For the system to have a solution, n should be greater than or equal to k. Therefore, n > k is chosen. The fitting parameter A is determined using the least squares method, resulting in the following formula:
[0072]
[0073] Represented in matrix form as follows:
[0074] Y (2m+1)×1 =X (2m+1)×k ×A k×1 +E (2m+1)×1
[0075] The least squares solution for fitting parameter A is
[0076] A = (X T ×X) -1 ×X T ×Y
[0077] Y's model filter value for
[0078]
[0079] In the formula, Y is the near-infrared hyperspectral data of forest ginseng after denoising using the SG smoothing model, m is the band length, n is the width of the filter window, 2m+1=n, X is the set of five points with equal wavelength intervals in a segment of the original near-infrared hyperspectral data of forest ginseng, A is the least squares fitting result, k is the number of fittings, and E is the original near-infrared hyperspectral data of forest ginseng.
[0080] (3) The decomposition formula of the first derivative model is as follows:
[0081] X - (i, 1st) = (X) - i+X - (i+g)-2X - i) / g 2
[0082] In the formula, X_(i, 1st) represents the near-infrared hyperspectral data of forest understory parameters after denoising using the first-order derivative model, and X - i represents the transmittance in the i-th band of the original near-infrared hyperspectral data of *Gynostemma pentaphyllum*, and X represents... - (i+g) represents the transmittance of the i+g bands in the original near-infrared hyperspectral data of the forest ginseng, and g is the window width.
[0083] In the above technical solution, step four, the formula for extracting feature spectral bands using the non-information variable elimination method is as follows:
[0084]
[0085] In the formula, X(i) is the quotient of the average spectral coefficient and standard deviation of the near-infrared hyperspectral curve of the forest ginseng after mixed noise reduction, P(i) is the average spectral coefficient of the near-infrared hyperspectral curve of the forest ginseng after mixed noise reduction, and R(i) is the standard deviation of the spectral coefficient of the near-infrared hyperspectral curve of the forest ginseng after mixed noise reduction.
[0086] In the above technical solution, in step four, the wavelength range for characteristic spectral band extraction is 900-1700nm, and the band range is 0-256 bands.
[0087] In the above technical solution, step four involves a convolutional neural network model comprising three parallel parts: a 1×1 convolution, a 1×1 convolution, and a 3×3 convolution, followed by two consecutive 3×3 convolutions. No padding is applied during the 1×1 convolutions, while the 3×3 convolutions are padded with a size of 1. The results of these three parallel convolution operations are then concatenated. The network's multi-scale convolutional layers are depthwise separable convolutional structures, with each branch's first layer containing multiple 1×1 convolutions. Since the original hyperspectral image has some redundancy in the spectral dimension, using 1×1 convolutions can compress this redundancy and reduce the number of model parameters. To extract deeper features and compress local spatial information, two consecutive convolutional layers with 3×3 kernels are added after the convolutional layers, without padding, establishing a relationship between the extracted features and the year category of the forest understory parameters. The first fully connected layer has 60 neurons, and the second fully connected layer has 30 neurons. The fewer neurons used in the fully connected layers are due to the smaller number of parameters in the network itself. Specifically, the preferred first layer comprises one convolutional layer and one pooling layer. The convolutional layer uses 104 convolutional kernels of size 28*28 with a stride of 4 to filter the near-infrared hyperspectral data of the input forest-grown ginseng. The pooling layer uses a pooling window of size 6*6 with a stride of 2 for pooling. The second layer comprises one convolutional layer and one pooling layer. The convolutional layer uses 256 convolutional kernels of size 14*14 with a stride of 4 to filter the pooling result from the previous layer. The pooling layer uses a pooling window of size 6*6 with a stride of 2 for pooling. The third layer is a convolutional layer that uses 364 convolutional kernels of size 3*3 with a stride of 1 to filter the pooling result from the previous layer. The fourth layer is a convolutional layer that uses 364 convolutional kernels of size 3*3 with a stride of 1 to filter the pooling result from the previous layer. The fifth layer contains a convolutional layer and a pooling layer. The convolutional layer uses 256 convolutional kernels of size 6*6 with a stride of 2 to filter the convolutional results from the previous layer. The pooling layer uses a pooling window of size 6*6 with a stride of 2 for pooling. The sixth layer is a fully connected layer, and the seventh layer is a softmax layer.
[0088] In the above technical solution, in step four, the training model for iterative training is:
[0089]
[0090] In the formula, fi(w) represents the loss function of a single sample in the training set of the neural network model, n represents the number of samples in the training set of the neural network model, and w represents the parameters of the convolutional neural network model.
[0091] In the above technical solution, in step four, the number of iterations for iterative training is 100, and the learning rate is 0.001; the calibration sample dataset and the prediction dataset are divided into two parts in a 3:2 ratio.
[0092] The terminology used in this invention generally has the meanings commonly understood by those skilled in the art, unless otherwise stated. To enable those skilled in the art to better understand the technical solutions of this invention, the invention will be further described in detail below with reference to embodiments.
[0093] In the following embodiments, various processes and methods not described in detail are conventional methods known in the art. Unless otherwise specified, the materials, reagents, apparatus, instruments, equipment, etc., used in the following embodiments are commercially available.
[0094] The present invention will be further illustrated below with reference to the embodiments.
[0095] Example 1
[0096] Step 1: Take 30 ginseng plants of the Erma Ya variety from forest-grown ginseng in Huinan County, Jilin Province, which are 10 years, 15 years and 20 years old respectively.
[0097] Step 2: Near-infrared hyperspectral images were acquired from two sides of each ginseng tree under the forest canopy, resulting in 60 near-infrared hyperspectral images, some of which are shown below. Figure 1 As shown;
[0098] Step 3: Perform radiometric correction and region of interest extraction on the near-infrared hyperspectral images of ginseng from different years. For each ginseng tree, extract the region of interest data from five parts of the near-infrared hyperspectral image, such as... Figure 2 As shown, the rhizome, round rhizome, upper part of the main root, lower part of the main root, and fibrous roots are respectively. A total of 300 regions of interest data were extracted, and after conversion, 300 TXT files were obtained, which are the original near-infrared hyperspectral curves of forest ginseng.
[0099] Step 4: In MATLAB software, perform hybrid noise reduction on the original near-infrared hyperspectral curves of the forest ginseng obtained in Step 3 to obtain the near-infrared spectral curves of the forest ginseng after noise reduction using the MSC model. Figure 4 Near-infrared spectral curves of forest ginseng after denoising using the SG smoothing model. Figure 5 Near-infrared spectral curves of forest ginseng after noise reduction using the first derivative model. Figure 6 ), and obtained the near-infrared spectral curves of forest ginseng after mixed noise reduction treatment ( Figure 7 ).
[0100] Step 5: In MATLAB software, using the non-information variable removal method, characteristic spectral bands are extracted from the near-infrared hyperspectral curves of the forest ginseng after noise reduction. The wavelength range is 900-1700 nm, and the band range is 0-256 bands. The extracted characteristic spectral bands are as follows: Figure 8As shown, there are 11 characteristic spectral bands, namely 270, 279, 280, 288, 297, 300, 669, 670, 673, 675 and 755.
[0101] Step 6: Build a convolutional neural network model using feature spectral bands, such as... Figure 9 As shown, the input layer of the convolutional neural network model is a 256-channel near-infrared hyperspectral image of forest ginseng with a size of 356*356. The first layer contains one convolutional layer and one pooling layer. The convolutional layer uses 104 convolutional kernels of size 28*28 with a stride of 4 to filter the input near-infrared hyperspectral image of the forest ginseng. The pooling layer uses a pooling window of size 6*6 with a stride of 2 for pooling. The second layer contains one convolutional layer and one pooling layer. The convolutional layer uses 256 convolutional kernels of size 14*14 with a stride of 4 to filter the pooling result of the previous layer. The pooling layer uses a pooling window of size 6*6 with a stride of 2 for pooling. The third layer is a convolutional layer that uses 364 convolutional kernels of size 3*3 with a stride of 1 to filter the pooling result of the previous layer. The fourth layer is a convolutional layer that uses 364 3x3 kernels with a stride of 1 to filter the pooling result from the previous layer. The fifth layer contains one convolutional layer and one pooling layer. The convolutional layer uses 256 6x6 kernels with a stride of 2 to filter the convolution result from the previous layer; the pooling layer uses a 6x6 pooling window with a stride of 2. The sixth layer is a fully connected layer. The seventh layer is a softmax layer. Specific parameters are shown in Table 1.
[0102] Step 7: Using year data as labels, iteratively train the convolutional neural network model, with the training progress as follows: Figure 10 As shown in Table 2, a trained neural network model was obtained. The accuracy of the calibration set, the accuracy of the prediction set, and the overall accuracy (the accuracy is the number of correctly classified samples divided by the total number of samples) were calculated using a confusion matrix. The results are shown in Table 2. It can be seen that the model's prediction accuracy for 20-year-old forest ginseng is 100%. The trained neural network was then used for non-destructive identification of the forest ginseng to be detected, and the year data for the forest ginseng to be detected are shown in Table 3.
[0103] Table 1. Structural parameters of the convolutional neural network model in Example 1
[0104]
[0105] Table 2 shows the accuracy of ginseng classification for three years using the trained neural network model in Example 1.
[0106]
[0107] Table 3 shows the results of identifying forest ginseng from different years using the neural network model trained in Example 1.
[0108]
[0109]
[0110] In Table 3, P represents precision; R represents recall; OA represents accuracy; category label 1 represents 20 years; category label 2 represents 15 years; and category label 3 represents 10 years.
[0111] Obviously, the above embodiments are merely examples for clear illustration and are not intended to limit the scope of the embodiments. Those skilled in the art will recognize that other variations or modifications can be made based on the above description. It is neither necessary nor possible to exhaustively list all embodiments here. However, obvious variations or modifications derived therefrom are still within the protection scope of this invention.
Claims
1. A method for nondestructive identification of the age of wild ginseng based on a convolutional neural network model and near-infrared hyperspectrum, characterized in that, It comprises the following steps; Step one, take different years of marked years of different years of forest under the participation, get different years of forest under the participation of near infrared hyperspectral image; Step two, the near infrared hyperspectral image of the forest under the participation of different years obtained is subjected to radiation correction, interested region extraction and format conversion to obtain the original near infrared hyperspectral curve of the forest under the participation; In step two, five interested regions of the near infrared hyperspectral image of the forest under the participation after radiation correction are extracted in ENVI software according to the point center strategy, which are the top of the reed, the round reed, the upper part of the main root, the lower part of the main root and the rootlet. Step three, the original near infrared hyperspectral curve of the forest under the participation is subjected to mixed denoising treatment by using MATLAB software to obtain the mixed denoised near infrared hyperspectral curve of the forest under the participation; The model used in the mixed denoising treatment is MSC model, SG smoothing model and first derivative model; In step four, the mixed denoised near infrared hyperspectral curve of the forest under the participation is subjected to feature band extraction by using the uninformative variable elimination method in MATLAB software, a convolutional neural network model is established, and the convolutional neural network is iteratively trained with year data as labels to obtain a trained neural network model; In step four, the first layer of the convolutional neural network model comprises a convolutional layer and a pooling layer, the convolutional layer filters the input near infrared hyperspectral curve of the forest under the participation by using 104 convolutional kernels with a size of 28*28 and a step of 4; the pooling layer is pooled by using a pooling window with a size of 6*6 and a step of 2; the second layer comprises a convolutional layer and a pooling layer, the convolutional layer filters the pooling result of the previous layer by using 256 convolutional kernels with a size of 14*14 and a step of 4; the pooling layer is pooled by using a pooling window with a size of 6*6 and a step of 2; the third layer is a convolutional layer which filters the pooling result of the previous layer by using 364 convolutional kernels with a size of 3*3 and a step of 1; the fourth layer is a convolutional layer which filters the pooling result of the previous layer by using 364 convolutional kernels with a size of 3*3 and a step of 1; the fifth layer comprises a convolutional layer and a pooling layer, the convolutional layer filters the convolution result of the previous layer by using 256 convolutional kernels with a size of 6*6 and a step of 2; the pooling layer is pooled by using a pooling window with a size of 6*6 and a step of 2; the sixth layer is a fully connected layer, and the seventh layer is a softmax layer; Step five, the trained neural network model is used to nondestructively identify the forest under the participation to be detected to obtain the year of the forest under the participation to be detected.
2. The method according to claim 1, wherein, In step one, two near infrared hyperspectral images of each forest under the participation are collected.
3. The method according to claim 1, wherein, In step one, the wavelength range of the near infrared hyperspectral image is 900-1700nm.
4. The method according to claim 1, wherein, In step two, the formula used for radiation correction is as follows: In the formula, I is the corrected near infrared hyperspectral image of the forest under the participation, I0 is the uncorrected near infrared hyperspectral image of the forest under the participation, B is the near infrared hyperspectral image of the forest under the participation obtained when the reflectivity is 0%, and W is the near infrared hyperspectral image of the forest under the participation obtained when the reflectivity is 99.9%.
5. The method according to claim 1, wherein, In step three, The decomposition formula of the MSC model is as follows: In the formula, is the average value of the original near-infrared hyperspectral data of all wild ginseng, n is the number of wild ginseng, K i is the offset, b i is the baseline shift, I i is the original near-infrared hyperspectral data of the i th wild ginseng, I i(MSC) is the near-infrared hyperspectral data of the i th wild ginseng after noise reduction by the MSC model; The decomposition formula of the SG smoothing model is as follows: Y (2m+1)×1 = X (2m+1)×k * A k×1 + E (2m+1)×1 In the formula, Y is the near-infrared hyperspectral data of the undergrowth ginseng after noise reduction of the SG smoothing model, m is the band length, n is the filter window width, 2m+1=n, X is the set of five points of equal wavelength interval of the original near-infrared hyperspectral data of the undergrowth ginseng in an interval, A is the least square fitting result, k is the fitting degree, and E is the original near-infrared hyperspectral data of the undergrowth ginseng. The decomposition formula of the first derivative model is as follows: X_(i,1st) = (X_i + X_(i+g) - 2X_i) / g 2 In the formula, X_(i, 1st) is the near-infrared hyperspectral data of the undergrowth ginseng after noise reduction of the first derivative model, X_i is the transmittance of the original near-infrared hyperspectral data of the undergrowth ginseng at the i-th band number, X_(i+g) is the transmittance of the original near-infrared hyperspectral data of the undergrowth ginseng at the i+g-th band number, and g is the window width.
6. The method according to claim 1, wherein, In step four, the formula for extracting the characteristic spectral band by the uninformative variable elimination method is as follows: In the formula, X(i) is the quotient of the average value and the standard deviation of the spectral coefficient of the mixed near-infrared hyperspectral curve of the undergrowth ginseng after noise reduction, P(i) is the average value of the spectral coefficient of the mixed near-infrared hyperspectral curve of the undergrowth ginseng after noise reduction, and R(i) is the standard deviation of the spectral coefficient of the mixed near-infrared hyperspectral curve of the undergrowth ginseng after noise reduction.
7. The method according to claim 1, wherein, In step four, the trained model of the iterative training is as follows: fi(w) represents the loss function of a single sample in the training set of the trained neural network model, n represents the number of samples in the training set of the trained neural network model, and w represents the parameters of the convolutional neural network model.
8. The method according to claim 1, characterized in that, In step four, the number of iterations of the iterative training is 100, and the learning rate is 0.001.
Citation Information
Patent Citations
NIR (Near Infrared Spectrum) undamaged identification authenticity method for wild ginseng
CN102636452A
Near-infrared detection and identification method for under-forest ginseng attributes
CN110987857A