Spectral Diagnostic Model for Agricultural Robot System Based on Binary Wavelet Algorithm

The application of agricultural robots can liberate labor. The improvement of robot sensing systems is the premise of making it work. At present, more research is being conducted on weeding and harvesting systems of field robot, but less research is being conducted on crop disease and insect pest perception, nutritional element diagnosis and precision fertilizer spraying systems. In this study, the effects of the nitrogen application rate on the absorption and accumulation of nitrogen, phosphorus and potassium in sweet maize were determined. Firstly, linear, parabolic, exponential and logarithmic diagnostic models of nitrogen, phosphorus and potassium contents were constructed by spectral characteristic variables. Secondly, the partial least squares regression and neural network nonlinear diagnosis model of nitrogen, phosphorus and potassium contents were constructed by the high-frequency wavelet sensitivity coefficient of binary wavelet decomposition. The results show that the neural network nonlinear diagnosis model of nitrogen, phosphorus and potassium content based on the high-frequency wavelet sensitivity coefficient of binary wavelet decomposition is better. The R2, MRE and NRMSE of nn of nitrogen, phosphorus and potassium were 0.974, 1.65% and 0.0198; 0.969, 9.02% and 0.1041; and 0.821, 2.16% and 0.0301, respectively. The model can provide growth monitoring for sweet corn and a perception model for the nutrient element perception system of an agricultural robot, while making preliminary preparations for the realization of intelligent and accurate field fertilization.


