Soil, a non-renewable resource, requires continuous monitoring to prevent degradation and support sustainable agriculture. Visible-near-infrared (Vis-NIR) spectroscopy is a rapid and cost-effective method for predicting soil properties. While traditional machine learning methods are commonly used for modeling Vis-NIR spectral data, large datasets may benefit more from advanced deep learning techniques. In this study, based on the large soil spectral library LUCAS, we aimed to enhance regression model performance in soil property estimation by combining Transformer and convolutional neural network (CNN) techniques to predict 11 soil properties (clay, silt, pH in CaCl2, pH in H2O, CEC, OC, CaCO3, N, P, and K). The Transformer-CNN model accurately predicted most soil properties, outperforming other methods (partial least squares regression (PLSR), random forest regression (RFR), support vector machine regression (SVR), Long Short-Term Memory (LSTM), ResNet18) with a 10–24 percentage point improvement in the coefficient of determination (R2). The Transformer-CNN model excelled in predicting pH in CaCl2, pH in H2O, OC, CaCO3, and N (R2 = 0.94–0.96, RPD > 3) and performed well for clay, sand, CEC, P, and K (R2 = 0.77–0.85, 2 < RPD < 3). This study demonstrates the potential of Transformer-CNN in enhancing soil property prediction, although future work should aim to optimize computational efficiency and explore a wider range of applications to ensure its utility in different agricultural settings.
Read full abstract