The Story Behind My Recycling App

It first occurred to me to create this app when I was inspired by an annoying, but straightforward, observation: no one has any idea what they can and cannot recycle. I've seen friends and family members discard plastic water bottles in the garbage or deposit non-recyclables into the recycling because they didn't know what to do. This confusion is a global problem. Contamination of recyclables (placing non-recyclable items in the recycling bin) can lead to entire loads of recyclables being sent to landfills. I wanted to create something that would allow people to make better decisions about recycling, one product at a time.


What Inspired Me

The idea for this app hit me at a community clean-up event. When I was digging through stacks of garbage and recyclables, I discovered much of the so-called "recycling" to be rubbish. People were trying their best, but they just didn't know how. I thought to myself, What would be better than having an app that could automatically tell you if something can be recycled? That's when I knew that I had to develop an app that uses machine learning to identify recyclable materials and guide users on how to properly dispose of them.


What I Learned

This app development was a humongous learning experience for me. Here are some of the key takeaways:

  1. Machine Learning is Powerful but Tricky:

    • I used a Core ML model that was trained on a dataset of images of recyclables and non-recyclables. The model was difficult to train because it required a lot of clean, labeled data. I gained experience in pre-processing images and fine-tuning the model to improve its performance.
  2. Real-Time Object Detection is Hard:

    • Making real-time object detection with Vision and AVFoundation frameworks was not a cakewalk. I needed to optimize the app for mobile device performance while processing video frames in real time.
  3. User Experience Matters:

    • I wanted the app to be intuitive and simple. Designing the UI/UX taught me the importance of quality feedback (like the green and red boundaries) and making the app available to everyone.
  4. Persistence Pays Off:

    • There were some instances when I was stuck, especially while debugging the camera or ML model. However, I found that determination and experimentation are necessary to address challenges.

How I Built the Project

To bring this idea to life, I utilized various technologies such as SwiftUI and UIKit for the user interface, AVFoundation for camera functionality, and Vision for object recognition. Here's a high-level breakdown of the development process:

  1. Data Collection and Model Training:

    • I collected a dataset of images of recyclable and non-recyclable items (such as plastic, metal, paper, etc.).
    • I used Create ML to build a custom Core ML model for waste detection.
  2. Camera Integration:

    • I created an AVCaptureSession to capture live video from the device's camera.
    • I processed the frames using the Vision framework to detect objects.
  3. Object Detection and Classification:

    • The application utilizes the trained Core ML model to classify objects in real-time.
    • It displays bounding boxes around detected items and labels them as recyclable or non-recyclable.
  4. Recyclability Feedback:

    • Real-time feedback is provided by greening the screen edges (recyclable) or reddening the screen edges (not recyclable).
    • It also temporarily stops 4 seconds of non-stop detection before stopping the scan and showing a "New Scan" button.
  5. User Interface:

    • The interface is minimal and uncluttered with clear instructions and feedback.

Challenges I Faced

  1. Model Accuracy:

    • The hardest task was getting the model to accurately classify objects. Initially, it struggled to distinguish between objects that looked alike (such as plastic bottles and glass bottles). I had to preprocess the data set and retrain the model multiple times to tweak its performance.
  2. Real-Time Performance:

    • Running object detection in real time on the phone was a delicate balancing act. I had to make trade-offs between accuracy and performance to ensure the app remained snappy.
  3. Edge Cases:

    • Handling edge cases (such as low lighting or obstructed objects) was tricky. I added error handling and user prompting to help users in these situations.
  4. User Testing:

    • Getting feedback from real users was an eye-opener. Some users reported that the app was too slow, whereas others needed more detailed recycling guides. I altered the design according to their feedback.

The Impact

This project has been incredibly rewarding, offering me deep insights into app development and machine learning. More importantly, it has the potential to significantly improve recycling habits by providing users with the tools they need to make informed decisions. I envision this app evolving to include more features and reaching a wider audience, ultimately contributing to a more sustainable future. I hope this app can help reduce recycling contamination and encourage more people to recycle correctly.


Final Thoughts

Building this app reinforced my belief in technology's potential to address real-world challenges. Beyond coding, it emphasized the importance of problem-solving, design thinking, and continuous iteration. This journey has not only been about creating an app but also about contributing to a larger cause of environmental sustainability. I’m proud of what I’ve built, and I’m excited to see how it evolves in the future. If this app can help even a few people recycle more effectively, I’ll consider it a success. 🌍♻️

Built With

Share this project:

Updates