Next Article in Journal
Decentralization versus Centralization: What Ensures Food Security? Empirical Evidence from 170 Prefecture-Level Cities in China’s Major Grain-Producing Areas
Next Article in Special Issue
Spectral-Frequency Conversion Derived from Hyperspectral Data Combined with Deep Learning for Estimating Chlorophyll Content in Rice
Previous Article in Journal
Influence of Rotor Cage Structural Parameters on the Classification Performance of a Straw Micro-Crusher Classifying Device: CFD and Machine Learning Approach
Previous Article in Special Issue
High-Precision Peach Fruit Segmentation under Adverse Conditions Using Swin Transformer
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Rapid Detection of Fertilizer Information Based on Near-Infrared Spectroscopy and Machine Learning and the Design of a Detection Device

Faculty of Modern Agricultural Engineering, Kunming University of Science and Technology, Kunming 650500, China
*
Author to whom correspondence should be addressed.
Agriculture 2024, 14(7), 1184; https://doi.org/10.3390/agriculture14071184
Submission received: 16 June 2024 / Revised: 4 July 2024 / Accepted: 17 July 2024 / Published: 18 July 2024

Abstract

:
The online detection of fertilizer information is pivotal for precise and intelligent variable-rate fertilizer application. However, traditional methods face challenges such as the complex quantification of multiple components and sensor-induced cross-contamination. This study investigates integrating near-infrared principles with machine learning algorithms to identify fertilizer types and concentrations. We utilized near-infrared transmission spectroscopy and applied Partial Least Squares Discriminant Analysis (PLS-DA), Support Vector Machine (SVM), and Back-Propagation Neural Network (BPNN) algorithms to analyze full spectrum data. The BPNN model, using S-G smoothing, demonstrated a superior classification performance for the nutrient ions of four fertilizer solutions: HPO42−, NH4+, H2PO4 and K+. Optimization using the competitive adaptive reweighted sampling (CARS) method yielded BPNN model RMSE values of 0.3201, 0.7160, 0.2036, and 0.0177 for HPO42−, NH4+, H2PO4, and K+, respectively. Building on this foundation, we designed a four-channel fertilizer detection device based on the Lambert–Beer law, enabling the real-time detection of fertilizer types and concentrations. The test results confirmed the device’s robust stability, achieving 93% accuracy in identifying fertilizer types and concentrations, with RMSE values ranging from 1.0034 to 2.4947, all within ±8.0% error margin. This study addresses the practical requirements for online fertilizer detection in agricultural engineering, laying the groundwork for efficient water–fertilizer integration technology aligned with sustainable development goals.

1. Introduction

In recent years, China has made strides in water–fertilizer integration technologies, embracing precision fertilizer application and intelligent irrigation [1]. Despite these advancements, there is still ground to cover before the international forefront is reached. The development of an intelligent water–fertilizer integration system is crucial for achieving precision irrigation [2,3]. This system relies on establishing predictive models for water and fertilizer, integrating advanced technologies for the real-time adjustment of variable irrigation, and ensuring the accurate quantitative management of agricultural products. The accurate online detection of each nutrient component in fertilizer solutions is essential for the precise regulation of water and fertilizers in irrigation [4]. However, online fertilizer detection often encounters challenges from environmental factors, leading to issues such as incomplete nutrient data, reduced accuracy, and slower processing speeds. Therefore, achieving dependable online fertilization detection remains a significant challenge for advancing intelligent control technologies in agricultural management.
Fertilizer component information primarily includes the main nutrients and their concentrations within water–fertilizer mixtures. The main online detection methods for fertilizer components at present, both domestically and internationally, include the EC/pH, ion-selective electrode (ISE), and dielectric property detection methods.
The EC/pH method utilizes sensors’ electrical conductivity and pH to measure overall ionic composition in fertilizer solutions. However, it lacks precision in differentiating individual ion concentrations [5,6]. The ISE method employs specific electrode membranes to precisely measure target ion concentrations and activities [7], but it may encounter cross-sensitivity issues among ions, potentially affecting measurement accuracy [8]. The dielectric property detection method uses capacitive sensors to measure the solution’s relative permittivity, suggesting composition and concentration changes based on variations in dielectric constant. Challenges remain regarding the reliability and stability of frequency prediction techniques.
In addition, near-infrared (NIR) spectroscopy has gained prominence in academia and industry for its ability to selectively absorb light based on functional group characteristics in substances. In recent years, the integration of machine learning methods has revolutionized data analysis, particularly in classification and regression tasks, due to their advanced feature extraction capabilities. Zhi dan Lin et al. undertook a comprehensive spectral scanning and chemical profiling of a substantial volume of soil and fertilizer specimens utilizing visible and near-infrared (VIS/NIR) techniques. Leveraging a genetic algorithm (GA)-based model, precise forecasts were achieved for parameters such as organic matter content (OMC), total nitrogen in soil, as well as nitrogen, phosphorus, and potassium levels in fertilizer [9]. Similarly, Mohammadreza Khanmohammadi et al. employed a chemometric approach amalgamating mid-frequency FTIR spectroscopy with the successive projection algorithm (SPA) for wavelength selection, coupled with a feed-forward back-propagation artificial neural network (BP-ANN) model, to quantify protein content in yogurt samples. The BP-ANN and SPA-BP-ANN methods yielded relative errors (REP) of 7.25 and 3.70, respectively, in predicting the calibration set [10]. Furthermore, Song Le et al. harnessed near-infrared diffuse reflectance spectroscopy to ascertain the composition of compound fertilizers, specifically the content of urea, diurea, and other constituents. Following appropriate preprocessing, partial least squares (PLS) regression achieved initial test coefficients, R2, of 0.9861 and 0.9713, underscoring its efficacy [11].
The research objective of this paper is to propose a fast and non-destructive method for detecting fertilizer component information based on NIR spectroscopy, and to improve the accuracy and robustness of the model via spectral pre-processing and feature extraction. Three different algorithms, i.e., BPNN, PLS, and SVM models, are compared to construct an optimal model for fertilizer component identification and concentration prediction. Based on this theory, a corresponding detection device is developed and integrated with hardware and software systems to achieve fertilizer type identification and rapid online concentration detection.

2. Materials and Methods

2.1. Sample Selection and Preparation

As the main effective nutrients of the N, P, and K fertilizers that are actually applied to agricultural production crops are NH4+, K+, and total phosphorus (PO43−, HPO42−, H2PO4) [12], in this paper, potassium sulfate (K2SO4, 99%), diammonium hydrogen phosphate ((NH4)2HPO4, 99%), potassium dihydrogen phosphate (KH2PO4, 99%), and ammonium sulfate ((NH4)2SO4, 99%) were purchased from Sinopharm Chemical Reagent Co., Ltd., Shanghai, China. Each fertilizer solution was configured with ten concentration gradients (10–100 mg/L at 10 mg/L intervals) using deionized water, with four samples replicated at each concentration. Finally, all samples were stored at room temperature until measurements were taken. The sample configuration was carried out in the college laboratory.

