Digital Mapping of Soil pH Based on Machine Learning Combined with Feature Selection Methods in East China

Zhidong Zhao, Mingsong Zhao, Hongliang Lü, Shihang Wang, Yuanyuan LüSustainability 2023 · DOI

TL;DR

This study demonstrates that employing feature selection techniques like RFE, SAFS, and SBF significantly improves the accuracy and generalization ability of machine learning models (Random Forest and Support Vector Regression) for digital soil pH mapping in East China. Specifically, the RFE method combined with Random Forest yielded the most robust predictions, highlighting the importance of intelligent feature engineering for accurate soil property prediction.

What Problem Does This Paper Address?

Accurately mapping soil properties, such as pH, is crucial for understanding soil quality, fertility, and environmental management. Traditional methods for soil mapping are often time-consuming, labor-intensive, and costly. Digital Soil Mapping (DSM) techniques offer a more efficient alternative by using statistical and machine learning models to predict soil properties based on various environmental covariates. However, the performance of these models can be hampered by a large number of potentially redundant or irrelevant features, leading to overfitting and reduced predictive power. This paper addresses the challenge of optimizing DSM models by investigating the impact of different feature selection methods on the accuracy and generalization of Random Forest (RF) and Support Vector Regression (SVR) models for soil pH prediction.

Methods

The study employed two prominent machine learning algorithms: Random Forest (RF) and Support Vector Regression (SVR). To enhance their performance, three feature selection methods were integrated:

  • Recursive Feature Elimination (RFE): This wrapper method iteratively removes features based on their importance in a trained model.
  • Simulated Annealing Feature Selection (SAFS): An optimization algorithm that explores the feature space to find an optimal subset.
  • Selection by Filtering (SBF): A filter method that selects features based on their statistical properties, independent of the learning algorithm.

These feature selection methods were applied to a comprehensive set of environmental covariates, including topographic, climatic, and vegetation indices. The performance of models built with selected features was compared against models trained using all available features (ALL-RF and ALL-SVR). Model accuracy was evaluated using Root Mean Squared Error (RMSE), Mean Absolute Error (MAE), and the Coefficient of Determination (R²), with a focus on both training and testing datasets to assess generalization. Parameter tuning for both RF (ntree, mtry) and SVR (C, gamma) was also performed using grid search and cross-validation.

Datasets

The study utilized a dataset comprising 140 soil samples collected from Anhui Province, East China. These samples provided the ground truth for soil pH.

Auxiliary data used as environmental covariates included:

  • Topographic Data: Derived from a 90m resolution Digital Elevation Model (DEM) from SRTM, including aspect, slope, elevation, and various curvature indices (plan, profile, convergence index, topographical wetness index, valley bottom flatness, ridge top flatness).
  • Vegetation Indices: Normalized Difference Vegetation Index (NDVI) and Enhanced Vegetation Index (EVI) derived from MODIS (250m resolution).
  • Climatic Data: Mean Annual Temperature (MAT) and Mean Annual Precipitation (MAP) at 1km resolution.

All environmental features and soil property predictions were resampled to a uniform 250m resolution. The dataset was split into training (108 samples) and testing (32 samples) sets for model evaluation.

Key Insights and Ideas

  • Feature Selection is Crucial for DSM: The study strongly supports the idea that judicious feature selection is not just beneficial but necessary for improving the accuracy and generalization of machine learning models in digital soil mapping. Simply throwing all available data at a model can lead to suboptimal results.
  • RFE Shines for Soil pH: Among the tested feature selection methods, Recursive Feature Elimination (RFE) consistently produced the best results, particularly when combined with the Random Forest algorithm. This suggests that identifying and retaining the most impactful features is key for this specific prediction task.
  • RF Outperforms SVR in Generalization: While both RF and SVR benefited from feature selection, the RF model, especially with RFE, demonstrated superior generalization ability. The gap between training and testing set accuracy was smaller for RFE-RF, indicating greater robustness.
  • Parameter Sensitivity Differs: The study found that RF model accuracy was relatively insensitive to individual parameter changes (ntree, mtry), whereas SVR's performance was significantly influenced by its kernel parameters (C and gamma). This highlights different model behaviors and the need for tailored optimization strategies.
  • Spatial Patterns Align with Known Characteristics: The predicted soil pH maps from both RF and SVR models consistently showed a "south acid and north alkaline" pattern, aligning with established knowledge of soil acidity in the Anhui Province. This validates the models' ability to capture known environmental relationships.

