A lightweight two-dimensional convolutional neural network for soil nutrient prediction by visible–near-infrared spectroscopy
Abstract
Rapid and accurate estimation of soil nutrient content is essential for assessing soil fertility, facilitating sustainable nutrient management, and optimizing crop productivity. However, the high dimensionality of spectral data and the limitations of one-dimensional prediction models hinder prediction accuracy and efficiency. We propose a lightweight two-dimensional convolutional neural network, 2D-CTM-CNN, which integrates data compression and reconstruction to solve these problems. The framework transforms one-dimensional visible–near-infrared (VNIR) spectra into a two-dimensional representation and employs a Shapley-weighted 2D-CNN to predict nitrogen (N) and soil organic carbon (SOC). Comparative experiments against partial least squares regression (PLSR), a 1D-CNN, and two state-of-the-art 2D-CNN approaches (2D-GASF-CNN and 2D-MTF-CNN) demonstrate that 2D-CTM-CNN achieves superior performance, with relative prediction deviation (RPD) values exceeding 4 for both N and SOC. Relative to the 1D-CNN, R2 improved by 5.68% for N and 5.56% for SOC, while spectral dimensionality was reduced from 4200 to 54, substantially enhancing computational efficiency. These findings highlight the effectiveness of 2D-CTM-CNN for high-precision soil nutrient prediction, offering a scalable and efficient solution for advancing precision agriculture.

Please wait while we load your content...