Inspiration
The Great Pacific Garbage Patch is an island of accumulated debris in the Pacific Ocean. It takes up ~1.6 million square kilometers, which is twice the size of Texas, and contains 1.8 trillion pieces of plastic. A large portion comes from human trash, and unfortunately, many animals like sea turtles often misinterpret this waste as food, often leading to death. Though it is a great task to mitigate all of this waste, we can start by reducing the pollution we contribute. If we can effectively separate waste and ensure it undergoes the correct processing, we can prevent overflowing landfills and provide relief to various communities.
What it does
Nearly 25% of collected recycling is contaminated and can't be recycled, wasting entire batches of recyling. To solve this critical issue, we have designed the SimpleSort Waste Detector. The user simply takes a picture of the item and uploads it to our model to receive feedback on where the item belongs. Currently, our system judges items based off of four categories: recycle, compost, landfill, and toxic waste. Based on the answer received, the user can now discard their waste effectively, ensuring it doesn’t contribute to garbage patches in the oceans.
How we built it
First, we had to find an appropriate pre-existing dataset to train our model. After a thorough search of multiple respositories, we decided to use a publicly available dataset from Kaggle which consisted of 13k varying images. The dataset was uploaded into a Google Colab notebook and categorized into four categories (recycle, compost, landfill, and toxic) based on the Recology guidelines applied in the Bay Area. The data was then randomly split into training (70%), validation (15%), and test (15%) subsets. Once the data was cleaned, we applied augmentation and autotuning via Tensorflow to create varation in the training data and streamline the training process. The model was developed using a MobileNetV2 implementation. The MobileNetV2 model consists of an end-to-end pre-trained Convolutional Neural Network with ~155 layers. This transfer-learning approach was chosen because its architecture makes it suitable for heavy image data while having a faster processing speed. The original ImageNet head is replaced with a 4 class layer that uses raw logits (no activation function) to classify the images, which is determined by the argmax function over logits.
Challenges we ran into
We ran into many challenges while developing this model. Firstly we realized that the initial dataset we had selected was inconsistently labeled, which was creating an abundance of noise during training. However, even after switching to a different dataset, we realized that there were bad files corrupting the data, which we had to scan for and then remove. Regardless of our fine tuning efforts, including class weighting, switiching from cross entropy to focal loss, replacing the softmax activation function with raw logits, and oversampling, the F1 score of the model remained low. Ultimately, we concluded that the oversampling and focal loss were overcomplicating and overfitting the data, so we decided to keep cross entropy and focus on training with more aggressive weights.
Accomplishments that we're proud of
As ML beginners, we are extremely proud of our ability to apply transfer learning and confront the numerous errors we encountered. We dealt with corrupt zip files, infinite batches, heavily imbalanced classes, and many other issues. Despite these setbacks, we persevered and overcame the hurdles, highlighting our dedication and commitment to this project. Moreover, we developed a visually appealing and user-friendly interface to implement our model.
What we learned
We were able to scratch the surface of deep learning and computer vision via transfer learning and the TensorFlow framework. We were given the opportunity to explore optimization, which is something that is not as feasible with simpler models such as logistic regression. We were also able to create a robust and effective user interface using the streamlit library.
What's next for SortSmart Waste Detector
In the future we hope to raise the F1 and accuracy of the model by creating a more representative dataset. We believe that the class weighting did not completely alleviate the issue of imbalanced data, so we hope to train the model on more compost and toxic waste material. Additionally, we strive to expand our data bandwidth to other substances as well, such as biohazardous waste. Ultimately, our goal is to make the SortSmart Waste Detector an accessible app so that everyone can practice responsible recycling.
Built With
- google-colab
- pycharm
- python
- streamlit
- tensorflow
Log in or sign up for Devpost to join the conversation.