Key Results

  • Improved Accuracy with Feature Selection: Compared to models using all features (ALL-RF, R2=0.45), feature selection methods significantly boosted the testing set R² for RF models: RFE-RF (0.61), SAFS-RF (0.71), and SBF-RF (0.69). For SVR, improvements were also observed: RFE-SVR (0.52), SAFS-SVR (0.50), and SBF-SVR (0.51) compared to ALL-SVR (0.44).
  • RFE-RF as the Top Performer: The RFE-RF model achieved the highest R² (0.61) in the testing set among the RF models that incorporated feature selection. It also showed a smaller difference between training and testing R² values, indicating better generalization.
  • Optimal Parameters: The study identified optimal parameters: for RF, mtry=1 and ntree=1000; for SVR, C=0.5 and gamma=0.125.
  • Spatial Prediction Consistency: Despite variations in accuracy, the spatial distribution patterns of soil pH predicted by all models were broadly similar, reflecting the regional environmental gradients.

Limitations and Future Work

  • Sample Size: The study used a relatively small sample size (n=140) for model building and validation. The authors acknowledge that this limits the reliability and stability of the models.
  • Generalization to Other Regions: The findings are specific to Anhui Province. Further research is needed to assess the transferability of these feature selection strategies and models to other geographical regions with different soil-forming factors.
  • Feature Selection Method Comparison: While RFE, SAFS, and SBF were evaluated, exploring other advanced feature selection techniques could potentially yield further improvements.
  • Model Complexity vs. Interpretability: While RF and SVR are powerful, their "black box" nature can limit direct interpretation of feature importance. Future work could explore more interpretable models or methods to enhance the understanding of the relationships between environmental factors and soil pH.
  • Parameter Optimization: The study focused on single and multi-parameter optimization. Further exploration of more sophisticated hyperparameter tuning techniques could refine model performance.

Summary updated

Abstract

This study aimed to evaluate and compare the performances of the random forest (RF) and support vector regression (SVR) models combined with different feature selection methods, including recursive feature elimination (RFE), simulated annealing feature selection (SAFS), and selection by filtering (SBF) in predicting soil pH in Anhui Province, East China. We also used the ALL original features to build the RF and SVR models as a comparison. A total of 140 samples were selected, following the principles of randomness, uniformity, and representativeness, to consider the combination of landscape elements, such as topography, parent material, and land use. Auxiliary data, including climatic, topographic, and vegetation indexes, were used for predicting soil pH. The results showed that compared with the use the ALL original modeling features (ALL-RF, ALL-SVR), the combination of the three feature selection algorithms with RF and SVR can eliminate some redundant features and effectively improve the prediction accuracy of the soil pH model. For the RF model, the RMSE and the MAE of the calibration of the RFE-RF model were 0.73 and 0.57 and had the highest R2 in four different RF models. The testing set of the RFE-RF model had an R2 of 0.61, which was better than that of the ALL-RF (R2 = 0.45) model and lower than those of the SAFS-RF (R2 = 0.71) and SBF-RF (R2 = 0.69) models. For the SVR model, the RFE-RF model was more robust and had better generalization ability. The accuracy of digital soil mapping can be improved through feature selection.
BibTeX
@inproceedings{zhao2023digital,
  author = {Zhidong Zhao and Mingsong Zhao and Hongliang Lü and Shihang Wang and Yuanyuan Lü},
  title = {{Digital Mapping of Soil pH Based on Machine Learning Combined with Feature Selection Methods in East China}},
  booktitle = {Sustainability},
  year = {2023},
  doi = {10.3390/su151712874},
}
Figure