Poplar leaf nitrogen content inversion method and system based on hyperspectral image data

The initial band set is determined through deep neural network and SHAP algorithm, and the band set is optimized using the sequence floating backward selection algorithm, which solves the accuracy and efficiency problems caused by high band correlation in hyperspectral image data inversion, and achieves high-precision Yang Inversion of nitrogen content in leaves.

CN119418210AInactive Publication Date: 2025-02-11RES INST OF FOREST RESOURCE INFORMATION TECHN CHINESE ACADEMY OF FORESTRY

Patent Information

Application Number
CN202411522025.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-29
Publication Date
2025-02-11
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

When using hyperspectral image data to invert the nitrogen content of poplar leaves, the prior art is susceptible to the Hughes phenomenon caused by high band correlation, which in turn reduces the accuracy and calculation efficiency of the inversion model.

Method used

Deep neural network (DNN) combined with SHAP algorithm is used to determine the initial band set, and the band set is gradually optimized through the sequence floating backward selection algorithm to build the optimal nitrogen content inversion model of poplar leaves.

Benefits of technology

It effectively reduces the complexity of the inversion model, improves the accuracy and calculation efficiency of the model, and realizes high-precision inversion of the nitrogen content of poplar leaves.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119418210A_ABST
    Figure CN119418210A_ABST
Patent Text Reader

Abstract

The invention discloses a poplar leaf nitrogen content inversion method and system based on hyperspectral image data. The method comprises the steps that S1, unmanned aerial vehicle hyperspectral image data and leaf sample nitrogen content data of a poplar planting area are acquired; s2, preprocessing the hyperspectral image data, extracting corresponding wave band reflectivity data according to the leaf sample position and the preprocessed hyperspectral image data, constructing a data set which comprises the leaf sample nitrogen content and the corresponding wave band reflectivity data, and dividing the data set into a training set and a verification set; s3, determining an initial wave band set of poplar leaf nitrogen content inversion by using a deep neural network DNN in combination with an SHAP algorithm; and S4, determining an optimal waveband set of poplar leaf nitrogen content inversion by using a sequence floating backward selection algorithm, and further determining a final poplar leaf nitrogen content inversion model. With the adoption of the method, high-precision inversion can be realized for leaf samples with different nitrogen contents.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of forestry physiological and biochemical phenotypic parameter inversion, and in particular to a method and system for inverting nitrogen content in poplar leaves based on hyperspectral image data. Background Art

[0002] Poplar is one of the important fast-growing timber species widely cultivated in the temperate plains of China. This species grows rapidly and has a wide range of applications in ecological protection forestry and industrial timber planting. Poplars have a variety of genotypes, showing different phenotypic traits. Understanding the phenotypic traits of different genotypes not only provides a solid foundation for its breeding, but also provides important information for the development and improvement of its varieties. Leaf nitrogen content is an important physiological and biochemical phenotypic parameter, which is closely related to poplar photosynthesis and affects its growth rate, biomass accumulation and stress resistance. In recent years, the rapid development of UAV hyperspectral remote sensing technology has provided rich spectral information for the inversion (prediction) of leaf nitrogen content at the scale of a single tree, and has become an important method for the inversion of physiological and biochemical parameters in agriculture and forestry at low altitude scale.

[0003] Although hyperspectral image data has rich canopy reflectance information, the Hughes phenomenon is prone to occur due to the high correlation between bands, which seriously affects the accuracy and computational efficiency of the inversion model. Current related research is mainly based on the embedded feature selection algorithm to obtain the band importance ranking, and the dimension reduction is performed by predefining the number of bands used in the model or according to the predefined step size. However, the above method predefines the regression model, which limits the choice of model algorithm form. Secondly, the above method ignores the change of feature contribution under dynamic set conditions, which increases the error in the band elimination process. In addition, the embedded feature selection algorithm cannot realize the optimal subset search and cannot eliminate the inversion error caused by the interaction between bands. The above factors have affected the accuracy and computing speed of the inversion of nitrogen content in poplar leaves, and the degree of data mining is seriously insufficient.

[0004] Therefore, it is an urgent problem to design a reasonable and high-precision method for inverting nitrogen content in poplar leaves based on UAV hyperspectral image data. Summary of the invention

[0005] The present invention provides a method and system for inverting the nitrogen content of poplar leaves based on hyperspectral image data, which is used to solve the problems existing in the above-mentioned prior art. The technical solution is as follows:

[0006] On the one hand, a method for inverting nitrogen content of poplar leaves based on hyperspectral image data is provided, including:

[0007] S1. Obtain UAV hyperspectral image data of poplar planting areas and leaf sample nitrogen content data;

[0008] S2, preprocessing the hyperspectral image data, extracting corresponding band reflectance data according to the leaf sample position and the preprocessed hyperspectral image data, constructing a data set, the data set including the leaf sample nitrogen content and the corresponding band reflectance data, and dividing the data set into a training set and a validation set;

[0009] S3. Use deep neural network DNN combined with SHAP algorithm to determine the initial band set for inversion of nitrogen content in poplar leaves;

