# Spectral Data-Driven Prediction of Soil Properties Using LSTM-CNN-Attention Model
## 3 Results
### Comparison of Performance with Other Models  
To further validate the advantages of the LSTM-CNN-Attention model for soil property forecasting, we selected traditional machine learning models (PLSR [13], SVR [20], RF [21]) and advanced deep learning models (PCA-LSTM [26], CNN-LSTM [30], CNN-GRU [18]) for comparative analysis. To ensure fairness, all models were trained using the same input data and preprocessing pipeline. The performance metrics for all prediction models on the testing dataset are presented in Table 6. It is evident from the table that the proposed LSTM-CNN-Attention model surpasses both traditional machine learning and deep learning models across all key soil properties. Among the machine learning models, RF outperforms PLSR and SVR, with average R\({}^{2}\) values exceeding those of PLSR and SVR by 4.69 and 2.35 percentage points, respectively. However, these traditional models struggle to capture the complex nonlinear relationships inherent in soil data. In contrast, deep learning models such as CNN-LSTM and CNN-GRU demonstrate superior performance by effectively learning temporal dependencies and capturing spatial patterns. The average R\({}^{2}\) values of CNN-LSTM and CNN-GRU exceed those of the best-performing RF model by 1.84 and 4.11 percentage points, respectively. Nevertheless, both still underperform relative to the proposed model. Notably, the PCA-LSTM model exhibits suboptimal performance, likely  
Figure 9: Actual vs. predicted values of the proposed framework: (**a**) OC, (**b**) N, (**c**) CaCO\({}_{3}\), and (**d**) pH(H\({}_{2}\)O). due to information loss introduced by PCA, which limits its ability to capture essential features. Additionally, the absence of CNN further restricts the model's ability to extract local patterns, resulting in reduced prediction accuracy. The residual plots in Figure 10 further demonstrate the effectiveness of the proposed model, showing smaller and more concentrated residuals across all soil properties compared with the other models. The residuals of the proposed model are tightly distributed around 0, emphasizing its robustness and reliability in forecasting soil properties. Additionally, Figure 11 presents the line plots for R\({}^{2}\) and RPD values across all models. In panel (a), the proposed model consistently achieves the highest R\({}^{2}\) scores, underscoring its ability to capture complex relationships within soil data. In panel (b), the model maintains superior RPD values across all properties, with a peak value for CaCO\({}_{3}\), demonstrating its effectiveness in managing variability and delivering accurate predictions. \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Properties** & **Metrics** & **Proposed** & **PCA-LSTM** &
\begin{tabular}{c} **CNN-LSTM** \\ \end{tabular} & **CNN-GRU** & **PLSR** & **SVR** & **RF** \\ \hline OC & R\({}^{2}\) & 0.949 & 0.890 & 0.923 & 0.936 & 0.879 & 0.897 & 0.918 \\  & RMSE & 16.687 & 24.619 & 20.535 & 18.779 & 25.816 & 23.795 & 21.281 \\  & MAE & 8.599 & 13.605 & 10.820 & 9.597 & 13.941 & 14.209 & 10.752 \\  & RPD & 3.940 & 2.670 & 3.202 & 3.501 & 2.876 & 3.120 & 3.489 \\ \hline N & R\({}^{2}\) & 0.916 & 0.813 & 0.878 & 0.904 & 0.828 & 0.849 & 0.849 \\  & RMSE & 0.993 & 1.483 & 1.199 & 1.062 & 1.502 & 1.332 & 1.331 \\  & MAE & 0.580 & 0.915 & 0.716 & 0.642 & 0.946 & 0.880 & 0.777 \\  & RPD & 3.737 & 2.503 & 3.095 & 3.496 & 2.282 & 2.572 & 2.574 \\ \hline CaCO\({}_{3}\) & R\({}^{2}\) & 0.943 & 0.895 & 0.919 & 0.935 & 0.841 & 0.876 & 0.919 \\  & RMSE & 33.370 & 45.146 & 39.973 & 35.845 & 48.603 & 46.497 & 39.850 \\  & MAE & 12.909 & 20.076 & 16.627 & 14.468 & 24.409 & 21.430 & 18.092 \\  & RPD & 5.377 & 3.105 & 4.489 & 5.006 & 2.884 & 3.015 & 3.518 \\ \hline pH(H\({}_{2}\)O) & R\({}^{2}\) & 0.926 & 0.728 & 0.869 & 0.894 & 0.818 & 0.821 & 0.838 \\  & RMSE & 0.364 & 0.698 & 0.484 & 0.436 & 0.571 & 0.564 & 0.558 \\  & MAE & 0.265 & 0.510 & 0.371 & 0.315 & 0.384 & 0.382 & 0.379 \\  & RPD & 3.352 & 1.747 & 2.519 & 2.798 & 2.342 & 2.371 & 2.397 \\ \hline \hline \end{tabular}
\end{table}