2.2. Acquisition of Near-Infrared Spectra

The spectral data collection for this study was conducted in the laboratory of Faculty of Environmental Science and Engineering at Kunming University of Science and Technology, using a Cary 5000 NIR spectrophotometer capable of detecting wavelengths from 700 to 2500 nm. The fertilizer solutions under investigation were prepared by adding drops into two-thirds of a quartz cuvette, which was then placed in the instrument’s detection tank. The NIR spectrophotometer scanned absorbance spectral curves of the four standard solutions across the entire wavelength range. Each fertilizer solution was scanned five times, and the resulting spectra were averaged to obtain spectral data comprising 1800 wavelengths, each associated with its own absorbance value. Subsequently, 160 sets of wavelength-absorbance spectral data were generated for the four fertilizer solutions. These datasets were then randomly divided into a calibration set and a prediction set in a 3:1 ratio using a random selection method. These sets were employed for the subsequent qualitative and quantitative modeling analyses of the fertilizer solutions (Figure 1a).

2.3. Spectral Pre-Processing and Feature Selection

To mitigate interference from background noise and other unwanted factors in the measured spectra of fertilizer samples [13], the spectral data must undergo preprocessing before modeling. Savitzky–Golay (S-G) smoothing was employed for this purpose, which involves fitting low-order polynomials to adjacent points using least squares. This technique effectively reduces noise, enhances the signal-to-noise ratio, and preserves the essential characteristics of the spectral data [14].
Moreover, this study collects extensive NIR spectral data, which may contain redundancy, covariance, and overlapping information that can impact model accuracy and robustness [15]. Thus, it becomes essential to extract characteristic wavelengths from the raw spectra. Here, Competitive Adaptive Reweighted Sampling (CARS) was utilized to achieve this. CARS operates on a principle akin to natural selection, where variables with higher regression coefficients are given greater weight during iterative feature selection. This approach ensures that emphasis is placed on variables with stronger predictive power in the model [16].

2.4. Classification and Regression Prediction Methods for Spectral Data

In this paper, three different machine learning algorithms, Partial Least Squares Discriminant Analysis (PLS-DA), Support Vector Machine (SVM), and Back-Propagation Neural Network (BPNN), were adopted to treat the prediction model for the construction of nutrient ion species and determination of their concentrations in the measured fertilizer solution. After comprehensively comparing and analyzing the prediction results of the three methods, an optimal classification and regression prediction model was finally selected based on the model evaluation index.
Partial Least Squares Discriminant Analysis (PLS-DA) can effectively extract useful signals from noise by decomposing the spectral information and the corresponding concentration matrices [11], which improves the signal-to-noise ratio and reduces the multicollinearity problem in the data, and significantly improves the reliability and accuracy of the analyzed data.
Support Vector Machine (SVM) focuses on segmenting two independent regions by finding an optimal separating hyperplane to distinguish between different classes of data points, which is based on maximizing the distance between the data points closest to the hyperplane (i.e., the support vectors) [17]. Not only is this approach applicable to classification tasks, but the same principle has been extended to regression problems, called support vector regression (SVR) [18].
The Back-Propagation Neural Network (BPNN) corrects the network using a back-propagation algorithm that gradually adjusts the network weights and biases to minimize the error between the network output and the desired output. In spectral analysis, BPNN is widely used to identify and quantitatively analyze the spectral data of various substances due to its powerful non-linear mapping ability and self-learning capability. The identification of spectral features of different substances by the calibration network can achieve the fast and accurate identification of unknown samples.

2.5. Modeling Assessment

The performance of the classification model is evaluated by sensitivity, specificity, and accuracy for each category [19]. These are calculated using the following equations:
S e n s i t i v i t y   ( % ) = T P T P + F N × 100
S p e c i f i c i t y   ( % ) = T N T N + F P × 100
A c c u r a c y   ( % ) = i = 1 n T P i N × 100
TP (true positives) refers to the number of samples correctly classified as ‘category 1’; FN (false negatives) refers to the number of samples that belonged to ‘category 1’ but were incorrectly classified as ‘category 0’; TN (true negatives) refers to the number of samples correctly classified as ‘category 0’; and FP (false positives) refers to the number of samples correctly classified as ‘category 0’. FN (false negatives) represents the number of samples that belonged to ‘Category 1’ but were incorrectly classified as ‘Category 0’; TN (true negatives) represents the number of samples that were correctly classified as ‘Category 0’; FP (false positives) represents the number of samples that belonged to ‘Category 0’ but were incorrectly classified as ‘Category 1’. False positives (FP) are the number of samples that belonged to category 0 but were misclassified as category 1. The total number of samples is denoted by N, where n is the total number of different categories.
When assessing the performance of regression models, the coefficient of determination (R2), the root mean square error (RMSE), and the residual prediction deviation (RPD) are commonly used as key indicators of model performance. The value of R² ranges from 0 to 1, and the closer the value of R2 is to 1, the more closely the model predicts the content of nutrient ionic constituents to the actual observations, and the better the fit [20]. Smaller values of RMSEC and RMSEP indicate a smaller deviation between the model predictions and the actual measurements, indicating a higher predictive accuracy of the model [21]. RPD is mainly used to assess the predictive accuracy and overall validity of the model regarding the data. It measures the stability and reliability of the model’s predictive ability, with larger RPD values indicating a better predictive performance of the model [22].

2.6. Development of Fertilizer Detection Sensor

2.6.1. Fertilizer Detection Sensor Design and Principle

