4 min read
Influenza A & B: Healthcare Screening App using Machine Learning Algorithm & Rule-Based Classification for Senior Citizen
  • Python
  • Flutter
  • Machine Learning
  • Random Forest
  • FastAPI
  • Firebase
  • Mobile App Development
  • Docker

This is a Final Year Project for my Bachelor’s Degree in Computer Science at Universiti Teknologi MARA (UiTM) Shah Alam. The project aims to develop a mobile application for senior citizens to assess influenza severity at home. The application uses a machine learning algorithm and rule-based classification to detect Influenza A & B based on the user’s symptoms.

This project is personal to me as my family and I was contracted with Influenza A in March 2023 after getting back from our village in Pahang. The experience was challenging, especially for my mom, who is a single mother after my dad passed away due to accident in 2012. She became the sole breadwinner for our family, and her health is crucial for our family’s well-being; mentally and physically. I wanted to develop this application to help elders to assess their influenza severity at home and seek medical attention if necessary.

Many considerations were taken during the development of this project, mainly two things were important which is time constraints and technical constraints. The project was developed within 6 months, and I had to consider the technical constraints such as the availability of the dataset, the hyperparameter tuning that needs to be done to create the best model possible, the user interface design, and the backend development. I had to ensure that the project is feasible and can be completed within the given time frame.

The dataset was obtained from Kaggle, it’s a public dataset made by Walter Conway to differentiate the symptoms between Influenza, Common Cold, Allergy, and COVID-19. It was generated by a utility he wrote for this purpose. It contains 20 columns of symptoms and 1 column of the target variable which is the class of the disease. The dataset contains 44453 rows of data, which is sufficient for a small project like this. The dataset was preprocessed using Python and Pandas to remove any unnecessary columns and to handle any missing values. The dataset was then split into training and testing data with a ratio of 70:30. The training data was used to train the machine learning model, and the testing data was used to evaluate the performance of the model.

Initially I wanted to use a Decision Tree model for the machine learning algorithm, but after some implementation and comparison I made with other models when trained on the same data. The Random Forest model performed better than the Decision Tree model, even after multiple attempts of hyperparameter tuning. The Random Forest model was able to achieve an accuracy of 91% compared to the Decision Tree model which only achieved an accuracy of 82%. The Random Forest model was chosen as the final model for the project.

The model was then wrapped in a FastAPI application and deployed using HuggingFace Spaces on Free tier (with awesome capabilities too for a Free tier!!) by wrapping the API in Docker. I then developed the Flutter application to consume the API and display the results to the user. The Flutter application was developed with the help of Firebase for the backend and authentication. I mulled on the choices for backend between Supabase and Firebase due to the fact that Supabase is open-source and free, but I chose Firebase because of its ease of use as both Flutter and Firebase are developed by Google and because of the time constraints too. The documenation was really seamless and helpful and I was able to develop the logic in a short amount of time.

All in all, it was a great experience dabbling and learning mobile development and machine learning, got an A for FYP too so im quite content with it.