## Inspiration

Our team grew up in the Bay Area and Chicago, watching our beautiful cities surrounded by natural landscapes continually polluted and littered. It's heartbreaking to see the parks and streets you love trashed by people that don't seem to care. But we've all been there, you need to throw something out but don't see a waste bin for blocks in each direction. Do you wait for a bin or gently set your empty coffee cup next to the curb? No one wants to scorn the environment, it's just convenience and cities can't afford to place trash bins everywhere.

That's why we created LitterBug to help tackle cities' trash problem. LitterBug uses easily accessible and collectible data to give heat maps of where trash is concentrated in a city and gives smart suggestions such as optimizing for the shortest distance from clusters of litter to a minimized number of trash bins.

## What it does

We decided to try to attack the dirtiest city in America: New York City(travelandleisure.com). LitterBug can use data from either: a vehicle recording geotagged images for up to date images, or Google Street View static images. We used Google Cloud Maps Static API to collect images in a grid over Manhattan corresponding to the city blocks. We oriented the heading of each image to be perpendicular to the street it's on so the image faces the sidewalks. Each image is placed in a graph of nodes and edges.

The images are held in a Microsoft Azure cloud computing server and used to run image recognition for litter. This is done using tensorflow with an open-source model we found. The object detection is run on GPUs and the number of classifications (litter) is stored for that coordinate.

Finally, the map is put together with litter detections to create a heat map of litter in New York. This can be used for deploying volunteers or street cleaners as well as placing new recycling and waste bins. We created a novel algorithm that groups areas of litter into clusters, and places a small number of waste bins such as to minimize the walking distance along each street from pieces of litter to the nearest bin. This allows the municipal body to only maintenance trash bins where they are needed while reducing litter and inconvenience for residents.

## How we built it

The project has 3 major parts:

1-Transforming the map of a geofenced area into a graph model and requesting Google Street View Images along each edge

2-Setting up litter object detection of city images on a Microsoft Azure server and labeling them using GPU processing

3-Importing graph and labels into a heat map of litter and running waste bin optimization algorithms

Together, these pieces make up the pipeline that can help city governments make smart decisions on keeping their city clean.

## Challenges we ran into

1-The main issue we ran into was graphics drivers for the Azure server. Without them, running image recognition on so many images would have taken over a day.

2-Making decisions in the waste bin algorithm on how to cluster litter and balance number of bins vs quantity of litter

3-Working with Google Maps Static to save images and give them the right heading (from a 360 sphere)

## Accomplishments that we're proud of

We are super proud of the scalability of the project. Compared to looking at a few pics from Mass Ave, part of a huge city is very exciting. We are also proud of the use of cloud computing to make the image recognition easier as well as our novel waste bin optimization algorithm!

## What we learned

We learned a lot about APIs and cloud computing while working on LitterBug. It's one thing to write code in an IDE, but another altogether to implement several libraries, APIs, and hosts into an efficient pipeline. Working with API was syntactically difficult, especially when you don't fully understand the code you're working with, but in the end makes the project much more powerful.
We also learned to think big. Originally, we planned to use a dozen pictures from Mass Ave, but partway through the project we realized through Google Cloud we could run data on a whole city despite being hundred on miles away.

## What's next for LitterBug

The most important addition to make LitterBug useful is a good GUI for either geofencing and area on Google maps or importing data from a municipal vehicle that circuits the city. With Azure, it is possible for the pipeline to not expect much from the user or the user's computer.
## Inspiration

My teammate and I grew up in Bolivia, where recycling has not taken much of a hold in society unfortunately. As such, once we moved to the US and had to deal with properly throwing away the trash to the corresponding bin, we were a bit lost sometimes on how to determine which bin to use. What better way to solve this problem than creating an app that will do it for us?

## What it does

By opening EcoSnap, you can take a picture of a piece of trash using the front camera, after which the image will be processed by a machine learning algorithm that will classify the primary object and give the user an estimate of the confidence percentage and in which bin the trash should go to.