To enhance the detection of fertilizer components, a sensor-based device utilizing near-infrared detection principles was developed. The device’s structure is depicted in (Figure 2a); it was designed in a cylindrical format to seamlessly integrate with the fertilizer pipeline. It includes a detector housing, a sensor unit, and a connector for pipeline integration. The sensor features four detection channels, each equipped with components such as LED light-emitting diodes (manufactured by Zhongwei Optoelectronic Technology (Hangzhou) Co., Ltd., ZVISION, Hangzhou, China), quartz glass plates, LED fixed stubs, optoelectronic receiving port bases, and a fertilizer inlet/outlet, as illustrated in (Figure 2b,c). This design ensures robust protection and light control, facilitating precise connection to the delivery line and ensuring the accurate detection of fertilizer solution components.
The detection device designed in this paper is mainly based on the absorbance of the fertilizer solution to be tested. From the Lambert–Beer law, the relationship between absorbance and incident light and transmitted light is as follows:
A = lg I 0 I t
where A is the absorbance of the measured solution; I0 is the intensity of incident monochromatic light; It is the intensity of transmitted light.
The intensity of incident light and transmitted light in each detection channel are expressed as the output voltage (Vi and Vt) of the two photodetectors. In order to eliminate, as far as possible, the influence of the light in the actual detection environment on the detection results of the device, the photodetector detects and records the ambient light corresponding to the voltage Va once in advance each time before switching on the LED light source for detection. The formula for calculating the absorbance is as follows:
A = lg V i V a V t V a
where A is the absorbance; Vi is the detection voltage value of the photodetector for detecting the incident light intensity of the channel; Vt is the detection voltage value of the photodetector for detecting the transmitted light intensity of the channel.

2.6.2. Signal Conditioning Circuitry

To address the challenge of noise interference in photodetector output, a signal conditioning circuit (Figure S1, Supplementary Materials) is employed to convert the weak current signal into a specified voltage signal. The initial step involves an (I–V) conversion circuit utilizing a high-precision operational amplifier, AD825 (U1), and a T-shaped feedback network. This circuit efficiently transforms the current output into a voltage signal. Following this, the gain amplifier circuit, centered around the operational amplifier LF353N (U2) and associated resistive–capacitive components, amplifies the voltage signal’s amplitude post-conversion. The careful selection of components and adjustment of potentiometer RP1 enable a flexible gain adjustment of up to 100 times, ensuring precise regulation of the output voltage signal’s amplitude.

2.6.3. Fertilizer Sensor Stability Analysis

Stability prediction serves as a crucial tool in evaluating the stability of the detection device, as the accuracy of the absorbance measurement hinges directly on the stability of voltage values during the measurement process. To ensure the reliability of the detection device’s output, a comprehensive prediction of voltage stability is imperative, focusing primarily on three key components: LED light source stability, transmitted light detection stability, and ambient light. To achieve this, NH4+ solutions at five concentrations—20, 40, 60, 80, and 100 mg/L—were employed as the test fertilizer solutions. Each test was conducted continuously for 3 h, with the corresponding photodetectors’ output voltage recorded every 15 min.

2.6.4. Detection Strategies for Sensors

This paper proposes a detection method for fertilizer components utilizing detection devices, following a ‘first qualitative, then quantitative’ approach. The method involves sequentially activating four LED light sources of specific wavelengths within the instrument, each illuminating the corresponding detection channel for a precise spectroscopic analysis of the fertilizer solution under examination. As the characteristic wavelengths of light traverse through the fertilizer solution, the photodetectors sequentially receive the transmission signals of each wavelength and convert them into voltage values. These voltage values are further transformed into absorbance values, enabling the identification of the fertilizer type based on the range of absorbance values. Subsequently, the specific absorbance value is utilized in the appropriate concentration detection model to calculate the specific concentration. The implementation of this detection strategy is depicted in Figure 3.

3. Results and Discussion

3.1. Spectral Pre-Processing and Spectral Characteristics of Four Fertilizer Solutions

Figure 4 depicts the absorbance spectra of all four fertilizer solutions across the entire spectral range. The horizontal coordinate corresponds to the NIR wavelength of the fertilizer solution and the vertical coordinate corresponds to the amount of absorbance produced by the NIR light source illuminating the fertilizer solution. Notably, the spectral curves of distinct nutrient ions exhibit discernible discrepancies in peak and trough patterns at specific wavelengths, alongside variations in peak shape, position, and absorption intensity. To discern the spectral nuances of the four fertilizer solutions and extract pivotal information from the spectral data, the Savitzky–Golay (S-G) smoothing method was employed. This preprocessing step forms the groundwork for the subsequent qualitative and quantitative modeling analyses of the four fertilizers under examination. The resulting spectra post S−G preprocessing are illustrated in (Figure 5).

3.2. Selection of Effective Characteristic Wavelengths for Near-Infrared Spectral Response Data of Fertilizer Solutions

Figure S3 (Supplementary Materials) depicts the competitive adaptive reweighted sampling (CARS) algorithm utilized for screening samples of HPO42− fertilizer solution nutrient ions to identify characteristic wavelengths. In Figure S3a, the rapid reduction in the number of selected wavelengths is evident during the initial sampling phase. With the increase in sample size, this reduction gradually decelerates. Concurrently, (RMSECV) exhibits a pattern of initially decreasing and then continuously increasing. The initial decrease signifies the effective removal of irrelevant noise information, while the subsequent increase suggests the potential loss of valid information during the process, as illustrated in Figure S3b. Subsequently, Figure S3c showcases the progression of regression coefficients for each wavelength during feature selection. The blue ‘*’ denotes the optimal sampling point where the lowest RMSECV is achieved, indicating the effectiveness of the selected wavelengths for screening.
The 50 characteristic wavelengths identified by CARS successfully captured the information related to HPO42−. These wavelengths are depicted in the average spectral map shown in Figure 6, primarily concentrated in the vicinity of 980 nm. Detailed feature extractions (Figures S4–S6) for the other three fertilizer solutions are available in the Supplementary Materials. Specifically, the feature wavelengths were concentrated around 1450, 1550, and 1600 nm, with selected feature points identified as 70, 60, and 29, respectively.
By comparing related studies, Lin Zhidan et al. [9] used CARS to select 161, 229, and 161 spectral characteristic wavelengths as the spectral characteristic wavelengths for N, P, and K nutrient contents, respectively. PLS and ELM models were developed. Under the optimal prediction model, R2 was 0.989, 0.963, and 0.981, respectively. The characteristic wavelength bands selected by Sun Di, Li Mengting et al. [23], based on the near mid-infrared spectroscopy and applying the SIPLS method to the total phosphorus content of faucal water in dairy plants, were also 10,400~9600 cm−1 (961~1041 nm), which is similar to the selection of characteristic wavelength points in this paper.

3.3. Fertilizer Component Classification Prediction Model