[0010] S4. Use the sequence floating backward selection algorithm to determine the optimal band set for the inversion of nitrogen content in poplar leaves, and then determine the final poplar leaf nitrogen content inversion model.

[0011] Optionally, the step S2 of preprocessing the hyperspectral image data specifically includes:

[0012] Performing radiation calibration, geometric correction and orthorectification on the acquired hyperspectral image data to obtain band reflectance data;

[0013] The bands below 400nm and above 900nm are eliminated, and the spectral data is smoothed by Savitzky-Golay filtering to obtain a smooth spectral curve within the range of 400-900nm, a total of 250 bands, and the calculation formula is as follows:

[0014]

[0015] in is the reflectivity value after filtering, y(t+i) is the original signal value in the sliding window, c i is the coefficient of the filter, which is determined by the polynomial fitted by the least squares method. m is half the window size. The window length is 2m+1, and the value of m is 5.

[0016] Optionally, the S3 specifically includes:

[0017] S31. Constructing the initial inversion model:

[0018] Based on the training set data, a deep neural network DNN was used to construct an initial inversion model for nitrogen content in poplar leaves. The SHAP algorithm was combined to calculate the contribution of each band to the model output, and the SHAP value of each band was output. The bands were sorted according to the SHAP value to determine the importance of each band in the inversion process. The model performance was verified using a validation set, and the validation set accuracy was calculated and output as the evaluation index of the model.

[0019] S32, gradually remove low importance bands:

[0020] Set the step size to 10, start removing the bottom 10 bands, build a new inversion model, use the removed bands to retrain the model, calculate the new SHAP value and validation set accuracy, and sort the remaining bands according to the updated SHAP value;

[0021] S33, loop iteration until the number of bands is 0:

[0022] Repeat the previous step iteratively, continue to remove the bottom 10 bands, build a new inversion model, calculate the new SHAP value and validation set accuracy, monitor the changes in model performance in each iteration, and record the validation set accuracy of each iteration until the number of bands drops to 0, and then end the iteration;

[0023] S34, determining an initial band set:

[0024] The accuracy of the validation set in each iteration process is compared to find the band set corresponding to the model with the highest accuracy, and the band set corresponding to the model with the highest accuracy is determined as the initial band set for inversion of the nitrogen content of the poplar leaves.

[0025] Optionally, the calculation formula of the SHAP value is as follows:

[0026]

[0027] where φ i represents the SHAP value, N is the set of all bands; S is a subset, which represents the set of bands considered when calculating the SHAP value, and represents all subsets that do not contain band i; f(S) is the model prediction of the band subset S; |S| is the number of bands in the subset S; |N| is the total number of bands, |N|-|S|≥1; f(S∪{i}) represents the model prediction output obtained by taking the union of the band set S and band i as input; is a combination coefficient used to calculate the weight of the marginal contribution when band i is added to the band set S. This weight takes into account all possible band combinations to ensure that the contribution of each band is fairly evaluated.

[0028] Optionally, the S4 specifically includes:

[0029] S41, band subset backward selection:

[0030] Remove each band from the current initial band set in turn, retrain the model, calculate and record the validation set accuracy of each removed band subset, compare and retain the band subset with the highest accuracy;

[0031] S42, band subset forward floating:

[0032] After removing the bands, the removed bands are added back to the current band subset one by one, and the inversion model is retrained to evaluate its validation set accuracy. If the model accuracy is improved after re-adding a band, the band is added back to the band subset;

[0033] S43, Algorithm iteration and model determination:

[0034] The band subsets were continuously optimized by alternating backward selection and forward floating steps. When no band could be removed or added to improve the accuracy of the model validation set, the iterative process stopped and the model with the best accuracy was used as the final inversion model for nitrogen content in poplar leaves.

[0035] On the other hand, a poplar leaf nitrogen content inversion system based on hyperspectral image data is provided, the system comprising:

[0036] The acquisition module is used to obtain the UAV hyperspectral image data of the poplar planting area and the nitrogen content data of leaf samples;

[0037] A processing module, used to pre-process the hyperspectral image data, extract corresponding band reflectance data according to the leaf sample position and the pre-processed hyperspectral image data, construct a data set, the data set includes the leaf sample nitrogen content and the corresponding band reflectance data, and divide it into a training set and a validation set;

[0038] The first determination module is used to determine the initial band set for inversion of nitrogen content in poplar leaves by using a deep neural network DNN combined with a SHAP algorithm;

[0039] The second determination module is used to determine the optimal band set for inversion of nitrogen content in poplar leaves by using a sequence floating backward selection algorithm, and then determine the final poplar leaf nitrogen content inversion model.

[0040] Optionally, the processing module is specifically used to:

[0041] Performing radiation calibration, geometric correction and orthorectification on the acquired hyperspectral image data to obtain band reflectance data;

[0042] The bands below 400nm and above 900nm are eliminated, and the spectral data is smoothed by Savitzky-Golay filtering to obtain a smooth spectral curve within the range of 400-900nm, a total of 250 bands, and the calculation formula is as follows:

[0043]

