Study on the Prediction Model Based on a Portable Soil TN Detector

. As the development of precision agriculture,it is necessary to obtain soil total nitrogen (TN) content and other element parameters.. With the NIRS technology, a soil detector for soil total nitrogen content was developed. It included two part: optical part and control part. The detector took each lamp-house connected with the incidence of Y type optical fiber in turn by a manual rotation, The different wavelength lamp-house signal was transferred to the surface of soil by the input fibre. The reflected signal would be converted by photoelectric sensor, the optical signal was converted to electrical signal. After the power circuit, amplier circuit, and AD convert circuit, the electrical signal was processed by MCU. Finally, the result of soil total nitrogen content could be displayed on LCD. With the forty-eight apple orchard soil samples of Beijing surburb, the predicted models were established by seven different methods (MLR, PLSR, SVM, BPNN, GA+BPNN, GA+SVM and PSO+SVM). The model established by genetic algorithm (GA) optimizing BP neural network was optimal, with R C of 0.94, R V of 0.78, RMSEC and RMSEP of 0.037 and 0.067. The results showed that the soil total nitrogen content detector had a stable performance. The established model had perfect accuracy and strong robustness.


Introduction
Soil macro and micro parameters such as TN, P, K, and OM could demonstrate the fertilization directly.It was the basis to carry out precision agriculture.At present, a lot of scholars [2][3][4][5][6][7][8][9][10][11][12] have carried out the farmland soil characteristics from spatial variability.The research content mainly concentrated on the soil nutrient (N, P, K, organic matter, et al), soil moisture, elements such as electricity conductivity, pH value.Soil fertility, the physical and chemical parameters could be analyzed by spectral analysis methods, which could short analysis time, reduce cost and improve the analysis efficiency in the laboratory.With nearly 30 years' development, it has made remarkable progress and achievements under laboratory conditions by near infrared spectral method for the soil spectral data preprocessing.In 1999, Shibusawa has studied on the parameters of soil (nitrogen, phosphorus and potassium, organic matter, electricity conductivity, et al) by near infrared spectral analysis technology.The sensitive wavebands have been selected and the parameters corresponding prediction models were also established.Huan-junliu, et al selected 675 soil samples of Heilongjiang province to build VIS NIR waveband and linear model of soil organic matter that the prediction accuracy was as high as 0.936(R 2 ).Gao Hongzhi, JiWenJun et al have used the maximum continuous projection algorithm to eliminate the effect between multivariate linear, extracted the modeling characteristics of soil total nitrogen and organic matter wavelength, the use of random forest, SVM, and ANN, partial least squares method(PLS) high precision models were obtained.Dong-jian et al has used 900-1700nm wavelength range of diffuse reflection spectrum to identify and eliminate abnormal samples.The accuracy of the model became excellent with the continuous projection algorithm (SPA, Successive Projections Algorithm) to the optimal modeling variable wavelength selection, and then through the three linear modeling methods affection the result of the organic matter content prediction was analyzed.PLS method and RBF neural network prediction model were also established.Yan shanshan introduced the continuum removal method to extract the sensitive wavebands of SOM, analysis when the change of soil organic matter content, the change rule of the spectrogram to extract the sensitive wavelength of 600 nm, 900 nm and 2210 nm as the center wavelength, the BP neural network to establish the model of SOM.With the prediction model data, root mean square error MSE was 0.286, the correlation coefficient was 0.979 and the model was superior to the whole band.Since the 1990's, some soil scientists and agricultural information technology scholars have researched on soil sample spectrum analysis of research status in real time based on the NIR spectroscopy.[12][13][14][15][16][17][18][19][20]  (Adamchuk, 1999; Shibusawa, 2000; Mouazen, 2005; Maleki, 2007;  Christy, 2008; XingZhen, 2008; Gao Hongzhi, 2011).Sudduth and Hummel have developed a rapid detection sensor which was used to identify the soil texture and soil organic matter in the 1990's based on NIRS.The accuracy of the detector could reach 90%.With the development of NIRS technology, the NIR lamphouse could be used in the field condition which made it easy to collect data in the outside.Several large companies have also product specificity lamp-house for the portable soil sensor and on-the-go soil sensor.Several foreign scholars have also obtained excellent result of soil moisture,soil organic matter and so on.Different scholars from studying the spectral characteristics of the soil, combined with chemometrics methods, established the soil moisture, soil organic matter, soil total nitrogen and soil parameters prediction model.foreign scholars also started to research on the effect of factor under the field condition to improve the model accuracy.Hence, we decided to develop a kind of portable soil TN detector based on NIRS technology.And then it would make the basis for the field condition to detect soil TN.

