Inspiration

The inspiration for the CareKeys project is driven by the pressing need to address the mental health challenges faced by children and adolescents in today's digital age, where an increasing number are experiencing critical depression, self-harm, and engaging in harmful behaviors. Recognizing the gap in parental control over children's text communication, which often reflects their inner thoughts and struggles, CareKeys aims to provide a sensitive and non-intrusive solution. By analyzing the content typed by kids on their devices, this project offers parents insights into their child's emotional state, enabling early support and intervention while respecting the child's privacy. This initiative is rooted in a compassionate response to the complexities of youth mental health, leveraging technology to create a safer digital environment and empower parents to better understand and support their children's emotional well-being.

What it does

CareKeys consists of two Android applications: one is a keyboard app that captures text input and sends all text information in an encrypted format to the backend. The backend processes this text information and sends it to a custom-tuned Large Language Model (LLM), which analyzes the text and provides intensity scores for different categories. This information is then stored in a database. As soon as the information is stored, the graphs in the CareKeys parent monitoring app are updated. The monitoring app features two graphs: a bar graph that displays categories such as depression, violence, self-harm, and sexual misconduct, and another graph that presents the emotional quotient. Additionally, the app displays the overall mood of the child. The keyboard app is equipped with admin-level parental controls, ensuring that parents have the necessary oversight while respecting the child's privacy. This system provides a comprehensive and technical solution for monitoring and understanding a child's emotional well-being through text interactions.

Development Journey

Frontend (Android)

For logging the text entered by a child, we have developed a custom Android keyboard app, CareKeys, with parental control enabled through device administration. We use Retrofit for making API calls to send the text information in an encrypted format to the backend for analysis. To view the results of different categories, we have the CareKeys parent monitoring app. In this app, parents receive a push notification as soon as new data is pushed to the database. There are two types of graphs: a bar graph and an area graph, which are updated in real time. The bar graph provides information related to different categories and the intensity of each category, while the area graph shows the emotional quotient for each day. Additionally, the app displays the overall emotion of the child.

Backend (BFF)

We developed the backend using Flask and utilized MySQL as the database. When we receive the encrypted text logs from the Android application, we decrypt them and send the plaintext to the custom Large Language Model (LLM) exposed through an API. The custom-tuned LLM processes the information and returns the intensity of each category based on the provided text. This information is then stored in the database. To visualize this information, we have exposed an API that is consumed by the Android app to display the two graphs and the overall emotion of the child.

Tuning Large Language Model (LLM)

We created a custom dataset containing sample text messages to fine-tune the OpenAI gpt-3.5-turbo-1106 Large Language Model (LLM). To facilitate the tuning process, we formatted the dataset as a .jsonl file and uploaded it to the OpenAI platform. Once the LLM was fine-tuned, we exposed the API to be consumed by the Flask backend. This customized LLM is now capable of analyzing text messages and providing insights into the emotional state and potential concerns of the child, which are then processed and visualized in the CareKeys system.

Challenges we ran into

During the initial stages of our project, we encountered several challenges in collecting data and tuning the Large Language Model (LLM). One of the main difficulties was curating a diverse and representative dataset of sample text messages that accurately reflected the emotional states and behaviors we aimed to identify. Additionally, the process of fine-tuning the OpenAI gpt-3.5-turbo-1106 model presented its own set of complexities. We had to carefully format our dataset as a .jsonl file, ensuring that it met the specific requirements for the tuning process. Despite these hurdles, we were able to overcome them through diligent data collection and meticulous attention to the tuning procedure, ultimately resulting in a customized LLM that effectively supports our CareKeys system.

Laudable Accomplishments

One of the key accomplishments of our project was achieving real-time integration between the Android application, the backend, and the fine-tuned Large Language Model (LLM). This seamless integration allows for instant analysis and visualization of the child's emotional state based on their text input.

What we learnt

Through the development of CareKeys, we learned to integrate various frameworks and technologies, including connecting an Android application with a Flask backend and MySQL database. We also gained experience in integrating the OpenAI API with our system, which was crucial for utilizing the fine-tuned Large Language Model (LLM) to analyze text input. These experiences have significantly enhanced our technical skills and understanding of complex system integration.

What's next for CareKeys

  1. Provide CareKeys on iOS
  2. Provide more categories to analyze the mental health
  3. Tune the model better to accommodate more categories

Built With

Share this project:

Updates