Introduction
With the rapid development of robot technology, it has been increasingly applied in the agricultural field [1]. Due to the high intensity of field operations and complex road conditions, research on robot path planning, road recognition and perception, automatic and optimized navigation and robot arm control are all prerequisites for realizing robot field work [2][3][4][5][6][7][8][9][10]. The weeding and harvesting function systems of field robots have been the most studied, while there is little research on crop disease and insect pest perception, nutrient element content diagnosis and precision fertilizer spraying function systems [10][11][12]. The diagnosis of the nutrient elements content can provide a basis for field robots to perceive the crop growth status. Sweet corn is a widely cultivated food crop because it is rich in vitamins, amino acids and so on, making it more and more popular [13,14]. Nitrogen, phosphorus and potassium in sweet corn are important nutrients for its growth, which have great influence on its growth, yield and quality [15][16][17]. Because the traditional diagnosis of maize nutrient elements adopts chemical methods, a large number of corn samples need to be picked, and complicated chemical testing is required, which takes a long time and will cause damage to the plant [18]. Hyperspectral imaging technology is a simple, rapid and non-destructive method for the detection of crop nutrient elements. This method has become an important means to obtain field information in the field of digital agriculture and has been widely used in the detection of nutrient information of crops such as corn, wheat, tea and so on [19][20][21][22][23]. In recent years, through spectral technology, researchers have used stepwise regression, principal component analysis, support vector basis, random forest algorithm, continuous wavelet transform and other methods to estimate the crop chlorophyll content, nutrient element content, water content and other indicators quickly and in a nondestructive manner [24][25][26][27][28][29][30][31].
Wei et al. conducted inverse analysis on the soil organic matter content and improved its diagnostic efficiency by using hyperspectral indicators [32]. Wang et al. conducted quantitative inversion of salt ion content by using the spectral characteristics of salt ions, which were extracted from reciprocal logarithm of reflectance (Log(1/R)), providing an effective tool for the diagnosis of soil salinity [33]. Based on hyperspectral imaging technology, Wu et al. established a multiple linear regression inversion model of soil moisture content (SMC), which can quickly and efficiently predict soil moisture content [34]. Han et al. constructed a prediction model of soil AS content by extracting the spectral secondderivative characteristic variables, providing scientific basis and technical reference for soil pollution monitoring [35]. Yu et al. processed hyperspectral rice data by discrete wavelet decomposition, successive projection and principal component analysis. On this basis, the characteristic variables of the nitrogen content were extracted, and an inversion model of the nitrogen content in japonica rice was established. Among the results, the inversion model based on discrete wavelet decomposition is the best [36]. Fan et al. comprehensively compared and analyzed the performance of different types of spectral variables in estimating maize leaf nitrogen content (LNC) through partial least squares regression and a random forest algorithm. The results show that the PLS model with optimal multispectral variables has a better fitting effect and is a more effective model to evaluate maize LNC [37]. The first and second derivative processing of spectral reflectance and the construction of normalized spectral vegetation index can improve the correlation between characteristic variables and detection target content. However, due to different absorption or reflection conditions of different detection targets and the large variation in feature bands, most of the spectral information cannot be characterized. Therefore, more different feature extraction methods need to be introduced to improve the signal-to-noise ratio of spectral data and increase the stability and accuracy of the model. Wavelet analysis is a new signal processing tool, which can reduce the dimension of spectral data, separate the high and low frequency information and facilitate the detection of singular points. Chen et al. processed hyperspectral reflectance data of soil samples by combining continuous media removal and wavelet packet decomposition, which improved the correlation between spectral reflectance and petroleum hydrocarbons in soil [38]. Gu decomposed hyperspectral datauses by wavelet transform algorithm. Then, the highfrequency information decomposed by wavelet technology is coupled with a random forest algorithm, which can effectively improve the prediction accuracy of soil organic matter content [39]. Li et al. preprocessed spectral data by mathematical transformation, a continuous wavelet transform algorithm and a correlation analysis algorithm. After the characteristic bands were extracted and selected, the estimation model of chlorophyll content in the stems and branches of Pitaya fruit was established. The R 2 value based on continuous wavelet transform is 0.678 and the root mean square error RMSE = 0.037 [40]. Zhang et al. reduced the hyperspectral noise and improved the performance of the hyperspectral estimation model of soil organic matter content by using the wavelet energy characteristic method. The wavelet energy feature method could not only improve the estimation accuracy of the SNR (Signal-Noise Ratio) and soil organic matter content but could also realize the reduction in the dimensions of hyperspectral soil data and reduce the model's complexity [41]. Wang et al. separated soil spectral data into five scales of high-frequency and low-frequency data by binary wavelet technology, then extracted the best band combination to build a diagnostic model of organic matter content, which has good stability [42]. Huang et al. decomposed canopy reflectance and its first derivative into wavelet coefficients by using the continuous wavelet transform method. The corresponding wavelet sensitivity coefficients were extracted, and the canopy LAI estimation model of late ripening wheat was established. Compared with models based on different types of hyperspectral vegetation indices, the accuracy of the late ripening wheat canopy LAI estimation model based on continuous wavelet coefficient was significantly improved [43]. Yang et al. decomposed spectral data by multi-scale wavelet. After extracting wavelet coefficients, partial least squares regression and support vector regression were used to construct the estimation model of tea polyphenol content. Compared with the model built by single feature variable, the multi-feature fusion method can improve the accuracy of estimating tea polyphenol content [44]. In conclusion, the pretreatment of hyperspectral reflectance data by wavelet analysis method can improve the correlation between feature bands and detection targets and improve the stability and accuracy of the model. However, the wavelet analysis method is rarely applied in the field of plant nutrient elements detection, and the research on sweet corn mostly focuses on nitrogen content, without comprehensive analysis of the main nutrient elements of corn nitrogen, phosphorus and potassium content.
In this paper, the comprehensive effects of different nitrogen application levels on the accumulation and absorption of nitrogen, phosphorus and potassium contents in maize were studied. The correlation between spectral characteristic variables and nitrogen, phosphorus and potassium contents of sweet corn was analyzed; then, the estimation model of nutrient elements was established by linear, parabolic, logarithmic and exponential functions. Then, the hyperspectral data of sweet corn are decomposed by binary wavelet. After analyzing the correlation between nitrogen, phosphorus and potassium contents and the frequency wavelet coefficients, the partial least squares regression and neural network nonlinear diagnosis model of nitrogen, phosphorus and potassium contents were established by extracting the wavelet sensitivity coefficients. Meanwhile, the stability, accuracy and precision of the model were evaluated by R 2 , MRE and NRMSE. AHP (Analytic Hierarchy Process) is used to assign the weight of the three evaluation factors, which is convenient to calculate the score of each model and compare the comprehensive performance of each model. The neural network model based on the binary wavelet high-frequency sensitivity coefficient has better comprehensive performance. It is of great significance to establish a diagnostic model for the rapid, accurate and nondestructive detection of nitrogen, phosphorus and potassium contents in maize leaves, which can not only make preliminary preparations for field operation robots to perceive the growth status of maize but can also provide a basis for the dynamic management of precise fertilization and topdressing.

