GARBADOOR: objects are inserted and scanned via webcam, then sorted into respective category
Arduino integration from back end of GarbaDoor connected to servos for rotating doors
maps, maps, maps everywhere - demo of our Smart City Trash System for GarbaDoor
GarbaDoor Website interface
GarbaDoor Dashboard for data collection and analytics
A distressed hacker hours before the deadline
One of our team members, Ray, recently visited Cambridge, MA (from Canada!) and realized that their trash cans were essentially nonexistent. The few that did exist there weren't exactly performing well enough to organize trash efficiently and conscientiously. That's why we decided to choose the focus of our project on GarbaDoor -- a smart trash can that is able to organize trash by leveraging machine learning and computer vision to classify and categorize objects in order to automate the sorting process for different types of rubbish.
GarbaDoor was inspired by our goal is to interest in building smarter cities with the power of AI, Google Cloud, and big data. In tackling one of the biggest problems in our world today -- food waste and energy conservation -- we are posed with the question of how can we not only incentivize people and systems to promote good environmental practices but also how we can create systems to automate and expedite processes.
The smart garbage can automatically detect and sort the garbage thrown into it. In doing so, this eliminates one of the biggest issues in garbage collection: recyclable garbage contamination. According to The Environmental Protection Agency, the average recycling contamination rate is 25% -- meaning that every 1 out of 4 items thrown into a recycling bin is not recyclable. The general apathy and lack of protocol towards garbage contamination drastically increases the cost of recycling during an age where we are in a global climate epidemic. According to recycleacrossamerica.org, U.S. RECYCLING IS IN A CRISIS. Nearly 1,000 recycling plants in California alone have shut down within the last two years because of recycling contamination. Our AI-influenced machine aims to solves the issue of garbage contamination with the cost of less than 100 dollars.
The name GarbaDoor was inspired from the Pokemon, Garbodor, which is closely related to trash, and who better else for the position than Garbodor!
What it does
The GarbaDoor is a smart trash can that intakes a piece of trash and is able to process it into a respective trash compartment within the bin. The apparatus uses a webcam to snap a picture of the object, and uses Google API's Machine Learning and Cloud Vision to classify the object into predefined general categories, ranking at most the top 10 classifications by the percentage of certainty. The object is classified by its most accurate classification and from that, it is categorized among one of the three disposable types of trash: compost, recyclable, or general garbage.
After GarbaDoor determines where the trash belongs, it drops the trash into the respective category using Arduino-powered servo motors to open flaps. These doors guide the object to its destination with quickly-shifting platforms. While the trash is being organized, the data from the trash is collected and stored in Google Firestore Database for data analysis. Our website hosts this data as a Dashboard interface, where users can view all past 'thrown away' items and how many have been counted. This data is visualized on our website via Google Maps API with an interactive map and graphs.
How we built it
Backend: machine learning and model training with object classification, using Google Cloud Platform's Machine Learning and Vision APIs to determine an object's type and machine learning to train the program to accurately detect other trash similar to previous results. Moreover, we connected Cloud Firestore with CRUD functionalities as new trash is being added and decided to keep track of the trash's name, category, and number of times it has been disposed. We used Flask server as our framework to quickly set up our application. After stable detection, we created Python scripts to provide Arduino connectivity.
Arduino: constructed a prototype of a smart trash can by reusing cardboard and duct tape from snack boxes from YHack. We decided to cut out compartments to house two flaps for the two servos, splitting up half and could rotate from one side to the other depending on the trash type. In fact, before the trash is guided to its correct compartment, it is judged by a camera with Google Vision in a relatively closed box.
Frontend: used ReactJS and KendoReact UI Library with Bootstrap framework to connect the backend and Firebase database to retrieve the data and display it on the webpage in real-time. We developed an interactive website for users to look through and discover interesting findings from data collected on trash from GarbaDoor with a dashboard and a map.
Challenges we ran into
An early obstacle we ran into was working with Arduinos and have it accurately rotate its servos from one side to the other. In fact, it was our first time directly working with hardware for most of us, so it was both a struggle and a learning experience. We were able to move the servo to one side, but not as well to the other side until later on through many sweat and tears. ;)
From Saturday to the end of the project at 8am Sunday morning, we had technical troubles with connecting our Python scripts to the front-end React client. Specifically, getting data to React to display onto the view was somewhat dumbfounding, as there were multiple errors with getting our data from our backend to appear on our website.
Accomplishments that we're proud of
Mainly, we are proud of the fact that we were able to use a webcam to determine an object's disposable type. However, we are also excited that we were able to construct a trash can to demo using cardboard and (a lot of) duct tape. Although the trash can isn't exactly the most appealing, we enjoyed the process of putting together the parts and connecting our Arduino/servos to it. As a team, we successfully divvied up the work and covered a solid plan for the creation and development of the software/hardware, and also coming up with a feasible business plan for future applications of GarbaDoor within IoT-connected smart cities.
What we learned
We used a lot of duct tape.
Also important: we learned how to utilize React to integrate our web application and debugging the many compilation errors. We successfully completed integration with complex hardware made from scratch (with cardboard!) and being able to transfer data to the database and back to the front-end. This overall flow was an amazing achievement for all of us.
Overall, the learning experience derived from the technical difficulties we encountered along the way, which is both a blessing and a curse. We were able to discover new technologies to implement, while arduously understand the nuances to correctly use them.
What's next for GarbaDoor
In the future, we would like to rebuild GarbaDoor using different and stronger materials since cardboard can only do so much for the vast number of trash we dispose of every day. We aim to facilitate the way we dispose our trash since forcing people to keep in mind what is garbage and what is not isn't the complete way to organize our trash.
Of course, our smart GarbaDoor cannot build a smart city with simply AI object classification. The next step for Garbador is to provide data and analysis for the city. For example, it can display a map of all the garbage cans in the city and warn the agency if a garbage can needs repair or cleaning. The city can also know where garbage cans are overfilled, thus needing more garbage cans, and where garbage cans are underused - thus can re-track the garbage cans.