Mental health is often an overlooked and stigmatized issue in many developing countries, in spite of its prevalence. In Indonesia, surveys show that at least 15% of youths aged 18 to 24 have experienced some form of mental health issue, and that 27% of the total population have reported experiencing suicidal thoughts. The Covid-19 pandemic has highlighted the urgent need for reinvestment in mental health, as altered daily routines, financial pressures, extensive social isolation and information overload continues to take its toll on mental health.
Studies do show, however, that the population has begun to take mental health seriously, with 90% of survey respondents agreeing that mental health should be given as much consideration as physical health. Nonetheless, several physical and social infrastructural weaknesses in the system exist, resulting in:
1) More than 50% of those suffering from mental health issues not seeking treatment, citing concerns that they are unsure where to get help from (Indonesia’s National health insurance program, JKN, does not cover psychological services despite high demand for it), the cost of treatments and social stigma,
2) Many mental health issues ending up getting detected and diagnosed too late, leading to poorer outcomes and increased mortality, and
3) Patients who do end up seeking professional help end up with extremely infrequent appointments, due to Indonesia’s severe shortage of licensed psychiatrists (1 psychiatrist for every 323,000 people). This leads to patients having difficulty recounting what has happened since their last appointments, and overworked providers who may have difficulty keeping track of patient records.
What it does
Psy Pal aims to mitigate these pain points found in the mental healthcare system. One feature of our solution is that it allows users to record daily data points, such as stress levels, energy levels, notes about the day, sleep quality and mood. In addition to this, we have implemented an open source computer vision model that detects heart rate (bpm) using the user’s front-facing camera.
The collected data is passed to the backend and the following processes occur:
1. Using Microsoft Azure Cognitive Services, sentiment analysis is performed on the user’s daily notes that they submit. Their notes are classified into positive, negative or neutral.
2. The rest of the data points, including stress, energy, food intake, heart rate, etc., are passed into a Machine Learning classification model hosted on MonkeyLearn. This model is trained based on datasets from https://data.humdata.org/dataset/who-data-for-indonesia. It classifies the user’s entry into one of the following 5 categories:
II. Non-specific mental distress
III. Shows some signs of mental illness, at some risk to self and/or others
IV. Shows obvious signs of mental illness, at risk to self and/or others
V. Recurrence & persistence of obvious mental illness, extreme risk to self and/or others
According to the user’s classification, our app can provide some personalized quick tips for the user to follow. These quick tips are based on information found from credible sources, including but not limited to, medical journals, website pages written by licensed psychiatrists, etc. We would like to make clear, however, that our app is not a stand-in for a psychiatrist’s diagnosis and treatment recommendation. Merely, our machine learning-based classifications gives mental health providers a general view of the user, and helps them track how their patients are progressing throughout the course of treatment. Likewise, the personalized tips are for users to obtain some short-term relief from any negative emotions they may be feeling before they can be put in touch with a provider.
Users and mental health providers alike can keep track of patient data through the Weekly Summary feature on the dashboard.
Finally, all users can quickly and easily book an appointment with a registered mental health provider through the app. Users can share their recorded data prior to their appointment for their provider to peruse. With this, providers are able to track patients’ data points more continuously between appointments, instead of having patients recount all that has happened to them since the last therapy session, where there may be room for bias, misinterpretations or forgetfulness. This results in more holistic and objective input, which providers can use to make more accurate diagnoses, assessments and recommended treatment options.
To reiterate, we hope that our solution is able to mitigate the pain points in a patient’s journey to seek treatment, by:
1) Providing them with an easy way to book appointments with mental health providers through the app,
2) Continuously collecting data points, which our machine learning model can classify to be able to detect mental health issues earlier, as studies have shown that earlier detection and intervention results in less intense treatment, reduced mortality and reduced disability, and,
3) Making it easier for patients to recount how they were feeling each day, and for overworked psychiatrists to keep track of patient records, as all of the data has been digitized and is easily accessible through the touch of a button.
How I built it
See credits below for open-source software, code and datasets that were borrowed
We have used React.JS to build the frontend of our solution. This is connected to our Node.js backend through the HTTP POST calls (REST API). We used open source templates from material UI and the structure of a more rudimentary mental health tracker(1), which we revamped to make our own web platform. This helped us cut down on development time in order to fit our work into the 36-hour timeframe we had.
Our computer vision-based heart rate detector was based off of open source code(2) that used Python openCV and machine learning libraries, to detect the user’s heart rate with 90% accuracy. We cleaned and enhanced this code to allow for the camera to measure heart rate faster and to immediately store this data.
We utilized Microsoft Azure’s Sentiment Analysis model(3) to quickly and efficiently detect sentiment (either positive, negative or neutral) from the user’s notes in the daily data points entry feature. To classify the user’s mental health status into one of the five categories listed above, we used a Support Vector Machine classifier hosted on machine learning website MonkeyLearn(4), and trained our model using cleaned datasets taken from the WHO(5). Over time, we hope to continue training our algorithm on more and more user data to continue developing its parameters and to become more effective in giving early warnings of mental illnesses.
Challenges I ran into
Accomplishments that I'm proud of
What I learned
There were a few key challenges that our team faced. Firstly, from a technical standpoint, this was the first time any of us had used React for frontend development. Along with this came all the challenges of navigating to learn a new framework. However, all of us managed to obtain a solid grasp of the basics relatively quickly, in order to code a minimalist yet functional user interface to connect to our backend.
We also found it difficult to prioritize which key features we would include in our solution so as to not be overwhelming while still highlighting our vision. Including every one of our ideas to add on as a feature would have been impossible given the time limit, and in the end we had to really get into our ‘Minimum Viable Product’ mindset to sort our proposed features based on importance, and to come up with our finalized product.
Finally, while some of our team members have done hackathons before, this was the first time any of us did a virtual one. This virtual aspect, and the fact that some of us were in different countries, posed some communication problems, something we foresaw prior to joining. A couple of methods we utilized to mitigate this issue was to have Scrum meetings every 2-3 hours to keep each other updated on what we have done, what we are doing, and any problems we are facing. We also took the time to draw up a “social contract” before starting the hackathon to outline our expectations for each other.
What's next for Psy_Pal_Mental_Health_Demo
One feature we wanted to include but did not have enough time to implement was a geolocation feature, which would allow users to input their location, as well as other details such as their insurance provider, for the app to create a shortlist of the names and locations of mental health providers in the user’s area. We hope this will aid users who may prefer face-to-face, as opposed to online, appointments, but who are still unsure of where to find help.
As a next step, we hope to partner our app with therapists and psychiatrists from local and international mental health NGOs. As one of Indonesia’s problems is the severe shortage of providers, we hope that this may bridge the gap between supply and demand, hopefully also leading to more frequent appointments between patient and provider.
Finally, we want to be able to include more data points that can be collected automatically, in addition to heart rate, which we currently have now. Devices such as FitBits and Apple Watches are already able to measure blood pressure, keep track of exercise and objectively assess sleep quality. In the future we hope to be able to include a feature that allows a user to import these kinds of data from their smart watches and devices.