[0044] in is the reflectivity value after filtering, y(t+i) is the original signal value in the sliding window, c iis the coefficient of the filter, which is determined by the polynomial fitted by the least squares method. m is half the window size. The window length is 2m+1, and the value of m is 5.

[0045] Optionally, the first determining module is specifically configured to:

[0046] Construct the initial inversion model:

[0047] Based on the training set data, a deep neural network DNN was used to construct an initial inversion model for nitrogen content in poplar leaves. The SHAP algorithm was combined to calculate the contribution of each band to the model output, and the SHAP value of each band was output. The bands were sorted according to the SHAP value to determine the importance of each band in the inversion process. The model performance was verified using a validation set, and the validation set accuracy was calculated and output as the evaluation index of the model.

[0048] Stepwise remove bands of low importance:

[0049] Set the step size to 10, start removing the bottom 10 bands, build a new inversion model, use the removed bands to retrain the model, calculate the new SHAP value and validation set accuracy, and sort the remaining bands according to the updated SHAP value;

[0050] The loop iterates until the number of bands reaches 0:

[0051] Repeat the previous step iteratively, continue to remove the bottom 10 bands, build a new inversion model, calculate the new SHAP value and validation set accuracy, monitor the changes in model performance in each iteration, and record the validation set accuracy of each iteration until the number of bands drops to 0, and then end the iteration;

[0052] Determine the initial set of bands:

[0053] The accuracy of the validation set in each iteration process is compared to find the band set corresponding to the model with the highest accuracy, and the band set corresponding to the model with the highest accuracy is determined as the initial band set for inversion of the nitrogen content of the poplar leaves.

[0054] Optionally, the calculation formula of the SHAP value is as follows:

[0055]

[0056] where φ irepresents the SHAP value, N is the set of all bands; S is a subset, which represents the set of bands considered when calculating the SHAP value, and represents all subsets that do not contain band i; f(S) is the model prediction of the band subset S; |S| is the number of bands in the subset S; |N| is the total number of bands, |N|-|S|≥1; f(S∪{i}) represents the model prediction output obtained by taking the union of the band set S and band i as input; is a combination coefficient used to calculate the weight of the marginal contribution when band i is added to the band set S. This weight takes into account all possible band combinations to ensure that the contribution of each band is fairly evaluated.

[0057] Optionally, the second determining module is specifically configured to:

[0058] Band subset backward selection:

[0059] Remove each band from the current initial band set in turn, retrain the model, calculate and record the validation set accuracy of each removed band subset, compare and retain the band subset with the highest accuracy;

[0060] Band subset forward float:

[0061] After removing the bands, the removed bands are added back to the current band subset one by one, and the inversion model is retrained to evaluate its validation set accuracy. If the model accuracy is improved after re-adding a band, the band is added back to the band subset;

[0062] Algorithm iteration and model determination:

[0063] The band subsets were continuously optimized by alternating backward selection and forward floating steps. When no band could be removed or added to improve the accuracy of the model validation set, the iterative process stopped and the model with the best accuracy was used as the final inversion model for nitrogen content in poplar leaves.

[0064] On the other hand, an electronic device is provided, comprising a processor and a memory, wherein the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the above-mentioned method for inverting nitrogen content in poplar leaves based on hyperspectral image data.

[0065] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction is stored in the storage medium, and the at least one instruction is loaded and executed by a processor to implement the above-mentioned method for inverting nitrogen content in poplar leaves based on hyperspectral image data.

[0066] The beneficial effects brought about by the technical solution provided by the present invention include at least:

[0067] The present invention can effectively determine the optimal waveband for inversion of nitrogen content in poplar leaves, reduce the complexity of the inversion model, and improve the accuracy of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0069] Figure 1 This is a flow chart of a method for inverting nitrogen content in poplar leaves based on hyperspectral image data provided by an embodiment of the present invention;

[0070] Figure 2 is a verification set scatter plot provided by an embodiment of the present invention;

[0071] Figure 3 It is a technical roadmap of a method for inverting nitrogen content of poplar leaves based on hyperspectral image data provided by an embodiment of the present invention;

[0072] Figure 4 It is a block diagram of a poplar leaf nitrogen content inversion system based on hyperspectral image data provided by an embodiment of the present invention;

[0073] Figure 5 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0074] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.

[0075] The embodiment of the present invention provides a method for inverting the nitrogen content of poplar leaves based on hyperspectral image data. The method can be implemented by an electronic device, which can be a terminal or a server. Figure 1 The flowchart of a method for inverting nitrogen content of poplar leaves based on hyperspectral image data is shown in FIG. The processing flow of the method may include the following steps:

[0076] S1. Obtain UAV hyperspectral image data of poplar planting areas and leaf sample nitrogen content data;

[0077] The embodiment of the present invention selects 10:00-14:00 Beijing time in windless and cloudless weather to obtain UAV hyperspectral image data of the poplar planting area, with a flight altitude of 100m, a spatial resolution of 5cm, a band range of 393-1007nm, and a spectral resolution of 2nm.