Three methods, (PLS-DA), (SVM), and (BPNN), as well as a combination of S-G smoothings, were used for the classification-prediction modelling analysis of the nutrient ions of the four fertilizer solutions to be tested. Figure 7 shows the confusion matrices generated by the optimal BPNN, while the other two confusion matrices are presented in Figures S4 and S5 (Supplementary Materials), from which it can be seen that the sensitivities of the K+ samples obtained by the BPNN model are all 100%. Compared to the original spectra, the accuracy of the corrected set of models processed by S-G preprocessing improved from 99.17% to 100%, while that of the predicted set improved significantly, from 87.18% to 98.35%.
Table 1 shows the classification results of all the models, and it can be seen that the three models obtained after S-G pre-processing achieved a better performance in most cases compared to the models under the original spectra, while the BPNN model after S-G pre-processing achieved very high sensitivity to K+, HPO42−, H2PO4, and NH4+ on both the calibration and prediction datasets, with an accuracy of 98.35%, which are all better than the other models. Zhiwei Jiang et al. developed near-infrared spectroscopy (NIRS) combined with five different types of machine learning methods to better identify botanical and geographical sources of AR. The results showed that SNV + BPNN performed best in plant origin classification, identifying both with more than 90% accuracy [24]. Fei Liu et al. investigated visible and near-infrared (Vis/NIR) spectroscopy combined with a back-propagation neural network (BPNN) to achieve the fast discrimination of instant milk tea. The BPNN prediction results showed a 98.7% recognition rate in the validation set [25].

3.4. Fertilizer Component Concentration Prediction Model

In this study, we used PLSR, SVR, and BPNN for the predictive modelling of nutrient ion concentration in the fertilizer solution and screened the best model. Table 2 shows the evaluation results of the three regression algorithms for predicting the nutrient ion concentrations in the four fertilizer samples based on the wavelengths selected by CARS. For K+, the CARS BPNN model gave the best prediction, with an R2 as high as 0.9879, an RMSEP of 0.3201 mg/L, and an RPD of 8.7947. H2PO4 was also better predicted by the CARS-BPNN model, with an R2 of 0.9592, RMSEP of 0.7160 mg/L, and RPD of 4.2287. For NH4+, the BPNN model obtained better correction (R2: 0.9971 vs. 0.9830) and prediction (R2: 0.9955 vs. 0.9245) results using CARS than using the full spectrum, suggesting that the use of eigenwave lengths is particularly effective for the BPNN algorithm. The CARS BPNN model was the best predictor of HPO42− concentration, with an R2 of 0.9936, RMSEP of 0.0177 mg/L and RPD of 12.6860.
(Figure 8) shows the correlation between the true and predicted values in the BPNN prediction model for the four fertilizer solutions that were tested. It can be clearly seen that the scattered points are concentrated around the y = x line in both the training and test sets, especially for (NH4)2HPO4, indicating a high degree of agreement between the predicted and actual values.
A comprehensive comparison of the performance of the three models in terms of concentration prediction shows that, after optimization using the CARS method, the performance of each model generally achieves a significant improvement, demonstrating the effectiveness of the CARS method in optimizing the performance of regression models. Shen Jengang [26] achieved R2 values of 0.989, 0.963, and 0.981 in the regression model of fertilizer powder after CARS feature extraction in NIR spectra and construction of PLS, ELM, and SVM, while the RMSEP values were 0.910, 1.724, and 1.393, respectively. Wang Xiaoke [27] completed the regression modelling of the elemental content of nitrogen, phosphorus, and potassium in the NIR spectra of fertilizer samples based on PLS, and the R2 was greater than 0.83. Wang Lingling [28] proposed a quantitative analytical method for the determination of total nitrogen content in monoammonium phosphate (MAP) fertilizers using Visible–Near-Infrared (Vis-NIR) spectroscopy and LS-SVM. The results showed that LS-SVM calibration using discrete wavelet transform was the best predictor of total nitrogen content in MAP fertilizers with R2, RMSEP, and RPD values of 0.91, 0.101, and 3.34, respectively.

3.5. Analysis of Characteristic Wavelength Selection and Prediction Modeling of Detection Devices

The analysis reveals that the characteristic wavelengths of the four fertilizer solutions are primarily concentrated around 980, 1450, 1550, and 1600 nm. This concentration suggests that crucial information is prominently expressed at these wavelengths. Consequently, a linear regression analysis was conducted to explore the relationship between concentration and absorbance for each of the four nutrient ions across ten concentration gradients at their respective characteristic wavelengths. The findings indicate a strong correlation between the nutrient ions and their characteristic wavelengths, as depicted in (Figure 9), with R2 values exceeding 0.95. This high degree of fit demonstrates the efficacy of the linear model in predicting absorbance changes based on wavelength, aligning with the fundamental assumptions of linear regression and fulfilling requirements for both speed and accuracy. Thus, these results offer valuable insights for selecting appropriate light sources and designing the structural framework of fertilizer solution component detection devices.
As can be seen in Figure 9, the absorbance ranges of the four nutrient ions at their respective characteristic wavelengths are also significantly different. the maximum value of absorbance A of HPO42− was less than 1; the minimum value of absorbance A of NH4+ was greater than 3.1; the absorbance values of H2PO4 were in the range of 3.02–3.09; the absorbance values of K+ ranged from 1.95 to 2.07. Therefore, when identifying the type of fertilizer to be tested, the fertilizer to be tested can be irradiated by four characteristic wavelengths of 980, 1450, 1550, and 1600 nm in turn, and the absorbance extremes of the nutrient ions at these wavelengths can be used to determine whether or not the fertilizer to be tested contains HPO42−, NH4+, H2PO4, and K+. The identification of the type of fertilizer is completed.
Based on the relationship between absorbance and concentration of the four ions at their respective characteristic wavelengths, fitting the corresponding linear regression model. As shown in Figure 9, the absorbance of four nutrient ions, HPO42−, NH4+, H2PO4, and K+, at the characteristic wavelengths of 980, 1450, 1550, and 1600 nm, respectively, showed a linear positive correlation with the concentration. Through linear regression, the prediction model of the concentration of the fertilizer solution and the absorbance at the characteristic wavelengths was established, as shown in Table 3.

3.6. Stability Analysis of the Fertilizer Sensor

In this paper the stability of the fertilizer sensor has also been analyzed in terms of LED irradiance voltage, transmission voltage, and ambient light voltage. The results are shown in Figure 10, the three voltage values of the fertilizer solution at each concentration do not fluctuate much, so it can be assumed that the effect on the stability of the device is small or negligible.

3.7. Accuracy of Fertilizer Component Type Identification

