Highlights
What are the main findings?
- NIR spectroscopy coupled with machine learning achieved good predictions for soil organic carbon and total nitrogen at the national scale.
- Prediction performance varied substantially across land-use types and environmental zones, with the Pannonian zone showing the highest overall accuracy and the Alpine South zone the lowest.
What are the implications of the main findings?
- The results provide property-specific and environment-specific assessments of whether NIR spectroscopy can deliver usable accuracy, serving as a reference for designing national soil monitoring programs.
- The variation in performance across different contexts indicates that the suitability of NIR spectroscopy should be evaluated separately for each target property, land use, and environmental zone.
Abstract
Near-infrared (NIR) spectroscopy combined with machine learning offers a rapid and cost-effective method for large-scale soil characterization. However, how this approach performs across diverse land-use types and environmental zones at the national scale remains poorly understood. This study conducts a systematic evaluation of five machine learning algorithms for predicting 14 key soil properties, using the Austrian NIR soil spectral library. The analysis assessed the robustness of partial least squares regression (PLSR), elastic net (EN), support vector regression (SVR), random forest (RF), and LightGBM across different land-use types and environmental zones. The results demonstrate that predictive accuracy is highly specific to the target soil property and influenced by its environmental and land-use context. No single algorithm was universally optimal. Overall, PLSR and EN provided the most accurate and robust predictions for the majority of properties, while SVR also performed satisfactorily. In contrast, complex non-linear models generally underperformed, showing a pronounced susceptibility to overfitting in data-scarce contexts. Critically, the relative ranking of algorithms shifted depending on the specific land-use type and environmental zone. This work provides references for deploying NIR spectroscopy with machine learning in national-scale soil assessment programs, revealing that model performance is not uniform across different environmental and management contexts.
1. Introduction
As a fundamental and non-renewable natural resource, soil is critical for sustaining agricultural productivity, ecosystem stability, and biogeochemical cycles [1,2,3]. Reliable information on soil properties is essential for understanding soil functions and supporting land management decisions [4,5,6]. Conventional approaches for determining soil properties primarily rely on wet chemical analysis [7,8]. Although these laboratory methods are highly accurate, they are labor-intensive, time-consuming, and costly, which hinders their application in large-scale national soil monitoring [9,10].
Near-infrared (NIR) spectroscopy has emerged as a powerful analytical technique for soil property characterization, one which relies on the interaction between NIR light and soil constituents [11,12]. The specific chemical bonds in soil constituents absorb NIR radiation at characteristic wavelengths through overtone and combination vibrations. This absorption process generates distinct spectral signatures that serve as quantitative proxies for soil composition [13,14]. The effective prediction of soil properties from spectra requires decoding the complex relationships within the data. This task is challenging because the spectral response for a target property is influenced by interactions among multiple soil components [15,16]. Machine learning algorithms provide a powerful solution to model the complex patterns of high-dimensional spectral datasets. They learn intricate patterns from spectral data without requiring explicit prior knowledge of the underlying physicochemical mechanisms, thereby facilitating the development of predictive models [17,18].
Numerous studies have explored various machine learning algorithms for soil property prediction from spectra. Early work demonstrated that Vis-NIR reflectance could predict soil organic carbon at continental scale [19], and subsequent local learning approaches showed that models based on spectrally similar neighbors can capture heterogeneous spectral–property relationships more effectively than globally fitted regressions [20]. More recently, local modeling from spectral libraries, using spectral similarity retrieval and continuum removal subset selection, has been reported to outperform global PLSR even with fewer calibration samples [9,21]. Another direction reformulates localization as a transfer learning problem, where a small number of local observations adapt a large global spectral library to site-specific conditions, potentially improving both accuracy and cost efficiency [22]. Moreover, deep representation learning with Transformer–CNN hybrids and encoder–decoder architectures has shown competitive performance for multiple soil properties, and interpretability tools are increasingly used to connect predictions to physically meaningful bands [23,24]. However, much of the existing research has been conducted in localized studies with relatively homogeneous environmental conditions and land use. While these approaches achieve satisfactory accuracy within their specific contexts, their design often overlooks the environmental heterogeneity across geographical extents [25]. This limitation relates to a foundational principle in spatial prediction, where the relationship between the soil spectrum and its properties is not universal but is influenced by the environmental context. This principle is articulated in the Third Law of Geography, which states that the similarity of geographic phenomena is contingent upon the similarity of their geographic environments [26]. For soil spectral modeling, it implies that the predictive performance of machine learning models is influenced by the specific pedoclimatic conditions and land management practices [27]. The performance and robustness of NIR spectroscopy with machine learning across the diverse land-use types and environmental zones at a national scale remain unquantified and poorly understood.
In this study, a national-scale evaluation of machine learning algorithms for soil property prediction using NIR spectra is performed using the Austrian soil spectral library, which encompasses diverse land-use types and environmental zones. Five representative machine learning algorithms are systematically investigated for predicting 14 soil properties. The analysis is specifically designed to examine how model performance varies across different contexts. The objectives of this study are (1) to evaluate the overall performance of NIR spectroscopy with machine learning for predicting 14 key soil properties at the national scale; (2) to analyze the variation in key soil properties and their spectral characteristics across different land-use types and environmental zones; and (3) to examine how prediction accuracy varies across land-use types and environmental zones.
2. Materials and Methods
2.1. Soil Samples
The soil samples used in this study were drawn from the Austrian near-infrared (NIR) soil spectral library compiled by Fohrafellner et al. [28]. The library comprises 2129 legacy samples collected across Austria between 2016 and 2023, covering all five environmental zones and a range of land-use types. Samples with missing land-use or environmental-zone information were excluded, leaving 2055 samples for the present analysis. According to the library documentation [28], samples were air-dried and passed through a 2 mm sieve prior to spectroscopic measurement. Sampling depth was recorded between 0 and 110 cm. All reference soil properties were taken directly from the library dataset. Their laboratory determination methods and associated standards are fully documented in the original dataset legend [28].
2.2. Spectral Data and Preprocessing
Diffuse reflectance spectra were recorded from 680 to 2500 nm at 1 nm resolution using a SpectraStarTM XL near-infrared spectrometer, with 24 scans per cup and two cups per sample, the results of which were averaged [28]. The reflectance (R) was converted to absorbance (A) by A = log10(1/R). Figure 1 shows the mean absorbance spectra of soil samples grouped by land-use type and environmental zone.
Figure 1.
Mean spectra of soil samples for (a) different land-use types and (b) different environmental zones.
The spectral range used for modeling was restricted to 780–2400 nm, and the detector-switch region (1330–1350 nm) was excluded [28]. The short-wave (<780 nm) and long-wave (>2400 nm) edges were removed due to low signal-to-noise ratios, while the 1330–1350 nm interval was discarded because it bridges the two detectors of the spectrometer and exhibits a visible discontinuity.
2.3. Machine Learning Algorithms
This study employed five machine learning algorithms to predict soil properties from NIR spectral data. The selected algorithms encompass a range of methodological approaches, from linear models to complex non-linear techniques, providing a comprehensive framework for evaluating predictive performance in soil spectral modeling.
PLSR was utilized as a linear method specifically designed for modeling high-dimensional datasets with multicollinear variables. Unlike principal component regression, PLSR does not seek latent components that explain the maximum variance within the feature space. Instead, it iteratively extracts a series of orthogonal latent components from the spectral data. Its criterion is to maximize the covariance between the components and the target soil property [29]. This process maps the original spectral coordinate system to a new subspace where the predictive relationship is most pronounced. By projecting the data onto the mutually orthogonal components, PLSR addresses dimensionality reduction and multicollinearity, filtering out noise and irrelevant spectral variation while preserving the information most relevant for prediction [30]. The optimal number of latent components, which controls model complexity and guards against overfitting, can be determined through cross-validation.
Elastic net (EN) was implemented as a regularized linear regression technique designed to improve upon ordinary least squares in the presence of correlated variables and high dimensionality. It imposes a composite penalty on the regression coefficients during model fitting, where the penalty is a convex combination of the L1-norm (lasso) and L2-norm (ridge) penalties [31]. The lasso penalty promotes sparsity by driving the coefficients of uninformative or redundant spectral bands to exactly zero, thereby performing automatic feature selection. The ridge penalty shrinks the coefficients of correlated predictors towards each other and towards zero, which helps to stabilize the solution and mitigate problems arising from high multicollinearity among spectral bands.
SVR was applied to model potentially non-linear relationships between spectral features and soil properties. SVR seeks to find the flattest hyperplane in a high-dimensional feature space that best fits the training data, where flatness is defined by minimizing the norm of the weight vector [32]. It is formulated as a convex optimization problem that incorporates an ε-insensitive loss function. This function penalizes prediction errors that exceed a predefined tolerance margin ε, thereby creating an ε-insensitive tube around the estimated hyperplane. Only samples falling outside this tube contribute to the cost, making the model robust to small errors and noise within the training data. To handle non-linearity, SVR utilizes kernel functions to implicitly map the original spectral data into a higher-dimensional space [33]. In this study, the radial basis function (RBF) kernel was adopted, which enables efficient learning of non-linear spectral–property relationships.
RF was employed as an ensemble learning method based on the aggregation of multiple decision trees [34]. The algorithm introduces bootstrap aggregating to build a diverse set of individual trees. Specifically, each tree is trained on a bootstrap sample drawn from the original training dataset. When splitting a node during the construction of a tree, this algorithm randomly selects a subset of features as candidates for the optimal split [35]. This approach ensures that the trees are different from one another, reducing the variance of the ensemble and making it more robust to noise in the training data. The final prediction is obtained by averaging the outputs from all individual trees in the forest, which generally results in improved generalization performance and less overfitting.
LightGBM was implemented as an advanced gradient boosting framework, which builds an ensemble model in a stage-wise fashion by sequentially adding weak learners. Each new tree is trained to predict the residuals of the current ensemble from the previous iteration, thereby correcting the errors of the existing model [36]. LightGBM uses a histogram-based algorithm to bucket continuous spectral feature values into discrete bins, speeding up the split-finding process. Specifically, it employs gradient-based one-side sampling (GOSS), which keeps all data points with large gradients and randomly samples from those with small gradients, focusing computational effort on the more informative samples. Furthermore, it utilizes exclusive feature bundling (EFB) to bundle mutually exclusive sparse features, effectively reducing the dimensionality [37].
2.4. Modeling and Evaluation
The dataset was first stratified by the cross-combination of land-use type and environmental zone. Within each resulting subgroup, samples were randomly split into a training set (70%) and an independent test set (30%). Two modeling approaches were adopted. In the overall approach, the training portions from all subgroups were merged into a combined training set, and the test portions into a combined test set. A single model was trained for each algorithm on the combined training set and evaluated on the combined test set. In the separate approach, models were constructed individually for each land-use type and each environmental zone, using the training samples from that subgroup for training and the corresponding test samples from the same subgroup for evaluation. Subgroups with fewer than ten training samples were excluded from the separate modeling. PLSR, EN, SVR, and RF were implemented using scikit-learn 1.5.2. LightGBM was implemented using LightGBM 4.6.0. All models were developed in Python 3.13.0. The flowchart of this study is shown in Figure 2. The distribution of training and test samples across different land-use types and environmental zones is summarized in Table 1 and Table 2, respectively.
Figure 2.
The flowchart of soil property prediction across land-use types and environmental zones.
Table 1.
Sample sizes for soil properties across land-use types.
Table 2.
Sample sizes for soil properties across environmental zones.
For all machine learning algorithms, the optimal values of their key parameters were determined through a five-fold cross-validation conducted on the training set. In this procedure, the training set was divided into five subsets of approximately equal size. The model was trained and validated iteratively five times, each time using a different fold as the validation set and the remaining four folds for training. The parameter configuration that yielded the best average validation performance across the five folds was selected. For the overall approach, cross-validation was performed on the combined training set; for the separate approach, cross-validation was performed independently within each subgroup. The search ranges of parameters for each algorithm are listed in Table 3.
Table 3.
Hyperparameter search ranges for each algorithm.
The predictive performance of the models was evaluated using four statistical metrics. Specifically, the coefficient of determination (R2) quantifies the proportion of variance in the observed values that is explained by the model predictions, with values closer to 1 indicating a better fit.
where yi is the observed value, and is the predicted value. denotes the mean of observed values, and n is the number of samples in the test set. Negative R2 values indicate that the model performs worse than a constant prediction at the mean. The root mean square error (RMSE), expressed in the units of the target property, measures the average magnitude of the prediction errors, where lower values correspond to greater accuracy. To assess the models’ robustness, the ratio of performance to deviation (RPD) was calculated as the ratio of the standard deviation of the observed values to the RMSE, and a higher RPD signifies a more reliable model. The ratio of performance to interquartile range (RPIQ) was computed as the interquartile range divided by the RMSE and provides a metric that is less sensitive to outliers, with higher values denoting superior predictive performance.
3. Results
3.1. Descriptive Statistics of Soil Properties
Figure 3 and Figure 4 present the distribution of the fourteen measured soil properties, grouped by land-use type and environmental zone, respectively. The box plots illustrate the central tendency, spread, and variability inherent to each group.
Figure 3.
Box plots of 14 soil properties across different land-use types.
Figure 4.
Box plots of 14 soil properties across different environmental zones.
The uneven availability of soil samples leads to some properties being absent for specific land-use types. All samples for labile carbon and clay in suspension were collected from Arable land. In contrast, SOC and pH CaCl2 were measured across all land-use types. Forest soils exhibited the highest median values for carbon and nitrogen properties, including SOC, TC, and TN. Arable land and Vineyard showed lower SOC and a more neutral to alkaline pH. Grassland displayed the highest median sand and the lowest median clay content, while Arable land was associated with a higher clay fraction. Phosphorus levels were highly variable, with Vegetable showing a high median concentration and a wide range.
The Mediterranean Mountains zone lacks soil samples for TC, CaCO3, and clay in suspension. The Alpine South zone was characterized by carbon-rich soils, showing the highest median SOC, labile carbon, and SOC/clay ratio. The Continental zone indicated a stronger influence of carbonate minerals, with the highest median CaCO3 content and a relatively high pH. The Pannonian zone was distinguished by fine-textured soils, exhibiting the highest median clay content and CEC, alongside the highest pH and the lowest TN.
3.2. Performance of Overall Approach
Table 4 summarizes the predictive performance of the five algorithms for each soil property under the overall modeling approach. PLSR exhibited the most robust and consistent accuracy among the five algorithms, yielding the highest or near-highest average R2 and RPD across all fourteen properties. It achieved the highest R2 for eight properties, although for several of these the margin over the second-best algorithm was small. EN delivered the best or comparable performance for TC, sand, SOC-to-clay ratio, and clay in suspension, while SVR showed the highest accuracy for TN and pH CaCl2.
Table 4.
Predictive performance of different algorithms under the overall modeling approach.
In contrast, the more complex models, RF and LightGBM, generally underperformed. Their average R2 values were considerably lower, and they showed limited predictive capability for several challenging properties. The RPD and RPIQ values further confirmed that PLSR, EN, and SVR consistently provided predictions suitable for quantitative soil assessment. With respect to individual soil properties, SOC, TN, clay, and pH CaCl2 were predicted with high-to-moderate accuracy by the top-performing algorithms. In contrast, phosphorus, labile carbon, CEC, and pH acetate proved difficult to predict accurately; even the best models yielded only low-to-moderate R2 values for these properties.
Furthermore, Figure 5 and Figure 6 show the R2 values of each algorithm for each land-use type and environmental zone, respectively. The results reveal that even within the overall approach, predictive accuracy varied substantially across contexts, with certain subgroups benefiting more from the pooled training data than others.
Figure 5.
R2 of machine learning algorithms under the overall approach for predicting soil properties across different land-use types.
Figure 6.
R2 of machine learning algorithms under the overall approach for predicting soil properties across different environmental zones.
3.3. Performance of Separate Approach
Figure 7 presents the R2 values of the five algorithms under the separate approach for each land-use type. Predictive accuracy for SOC varied strongly with land use. The highest R2 was obtained in Orchard, where PLSR achieved 0.90. Vegetable followed closely, with EN reaching 0.92. Forest also performed well, with PLSR at 0.87. Arable land gave moderate R2 with PLSR at 0.77, and Grassland with EN at 0.57. Lawn and Ornamental plant yielded lower values, approximately 0.53 and 0.38, respectively. For Vineyard, the best result came from EN with an R2 of 0.09, while PLSR produced a negative value. RMSE was lowest for Vegetable and highest for Ornamental plant, consistent with the R2 pattern.
Figure 7.
R2 of machine learning algorithms under the separate approach for predicting soil properties across different land-use types.
For pH CaCl2, the strongest result came from Vineyard, where SVR gave an R2 of 0.85. Arable land also performed well with SVR at 0.69. In contrast, Forest produced a strongly negative R2, and Lawn reached only 0.19 even with the best model. Other properties also revealed a strong dependence on land use. Phosphorus was predicted accurately in Orchard, with PLSR reaching 0.88, but very poorly for Arable land, where EN achieved only 0.08 even though Arable land had many more samples.
Within Arable land, the relative ranking of algorithms was similar to that in the overall modeling approach. PLSR and EN were the top choices for most properties, and SVR was best for pH CaCl2. Nevertheless, several challenging properties had notably lower R2 values than in the overall model. For example, phosphorus decreased from 0.35 in the overall model to 0.08 in the Arable-specific model. This suggests that a model built on a single land use does not automatically yield more refined soil–spectral relationships and may generalize more poorly than a model trained on a diverse dataset.
Furthermore, Figure 8 illustrates the corresponding results under the separate approach for each environmental zone. The Mediterranean Mountains zone contained too few samples for reliable evaluation and was therefore excluded. Comparative analysis was possible for Alpine South, Continental, and Pannonian, where most soil properties had adequate sample sizes.
Figure 8.
R2 of machine learning algorithms under the separate approach for predicting soil properties across different environmental zones.
For SOC, predictive accuracy was highest in the Pannonian zone, where EN achieved an R2 of 0.85 and PLSR achieved 0.82. The Continental zone also performed well, with SVR reaching 0.78 and PLSR reaching 0.75. Alpine South showed moderate results, where EN attained 0.69 and PLSR attained 0.64. The RMSE pattern was consistent with the R2 results, with the smallest errors observed in Pannonian and the largest in Alpine South.
The Pannonian zone showed the highest prediction accuracy among the three zones. Several key properties reached high accuracy, including the SOC-to-clay ratio at 0.88, CaCO3 at 0.92, TN at 0.90, and CEC at 0.73, all obtained with PLSR. The Continental zone showed promising results for properties such as TN and clay, both exceeding 0.75 under EN. By comparison, Alpine South showed the lowest prediction accuracy. The R2 for CaCO3 remained below 0.35, the R2 for CEC was negative, and several texture-related properties were predicted with low or unstable accuracy.
The tree-based models performed inconsistently across the three zones. RF and LightGBM frequently produced low or negative R2 values, especially for CaCO3, pH acetate, and texture fractions in Alpine South and Pannonian. Their instability contrasted with the steady performance of PLSR and EN, which remained the most reliable choices for zone-specific spectral modeling.
4. Discussion
The 14 target properties differ markedly in the directness of their relationship with NIR absorbance. Based on the physicochemical origin of the spectral signal, they fall into three groups. The first group consists of properties that exhibit a direct or quasi-direct spectral response: SOC, TC, and TN are associated with C-H, N-H, and O-H overtone and combination bands [11,13]; clay, sand, and silt are captured partly through mineral absorption features and partly through particle-size-dependent scattering geometry [11,14]. The second group comprises properties that are predicted primarily through their covariance with directly sensed constituents. CaCO3 is linked to carbonate absorption in the 2300–2400 nm region [13]. CEC is approximated by organic-matter and clay-mineral associations [28]. pH, SOC/clay ratio, and clay in suspension are derived from the same spectral subspaces [11]. The third group, including phosphorus and labile carbon, has no distinct NIR chromophore and relies on weak, context-specific secondary correlations, which accounts for their persistently lower accuracy and greater instability across land-use types and environmental zones [20,28]. This grouping aligns with the observed ranking of model performance and indicates that NIR spectroscopy is best positioned as a quantitative tool for group-1 properties and as a screening tool for group-2 and group-3 properties, rather than a universal substitute for wet-chemical analysis.
For most soil properties and contexts, linear models achieved higher predictive accuracy than complex non-linear algorithms. This pattern was observed under the current single-partition evaluation; a more comprehensive assessment using repeated cross-validation would help confirm its robustness. This pattern is consistent with earlier large-scale studies reporting that local calibration strategies can capture heterogeneous spectral–property relationships more effectively than globally fitted models [19,20]. In the present dataset, the performance gap between linear and non-linear models was itself context-dependent, shifting across land-use types and environmental zones. This further supports the view that spectral–property relationships are not uniform but are conditioned by the compositional and environmental characteristics of the sample domain. PLSR projects high-dimensional collinear data into a latent space that maximizes covariance with the target variable. EN employs hybrid regularization to perform automated wavelength selection while mitigating multicollinearity, thereby preventing overfitting in datasets with thousands of correlated spectral bands. Under the conditions examined here, simpler models with stronger inductive bias generalized more effectively than complex black-box models. Furthermore, the consistent performance of PLSR across diverse environmental zones underscores its stability and reliability for large-scale applications.
Model performance differed across application contexts, as evidenced by the shifts in accuracy when analyses were stratified by specific land use or environmental zone. RF and LightGBM underperformed in several contexts. While these models are capable of learning intricate patterns, they require substantial data to achieve robust generalization. Dividing the dataset by land-use types or environmental zones reduces the number of samples available for training each sub-model, and the complex models trained on limited samples are prone to overfitting. This frequently resulted in low or negative R2 values, for example when RF was applied to TC in Arable land or to CaCO3 in the Continental zone. In contrast, linear models with stronger inductive biases and more constrained parameter spaces demonstrated superior generalization ability from limited samples. Consequently, for sample-constrained soil monitoring applications, a well-applied linear model often presents a better choice than a complex non-linear one.
Land management practices shape soil composition and the resultant spectral response [38,39]. This was evidenced by the dramatic variation in predictive accuracy for the same property across different land uses. For example, SOC was predicted with high accuracy in Orchard but poorly in Vineyard, reflecting differences in organic matter composition and soil-matrix interactions between these land-use types. Such variation suggests that the spectral relationship of a soil property can be unique to a given land use, and that spectral predictability is not guaranteed across all management contexts [40,41]. Similarly, model performance was influenced by environmental zones, which integrate the composite effects of climate, geology, and soil formation processes [42,43]. The high prediction accuracy observed in the Pannonian zone for several properties coincided with its larger sample sizes and narrower property ranges, while the Alpine South zone, with fewer samples and wider property distributions, showed lower accuracy. These differences likely reflect the confounding effects of sample size and property variability rather than intrinsic differences in spectral predictability between zones. This spatial dependency highlights the necessity of contextual awareness in soil spectral modeling.
The comparison between the overall and separate approaches on the same set of test observations showed that the separate approach did not consistently improve predictive performance across land-use types or environmental zones. While the separate approach outperformed the overall one for certain soil properties and algorithms, it also led to lower accuracy in other cases. This suggests that the effectiveness of the separate approach depends on the target soil property, the algorithm used, and the availability of representative samples, rather than being guaranteed by separation alone.
This study advances the field from demonstrating predictive feasibility to providing an evidence-based reference for deploying NIR spectroscopy with machine learning in national-scale soil monitoring. The findings argue against a one-size-fits-all model, advocating instead for a context-aware strategy. For national-scale soil monitoring, a model utilizing a robust linear algorithm trained on a comprehensive spectral library offers reliable and stable predictions. For regional or land-use-specific applications where sample density is sufficient, localized models can yield satisfactory accuracy for certain properties, but algorithm selection must be rigorously validated. Therefore, the selection of a predictive algorithm should be based on the specific soil property of interest and the environmental context, with simpler linear models recommended as the practical choice for most spectral modeling.
Several limitations of this study should be acknowledged. First, the sample size in certain subsets of the spectral library is limited, which constrains the reliability of model evaluation for those specific contexts. Second, this study is based solely on the Austrian soil spectral library. While the dataset spans diverse land-use types and environmental zones within Austria, the generalizability of the findings to other regions with different pedoclimatic conditions remains to be tested. Third, future studies could explore a broader range of preprocessing techniques and modeling algorithms for further validation.
5. Conclusions
This study performed a national-scale evaluation of NIR spectroscopy with machine learning for predicting 14 soil properties, assessing how land-use types and environmental zones influence predictive performance. The main conclusions are as follows:
- (1)
- The accuracy of soil property prediction using NIR spectroscopy varied across different target properties. SOC, TN, and clay were among the most accurately predicted properties. In contrast, phosphorus, labile carbon, and CEC proved more challenging, yielding moderate-to-low prediction accuracy even with the best-performing models. These results suggest that the complexity of soil property relationships is a primary determinant of predictive feasibility.
- (2)
- Among the algorithms evaluated, PLSR and EN achieved the highest predictive accuracy for most properties, whereas non-linear methods were less robust, especially in smaller subgroups. While their regularized structure offers a plausible explanation for this advantage, the observed pattern reflects predictive performance rather than a direct test of the underlying functional form.
- (3)
- The predictive performance of the machine learning algorithms differed across land-use types and environmental zones. No single algorithm performed best across all conditions, indicating that the applicability of a model depends on the specific property and context.
Future studies should validate these findings using soil spectral libraries from other geographic regions, and further refine the context-aware guidelines for deploying NIR spectroscopy with machine learning in national-scale soil assessment.
Author Contributions
Conceptualization, Q.L.; methodology, D.L.; software, D.L.; validation, Y.W. and D.L.; formal analysis, L.W.; investigation, L.W. and Q.L.; resources, L.W.; data curation, Y.W.; visualization, Y.W.; supervision, Q.L. All authors have read and agreed to the published version of the manuscript.
Funding
This research received no external funding.
Institutional Review Board Statement
Not applicable.
Informed Consent Statement
Not applicable.
Data Availability Statement
The data presented in this study are available at https://doi.org/10.5281/zenodo.15772618.
Acknowledgments
During the preparation of this manuscript, the authors used DeepSeek-V3 for the purposes of language polishing and grammar correction. The authors have reviewed and edited the output and take full responsibility for the content of this publication.
Conflicts of Interest
The authors declare no conflicts of interest.
References
- Li, T.; Cui, L.; Filipović, V.; Tang, C.; Lai, Y.; Wehr, B.; Song, X.; Chapman, S.; Liu, H.; Dalal, R.C.; et al. From Soil Health to Agricultural Productivity: The Critical Role of Soil Constraint Management. CATENA 2025, 250, 108776. [Google Scholar] [CrossRef] [Scilit]
- Schmidt, M.W.I.; Torn, M.S.; Abiven, S.; Dittmar, T.; Guggenberger, G.; Janssens, I.A.; Kleber, M.; Kögel-Knabner, I.; Lehmann, J.; Manning, D.A.C.; et al. Persistence of Soil Organic Matter as an Ecosystem Property. Nature 2011, 478, 49–56. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Quinton, J.N.; Govers, G.; Van Oost, K.; Bardgett, R.D. The Impact of Agricultural Soil Erosion on Biogeochemical Cycling. Nat. Geosci. 2010, 3, 311–314. [Google Scholar] [CrossRef] [Scilit]
- Schulte, R.P.O.; Creamer, R.E.; Donnellan, T.; Farrelly, N.; Fealy, R.; O’Donoghue, C.; O’hUallachain, D. Functional land management: A framework for managing soil-based ecosystem services for the sustainable intensification of agriculture. Environ. Sci. Policy 2014, 38, 45–58. [Google Scholar] [CrossRef] [Scilit]
- Carter, M.R. Soil quality for sustainable land management: Organic matter and aggregation interactions that maintain soil functions. Agron. J. 2002, 94, 38–47. [Google Scholar] [CrossRef] [Scilit]
- Lu, Q.; Tian, S.; Wei, L. Digital Mapping of Soil pH and Carbonates at the European Scale Using Environmental Variables and Machine Learning. Sci. Total Environ. 2023, 856, 159171. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Xu, Z.; Lu, Q. Spectral preprocessing and machine learning models for prediction of subarctic climate woodland soil organic carbon and total nitrogen using Vis-NIR spectroscopy. J. Soils Sediments 2026, 26, 319. [Google Scholar] [CrossRef] [Scilit]
- van Leeuwen, C.C.E.; Mulder, V.L.; Batjes, N.H.; Heuvelink, G.B.M. Statistical modelling of measurement error in wet chemistry soil data. Eur. J. Soil Sci. 2022, 73, e13137. [Google Scholar] [CrossRef] [Scilit]
- Zhou, Y.; Biswas, A.; Hong, Y.; Chen, S.; Hu, B.; Shi, Z.; Guo, Y.; Li, S. Enhancing Soil Profile Analysis with Soil Spectral Libraries and Laboratory Hyperspectral Imaging. Geoderma 2024, 450, 117036. [Google Scholar] [CrossRef] [Scilit]
- Lu, Q.; Zhang, L. Prediction of European Cropland Soil Carbon and Nitrogen Using Vis-NIR Spectroscopy with PLSR: Effects of Spectral Resolution and Environmental Variables. Comput. Electron. Agric. 2026, 246, 111629. [Google Scholar] [CrossRef] [Scilit]
- Ben-Dor, E.; Banin, A. Near-Infrared Analysis as a Rapid Method to Simultaneously Evaluate Several Soil Properties. Soil Sci. Soc. Am. J. 1995, 59, 364–372. [Google Scholar] [CrossRef] [Scilit]
- He, Y.; Song, H.; García, A.; Hernández, A. Prediction of Soil Macronutrients Content Using near Infrared Spectroscopy. In ICO20: Remote Sensing and Infrared Devices and Systems; Jiang, J., Nosach, O.Y., Wang, J., Eds.; SPIE: Bellingham, WA, USA, 2006; Volume 6031, p. 603117. [Google Scholar] [CrossRef] [Scilit]
- Bellon-Maurel, V.; Fernandez-Ahumada, E.; Palagos, B.; Roger, J.-M.; McBratney, A. Critical Review of Chemometric Indicators Commonly Used for Assessing the Quality of the Prediction of Soil Attributes by NIR Spectroscopy. TrAC Trends Anal. Chem. 2010, 29, 1073–1081. [Google Scholar] [CrossRef] [Scilit]
- Mohamed, E.S.; Saleh, A.M.; Belal, A.B.; Gad, A. Application of Near-Infrared Reflectance for Quantitative Assessment of Soil Properties. Egypt. J. Remote Sens. Space Sci. 2018, 21, 1–14. [Google Scholar] [CrossRef] [Scilit]
- Liu, S.; Chen, J.; Guo, L.; Wang, J.; Zhou, Z.; Luo, J.; Yang, R. Prediction of Soil Organic Carbon in Soil Profiles Based on Visible–near-Infrared Hyperspectral Imaging Spectroscopy. Soil Tillage Res. 2023, 232, 105736. [Google Scholar] [CrossRef] [Scilit]
- Liu, K.; Qiu, H.; Li, X.; Fan, P.; Qi, S. Prediction of Potentially Toxic Trace Elements (PTEs) in Soil and Sediments Using Vis-NIR Spectroscopy: A Review. Appl. Spectrosc. Rev. 2025, 61, 117–145. [Google Scholar] [CrossRef] [Scilit]
- Shin, S.K.; Lee, S.J.; Park, J.H. Prediction of Soil Properties Using Vis-NIR Spectroscopy Combined with Machine Learning: A Review. Sensors 2025, 25, 5045. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Wadoux, A.M.J.-C. Interpretable Spectroscopic Modelling of Soil with Machine Learning. Eur. J. Soil Sci. 2023, 74, e13370. [Google Scholar] [CrossRef] [Scilit]
- Stevens, A.; Nocita, M.; Tóth, G.; Montanarella, L.; van Wesemael, B. Prediction of Soil Organic Carbon at the European Scale by Visible and Near InfraRed Reflectance Spectroscopy. PLoS ONE 2013, 8, e66409. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Ramírez-López, L.; Behrens, T.; Schmidt, K.; Stevens, A.; Demattê, J.A.M.; Scholten, T. The Spectrum-Based Learner: A New Local Approach for Modeling Soil Vis–NIR Spectra of Complex Datasets. Geoderma 2013, 195–196, 268–279. [Google Scholar] [CrossRef] [Scilit]
- Dong, N.; Wang, D.; Cai, H.; Sun, Q.; Shi, P. Assessing the Capability of Visible Near-Infrared Reflectance Spectroscopy to Monitor Soil Organic Carbon Changes with Localized Predictive Modeling. Remote Sens. 2025, 17, 3373. [Google Scholar] [CrossRef] [Scilit]
- Viscarra Rossel, R.A.; Shen, Z.; Ramírez-López, L.; Behrens, T.; Shi, Z.; Wetterlind, J.; Sudduth, K.A.; Stenberg, B.; Guerrero, C.; Gholizadeh, A.; et al. An Imperative for Soil Spectroscopic Modelling Is to Think Global but Fit Local with Transfer Learning. Earth-Sci. Rev. 2024, 254, 104797. [Google Scholar] [CrossRef] [Scilit]
- Cao, L.; Sun, M.; Yang, Z.; Jiang, D.; Yin, D.; Duan, Y. A Novel Transformer-CNN Approach for Predicting Soil Properties from LUCAS Vis-NIR Spectral Data. Agronomy 2024, 14, 1998. [Google Scholar] [CrossRef] [Scilit]
- Ke, Z.; Ren, S.; Yin, L. Advancing Soil Property Prediction with Encoder-Decoder Structures Integrating Traditional Deep Learning Methods in Vis-NIR Spectroscopy. Geoderma 2024, 449, 117006. [Google Scholar] [CrossRef] [Scilit]
- Sun, Q.; Shi, P. Enhancing Proximal and Remote Sensing of Soil Organic Carbon: A Local Modelling Approach Guided by Spectral and Spatial Similarities. Geoderma 2025, 457, 117298. [Google Scholar] [CrossRef] [Scilit]
- Zhu, A.; Lu, G.; Liu, J.; Qin, C.; Zhou, C. Spatial Prediction Based on Third Law of Geography. Ann. GIS 2018, 24, 225–240. [Google Scholar] [CrossRef] [Scilit]
- Li, L.; Zhang, Z.; Sun, M.; Ding, J.; Wang, J.; Xu, D.; Huang, Y. Selecting the Right Samples Rather than More Samples: A New Spectral–Environmental Similarity Strategy for Local Soil Spectral Modeling. Geoderma 2026, 467, 117710. [Google Scholar] [CrossRef] [Scilit]
- Fohrafellner, J.; Lippl, M.; Bajraktarevic, A.; Baumgarten, A.; Spiegel, H.; Körner, R.; Sandén, T. Austrian NIR Soil Spectral Library for Soil Health Assessments. Earth Syst. Sci. Data 2026, 18, 219–229. [Google Scholar] [CrossRef] [Scilit]
- Conforti, M.; Castrignanò, A.; Robustelli, G.; Scarciglia, F.; Stelluti, M.; Buttafuoco, G. Laboratory-Based Vis–NIR Spectroscopy and Partial Least Square Regression with Spatially Correlated Errors for Predicting Spatial Variation of Soil Organic Matter Content. CATENA 2015, 124, 60–67. [Google Scholar] [CrossRef] [Scilit]
- Geladi, P.; Kowalski, B.R. Partial Least-Squares Regression: A Tutorial. Anal. Chim. Acta 1986, 185, 1–17. [Google Scholar] [CrossRef] [Scilit]
- Zou, H.; Hastie, T. Regularization and Variable Selection Via the Elastic Net. J. R. Stat. Soc. Ser. B Stat. Methodol. 2005, 67, 301–320. [Google Scholar] [CrossRef] [Scilit]
- Smola, A.J.; Schölkopf, B. A Tutorial on Support Vector Regression. Stat. Comput. 2004, 14, 199–222. [Google Scholar] [CrossRef] [Scilit]
- Schölkopf, B.; Smola, A.J. Learning with Kernels: Support Vector Machines, Regularization, Optimization, and Beyond; MIT Press: Cambridge, MA, USA, 2002. [Google Scholar] [CrossRef] [Scilit]
- Breiman, L. Random Forests. Mach. Learn. 2001, 45, 5–32. [Google Scholar] [CrossRef] [Scilit]
- Tian, Y.; Cao, S.; Sun, P.; Kang, Q.; Liu, S.; Zheng, X.; Wei, L.; Lu, Q. Digital Mapping of Soil pH Using Tree-Based Models Coupled with Residual Kriging. Land 2026, 15, 365. [Google Scholar] [CrossRef] [Scilit]
- Friedman, J.H. Greedy Function Approximation: A Gradient Boosting Machine. Ann. Stat. 2001, 29, 1189–1232. [Google Scholar] [CrossRef] [Scilit]
- Ke, G.; Meng, Q.; Finley, T.; Wang, T.; Chen, W.; Ma, W.; Ye, Q.; Liu, T.-Y. LightGBM: A Highly Efficient Gradient Boosting Decision Tree. In Proceedings of the Advances in Neural Information Processing Systems; Curran Associates, Inc.: Red Hook, NY, USA, 2017; Volume 30. [Google Scholar]
- Shokr, M.S.; Mustafa, A.A.; Alharbi, T.; Meroño de Larriva, J.E.; El-Sorogy, A.S.; Al-Kahtany, K.; Abdelsamie, E.A. Integration of VIS–NIR Spectroscopy and Multivariate Technique for Soils Discrimination Under Different Land Management. Land 2024, 13, 2056. [Google Scholar] [CrossRef] [Scilit]
- Wang, Z.; Miao, Z.; Yu, X.; He, F. Vis-NIR Spectroscopy Coupled with PLSR and Multivariate Regression Models to Predict Soil Salinity under Different Types of Land Use. Infrared Phys. Technol. 2023, 133, 104826. [Google Scholar] [CrossRef] [Scilit]
- Tamene, L.; Sileshi, G.W.; Ndengu, G.; Mponela, P.; Kihara, J.; Sila, A.; Tondoh, J. Soil Structural Degradation and Nutrient Limitations across Land Use Categories and Climatic Zones in Southern Africa. Land Degrad. Dev. 2019, 30, 1288–1299. [Google Scholar] [CrossRef] [Scilit]
- Wang, W.; Sardans, J.; Zeng, C.; Zhong, C.; Li, Y.; Peñuelas, J. Responses of Soil Nutrient Concentrations and Stoichiometry to Different Human Land Uses in a Subtropical Tidal Wetland. Geoderma 2014, 232–234, 459–470. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Zwetsloot, M.J.; van Leeuwen, J.; Hemerik, L.; Martens, H.; Simó Josa, I.; Van de Broek, M.; Debeljak, M.; Rutgers, M.; Sandén, T.; Wall, D.P.; et al. Soil multifunctionality: Synergies and trade-offs across European climatic zones and land uses. Eur. J. Soil Sci. 2020, 72, 1640–1654. [Google Scholar] [CrossRef] [Scilit]
- Li, Y.; Ma, J.; Xiao, C.; Li, Y. Effects of Climate Factors and Soil Properties on Soil Nutrients and Elemental Stoichiometry across the Huang–Huai–Hai River Basin, China. J. Soils Sediments 2020, 20, 1970–1982. [Google Scholar] [CrossRef] [Scilit]
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. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.