[0078] In the embodiment of the present invention, poplar leaves are manually collected and GPS points are recorded. After the collection is completed, the leaves are placed in an oven at 105° C. for 30 minutes, then adjusted to 70° C. and dried to constant weight, and then processed by Kjeldahl method to obtain the nitrogen content of the leaves.

[0079] S2, preprocessing the hyperspectral image data, extracting corresponding band reflectance data according to the leaf sample position and the preprocessed hyperspectral image data, constructing a data set, the data set including the leaf sample nitrogen content and the corresponding band reflectance data, and dividing the data set into a training set and a validation set;

[0080] Optionally, the step S2 of preprocessing the hyperspectral image data specifically includes:

[0081] Performing radiation calibration, geometric correction and orthorectification on the acquired hyperspectral image data to obtain band reflectance data;

[0082] The bands below 400nm and above 900nm are removed (to reduce the influence of water vapor), and the spectral data is smoothed by Savitzky-Golay filtering to obtain a smooth spectral curve in the range of 400-900nm, with a total of 250 bands. The calculation formula is as follows:

[0083]

[0084] in is the reflectivity value after filtering, y(t+i) is the original signal value in the sliding window, c i is the coefficient of the filter, which is determined by the polynomial fitted by the least squares method. m is half the window size. The window length is 2m+1, and the value of m is 5.

[0085] The data set constructed in the embodiment of the present invention includes leaf nitrogen content and its corresponding 250 band reflectance data in the range of 400-900nm. 2 / 3 of the data set are randomly selected as a training set, and the remaining 1 / 3 are used as a validation set.

[0086] S3. Use deep neural network DNN combined with SHAP algorithm to determine the initial band set for inversion of nitrogen content in poplar leaves;

[0087] Optionally, the S3 specifically includes:

[0088] S31. Constructing the initial inversion model:

[0089] Based on the training set data, a deep neural network DNN is used to construct an initial inversion model for nitrogen content in poplar leaves (the specific construction method is a prior art and will not be repeated here), and the SHAP (SHapley Additive exPlanation) algorithm is combined to calculate the contribution of each band to the model output, output the SHAP value of each band, sort the bands according to the SHAP value, determine the importance of each band in the inversion process, and use the validation set to verify the model performance, and calculate and output the validation set accuracy as the evaluation index of the model;

[0090] The number of hidden layers of the DNN model in the embodiment of the present invention is set to 4 layers, with 28 neurons in each layer, the activation function is ReLU, the optimizer is Adam, the learning rate is 0.001, the batch size and the number of iterations are 64 and 200 respectively, the Dropout is 0.3, and the loss function is the root mean square error RMSE. The inversion model is constructed using the training set and the SHAP value is output. The bands are sorted according to the SHAP value to determine the importance of each band in the inversion process. Then the model performance is verified using the validation set, and the validation set accuracy R is calculated and output. 2 and RMSE are used as evaluation indicators of the model.

[0091] S32, gradually remove low importance bands:

[0092] Set the step size to 10, start removing the bottom 10 bands, build a new inversion model, use the removed bands to retrain the model, calculate the new SHAP value and validation set accuracy, and sort the remaining bands according to the updated SHAP value;

[0093] S33, loop iteration until the number of bands is 0:

[0094] Repeat the previous step iteratively, continue to remove the bottom 10 bands, build a new inversion model, calculate the new SHAP value and validation set accuracy, monitor the changes in model performance in each iteration, and record the validation set accuracy of each iteration until the number of bands drops to 0, and then end the iteration;

[0095] S34, determining an initial band set:

[0096] The accuracy of the validation set in each iteration process is compared to find the band set corresponding to the model with the highest accuracy, and the band set corresponding to the model with the highest accuracy is determined as the initial band set for inversion of the nitrogen content of the poplar leaves.

[0097] Optionally, the calculation formula of the SHAP value is as follows:

[0098]

[0099] where φi represents the SHAP value, N is the set of all bands; S is a subset, which represents the set of bands considered when calculating the SHAP value, and represents all subsets that do not contain band i; f(S) is the model prediction of the band subset S; |S| is the number of bands in the subset S; |N| is the total number of bands, |N|-|S|≥1; f(S∪{i}) represents the model prediction output obtained by taking the union of the band set S and band i as input; is a combination coefficient used to calculate the weight of the marginal contribution when band i is added to the band set S. This weight takes into account all possible band combinations to ensure that the contribution of each band is fairly evaluated.

[0100] S4. Use the sequence floating backward selection algorithm to determine the optimal band set for the inversion of nitrogen content in poplar leaves, and then determine the final poplar leaf nitrogen content inversion model.

[0101] Optionally, the S4 specifically includes:

[0102] S41, band subset backward selection:

[0103] Remove each band from the current initial band set in turn, retrain the model, calculate and record the validation set accuracy of each removed band subset, compare and retain the band subset with the highest accuracy;

