## The Idea Behind the App

When you're grabbing dinner at a restaurant, how do you choose which meal to order?

Perhaps you look at the price, calorie count, or, if you're trying to be environmentally-conscious, the carbon footprint of your meal.

COyou is an Android app which reveals the carbon footprint of the meals on a restaurant menu, so that you can make the most informed choice about the food you eat.

### Why is this important?

Food production is responsible for a quarter of all greenhouse gas emissions which contribute to global warming. In particular, meat and other animal products are responsible for more than half of food-related greenhouse gas emissions. However, even among fruits and vegetables, the environmental impact of different foods varies considerably. Therefore, being able to determine the carbon footprint of what you eat can make a difference to the planet.

## How COyou Works

Using pandas, we cleaned our [carbon emissions per ingredients data](https://link.springer.com/article/10.1007/s11367-019-01597-8#Sec24) and mapped it by ingredient-emission.
We used Firebase to enable OCR, so that the app recognizes the text of the menu items. Using Google Cloud's Natural Language API, we broke each menu item name down into entities. For example:

```
     1. scrambled eggs -> "eggs",
     2. yogurt & granola -> "yogurt", "granola"

```

If an entry is found (for simpler menu items such as "apple juice"), the CO2 emission is immediately returned. Otherwise, we make an API call to USDA Food Central's database, which returns a list of ingredients for the menu item. Then, we map the ingredients to its CO2 emissions and sum the individual CO2 emissions of each ingredient in the dish. Finally, we display a list of the ingredients and the total CO2 emissions of each dish.

## The Creation of COyou

We used Android Studio, Google Firebase, Google NLP API, and an enthusiasm for food and restaurants in the creation of COyou.

## Sources and Further Reading

1. [Determining the climate impact of food for use in a climate tax—design of a consistent and transparent model](https://link.springer.com/article/10.1007/s11367-019-01597-8#Sec24)
2. [Carbon Footprint Factsheet](http://css.umich.edu/factsheets/carbon-footprint-factsheet)
3. [Climate change food calculator: What's your diet's carbon footprint?](https://www.bbc.com/news/science-environment-4645971)
4. [USDA Food Data Central API](https://fdc.nal.usda.gov/index.htm)
## Inspiration

In 2010, when Haiti was rocked by an earthquake that killed over 150,000 people, aid workers manned SMS help lines where victims could reach out for help. Even with the international humanitarian effort, there was not enough manpower to effectively handle the volume of communication. We set out to fix that.

## What it does

EmergAlert takes the place of a humanitarian volunteer at the phone lines, automating basic contact. It allows victims to request help, tell their location, place calls and messages to other people, and inform aid workers about their situation.

## How we built it

We used Mix.NLU to create a Natural Language Understanding model that categorizes and interprets text messages, paired with the Smooch API to handle SMS and Slack contact. We use FHIR to search for an individual's medical history to give more accurate advice.

## Challenges we ran into

Mentoring first time hackers was both a challenge and a joy.

## Accomplishments that we're proud of

Coming to Canada.

## What we learned

Project management is integral to a good hacking experience, as is realistic goal-setting.

## What's next for EmergAlert

Bringing more depth to the NLU responses and available actions would improve the app's helpfulness in disaster situations, and is a good next step for our group.
## Inspiration

Of all the mammals on Earth, only 4% are wild; the remaining 96% are livestock and humans. For birds only 30% are wild, the rest being chickens and poultry (Bar-On et al., 2018).

Food, Agriculture, and Land Use directly account for 24% of greenhouse gas sources, more than Transportation (14%), Industry (21%), and on par with Electricity Production (25%) (IPCC, 2014).Food accounts for up to 37% of the global greenhouse emissions and 70% of water withdrawals when taking into account all phases of production and distribution (IPCC, 2019).

A global transition towards more sustainable food will be among the most important strategies to reduce human impact on planetary resources. Many people want to do their part to reduce emissions, but they do not know where to start. Here we present the most accurate and up to date database on food carbon footprints to provide knowledge and tools that can support turning ideas into action.

## What it does

Our app informs users about their carbon footprint based on the food products that are bought from stores. Using a revolutionary dataset from Nature scientific data built using 3349 carbon footprint values extrapolated from 841 publications, we calculated the carbon footprint of specific foods based on the quantity consumed and type of food. The application takes in user input to create a shopping list with grocery items. This can be done through manual photo upload or by adding each item to a shopping list. The application automatically tries to look for similar replacement items in a person's shopping list that has a lower carbon footprint.

## How we built it

This project was built using the MERN Stack, with a splash of computer vision using OpenCV and Microsoft Azure Machine Learning and D3 for visualization. The frontend components were built using Material UI. A MongoDB database was used to store shopping lists and client data. D3, a Javascript visualization library was used to create the graph of carbon footprints per food for exploration.

## Challenges we ran into

One of the biggest challenges we ran into was trying to upload an image to be stored into a URL using React. This step was crucial to the development of our project since the use case of scanning receipts for grocery and food items relied heavily on image input and processing. We thought of different ways to try to diagnose and tackle the problem such as uploading the image onto a free image hosting service, reading the image into an array of bytes (metadata was lost), and asking a mentor for help.

Additionally, we believe that coming up with an idea that we were all passionate about was the hardest part. Brainstorming did not come easy to us since most of us did not know each other prior to the hackathon. Our entire team knew that we wanted to do something sustainability-related. We cycled through many ideas before settling on this one. We struggled with narrowing down our priorities since we had so many ideas to branch out upon. Some of the ideas that we wanted to implement (but couldn't get to) are listed in the last section of the README below.

## Accomplishments that we're proud of

We're proud of all we've done so far, from all the time spent on brainstorming to coming up with a prototype for demonstration. Our team is particularly proud of how we were able to combine our steeply different skills to create an application. Our UI was designed by a team member who has never worked on UI in the past. Deploying and running the CV algorithm was also one of the most time-consuming and messy tasks, but we are still glad that our hard work was able to be showcased.

## What we learned

There's no doubt that each of us has learned a lot from this project. Breaking it down individually,
Mei: I learned how to build and design the webpage using Material UI, along with using React to integrate GET and POST requests from the frontend to the backend.

## What's next for The Secret 37%

The first next step is to make our features work flawlessly. We had a difficult time integrating D3 with react. In addition, we want to make sure that the computer vision for converting receipts into carbon footprints works is reliable. We would also like to add more NLP so that the algorithm automatically finds the closest match for any food item (e.g. user types in Special K, the algorithm match cornflakes, the closest match in our database). As another next step, we would like the user to be able to track their monthly emissions from food by compiling all receipts/shopping lists. Finally, we would like to make this an integrated phone app as well.