A method for detecting moisture content of adaptive plant leaves and a method for establishing a detection model
Through the multi-layer perceptron regression model and transfer learning technology, combined with the LOPEX93 data set, a highly adaptable nonlinear model is established, which solves the real-time and adaptability problems of leaf moisture content detection in the existing technology, and realizes the detection of leaf moisture content in different environments. accurate and efficient detection.
Patent Information
- Application Number
- CN202410688607.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-30
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2044-05-30
AI Technical Summary
The existing plant leaf moisture content detection method relies on the drying constant weight method, which cannot achieve real-time and continuous measurement. The linear model has weak fitting ability and cannot capture complex nonlinear relationships. It has poor adaptability and is affected by the measurement environment and leaf species. The impact is greater.
Using a multi-layer perceptron regression model combined with the LOPEX93 data set, through transfer learning and continuous label smoothing strategies, a highly adaptable nonlinear model is established to reduce dependence on feature selection and the environment, and achieve accurate detection with a small amount of data.
It realizes that only a small amount of data can be used to establish an applicable moisture content detection model in different environments, improves the accuracy and adaptability of detection, reduces the dependence on measuring instruments and the environment, and supports real-time and efficient detection.
Smart Images

Figure CN118501103B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of plant leaf moisture content detection, and in particular to an adaptive plant leaf moisture content detection method and a detection model establishment method. Background Art
[0002] Traditional plant leaf moisture content detection usually uses the drying constant weight method, which measures the fresh weight and dry weight of the leaves and uses the wet basis moisture content or dry basis moisture content formula to calculate the leaf moisture content. The drying constant weight method is an accurate and reliable method for measuring plant moisture content, but its measurement process requires collecting leaves and drying them to a constant weight, which takes a long time and cannot achieve real-time and continuous measurement.
[0003] A Chinese patent with publication number CN106092955A proposes a method for determining the moisture content of Miscanthus plant leaves: the Miscanthus plant leaves are scanned in the near-infrared spectrum band of 400nm-2500nm to obtain reflected light spectra at 23 characteristic wavelengths, the reflectance spectra of these characteristic wavelengths and the moisture content calculated by the drying constant weight method are used to make training data, a linear model is established, and the moisture content of the leaves is calculated using the established model.
[0004] A Chinese patent with publication number CN110779875B proposes a method for detecting the moisture content of winter wheat ears based on hyperspectral technology: measuring the spectral data of winter wheat ears, preprocessing the original spectral data (including denoising and wavelet transform), using correlation analysis to obtain characteristic bands sensitive to moisture, using the spectral data of these characteristic bands and the moisture content calculated by the drying constant weight method to create training data, using the partial least squares method to establish a linear model, and using the established model to calculate the moisture content.
[0005] The methods used in the above-mentioned Chinese patents with publication numbers CN106092955A and CN110779875B require firstly to extract the spectral data sensitive to water as the model features by experience or data analysis algorithm, calculate the leaf moisture content by drying method as the data label, and establish a linear model. The accuracy of the model is affected by the following factors:
[0006] 1. Depends on the degree of correlation between the features extracted through experience or data analysis algorithms and the moisture content of the leaves.
[0007] 2. When collecting the reflectance spectrum of leaves, there will be different degrees of deviation due to differences in measuring instruments (wavelength range, setting parameters), measuring environment (lighting), and leaf types. The model established using data collected in a specific environment is not suitable for scenarios in different environments.
[0008] 3. The linear model has weak fitting ability and cannot capture complex nonlinear relationships. Its advantage is that it allows the use of a small amount of data to fit the model, but relatively speaking, the established model has poor adaptability and is more demanding on the measurement environment. Summary of the invention
[0009] In view of the above-mentioned deficiencies in the prior art, the object of the present invention is to provide an adaptive plant leaf moisture content detection method and a detection model establishment method, which does not rely on prior knowledge of feature selection. For different reflectance measurement scenarios, only a small amount of modeling data can be used to establish a nonlinear model suitable for detecting moisture content based on leaf reflectivity in the current scenario, thereby achieving real-time and accurate detection.
[0010] In order to achieve the above object, the technical solution adopted by the present invention is:
[0011] A method for establishing an adaptive plant leaf moisture content detection model, comprising:
[0012] The reflectivity and weight data of the leaves in the current scene are collected by using the drying constant weight method, and the moisture content is calculated according to the collected reflectivity and weight data to form a first data set;
[0013] Select the data in the LOPEX93 data set that have the same band as the acquisition equipment of the drying constant weight method, calculate the moisture content based on the selected data, and form a second data set;
[0014] Establish a multi-layer perceptron regression model;
[0015] The multi-layer perceptron regression model is trained using the second data set until convergence, thereby obtaining an initial model for moisture content detection;
[0016] The initial model for moisture content detection is trained by a transfer learning method with a continuous label smoothing strategy to obtain a moisture content detection model; wherein the data used to train the initial model for moisture content detection is the first data set.
[0017] Optionally, build a multi-layer perceptron regression model, including:
[0018] Using the second data set as training data, the multi-layer perceptron model is cross-validated.
[0019] A heuristic search algorithm is used to search for the optimal model parameters of the multilayer perceptron model;
[0020] The parameters of the multilayer perceptron model are set to the optimal model parameters to obtain a multilayer perceptron regression model.
[0021] Optionally, the heuristic search algorithm is a Bayesian optimization algorithm.
[0022] Optionally, the objective function of the Bayesian optimization algorithm is as follows:
[0023]
[0024] Among them, RMSE is the root mean square error, n is the number of samples in the data set, is the label value, is the predicted value; the model parameters corresponding to the minimum RMSE are the optimal model parameters.
[0025] Optionally, a transfer learning method with a continuous label smoothing strategy is used to train the initial moisture content detection model to obtain a moisture content detection model, specifically including:
[0026] Divide the label intervals according to the sample labels in the adopted training data set. The division standard is that the number of intervals with consecutive samples of 0 is less than or equal to 5, and count the number of samples in each interval;
[0027] Calculate the weight of each interval. The weight calculation formula is as follows:
[0028]
[0029] in, is the weight of the ith interval, is the number of samples in the i-th interval. When i exceeds the upper and lower ranges, ;
[0030] The initial moisture content detection model is trained by using the transfer learning method to obtain a moisture content detection model. The loss calculation formula during training is as follows:
[0031]
[0032] Among them, loss is the loss, is the calculated inference value of the current model, is the true label, The true label The weight of the interval.
[0033] Optionally, the specific formula for calculating the moisture content is as follows:
[0034]
[0035] in, For fresh leaf quality, The dry leaf mass.
[0036] Another technical solution adopted by the present invention is:
[0037] An adaptive plant leaf moisture content detection method, comprising:
[0038] Collect the reflectivity of the leaf to be tested;
[0039] Obtaining a moisture content detection model corresponding to the scene where the leaf to be tested is located, wherein the moisture content detection model is obtained by using the above-mentioned adaptive plant leaf moisture content detection model establishment method;
[0040] The reflectivity of the leaf to be tested is input into the corresponding moisture content detection model to obtain the moisture content of the leaf to be tested.
[0041] The beneficial effects of the present invention are: using a neural network model multilayer perceptron and the leaf reflectivity public data set LOPEX93 to establish an initial model, and adjusting the model through the transfer learning method, combined with a continuous label smoothing strategy to reduce the impact of sample imbalance. It is achieved that only a small amount of samples in the current scene need to be collected to complete the establishment of a moisture content detection model suitable for the current scene. The accuracy of the model is not affected by factors such as experience, data correlation, measuring instruments, measurement environment, and leaf type, and has high adaptability. The established moisture content detection model can be used to calculate the moisture content of the leaves to be tested in the same scene. The reflectivity of the leaves to be tested is input into the moisture content detection model of the corresponding scene to obtain the moisture content of the leaves to be tested. The detection method is simple, real-time, and efficient. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 It is a schematic flow chart of a method for establishing an adaptive plant leaf moisture content detection model according to an embodiment of the present invention;
[0043] Figure 2 Shown is a schematic flow chart of an adaptive plant leaf moisture content detection method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0044] In order to more clearly understand the technical content, achieved purposes and effects of the present invention, the present invention is described in detail below in conjunction with specific implementation methods and in conjunction with the accompanying drawings. It should be noted that, in the absence of conflict, the implementation methods of the present invention and the features in the implementation methods can be combined with each other. In the following description, many specific details are set forth in order to fully understand the present invention. The described implementation methods are only part of the implementation methods of the present invention, not all implementation methods. Based on the implementation methods in the present invention, all other implementation methods obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present invention.
[0045] Please refer to Figure 1 As shown, the embodiment of the present invention proposes a method for establishing an adaptive plant leaf moisture content detection model, comprising:
[0046] Step 1: Use the drying constant weight method to collect the reflectivity and weight data of the leaves in the current scene, and calculate the moisture content based on the collected reflectivity and weight data to form the first data set D1; for example, pick three leaves (can be of different types), measure the reflectivity and weight at each stage (just picked, every 5 minutes of baking, and completely dried), and calculate the moisture content of each stage according to the wet basis moisture content calculation formula:
[0047] Step 2, selecting data in the LOPEX93 data set with the same band as the acquisition equipment of the drying constant weight method, calculating the moisture content of the selected data according to the wet basis moisture content calculation formula, and forming a second data set D2; it should be noted that in the first data set D1 and the second data set D2, the reflectivity is used as a feature, and the corresponding moisture content is used as a label;
[0048] Step 3, establish a multi-layer perceptron regression model;
[0049] Step 4, using the second data set D2 to train the multi-layer perceptron regression model until convergence, to obtain an initial model for moisture content detection;
[0050] Step 5: Use a transfer learning method with a continuous label smoothing strategy to train the initial moisture content detection model to obtain a moisture content detection model; wherein the data used to train the initial moisture content detection model is the first data set D1.
[0051] The LOPEX93 dataset refers to a remote sensing dataset obtained by the Land Oceans and Atmosphere Experiment (LOPEX) held in Los Angeles, USA in 1993. The dataset includes 330 reflectance samples of 45 kinds of leaves, with a band range of 400-2500nm, and each sample has recorded fresh weight and dry weight. In this embodiment, the sample data in the current scene is collected by the drying constant weight method, and the moisture content is calculated as the modeling data. And the data in the LOPEX93 dataset with the same band range as the acquisition equipment band range of the drying constant weight method (such as 900-1700nm) is intercepted, and the moisture content is also calculated as the modeling data.
[0052] Based on the above embodiment, in an extended embodiment, step 3, establishing a multi-layer perceptron regression model, specifically includes:
[0053] Step 31, using the second data set as training data, cross-validating the multi-layer perceptron model,
[0054] Step 32, using a Bayesian optimization algorithm to search for optimal model parameters of the multilayer perceptron model;
[0055] Step 33, setting the parameters of the multilayer perceptron model to the optimal model parameters to obtain a multilayer perceptron regression model.
[0056] Specifically, the objective function of the Bayesian optimization algorithm is as follows:
[0057]
[0058] Among them, RMSE is the root mean square error, n is the number of samples in the data set, is the label value, is the predicted value; the model parameters corresponding to the minimum RMSE are the optimal model parameters.
[0059] Multilayer Perceptron (MLP) is a basic neural network model with the following features:
[0060] (1) Hidden layers with nonlinear activation functions are capable of learning complex nonlinear relationships.
[0061] (2) It consists of one or more hidden layers, each of which contains multiple neurons. These model parameters have a great influence on the final effect and need to be manually designed.
[0062] (3) A large amount of training data is required for effective training.
[0063] MLP has powerful nonlinear fitting capabilities and better generalization capabilities for complex measurement environments and different blade types. Existing technologies tend to use linear models because the collected samples are limited and the MLP model cannot be effectively trained. In this embodiment, the LOPEX93 dataset is used as the initial modeling data. The parameter design of the model is cross-validated on the dataset, and the root mean square error (RMSE) of the test results is used as the evaluation indicator. A heuristic search algorithm (such as the Bayesian optimization algorithm) is used to search for the optimal model parameters, and an initial model with excellent performance can be obtained.
[0064] Based on any of the above embodiments, in an extended embodiment, step 5, using a transfer learning method with a continuous label smoothing strategy to train the initial moisture content detection model to obtain a moisture content detection model, specifically includes:
[0065] Step 51, dividing the label intervals according to the sample labels in the adopted training data set, the division standard is that the number of intervals with the number of consecutive samples of 0 is less than or equal to 5, and counting the number of samples in each interval;
[0066] Step 52, calculating the weight of each interval, specifically includes: taking the reciprocal of the weighted sum of the number of samples in each interval counted in step 51 and the number of adjacent intervals as the loss calculation weight of each label interval, and the weight calculation formula is as follows:
[0067]
[0068] in, is the weight of the ith interval, is the number of samples in the i-th interval. When i exceeds the upper and lower ranges, ;
[0069] Step 53, the initial model for moisture content detection is trained by using a transfer learning method, and the current loss is calculated using the mean square error to obtain a moisture content detection model. The loss calculation formula during training is as follows:
[0070]
[0071] Among them, loss is the loss, is the calculated inference value of the current model (i.e., the initial model for moisture content detection), is the true label, The true label The weight of the interval, weight The method of step 52 is used to obtain.
[0072] This embodiment fine-tunes the initial model of moisture content detection by using a transfer learning method with a continuous label smoothing strategy. This achieves transfer learning from the moisture content detection task of the LOPEX93 dataset to the leaf moisture content detection task of the current scene (collected data). That is, the MLP model weights trained in step 4 are used as the initial weights, the model is continued to be trained using the collected data, and the continuous label smoothing strategy is used to reduce the impact of sample imbalance.
[0073] Among them, sample imbalance refers to the phenomenon that in the collected data, samples with different moisture contents are easily distributed unevenly, such as 80% of samples have a moisture content of more than 60%. The uneven sample distribution will cause the model to have a decreased accuracy in detecting moisture content in intervals where the training data accounts for a small proportion. Existing methods for sample imbalance usually include sample sampling, data enhancement, and classification loss weights. Sample sampling is not suitable for situations with a small number of samples. Data enhancement easily adds more disturbance noise, and classification loss weights are measures for classification tasks. This embodiment designs a continuous label smoothing strategy to effectively reduce the error caused by sample imbalance when there are few samples, and will not increase disturbance noise.
[0074] Based on any of the above embodiments, in an extended embodiment, the specific formula for calculating the moisture content is as follows:
[0075]
[0076] in, For fresh leaf quality, The dry leaf mass.
[0077] Please refer to Figure 2 As shown, the embodiment of the present invention also provides an adaptive plant leaf moisture content detection method, comprising:
[0078] Collect the reflectivity of the leaf to be tested;
[0079] Obtaining a moisture content detection model corresponding to the scene where the leaf to be tested is located, wherein the moisture content detection model is obtained by using the adaptive plant leaf moisture content detection model establishment method of any of the above embodiments;
[0080] The reflectivity of the leaf to be tested is input into the corresponding moisture content detection model to obtain the moisture content of the leaf to be tested.
[0081] From the above description, we can see that:
[0082] 1. The present invention uses the MLP model to model the moisture content detected based on leaf reflectivity, which has better nonlinear expression and generalization capabilities.
[0083] 2. The MLP model does not require feature selection based on prior knowledge or data analysis methods. It supports modeling all reflectance data as features. By adding regularization coefficients to the loss function, a sparse solution of the weights corresponding to each feature can be obtained, thereby achieving the purpose of automatic feature selection.
[0084] 3. The present invention uses transfer learning combined with a continuous label smoothing strategy to solve the problem that the MLP model requires a large amount of training data and realizes small sample learning.
[0085] 4. Thanks to the LOPEX93 dataset and the transfer learning training method, for complex scene changes, only a small amount of data needs to be collected in the scene to train a leaf moisture content detection model suitable for the current scene, which greatly increases the usability of the model.
[0086] The following is an explanation using a specific example.
[0087] 1. Pick three leaves of different types, measure the reflectivity (collected three times at different positions of the leaves) and weight of the leaves just picked, set the oven temperature to 100°, put the leaves into the oven for baking, take out the leaves every 5 minutes, measure the reflectivity (collected three times at different positions of the leaves) and weight of the leaves in this state, after measuring 10 times (baking for 50 minutes), bake for another 30 minutes to ensure that the leaves are completely dry, take out and weigh them as the dry weight of the leaves, and finally obtain 3*3*10=90 sample data as the first data set D1; the band range of the measuring instrument is 900-1700nm.
[0088] 2. The moisture content of the collected data is calculated using the wet basis moisture content calculation formula as the modeling label, and the data with a band range of 900-1700nm in the LOPEX93 sample data is intercepted. The sample moisture content is calculated at the same time as the second data set D2, thereby completing the production of the modeling data set.
[0089] 3. Search for the optimal model parameters of the MLP model through the Bayesian optimization algorithm. The parameters that need to be searched include the number of hidden layers, the number of neurons in each hidden layer, the activation function and the regularization term coefficient. The objective function of the optimization algorithm is to use the second data set D2 to perform cross-validation on the given parameter model. The RMSE of the verification result is the smallest.
[0090] 4. Build a model based on the optimal model parameters searched out in step 3, use the second data set D2 to train until convergence, and save the model as the initial model for moisture content detection.
[0091] 5. Use the first data set D1 to fine-tune the initial model of moisture content detection in step 4 using a transfer learning method with a continuous label smoothing strategy. During training, the loss value is calculated according to the continuous label smoothing weights calculated in advance until the loss value during training no longer decreases.
[0092] 6. The final model saved is the moisture content detection model. For the leaves to be detected, use a spectrometer to measure the reflectivity of the leaves, input the moisture content detection model corresponding to the scene where the leaves to be detected are located, and the corresponding moisture content can be calculated and output.
[0093] In order to detect the effectiveness of the embodiments of the present invention, in addition to collecting a set of data for modeling, an additional set of data is collected as a test set. The final moisture content detection model is used to calculate the evaluation index RMSE on the test set. Table 1 shows the RMSE test results of different models trained with different data on the test set. The lower the RMSE, the lower the error and the better the model fit.
[0094] Table 1 RMSE test results of different models trained with different data on the test set
[0095]
[0096] In Table 1, D1 represents a first data set formed according to the collected data, D2 represents a second data set formed according to the LOPEX93 data set, D1+D2 represents merging the two parts of data as training data, and D2->D1 represents the method of the present invention: first use the data of D2 for training, and then use the transfer learning method to use the data of D1 for training; GBM is a GradientBoosting model, RF is a random forest model, and PLS is a least squares regression model, all of which are commonly used linear models, and MLP is a multi-layer perceptron model. It can be seen from Table 1 that regardless of whether the LOPEX93 data set is added for training, the MLP model of the traditional training method is not as good as the linear model. After the MLP model is trained using the transfer learning method, the lowest error can be obtained.
[0097] As shown in Table 2, the test results of the initial model for moisture content detection before and after transfer learning are shown. The initial model is the model trained on D2, that is, the initial model for moisture content detection mentioned above.
[0098] Table 2 Test results of the initial model for moisture content detection before and after transfer learning
[0099]
[0100] As can be seen from Table 2, after training the model using the transfer learning method, the performance on the test set has been greatly improved. After adding the label smoothing strategy, the RMSE is further reduced.
[0101] Table 3 shows the model test results obtained by direct transfer learning, and Table 4 shows the model test results obtained by transfer learning with continuous label smoothing strategy, where Avg represents the average error. The moisture content of the data samples used for training is concentrated in the range of 10%-90%. From Tables 3 and 4, it can be seen that the error of the sample test results with a moisture content of 1.2% is reduced from 8.17% to 5.5% after using the label smoothing strategy. The average error is also effectively reduced.
[0102] Table 3 Model test results obtained using direct transfer learning
[0103]
[0104] Table 4. Model test results obtained by transfer learning with continuous label smoothing strategy
[0105]
[0106] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Therefore, any modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the technical solution of the present invention are still within the scope of the technical solution of the present invention.
Claims
1. A method for establishing an adaptive plant leaf moisture content detection model, characterized in that: include: The reflectivity and weight data of the leaves in the current scene are collected by using the drying constant weight method, and the moisture content is calculated according to the collected reflectivity and weight data to form a first data set; Select the data in the LOPEX93 data set that have the same band as the acquisition equipment of the drying constant weight method, calculate the moisture content based on the selected data, and form a second data set; Establish a multi-layer perceptron regression model; The multi-layer perceptron regression model is trained using the second data set until convergence, thereby obtaining an initial model for moisture content detection; The initial model for moisture content detection is trained by using a transfer learning method with a continuous label smoothing strategy to obtain a moisture content detection model; wherein the data used to train the initial model for moisture content detection is the first data set; Establish a multi-layer perceptron regression model, including: Using the second data set as training data, the multi-layer perceptron model is cross-validated. A heuristic search algorithm is used to search for the optimal model parameters of the multilayer perceptron model; The parameters of the multilayer perceptron model are set to the optimal model parameters to obtain a multilayer perceptron regression model; The heuristic search algorithm is a Bayesian optimization algorithm; the objective function of the Bayesian optimization algorithm is as follows: Among them, RMSE is the root mean square error, n is the number of samples in the data set, is the label value, is the predicted value; the model parameters corresponding to the minimum RMSE are the optimal model parameters.
2. The method for establishing an adaptive plant leaf moisture content detection model according to claim 1, characterized in that: The initial moisture content detection model is trained by using a transfer learning method with a continuous label smoothing strategy to obtain a moisture content detection model, which specifically includes: Divide the label intervals according to the sample labels in the adopted training data set. The division standard is that the number of intervals with consecutive samples of 0 is less than or equal to 5, and count the number of samples in each interval; Calculate the weight of each interval. The weight calculation formula is as follows: in, is the weight of the ith interval, is the number of samples in the i-th interval. When i exceeds the upper and lower ranges, ; The initial moisture content detection model is trained by using the transfer learning method to obtain a moisture content detection model. The loss calculation formula during training is as follows: Among them, loss is the loss, is the calculated inference value of the current model, is the true label, The true label The weight of the interval.
3. The method for establishing an adaptive plant leaf moisture content detection model according to claim 1, characterized in that: The specific formula for calculating moisture content is as follows: in, For fresh leaf quality, The dry leaf mass.
4. A method for detecting moisture content of adaptive plant leaves, characterized in that: include: Collect the reflectivity of the leaf to be tested; Obtaining a moisture content detection model corresponding to the scene where the leaf to be tested is located, wherein the moisture content detection model is obtained by using the method for establishing an adaptive plant leaf moisture content detection model according to any one of claims 1 to 3; The reflectivity of the leaf to be tested is input into the corresponding moisture content detection model to obtain the moisture content of the leaf to be tested.
Citation Information
Patent Citations
Method for determining water content of Miscanthus plant leaf
CN106092955A
A method for detecting the moisture content of winter wheat ears based on hyperspectral technology
CN110779875B
Method for detecting winter wheat ear moisture content based on hyperspectral technology
CN110779875A
Forest combustible moisture content inversion algorithm based on remote sensing data
CN114492726A
Tea seed kernel moisture content detection method and system based on microwave frequency sweeping technology and Stacking integrated model
CN115541621A