Ten different concentrations of HPO42−, NH4+, H2PO4, and K+ fertilizer solutions were subjected to testing across four detection channels, with each concentration undergoing five repetitions. During each experiment, the voltages corresponding to the incident and transmitted light received by the photodetectors in the four detection channels were recorded. Subsequently, absorbances A1, A2, A3, and A4 of the four detection channels were calculated using Equation (5), facilitating the judgment of the fertilizer types under examination based on the extremes of absorbance for each nutrient ion at these wavelengths. Ultimately, the accuracy of the fertilizer species identification was determined by tallying the number of correct identifications.
The confusion matrices of the test results are depicted in Figure 11. Notably, (NH4)2HPO4 was correctly identified 48 times, resulting in a species identification accuracy of 96%; (NH4)2SO4 was correctly identified 45 times, with a species identification accuracy of 90%; KH2PO4 was correctly identified 44 times, achieving a species identification accuracy of 88%; K2SO4 was correctly identified 49 times, yielding a species identification accuracy of 98%. From the experimental results, it can be seen that the average accuracy of the fertilizer detection device for four types of fertilizer solution for species identification is 93%, showing a better ability to identify the types of fertilizer solution. Wu Hao et al. [29] designed a sensor based on the dielectric properties of a water-soluble fertilizer, in which the detection accuracy of K2SO4 solution using e-frequency was 97.43%, slightly lower than that of K+ (98%) in this paper, while the detection accuracy of the KH2PO4 solution was 94.8% higher than that of H2PO4 in this paper.

3.8. Fertilizer Component Concentration Detection Accuracy

After identifying the types of fertilizer solutions, the absorbance data obtained from each type were input into the fertilizer concentration prediction model described previously. The measurement results are presented in Table 4, detailing the detected concentrations calculated using the fertilizer solution detection model. The accuracy of the fertilizer concentration detection model was verified by computing the relative error between the actual and measured concentrations, as illustrated in Figure 12.
Figure 12 illustrates the concentration detection errors of the sensor across the four configurations of fertilizer solutions. Notably, for the K+ solution, the maximum relative error does not exceed 6%, indicating a highly desirable detection accuracy. Regarding the detection results of the H2PO4 solution, it is observed that within the low-concentration range below 50 mg/L, the detected concentration closely aligns with the actual concentration, with the lowest relative error recorded at 0.12%. In the higher-concentration range, although the detected concentration tends to slightly surpass the actual concentration, the overall relative error remains within the acceptable range (<±7%), reflecting consistent performance. For the NH4+ solution, the detected values closely mirror the actual values across most concentrations, except for the 40 mg/L concentration, where the relative error peaks at 7.65%. Lastly, the results for HPO42− exhibit excellent agreement, with the detected values almost perfectly matching the actual values.
Li J et al. [30] designed a cylindrical capacitance sensor based on the dielectric properties of fertilizer solutions, with KCL, Ca(H2PO4)2-H2O, and H2NCONH2 as the test object, and the maximum relative error of its sensor concentration detection was 7.26%. Li Yunqing et al. [31] designed a NO3 selective electrode-based detection device, in which the maximum error caused by H2PO4 in the detection of NO3 concentration can reach up to 16%; compared with the sensor designed in this paper, it achieved better results.

4. Conclusions

This paper proposes a rapid detection method using near-infrared spectrophotometry to determine the concentrations of four fertilizer solutions: (NH4)2SO4, K2SO4, (NH4)2HPO4, and KH2PO4.
(1) Firstly, qualitative and quantitative prediction models for fertilizer liquid components were developed using NIR spectroscopy and machine learning algorithms to assess their feasibility. The Back-Propagation Neural Network (BPNN) demonstrated superior qualitative accuracy (98.35%) in identifying all four fertilizer liquids compared to the Partial Least Squares Discriminant Analysis (PLS-DA) model (94.87%) and Support Vector Machine (SVM) model (87.18%). Additionally, the CARS-BPNN model effectively predicted concentrations, achieving RMSE values ranging from 0.01777 to 0.7160.
(2) Subsequently, characteristic wavelengths (980 nm, 1450 nm, 1550 nm, and 1600 nm) were identified through CARS. A four-channel online fertilizer composition testing device was designed using the characteristic wavelength determined by Lambert–Beer’s law (980 nm). The detection strategy prioritized qualitative assessment followed by quantitative analysis, achieving 93% accuracy in identifying the four types of fertilizers. Concentration detection RMSE values ranged from 1.0034 to 2.4947, with errors of less than ±8.0%. The sensor’s detection accuracy slightly trailed behind that of the full-spectrum BPNN prediction results. These findings collectively enhance the feasibility of practical engineering applications.
To broaden the applicability and versatility of the sensors, future research could extend its scope to include a wider range of fertilizer solution types and concentrations. This study lays a promising technological foundation for the development of sensors capable of efficiently, rapidly, and cost-effectively detecting fertilizer solution information. Future developments might focus on integrating full-spectrum fertilizer solution detection sensors with advanced machine learning models to enhance their accuracy and efficiency, despite potential increased costs. Moreover, this technology holds promise for applications in water–fertilizer integration systems, providing critical support for precise variable-rate fertilizer application.

Supplementary Materials

The following supporting information can be downloaded at: https://www.mdpi.com/article/10.3390/agriculture14071184/s1, Figure S1: Signal conditioning circuit diagram; Figure S2: Device testing platform; Figure S3: CARS process for selecting the effective wavelength of HPO42−; Figure S4: Effective wavelength distribution of NH+ 4after CARS selection; Figure S5: Effective wavelength distribution of H2PO4− after CARS selection; Figure S6: Effective wavelength distribution of K+ after CARS selection; Figure S7: Comparison of the original spectra with the confusion matrix of the four-classified prediction set obtained by S-G preprocessing combined with PLS-DA; Figure S8: Comparison of the original spectra with the confusion matrix of the four-classification prediction set obtained by S-G preprocessing combined with SVM.

Author Contributions

Conceptualization, Y.M. and J.L.; methodology, Z.W. and S.C.; software, Y.M. and S.C.; validation, Y.C. and J.L.; formal analysis, Y.M. and J.L.; investigation, Z.W. and Y.C.; resources, J.L.; data curation, Z.W. and J.L.; writing—original draft preparation, J.L. and Z.W.; writing—review and editing, Y.M. and J.L.; visualization, Y.M.; supervision, J.L.; project administration, Y.M.; funding acquisition, J.L. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the National Natural Science Foundation of China, grant number 52069008, the Yunnan Major Science and Technology Special Plan, grant number 202302AE090024, the Yunnan Fundamental Research Projects, grant number 202101AT070113, the Yunnan Revitalization Talent Support Program.

Institutional Review Board Statement

Not applicable.

Data Availability Statement

