Inspiration
This project was inspired by the need for faster and safer biomedical waste segregation in hospitals, where manual sorting can lead to errors and health risks. The goal was to use AI to make waste classification more accurate and efficient.
What it does
SafeWaste AI is an AI-based web application that classifies biomedical waste from uploaded images using a ResNet18 deep learning model. It predicts the type of waste along with a confidence score and provides proper disposal instructions to ensure safe handling. The system also generates Grad-CAM heatmaps to visually explain the model’s decision, stores all predictions in a database for tracking, and offers a dashboard for analytics. Additionally, it can generate PDF reports and send email alerts when the model’s confidence is low, helping ensure reliable and safe waste management decisions.
How we built it
We built SafeWaste AI by combining deep learning with a full-stack web application. First, we trained a ResNet18 convolutional neural network to classify biomedical waste images into different categories using PyTorch. Then, we developed a Flask backend to handle image uploads, run predictions, and return results. We integrated OpenCV to generate Grad-CAM heatmaps for model interpretability and used SQLite to store prediction history and feedback. For the user interface, we created web pages using HTML templates, and added features like a dashboard for analytics, PDF report generation using ReportLab, and email alerts using Flask-Mail when prediction confidence is low. Since we were not very familiar with ResNet-18, we referred to research papers and AI tools to better understand its architecture and implementation.
Challenges we ran into
We faced a few simple but important challenges while building SafeWaste AI. At first, getting good accuracy was difficult because the dataset was not perfectly balanced. Integrating the PyTorch model with the Flask app also took effort, especially while handling image uploads and prediction flow smoothly. Setting up Grad-CAM heatmaps was a bit tricky because it required correct layer selection in ResNet18. We also had minor issues in formatting PDF reports and configuring email alerts properly. Overall, most challenges were solved through testing and debugging step by step.
Accomplishments that we're proud of
We are proud of building a complete end-to-end AI system that can automatically classify biomedical waste from images with real-time predictions. The project successfully integrates a deep learning model with a Flask web application, along with features like Grad-CAM heatmaps for explainability, a dashboard for analytics, and a database to store prediction history. We also implemented PDF report generation and email alerts for low-confidence predictions, making the system more practical and reliable. Overall, it was a great learning experience in combining AI with real-world deployment.
What we learned
We learned how to build a complete AI system from scratch, starting with training a deep learning model using PyTorch for image classification. We understood how CNNs like ResNet18 work and how concepts like softmax, cross-entropy loss, and ReLU are used in practice. We also learned how to connect a machine learning model with a Flask web application, handle image uploads, and store results in a database. Along with this, we gained experience in generating Grad-CAM heatmaps for model explainability, creating PDF reports, and sending email notifications. Overall, we learned how to turn an AI model into a fully working real-world application.
What's next for SafeWasteAI
SafeWaste AI can be further enhanced into a more advanced and real-world deployable system. It can be improved by training the model on larger and more diverse datasets to increase accuracy and reliability. The system can be upgraded to support real-time image capture using cameras instead of manual uploads. An IoT-based extension can be added where smart bins with sensors and camera modules automatically detect and classify waste, and even guide proper disposal in real time. The application can also be deployed on cloud platforms for wider accessibility and integrated into mobile apps for easier use in hospitals. Additionally, advanced analytics dashboards, user authentication, and hospital-level decision support features can be added to make it a complete intelligent waste management system.

Log in or sign up for Devpost to join the conversation.