top of page
Search

Project 2: Classification - 10/10/22

  • Writer: Cherny Devireddy
    Cherny Devireddy
  • Oct 10, 2022
  • 3 min read

Problem:

The overproduction of garbage is a worldwide problem. Although we try to mitigate this problem with recycling and composting, it is sometimes hard to tell how exactly to sort through all the trash and find out what is recycling and what is composting. This is especially hard if we try to do this in a landfill for example. In order to solve this problem I have developed, trained, and tested a model to determine what is recycling and what is compost.


Data:

I found my data on Kaggle. This is the link:

This dataset contains features such as organic and recyclable images that can be sorted with the developed model.


Pre-processing the data:

A lot of the pre-processing I had to do was regarding the importing of the images into jupyter notebook. I had a lot of trouble with reading zip files. For example, extracting the zip files so I can read them as their file names. I also had trouble with loving my base path of where I had my data. After I realized there was a way to pull the data directly from Kaggle I faced another issue where I couldn't properly read in the location of the Kaggle data. I used a lot of references from this notebook: https://www.kaggle.com/code/beyzanks/waste-classification-with-cnn in order to figure out how to do certain things to process the data.


Data Understanding/Visualization:

In order to understand the data, I made sure to add labels to each of the images. I then figured out how many images are in each category (organic and recyclable). In order to visualize this information, I used a pie chart to show the number of each of the 2 categories. In this step, I found out that there are more organic images than recyclable images. Then I applied the labels to a random group of 9 images to make sure my visualizations were working properly and that the data is being processed correctly.


Modeling:

Firstly, I used an image data generator to make the transformation of the data on a random basis. It will help with achieving the result that I am looking for. Then I trained the dataset and tested the dataset with the fit_generator. This gave me an accuracy of .83 out of my whole dataset. After that, I tried to display my results in the form of a histogram. The fit_generator has given me a pretty decent accuracy score though.


Evaluation:

My model has an accuracy rate of .83 or in other words about 80%. In order to test this model, I had my model show the predicted label and the actual label of the image to manually show/check the accuracy rate. In this process I found my model to be correct in the way it was predicting if the images were organic or recyclable. For example, 12 out of the 15 images I displayed were labeled correctly.


The Story:

Throughout this project, I learned that it is important to pick issues that you are passionate about solving because I try to be environmentally conscious when possible but when it is not possible I feel this pressure that I am hurting the planet and causing more garbage to just end up in landfills. In order to solve this issue, I have created a model that can be implemented by garbage collection companies and landfills to sort through their trash and see what can be salvaged and prevented from ending up in a landfill. If this model is implemented, it will take pressure off people in public areas who are not able to compost (with organic materials) or recycle (with recyclable materials) because they will know that this model is doing it for them.


Impact:

The good impact of finding a solution to the problem is that it will help with the trash sorting issue that we have and it will help reduce our global waste if this model was implemented into landfills or garbage collection companies. A bad impact is that if the solution doesn't work properly then the trash won't be sorted correctly or if there is an item that isn't in our dataset then the algorithm won't know what to do.


References:


Code:


 
 
 

Comments


bottom of page