CafeteriaSense: AI-Powered Food Waste Prediction for Schools
Inspiration
Every day during lunch, we saw the same problem: large amounts of perfectly usable food being thrown away. Trays of untouched meals, extra sides, and prepared food that was never eaten disappeared into the trash, while many students across the country continue to face food insecurity.
We started wondering about why this occurs, and our research revealed that the problem was not that cafeteria staff did not care. The problem was that school food systems are influenced by dozens of unpredictable factors: attendance changes, weather, special events, student preferences, menu choices, staffing, and operational limitations. Because these factors interact in complex ways, cafeterias often have no reliable way to understand how much waste a specific day will create or what caused it.
A cafeteria manager may know that waste is occurring, but they cannot easily answer questions like: Why did waste increase this week? Which factors caused it? Is this pattern predictable? What action would actually reduce it?
That led us to a different perspective. Instead of only trying to predict how much food schools should prepare, we wanted to predict the outcome schools are actually trying to prevent: the food waste itself.
CafeteriaSense was created to help schools predict waste, understand why it happens, and take targeted action before waste occurs.
What CafeteriaSense Does and Why It Matters
CafeteriaSense is an AI-powered decision-support system that predicts school cafeteria food waste before lunch service begins.
Unlike traditional waste tracking systems that only measure waste after it happens, CafeteriaSense focuses on prevention. It combines three steps into one system:
- Prediction: How much food waste is likely to occur?
- Explanation: What factors are driving that waste?
- Action: What changes could help reduce it?
The system analyzes 20 operational factors, including student attendance, menu complexity, weather, day of the week, holidays, exam periods, staffing, and equipment availability. It predicts expected food waste, provides a confidence range, identifies the factors contributing most to the prediction, and recommends targeted actions.
Rather than giving generic advice like “make less food,” CafeteriaSense provides recommendations based on a school's specific situation. For example, a school might discover that its highest waste occurs on Fridays when attendance drops and a complex menu is served. Instead of repeating the same pattern, cafeteria staff can use this information to adjust preparation strategies, modify menus, or explore food donation opportunities to help reduce the schools waste.
CafeteriaSense is not designed to replace cafeteria managers. The AI provides insights, while humans remain responsible for decisions involving students, budgets, staff, and community needs. Human judgment remains essential because cafeteria staff understand factors that cannot always be captured by data.
By making food waste measurable and actionable, CafeteriaSense helps schools reduce unnecessary waste, lower environmental impact, save resources, and make better decisions.
How We Built It
We built CafeteriaSense as a complete AI product pipeline: data generation, model training, deployment, and user experience.
AI Prediction Model
We trained a neural network using TensorFlow and Keras.
Traditional approaches often rely on simple averages or fixed rules, such as reducing production by a certain percentage. However, cafeteria waste is influenced by many interacting variables. AI allows CafeteriaSense to identify patterns and relationships that would be difficult to detect manually.
Since real cafeteria datasets are difficult to access due to privacy concerns and school data restrictions, we created 50,000 realistic synthetic cafeteria scenarios. Each scenario combined different operational factors and waste outcomes based on research-backed relationships. In addition, we intentionally introduced Gaussian noise into the training data to ensure that the model performs reliably under real-world scenarios with messier input data and to prevent the model from overfitting.
Synthetic data allowed us to build and test the system while avoiding the privacy challenges of collecting student and school information. However, the long-term goal is to continuously improve the model using real cafeteria measurements and feedback from schools.
The neural network was able to learn complex interactions between multiple variables. For example, attendance changes may have a different effect depending on weather, preparation difficulty, and staffing levels. A neural network can capture these relationships more effectively than a simple rule-based algorithm.
The final model achieved approximately R² ≈ 0.80 on test data alongisde providing predictions with uncertainty estimates rather than presenting AI outputs as perfect answers.
Web Application
We built a browser-based dashboard using HTML, CSS, JavaScript, and TensorFlow.js.
Instead of sending school data to external servers, the model runs directly in the browser. This local-first design improves privacy, reduces latency, and allows schools to use the system without requiring complex infrastructure.
The dashboard includes:
- Waste prediction and recommendations
- 28-day forecasting
- Environmental impact estimates
- School benchmarking
- Responsible AI explanations
- Food bank resources
Users enter their school's operational information and receive an immediate prediction, explanation of the factors involved, and recommendations tailored to their situation.
Deployment
The application was deployed using Vercel with a lightweight static architecture. Since the system does not require a backend database, it can scale easily while keeping user data private.
Challenges We Faced
One of the biggest challenges was transforming a trained AI model into a reliable product.
TensorFlow to TensorFlow.js Conversion
The model was trained in Python but needed to run inside a browser. Converting the model introduced compatibility issues involving model files, weight formatting, and differences between training and inference environments.
Debugging these issues taught us that building AI applications requires more than creating a model. The deployment environment, user experience, and reliability are equally important.
Making AI Explainable
A prediction alone is not enough. If users do not understand why the AI made a recommendation, they are less likely to trust or use it.
We focused on making CafeteriaSense interpretable by showing contributing factors, confidence ranges, and reasoning behind recommendations. This added complexity but was necessary for responsible real-world AI.
Creating Useful Data
Generating synthetic data required balancing realism, diversity, and privacy. We needed enough variation for the model to learn meaningful patterns while ensuring the scenarios represented realistic school environments.
Accomplishments We're Proud Of
We built a complete AI-powered application from the ground up:
- A trained machine learning model
- A browser-based AI interface
- Real-time waste predictions
- Recommendation generation
- Environmental impact analysis
- Responsible AI features
We are especially proud that CafeteriaSense goes beyond prediction. Many AI systems stop after producing an output, but we focused on creating a complete decision-support system that helps people understand problems and take action.
We designed the system around responsible AI principles:
- Humans remain in control of decisions
- Predictions include uncertainty
- Users can understand why recommendations are generated
- Data privacy is prioritized
What We Learned
This project taught us that building useful AI requires much more than selecting a model.
We learned that deployment can be just as challenging as training. A model that works in a notebook is very different from a reliable application used by real people.
We learned that explainability is essential for real-world AI. Accuracy alone is not enough. Users need to understand and trust AI recommendations.
We learned that synthetic data can be valuable when real data is difficult to access, especially when privacy is important.
Most importantly, we learned that successful AI products combine machine learning, software engineering, user experience, and an understanding of the people who will use the technology.
What's Next
The next step is testing CafeteriaSense with real schools and replacing synthetic training data with real cafeteria measurements.
Future improvements include:
- Creating feedback loops so predictions improve over time
- Integrating computer vision to measure actual plate waste
- Improving food donation logistics by connecting surplus predictions with food banks
Long term, we want to help thousands of schools use AI-driven insights to reduce waste and make sustainability more practical.
CafeteriaSense started with a simple observation: food was being wasted every day without anyone knowing exactly why. We built a system that transforms that invisible waste into measurable data, actionable insights, and better decisions.
Our goal is not just to reduce food waste. It is to help schools create a future where resources are used intentionally and every meal has more impact.
Log in or sign up for Devpost to join the conversation.