Food waste and unhealthy eating habits are getting worse around the world, especially in big cities where it’s tough to keep an eye on what people actually eat. Right now, most food safety checks just look at the expiration date on the packaging. The problem is, the date doesn’t always tell you whether the food’s safe or how it might affect your health.
This research offers a smarter way to figure out if your food is safe, using artificial intelligence to dig into what’s actually in it and whether it makes sense to eat. The system uses both machine learning and deep learning: a Random Forest classifier judges how risky the food is for your health, and a Long Short-Term Memory model spots patterns in the ingredients and their context. On top of that, a set of simple rules checks if the food is still within its expiration date.
Putting all of this together, the system sorts foods into different risk levels based on what’s in them and how fresh they are, explaining its reasoning in plain language. And it doesn’t just stop there—it gives people straightforward tips to help them eat healthier and steer clear of potential health risks. When food gets close to its expiry date—or goes past it—the solution steps in with clear advice: either eat it right away or toss it. It’s simple, but it helps cut down on food waste and keeps what you eat safer. On top of that, it lets you make smarter choices about what you’re eating in general.
Introduction
The text presents an AI-based intelligent food monitoring and pantry management system designed to reduce food waste, improve dietary habits, and promote health awareness. Poor food monitoring, unhealthy eating behaviors, and inefficient pantry management contribute significantly to food waste and health risks. The proposed system addresses these issues by using Artificial Intelligence (AI), Machine Learning (ML), and Deep Learning (DL) to analyze food ingredients, predict health risks, and provide personalized dietary recommendations. It classifies food items into multiple health risk categories, explains the results in an interpretable manner, and offers consumption guidance while also monitoring food expiry dates.
The background highlights the rapid growth of digital health and nutrition applications, which help users monitor calorie intake and dietary habits. Recent AI and ML technologies have enhanced these applications by enabling personalized recommendations and predictive health analysis. While neural networks such as Long Short-Term Memory (LSTM) effectively analyze ingredient sequences and contextual information, ensemble methods like Random Forest (RF) provide accurate classification of structured data. However, existing pantry management systems mainly focus on expiry reminders and lack intelligent health-risk assessment.
The literature review shows that most existing dietary recommendation systems rely on structured nutritional data and conventional ML algorithms such as Decision Trees, Support Vector Machines, and Neural Networks. Although hybrid AI models have improved prediction accuracy, few systems integrate ingredient-level contextual analysis, multi-risk health prediction, and pantry management into a single framework. The proposed system fills this gap by combining deep learning, machine learning, and rule-based methods to deliver comprehensive food safety and health analysis.
The proposed methodology consists of several stages:
Data Acquisition and Preprocessing: Collection of ingredient data with labels for diabetes, blood pressure, thyroid, and allergy risks, followed by cleaning, label encoding, and preprocessing.
Text Representation: Ingredient text is tokenized and padded to create standardized numerical sequences.
Dataset Partitioning: The dataset is divided into 80% training and 20% testing.
Multi-Output Label Transformation: One-hot encoding enables simultaneous prediction of multiple health risk categories.
Deep Feature Learning: An LSTM network with embedding, LSTM, and dense layers learns semantic and sequential relationships among ingredients.
Feature Extraction: Latent features from the trained LSTM are extracted.
Machine Learning Classification: A Random Forest classifier uses these deep features to predict multiple health risks.
Model Evaluation: Prediction accuracy is measured individually for each health risk and averaged for overall performance.
Model Persistence: The trained LSTM model, Random Forest classifier, tokenizer, and encoders are saved for deployment.
The workflow begins with ingredient text as input and produces predictions for diabetes risk, blood pressure risk, thyroid risk, and allergy risk, along with dietary recommendations.
A major contribution of the study is its hybrid LSTM–Random Forest architecture, which combines the contextual understanding of LSTM with the strong classification capabilities of Random Forest. This improves prediction accuracy while maintaining interpretability. The algorithm follows a structured pipeline involving data preprocessing, LSTM training, feature extraction, Random Forest classification, evaluation, and model storage.
The implementation uses:
Frontend: React, JavaScript, HTML, and CSS.
Backend: Node.js and Express.js.
Machine Learning: Python, TensorFlow/Keras for LSTM, Scikit-learn for Random Forest, and Pandas/NumPy for data processing.
Development Environment: Jupyter Notebook or Google Colab for ML and Visual Studio Code for full-stack development.
The deep learning model includes a 64-dimensional embedding layer, a 64-unit LSTM layer, a 32-neuron dense layer, and four softmax output layers corresponding to diabetes, blood pressure, thyroid, and allergy risks. Training employs the Adam optimizer, five epochs, batch size of 32, a 5,000-word vocabulary, 20-token sequence length, and a Random Forest with 200 decision trees.
Conclusion
A. Objective
The main goal of the HealthAware: Intelligent Food Risk Prediction and Expiry Management System design is to make a cutting-edge, all-in-one web-based platform that combines smart food risk predictions with expiry management. The proposed design will solve the problems that come with traditional nutrition and food management platforms by bringing together contextual analysis of food ingredients, smart risk classification, and rule-based expiry management into one platform.
The system uses artificial intelligence to try to give users personalized and accurate information about the health risks of food.
B. Review of Key Findings
The results of the experiment indicate that the proposed hybrid LSTM and Random Forest model performs extremely well at identifying the health risk categories for classification purposes. The use of LSTM allows obtaining valuable feature representations through effectively modeling the interactions between the food ingredients in a sequential fashion.
Moreover, the expiry monitoring component employs real-time date comparison functionality to categorize food items according to the three levels of safety: edible, nearing expiry, and expired. Such a solution resolves the typical problem experienced in reality, when people tend to forget about expiration dates and throw away spoiled food.
A combination of risk prediction based on artificial intelligence techniques with expiry monitoring based on rules allows acquiring a holistic assessment of food quality and makes decision-making much easier.
C. Implications and Applications
Implications of the proposed system are extensive for the purposes of smart food management, digital health, and smart consumers. The system can have numerous practical applications in life including those of smart grocery shopping software, platforms for recommending healthy food based on dietary needs, household pantries, and food safety monitoring in e-commerce environment.
It facilitates healthier food consumption practices through predictive analytics based on expiration date awareness. At the same time, smart alerts and recommendations reduce the volume of wasted food products in households. Using artificial intelligence in combination with tools for managing food can result in more intelligent living spaces.
D. Future Scope
While the suggested HealthAware: Smart Food and Expiry Management System has great prediction effectiveness and applicability, there are still many possibilities of improvement. The one thing that can be most certain to occur in the future is the use of an IoT-based technology such as a pantry system, refrigerator, or any other food monitoring system. This will increase the efficiency of using the suggested system by getting rid of manually entering data about the food products and tracking them in real time.
To increase the contextual understanding of complex combinations of ingredients, the current hybrid model could potentially be expanded to include more advanced deep learning architectures (e.g., transformer-based models). The application of these models could result in better features being represented which would, in turn, improve the accuracy of predictions.
Another exciting extension of the system would include using computer vision techniques to recognize food items. As a result, there will be more automation and ease-of-use because the system will use image-based models to automatically identify food items, including the determination of the freshness/expiry of the food items.
Through the development of mobile applications and the deployment of the system in cloud environments, scalability and accessibility can be greatly improved. Therefore, users will have access to the system at any time (24/7) and from any location.
Additionally, integrating adaptive learning capabilities to the system will allow for the system to learn from user interactions over time, as well as provide users with personalized recommendations and improved decision making based on the user\'s entire history with the system.
In summary, this proposed system has provided evidence of the benefits of utilizing artificial intelligence with proven food management techniques to improve food safety evaluations and increase dietary awareness. By providing users with reliable and actionable recommendations based on contextual ingredient evaluations and expiration date monitoring, this system has the potential to significantly reduce food waste and enhance health-oriented decision making through the utilization of appropriately applied hybrid methods.
References
[1] I. Goodfellow, Y. Bengio, and A. Courville, Deep Learning. MIT Press, 2016.
[2] S. Hochreiter and J. Schmidhuber, “Long short-term memory,” Neural Computation, vol. 9, no. 8, pp. 1735–1780, 1997.
[3] L. Breiman, “Random forests,” Machine Learning, vol. 45, no. 1, pp. 5–32, 2001.
[4] M. Abadi et al., “TensorFlow: A system for large-scale machine learning,” in Proc. USENIX OSDI, 2016.
[5] Z. Liu et al., “Artificial intelligence in food safety: A review,” Foods, vol. 12, no. 6, 2023.
[6] K. Agrawal et al., “Artificial intelligence in personalized nutrition and food systems,” Frontiers in Nutrition, 2025.
[7] Q. Chen and R. Kumar, “Design and implementation of a nutrition checker mobile application,” IEEE Transactions on Mobile Computing, 2023.
[8] R. Rashvand et al., “AI-based prediction of food shelf-life: Advances and challenges,” Trends in Food Science & Technology, 2025.
[9] C. Trattner and D. Elsweiler, “Investigating the healthiness of online recipes,” in Proc. WWW Conference, 2017.
[10] M. Ge, F. Ricci, and D. Massimo, “Health-aware food recommender systems,” in Proc. ACM RecSys, 2015.
[11] D. Elsweiler and M. Harvey, “Towards automatic meal plan recommendations for balanced nutrition,” in Proc. ACM RecSys, 2015.
[12] S. Abbar, Y. Mejova, and I. Weber, “You tweet what you eat: Studying food consumption via social media,” in Proc. ACM CHI, 2015.
[13] L. Zhou et al., “Application of deep learning in food: A review,” 2019.
[14] W.-Y. Ong, C.-W. Too, and K.-C. Khor, “Transfer learning for food expiry reminder systems,” 2021.
[15] M. R. Hyder and T. Khan, “Automated food expiry notification system,” International Journal of Engineering Science, 2020.
[16] T. Khan, “Cloud-based smart food expiry system using QR codes,” in IEEE Conference, 2018.
[17] H. Almurashi et al., “Smart expiry food tracking system,” Advances in Intelligent Systems, 2021.
[18] Y. Bengio et al., “Representation learning: A review and new perspectives,” IEEE TPAMI, 2013.