Inspiration

We wanted to tackle the tech cares challenge by creating something that would allow people to detect depression in someone they knew. We read plenty of articles and studies that correlate social media posts with depression and we noticed there was a reoccurring trend with them. We used this information to come up with an algorithm. All it takes is running someones Twitter handle or Instagram name and our algorithm uses Google's Natural Language Processor as well as Google's Cloud Vision API

What it does

Our Web App runs the Instagramor Twitter's statuses and pictures to come up with a depression number and this depression number is then multiplied by 100, to get a percentage. 0% meaning the user is not depressed at all and 100% means that the user is more likely to be depressed.

Formula: NOT-LIKELY-DEPRESSED = .6 ||
LIKELY-DEPRESSED = -1 ||

NOT-LIKELY-ANGRY = .80 ||
LIKELY-ANGRY = -.8 ||

NOT-LIKELY-HAPPY = -.7 ||
LIKELY-HAPPY = 1 ||

Each face recognized receives 3 face emotions. We add up those 3 values and divide by 3 to get an average of emotion. We then add to this number the Natural Language Processor sentiment onto our emotion average to achieve an final average. This final average is subject to the following scale.

Our Emotion scale : -1 = Likely Depressed || 0 = Neutral/Ambiguous || 1 = Likely Not Depressed

How I built it

We built it using a simple web page that runs a Ajax call to our python scripts. Our first python script grabs the images from Instagram and the statuses from Twitter. Our next python script runs the images and statuses against Google Clouds Vision API and Natural Language Processor. That same script then calculates a likelihood for a user to be depressed, it does this by looking for clues such as depressing tweets, or sad images the user posts on Instagram.

Challenges I ran into

We ran into some problems using Google Cloud but we eventually overcame them. We also ran into some time issues because it was difficult to complete in the 36 hours.

Accomplishments that I'm proud of

It was my first time using Google Vision and Natural Language Processing

What I learned

I learned python, Instagram and Twitter API's and how to navigate with Google Cloud.

What's next for We Care

Next we plan on submitting our app for under review for Instagram. When we are approved by Instagram we will be able to search for any user, without having them to first ask for developer permissions. Instagram has provided a update to their API recently that blocks the search for public users, unless your app is approved.

Built With

  • google-cloud-natural-language-processing
  • google-cloud-vision-api
  • instagram-api
  • python
  • twitter
Share this project:

Updates