A taste of tomorrow: How is AI transforming food safety and quality

Dilpreet Singh Brar

Food Scientist

11 min read
A taste of tomorrow: How is AI transforming food safety and quality

co-author: Christina Marantelou

Food quality and safety in a changing global supply chain

The quality and safety of food (FQS) have consistently been significant issues due to their strong link to public health and the economy1. It is essential to ensure that the characteristics of food quality, such as texture, odour/aroma, appearance, taste, and nutritional value throughout the entire food supply chain, conform to the acceptability standards established by governmental regulatory bodies, manufacturers, and consumers2. Furthermore, the global food supply chain has become increasingly intricate, and its adaptability has evolved. From farm to fork, the implementation of food production systems is influenced by substantial changes in the environment, population, and economy. These alterations may increase food fraud and security threats, ultimately jeopardizing human health.

At present, a variety of analytical techniques, including chromatography, spectroscopy, DNA fingerprinting, and electrochemical methods, have been created to identify and monitor adulterants and contaminants (such as pesticides, antibiotics, and aflatoxins)3. Nevertheless, these analytical approaches frequently rely on targeted methods, which restrict their applicability due to their destructive nature4, operational complexity, cost inefficiency (high expenses), and time limitations. With the rapid progress in computer science, the integration of diverse analytical methods with artificial intelligence (AI) technology has facilitated non-targeted detection for the monitoring of FQS.

How artificial intelligence supports modern food safety and quality control

Artificial Intelligence (AI) technology represents a sector of computer science focused on the exploration of machine intelligence through the creation of computer programs capable of replicating, enhancing, and building upon human intelligence5.

This indicates that AI technology encompasses a learning mechanism derived from datasets, emulating human thought processes or behaviours to generate tailored responses to various scenarios, referred to as input-output "learning"6. However, the fundamental functions of AI applications predominantly involve making predictions, which frequently necessitate human involvement for assessment and decision-making. In the field of AI, Machine Learning (ML) has attracted considerable interest from scholars.

Historically, artificial intelligence (AI) emerged as a distinct academic field in the 1950s, when researchers sought to create robots capable of thinking, solving problems, and learning autonomously 7,8. The discipline remained relatively obscure until the 2000s7, characterised by cycles of enthusiasm followed by phases of disillusionment and funding reductions, commonly known as AI winter9. The advent of data-driven algorithms and machine learning (ML) transformed the landscape by introducing the innovative aspect of learning from past data to improve problem-solving capabilities. Interest and financial support surged after 2012, as deep learning techniques demonstrated remarkable learning and predictive performance, surpassing nearly all prior AI methods 10,11, and again after 2017 with the launch of the transformer architecture 11,12. In the early 2020s, there was a notable increase in AI advancements, primarily driven by major organisations in the United States, including large tech companies, academic institutions, and research labs, leading to significant developments in the field. AI and ML are interconnected yet distinct subjects within computer science13 (Figure 1). Table 1 offers a concise overview of the distinctions between AI and ML.

Artificial intelligence vs. machine learning.png

Figure 1. Artificial intelligence vs. machine learning13

Table 1. Differences between AI and ML

Aspect

AI

ML

Description

Artificial Intelligence (AI) refers to the simulation of human cognitive functions by machines, especially computer systems. This involves the development of systems or algorithms that can perform tasks typically requiring human intelligence, such as understanding natural language, recognizing patterns, learning from experience, and making judgments.

Machine Learning (ML) is a subset of Artificial Intelligence (AI) that focuses on developing algorithms and statistical models to enable computers to perform tasks without explicit instructions.

Aim/Purpose

To develop systems capable of performing tasks that typically require human intelligence.

To enable machines to improve their performance in a specific task by acquiring knowledge from data without requiring explicit programming.

Focus/Scope

Possesses a wider scope, covering a diverse array of

methods, including machine learning.

More focused on identifying patterns and

insights from data to improve the

effectiveness of a specific activity or

application.

Methods & approaches

Utilises a diverse range of methods and techniques, such as

computer vision, natural language processing, expert

systems, and others.

Primarily emphasises algorithms based on mathematical and statistical techniques for data analysis and outcome forecasting.

Data reliance

It may or may not be significantly influenced by the data that has been acquired.

Heavily reliant on data for the purposes of model training

and predictions.

Human intervention

Able to operate independently or with human participation.

Relying on human participation for

training, validation, and parameter adjustments.

Decision making

Can make choices according to established guidelines or

recognised patterns.

Employs data-driven patterns to inform decision-making.

Adaptability

Able to adapt to new situations by adhering to established protocols or integrating insights from new information.

Improves and sharpens its performance

through augmented data and repetitions.

Examples

Chatbots, expert systems, virtual assistants, self-driving vehicles, robotics, natural language processing, computer vision, game-playing artificial intelligence, etc.

Regression, classification, and clustering algorithms, along with neural networks, decision trees, SVM- support vector machines, and reinforcement learning algorithms, serve as examples of machine learning techniques.

AI today can be grouped into two broad categories:

  • Weak or Narrow AI: designed for specific tasks and widely used in healthcare, finance, manufacturing, and food systems
  • Strong or General AI: a theoretical form aiming to replicate human intelligence across many areas

AI is specifically designed to perform a particular task within defined parameters (i.e., it is specialised and has a limited range of application). It lacks the extensive cognitive abilities characteristic of human intelligence. The main advantage of Weak AI lies in its practical application across various fields, facilitating automation, optimisation, and enhancement in specific roles. These systems are frequently employed in various industries, including healthcare, finance, manufacturing, and customer service, to streamline processes, enhance decision-making, and improve user experiences.

However, Weak AI also has considerable limitations. These systems exhibit restricted understanding beyond their intended scope, which complicates their ability to handle unexpected inputs or scenarios. Issues regarding data privacy, bias, and ethical considerations arise when these systems manage sensitive data and influence decision-making processes. Conversely, Strong AI aims to replicate human intelligence across multiple domains and has the ability to understand, learn, and apply knowledge across a broad range of tasks, similar to human intelligence 14-17.

How machine learning supports food quality and safety monitoring

Machine learning (ML), a subset of artificial intelligence, allows software to make predictions with greater accuracy without the necessity for explicit programming. ML algorithms utilise historical data to forecast new output values. Over time, a variety of traditional ML algorithms have been created to manage and improve FQS3. Deep learning (DL) algorithms, such as convolutional neural networks (CNN), are particularly adept at feature extraction from sample data when compared to traditional ML algorithms. The core principles and techniques of ML encompass supervised learning, unsupervised learning, and reinforcement learning 18,19.

Supervised learning for food classification and prediction

In this approach, models are trained on labelled data, where each input data point corresponds to a specific target label. Consequently, the trained algorithm can be employed to predict or classify new, unseen data 18-20.

Unsupervised learning for hidden pattern detection

This method involves models discovering patterns in data without the necessity for labelled examples or explicit direction. Unsupervised learning proves especially advantageous in scenarios where labeled data is scarce, when acquiring such data is expensive, or when the underlying structure of the data is not fully understood.

Reinforcement learning for process optimisation in the food industry

This type of ML involves models learning through their interactions with an environment and receiving feedback in the form of rewards or penalties 22-24.

Deep learning and its role in modern food authentication

Deep learning (DL), a branch of ML, uses algorithms modelled based on biological neurons. Powerful processors, enormous datasets and adaptable software libraries have helped make DL one of the most widely used ML approaches today. The definition of DL is models with numerous processing layers that develop a representation of the data with various degrees of abstraction 25. Modern AI-powered systems provide cutting-edge solutions to a wide range of challenging issues in areas like health care, nutrition, agriculture, energy and transportation that impact people's lives. These systems require low human involvement, and their error margin is small.

Recently, DL algorithms have achieved the highest accuracy performance for challenging problems, including face recognition, object identification and image segmentation. Although these algorithms provide incredibly precise responses, it is sometimes challenging for people to understand how the machine arrived at that conclusion. Because of this, AI researchers have put a lot of effort into developing tools, processes and strategies that allow people to understand and trust the results of ML-based models. This research area is called explainable artificial intelligence (XAI). It is used to describe the reasons behind and mechanisms underlying the biases of an AI-based model26.

The rise of explainable AI in food safety decisions

The domain of Explainable Artificial Intelligence (XAI) encompasses various techniques and methodologies that enable users of machine learning (ML) models to trust and comprehend their outputs. It is widely recognized that enhancing our understanding of a system can assist in addressing any potential issues it may encounter. Consequently, XAI plays a vital role in the deployment of AI-driven models. While simpler AI systems based on production rules, such as those employing if-then-else constructs, are easily comprehensible, models based on deep neural networks (DNNs) are too intricate to be readily explained26. DNNs are often criticised for being black-box models due to their millions of parameters and multilayer nonlinear architectures27.

The interpretability of deep learning (DL) models is crucial, given the extensive range of applications in which they are utilised. Treating interpretability as a distinct design consideration offers three key benefits: ensuring the model's fairness, improving its robustness, and confirming that significant inputs lead to the derived conclusions26.

AI in food industry 4.0

Artificial Intelligence (AI) introduces a transformative change alongside the Industrial Revolution 4.0. Within Food Industry 4.0, this technology is applied at various stages; numerous techniques have been created to assess the quality of food products 28. These techniques include computer vision and sensors like E-nose and E-tongue, which operate on diverse Machine Learning (ML) and Deep Learning (DL) frameworks 29.

Artificial Intelligence technology in the quantitative analysis of FQS indicators.png

Fig 2. Artificial Intelligence technology in the quantitative analysis of FQS indicators 3

Figure 2 presents a summary of the prevalent algorithms, encompassing both traditional machine learning (ML) and deep learning (DL), that are presently employed in FQS. These algorithms are utilised for analysing various components including protein, fat, carbohydrates, moisture, foodborne pathogens, pesticides, veterinary drugs, fungal toxins, heavy metals, and additional factors. The extension of new AI technology algorithms beyond traditional approaches opens up new prospects for improving prediction performance and expanding the applications of FQS indicator monitoring.

References with Hyperlinked Article Titles

  1. K.V. Kotsanopoulos; I.S. Arvanitoyannis (2017) The role of auditing, food safety, and food quality standards in the food industry: a review, Compr. Rev. Food Sci., 16(5), 760–775.
  2. Y. Ye; H. Guo; X. Sun (2019) Recent progress on cell-based biosensors for analysis of food safety and quality control, Biosens. Bioelectron. 126, 389–404.
  3. Lunzhao Yi, L.; Wang, W.; Diao, Y.; Yi, S.; Shang, Y.; Ren, D.; Ge, K.; Gu, Y. (2024) Recent advances of artificial intelligence in quantitative analysis of food quality and safety indicators: A review, Trends in Analytical Chemistry, 180, 117944.
  4. G.M. ElMasry; S. Nakauchi (2016) Image analysis operations applied to hyperspectral images for non-invasive sensing of food quality – a comprehensive review. Biosyst. Eng. 142, 53–82.
  5. R. Hardian; Z. Liang; X. Zhang; G. Szekely (2020) Artificial intelligence: the silver bullet for sustainable materials development, Green Chem. 22, 7521–7528.
  6. Z.J. Baum; X. Yu; P.Y. Ayala; Y. Zhao; S.P. Watkins; Q. Zhou (2021) Artificial intelligence in chemistry: current trends and future directions, J. Chem. Inf. Model. 61, 3197–3212.
  7. Cannataro, M.; Guzzi, P.H.; Agapito, G.; Zucco, C.; Milano, M. Chapter 3—Artificial Intelligence. In Artificial Intelligence in Bioinformatics; Cannataro, M., Guzzi, P.H., Agapito, G., Zucco, C., Milano, M., Eds.; Elsevier: Amsterdam, The Netherlands, 2022; pp. 29–33, ISBN 978-0-12-822952-1.
  8. Helm, J.M.; Swiergosz, A.M.; Haeberle, H.S.; Karnuta, J.M.; Schaffer, J.L.; Krebs, V.E.; Spitzer, A.I.; Ramkumar, P.N. (2020) Machine Learning and Artificial Intelligence: Definitions, Applications, and Future Directions. Curr. Rev. Musculoskelet. Med. 13, 69–76.
  9. Galanos, V. (2023) Expectations and Expertise in Artificial Intelligence: Specialist Views and Historical Perspectives on Conceptualisation, Promise, and Funding. Ph.D. Thesis, University of Edinburgh, Edinburgh, UK.
  10. Le, Q.V. (2013) Building High-Level Features Using Large Scale Unsupervised Learning. In Proceedings of the 2013 IEEE International Conference on Acoustics, Speech and Signal Processing, Vancouver, BC, Canada, 26–31 May 2013; IEEE: Piscataway, NJ, USA; pp. 8595–8598.
  11. Delipetrev, B.; Tsinaraki, C.; Kostic, U. (2024) Historical Evolution of Artificial Intelligence. JRC Publications Repository. Available online: https://publications.jrc.ec.europa.eu/repository/handle/JRC120469 (accessed on 6 January 2024).
  12. Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A.N.; Kaiser, Ł.; Polosukhin, I. (2017) Attention Is All You Need. In Proceedings of the 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA, 4–9 December 2017.
  13. Gbashi, S.; Njobeh, P.B. (2024) Enhancing Food Integrity through Artificial Intelligence and Machine Learning: A Comprehensive Review. Appl. Sci., 14, 3421.
  14. Flowers, J.C. (2019) Strong and Weak AI: Deweyan Considerations. In Proceedings of the AAAI Spring Symposium: Towards Conscious AI Systems, Palo Alto, CA, USA, 25–27 March 2019; Volume 2287.
  15. Fjelland, R. (2020) Why General Artificial Intelligence Will Not Be Realized. Humanit. Soc. Sci. Commun. 7, 1–9.
  16. Asay, C.D. (2019) Artificial Stupidity. Wm. Mary L. Rev. 61, 1187.
  17. Kuusi, O.; Heinonen, S. (2022) Scenarios from Artificial Narrow Intelligence to Artificial General Intelligence—Reviewing the Results of the International Work/Technology 2050 Study. World Futures Rev. 14, 65–79.
  18. Varshney, H.; Khan, R.A.; Khan, U.; Verma, R. (2021) Approaches of Artificial Intelligence and Machine Learning in Smart Cities: Critical Review. In Proceedings of the IOP Conference Series: Materials Science and Engineering; IOP Publishing: Bristol, UK; Volume 1022, p. 012019.
  19. Ullah, Z.; Al-Turjman, F.; Mostarda, L.; Gagliardi, R. (2020) Applications of Artificial Intelligence and Machine Learning in Smart Cities. Comput. Commun. 154, 313–323.
  20. Saravanan, R.; Sujatha, P. (2018) A State of Art Techniques on Machine Learning Algorithms: A Perspective of Supervised Learning Approaches in Data Classification. In Proceedings of the 2018 Second International Conference on Intelligent Computing and Control Systems (ICICCS), Madurai, India, 14–15 June 2018; IEEE: Piscataway, NJ, USA; pp. 945–949.
  21. Sindhu Meena, K.; Suriya, S. (2020) A Survey on Supervised and Unsupervised Learning Techniques. In Proceedings of the International Conference on Artificial Intelligence, Smart Grid and Smart City Applications: AISGSC, Coimbatore, India, 3–5 January 2019, Springer: Berlin/Heidelberg, Germany; pp. 627–644.
  22. Dong, H.; Ding, Z.; Zhang, S.; Chang, (2020) Deep Reinforcement Learning; Springer: Berlin/Heidelberg, Germany, ISBN 9811540942.
  23. Wiering, M.A.; Van Otterlo, M. (2012) Reinforcement Learning. Adapt. Learn. Optim. 12, 729.
  24. Martín-Guerrero, J.D.; Lamata, L. (2021) Reinforcement Learning and Physics. Appl. Sci. 11, 8589.
  25. Coronato, A.; Naeem, M.; De Pietro, G.; Paragliola, G. (2020) Reinforcement Learning for Intelligent Healthcare Applications: A Survey. Artif. Intell. Med. 109, 101964.
  26. Le Cun, Y.; Bengio, Y.; Hinton, G. E. (2015) Deep learning. Nature, 521, 436–444.
  27. Goodman, B.; Flaxman, S. (2017) European Union regulations on algorithmic decision-making and a "right to explanation". AI Magazine, 38(3), 50–57.
  28. Castelvecchi, D. (2016) Can we open the black box of AI?. Nature, 538, 20–23.
  29. A. Hassoun; A. Aït Kaddour; A.M. Abu Mahfouz; N.B. Rathod; F. Bader; F.J. Barba; A. Biancolillo; J. Cropotova; C.M. Galanakis; A.R. Jambrak; J.M. Lorenzo. (2023) The fourth industrial revolution in the food industry—Part I: Industry 4.0 technologies. Critical Reviews in Food Science and Nutrition, 63, pp. 6547-6563.