## Inspiration

Nowadays, large corporations are spending more and more money nowadays on digital media advertising, but their data collection tools have not been improving at the same rate. Nike spent over $3.03 billion on advertising alone in 2014, which amounted to approximately $100 per second, yet they only received a marginal increase in profits that year. This is where Scout comes in.

## What it does

Scout uses a webcam to capture facial feature data about the user. It sends this data through a facial recognition engine in Microsoft Azure's Cognitive Services to determine demographics information, such as gender and age. It also captures facial expressions throughout an Internet browsing session, say a video commercial, and applies sentiment analysis machine learning algorithms to instantaneously determine the user's emotional state at any given point during the video. This is also done through Microsoft Azure's Cognitive Services. Content publishers can then aggregate this data and analyze it later to determine which creatives were positive and which creatives generated a negative sentiment.

Scout follows an opt-in philosophy, so users must actively turn on the webcam to be a subject in Scout. We highly encourage content publishers to incentivize users to participate in Scout (something like $100/second) so that both parties can benefit from this platform.

We also take privacy very seriously! That is why photos taken through the webcam by Scout are not persisted anywhere and we do not collect any personal user information.

## How we built it

The platform is built on top of a Flask server hosted on an Ubuntu 16.04 instance in Azure's Virtual Machines service. We use nginx, uWSGI, and supervisord to run and maintain our web application. The front-end is built with Google's Materialize UI and we use Plotly for complex analytics visualization.

The facial recognition and sentiment analysis intelligence modules are from Azure's Cognitive Services suite, and we use Azure's SQL Server to persist aggregated data. We also have an Azure Chatbot Service for data analysts to quickly see insights.

## Challenges we ran into

**CORS CORS CORS!.** Cross-Origin Resource Sharing was a huge pain in the head for us. We divided the project into three main components: the Flask backend, the UI/UX visualization, and the webcam photo collection+analysis. We each developed our modules independently of each other, but when we tried to integrate them together, we ran into a huge number of CORS issues with the REST API endpoints that were on our Flask server. We were able to resolve this with a couple of extra libraries but definitely a challenge figuring out where these errors were coming from.

SSL was another issue we ran into. In 2015, Google released a new WebRTC Policy that prevented webcam's from being accessed on insecure (HTTP) sites in Chrome, with the exception of localhost. This forced us to use OpenSSL to generate self-signed certificates and reconfigure our nginx routes to serve our site over HTTPS. As one can imagine, this caused havoc for our testing suites and our original endpoints. It forced us to resift through most of the code we had already written to accommodate this change in protocol. We don't like implementing HTTPS, and neither does Flask apparently. On top of our code, we had to reconfigure the firewalls on our servers which only added more time wasted in this short hackathon.

## Accomplishments that we're proud of

We were able to multi-process our consumer application to handle the massive amount of data we were sending back to the server (2 photos taken by the webcam each second, each photo is relatively high quality and high memory).

We were also able to get our chat bot to communicate with our REST endpoints on our Flask server, so any metric in our web portal is also accessible in Messenger, Skype, Kik, or whatever messaging platform you prefer. This allows marketing analysts who are frequently on the road to easily review the emotional data on Scout's platform.

## What we learned

When you stack cups, start with a 3x3 base and stack them in inverted directions.

## What's next for Scout

You tell us! Please feel free to contact us with your ideas, questions, comments, and concerns!
## A bit about our thought process...

If you're like us, you might spend over 4 hours a day watching *Tiktok* or just browsing *Instagram*. After such a bender you generally feel pretty useless or even pretty sad as you can see everyone having so much fun while you have just been on your own.

That's why we came up with a healthy social media network, where you directly interact with other people that are going through similar problems as you so you can work together. Not only the network itself comes with tools to cultivate healthy relationships, from **sentiment analysis** to **detailed data visualization** of how much time you spend and how many people you talk to!

## What does it even do

It starts simply by pressing a button, we use **Google OATH** to take your username, email, and image. From that, we create a webpage for each user with spots for detailed analytics on how you speak to others. From there you have two options:

       **1)** You can join private discussions based around the mood that you're currently in, here you can interact completely as yourself as it is anonymous. As well if you don't like the person they dont have any way of contacting you and you can just refresh away!

       **2)** You can join group discussions about hobbies that you might have and meet interesting people that you can then send private messages too! All the discussions are also being supervised to make sure that no one is being picked on using our machine learning algorithms

## The Fun Part

Here's the fun part. The backend was a combination of **Node**, **Firebase**, **Fetch** and **Socket.io**. The ML model was hosted on **Node**, and was passed into **Socket.io**. Through over 700 lines of **Javascript** code, we were able to create multiple chat rooms and lots of different analytics.

One thing that was really annoying was storing data on both the **Firebase** and locally on **Node Js** so that we could do analytics while also sending messages at a fast rate!

There are tons of other things that we did, but as you can tell my **handwriting sucks....** So please instead watch the youtube video that we created!

## What we learned

We learned how important and powerful social communication can be. We realized that being able to talk to others, especially under a tough time during a pandemic, can make a huge positive social impact on both ourselves and others. Even when check-in with the team, we felt much better knowing that there is someone to support us. We hope to provide the same key values in Companion!
## Inspiration

Our team was inspired by how projects such as Waterloo Waterworks and forest fire maps were able to take data and give meaning to it through visualization. We were also inspired by the effect large collective data projects can have on people who feel emotionally isolated when they realize they are not alone. Finally, we were inspired by the potential of co:here's NLP API and wanted to see how we could use it to process data on a large scale to return useful and compelling conclusions.

## What it does

With the combination of these ideas, we decided to develop a program that took responses to the prompt "How are you feeling today?" and added them to a dataset. Each response was analyzed and given a sentiment score. We wanted to give meaning to our data by representing it in a visually interesting way. The data was arranged using an algorithm that graphically layered each of the responses depending on how positive or negative their sentiment was, and we also developed an algorithm that concluded the overall "vibe" of everyone's day.

## How we built it

In order to create our best work, we played to the strength of each of our team members. The backend connection and analysis algorithms were developed using Python, and the frontend was designed using Figma and implemented using JavaScript and Processing. Flask was used to bridge our front-end and back-end components together.

## Challenges we ran into

Some of the challenges that we ran into were... basically everything. We had never set up Flask on our own before and were not experienced with using Python for the back-end. We struggled to debug and combine all of our code components since we had implemented the front-end, back-end, and Flask on three different computers.

## Accomplishments that we're proud of

We're really proud of how we all learned so much from this experience and challenged ourselves out of our comfort zones. Despite a lot of hurdles and being really sleep-deprived, we persisted and continued to problem-solve until we were satisfied with what we came up with. We're really impressed with what we've created and our perseverance.

## What we learned

We learned how to use the co:here API, how to work in a team with really diverse skill sets, and how to successfully deploy a complicated web application!

## What's next for Emotivate

Human beings are hugely emotional creatures, so a web app that has access to a large group of people to accurately represent their emotions has enormous potential. We think that expanding Emotivate to the public web would be the logical next step in allowing it to create a unique value in society by allowing us to use our emotions to inform our habits.