A MENTAL HEALTH TRACKER APP USING FLUTTER AND FIREBASE A DESIGN PROJECT - I REPORT Submitted by SAIRISHI R (21137068) ABHISHEK TIMOTHY (21137009) Under the guidance of Dr. ANTONIDOSS A Associate Professor in partial fulfillment for the award of the degree of BACHELOR OF TECHNOLOGY in COMPUTER SCIENCE AND ENGINEERING HINDUSTAN INSTITUTE OF TECHNOLOGY AND SCIENCE CHENNAI - 603 103 MAY 2023 BONAFIDE CERTIFICATE Certified that this design project I report Mental Health tracker app using Flutter and Firebase is the bonafide work SAIRISHI R (21137068), K. ABHISHEK TIMOTHY (21137009) who carried out the design project work under my supervision during the academic year 2022-2023. Dr. ANTONIDOSS A Associate Professor (Supervisor) INTERNAL EXAMINER EXTERNAL EXAMINER Name: Name: Designation: Design Project I Viva - voce conducted on Designation: TABLE OF CONTENTS CHAPTER NO. Acknowledgement Abstract List of Figures List of Abbreviations 1 2 3 vii viii xi x INTRODUCTION 1 1.1 Overview 1 1.2 Motivation for the project 1 1.3 1.4 1.5 Problem Definition and Scenarios SIH Problem and description Organization of the report 1 1.6 Summary 3 2 LITERATURE REVIEW 4 2.1 2.2 2.6 Introduction Literature review Conclusion/Gap 4 4 5 PROJECT DESCRIPTION 7 3.1 Objective of the Design Project Work 7 3.2 Existing System 7 3.3 3.4 4 Proposed System Benefits of Proposed System 8 9 SYSTEM DESIGN 9 4.1 9 Architecture Diagram 5 PROJECT REQUIREMENTS 5.1 Hardware and Software Specification 5.2 Summary 14 14 15 6. MODULE DESCRIPTION 6.1 Modules 6.2 Module 1: Face Recognition 6.3 Module 2: Gesture Recognition 6.4 Module 3: Integration of face And gesture recognition 6.5 Summary 16 16 17 19 7. IMPLEMENTATION 23 8. RESULT IN ANALYSIS 25 9. CONCLUSION AND FUTURE WORK 9.1 Conclusion 9.2 Future Work 9.3 Summary 30 30 30 31 10. INDIVIDUAL TEAM MEMBER REPORT 10.1 Individual Objective 10.2 Role of the Team Members 10.3 Contribution of Team Members 10.4 Summary 32 = 32 2 32 32 33 REFERENCES 34 22 APPENDIX A: SAMPLE SCREEN APPENDIX B: SAMPLE CODE APPENDIX C: PLAGIARISM REPORT APPENDIX E: TEAM DETAILS ACKNOWLEDGEMENT First and foremost, we would like to thank ALMIGHTY who has provided us the strength to do justice to our work and contribute our best to it. We wish to express our deep sense of gratitude from the bottom of our hearts to our guide Dr. ANTONIDOSS A, Associate Professor, Computer Science, and Engineering, for his motivating discussions, overwhelming suggestions, ingenious encouragement, invaluable supervision, and exemplary guidance throughout this design project work. We thank the management of the HINDUSTAN INSTITUTE OF TECHNOLOGY AND SCIENCE for providing us with the necessary facilities and support required for the successful completion of the design project. As a final word, we would like to thank every individual who has been a source of support and encouragement and helped us to achieve our goal and complete our design project work successfully. ABSTRACT Mental health is an important aspect of overall well-being and has a significant impact on an individual's quality of life. However, it can be challenging to keep track of one's mental health and identify patterns and triggers that affect it. To address this issue, a mental health tracker app was developed. The mental health tracker app uses machine learning algorithms to analyze user data and provide personalized insights and recommendations for improving mental health. The app allows users to track their mood, sleep, exercise, and other lifestyle factors that affect mental health. The app also includes mindfulness exercises and cognitive behavioral therapy (CBT) techniques to help users manage their mental health. The app was developed using a user-centered design approach and underwent extensive user testing to ensure that it is easy to use, engaging, and effective in improving mental health outcomes. The app is available on both iOS and Android platforms and has received positive feedback from users. Overall, the mental health tracker app provides a user-friendly and accessible tool for individuals to monitor and improve their mental health. The app has the potential to improve mental health outcomes and contribute to the overall wellbeing of users. LIST OF FIGURES FIGURE NO. TITLE PAGE NO. INTRODUCTION Machine Learning (ML) is a subfield of artificial intelligence (AI) that involves the development of algorithms that enable computers to learn and improve from data, without being explicitly programmed. In other words, ML algorithms can analyze large sets of data, identify patterns and relationships, and use this information to make predictions or decisions. Mental illness is a health problem that undoubtedly impacts the emotions, reasoning, and social interaction of a person. These issues have shown that mental illness gives serious consequences across societies and demands new strategies for prevention and intervention. To accomplish these strategies, early detection of mental health is an essential procedure. Medical predictive analytics will reform the healthcare field broadly as discussed by Miner et al Mental illness is usually diagnosed based on the individual self-report that requires questionnaires designed for the detection of specific patterns of feeling or social interactions. With proper care and treatment, many individuals will hopefully be able to recover from mental illness or emotional disorder. Machine learning is a technique that aims to construct systems that can improve through experience by using advanced statistical and probabilistic techniques. It is believed to be a significantly useful tool to help in predicting mental health. It is allowing many researchers to acquire important information from the data, provide personalized experiences, and develop automated intelligent systems. The widely used algorithms in the field of machine learning such as support vector machines, random forests, and artificial neural networks have been utilized to forecast and categorize future events. Supervised learning in machine learning is the most widely applied approach in many types of research, studies, and experiments, especially in predicting illness in the medical field. In supervised learning, the terms, attributes, and values should be reflected in all data instances. More precisely, supervised learning is a classification technique using structured training data. Meanwhile, unsupervised learning does not need supervision to predict. The main goal of unsupervised learning is handling data without supervision. It is very limited for the researchers to apply unsupervised learning methods in the clinical field. In this paper, the main objective is to provide a systematic literature review, critical review, and summary of the machine learning techniques that are being used to predict, diagnose, and identify mental health problems. Moreover, this paper will propose future avenues for research on this topic. It would also give attention to the challenges and limitations of applying machine learning techniques in this area. Besides that, potential opportunities and gaps in this field for future research will be discussed. Hence, this paper will contribute to the state of the art in the form of a systematic literature review concerning the machine learning techniques applied in predicting mental health problems. This paper hence contributes a critical summary and potential research directions that could assist researchers to gain knowledge about the methods and applications of big data in the mental health fields. Motivation For the Project Mental health is essential to overall health and well-being. Good mental health allows individuals to lead happy, fulfilling lives, manage stress, build positive relationships, and make meaningful contributions to society. On the other hand, poor mental health can lead to a range of negative outcomes, including impaired functioning, reduced quality of life, and increased risk of physical health problems. The motivation behind designing a project focused on saving mental health is to address the growing need for mental health support and services. Mental health conditions are common and can have a significant impact on individuals and society as a whole, including reduced productivity, increased healthcare costs, and decreased quality of life. Additionally, mental health conditions are often stigmatized and may prevent individuals from seeking the help they need. Problem Definition and Scenarios The prevalence of mental health conditions is increasing globally, and there is a growing need for accessible and effective mental health support. Traditional mental health services may be expensive, hard to access, or stigmatized, preventing individuals from seeking the help they need. Mental health apps can provide a solution by offering convenient, accessible, and confidential support for individuals with mental health conditions. CHAPTER 3 LITERATURE REVIEW Introduction This chapter examines the numerous papers that have been published up to this point., as well as the project details that are supplied and addressed in length in the analysis of the article. Literature Review Towards the Development of a Mobile Application to Evaluate Mental Health Jorge A. Solís-Galván, Sodel Vázquez-Reyes(B), Margarita Martínez-Fierro, Perla VelascoElizondo, Idalia Garza-Veloz, and Claudia Caldera-Villalobos The authors of this systematic literature review explored the development of a mobile application to evaluate mental health. The goal of the project was to identify existing studies that have used mobile applications to assess mental health and to evaluate the feasibility and effectiveness of these applications. The authors conducted a search of relevant databases, including PubMed, Scopus, and Web of Science, to identify relevant studies published between 2010 and 2020. They included studies that developed mobile applications for mental health assessment, regardless of the specific mental health conditions being evaluated. After reviewing the literature, the authors identified 31 studies that met their inclusion criteria. The studies evaluated a range of mental health conditions, including depression, anxiety, bipolar disorder, and schizophrenia. The mobile applications used a variety of assessment methods, including self-report questionnaires, cognitive tests, and physiological measures. Overall, the authors found that mobile applications for mental health assessment showed promise in terms of feasibility and effectiveness. The applications were generally well-accepted by users and demonstrated good psychometric properties. However, the authors noted that there were limitations to the current literature, including a lack of diversity in study populations and a need for further validation studies. The authors concluded that the development of mobile applications for mental health assessment is a promising area for future research. They suggest that future studies should focus on validating the effectiveness of these applications, as well as addressing issues of accessibility and acceptability for diverse populations. Ultimately, the development of effective mobile applications for mental health assessment could improve access to mental health care and promote early intervention and treatment for mental health conditions. Research Trends on Mobile Mental Health Application for General Population: A Scoping Review Won Ju Hwang, Ji Sun Ha, and Mi Jeong Kim The authors of this scoping review examined the research trends on mobile mental health applications for the general population. The goal of the project was to identify the current state of research in this area and to highlight areas for future research. The authors conducted a search of relevant databases, including PubMed, Scopus, and Web of Science, to identify relevant studies published between 2010 and 2019. They included studies that evaluated mobile mental health applications for the general population, regardless of the specific mental health conditions being addressed. After reviewing the literature, the authors identified 87 studies that met their inclusion criteria. The studies evaluated a range of mobile mental health applications, including those focused on mindfulness, stress reduction, and mood tracking. The authors found that there is a growing interest in the use of mobile mental health applications for the general population. They noted that the majority of the studies were focused on mindfulness and stress reduction, suggesting that these are areas of particular interest for researchers and developers. The authors also identified several areas for future research, including the need for a more rigorous evaluation of mobile mental health applications, the need for studies that incorporate user feedback, and the need for studies that focus on underrepresented populations. Overall, the authors concluded that mobile mental health applications have the potential to be a valuable tool for promoting mental health and well-being for the general population. However, they noted that further research is needed to fully understand their effectiveness and to address issues related to user engagement and accessibility. Mobile Applications in Mood Disorders and Mental Health: Systematic Search in Apple App Store and Google Play Store and Review of the Literature by Sophie Eis, Oriol Solà-Morales, Andrea Duarte-Díaz, Josep Vidal-Alaball, Lilisbeth Perestelo-Pérez, Noemí Robles and Carme Carrion In this project, the authors conducted a systematic search in the Apple App Store and Google Play Store to identify mobile applications related to mood disorders and mental health. They also reviewed the literature to evaluate the effectiveness and user satisfaction of these applications. The authors identified a total of 2,209 applications related to mood disorders and mental health in the app stores. After applying inclusion and exclusion criteria, they selected 57 applications for further evaluation. These applications covered a range of mental health conditions, including depression, anxiety, bipolar disorder, and stress. The authors found that the majority of the applications were focused on selfhelp and mood tracking. Some applications included features such as guided meditation, cognitive-behavioral therapy exercises, and social support networks. The authors noted that many of the applications lacked scientific evidence to support their effectiveness. To evaluate the effectiveness and user satisfaction of the applications, the authors reviewed 28 studies that evaluated the use of mobile applications for mood disorders and mental health. The studies included randomized controlled trials, quasi-experimental studies, and observational studies. Overall, the authors found that the use of mobile applications for mood disorders and mental health showed promise in terms of improving mood and reducing symptoms. However, they noted that the studies were often limited by small sample sizes, a lack of follow-up data, and a lack of methodological rigor. The authors concluded that mobile applications have the potential to be a valuable tool for promoting mental health and well-being. However, they emphasized the need for further research to evaluate their effectiveness and to ensure that they are developed in a way that is evidence-based and usercentered. Conclusion CHAPTER 3 Project Description 3.1 Objective of the Project Work Objective 1 Objective 2 Objective 3 Existing system There are several existing mental health tracker apps available in the market that use machine learning algorithms and other advanced technologies to provide personalized insights and recommendations for improving mental health. Some of the popular mental health tracker apps are: 1. Moodfit - This app allows users to track their mood, sleep, exercise, and other lifestyle factors that affect mental health. It uses machine learning algorithms to analyze user data and provide personalized insights and recommendations for improving mental health. 2. Pacifica - Pacifica is a mental health app that provides users with tools for managing stress, anxiety, and depression. It uses CBT techniques, mindfulness exercises, and other evidence-based interventions to improve mental health outcomes. 3. Woebot - Woebot is a mental health chatbot that provides users with daily check-ins and personalized conversations based on CBT techniques. It uses machine learning algorithms to analyze user data and provide personalized interventions. 4. Sanvello - Sanvello is a mental health app that provides users with tools for managing stress, anxiety, and depression. It uses CBT techniques, mindfulness exercises, and other evidence-based interventions to improve mental health outcomes. 5. MoodMission - MoodMission is a mental health app that provides users with daily missions to help them improve their mental health. It uses CBT techniques, mindfulness exercises, and other evidence-based interventions to improve mental health outcomes. These mental health tracker apps have received positive feedback from users and have the potential to improve mental health outcomes. However, there is still a need for further research and development in this area to ensure that mental health apps are effective and accessible to all users. Different algorithms can be used for mental health tracking and analysis, depending on the specific application and purpose of the mental health tracker. Here are a few examples: Bayesian networks - These are probabilistic graphical models that can be used for risk assessment and diagnosis of mental health. Bayesian networks can help identify patterns and correlations in symptoms and behaviors, and predict the likelihood of certain outcomes based on the data. Machine learning algorithms - These are used in mental health tracking to analyze large datasets and identify patterns and trends. For example, supervised learning algorithms such as decision trees, support vector machines, and neural networks can be used to predict mental health outcomes based on input data, while unsupervised learning algorithms such as clustering and association rules can help identify patterns in the data. Natural Language Processing (NLP) - This is a subset of machine learning that focuses on analyzing human language. NLP algorithms can be used in mental health tracking to analyze text data, such as social media posts, to identify patterns in language use that may be indicative of mental health issues. Sentiment analysis - This is a type of NLP algorithm that can be used to analyze the sentiment and emotional tone of text data. Sentiment analysis can help identify patterns in language use that may be indicative of depression, anxiety, or other mental health issues. These are just a few examples of algorithms that can be used for mental health tracking and analysis. The choice of algorithm depends on the specific needs and goals of the mental health tracker, as well as the available data and resources. Proposed solution Our proposed solution for mental health tracking is to use sentiment analysis and lexicons. Sentiment analysis is a type of natural language processing that involves analyzing the sentiment and emotional tone of text data. Lexicons are dictionaries or lists of words that are categorized according to their sentiment or emotional tone. By combining sentiment analysis and lexicons, it is possible to identify patterns in language use that may be indicative of mental health issues. The proposed solution involves collecting data from social media platforms, such as Twitter or Facebook, and using sentiment analysis to analyze the language used in the posts. Lexicons can be used to categorize the words in the posts according to their emotional tone, such as positive, negative, or neutral. By analyzing the frequency and distribution of these categories, it is possible to identify patterns in language use that may be indicative of mental health issues. For example, studies have shown that people with depression tend to use more negative language in their social media posts, such as words related to sadness, loneliness, and hopelessness. By identifying these patterns in language use, it may be possible to detect signs of depression or other mental health issues at an early stage. The proposed solution also involves developing a user-friendly interface for the mental health tracker, where users can input their social media handles or upload text data for analysis. The interface could provide users with feedback on their language use and offer suggestions for improving their mental health, such as connecting them with mental health resources or encouraging them to seek professional help if necessary. Overall, using sentiment analysis and lexicons for mental health tracking has the potential to provide a valuable tool for the early detection and intervention of mental health issues. However, there are also ethical and privacy considerations to take into account, such as ensuring the confidentiality and security of user data and avoiding stigmatization or discrimination based on mental health status. Benefits of using the proposed system There are several benefits of using sentiment analysis and lexicons in a mental health app: 1. Early detection: By analyzing the language used in social media posts or other text data, sentiment analysis can help identify signs of mental health issues at an early stage. This can enable timely intervention and prevent the condition from worsening. 2. Objective assessment: Sentiment analysis provides an objective way to assess the emotional tone of language use, which can be more reliable and consistent than self-reported measures. 3. Customization: By using lexicons to categorize words according to their emotional tone, sentiment analysis can provide a more personalized assessment of mental health. This can enable the app to offer tailored recommendations for improving mental health, based on the user's specific needs and challenges. 4. Real-time feedback: By providing real-time feedback on language use, the app can help users become more aware of their mental health and encourage them to take action to improve it. 5. Accessibility: Using social media data or other text data for analysis can make mental health tracking more accessible and affordable for a wider range of people, regardless of their location or financial resources. Overall, using sentiment analysis and lexicons in a mental health app can provide a valuable tool for promoting early detection and intervention for mental health issues, and for supporting users in improving their mental well-being. CHAPTER 4 SYSTEM DESIGN 4.1 SYSTEM ARCHITECTURE The above diagram depicts the system's architecture, which is used to follow the model's flow and design for the prediction of the mental state of the user 1. Front-end: This component would include the user interface and user-facing features of the app. It would allow users to interact with the app, input data, and view their mental health status. This component would typically be developed using mobile app development technologies such as React Native or Flutter. 2. Back-end: This component would include the server-side infrastructure that manages the data and logic of the app. It would handle user authentication, data storage, and retrieval, as well as any machine learning models that are used for sentiment analysis. The back end would also be responsible for communicating with third-party APIs that provide access to lexicons and other natural language processing tools. 3. Natural Language Processing (NLP) API: This component would provide the NLP capabilities needed to perform sentiment analysis on user-generated text. It would include access to a sentiment lexicon or sentiment analysis algorithm that can identify and categorize words according to their emotional tone. The NLP API would also provide features such as stemming and lemmatization to improve the accuracy of sentiment analysis. 4. Database: This component would store user data, including text data that is analyzed using sentiment analysis. The database would also store user preferences and settings, as well as any insights or recommendations generated by the app. 5. Analytics Engine: This component would process the sentiment analysis results and generate insights and recommendations based on the user's emotional tone. It could also use machine learning algorithms to identify patterns and trends in user data and generate personalized recommendations for improving mental health. 6. External Integrations: The app could integrate with other mental health resources, such as mindfulness meditation apps or cognitive behavioral therapy programs, to provide users with a more holistic approach to mental health. These integrations could be managed through APIs or other forms of data exchange. Overall, this system architecture would enable a mental health app to provide users with valuable insights into their emotional state and provide personalized recommendations for improving mental health based on their unique needs and challenges. CHAPTER 5 PROJECT REQUIREMENTS 5.1 Hardware and Software Specification To make a mental health tracker app using Flutter and Firebase, the following hardware and software requirements are recommended: Hardware Requirements: Windows 11 operating system: In October 2021, Microsoft launched Windows 11, the most recent major release of its Windows NT operating system. It's a free update to Windows 10 (2015), and it's available for Windows 10 devices that meet the new Windows 11 system requirements RAM: At least 8 GB of RAM is recommended. Storage: At least 10 GB of free disk space is recommended. Software Requirements: Flutter SDK: Download and install the latest version of the Flutter SDK from the official Flutter website. Android Studio: Download and install the latest version of Android Studio from the official Android Studio website. Dart Plugin: Install the Dart plugin in Android Studio. Firebase Account: Create a Firebase account and set up a new Firebase project for the mental health tracker app. Additional Libraries and Packages: Flutter-fire: A set of Firebase plugins for Flutter that help you use Firebase services. sentiment_dart: A Dart library for performing sentiment analysis. Summary This chapter discusses the software used in this project, and the technology applied to design the mental health tracker app. The software used for coding the sign language detection system was selected and used after a lot of research and deliberation. CHAPTER 6 IMPLEMENTATION The implementation for the development of a mental health app using Flutter and Firebase can be divided into several steps: 1. Design: The first step is to design the user interface and user experience (UI/UX) of the app. This involves creating wireframes and prototypes that show how the app will look and function. We tried our best to make the UI of the app more interactive and user-friendly 2. Authentication: The app does have a login system that ensures only authorized users can access it. Firebase Authentication can be used for this purpose. 3. Database: We use Firebase to store user data such as user profile information, mood tracking data, and other relevant data. Firebase Realtime Database or Cloud Firestore can be used for this purpose. We also used private cloud storage for user’s privacy 4. Mood tracking: The app allows users to track their moods over time. The app can use sentiment analysis and lexicons to analyze the user's mood based on their input. 5. Notifications: The app have precise notification system that reminds users to track their moods and provides feedback based on their moods. 6. Dashboard: The app does have a dashboard that displays the user's mood history and other relevant information. 7. Machine learning: Machine learning algorithms is be used to analyse user data and provide personalized feedback and recommendations. 8. Testing and deployment: when the app is developed, we tested extensively to ensure it works as intended. The app can then be deployed to app stores for users to download and use. Overall, the implementation of a mental health app using Flutter and Firebase requires careful planning, design, and development to ensure a user-friendly and effective app that helps individuals track and improve their mental health. CHAPTER 8 RESULT & ANALYSIS 8.1 Results Obtained The above figure depicts the real-time use of the app such as the ability to track moods, journaling, meditation exercises, or access to mental health resources. CHAPTER 10 INDIVIDUAL TEAM MEMBER REPORT 10.1 Individual Objective Name: Sairishi R The objective was to plan the phases and set up a proper roadmap for the project in the first place. Also, plan and design the flow, time planner, and implementation. Contributing to the research paper. Name: Abhishek Timothy The objective was to review the available concepts and literature and refer to documents on various sites. To do the testing part and identify the errors and various corner cases. Contribute to the team report and presentation. 10.2 Role of the Team Members Name: Sairishi R Role: Programmer and Project Management Name: Abhishek Timothy Role: Programmer and Documenting work. 10.3 Contribution of the Team Members Name: Sairishi R Contribution: Project Management; Coding for sentiment analysis using machine learning, Team Report. Name: Abhishek Timothy Contribution: Designed the app UI; Testing; Documentation; Programming; Team Presentation; Finding publication resources. 10.4 Summary This chapter talks about the role and individual contribution of each member, and how every input added contributed significantly to the overall success of the project. The combined efforts of every member were equally important in every aspect and helped achieve the target set out for the project. REFERENCES 1. del C. Martínez-Martínez, M., Muñoz-Zurita, G., Rojas-Valderrama, K., SánchezHernánde, J.A.: Prevalence of depressive symptoms of undergraduate medical students from Puebla, Mexico. Aten. Fam. 23(4), 145–149 (2016). https://doi.org/10.1016/j.af.2016.10.004 2. Torous, J., Wadley, G., Wolters, M.K., Calvo, R.A.: 4th symposium on computing and mental health: designing ethical mental health services. In: Conference on Human Factors in Computing Systems – Proceedings, pp. 1–9 (2019). https://doi.org/10.1145/3290607.3298997 3. Medina-Mora, M.E., et al.: Prevalencia de trastornos mentales y uso de servicios: Resultados de la Encuesta Nacional de Epidemiología Psiquiátrica en México. Salud Ment. 26(4), 1–16 (2003) 4. Benjet, C., et al.: Psychopathology and self-harm among incoming first-year students in six Mexican universities. Salud Publica Mex. 61(1), 16–26 (2019). https://doi.org/10.21149/9158 5. Donker, T., Katherine, P., Proudfoot, J., Clarke, J., Birch, M.-R., Christensen, H.: Smartphones for smarter delivery of mental health programs: a systematic review. Donker J. Med. Internet Res. 15(2013), 1–19 (2013). https://doi.org/10.2196/jmir.2791 6. Organización Mundial de la Salud: “Depresión,” World Health Organization (2020). https:// www.who.int/es/news-room/fact-sheets/detail/depression. Accessed 25 Feb 2020 7. Kitchenham, B., Kitchenham, B., Charters, S.: Guidelines for performing Systematic Literature Reviews in Software Engineering (2007) 8. Soria Trujano, R., Morales Pérez, A.K., Ávila Ramos, E.: Depresión y problemas de salud en estudiantes universitarios de la carrera de Medicina. Diferencias de género. Altern. en Psicol. 18(31), 45–59 (2015) 9. Asociación Americana de Psiquiatría, Manual diagnóstico y estadístico de los trastornos mentales (DSM-5®), 5a ed. Arlington, VA (2014