Method of Obtaining Sweet Corn Samples
In the farm maize mono-cropping plot without fertilization, the soil in the tillage layer was dried and mixed with 2 cm sieve as the standby test soil. After mixing, the basic physical and chemical properties of the test soil were determined as urea during the test period, and nitrogen content was 46%. Nitrogen treatment during the whole growth period was as follows: no nitrogen application: 0 kg N·hm −2 (N 0 ); Low-nitrogen: 100 kg N·hm −2 (N 1 ); High-nitrogen: 300 kg N·hm −2 (N 2 ). When maize grew to coniferous stage, nitrogen fertilizer treatment was 30% of the whole growth period, that is: no nitrogen: 0 kg N·hm −2 (N 0 ); Low-nitrogen: 30 kg N·hm −2 (N 1 ); High-nitrogen: 90 kg N·hm −2 (N 2 ). After maize was grown for a week, two or three leaves were taken as samples to measure the following indices: nitrogen, phosphorus and potassium contents and corresponding hyperspectral data.

Determination of Nutrient Elements and Acquisition of Hyperspectral Data
In this experiment, the contents of total nitrogen, total phosphorus and total potassium in corn leaves were determined by distillation, vanadium molybdenum yellow colorimetric method and flame photometric method after H 2 SO 4 -H 2 O 2 discooking [45]. Figure 1 shows the nutritional element diagnostic test system of an agricultural robot. The hardware includes a hyperspectral camera, a mobile platform, a supplementary light and a camera obscura. The software platform includes SpecView collection software and ENVI (Environment for Visualizing Imagesdata processing software. The spectral data curve of corn leaves determined by this system is shown in Figure 2. Four points at the same position of each leaf were selected to collect data, and their average value was used as the spectral reflectance of the sample. The hyperspectral data were corrected by Formula (1): where I 0 is the corrected hyperspectral data, I is the original hyperspectral data, I W is the white board average hyperspectral data and I D is the blackboard average hyperspectral data. kg N·hm −2 (N0); Low-nitrogen: 30 kg N·hm −2 (N1); High-nitrogen: 90 kg N·hm −2 (N2). After maize was grown for a week, two or three leaves were taken as samples to measure the following indices: nitrogen, phosphorus and potassium contents and corresponding hyperspectral data.

Determination of Nutrient Elements and Acquisition of Hyperspectral Data
In this experiment, the contents of total nitrogen, total phosphorus and total potassium in corn leaves were determined by distillation, vanadium molybdenum yellow colorimetric method and flame photometric method after H2SO4-H2O2 discooking [45]. Figure 1 shows the nutritional element diagnostic test system of an agricultural robot. The hardware includes a hyperspectral camera, a mobile platform, a supplementary light and a camera obscura. The software platform includes SpecView collection software and ENVI (Environment for Visualizing Imagesdata processing software. The spectral data curve of corn leaves determined by this system is shown in Figure 2. Four points at the same position of each leaf were selected to collect data, and their average value was used as the spectral reflectance of the sample. The hyperspectral data were corrected by Formula (1): where I0 is the corrected hyperspectral data, I is the original hyperspectral data, IW is the white board average hyperspectral data and ID is the blackboard average hyperspectral data.

Hyperspectral camera
Mobile platform

Supplementary light
SpecView software Camera obscura

Extraction of Hyperspectral Characteristic Variables
The original hyperspectral data have a low SNR, and the band information is redundant. At the same time, there is a certain correlation between the reflectance data of various bands. The accuracy of diagnostic models based on raw data is low [46,47]. Extracting spectral characteristic variables to establish a diagnostic model of nutrient element content can reduce the computational cost. In this paper, hyperspectral location variables, hyperspectral area variables and vegetation index variables were adopted to analyze the correlation between nitrogen, phosphorus and potassium contents. The meanings and calculation methods of each hyperspectral characteristic variable are shown in Table 1 [48][49][50][51]. Green peak reflectance Rg Maximum first-order differential spectral value at 510-560 nm

Extraction of Hyperspectral Characteristic Variables
The original hyperspectral data have a low SNR, and the band information is redundant. At the same time, there is a certain correlation between the reflectance data of various bands. The accuracy of diagnostic models based on raw data is low [46,47]. Extracting spectral characteristic variables to establish a diagnostic model of nutrient element content can reduce the computational cost. In this paper, hyperspectral location variables, hyperspectral area variables and vegetation index variables were adopted to analyze the correlation between nitrogen, phosphorus and potassium contents. The meanings and calculation methods of each hyperspectral characteristic variable are shown in Table 1 [48][49][50][51]. Table 1. Hyperspectral characteristic parameters and description.

Types of Spectral Characteristic Variables Spectral Characteristic Variables Parameter Description
Spectral position variable Ratio of green peak reflectance to red valley reflectance Normalized values of green peak reflectance and red valley reflectance Ratio of the area of the red side to the area of the blue side VI 4 = SD r /SD y Ratio of the area of the red side to the area of the yellow side The normalized value of the red-side area and the blue-side area The normalized value of the area of the red and yellow sides Correction of simple ratio index mSR 705

Binary Wavelet Analysis
As a signal processing tool emerging in recent years, wavelet analysis has the characteristic of being multi-scale, which can gradually observe the signal from coarse to fine, and has the function of describing the local features of the signal, which is beneficial to the detection of singular points. The binary wavelet is the semi-discretization result of continuous wavelet transform [52]. Let the scale parameter a = 2 j , j∈z, and the translation parameter b still take the continuous value, as shown in Formula (2). In this case, the binary wavelet transform definition of f (t) is shown in Formula (3): Binary wavelet can effectively separate low-frequency information from high-frequency information and retain all information of the original signal f (t). The high-frequency signal is the detail information in the original information and the low-frequency signal is the macro information in the original information, which provides a new idea for spectral signal processing and analysis [53]. Since the changes in nutrient element contents in sweet corn in hyperspectral reflectance were relatively weak, binary wavelet based on db 2 , db 3 , db 4 and db 5 wavelet bases was adopted to analyze the spectral data. Five decomposition layers were used to process and analyze spectral data and extract characteristic information in the spectrum.

Modeling Method and Accuracy Verification
The correlation between spectral characteristic variables and nitrogen, phosphorus and potassium contents was analyzed and calculated by using Excel, SPSS, Origin and Matlab software; then, the correlation coefficient was adopted for evaluation. The spectral characteristic variables with high correlation coefficients were selected as independent variables to construct four diagnostic models of high nitrogen, phosphorus and potassium contents, which were linear, parabolic, exponential and logarithmic. After binary wavelet decomposition, correlation analysis was conducted between high-and low-frequency wavelet coefficients and nitrogen, phosphorus and potassium contents of sweet corn, and corresponding wavelet sensitivity coefficients were extracted. Then, partial least squares regression (PLS) and an artificial neural network were used to construct the diagnostic models of nitrogen, phosphorus and potassium contents in sweet corn.
In order to objectively reflect the modeling accuracy, two-thirds of the samples were selected for modeling and one-third for verification. Moreover, the modeling determination coefficient R 2 , Mean Relative Error (MRE) and Normalized Root Mean Square Error (NRMSE) were used to comprehensively analyze the stability, accuracy and accuracy of the model. The formulae are as follows: where y i denotes the measured value of nutrient element content; y i represents the predicted value calculated by the inversion model; I is the number of sweet corn sample; and n is the number of verified sample 24.
The larger the determination coefficient R 2 is, the better the fitting degree of the model is, while the smaller the MRE and NRMSE values are, the higher the inversion model accuracy is. In order to better reflect the synthesis of various models, AHP was adopted in this study, and the opinions of 7 experts in the field of nondestructive crop testing were consulted. The weight of evaluation factors R 2 , MRE and NRMSE were 46.48%, 29.58% and 23.94%, respectively. As R 2 is larger and closer to 1, the stability is better. Finally, the reciprocal of R 2 , MRE and NRMSE multiplied by the corresponding weights were taken as the final score. The lower the score, the better the model performance. The comprehensive score is called T, as shown in Formula (7):

Changes of Nitrogen, Phosphorus and Potassium Contents under Different Nitrogen Application Treatments
As shown in Figure 3a, with the increase in the nitrogen application rate, the nitrogen content in maize leaves increased first and then decreased, and there were significant differences in the nitrogen content between the nitrogen application levels of N 0 , N 1 and N 2 (p < 0.05). Compared with the N 1 and N 2 treatments, the nitrogen content of leaves under the N 1 and N 2 treatments increased, and the nitrogen content under the N 1 and N 2 treatments was 1.28 times and 1.13 times higher than that under N 0 , respectively. The nitrogen content of leaves at the N 1 level was reduced compared with that at the N 2 level, and the nitrogen content at the N 1 level was 1.12 times that at N 2 level. The results showed that an appropriate increase in the nitrogen application rate could promote the absorption and accumulation of nitrogen in maize leaves, while a high nitrogen application rate inhibited the accumulation of nitrogen in maize leaves, which significantly decreased the nitrogen accumulation rate and reduced the utilization rate of nitrogen fertilizer. As shown in Figure 3b, with the increase in the nitrogen application rate, the phosphorus content of maize decreased, and there were significant differences in phosphorus content between the N 0 and the N 1 and N 2 levels (p < 0.05). Compared with N 1 and N 2 , the phosphorus content of maize under the N 0 treatment decreased, and the phosphorus content under the N 0 treatment was 1.47 times of that under N 1 and 1.93 times of that under N 2 . The phosphorus content at the N 1 level was 1.31 times higher than that at the N 2 level, and the phosphorus content at the N 1 level was lower than that at the N 2 level. The results showed that with the increase in the nitrogen application rate, the accumulation of phosphorus in maize decreased rapidly at first and then at a decreasing rate. As shown in Figure 3c, with the increase in the nitrogen application rate, the potassium content of maize decreased, and there were significant differences in potassium content between nitrogen application levels N 0 and N 1 and N 2 , respectively (p < 0.05); the potassium content under nitrogen application treatments N 0 and N 1 were 1.40 times of that under N 2 and 1.37 times of that under N 1 . The results showed that applying a small amount of nitrogen fertilizer had little effect on the uptake and accumulation of potassium in maize, but the application of high amounts of nitrogen inhibited the uptake of potassium and made the accumulation decrease rapidly.
content of leaves at the N1 level was reduced compared with that at the N2 level, and the nitrogen content at the N1 level was 1.12 times that at N2 level. The results showed that an appropriate increase in the nitrogen application rate could promote the absorption and accumulation of nitrogen in maize leaves, while a high nitrogen application rate inhibited the accumulation of nitrogen in maize leaves, which significantly decreased the nitrogen accumulation rate and reduced the utilization rate of nitrogen fertilizer. As shown in Figure 3b, with the increase in the nitrogen application rate, the phosphorus content of maize decreased, and there were significant differences in phosphorus content between the N0 and the N1 and N2 levels (p < 0.05). Compared with N1 and N2, the phosphorus content of maize under the N0 treatment decreased, and the phosphorus content under the N0 treatment was 1.47 times of that under N1 and 1.93 times of that under N2. The phosphorus content at the N1 level was 1.31 times higher than that at the N2 level, and the phosphorus content at the N1 level was lower than that at the N2 level. The results showed that with the increase in the nitrogen application rate, the accumulation of phosphorus in maize decreased rapidly at first and then at a decreasing rate. As shown in Figure 3c, with the increase in the nitrogen application rate, the potassium content of maize decreased, and there were significant differences in potassium content between nitrogen application levels N0 and N1 and N2, respectively (p < 0.05); the potassium content under nitrogen application treatments N0 and N1 were 1.40 times of that under N2 and 1.37 times of that under N1. The results showed that applying a small amount of nitrogen fertilizer had little effect on the uptake and accumulation of potassium in maize, but the application of high amounts of nitrogen inhibited the uptake of potassium and made the accumulation decrease rapidly.

Correlation Analysis and Diagnostic Model of Nitrogen, Phosphorus and Potassium Contents and Spectral Characteristic Variables in Sweet Maize
The calculated correlation coefficient values and significance test results of each spectral characteristic variable and nutrient element content are shown in Table 2.
According to the correlation coefficient calculation results in Table 2, nitrogen content was significantly correlated with D b , λ b , D y , λ y , D r , λ r , R g , λ g , R r , λ r , SD b , SD y , SD r , SD g , VI 1 , VI 2 , VI 4 , VI 5 and VI 6 , among which the correlation coefficient with R r , λ r and VI 2 was higher. The absolute values were all above 0.74. P content was significantly correlated with characteristic variables except for VI 3 and VI 7 , and the correlation coefficients with D r , R g and SD b were higher than 0.9. Potassium content was significantly correlated with other characteristic variables except for VI 1 , VI 3 , VI 4 and VI 7 , and the correlation coefficient with SD b , SD y and VI 6 was higher than 0.56. Table 2. Correlation coefficients of spectral characteristic variables with nitrogen, phosphorus and potassium contents.  The 72-sample data after removing abnormal data were randomly divided into 2 groups, among which 48 samples were used for modeling and 24 samples were used for verifying the model accuracy. According to the correlation coefficient between the spectral index and nutrient element content, R r , λ r and VI 2 were selected as independent variables of the diagnostic model to construct the diagnostic model of nitrogen content. D r , R g and SD b were selected as independent variables to construct a diagnostic model of phosphorus content. SD b , SD y and VI 6 were selected as independent variables to construct a diagnostic model of potassium content. Four common regression models, a linear model, a parabola model, an exponential model and a logarithmic model, were used to construct the diagnostic model. The MRE, R 2 and NRMSE were used to evaluate the comprehensive stability, accuracy and accuracy of the diagnostic models, respectively, and the T value was used to compare the comprehensive performance of each model. Table 3 shows the accuracy and verification results of the model. The following can be seen: (1) Among the diagnostic models constructed by nitrogen content and hyperspectral characteristic variables, the parabolic model with R r as the independent variable had the lowest T value, with its modeling R 2 of 0.672, MSE of 5.39% and NRMSE of 0.093. It can estimate nitrogen content effectively. (2) Among the diagnostic models constructed by phosphorus content and hyperspectral characteristic variables, the linear model fitted with SD b as the independent variable had the lowest T value, with its modeling R 2 of 0.835, MSE of 11.97% and NRMSE of 0.120. It can estimate phosphorus content stably and accurately.

Types of Variables Nitrogen Content Phosphorus Content
(3) Among the diagnostic models constructed by potassium content and hyperspectral characteristic variables, the parabolic model fitted with SD b as the independent variable had the lowest T value, with its modeling R 2 of 0.432, MSE of 10.22% and NRMSE of 0.112. As the modeling R 2 was less than 0.5, potassium content could not be estimated stably.

Binary Wavelet Modeling
Spectral curves were reconstructed based on the low-frequency (high-frequency) data of different scales. The decomposition results of db 5 were shown in Figure 4, where Figure 4a was the low-frequency wavelet coefficient curve and Figure 4b was the highfrequency wavelet coefficient curve. It can be seen from Figure 4a that the low-frequency wavelet coefficient curve preserves the morphological characteristics of the original spectrum. However, with the increase in the scale, the absorption characteristics of the spectral curve gradually weaken in the bands of 560−580 nm, 600−700 nm and 780-840 nm. The degree of separation of high-frequency information in original spectral data by binary wavelet is gradually deepened. Figure 4b shows that the spectral curve fluctuates strongly around 480, 610, 670 and 820 nm, indicating that the original spectral data are sensitive to the fluctuation of nitrogen, phosphorus and potassium contents in sweet corn near the corresponding band. It can be seen from the above that binary wavelet can effectively separate the high-frequency information in the original spectral data and highlight the absorption and reflection characteristics in the sweet corn spectrum.

Binary Wavelet Modeling
Spectral curves were reconstructed based on the low-frequency (high-frequency) data of different scales. The decomposition results of db5 were shown in Figure 4, where Figure 4a was the low-frequency wavelet coefficient curve and Figure 4b was the highfrequency wavelet coefficient curve. It can be seen from Figure 4a that the low-frequency wavelet coefficient curve preserves the morphological characteristics of the original spectrum. However, with the increase in the scale, the absorption characteristics of the spectral curve gradually weaken in the bands of 560−580 nm, 600−700 nm and 780-840 nm. The degree of separation of high-frequency information in original spectral data by binary wavelet is gradually deepened. Figure 4b shows that the spectral curve fluctuates strongly around 480, 610, 670 and 820 nm, indicating that the original spectral data are sensitive to the fluctuation of nitrogen, phosphorus and potassium contents in sweet corn near the corresponding band. It can be seen from the above that binary wavelet can effectively separate the high-frequency information in the original spectral data and highlight the absorption and reflection characteristics in the sweet corn spectrum.  Figure 5 shows the correlation curves between the A5 low-frequency wavelet coefficient and the D5 high-frequency wavelet coefficient of the db5 wavelet decomposition and nutrient element content, respectively. It can be seen from Figure 5 that the fluctuation range of the correlation curve between low-frequency wavelet coefficient and nitrogen, phosphorus and potassium content is small, and the correlation coefficient is smaller than the high-frequency wavelet coefficient. The correlation between the high-frequency wavelet coefficients and the contents of nitrogen, phosphorus and potassium in sweet corn was wide, and the correlation coefficients were basically significant. The contents of nitrogen, phosphorus and potassium in sweet corn leaves are low, and the response to the spectrum is weak, which is mainly reflected in details. Furthermore, the sensitivity of the high-frequency wavelet coefficient to the content of each element is better than that of the lowfrequency wavelet coefficient.  Figure 5 shows the correlation curves between the A 5 low-frequency wavelet coefficient and the D 5 high-frequency wavelet coefficient of the db 5 wavelet decomposition and nutrient element content, respectively. It can be seen from Figure 5 that the fluctuation range of the correlation curve between low-frequency wavelet coefficient and nitrogen, phosphorus and potassium content is small, and the correlation coefficient is smaller than the high-frequency wavelet coefficient. The correlation between the high-frequency wavelet coefficients and the contents of nitrogen, phosphorus and potassium in sweet corn was wide, and the correlation coefficients were basically significant. The contents of nitrogen, phosphorus and potassium in sweet corn leaves are low, and the response to the spectrum is weak, which is mainly reflected in details. Furthermore, the sensitivity of the high-frequency wavelet coefficient to the content of each element is better than that of the low-frequency wavelet coefficient.
The high-frequency wavelet coefficients were significantly correlated with the nitrogen, phosphorus and potassium contents of sweet corn leaves. The wavelet sensitivity coefficients of nitrogen, phosphorus and potassium were extracted from the high-frequency wavelet coefficients, then the diagnostic models of nitrogen, phosphorus and potassium contents in sweet corn were constructed by partial least squares regression and neural network. The stability, accuracy and precision of the models were evaluated comprehensively by modeling the R 2 , MRE and NRMSE, respectively. The T values of each model were calculated to comprehensively compare the performance of the diagnostic models.   The partial least squares regression model and the neural network nonlinear model select three wavelet sensitivity coefficients with high correlation coefficients as independent variables. The neural network framework adopts a feedforward neural network with each sample characteristic variable as input. The hidden layer is set to 1 and the number of neurons is set to 10. Finally, the corresponding nutrient element content is output. The nonlinear model of neural network is shown in Table 4.The diagnostic model of nitrogen content took wavelet coefficients 448 and 450 in the D 4 high-frequency band of db 3 and 367 in the D 5 high-frequency band of db 2 as independent variables. The correlation coefficients between the 3 variables and nitrogen content were 0.916, 0.958 and 0.918, respectively, denoted as X db3-D4−448 , X db3-D4−450 and X db2-D5−367 , respectively. The diagnostic model of the phosphorus content takes wavelet coefficients at 527, 486 and 482 of the D 5 highfrequency band of wavelet db 3 as independent variables. The correlation coefficients with phosphorus content were 0.929, 0.930 and 0.952, respectively, denoted as X db3-D5−527 , X db3-D5−486 and X db3-D5−482 , respectively. The diagnostic model of the potassium content takes wavelet coefficients at 455, 608 and 706 of the D 5 high-frequency band of db 2 as independent variables. The correlation coefficients with potassium content were 0.828, 0.916 and 0.792, respectively, denoted as X db2-D5−455 , X db2-D5−608 and X db2-D5−706 , respectively.  Table 5 shows that using the traditional spectrum characteristic of the variable construction of the nitrogen, phosphorus and potassium content of the diagnosis model, the correlation coefficient is relatively small; the model of the comprehensive stability, accuracy and precision is low; and the sensitivity based on the binary wavelet decomposition of the wavelet coefficient of nitrogen, phosphorus and potassium content of the partial least-squares regression diagnostic model and the neural network nonlinear model as correlation coefficient increased significantly. The comprehensive performance of the model was significantly improved.  Table 6 shows the comparison between the optimal diagnostic model with spectral characteristic variables as independent variables, the partial least squares diagnosis model and the neural network nonlinear diagnosis model.Compared with the parabolic model based on R r as independent variable, the R 2 , MRE and NRMSE of the partial least squares regression model based on the sensitivity coefficient of binary wavelet and high-frequency wavelet improved by 34.8%, 62.7%, 75.48% and 28.14%, respectively. The R 2 , MRE and NRMSE of the neural network nonlinear model are increased by 44.94%, 69.39% and 78.70%, respectively, and their comprehensive performance is improved by 28.14%. Compared with partial least squares regression model, the neural network model R 2 improved by 7.51%, the MRE decreased by 17.91%, the NRMSE decreased by 13.16% and the comprehensive performance improved by 7.71%. Compared with the linear model based on SD b as independent variable, the R 2 , MRE and NRMSE of the partial least squares regression model based on the high-frequency wavelet sensitivity coefficient of the binary wavelet were improved by 10.06%, 41.19%, 30.42% and 11.95%, respectively. The R 2 , MRE and NRMSE of the neural network nonlinear model are increased by 16.05%, 24.64% and 13.25%, respectively, and the comprehensive performance is improved by 14.42%. Compared with the partial least square regression model, the neural network model increased R 2 by 5.44%, MRE by 2.81% and NRMSE by 24.67%, but the comprehensive performance of the neural network model increased by 2.80%. Compared with the parabolic model for potassium content diagnosis constructed with SD b as the independent variable, the R 2 , MRE, NRMSE and comprehensive performance of the partial least squares regression model constructed based on the high-frequency wavelet sensitivity coefficient of binary wavelet are improved by 86.80%, 61.64%, 59.46% and 47.18%, respectively. The R 2 , MRE and NRMSE of the neural network nonlinear model are increased by 90.05%, 78.86% and 73.13%, respectively, and the comprehensive performance of the neural network nonlinear model is improved by 48.84%. Compared with the partial least squares regression model, the neural network model improved R 2 by 1.73%, MRE by 44.90% and NRMSE by 33.7%, but the comprehensive performance of neural network model improved by 3.13%. The results show that the high-frequency wavelet coefficients separated by binary wavelet can effectively suppress the interference of noise information, improve the signal-to-noise ratio of spectral data and improve the correlation between wavelet coefficients and nitrogen, phosphorus and potassium content, and improve the stability, accuracy and accuracy of the diagnostic model.

Conclusions
In this study, the specific conclusions are as follows: (1) With the increase in the nitrogen application rate, the nitrogen content in maize leaves increased first and then decreased, indicating that an appropriate increase in the nitrogen application rate could promote the absorption and accumulation of nitrogen in maize leaves, while a high nitrogen application rate could inhibit the accumulation of nitrogen in maize leaves, which significantly decreased the nitrogen accumulation rate and reduced the utilization rate of nitrogen. The decrease in the phosphorus content in maize indicated that with the increase in the nitrogen application rate, the accumulation of phosphorus in maize decreased rapidly at first and then at a decreasing rate. The decrease in the potassium content in maize indicated that the application of a small amount of nitrogen fertilizer had little effect on the absorption and accumulation of potassium in maize, and the application of a high amount of nitrogen would inhibit the absorption of potassium and make the accumulation decrease rapidly. (2) Binary wavelet can effectively improve the sensitivity of the spectrum to nitrogen, phosphorus and potassium contents of sweet corn and then improve the comprehensive performance of the model. Compared with the method of constructing spectral characteristic variables and vegetation incidices, it can effectively integrate the beneficial weak information in spectral data and suppress the influence of high-frequency noise. Compared with the parabola model based on Rr and the partial least squares regression model based on the binary wavelet high-frequency sensitivity coefficient, the comprehensive performance of the neural network nonlinear model based on the binary wavelet high-frequency sensitivity coefficient improved by 28.14% and 7.71%, respectively. Compared with the linear and partial least squares regression diagnosis models based on the high frequency sensitivity coefficient of binary wavelet, the comprehensive performance of the neural network nonlinear model based on the high frequency sensitivity coefficient of the binary wavelet improved by 14.42% and 2.80%, respectively. Compared with the parabola based on SDB as the independent variable and the partial least squares regression potassium content diagnosis model based on the binary wavelet high-frequency sensitivity coefficient, the comprehensive performance of the neural network nonlinear model based on the binary wavelet high frequency sensitivity coefficient is improved by 48.84% and 3.13%, respectively. (3) The chemical measurement method by using traditional destructive sampling of sweet corn nitrogen, phosphorus and potassium content and is sensitive to the highfrequency wavelet coefficient of building a neural network nonlinear sweet corn nitrogen, phosphorus and potassium content of the diagnosis model has good comprehensive performance, which can realize the rapid and nondestructive testing of sweet corn nitrogen, phosphorus and potassium content.
The diagnostic accuracy of nutrient element contents in this study can be further studied in order to improve the accuracy of agricultural robots to perceive nutrient element content in crops. The next step is to improve the SNR of the spectral data and improve the accuracy of the diagnostic model by using artificial neural network algorithm. Finally, the method can be applied to the nutrient element content sensing system of agricultural robot.