[0104] Assuming that there are 100 bands in the initial band set determined in step S3, first remove the first band from the 100 bands, retrain the model, calculate and record the validation set accuracy of the band subset (the second band - the 100th band) after removing the first band; then remove the second band from the 100 bands, retrain the model, calculate and record the validation set accuracy of the band subset (the first band, the third band - the 100th band) after removing the second band; then remove the third band from the 100 bands, retrain the model, calculate and record the validation set accuracy after removing the third band. The validation set accuracy of the band subset (the 1st band, the 2nd band, the 4th to the 100th band); ...; until the 100th band is removed from the 100 bands, and the model is retrained, the validation set accuracy of the band subset (the 1st to the 99th band) after the 100th band is removed is calculated and recorded; the band subset with the highest accuracy is compared and retained, assuming that the band subset with the highest accuracy is (the 1st to the 7th band, the 9th to the 100th band), that is, the band subset with the 8th band removed, that is, the current band subset is (the 1st to the 7th band, the 9th to the 100th band).

[0105] S42, band subset forward floating:

[0106] After removing the bands, the removed bands are added back to the current band subset one by one, and the inversion model is retrained to evaluate its validation set accuracy. If the model accuracy is improved after re-adding a band, the band is added back to the band subset;

[0107] The removed 8th band is added back to the current band subset (bands 1-7, bands 9-100). If the performance is not improved, the 8th band is not added. In the next iteration, the current band subset is still (bands 1-7, bands 9-100).

[0108] S43, Algorithm iteration and model determination:

[0109] The band subsets were continuously optimized by alternating backward selection and forward floating steps. When no band could be removed or added to improve the accuracy of the model validation set, the iterative process stopped and the model with the best accuracy was used as the final inversion model for nitrogen content in poplar leaves.

[0110] In the second iteration, the current band subset (bands 1-7, bands 9-100) is used as the initial band set. The first band is removed from the 99 bands, and the model is retrained. The validation set accuracy of the band subsets after removing the first band (bands 2-7, bands 9-100) is calculated and recorded; then the second band is removed from the 99 bands, and the model is retrained. The validation set accuracy of the band subsets after removing the second band (bands 1, 3-7, bands 9-100) is calculated and recorded; then the third band is removed from the 99 bands, and the model is retrained. The validation set accuracy of the band subsets after removing the third band is calculated and recorded. The validation set accuracy of the band subsets (1st band, 2nd band, 4th-7th band, 9th-100th band); ...; until the 100th band is removed from the 99 bands, and the model is retrained, the validation set accuracy of the band subsets after removing the 100th band (1st-7th band, 9th-99th band) is calculated and recorded; compare and retain the band subset with the highest accuracy, assuming that the band subset with the highest accuracy is (1st-4th band, 6th-7th band, 9th-100th band), that is, the band subset with the 5th band removed, that is, the current band subset is (1st-4th band, 6th-7th band, 9th-100th band).

[0111] Add the removed 8th band back to the current band subset (bands 1-4, bands 6-7, bands 9-100). If the performance does not improve, the 8th band will not be added.

[0112] The removed 5th band is added back to the current band subset (bands 1-4, bands 6-7, bands 9-100). If the performance is not improved, the 5th band is not added. In the next iteration, the current band subset is still (bands 1-4, bands 6-7, bands 9-100).

[0113] In the third iteration, the current band subset (bands 1-4, bands 6-7, bands 9-100) is used as the initial band set, and each band is removed from the current initial band set in turn, and the model is retrained. The validation set accuracy of each removed band subset is calculated and recorded, and the band subset with the highest accuracy is compared and retained. Assume that the band subset with the highest accuracy is (bands 1-4, bands 6-7, bands 9-12, bands 14-100), that is, the band subset of the 13th band is removed, that is, the current band subset is (bands 1-4, bands 6-7, bands 9-12, bands 14-100).

[0114] The 8th, 5th and 13th removed bands are added to the current band subset respectively, and the inversion model is retrained to evaluate its verification set accuracy (the sequence floating backward selection algorithm of the embodiment of the present invention has basically no effect on the first few iterations, no new band subsets appear, and the verification set accuracy is not improved. However, when the number of current band subsets drops to, for example, 50, adding a deleted band may not only lead to the emergence of new band subsets, but also improve the verification set accuracy).

[0115] The purpose of the embodiment of the present invention is to search for the optimal band set for inversion of nitrogen content in poplar leaves, and to construct an inversion model. The sequential floating backward selection algorithm can achieve the above goal through iteration, but when the number of bands in the set is too large, the computational efficiency of the method will also be low. Therefore, the embodiment of the present invention determines the initial band set by finding the bands that can cover the important information in the original band set, thereby reducing the amount of calculation and improving the search speed of the optimal band set. Why should we perform further screening based on the initial band set? On the one hand, the band autocorrelation in the initial band set will affect the final inversion accuracy, and on the other hand, the low-correlated bands will also increase the uncertainty of the model. Therefore, it is necessary to gradually eliminate the bands that affect the model accuracy through the sequential floating backward selection algorithm to further improve the accuracy and computational efficiency.