## How we built it

We decided to use Flutter to make EcoSnap because of its ability to run on multiple platforms with only one main source file. Furthermore, we also really liked its "Hot Reload" feature which allowed us to see the changes in our app instantly. After creating the basic UI and implementing image capturing capabilities, we connected to Google's Cloud Vision and OpenAI's GPT APIs. With this done, we fed Vision the image that was captured, which then returned its classification. Then, we fed this output to GPT, which told us which bin we should put it in. Once all of this information was acquired, a new screen propped up informing the user of the relevant information!

## Challenges we ran into

Given this was our first hackathon and we did not come into it with an initial idea, we spent a lot of time deciding what we should do. After coming up with the idea and deciding on using Flutter, we had to learn from 0 how to use it as well as Dart, which took also a long time. Afterwards, we had issue implementing multiple pages in our app, acquiring the right information from the APIs, feeding correct state variables, creating a visually-appealing UI, and other lesser issues.

## Accomplishments that we're proud of

This is the first app we create, a huge step towards our career in the industry and a nice project we can add to our resume. Our dedication and resilience to keep pushing and absorbing information created an experience we will never forget. It was great to learn Flutter given its extreme flexibility in front-end development. Last but not least, we are proud by our dedication to the end goal of never having to doubt whether the trash we are throwing away is going into the wrong bin.

## What we learned

We learned Flutter. We learned Dart. We learned how to implement multiple APIs into one application to provide the user with very relevant information. We learned how to read documentation. We learned how to learn a language quickly.

## What's next for EcoSnap

Hopefully, win some prizes at the Hackathon and keep developing the app for an AppStore release over Thanksgiving! Likewise, we were also thinking of connecting a hardware component in the future. Basically, it would be a tiny microprocessor connected to a tiny camera connected to an LED light/display. This hardware would be placed on top of trash bins so that people can know very quickly where to throw their trash!
## Inspiration

The issue of waste management is something that many people view as trivial yet is one of the fundamental factors that will decide the liveability of the world. Yet even in Canada, a developed country, only 9% of plastics are recycled, meaning that the equivalent of 24 CN towers of recyclable plastic enters our landfills each year. In developing nations, this is an even more serious issue that can have profound impacts on quality of life.

## What it does

Detritus AI is a smart garbage can that is able to detect and categorize waste into the respective containers and transmit essential information that allows for the optimization of garbage routes. DetritusAI tracks the quantity of waste that is in each container and communicates with the client-side applications used by garbage truck drivers to determine how full each container is. Based on the capacity of each garbage can and its location, DetritusAI calculates the optimal route for garbage trucks to collect garbage while minimizing distance and time, even taking into account traffic.

## How we built it

When users place an object near the garbage can, a time of flight sensor detects the object and triggers an image classification algorithm that identifies the category of the waste. A message is sent via Solace, which instructs the garbage can to open the appropriate lid.

Within the garbage cans, the time of flight sensors continuously determines the capacity of the bin and communicates that information via Solace to the client-side application.

Using the Google Directions API, the optimal route for garbage collection is determined by factoring in traffic, distance, and the capacity of each bin. An optimal route is displayed on the dashboard, along with turn by turn directions.

## Challenges I ran into

An issue we had was that we wanted to display a visual representation of the optimal route; however, we did not have enough time to figure out how to visually display the directions of the optimal route that we calculated.

## Accomplishments that I'm proud of

We're proud of how we were able to integrate the hardware, classification algorithm, and the dashboard into a seamless solution for waste management -- especially given the tight time constraint.

## What I learned

Communication between different components often takes more time than one might imagine. Thankfully, Solace is a very powerful tool that has resolved this issue.

## What's next for DetritusAI

1. Visually display the optimized route on the dashboard for the user
2. Add a compost category because the environment is cool.
3. Incorporate a social aspect that encourages people to recycle such as incentives or leaderboards