Skip to content

nayon0217/Waste-Classification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Waste Classification App 🗑️♻️

An AI-powered waste classification system that uses deep learning to automatically identify and categorize waste materials, promoting efficient recycling and sustainable waste management.

About

Waste Classification is an intelligent image recognition system designed to automate the sorting of recyclable materials. By leveraging computer vision and deep learning techniques, this application helps users quickly identify whether waste items are recyclable, compostable, or belong to other categories, reducing contamination in recycling streams and promoting environmental sustainability.

Features

  • Real-Time Image Classification - Instantly classify waste materials using your device's camera or uploaded images
  • Multiple Waste Categories - Recognizes various types of waste including recyclables, organic waste, and general trash
  • Deep Learning Powered - Utilizes convolutional neural networks (CNN) for accurate waste recognition
  • User-Friendly Interface - Clean React-based frontend for easy interaction
  • Fast Processing - Quick inference times suitable for real-time applications
  • Educational Tool - Helps users learn proper waste sorting practices

Tech Stack

Frontend

  • Framework: React.js
  • Language: JavaScript
  • Styling: CSS3
  • Build Tool: Create React App

Backend

  • Framework: Flask (Python)
  • Machine Learning: TensorFlow/Keras or PyTorch
  • Image Processing: OpenCV, PIL
  • API: RESTful endpoints for classification

Machine Learning

  • Architecture: Convolutional Neural Networks (CNN)
  • Common Models: ResNet, VGGNet, MobileNet, or custom architectures
  • Training: Transfer learning on waste image datasets
  • Deployment: Model serving via Flask API

Project Structure

Waste-Classification/
├── frontend/               # React application
│   ├── public/            # Static files
│   ├── src/               # React components and logic
│   │   ├── components/    # Reusable UI components
│   │   ├── App.js         # Main application component
│   │   └── index.js       # Entry point
│   └── package.json       # Frontend dependencies
│
├── backend/               # Flask API server
│   ├── app.py            # Main Flask application
│   ├── model/            # Trained ML models
│   ├── utils/            # Helper functions
│   └── requirements.txt  # Python dependencies
│
└── README.md

Getting Started

Prerequisites

  • Node.js 14+ and npm (for frontend)
  • Python 3.7+ (for backend)
  • A trained waste classification model (or train your own)

Installation

1. Clone the Repository

git clone https://github.com/nayon0217/Waste-Classification.git
cd Waste-Classification

2. Frontend Setup

cd frontend
npm install

3. Backend Setup

cd backend
pip install -r requirements.txt

Common backend dependencies might include:

flask
flask-cors
tensorflow
keras
pillow
opencv-python
numpy

Running the Application

Start the Backend Server

cd backend
python app.py

The Flask server typically runs on http://localhost:5000

Start the Frontend Development Server

In a separate terminal:

cd frontend
npm start

The React application will open at http://localhost:3000

Usage

  1. Upload an Image: Click the upload button to select an image of waste material from your device
  2. Capture with Camera (if implemented): Use your device's camera to take a photo
  3. Get Classification: The system processes the image and returns the waste category
  4. View Results: See the classification result with confidence score and disposal recommendations

API Endpoints

POST /classify

Classifies an uploaded waste image.

Request:

{
  "image": "<base64_encoded_image>"
}

Response:

{
  "category": "Recyclable - Plastic",
  "confidence": 0.95,
  "recommendations": "Place in blue recycling bin"
}

Troubleshooting

Model not loading:

  • Ensure the model file is in the correct directory
  • Check that the model format matches the loading code

CORS errors:

  • Verify Flask-CORS is installed and configured
  • Check that backend URL is correctly set in frontend

Low accuracy:

  • Ensure good image quality
  • Check lighting conditions
  • Verify the object is clearly visible
  • Consider model retraining with more data

Contact

nayonk@andrew.cmu.edu


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published