[0116] The optimal band subset for inverting the nitrogen content of poplar leaves obtained by the method of the embodiment of the present invention is shown in Table 21, and the subset includes 24 bands, namely 435nm, 437nm, 439nm, 441nm, 449nm, 465nm, 525nm, 559nm, 671nm, 679nm, 681nm, 685nm, 691nm, 695nm, 697nm, 701nm, 703nm, 715nm, 723nm, 731nm, 741nm, 747nm, 887nm, and 891nm. The above bands are mainly concentrated in the blue band (430nm-470nm) and the red edge band (680nm-780nm).

[0117] The scatter plot of the validation set is as follows Figure 2 As shown in the figure, it can be seen that the model can well map the relationship between band reflectance and leaf nitrogen content, R 2 and RMSE were 0.946 and 1.859 g / kg respectively. The results showed no obvious overestimation of low values ​​or underestimation of high values, and the fitting line was close to the 1:1 line, which proved that the model can achieve high-precision inversion for leaf samples with different nitrogen contents.

[0118] Table 1 Optimal band subsets used in the inversion model for nitrogen content in poplar leaves

[0119]

[0120] The technical route of a method for inverting nitrogen content of poplar leaves based on hyperspectral image data provided by an embodiment of the present invention is also as follows: Figure 3 shown.

[0121] like Figure 4 The embodiment of the present invention further provides a poplar leaf nitrogen content inversion system based on hyperspectral image data, the system comprising:

[0122] An acquisition module 410 is used to acquire UAV hyperspectral image data of the poplar planting area and leaf sample nitrogen content data;

[0123] The processing module 420 is used to pre-process the hyperspectral image data, extract the corresponding band reflectance data according to the leaf sample position and the pre-processed hyperspectral image data, construct a data set, the data set includes the nitrogen content of the leaf sample and the corresponding band reflectance data, and divide it into a training set and a validation set;

[0124] The first determination module 430 is used to determine the initial band set for inversion of nitrogen content in poplar leaves by using a deep neural network DNN combined with a SHAP algorithm;

[0125] The second determination module 440 is used to determine the optimal band set for inversion of nitrogen content in poplar leaves by using a sequence floating backward selection algorithm, and then determine the final inversion model for nitrogen content in poplar leaves.

[0126] Optionally, the processing module is specifically used to:

[0127] Performing radiation calibration, geometric correction and orthorectification on the acquired hyperspectral image data to obtain band reflectance data;

[0128] The bands below 400nm and above 900nm are eliminated, and the spectral data is smoothed by Savitzky-Golay filtering to obtain a smooth spectral curve within the range of 400-900nm, a total of 250 bands, and the calculation formula is as follows:

[0129]

[0130] in is the reflectivity value after filtering, y(t+i) is the original signal value in the sliding window, c i is the coefficient of the filter, which is determined by the polynomial fitted by the least squares method. m is half the window size. The window length is 2m+1, and the value of m is 5.

[0131] Optionally, the first determining module is specifically configured to:

[0132] Construct the initial inversion model:

[0133] Based on the training set data, a deep neural network DNN was used to construct an initial inversion model for nitrogen content in poplar leaves. The SHAP algorithm was combined to calculate the contribution of each band to the model output, and the SHAP value of each band was output. The bands were sorted according to the SHAP value to determine the importance of each band in the inversion process. The model performance was verified using a validation set, and the validation set accuracy was calculated and output as the evaluation index of the model.

[0134] Stepwise remove bands of low importance:

[0135] Set the step size to 10, start removing the bottom 10 bands, build a new inversion model, use the removed bands to retrain the model, calculate the new SHAP value and validation set accuracy, and sort the remaining bands according to the updated SHAP value;

[0136] The loop iterates until the number of bands reaches 0:

[0137] Repeat the previous step iteratively, continue to remove the bottom 10 bands, build a new inversion model, calculate the new SHAP value and validation set accuracy, monitor the changes in model performance in each iteration, and record the validation set accuracy of each iteration until the number of bands drops to 0, and then end the iteration;

[0138] Determine the initial set of bands:

[0139] The accuracy of the validation set in each iteration process is compared to find the band set corresponding to the model with the highest accuracy, and the band set corresponding to the model with the highest accuracy is determined as the initial band set for inversion of the nitrogen content of the poplar leaves.

[0140] Optionally, the calculation formula of the SHAP value is as follows:

[0141]

[0142] where φ i represents the SHAP value, N is the set of all bands; S is a subset, which represents the set of bands considered when calculating the SHAP value, and represents all subsets that do not contain band i; f(S) is the model prediction of the band subset S; |S| is the number of bands in the subset S; |N| is the total number of bands, |N|-|S|≥1; f(S∪{i}) represents the model prediction output obtained by taking the union of the band set S and band i as input; |S|! (|N|-|S|-1)!

[0143] |N|! is a combination coefficient used to calculate the weight of the marginal contribution of band i when it is added to the band set S. This weight takes into account all possible band combinations to ensure that the contribution of each band is fairly evaluated.

[0144] Optionally, the second determining module is specifically configured to:

[0145] Band subset backward selection:

[0146] Remove each band from the current initial band set in turn, retrain the model, calculate and record the validation set accuracy of each removed band subset, compare and retain the band subset with the highest accuracy;

[0147] Band subset forward float:

[0148] After removing the bands, the removed bands are added back to the current band subset one by one, and the inversion model is retrained to evaluate its validation set accuracy. If the model accuracy is improved after re-adding a band, the band is added back to the band subset;

[0149] Algorithm iteration and model determination:

[0150] The band subsets were continuously optimized by alternating backward selection and forward floating steps. When no band could be removed or added to improve the accuracy of the model validation set, the iterative process stopped and the model with the best accuracy was used as the final inversion model for nitrogen content in poplar leaves.

[0151] An embodiment of the present invention provides a poplar leaf nitrogen content inversion system based on hyperspectral image data, and its functional structure corresponds to a poplar leaf nitrogen content inversion method based on hyperspectral image data provided by an embodiment of the present invention, which will not be repeated here.

[0152] Figure 5 It is a structural schematic diagram of an electronic device 500 provided in an embodiment of the present invention. The electronic device 500 may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 501 and one or more memories 502, wherein at least one instruction is stored in the memory 502, and the at least one instruction is loaded and executed by the processor 501 to implement the steps of the above-mentioned method for inverting nitrogen content in poplar leaves based on hyperspectral image data.

[0153] In an exemplary embodiment, a computer-readable storage medium is also provided, such as a memory including instructions, which can be executed by a processor in a terminal to complete the above-mentioned method for inverting the nitrogen content of poplar leaves based on hyperspectral image data. For example, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0154] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0155] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for inverting nitrogen content in poplar leaves based on hyperspectral image data, characterized in that: The method comprises: S1. Obtain UAV hyperspectral image data of poplar planting areas and leaf sample nitrogen content data; S2, preprocessing the hyperspectral image data, extracting corresponding band reflectance data according to the leaf sample position and the preprocessed hyperspectral image data, constructing a data set, the data set including the leaf sample nitrogen content and the corresponding band reflectance data, and dividing the data set into a training set and a validation set; S3. Use deep neural network DNN combined with SHAP algorithm to determine the initial band set for inversion of nitrogen content in poplar leaves; S4. Use the sequence floating backward selection algorithm to determine the optimal band set for the inversion of nitrogen content in poplar leaves, and then determine the final poplar leaf nitrogen content inversion model.

2. The method according to claim 1, characterized in that: The hyperspectral image data is preprocessed in S2, specifically including: Performing radiation calibration, geometric correction and orthorectification on the acquired hyperspectral image data to obtain band reflectance data; The bands below 400nm and above 900nm are eliminated, and the spectral data is smoothed by Savitzky-Golay filtering to obtain a smooth spectral curve within the range of 400-900nm, a total of 250 bands, and the calculation formula is as follows: in is the reflectance value after filtering, is the original signal value in the sliding window, c i is the coefficient of the filter, which is determined by the polynomial fitted by the least squares method. m is half the window size. The window length is 2m+1, and the value of m is 5.

3. The method according to claim 1, characterized in that The S3 specifically includes: S31. Constructing the initial inversion model: Based on the training set data, a deep neural network DNN was used to construct an initial inversion model for nitrogen content in poplar leaves. The SHAP algorithm was combined to calculate the contribution of each band to the model output, and the SHAP value of each band was output. The bands were sorted according to the SHAP value to determine the importance of each band in the inversion process. The model performance was verified using a validation set, and the validation set accuracy was calculated and output as the evaluation index of the model. S32, gradually remove low importance bands: Set the step size to 10, start removing the bottom 10 bands, build a new inversion model, use the removed bands to retrain the model, calculate the new SHAP value and validation set accuracy, and sort the remaining bands according to the updated SHAP value; S33, loop iteration until the number of bands is 0: Repeat the previous step iteratively, continue to remove the bottom 10 bands, build a new inversion model, calculate the new SHAP value and validation set accuracy, monitor the changes in model performance in each iteration, and record the validation set accuracy of each iteration until the number of bands drops to 0, and then end the iteration; S34, determining an initial band set: The accuracy of the validation set in each iteration process is compared to find the band set corresponding to the model with the highest accuracy, and the band set corresponding to the model with the highest accuracy is determined as the initial band set for inversion of the nitrogen content of the poplar leaves.

4. The method according to claim 3, characterized in that The calculation formula of the SHAP value is as follows: where φ i represents the SHAP value, N is the set of all bands; S is a subset, which represents the set of bands considered when calculating the current SHAP value, representing all subsets that do not contain band i; f(S) is the model prediction of the band subset S; |S| is the number of bands in the subset S; |N| is the total number of bands, f(S∪{i}) represents the model prediction output obtained by taking the union of band set S and band i as input; is a combination coefficient used to calculate the weight of the marginal contribution when band i is added to the band set S. This weight takes into account all possible band combinations to ensure that the contribution of each band is fairly evaluated.