The original contributions presented in the study are included in the article/Supplementary Materials, further inquiries can be directed to the corresponding author.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Gao, Z.; Du, S.; Zhong, Y.; Wu, Y.; Zhang, G. Water Fertiliser Integration Development Status and Prospects. China Agric. Inform. 2015, 27, 14–19. [Google Scholar]
  2. Sun, F.; Ma, W.; Li, H.; Wang, S. Research on Water-Fertilizer Integrated Technology Based On Neural Network Prediction and Fuzzy Control. IOP Conf. Ser. Earth Environ. Sci. 2018, 170, 32168. [Google Scholar] [CrossRef]
  3. Cai, C.; Zheng, P.; Zhang, J. Integrated Monitor System of Water and Fertilizer of Greenhouse Intelligent Irrigation. Jiangsu Agric. Sci. 2017, 45, 164–166. [Google Scholar]
  4. Lu, H.; Wang, T.; Qiao, D.; Sun, J.; Wu, G.; Tian, C.; Yan, F.; Zhen, B. Internet of Things in Irrigated Agriculture: From Irrigation Automation to Smart Irrigation. J. Irrig. Drain. 2023, 42, 87–99. [Google Scholar]
  5. Song, J.; Xu, L.; He, D.; Tuskagoshi, S.; Kozai, T.; Shinohara, Y. Estimating EC and Ionic EC Contribution Percentage of Nutrient Solution Based on Ionic Activity. Int. J. Agric. Biol. Eng. 2019, 12, 42–48. [Google Scholar] [CrossRef]
  6. Moon, T.; Ahn, T.I.; Son, J.E. Long Short-Term Memory for a Model-Free Estimation of Macronutrient Ion Concentrations of Root-Zone in Closed-Loop Soilless Cultures. Plant Methods 2019, 15, 59. [Google Scholar] [CrossRef] [PubMed]
  7. Chen, F.; Wei, D.; Tang, Y. Virtual Ion Selective Electrode for Online Measurement of Nutrient Solution Components. IEEE Sens. J. 2011, 11, 462–468. [Google Scholar] [CrossRef]
  8. Cecconi, F.; Reifsnyder, S.; Ito, Y.; Jimenez, M.; Sobhani, R.; Rosso, D. ISE-Ammonium Sensors in WRRFs: Field Assessment of Their Influencing Factors. Environ. Sci. Water Res. Technol. 2019, 5, 737–746. [Google Scholar] [CrossRef]
  9. Lin, Z.; Wang, R.; Wang, Y.; Wang, L.; Lu, C.; Liu, Y.; Zhang, Z.; Zhu, L. Accurate and Rapid Detection of Soil and Fertilizer Properties Based on Visible/near-Infrared Spectroscopy. Appl. Opt. 2018, 57, D69–D73. [Google Scholar] [CrossRef]
  10. Khanmohammadi, M.; Garmarudi, A.B.; Ghasemi, K.; Garrigues, S.; de la Guardia, M. Artificial Neural Network for Quantitative Determination of Total Protein in Yogurt by Infrared Spectrometry. Microchem. J. 2009, 91, 47–52. [Google Scholar] [CrossRef]
  11. Song, L.; Zhang, H.; Ni, X.; Wu, L.; Lin, B.; Yu, L.; Wang, Q.; Wu, Y. Quantitative Analysis of Contents in Compound Fertilizer and Application Research Using Near Infrared Reflectance Spectroscopy. Spectrosc. Spectr. Anal. 2014, 34, 73–77. [Google Scholar]
  12. Yahaya, S.M.; Mahmud, A.A.; Abdullahi, M.; Haruna, A. Recent Advances in the Chemistry of Nitrogen, Phosphorus and Potassium as Fertilizers in Soil: A Review. Pedosphere 2023, 33, 385–406. [Google Scholar] [CrossRef]
  13. Bian, X.; Wang, K.; Tan, E.; Diwu, P.; Zhang, F.; Guo, Y. A Selective Ensemble Preprocessing Strategy for Near-Infrared Spectral Quantitative Analysis of Complex Samples. Chemom. Intell. Lab. Syst. 2020, 197, 103916. [Google Scholar] [CrossRef]
  14. Zhang, G.; Hao, H.; Wang, Y.; Jiang, Y.; Shi, J.; Yu, J.; Cui, X.; Li, J.; Zhou, S.; Yu, B. Optimized Adaptive Savitzky-Golay Filtering Algorithm Based on Deep Learning Network for Absorption Spectroscopy. Spectrochim. Acta Part A Mol. Biomol. Spectrosc. 2021, 263, 120187. [Google Scholar] [CrossRef]
  15. Jiang, H.; Zhang, H.; Chen, Q.; Mei, C.; Liu, G. Identification of Solid State Fermentation Degree with FT-NIR Spectroscopy: Comparison of Wavelength Variable Selection Methods of CARS and SCARS. Spectrochim. Acta Part A Mol. Biomol. Spectrosc. 2015, 149, 1–7. [Google Scholar] [CrossRef]
  16. Li, H.; Liang, Y.; Xu, Q.; Cao, D. Key Wavelengths Screening Using Competitive Adaptive Reweighted Sampling Method for Multivariate Calibration. Anal. Chim. Acta 2009, 648, 77–84. [Google Scholar] [CrossRef]
  17. Liang, L.; Zhang, T.; Wang, K.; Tang, H.; Yang, X.; Zhu, X.; Duan, Y.; Li, H. Classification of Steel Materials by Laser-Induced Breakdown Spectroscopy Coupled with Support Vector Machines. Appl. Opt. 2014, 53, 544–552. [Google Scholar] [CrossRef]
  18. Yu, C.J.; He, Y.Y.; Quan, T.F. Frequency Spectrum Prediction Method Based on EMD and SVR. Intell. Syst. Des. Appl. 2008, 3, 39–44. [Google Scholar]
  19. Li, Q.; Zeng, J.; Lin, L.; Zhang, J.; Zhu, J.; Yao, L.; Wang, S.; Yao, Z.; Wu, Z. Low Risk of Category Misdiagnosis of Rice Syrup Adulteration in Three Botanical Origin Honey by ATR-FTIR and General Model. Food Chem. 2020, 332, 127356. [Google Scholar] [CrossRef]
  20. Li, L.; Ren, T.; Wang, S.; Ming, J.; Liu, Q.; Lu, J. Prediction Models of Winter Oilseed Rape Yield Based on Hyperspectral Data at Pod-Filling Stage. Trans. Chin. Soc. Agric. Mach. 2017, 48, 221–229. [Google Scholar]
  21. Zhang, Z.; Tai, X.; Yang, N.; Zhang, J.; Huang, X.; Chen, Q. UAV Multispectral Remote Sensing Soil Salinity Inversion Based on Different Fractional Vegetation Coverages. Trans. Chin. Soc. Agric. Mach. 2022, 53, 220–230. [Google Scholar]
  22. Orrillo, I.; Cruz-Tirado, J.P.; Cardenas, A.; Oruna, M.; Carnero, A.; Barbin, D.F.; Siche, R. Hyperspectral Imaging as a Powerful Tool for Identification of Papaya Seeds in Black Pepper. Food Control 2019, 101, 45–52. [Google Scholar] [CrossRef]
  23. Sun, D.; Li, M.; Mou, M.; Zhao, R.; Zhang, K. Rapid Determination of Nitrogen and Phosphorus in Dairy Farm Slurry Via Near-Mid Infrared Fusion Spectroscopy Technology. Spectrosc. Spectr. Anal. 2021, 41, 3092–3098. [Google Scholar]
  24. Jiang, Z.; Jin, K.; Zhong, L.; Zheng, Y.; Shao, Q.; Zhang, A. Near-Infrared Spectroscopy Combined with Machine Learning for Rapid Identification of Atractylodis Rhizoma Decoction Pieces. Ind. Crops Prod. 2023, 197, 116579. [Google Scholar] [CrossRef]
  25. Liu, F.; Ye, X.; He, Y.; Wang, L. Application of Visible/near Infrared Spectroscopy and Chemometric Calibrations for Variety Discrimination of Instant Milk Teas. J. Food Eng. 2009, 93, 127–133. [Google Scholar] [CrossRef]
  26. Shen, J.; Qiao, W.; Chen, H.; Zhou, J.; Liu, F. Application of Visible/Near Infrared Spectrometers to Quickly Detect the Nitrogen, Phosphorus, and Potassium Content of Chemical Fertilizers. Appl. Sci. 2021, 11, 5103. [Google Scholar] [CrossRef]
  27. Wang, X.; Zhao, C.; Dong, D. High-Throughput Online Measurement of Nutrient Contents in Moving Fertilizers-Based on near Infrared Spectrum and Chemometrics. Jiangsu Agric. Sci. 2018, 46, 238–240. [Google Scholar]
  28. Wang, L.S.; Wang, R.J.; Lu, C.P.; Wang, J.; Huang, W.; Jian, Q.; Wang, Y.B.; Lin, L.Z.; Song, L.T. Quantitative Analysis of Total Nitrogen Content in Monoammonium Phosphate Fertilizer Using Visible-Near Infrared Spectroscopy and Least Squares Support Vector Machine. J. Appl. Spectrosc. 2019, 86, 465–469. [Google Scholar] [CrossRef]
  29. Wu, H.; Li, J.; Zhang, J.; Ma, Z.; Waleed, E. Development of Rapid Identification Device for Variety of Macronutrient Water Soluble Fertilizers Based on Dielectric Characteristic Frequency. Trans. Chin. Soc. Agric. Eng. (Trans. CSAE) 2017, 33, 51–58. [Google Scholar]
  30. Li, J.; Gao, Y.; Zeng, J.; Li, X.; Wu, Z.; Wang, G. Online Rapid Detection Method of Fertilizer Solution Information Based on Characteristic Frequency Response Features. Sensors 2023, 23, 1116. [Google Scholar] [CrossRef]
  31. Li, J.; Li, Y.; Yang, Q.; Lei, L.; Wu, Z. Development of Real-Time Detecting Device for Nitrogen Concentration of Liquid Fertilizer. Trans. Chin. Soc. Agric. Eng. 2015, 31, 139–145. [Google Scholar]
