Neural Food Waste Predictor is a full-stack machine learning dashboard for estimating daily food waste from operational and environmental inputs.
The project combines a React frontend, a FastAPI backend, and an MLPRegressor model so users can explore both historical data and live inference from one interface.
Food waste is expensive, environmentally harmful, and often driven by patterns that operators can only see after the fact.
This project turns that problem into a product flow:
- visualize historical waste behavior
- retrain a model from generated operational data
- change input conditions live
- get an immediate waste prediction from the API
- Frontend: React, TypeScript, Vite, Recharts
- Backend: Python, FastAPI, Uvicorn
- ML: scikit-learn
MLPRegressor, NumPy, pandas - Styling: custom CSS
Start the backend:
cd backend
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python train_model.py
uvicorn main:app --reloadIn a second terminal, start the frontend:
cd frontend
npm install
npm run devThen open http://localhost:5173.
- Click the Codespaces badge above.
- Open two terminals.
- Start the backend with the commands above.
- Start the frontend with the commands above.
- Open the forwarded Vite port.
If you want a fast product walkthrough from another computer, use the public browser demo above.
That hosted demo runs a deterministic client-side version of the waste logic for easy access, while the full local repo still contains the React frontend, FastAPI API, and trained scikit-learn model artifact.
frontend/dashboard UI and chartsbackend/main.pyFastAPI inference APIbackend/train_model.pysynthetic data generation and model trainingbackend/model.joblibtrained model artifactbackend/historical_waste.csvdemo dataset
This repository now has a lightweight public browser demo plus a fuller local stack implementation.
The browser demo is the easiest public entry point, while the local repo remains the more complete engineering version.