2
Materials and Methods (

2) Structure Design of soil TN sensor
With the NIRS technology, a soil detector for soil total nitrogen content was developed.It was consisted of optical part and control part.The detector took each lamp-house connected with the incidence of Y type optical fiber in turn by a manual rotation, The different wavelength lamp-house signal was transferred to the surface of soil by the input fibre.Once the signal was converted by the photoelectric sensor, the optical signal was converted to electrical signal.After the power circuit, amplier circuit, and AD convert circuit, the electrical signal was processed by MCU.Finally, the result of soil total nitrogen content could be displayed on LCD.Fig. 1 shows the structure, and Fig. 2 shows Soil TN content detector structure.In order to develop the portable detector, appropriate lamp-houses and transmission channel should be selected correctly.In this study, Lighting Emitting Diode (LED) was selected as active lamp-house.According to the result of 2.1 section, six wavelength of LED were selected.All the selected lamphouses had the advantagement of low cost, narrow bandwidth and portable.They were at the wavelength of 1550, 1300, 1200, 1100, 1050, and 940 nm.In order to analyze the effect of soil moisture, another special LED was also selected, which was at the wavelength of 1450nm.When the soil TN sensor began to work, all the LEDs would be open by turn, and the optical signal could be transmitted by the input fiber.When the LED optical signal arrival at the surface of soil, it would be divide into two part.One part would be absorpted by the soil and the other part would be reflected by the soil.According to the different content of soil properties, the reflectance value would be different.For the soil moisture content, as the soil moisture content increased, the reflectance value would reduce.When the locating dowel was pulled up, the rotary table was back to original place by the clockwork spring. (

4) Control part
The soil TN detector was controlled by the MCU. Figure 3 shows the MCU process chart.Once the optical signal was converted into electrical signal, it was processed by the IU convert circuit, amplier circuit, AD convert circuit and LCD display circuit by turn.All the weak electrical signal would become standard signal for the MCU.In the MCU, it could be display stored.Both the reflectance value and absorbance value would be stored at the same time.With the help of soil TN predicted model, the soil TN content could be displayed on LCD.

Experimental Methods
The soil coverage rate was 82% in Beijing suburb, the area was about 137.8 hectare.Among them, the brown soil area was 89.1 hectare, about 65% of Beijing soil area.Soil type was typical brown earth soil which has a strong representation.They were collected from Beijing suburb with the ranges of N 40.14395738°40.1434362°and E 116.2154066°116.2150152°.The depth was 1-20 centimeters under the soil surface.
In order to reduce the effect of operation error, all the soil samples were taken as uniform number, crushing and drying.And then they were divided into two parts, one part was measured by the traditional chemical methods; the other part was used to detect by the developed portable sensor.All the data were measured for twice by the soil TN detector.For the first time, the absorbance of standard whiteboard was measured.And for the second time, the probe output signal was also obtained.With the help of equation of ( 1) and ( 2), the absorbance of the soil sample could be obtained.According to the Equation ( 1) and ( 2), the absorbance would be obtained.
Where: i is 1550nm, 1450nm, 1300nm, 1200nm, 1100nm, 1050nm, and 940 nm; i V is the output value at the wavelength of i by putting probe on the standard whiteboard; ' i V is the output at the wavelength of i by pushing probe into the soil sample; i r is the reflectance value at the wavelength of i ; i A is absorbance of the wavelength of i .

The evaluation of soil TN predicted model
In order to evaluate the portable soil TN detector accuracy and performance, three parameters were chose to evaluate them, include RMSEC, RMSEP and RPD value.Equation ( 3), (4), and (5) shows the calculation formulas.
Where: i was soil sample serial;

Soil spectral data pretreatment
Table 1 showed the statistics data of soil parameters.The content range of that was 0.007% ~ 0.286%, average content of soil TN was 0.16% and the standard deviation was 0.007.From the distribution coverage, soil total nitrogen variation range was across crop growth cycle, it was suitable for modeling analysis.The data obtained from the detector has been processed by the average filtering software and hardware of the first-order RC low-pass filter.According to the formula (1) and ( 2), soil reflectance and absorbance values at the six different wavelengths were obtained.Relevant relations showed that the correlation coefficient between absorbance and soil TN content were 0.19, 0.31, 0.10, 0.21, 0.10 and 0.11, respectively.This paper proposed a new soil spectral data pretreatment method, the differential absorbance was selected as a new independent variable factor.Differential absorbance data was obtained by formula (6).Fig. 4 showed the result of absorbance and soil TN content with the new data pretreatment method.The correlation coefficient between differential absorbance (
Where ： i and j are 940,1050,1100,1200,1300,1450 and 1550nm;  were as input factor.The soil TN predicted model was established by the MLR, PLSR, BPNN method, SVM method, GA+BPNN, improved support vector machine (GA+SVM) method and the improved support vector machine method (PSO+SVM) respectively.Table 2 showed the results of different soil TN predicted models.
(1)A kind of new portable soil TN detector was developed.LED was selected as the lamp house, and optimization amplification and filter circuit were designed.
(2) A new soil spectral data pretreatment method suitable for portable detector was proposed.According to the method, the correlation coefficient between spectral absorbance and soil TN was improved, obviously.
(3)The soil TN forecasting model was established by seven different methods (MLR, PLSR, SVM, BPNN, GA+BPNN, GA+SVM and PSO+SVM).The GA+BPNN model had high Rc of 0.94 and Rv of 0.78, and the RMSEC, RMSEP, RPD satisfied the requirement.Especially, the RPD value reached 2.577.It could be as the soil TN forecasting model.Although the soil parameter predicting model were established, the robustness and universality still had disadvantage.In the next step, the effect of soil other properties should be considered in the model.

iy
was soil TN measured by FOSS Kjeltec TM 2300; ci y is calibration group soil TN predicted value; pi y is validation group soil TN predicted value; _ y is soil total nitrogen content average valuemeasured by FOSS Kjeltec TM 2300; c n calibration group number; p n is validation group number.

A
is original absorbance value.

2.1 Soil TN detector design (1) Selection of snesitive wavelengths
It was necessary to determine the used NIR wavelength lamp-house for the soil TN sensor, firstly.Several scholars had studied on the determination of NIR wavelength lamp-house.Zheng Lihua et al had tried four kinds of methods to estimate soil TN content, such as BPNN, MLR, SVM and wavelet analysis.With the different methods, she also proposed the selected sensitive wavelength, including 24 suggestion wavelengths.The selected wavebands were844nm,859nm, 923nm,931nm, 972nm,984nm, 1028nm,1064nm,1092nm,1124nm,1187nm,1208nm, 1215nm,1286nm, 1311nm,1389nm,1394nm,1536nm,1559nm,1673nm,1684nm,1895nm,1833nm,1991 nm, 2150nm and 2234nm.According to the mentioned results, An et al suggested a new group of wavelengths to build the BPNN estimation model, 1550nm, 1300nm, 1200nm, 1100nm, 1050nm, 940 nm.The R 2 (calibration and validation) were 0.85 and 0.77,respectively.Under the laboratory condition and field condition, the models have different affect factor, as a result, it would be necessary to determine new model parameters after finishing the development.

Table 1 .
Statistics data of soil parameters

Table 2 .
Comparison of different soil TN predicted modelsThe model with differential absorbance was obvious better than that with original absorbance for all the seven different methods from table 2. For the RMSEC, it reduced from 0.085 to 0.061 and improved about 27.4%.For the RMSEP, it reduced from 0.094 to 0.075, improved about 3.1%.The model accuracy become more better.For the linear method, PLSR model had the Rc of 0.83, Rv of 0.65, which were both higher than that of MLR model.RMESC and RMSEP were also lower than that of MLS model.For the nonlinear methods, BPNN, SVM, GA+BPNN, GA+SVM and PSO+SVM had the Rc of 0.69, 0.86, 0.94, 0.86 and 0.94, respectively.It had the increased trend gradually.The correlation coefficients of validation were 0.72, 0.74, 0.78, 0.74 and 0.78, respectively.Among them, the GA+BPNN method had the highest value.All the RMSEC and RMSEP satisfied the requirement except SVM method.According to the RPD value, GA+BPNN, GA+ SVM and PSO+SVM model had excellent performance.As a result, the GA+BPNN model had high Rc and Rv, and the RMSEC, RMSEP, RPD value the requirement.It could be as the soil TN forecasting model.