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
Review
. 2025 Jan 14;14(2):247.
doi: 10.3390/foods14020247.

Application of Convolutional Neural Networks and Recurrent Neural Networks in Food Safety

Affiliations
Review

Application of Convolutional Neural Networks and Recurrent Neural Networks in Food Safety

Haohan Ding et al. Foods. .

Abstract

This review explores the application of convolutional neural networks (CNNs) and recurrent neural networks (RNNs) in food safety detection and risk prediction. This paper highlights the advantages of CNNs in image processing and feature recognition, as well as the powerful capabilities of RNNs (especially their variant LSTM) in time series data modeling. This paper also makes a comparative analysis in many aspects: Firstly, the advantages and disadvantages of traditional food safety detection and risk prediction methods are compared with deep learning technologies such as CNNs and RNNs. Secondly, the similarities and differences between CNNs and fully connected neural networks in processing image data are analyzed. Furthermore, the advantages and disadvantages of RNNs and traditional statistical modeling methods in processing time series data are discussed. Finally, the application directions of CNNs in food safety detection and RNNs in food safety risk prediction are compared. This paper also discusses combining these deep learning models with technologies such as the Internet of Things (IoT), blockchain, and federated learning to improve the accuracy and efficiency of food safety detection and risk warning. Finally, this paper mentions the limitations of RNNs and CNNs in the field of food safety, as well as the challenges in the interpretability of the model, and suggests the use of interpretable artificial intelligence (XAI) technology to improve the transparency of the model.

Keywords: convolutional neural networks; deep learning; food safety; long short-term memory; recurrent neural networks.

PubMed Disclaimer

Conflict of interest statement

There are no conflicts of interest to declare.

Figures

Figure 1
Figure 1
Application of CNNs and RNNs in food safety.
Figure 2
Figure 2
Basic architecture of CNNs. “•••” denotes omitted convolutional layers, arrows indicate data flow and processing steps.
Figure 3
Figure 3
Basic architecture of an RNN. Arrows indicate data flow and processing steps, subscripts denote different nodes, different colors of “•••” indicate that intermediate nodes are omitted at different time steps or in different layers.
Figure 4
Figure 4
Internal structure of an LSTM.
Figure 5
Figure 5
Workflow of food safety testing using CNN. “•••” indicate more application scenarios for food safety testing.
Figure 6
Figure 6
Future outlook, limitations, and challenges.

Similar articles

Cited by

References

    1. Gallo M., Ferrara L., Calogero A., Montesano D., Naviglio D. Relationships between food and diseases: What to know to ensure food safety. Food Res. Int. 2020;137:109414. doi: 10.1016/j.foodres.2020.109414. - DOI - PubMed
    1. Pires S.M., Desta B.N., Mughini-Gras L., Mmbaga B.T., Fayemi O.E., Salvador E.M., Gobena T., Majowicz S.E., Hald T., Hoejskov P.S. Burden of foodborne diseases: Think global, act local. Curr. Opin. Food Sci. 2021;39:152–159. doi: 10.1016/j.cofs.2021.01.006. - DOI - PMC - PubMed
    1. Weston M., Geng S., Chandrawati R. Food sensors: Challenges and opportunities. Adv. Mater. Technol. 2021;6:2001242. doi: 10.1002/admt.202001242. - DOI
    1. Choi J.R., Yong K.W., Choi J.Y., Cowie A.C. Emerging point-of-care technologies for food safety analysis. Sensors. 2019;19:817. doi: 10.3390/s19040817. - DOI - PMC - PubMed
    1. Domínguez I., Frenich A.G., Romero-González R. Mass spectrometry approaches to ensure food safety. Anal. Methods. 2020;12:1148–1162. doi: 10.1039/C9AY02681A. - DOI

LinkOut - more resources