Traditional one-dimensional near-infrared spectroscopy only reflects the variation of spectral intensity with wavelengths, and analytical models are difficult to mine the coupling correlation features among different wavelengths. Meanwhile, traditional linear machine learning and one-dimensional deep learning models suffer from insufficient nonlinear fitting ability, weak capability in extracting global wavelength-dependent information, and poor anti-interference performance and small-sample generalization ability, which greatly limits the high-precision non-destructive quantitative detection of pharmaceutical and agricultural products in near-infrared spectral analysis. To solve the above problems, this paper adopts six two-dimensional encoding strategies to convert one-dimensional spectra into two-dimensional feature matrices to characterize the implicit correlation information between wavelengths. Customized optimization of deep learning models is carried out according to the differentiated spectral characteristics of two application scenarios, and the Difference Index (DI) achieves superior performance in both cases: (1) In the application of tablet active ingredient detection with high signal-to-noise ratio and high-dimensional features, the DI-S-ViT model is constructed by combining two-dimensional spectral characterization built via DI with the spectral Vision Transformer architecture. It captures global wavelength dependencies through multi-head self-attention, achieving R 2 = 0.9757 and RPD = 6.420 on the test set; (2) For the scenario of single wheat kernel protein detection characterized by strong scattering noise and limited sample size, the DI-S-ResNet18 model adopting optimal DI encoding and a modified residual network is used. The residual structure improves the robustness of the model with small samples, with R 2 = 0.9321 and RPD = 3.873 on the test set. In addition, a lightweight S-CNN is established as the baseline model to objectively validate the performance advantages of the two customized models. Experimental results show that two-dimensional spectral encoding effectively compensates for the inability of one-dimensional spectra to characterize band coupling information. Compared with the optimal one-dimensional baseline models on the two datasets, the RMSEP decreased by 16.56% in the tablet scenario and 24.74% in the wheat scenario. The prediction accuracy and generalization ability of the new method are significantly improved. This method can provide a high-precision modeling approach for non-destructive quantitative detection of pharmaceutical tablets and grain agricultural products.
No takes yet. Share an insight, caveat, or question.
Song et al. (2026) studied this question.
Synapse has enriched 5 closely related papers on similar clinical questions. Consider them for comparative context: