## Description

Recycletron is an AI-powered tool designed to classify trash instantly as recyclable or non-recyclable. It empowers users to make informed decisions about waste disposal, ensuring recyclables don’t end up in landfills. Recycletron is scalable globally, working seamlessly for individuals, businesses, and governments alike. By integrating gamification and educational features, Recycletron not only promotes proper waste management but also makes it engaging and rewarding for users. Whether you’re a global corporation, a developing nation, or simply looking to teach children the value of sustainability, Recycletron is here to help.

## How we built it

* Meta’s detectron2 object identification model
* Flask for backend implementation
* HTML, Javascript for frontend

“Detectron2 is Facebook AI Research's next generation library that provides state-of-the-art detection and segmentation algorithms. It is the successor of Detectron and maskrcnn-benchmark. It supports a number of computer vision research projects and production applications in Facebook.” - From Meta/Facebook GitHub README.md.

Object identification is a class of novel computer vision algorithms that uses advanced methods to find multiple objects within one image. This contrasts with traditional image classification techniques that can only put one label on an image. It does this by first learning how to “split” an image into multiple possible regions where images could exist, and then runs a Convolutional Neural Network, Swin Transformer, or other computer vision models across each region individually. Detectron2 is a library that allows users to test multiple advanced methods, already trained on enormous data of everyday household objects.
For more specifics, feel free to check out Detectron2’s detailed documentation.

## Challenges we ran into

The largest challenge was finding a class of models that would fit our use case, and being able to understand it well enough to use it. Traditional Convolutional Neural Networks would work okay, but our vision was to have a model that could take a pile of waste and determine what is recyclable and what is not; after all, in households and in recycling factories, where we hope to deploy this technology to facilitate the recycling process and incentivize individuals to recycle, there aren’t usually ways to individually separate each waste material into its own individual picture to then classify. We were able to find object identifying networks, but there are many versions, including YOLO models, R-CNN, and Weak Supervised Segmentation, and finding a codebase that had prepackaged models as well as useable modules was tough.
We also ran into challenges when we finally looked to deploy our model. Though these models are extraordinarily fast, they used lots of memory which made it tough to deploy these models through virtual servers. Since we didn't have advanced GPUs, we had to push these models through our cpus, which made them a lot slower and harder to host. We got around this by hosting our backend on one computer, pushing all the calculations from there before sending it back to the frontend for the user to view.

## Accomplishments that we're proud of

We're proud of getting a model connected to a frontend service and able to run fast inference on any image given by a user. For many of us, this is our first time working with AI models, and object identification is an exciting field still undergoing development. We're excited to have been a small part of it.

## What's next for Recycletron

We wanted to make Recycletron more gamified, so that users could log in, upload images, and be rewarded for recycling and also adding to our database of recycled items. We added a basic framework for username, password, and score storage but in the future we would like to fully develop this into a sort of game.
While deploying our model, we struggled with finding a way to host the network. Virtual machines would get overloaded with their low memory, and our computers did not have GPUs, sometimes making inference slow, especially in real-time. In the future we'd like to get a small server with a GPU to have a centralized place for users.
There are more advanced object identification models trained on over 20,000 different objects and ready-to-go. An example is the Detic model created by Facebook, which is much more robust than Detectron2. However, these models were too heavy for us to use for inference
## Inspiration

Have you ever walked up to a recycling can and wondered if you can recycle your trash. With Trash MIT, we take a picture of your item and run it through our database to check if it's recyclable.

## What it does

Trash MIT identifies what an object is using a webcam and checks it against our list of items. If it is unsure of what the item is, Trash MIT asks for user input. Over time it will collect data on what is and isn't recyclable.
Trash MIT has 2 purposes: (1) Collecting data on what people think is and isn't recyclable (2) telling people what is and isn't recyclable.
Trash MIT could easily be implemented at restaurant trash cans where there is a small known set of trash frequently thrown away. Trash MIT makes recycling fun and interactive encouraging recycling.

## How we built it

Google's cloud vision API identifies types of objects. Based on our list of recyclable objects, we then tell the user if the object is recyclable.

## Challenges we ran into

We searched around online looking for a comprehensive list of recyclable items and were unable to find one. We then realized we were going to have to create our data set ourselves.

We tried using barcodes; however, it is still hard to go from identifying an object to whether it's recyclable or not.

## Accomplishments that we're proud of

It runs!

## What we learned

How to use API's, google cloud and OpenCV.
Working in teams

## What's next for trash MIT

We have so many ideas!

### Trash MIT is missing hardware.

We would like to build a unit that could be attached to trash cans in urban areas. The unit would have a screen behind the trash to eliminate noise (during HackMIT we held a piece of paper behind items to stop the Google API from identifying items in the background).
Instead of using 'y' and 'n' to take in user input, we would place sensors on the trash can. That way we can collect data based on what people are already throwing away. We can use this data for two purposes. Reporting back to recycling authorities on whether people are actually recycling correctly and to improve our data.

### Developing the classification

We could also expand from single-stream recycling. Currently, we only identify recycling or non-recycling. We could expand so we can identify different types of recycling.
We could expand to use Machine Learning to help with the identification.
We could also contact local government for information on recycling laws in different areas.
We could improve the interface with more color to encourage more recycling.
## We got inspired by the lack of motivation household participation in local recycling programs. Many households have the ability to participate in curbside recycling and all have the ability to drop off recycling at a local recycling collection center. We thought if we provide a financial incentive or some form of gamification we could encourage users to recycle . We believe the government will assist us in this as in the long run it makes their jobs easier and costs them less money than large scale clean ups.

## What it does

The app takes pictures of garbage. Recognizes objects which are garbage, classifies it and gives users instructions on how to safely dispose or recycle the garbage and gives rewards for participating. The app also gives users the option of uploading to snapchat with captions and filters showing they recycled.

## How we built it

We built the app by using building an app and integrating various pieces together. We used various API's to help the app run smoothly such as Snapchat and Google Vision and camera kit. When we got all the necessary data we wrote the logic to classify this data with Toronto's waste database and pass back instructions to our users

## Challenges we ran into

## Accomplishments that we're proud of

We used google vision Api for the first time and properly identified objects. We also spent a great deal of time on the snap chat api so we were happy we got that to work.

## What we learned

We learned a lot about android studio and how to develop for android devices, we also significantly improved our debugging skills as android sdk came with a lot of problems , We had to refresh our memory of git and use proper version control as all four of us worked on different components and had to stay synced with each other.

## What's next for Enviro-bin

Partner with government for rewards system and have them also respond to pings from our app to pick up major garbage in location.