Figure 1. Development strategy of NIR fertilizer detection sensors: (a) acquisition and pre-processing of NIR absorption spectra of four fertilizer liquids; (b) determination of characteristic wavelengths and construction of qualitative and quantitative models; (c) design of sensor structures and amplifier circuits; and (d) detection strategy of qualitative analysis followed by quantitative assessment.
Figure 1. Development strategy of NIR fertilizer detection sensors: (a) acquisition and pre-processing of NIR absorption spectra of four fertilizer liquids; (b) determination of characteristic wavelengths and construction of qualitative and quantitative models; (c) design of sensor structures and amplifier circuits; and (d) detection strategy of qualitative analysis followed by quantitative assessment.
Agriculture 14 01184 g001
Figure 2. Fertilizer detection sensor; (a) overall structure of the sensor; (b) exterior structure of the sensor; (c) internal structure of the sensor; (d) physical drawing of the fertilizer sensor.
Figure 2. Fertilizer detection sensor; (a) overall structure of the sensor; (b) exterior structure of the sensor; (c) internal structure of the sensor; (d) physical drawing of the fertilizer sensor.
Agriculture 14 01184 g002
Figure 3. Fertilizer concentration detection strategy.
Figure 3. Fertilizer concentration detection strategy.
Agriculture 14 01184 g003
Figure 4. Raw spectra of nutrient ions of four fertilizer solutions to be tested.
Figure 4. Raw spectra of nutrient ions of four fertilizer solutions to be tested.
Agriculture 14 01184 g004
Figure 5. S-G pretreatment spectra of nutrient ions of four fertilizer solutions to be tested.
Figure 5. S-G pretreatment spectra of nutrient ions of four fertilizer solutions to be tested.
Agriculture 14 01184 g005
Figure 6. Effective wavelength distribution of HPO4 after CARS selection.
Figure 6. Effective wavelength distribution of HPO4 after CARS selection.
Agriculture 14 01184 g006
Figure 7. Comparison of the original spectra with the confusion matrix of the four-classification prediction set obtained by S-G preprocessing combined with BPNN: (a) raw spectrum; (b) S-G preprocessing.
Figure 7. Comparison of the original spectra with the confusion matrix of the four-classification prediction set obtained by S-G preprocessing combined with BPNN: (a) raw spectrum; (b) S-G preprocessing.
Agriculture 14 01184 g007
Figure 8. Correlation between true and predicted values in the BPNN prediction model for four fertilizer solutions to be tested. (a) KH2PO4 quantity contained (b) K2SO4 quantity contained (c) (NH4)2SO quantity contained (d) (NH4)2HPO4 quantity contained.
Figure 8. Correlation between true and predicted values in the BPNN prediction model for four fertilizer solutions to be tested. (a) KH2PO4 quantity contained (b) K2SO4 quantity contained (c) (NH4)2SO quantity contained (d) (NH4)2HPO4 quantity contained.
Agriculture 14 01184 g008
Figure 9. Fitting curves of concentration and absorbance at characteristic wavelengths of four fertilizers to be tested: (a) HPO4 (980 nm); (b) NH4+ (1450 nm); (c) H2PO4 (1550 nm); (d) K+ (1600 nm).
Figure 9. Fitting curves of concentration and absorbance at characteristic wavelengths of four fertilizers to be tested: (a) HPO4 (980 nm); (b) NH4+ (1450 nm); (c) H2PO4 (1550 nm); (d) K+ (1600 nm).
Agriculture 14 01184 g009
Figure 10. Stability test of fertilizer detection device: (a) LED irradiation voltage value; (b) transmission voltage value; (c) ambient light voltage value.
Figure 10. Stability test of fertilizer detection device: (a) LED irradiation voltage value; (b) transmission voltage value; (c) ambient light voltage value.
Agriculture 14 01184 g010
Figure 11. Confusion matrix for identifying nutrient ion types in four fertilizer solutions.
Figure 11. Confusion matrix for identifying nutrient ion types in four fertilizer solutions.
Agriculture 14 01184 g011
Figure 12. The concentration detection error of the sensor for four kinds of configured fertilizer solution.
Figure 12. The concentration detection error of the sensor for four kinds of configured fertilizer solution.
Agriculture 14 01184 g012
Table 1. Comparison of four classification results obtained by S−G preprocessing combined with PLS-DA, SVM, and BPNN modeling, respectively.
Table 1. Comparison of four classification results obtained by S−G preprocessing combined with PLS-DA, SVM, and BPNN modeling, respectively.
Modeling Correction SetPrediction Set
K+H2PO4HPO42−NH4+K+H2PO4HPO42−NH4+
Raw-PLSSENS (%)10096.9086.201001007581.860
SPEC (%)10096.785.810010067.6583.87100
ACC (%)95.8784.62
S-G-PLSSENS (%)10010010010010083.3100100
SPEC (%)10010010010010093.1100100
ACC (%)10094.87
Raw-SVMSENS (%)10093.909694.1010085.7064.7063.60
SPEC (%)10096.9085.7010036.407591.7087.50
ACC (%)95.8771.95
S-G-SVMSENS (%)10010010010050100100100
SPEC (%)10010010010010083.396.7100
ACC (%)10087.18
Raw-BPNNSENS (%)10010096.910010087.563.6100
SPEC (%)10098.8510010010095.887.9100
ACC (%)99.1787.18
S-G-BPNNSENS (%)10010010010010093.3100100
SPEC (%)10010010010010097.85100100
ACC (%)10098.35
Table 2. PLSR, SVR, and BPNN statistics for predicting nutrient ion concentrations in four fertilizer samples using full and eigen spectral modeling.
Table 2. PLSR, SVR, and BPNN statistics for predicting nutrient ion concentrations in four fertilizer samples using full and eigen spectral modeling.
Fertilizer TypeWavelength
Selection
Methods
ModelingCorrection SetPrediction SetRPD
Rc2RMSECRp2RMSEP
K+
K2SO4
FullPLSR0.90310.28300.90290.81803.4995
SVR0.93550.58670.77051.53676.8459
BPNN0.98290.20350.79810.93072.3104
CARSPLSR0.99270.18780.92350.61404.9311
SVR0.95850.58280.95500.82026.8459
BPNN0.99580.18480.98790.32018.7947
H2PO4
KH2PO4
FullPLSR0.92480.27050.90380.82233.4817
SVR0.99140.26670.78850.93522.3370
BPNN0.80221.97680.71022.10081.4722
CARSPLSR0.98830.23720.92080.73513.5614
SVR0.93800.74520.53561.63711.1029
BPNN0.92490.74090.95920.71604.2287
NH4+
(NH4)2SO4
FullPLSR0.98950.06320.91820.71023.5063
SVR0.98090.08950.93460.68143.7464
BPNN0.98300.37800.92450.74823.6503
CARSPLSR0.99870.43890.95200.49036.1752
SVR0.99620.08190.78940.98033.1387
BPNN0.99710.15220.99550.203614.9451
HPO42−
(NH4)2HPO4
FullPLSR0.98850.04310.95080.05895.3663
SVR0.99820.08150.71863.04361.0886
BPNN0.94750.67100.95290.58404.8282
CARSPLSR0.99980.02780.99080.03748.8580
SVR0.99700.08490.98840.32805.0983
BPNN0.99620.18240.99360.017712.6860
Table 3. Predictive models for ion concentrations of the four fertilizer solutions to be tested.
Table 3. Predictive models for ion concentrations of the four fertilizer solutions to be tested.
Nutrient IonCharacteristic Wavelength Concentration Prediction ModelR2
HPO42−y = 0.5915 + 0.0004x0.9624
NH4+y = 3.1026 + 0.00006x0.9573
H2PO4y = 3.0936 + 0.0006x0.9552
K+y = 1.9402 + 0.0013x0.9560
Table 4. Absorbance and predicted concentration results for four 10–100 mg/L nutrient examples.
Table 4. Absorbance and predicted concentration results for four 10–100 mg/L nutrient examples.
Nutrient IonActual Concentration mg/LAbsorbancePredicted Concentration mg/LR2RMSE
K+101.95410.260.99531.9683
201.96620.19
301.97728.31
401.99138.98
502.00348.53
602.02061.49
702.03371.61
802.04983.56
902.05790.20
1002.0659.12
H2PO4103.0999.680.99592.4947
203.10621.18
303.11332.07
403.11840.05
503.12653.21
603.13064.12
703.13771.54
803.14483.96
903.14992.72
1003.15298.07
NH4+103.1039.520.99701.6518
203.10420.62
303.10529.87
403.10543.06
503.10651.09
603.10661.33
703.10769.82
803.10878.09
903.10892.78
1003.10998.29
HPO42−100.59610.250.99911.0034
200.60021.19
300.60329.88
400.60842.01
500.61250.68
600.61558.94
700.62071.05
800.62480.33
900.62891.07
1000.63199.23
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Ma, Y.; Wu, Z.; Cheng, Y.; Chen, S.; Li, J. Rapid Detection of Fertilizer Information Based on Near-Infrared Spectroscopy and Machine Learning and the Design of a Detection Device. Agriculture 2024, 14, 1184. https://doi.org/10.3390/agriculture14071184

AMA Style

Ma Y, Wu Z, Cheng Y, Chen S, Li J. Rapid Detection of Fertilizer Information Based on Near-Infrared Spectroscopy and Machine Learning and the Design of a Detection Device. Agriculture. 2024; 14(7):1184. https://doi.org/10.3390/agriculture14071184

Chicago/Turabian Style

Ma, Yongzheng, Zhuoyuan Wu, Yingying Cheng, Shihong Chen, and Jianian Li. 2024. "Rapid Detection of Fertilizer Information Based on Near-Infrared Spectroscopy and Machine Learning and the Design of a Detection Device" Agriculture 14, no. 7: 1184. https://doi.org/10.3390/agriculture14071184

APA Style

Ma, Y., Wu, Z., Cheng, Y., Chen, S., & Li, J. (2024). Rapid Detection of Fertilizer Information Based on Near-Infrared Spectroscopy and Machine Learning and the Design of a Detection Device. Agriculture, 14(7), 1184. https://doi.org/10.3390/agriculture14071184

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop