AWS Public Sector Blog

How NTU FRESH is using AWS to build predictive food safety at scale

How NTU FRESH is using AWS to build predictive food safety at scale

Food safety is undergoing a quiet revolution. As Singapore and the broader Asia-Pacific region embrace novel food sources, from cultivated meat and precision-fermented proteins to plant-based alternatives, the traditional reactive approaches to food safety evaluation are no longer sufficient. The need for faster, smarter, and more scalable safety assessments has never been greater.

Backed by the Amazon Web Services (AWS) Cloud to Table initiative, the Future Ready Food Safety Hub (FRESH) at Nanyang Technological University (NTU), Singapore, is at the forefront of reimagining food safety through the lens of cloud computing, generative AI, and machine learning (ML). Rather than waiting for contamination events or relying solely on periodic lab testing, FRESH is building a predictive, data-driven system that continuously learns from laboratory results and real-time Internet of Things (IoT) sensor inputs to stay ahead of emerging food safety risks.

The scope of FRESH’s ambition is broad and purposeful:

  • Dynamic shelf-life modeling – By analyzing environmental and production data, FRESH aims to predict precise safety windows for perishable products. This approach mirrors proven industry results. AI-driven shelf-life analytics in grocery pilots have demonstrated a 14.8 percent reduction in food waste per store by enabling live, data-informed ordering and stock decisions.
  • Cold chain monitoring – Continuous IoT-enabled monitoring to detect temperature excursions and prevent spoilage before it reaches consumers.
  • ML-driven pre-screening of novel ingredients – Accelerating the safety evaluation pipeline for emerging food categories by surfacing risk signals earlier and with greater confidence.

By harnessing the scalable, secure cloud infrastructure of AWS, FRESH is making predictive food safety assessments feasible at a speed and scale that was previously impractical, transforming what formerly took weeks of lab work into near real-time, actionable intelligence.

In this post, we walk you through how FRESH is translating cloud-enabled analytics into practical tools that support resilient, trusted food systems, starting with a deep dive into dynamic shelf-life modeling. Specifically, we detail how AWS services such as Amazon Simple Storage Service (Amazon S3), AWS Glue, and Amazon SageMaker AI are used to build and train predictive models. We also explain how real-time inputs from IoT handheld sensors measuring volatile organic compounds (VOC), pH, and water activity are used to assess food freshness.

Solution overview

The FRESH predictive food safety solution is architected around a modern, cloud-based data pipeline that connects physical sensing at the food source to intelligent decision-making in the cloud. We designed the solution with three core principles in mind: scalability to handle diverse food categories and data volumes, modularity to accommodate new sensor types and ML models over time, and actionability to surface insights that food safety professionals can act on immediately.

At a high level, the architecture brings together the following AWS services and capabilities:

  • IoT data ingestion – Handheld IoT sensors capture real-time VOC, pH, and water activity readings from food samples and transmit this data securely to AWS through AWS IoT Core, providing a continuous stream of freshness indicators from the field.
  • Data processing and feature engineeringAWS Glue orchestrates the extraction, transformation, and loading (ETL) of historical laboratory results and omics datasets (multidimensional biological data such as genomics and proteomics), preparing clean, enriched feature sets ready for model training and inference.
  • Model training and deploymentAmazon SageMaker AI serves as the ML backbone of the solution. FRESH researchers use Amazon SageMaker AI to experiment with, train, and tune predictive models that correlate sensor signals with food safety outcomes, then deploy those models as scalable, low-latency inference endpoints accessible by field applications.
  • Insight delivery – Dashboards and application interfaces surface predictions and safety alerts, empowering food safety teams to make faster, evidence-based decisions on shelf life, stock management, and ingredient screening.

Together, these components form an end-to-end predictive food safety platform that grows smarter with every data point collected and more valuable with every food safety decision it informs.

The following diagram shows the high-level solution architecture.

Architecture diagram of a predictive food safety system showing how IoT sensor data is ingested, processed, and transformed into real-time shelf-life predictions and operator guidance. Sensors connect to AWS IoT Core via MQTT, which routes traffic to Amazon API Gateway. Requests are forwarded through an Application Diagram showing load balancer into AWS Fargate running in a VPC, which interacts with Amazon SageMaker AI for model inference, Amazon Bedrock for generative AI guidance, and Amazon DynamoDB for state management. Results are delivered to a retail operator dashboard hosted on AWS Amplify.

Figure 1: Architecture diagram of FRESH predictive food safety solution

Solution walkthrough

The following walkthrough traces the platform’s data flow from physical sensing at the food source to the moment a safety assessment reaches an operator’s screen. Each stage maps to a distinct set of AWS services and is designed to operate independently, so the system can scale, swap components, or incorporate new food categories without disrupting the layers around it.

1. Edge sensing and IoT ingestion – Handheld IoT sensors placed at the point of inspection continuously capture VOC concentrations alongside ambient temperature and humidity. Readings are transmitted securely to AWS IoT Core over MQTT, where device-level topic routing separates streams by product type and physical location. This approach means that data from different food categories arrives cleanly partitioned, ready for downstream processing without manual intervention.

2. Real-time feature assembly – Raw sensor signals are received by a containerized API service running on Amazon Elastic Container Service (Amazon ECS) with AWS Fargate. The service enriches each incoming reading with product metadata, including food category, packaging conditions, and relevant microbial context, to produce a structured feature set ready for model inference. The serverless compute model of AWS Fargate means the layer scales automatically with sensor volume, with no infrastructure management required. Amazon Elastic Container Registry (Amazon ECR) stores and manages the container images deployed to AWS Fargate.

3. Model training on Amazon SageMaker AI – Predictive models are trained on a large, well-established corpus of microbiology data covering a wide range of spoilage organisms, food matrices, and storage conditions. Amazon SageMaker AI manages the full training lifecycle: data preparation, feature engineering, experiment tracking, hyperparameter optimization, and model registration. The models produce probabilistic microbial load predictions with calibrated uncertainty bounds, giving operators a confidence envelope around each shelf-life estimate rather than a single point prediction. A multistage modeling approach extends forecasts across commercially relevant time horizons. Trained model artifacts are stored in Amazon S3 and versioned, so expanded datasets can be promoted to production without downtime.

4. Shelf-life inference and risk scoring – Each incoming sensor reading triggers a real-time inference call against an Amazon SageMaker AI endpoint hosting the trained model. The endpoint evaluates the enriched feature vector against organism-specific spoilage thresholds and returns two outputs: an estimated remaining shelf life and a normalized risk score. These two values form the foundation for every downstream action, from inventory decisions to operator alerts. Endpoint auto scaling keeps response latency consistent regardless of how many product lines are being assessed simultaneously.

5. Dynamic pricing and waste-reduction logic – The risk score from the inference layer feeds directly into a configurable pricing module that translates freshness signals into actionable markdown recommendations. Discount suggestions are tied to predicted remaining shelf life and respect per-product commercial constraints, so operators receive guidance that is both scientifically grounded and financially viable. The configuration is product-agnostic and can be tuned independently for different food categories or retail partners without retraining the underlying models.

6. Generative AI–powered operator guidance – Numeric model outputs (shelf-life estimates, risk scores, and pricing signals) are passed to a foundation model (FM) through Amazon Bedrock, which synthesizes them into operator guidance in plain English. Rather than presenting raw numbers, the system surfaces a concise, actionable assessment: what the current freshness status means in practical terms, what action is recommended, and whether any regulatory considerations apply. This layer makes the system accessible to frontline food safety staff who might not have a data science background, lowering the barrier to adoption across diverse operational settings.

7. Real-time dashboard delivery – The system surfaces assessed results in near real time through a web application hosted on AWS Amplify. Amazon API Gateway manages the connection between the backend and the client, and Amazon Cognito provides identity and access management so that only authorized users can view sensitive freshness and pricing data. Amazon DynamoDB stores shelf-life predictions and risk scores for low-latency retrieval by the dashboard. Operators observe a continually updated view of every monitored product, including shelf-life trajectory, risk status, and recommended action, without needing to query systems manually. The frontend is designed to run on standard devices available in food retail and production environments, requiring no specialist hardware.

Conclusion

This work demonstrates what becomes possible when predictive microbiology, IoT sensing, and cloud-based ML converge on a unified AWS architecture. For NTU FRESH, it marks the first production-grade deployment of the hub’s dynamic shelf-life modeling capability, replacing static best-by labels with continually updated, sensor-grounded predictions visible to any operator in real time. The system is designed to be extensible: new organisms, sensor types, and food matrices can be incorporated by retraining on expanded ComBase data without touching the cloud infrastructure or the client application.

FRESH is exploring a retail pilot that would deploy AWS IoT Greengrass to a partner site, connect live sensors, and close the feedback loop between field observations and model retraining. With approximately one-third of all food produced globally lost or wasted, the combination of predictive microbiology, AWS managed services, and generative AI offers a practical path toward a smarter, safer, and less wasteful food supply chain.

To learn more about the AWS services used in this solution, visit AWS IoT Core Developer Guide, Amazon SageMaker AI Developer Guide, and the Amazon Bedrock User Guide.

Noor Khan

Noor Khan

Noor Khan is a Solutions Architect at Amazon Web Services (AWS) supporting Singapore's public sector education and research landscape. She works closely with academic and research institutions, leading technical engagements and designing secure, innovative, and scalable architectures. Her passions include AI/ML, generative AI, web development, and empowering women in tech.

Dr. Charlie Lee

Dr. Charlie Lee

Charlie Lee is genomics industry lead for Asia-Pacific and Japan at AWS and has a PhD in computer science with a focus on bioinformatics. An industry leader with more than two decades of experience in bioinformatics, genomics, and molecular diagnostics, he is passionate about accelerating research and improving healthcare through genomics with cutting-edge sequencing technologies and cloud computing.

Prof. Chen Wei Ning, William

Prof. Chen Wei Ning, William

Prof. Chen Wei Ning, William is the Michael Fam Chair Professor in Food Science and Technology at Nanyang Technological University (NTU), and Director of Singapore Future Ready Food Safety Hub (FRESH@NTU). He also leads the NTU Food Science & Technology Programme and the Singapore Agri-food Innovation Lab (SAIL). His research spans tech innovations in food waste reduction, fermentation technology, and new generation of tech platforms for safety and nutrition benefits assessment of alternative foods, with deep ties to food industry, government agencies, and international organizations.

Kai Hui Ang

Kai Hui Ang

Kai is an education and research account manager at Amazon Web Services (AWS). She serves as the primary strategic advisor for academic institutions in Singapore, working alongside corporate staffs and researchers to understand their cloud computing needs—particularly in healthcare genomics research and AI workloads—and help them leverage AWS services to accelerate their research outcomes.

Youssef Ezzaky

Youssef Ezzaky

Youssef Ezzaky is a research fellow at Singapore Future Ready Food Safety Hub (FRESH@NTU), focusing on microbial food safety, predictive microbiology, and machine learning. His work bridges food safety science and AI, developing risk models and computational tools, including cloud-based shelf-life dashboards, to make food systems safer and smarter. He is currently training ML models on AWS to advance data-driven approaches to food safety research.