SaveAFriend

Suicide is one of the leading causes of deaths in the world with over hundreds of thousands people affected every single year. Depression is one of the main factors that causes people to have thoughts of ending their lives. People resort to many ways to cope against the painful thoughts, whether it is seeking therapy, talking with loved ones, or writing in a journal. Unfortunately, many experience it worse enough to avoid any resources that could give them a reason they have all the reasons to live. With the world evolving into a digital-centric society. People's digital footprint, all the social media posts, photos, words, we've posted on the internet--paints a bigger picture of our lives than we realize; particularly their mental health. With billions of users using the platform everyday, there is no telling how many people reach the climax of their mental breakdown, and leave their final message to the world before they leave. AI, an revolutionary investment in technology has great potential to solve many world problems, including this one. Therefore, we decided to create a project that incorporates aspects of machine learning into an application of artificial intelligence with the means to save the thousands of people who need help.

What it does

SaveAFriend uses an innovative learning model adapted from the NPJ Digital Medicine Journal to identify suicidal ideation (SI) in an individual. All a concerned friend needs to do is enter their friend's social media handle @user and we parse through their social medias where we look for themes of SI and alerting the necessary authorities to bring help to their way. The application of the AI takes user input of specific users from common social media platforms such as Twitter, Reddit, and Facebook, and calculates the AUC (i.e. the confidence of the AI's prediction on whether or not they exhibit suicidal ideation) on each user based on their suicidal ideation, the time they posted, the amount of times they posted suicide-related prompts, and the severity of the tweet (i.e. does it show intent of suicide?). A visual is also provided to see how each post affects the the AUC graph. An AUC score of >=0.7 and a detection of suicide-related prompts in the user's tweets automatically alerts the RCMP, who can direct them to the appropriate local emergency centres and get the social media user the assistance they need . A secure log-in for the RCMP was also added for the association to access administrator control panel for information retrievement.

How we Built it

Primarily using the Cohere Natural Language Processing API Classify, we created the AI module within Python with datasets in CSV format. This handled with the inner structures of the AI and the training process to bring the AI into action. Afterwards, we integrated the back-end of the project into a mobile application. This was created with Flask and Anvil which we then brought it available onto iOS and Android using the Anvil IDE. For the inner algorithms that dealt with AUC, we worked with Python modules such as numPy and scikit for optimizing the AI's accuracy. We used Matplotlib to plot the AUC curve. We also implemented Advanced Encryption Standard (AES) algorithm (AES-256) in terms of securing our login credentials and user reports to ensure confidentiality.

Challenges

The process of training the AI to first identify suicide-related phrases was a difficult task as the ideal accuracy we expected needed more resources and datasets. The implementation of the AUC algorithm was also a challenge since there are many factors when it comes to human emotions. After all, AI can't perfectly detect whether someone is exerting symptoms of serious depression vs detecting whether prompts are suicide-related or not. We also had difficulties implementing a frequency-based algorithm to track how frequent the person has posted suicide-related prompts either consecutively or within a short timespan. Considering how complex human emotions are, we can't weed out those who post less frequent posts with SI, since they have as much of a chance of experiencing the same pain as others.

Accomplishments that we're proud of

When we got the AI to finally decipher prompts correctly, we were astounded by how the AI came to life within the little time we worked on it. Using the Cohere Classify API was rather a new experience for us, in addition to our basic knowledge of machine learning in general.

What we Learned

We worked with many different frameworks, languages, and APIs and we learned how to train AI efficiently to filter out certain terms in English on the back-end. With that component of the project, we learned how to integrate it into a suitable GUI for day to day users to interact with using front-end development. We learned about a crucial algorithm that can detect common patterns in human emotion which often lead them to commit to certain acts, which we then attempted to implement into our AI for more of an accurate identification when users input their friends.

We learned that mental health is a nuanced, complex topic. Clinical professionals (i.e. psychiatrists, psychologists, therapists) and emergency services are truly invaluable. Therefore, we hope this application can be of use for them to stop tragedies before they happen. Furthermore, we learned machines and humans can work side-by-side to navigate and learn about the complex sphere of human emotions.

What's next for Save A Friend

When the AI sprouted into a functional data filtering system, our brains also sprouted with new ideas we can implement to further improve the project in the future. This includes considering more scenarios of human emotion that would use algorithms distinct from AUC, such as dealing with frequency as previous discussed in our challenges. We could also add more to the AI and familiarize it with other aspects of ideations, whether it is homicidal or hate speech. With these additions, we can contact authorities who specialize in these areas to stop any form of digital abuse. With these ideas, more people can receive the help they need to get back on their feet and enjoy their life to the fullest.

We also want to submit to the App Store and Android Store.

Submitted for: Best Health Hack, Best Overall Hack

Share this project:

Updates