Inspiration

MentalAI was inspired by the growing need for accessible mental health support in a fast-paced world. We recognize that many individuals face challenges in seeking help due to unaffordable mental health care, lack of access to it in the region, or stigma towards mental illness, leaving them feeling isolated or unheard. Toward creating an inclusive, friendly, and non-judgmental space where people with mental illness may share their concerns freely and get real-time feedback at little-to-no costs, MentalAI was born to mimic empathetic interactions found in therapy.

What it does

MentalAI is a conversational AI chatbot designed to engage users in supportive and empathetic dialogues. Fine-tuned on real conversations between patients seeking advice and qualified psychologists, the chatbot is able to understand emotional cues and respond in a caring manner. Specifically, MentalAI can offer constructive advice on emotional support, coping strategies, and mental health advice tailored to the user's specific situation, making mental health care more affordable, accessible, and approachable.

How we built it

We built MentalAI by fine-tuning the GPT-4o mini model on mental_health_counseling_conversations, a public dataset containing questions that cover a wide range of mental health topics and answers by qualified psychologists. To fine-tune the model, we cleaned the dataset, turned it into JSONL format, and inputted it into the OpenAI API. For the front-end, we used the NextJS framework with tailwind styling. For back-end, we used a Node server and local storage (although we plan to expand this to a database).

Challenges we ran into

  • Finding the appropriate dataset for fine-tuning: The model requires real-world conversational data to learn from, while the majority of the datasets we gathered online consist of labels rather than natural language that the model can learn from.
  • Adjusting the data fed into the fine-tuning process: Through experiments, we discovered that the model hallucinates when the model overfits on large dataset, leading to us only using a portion of the dataset.
  • Fetching calls(PUT, GET, POST) to backend from frontend: Connecting backend with frontend was difficult and time-consuming when figuring out the correct request and responses to send; mapping out how the responses were received and parsing them into usable information also proved to be challenging.

Accomplishments that we're proud of

  • Effective fine-tuning: MentalAI's responses become more professional, empathic, and constructive after the fine-tuning process.
  • Easy-to-navigate user interface: Our interface is clean and minimalistic, providing straightforward access to the chatbox service.
  • We are extremely proud of the backend we built. It efficiently handles data connection, API integrations, and asynchronous processing. The system is designed with scalability, security, and performance in mind and we plan to expand it in the future.

What we learned

  • AI can be used to create social impacts and increase the accessibility of programs that were previously unaffordable or hard to navigate, in this case mental health care
  • Fine-tuning can improve AI performance and allow it to specialize in a specific field
  • In a project, despite what we see on the surface, there are so many moving parts. Every port, connection, line of code, and syntax contributes to the whole project and it was amazing to see it all come together.
  • Alone we can do so little; together we can do so much.

What's next for MentalAI

  • Creating different models for different categories of mental health illnesses (e.g., depression, anxiety, PTSD); each model will be trained on datasets pertaining to its mental illness for it to specialize in it and provide personalized support.
  • Include image generation capability for individuals who prefer a visual form of communication (e.g., generating cartoonish pictures to cheer young users up).
  • Offer options to customize color themes, font, etc. to provide a more friendly experience for users and improve their experience.

Built With

Share this project:

Updates