Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2024 Aug 22;24(16):5438.
doi: 10.3390/s24165438.

Comparative Analysis of Machine Learning and Deep Learning Algorithms for Assessing Agricultural Product Quality Using NIRS

Affiliations

Comparative Analysis of Machine Learning and Deep Learning Algorithms for Assessing Agricultural Product Quality Using NIRS

Jiwen Ren et al. Sensors (Basel). .

Abstract

The success of near-infrared spectroscopy (NIRS) analysis hinges on the precision and robustness of the calibration model. Shallow learning (SL) algorithms like partial least squares discriminant analysis (PLS-DA) often fall short in capturing the interrelationships between adjacent spectral variables, and the analysis results are easily affected by spectral noise, which dramatically limits the breadth and depth of applications of NIRS. Deep learning (DL) methods, with their capacity to discern intricate features from limited samples, have been progressively integrated into NIRS. In this paper, two discriminant analysis problems, including wheat kernels and Yali pears as examples, and several representative calibration models were used to research the robustness and effectiveness of the model. Additionally, this article proposed a near-infrared calibration model, which was based on the Gramian angular difference field method and coordinate attention convolutional neural networks (G-CACNNs). The research results show that, compared with SL, spectral preprocessing has a smaller impact on the analysis accuracy of consensus learning (CL) and DL, and the latter has the highest analysis accuracy in the modeling results using the original spectrum. The accuracy of G-CACNNs in two discrimination tasks was 98.48% and 99.39%. Finally, this research compared the performance of various models under noise to evaluate the robustness and noise resistance of the proposed method.

Keywords: Gramian angular difference field; convolutional neural networks; coordinate attention; near-infrared spectroscopy; robust model.

PubMed Disclaimer

Conflict of interest statement

The authors declare no conflicts of interest.

Figures

Figure 1
Figure 1
Network structure and CA internal structure. The CNN is composed of a series of convolutional layers and max pooling layers. The fully connected layer is then utilized for the final classification. By incorporating a CA module at the front of the network, the CACNNA network is formed. The CA module embeds positional information by pooling, concatenation, and convolution operations on the initial feature map in two directions.
Figure 2
Figure 2
The spectral collection system for Yali pears.
Figure 3
Figure 3
Experimental flow chart. The experiment is mainly composed of four stages. Initially, the spectra for agricultural products is collected. Following that, a variety of processing techniques are utilized to treat the spectra. Subsequently, discriminative models that are representative are developed according to the modeling strategy. Finally, an in-depth analysis of the modeling process is performed.
Figure 4
Figure 4
Average spectra. (a) The average spectra of wheat kernels. (b) The average spectra of Yali pears.
Figure 5
Figure 5
Schematic diagram of GAF converting process. The color change from blue to red corresponds to the increment of the value in the pixel.
Figure 6
Figure 6
Grad-CAM of DL model. The yellow area is paid attention to by the network, and the blue area network lacks attention. The red line is the dividing line of the attention heatmap. The attention concentration of the model is evaluated by dividing the heatmap into regions of interest and regions of non-interest.
Figure 7
Figure 7
Schematic diagram of additive noise of spectra. (a) Wheat kernel dataset. (b) Yali pear dataset.
Figure 8
Figure 8
Grad-CAM results with noise spectrum. The yellow area is paid attention to by the network, and the blue area network lacks attention. (a) G-CNN. (b) G-CACNN.
Figure 9
Figure 9
Results of different methods under different levels of noise. (a) Robustness test of the models based on the wheat kernel dataset. (b) Robustness test of the models based on the pear dataset.

References

    1. Mishra P., Woltering E. Semi-supervised robust models for predicting dry matter in mango fruit with near-infrared spectroscopy. Postharvest Biol. Technol. 2023;200:112335. doi: 10.1016/j.postharvbio.2023.112335. - DOI
    1. Esquerre C.A., Achata E.M., Garcia-Vaquero M., Zhang Z., Tiwari B.K., O’Donnell C.P. Use of an NIR MEMS spectrophotometer and visible/NIR hyperspectral imaging systems to predict quality parameters of treated ground peppercorns. LWT-Food Sci. Technol. 2020;131:109761. doi: 10.1016/j.lwt.2020.109761. - DOI
    1. Chadalavada K., Anbazhagan K., Ndour A., Choudhary S., Palmer W., Flynn J.R., Mallayee S., Pothu S., Prasad K.V.S.V., Varijakshapanikar P., et al. NIR Instruments and Prediction Methods for Rapid Access to Grain Protein Content in Multiple Cereals. Sensors. 2022;22:3710. doi: 10.3390/s22103710. - DOI - PMC - PubMed
    1. Cozzolino D. The Ability of Near Infrared (NIR) Spectroscopy to Predict Functional Properties in Foods: Challenges and Opportunities. Molecules. 2021;26:6981. doi: 10.3390/molecules26226981. - DOI - PMC - PubMed
    1. Rahmawati L., Widodo S., Kurniadi D.P., Daud P., Triyono A., Sriharti, Susanti N.D., Mayasti N.K.I., Indriati A., Yulianti L.E., et al. Determination of colorant type in yellow tofu using Vis-NIR and SW-NIR spectroscopy. Food Sci. Technol. 2023;43:e112422. doi: 10.1590/fst.112422. - DOI

LinkOut - more resources