| ---
|
| library_name: scikit-learn
|
| tags:
|
| - regression
|
| - food-waste
|
| - sustainability
|
| - scikit-learn
|
| ---
|
|
|
|
|
|
|
| # FoodBridge AI
|
| ## Intelligent Global Food Waste Redistribution System
|
|
|
| FoodBridge AI is a machine learning system designed to predict food surplus and identify waste levels in food service environments. The system helps reduce food waste by enabling smarter redistribution strategies.
|
|
|
| ---
|
|
|
| # Project Objectives
|
|
|
| The goal of this project is to:
|
|
|
| - Predict food surplus using machine learning
|
| - Classify waste levels (Low / Medium / High)
|
| - Provide real-time predictions through APIs
|
| - Offer an interactive dashboard for users
|
| - Support data-driven food redistribution
|
|
|
| ---
|
|
|
| # Project Architecture
|
|
|
| FoodBridge AI consists of the following components:
|
|
|
| 1. **Exploratory Data Analysis (EDA)**
|
| 2. **Machine Learning Models**
|
| 3. **Model Training Pipelines**
|
| 4. **FastAPI Backend**
|
| 5. **Streamlit Dashboard**
|
| 6. **Model Documentation**
|
|
|
| ---
|
|
|
| # Project Structure
|
|
|
| # FoodBridge AI
|
| ## Intelligent Global Food Waste Redistribution System
|
|
|
| FoodBridge AI is a machine learning system designed to predict food surplus and identify waste levels in food service environments. The system helps reduce food waste by enabling smarter redistribution strategies.
|
|
|
| ---
|
|
|
| # Project Objectives
|
|
|
| The goal of this project is to:
|
|
|
| - Predict food surplus using machine learning
|
| - Classify waste levels (Low / Medium / High)
|
| - Provide real-time predictions through APIs
|
| - Offer an interactive dashboard for users
|
| - Support data-driven food redistribution
|
|
|
| ---
|
|
|
| # Project Architecture
|
|
|
| FoodBridge AI consists of the following components:
|
|
|
| 1. **Exploratory Data Analysis (EDA)**
|
| 2. **Machine Learning Models**
|
| 3. **Model Training Pipelines**
|
| 4. **FastAPI Backend**
|
| 5. **Streamlit Dashboard**
|
| 6. **Model Documentation**
|
|
|
| ---
|
|
|
| # Project Structure
|
|
|
| FoodBridge_AI
|
| β
|
| βββ data
|
| β
|
| βββ notebooks
|
| β βββ 01_EDA.ipynb
|
| β βββ 02_surplus_prediction_model.ipynb
|
| β βββ 03_waste_classification_model.ipynb
|
| β
|
| βββ utils
|
| β
|
| βββ models
|
| β
|
| βββ api
|
| β βββ main.py
|
| β
|
| βββ dashboard
|
| β βββ app.py
|
| β
|
| βββ saved_models
|
| β βββ foodbridge_regressor.pkl
|
| β βββ waste_classifier.pkl
|
| β βββ model_features.json
|
| β βββ classifier_features.json
|
| β
|
| βββ model_cards
|
| β βββ foodbridge_model_card.md
|
| β
|
| βββ README.md
|
|
|
|
|
| ---
|
|
|
| # Dataset
|
|
|
| The dataset contains approximately **10,000 records** collected from various food service environments.
|
|
|
| Key attributes include:
|
|
|
| - food preparation quantity
|
| - customer footfall
|
| - demand indicators
|
| - environmental factors
|
| - location information
|
|
|
| ---
|
|
|
| # Machine Learning Models
|
|
|
| ## Surplus Prediction
|
|
|
| Algorithm used:
|
|
|
| Random Forest Regressor
|
|
|
| Performance:
|
|
|
| MAE β 1.7
|
| RΒ² β 0.99
|
|
|
| ---
|
|
|
| ## Waste Classification
|
|
|
| Algorithm used:
|
|
|
| Random Forest Classifier
|
|
|
| Performance:
|
|
|
| Accuracy β 90%
|
|
|
| ---
|
|
|
| # Technologies Used
|
|
|
| - Python
|
| - Pandas
|
| - Scikit-Learn
|
| - FastAPI
|
| - Streamlit
|
| - Matplotlib
|
| - Seaborn
|
|
|
| ---
|
|
|
| # Running the Project
|
|
|
| ## 1 Install Dependencies
|
|
|
|
|
| ---
|
|
|
| # Dataset
|
|
|
| The dataset contains approximately **10,000 records** collected from various food service environments.
|
|
|
| Key attributes include:
|
|
|
| - food preparation quantity
|
| - customer footfall
|
| - demand indicators
|
| - environmental factors
|
| - location information
|
|
|
| ---
|
|
|
| # Machine Learning Models
|
|
|
| ## Surplus Prediction
|
|
|
| Algorithm used:
|
|
|
| Random Forest Regressor
|
|
|
| Performance:
|
|
|
| MAE β 1.7
|
| RΒ² β 0.99
|
|
|
| ---
|
|
|
| ## Waste Classification
|
|
|
| Algorithm used:
|
|
|
| Random Forest Classifier
|
|
|
| Performance:
|
|
|
| Accuracy β 90%
|
|
|
| ---
|
|
|
| # Technologies Used
|
|
|
| - Python
|
| - Pandas
|
| - Scikit-Learn
|
| - FastAPI
|
| - Streamlit
|
| - Matplotlib
|
| - Seaborn
|
|
|
| ---
|
|
|
| # Running the Project
|
|
|
| ## 1 Install Dependencies
|
|
|
| pip install -r requirements.txt
|
| ---
|
|
|
| ## 2 Run FastAPI Server
|
|
|
| cd api
|
| uvicorn main:app --reload
|
|
|
| API documentation will be available at:
|
|
|
| http://127.0.0.1:8000/docs
|
|
|
|
|
| ---
|
|
|
| ## 3 Run Streamlit Dashboard
|
|
|
| cd dashboard
|
| streamlit run app.py
|
|
|
|
|
| Dashboard will open at:
|
|
|
| http://localhost:8501
|
|
|
|
|
| ---
|
|
|
| # Applications
|
|
|
| FoodBridge AI can be used by:
|
|
|
| - restaurants
|
| - supermarkets
|
| - NGOs
|
| - food banks
|
| - smart city initiatives
|
|
|
| ---
|
|
|
| # Future Enhancements
|
|
|
| - Real-time IoT food monitoring
|
| - Deep learning demand forecasting
|
| - NGO logistics integration
|
| - Geographic redistribution optimization
|
|
|
| ---
|
|
|
| # Author
|
|
|
| Final Project
|
|
|
| FoodBridge AI β Intelligent Food Waste Prediction System
|
|
|
|
|
|
|