Utilizing Deep Learning for Waste Detection and Management

For our group project in INF2179H Machine Learning with Applications in Python, we wanted to leverage AI to optimize waste detection and management in Toronto. I'm responsible for building a Convolutional Neural Network (CNN) using a dataset of labeled waste images.
Problem Statement
Litter pollution in Toronto is a significant environmental issue, with over 50,000 large plastic trash items removed from the Toronto Harbour alone in 2025. The city spends approximately 27 million dollars annually on City Litter Operations, including cleanup and collection. The vast operations run for twenty hours per day, seven days per week with ample staff labouring to empty bins and sweep streets. Despite these efforts, effective waste collection and management is still a challenge. Waste misclassification leads to inefficiencies in recycling and waste management. Many items that could be recycled end up in landfills simply because they are sorted incorrectly. Thus, we envision a trash-collecting robot with advanced computer vision to automatically, efficiently, and correctly detect waste items.
Solution
Our comprehensive proposed solution addresses two aspects
Where to deploy the robots: By using Random Forest, we can uncover patterns that lead to higher amounts of littering in specific areas. Identifying these key features will allow us to anticipate when and where littering is likely to increase, enabling proactive measures such as deploying temporary bins or reallocating waste collection resources. Our objective is to identify the features most strongly correlated with litter accumulation. These insights will empower the city to optimize cleanup operations, ensuring that resources are directed efficiently to high-litter zones at the right times.
How the robots operate: We aim to develop a neural network model that can accurately classify images of household garbage into 12 distinct categories (e.g., paper, cardboard, metal, plastic, glass, clothes, shoes, batteries, etc.). This system would be able to identify litter in real time from images captured by cameras mounted along Toronto’s streets or other waste-prone areas. This would enable more targeted cleaning efforts, reducing time spent on unnecessary collection and allowing for quicker response times to areas that require attention.
CNN
I trained a Convolutional Neural Network (CNN) using a dataset of labeled waste images. The model learns to recognize patterns and features unique to each trash type. The dataset consists of 12 garbage classes, including batteries, cardboard, plastic, and more.
A CNN is well-suited for this task because it excels at image recognition by automatically detecting relevant visual patterns, such as textures, shapes, and colors, which are crucial for distinguishing different types of waste. Due to resource constraints and quick turnaround, I relied on the pre-trained model ResNet-50 for this task.
The baseline model uses GlobalAveragePooling2D() to reduce spatial dimensions before dense layers:
Fine tuning: Last 10 layers
Dense layer: 1
Dropout: 0.3 (single)
Evaluation: Basic accuracy plot
Epochs: 10
After that, I fine-tuned the model with better model architecture and advanced training strategies to improve performance and optimize efficiency:
Fine-tuning: Last 15 layers
Dense layers: 2 (512 → 256)
Dropout: 0.4 + 0.2 (two layers)
Callbacks: LR reduction, early stopping
Evaluation: Confusion matrix + full metrics
Epochs: 30 (with early stopping)
Results
Final Test Loss: 1.2593
Final Test Accuracy: 59.81%


While the model is performing well, there is still room for improvement due to quality and imbalances in the data it was trained on. Addressing these gaps will further improve its accuracy and dependability.
Demo
This project demonstrates the potential of AI in improving waste classification and sustainability efforts. With further refinements, this technology could significantly enhance recycling efficiency.
