Explainable residual CNN with Gramian Angular Field encoding for rapid quantification of soil properties using near-infrared spectroscopy
- 1Zhengzhou Tobacco Research Institute of CNTC
- 2College of Chemistry and Chemical Engineering, Hunan University
Abstract
Background: Soil chemical composition is a key indicator of soil fertility, yet conventional physicochemical analysis is time-consuming and costly. Although near-infrared (NIR) spectroscopy enables rapid, non-destructive detection, traditional linear models struggle with the non-linear nature of high-dimensional spectral data, and deep-learning models often suffer from a "black-box" problem.
Methods: A one-dimensional residual convolutional neural network (1D-Res-CNN) was constructed, and the output feature maps of intermediate convolutional layers were visualized to reveal how the model learns spectral features. One-dimensional spectral sequences were mapped into twodimensional images via Gramian Angular Summation Field (GASF) and Continuous Wavelet Transform (CWT); after systematically comparing encoding performance across spectral sub-intervals, the optimal range was selected to feed a two-dimensional residual CNN (2D-Res-CNN) regression model. Using SNV-preprocessed Fourier-transform NIR spectra and an SPXY-partitioned dataset, the proposed framework was benchmarked against partial least squares regression (PLSR), k-nearest neighbors (KNN), and random forest (RF).
Results: First-layer kernels in the 1D-Res-CNN automatically captured spectral features corresponding to functional-group absorption peaks, supporting the physical interpretability of feature extraction. GASF-encoded images in the 5880~4000 cm ⁻¹ range exhibited the highest feature density and outperformed CWT encoding. The 2D-Res-CNN achieved prediction-set R p 2 of 0.87, 0.91, 0.91, 0.93, and 0.88 for soil pH, labile organic carbon, total nitrogen, organic matter, and available phosphorus, respectively, with lower RMSEP than both the 1D-CNN and PLSR.
Conclusion: By enhancing spectral feature expression through visual encoding and providing preliminary insight into model behavior via layer-wise feature-map visualization, this work offers an interpretable technical strategy for rapid quantitative analysis of soil chemical composition by NIR spectroscopy.
Related
- NephroTox AI: an explainable machine learning framework with uncertainty quantification for drug-induced nephrotoxicity prediction
- Engineering optoelectronic and excitonic properties in carbon quantum dots via defect encoding: a first-principles study
- Counterfeit Citri Reticulatae Pericarpium Identification: Multi‐Class Detection Using Vis/ NIR Spectroscopy and Residual Neural Networks
- Development and validation of an RP-HPLC method for the quantification of residual 7-chloroquinaldine impurity in alkene aldehyde intermediate of montelukast sodium
- In-situ quantification of NH₂ radicals in low-pressure NH3/O2/N2 flames implementing cavity ring-down spectroscopy: Challenges & mitigation
BibTeX
@article{li2026explainable,
title = {{Explainable residual CNN with Gramian Angular Field encoding for rapid quantification of soil properties using near-infrared spectroscopy}},
author = {Xiong Li and Junwei Guo and Ran Wan and Le Zhao and Zengping Chen},
journal = {Frontiers in Plant Science},
year = {2026},
month = oct,
doi = {10.3389/fpls.2026.1953112},
url = {https://www.frontiersin.org/articles/10.3389/fpls.2026.1953112/full},
note = {CC BY 4.0},
}
RIS
TY - JOUR
TI - Explainable residual CNN with Gramian Angular Field encoding for rapid quantification of soil properties using near-infrared spectroscopy
AU - Xiong Li
AU - Junwei Guo
AU - Ran Wan
AU - Le Zhao
AU - Zengping Chen
PY - 2026
DA - 2026/10/14
JO - Frontiers in Plant Science
DO - 10.3389/fpls.2026.1953112
UR - https://www.frontiersin.org/articles/10.3389/fpls.2026.1953112/full
AB - Background: Soil chemical composition is a key indicator of soil fertility, yet conventional physicochemical analysis is time-consuming and costly. Although near-infrared (NIR) spectroscopy enables rapid, non-destructive detection, traditional linear models struggle with the non-linear nature of high-dimensional spectral data, and deep-learning models often suffer from a "black-box" problem. Methods: A one-dimensional residual convolutional neural network (1D-Res-CNN) was constructed, and the output feature maps of intermediate convolutional layers were visualized to reveal how the model learns spectral features. One-dimensional spectral sequences were mapped into twodimensional images via Gramian Angular Summation Field (GASF) and Continuous Wavelet Transform (CWT); after systematically comparing encoding performance across spectral sub-intervals, the optimal range was selected to feed a two-dimensional residual CNN (2D-Res-CNN) regression model. Using SNV-preprocessed Fourier-transform NIR spectra and an SPXY-partitioned dataset, the proposed framework was benchmarked against partial least squares regression (PLSR), k-nearest neighbors (KNN), and random forest (RF). Results: First-layer kernels in the 1D-Res-CNN automatically captured spectral features corresponding to functional-group absorption peaks, supporting the physical interpretability of feature extraction. GASF-encoded images in the 5880~4000 cm ⁻¹ range exhibited the highest feature density and outperformed CWT encoding. The 2D-Res-CNN achieved prediction-set R p 2 of 0.87, 0.91, 0.91, 0.93, and 0.88 for soil pH, labile organic carbon, total nitrogen, organic matter, and available phosphorus, respectively, with lower RMSEP than both the 1D-CNN and PLSR. Conclusion: By enhancing spectral feature expression through visual encoding and providing preliminary insight into model behavior via layer-wise feature-map visualization, this work offers an interpretable technical strategy for rapid quantitative analysis of soil chemical composition by NIR spectroscopy.
SN - 1664-462X
ER -