iPad Home Page
Swaste Computer Vision
U.S. recycling levels are currently 21.4% (recent EPA funded Yale University Study and recycling, as a whole, is collapsing in the U.S. due to public confusion about recycling. Swaste was built as an educational tool that aimed to solve this problem by not only helping educate users what bins everyday objects belong in but also incentivizing users to continue proper waste management protocol even when not using a Swaste bin.
What it does
Swaste makes waste disposal units smart: smart waste. From the user’s perspective, after scanning an item they wish to dispose of, a swaste disposal unit will inform the user of whether the item should be considered recycle, trash, or compost. In this same moment, the Swaste disposal unit will present the user with the opportunity to dispose of their waste by opening the corresponding waste bin. After disposing of their waste, the user is presented the option to collect their “Swaste reward points” via a QR code. By collecting these points, Swaste rewards users will be subject to special deals with companies or individuals interested in partnering with eco-minded individuals.
How we built it
Swaste can be broken into a few different sections.
macApp (Swift, C for Arduino) The mac app is responsible for passing data to an arduino, which in turn powers the waste disposal servos. The mac app was necessary because of hardware limitations (Arduino did not come with a WiFi module). The mac app ties into the larger picture of the architecture in that it receives a websocket broadcasted by the iPad app (facilitated by the Node.js backend) specifying that a bin should be opened.
iPadApp (Swift) The iPad app is the primary visual interface that a casual user of Swaste would experience. Of course, the primary tech that supports Swaste lives here: the computer vision. For computer vision, we are using CoreML and running analysis on the iPad. We trained the CoreML model with images that we scraped from the web using a python program. Once we had around 5,000 images, we manually combed through the entire data set to ensure a high quality model. It communicates with both the serviceless backend via API gateway to pass store user waste disposal data, and also communicates to the mac app and the user’s phone via web sockets (QR code scanning is facilitated via web sockets).
iOSApp (Swift) The iOS app offers Swaste users insights into their waste disposal history, and subsequently the possibility for rewards. It fetches user data from the serverless backend via API Gateway, and communicates with the iPad app via websocket to establish the QR code connection.
Node.js Server The Node.js server is hosted on an EC2 instance and is backed with express. Primarily, it hosts a Socket.io server for use throughout the front-end. In addition, it hosts the Swaste website.
AWS Serverless Stack (Dynamo, Lambda, API Gateway) The serverless stack has data stored in DynamoDB. The data is manipulated by Node.js Lambda functions. Data is passed to the lambda functions via API gateway which is called from our front end stack.
Challenges we ran into
- Establishing a way to determine who the user of the Swaste disposal unit was in order to deliver reward points. At first, we wanted to enable this functionality via bluetooth proximity detection; however, after shortcomings of the iOS API, and further hardware troubles with Raspberry Pi (no monitor to connect), we were forced to abandon the idea for QR codes.
- Training/garnering data for the CoreML model
- TLS securing our domain to comply with modern websocket security standards
Accomplishments that we're proud of
- Fully functional Mac, iPad and iPhone applications
- Established sockets between iPad and iPhone and iPad and Mac
- Computer Vision using Core-ML
- AWS backend services (DynamoDB, Lambda, EC2, API-Gateway)
- Controlling servo motors using Arduino connected to Mac host
- Controlling Arduino functions through interactions on iPad application
- Webscrapping Computer Vision data with Python3 library
What we learned
- Use of external hardware (Arduino, Raspberry PI 3B, Servo)
- 3D Printing and Laser Cutting tools
- Webscrapping for images using Python3
- Integrating mulitple software ---- with hardware components in a coherent system
- Using Core-ML and Vision Kit to train a Convolutional Neural-Network based classification model
- Recycling concepts and proper waste etiqeutte
What's next for swaste
In the immediate future, Swaste plans to expand the data it trains its computer vision on in order to be able to cater to a larger variety of object classifications.
Swaste has real world application in office and urban settings. Our goal is not to replace every garbage can with Swaste. The reality is, we will always be a minority, and we embrace this fact as a key motivating factor for our vision to place small batches of units across high populated areas, thus to maximize proper waste disposal education.