5. The method according to claim 1, characterized in that The S4 specifically includes: S41, band subset backward selection: Remove each band from the current initial band set in turn, retrain the model, calculate and record the validation set accuracy of each removed band subset, compare and retain the band subset with the highest accuracy; S42, band subset forward floating: After removing the bands, the removed bands are added back to the current band subset one by one, and the inversion model is retrained to evaluate its validation set accuracy. If the model accuracy is improved after re-adding a band, the band is added back to the band subset; S43, Algorithm iteration and model determination: The band subsets were continuously optimized by alternating backward selection and forward floating steps. When no band could be removed or added to improve the accuracy of the model validation set, the iterative process stopped and the model with the best accuracy was used as the final inversion model for nitrogen content in poplar leaves.

6. A poplar leaf nitrogen content inversion system based on hyperspectral image data, characterized in that: The system comprises: The acquisition module is used to obtain the UAV hyperspectral image data of the poplar planting area and the nitrogen content data of leaf samples; A processing module, used to pre-process the hyperspectral image data, extract corresponding band reflectance data according to the leaf sample position and the pre-processed hyperspectral image data, construct a data set, the data set includes the leaf sample nitrogen content and the corresponding band reflectance data, and divide it into a training set and a validation set; The first determination module is used to determine the initial band set for inversion of nitrogen content in poplar leaves by using a deep neural network DNN combined with a SHAP algorithm; The second determination module is used to determine the optimal band set for inversion of nitrogen content in poplar leaves by using a sequence floating backward selection algorithm, and then determine the final poplar leaf nitrogen content inversion model.

7. The system according to claim 6, characterized in that The processing module is specifically used for: Performing radiation calibration, geometric correction and orthorectification on the acquired hyperspectral image data to obtain band reflectance data; The bands below 400nm and above 900nm are eliminated, and the spectral data is smoothed by Savitzky-Golay filtering to obtain a smooth spectral curve within the range of 400-900nm, a total of 250 bands, and the calculation formula is as follows: in is the reflectance value after filtering, is the original signal value in the sliding window, c i is the coefficient of the filter, which is determined by the polynomial fitted by the least squares method. m is half the window size. The window length is 2m+1, and the value of m is 5.

8. The system according to claim 6, characterized in that The first determining module is specifically configured to: Construct the initial inversion model: Based on the training set data, a deep neural network DNN was used to construct an initial inversion model for nitrogen content in poplar leaves. The SHAP algorithm was combined to calculate the contribution of each band to the model output, and the SHAP value of each band was output. The bands were sorted according to the SHAP value to determine the importance of each band in the inversion process. The model performance was verified using a validation set, and the validation set accuracy was calculated and output as the evaluation index of the model. Stepwise remove bands of low importance: Set the step size to 10, start removing the bottom 10 bands, build a new inversion model, use the removed bands to retrain the model, calculate the new SHAP value and validation set accuracy, and sort the remaining bands according to the updated SHAP value; The loop iterates until the number of bands reaches 0: Repeat the previous step iteratively, continue to remove the bottom 10 bands, build a new inversion model, calculate the new SHAP value and validation set accuracy, monitor the changes in model performance in each iteration, and record the validation set accuracy of each iteration until the number of bands drops to 0, and then end the iteration; Determine the initial set of bands: The accuracy of the validation set in each iteration process is compared to find the band set corresponding to the model with the highest accuracy, and the band set corresponding to the model with the highest accuracy is determined as the initial band set for inversion of the nitrogen content of the poplar leaves.

9. The system according to claim 8, characterized in that The calculation formula of the SHAP value is as follows: where φ i represents the SHAP value, N is the set of all bands; S is a subset, which represents the set of bands considered when calculating the SHAP value, and represents all subsets that do not contain band i; f(S) is the model prediction of the band subset S; |S| is the number of bands in the subset S; |N| is the total number of bands, |N|-|S|≥1; f(S∪{i}) represents the model prediction output obtained by taking the union of the band set S and band i as input; is a combination coefficient used to calculate the weight of the marginal contribution when band i is added to the band set S. This weight takes into account all possible band combinations to ensure that the contribution of each band is fairly evaluated.

10. The system according to claim 6, characterized in that The second determining module is specifically used to: Band subset backward selection: Remove each band from the current initial band set in turn, retrain the model, calculate and record the validation set accuracy of each removed band subset, compare and retain the band subset with the highest accuracy; Band subset forward float: After removing the bands, the removed bands are added back to the current band subset one by one, and the inversion model is retrained to evaluate its validation set accuracy. If the model accuracy is improved after re-adding a band, the band is added back to the band subset; Algorithm iteration and model determination: The band subsets were continuously optimized by alternating backward selection and forward floating steps. When no band could be removed or added to improve the accuracy of the model validation set, the iterative process stopped and the model with the best accuracy was used as the final inversion model for nitrogen content in poplar leaves.

Citation Information

Patent Citations

  • Crop total nitrogen content inversion method and system based on hyperspectral remote sensing

    CN114036461A

  • Hyperspectral inversion method for soil organic matter content

    CN116297239A

  • Method and system for optimizing self-adaptive blockage-relieving traffic organization scheme

    CN116777239A

  • Inversion method of nitrogen content of apple canopy leaves based on hyperspectrum

    CN117933084A

  • Inland lake water depth inversion method based on lake bottom classification

    CN118296463A

Cited By

  • Polarization hyperspectral water quality monitoring system and method

    CN121740763A