Welcome to the HFS repository! This project was developed during the Hatch from Scratch 24-hour hackathon conducted by the Birla Institute of Technology, Mesra. The primary goal of this project is to create an AI-powered waste sorting system that effectively classifies waste into various categories.
The challenge is to design a waste sorting system that uses artificial intelligence to identify and categorize waste materials accurately. By leveraging machine learning techniques, the project aims to improve recycling rates and promote environmental sustainability.
This project is built using the following technologies:
- Python: For backend development and implementing the AI model.
- Next.js: A React-based framework for building the frontend application.
- Tailwind CSS: A utility-first CSS framework used for styling the frontend UI.
The repository structure is organized as follows:
.
├── backend
│ ├── DATASET
│ │ ├── TEST
│ │ │ ├── N
│ │ │ ├── O
│ │ │ └── R
│ │ └── TRAIN
│ │ ├── N
│ │ ├── O
│ │ └── R
│ ├── models
│ └── src
│ └── __pycache__
└── frontend
└── UI
├── public
└── src
├── app
│ └── fonts
└── pages
-
backend: Contains the backend code and model files.
- DATASET: Holds the training and testing datasets for the model, organized into categories (N, O, R).
- models: Directory for storing trained models.
- src: Source code for the backend application.
-
frontend: Contains the frontend code and UI components.
- public: Publicly accessible files, such as images and fonts.
- src: Source code for the Next.js application, including app configuration and pages.
To get started with the project, follow these steps:
-
Clone the repository:
git clone https://github.com/Brainitech/HFS.git cd HFS -
Download the Dataset:
Download the dataset from this link and place it in the
backend/DATASETdirectory. -
Backend Setup:
- Navigate to the
backenddirectory:cd backend - Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use: venv\Scripts\activate
- Install the required packages:
pip install -r requirements.txt
- Navigate to the
-
Frontend Setup:
- Navigate to the
frontend/UIdirectory:cd frontend/UI - Install the required npm packages:
npm install
- Navigate to the
To run the application, you will need to start both the frontend and backend servers in separate terminal windows:
-
Backend:
- From the
backenddirectory, run:uvicorn src:app --reload # Adjust according to your main module
- From the
-
Frontend:
- From the
frontend/UIdirectory, run:npm run dev
- From the
The core of the AI-powered waste sorting system is a Convolutional Neural Network (CNN) that processes images for classification. The model works as follows:
- Input: The CNN takes colored images of waste materials as input.
- Preprocessing: The images are converted to grayscale to reduce complexity and improve classification performance.
- Classification: The model classifies the waste into predefined categories (N, O, R) based on features extracted during training.
This approach allows for efficient and accurate sorting of waste, facilitating better recycling and waste management practices.
- Birla Institute of Technology, Mesra: IET Club for organizing the hackathon.