Smart Diabetes Risk Detector

This project is a user friendly python based tool I which detects how prone any person is to diabetes based on a interactive questionaire.
Aaditya Aaditya
Grade 8

Problem

We all know that the Diabetes is a growing health concern around the world with millions of people at the risk of developing Type 2 diabetes due to lifestyle factors, genetics, bad eating habits amd unawareness.Many individuals remain undiagonosed until serious health problems arise, making early detection and risk assesment vital for prevention. 

However, existing screening methods most of the time require clinical visits, expensive tests or specialized knowledge, limiting accessibility for general public. There is a need for a user friendly option that is accessible and costeffective that can help people assess their risk level from the comfort of their homes.

The Smart Diabetes Detector aims to solve this problem by providing a diabetes tool that:

-Uses validated medical standards to estimate diabetees risk

-Provides quick feedback on BMI and overall risk

-Advises early action and preventive healthcare measures

By making diabetes risk detection more accessible, this tool helps people become aware about their health and seek medical advice before complications emerge.

Method

Method & Introduction

The Smart Diabetes Risk Detector is a python software-based tool designed to evaluate an individual's risk of developing Type 2 diabetes using the CANRISK model. It utilizes programming and data analysis to provide users with a quick, efficient and reliable diabetes risk assessment.

 

1. Programming Language Used

This project is developed using Python which is one of the most versatile and widely used programming language in the world today. 
I have used below mentioned Python libraries:
  •  Tkinter – To create the Graphical User Interface (GUI)
  •  Pandas – To store and manage data in an Excel file
  •  Messagebox (from Tkinter) – To show user alerts and error messages
I have chosen python for this project because it offers:
  •  Simplicity and easy-to-read syntax
  •  GUI support for interactive applications
  •  Data processing capabilities for score calculation and storage

2. Inputs Required for Testing

To evaluate diabetes risk, the tool requires the following user inputs:

  • Personal Details - Name, Age, Gender
  • Physical Measurements - Height ( cm ) , Weight ( kg )  ( used for BMI calculation )
  • Lifestyle & Medical History - Family history of diabetes, daily physical activity, diet, blood pressure, past high blood sugar levels


3. How the Smart Diabetes Risk Detector Works

The tool follows a structured process to calculate and display the risk level - 

Welcome Screen

 

 

 

 

 

 

 

 

Step 1: User Input Collection
The user enters their details in the GUI ( Name, Height, Weight, etc. )
The system calculates BMI automatically.

User Input Screen

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Step 2: Diabetes Risk Score Calculation
Now the software assigns scores based on answers to predefined questions.
A final risk score is computed based on validated medical guidelines

Step 3: Risk Classification & Display

The tool categorizes the user’s diabetes risk level into:

  • Low Risk ( Score ≤ 32 )
  • Moderate Risk ( Score 33 - 42 )
  • High Risk ( Score > 42 )

The result is displayed in the GUI with a message about lifestyle recommendations.

Results

 

 

 

 

 

 

 

 

 

 


 

Analysis

Step 4: Data Storage & Analysis

The results (Name, BMI, Score, Risk Level) are stored in an Notepad file with Date and Time for future reference.
Users can track changes in their risk level over time.

Results saved in Notepad with Date and Time

The CANRISK  scoring system assigns points  based on many risk factors for developing type 2 diabetes. Below is the breakdown -

CANRISK Scoring Breakdown

  1. Age:

    • 18-44 years → 0 points
    • 45-54 years → 7 points
    • 55-64 years → 13 points
    • 65-74 years → 15 points
  2. Gender at Birth:

    • Male → 6 points
    • Female → 0 points
  3. Waist Circumference (Measured at the level of the belly button):

    • Men <94 cm / Women <80 cm → 0 points
    • Men 94-102 cm / Women 80-88 cm → 4 points
    • Men >102 cm / Women >88 cm → 6 points
  4. Daily Physical Activity (at least 30 minutes of exercise per day):

    • Less than 30 minutes → 1 point
    • 30 minutes or more → 0 points
  5. Fruit and Vegetable Intake:

    • Every day → 0 points
    • Not every day → 2 points
  6. History of High Blood Pressure:

    • Yes → 4 points
    • No → 0 points
  7. History of High Blood Sugar:

    • Yes → 14 points
    • No → 0 points
  8. Family History of Diabetes:

    • Parent or Sibling has diabetes → 2 points
    • No family history → 0 points

Risk Categories Based on Total Score

  • 0-32: Low Risk
  • 33-42: Moderate Risk
  • 43+: High Risk

This scoring  system helps to assess a person's  risk of developing type 2 diabetes. 

Conclusion

Conclusion

  • Users will receive an instant risk assessment for Type 2 diabetes.
  • This tool will promote awareness and encourage users to adopt healthier lifestyles.
  • By storing data it allows for trend analysis and future improvements in risk prediction.
  • This tool doesnt require any internet to operate and thus can be used at remore locations where people have less access to health facilities.

Smart Diabetes Risk Assessment Tool uses the CANRISK Questionnaire  to determine a person's risk of Type 2 Diabetes. The tool computes the BMI (body mass index) and a total risk score using parameters that have been validated by Public Health Agency of Canada (PHAC), and it incorporates Tkinter for an intuitive graphical user interface.

Important Features 
Graphical User Interface (GUI): The application uses Python's Tkinter module to deliver a user friendly smooth experience.
Validated risk factors like age, BMI, waist circumference, lifestyle choices, and family history are all part of the CANRISK-Based Assessment.
BMI Calculation: Using the user's height and weight, the application automatically calculates their BMI.
Automated Risk Scoring: The application determines the user's overall diabetes risk score and assigns them a low, moderate, or high risk groups.
Result Logging with Timestamp: Every assessment is stored with a date and time record for tracking individual progress.

The primary benefit of this tool is its offline functionality, which makes it ideal for:

1. Surveying Classrooms and Communities: This tool enables researchers, educators, and medical professionals to conduct surveys in classrooms or communities without requiring an internet connection.

2. Monitoring Health Trends Over Time: This tool assists in monitoring progress over a repeated period of time by storing the results with timestamps. It can be used, for instance, to track changes in lifestyle and how they affect the risk of diabetes over the course of weeks or months.

3. Health & Fitness Programs: This tool can be used by organisations running health awareness campaigns to evaluate participants at the beginning and end of a program in order to gauge the effects of lifestyle modifications.

4. Corporate Wellness Surveys: Employers who prioritise employee well-being can use this tool to conduct workplace health evaluations and promote healthier lifestyle choices.

The Importance of This Project
Globally, diabetes is becoming a bigger public health issue. People can prevent or postpone the onset of diabetes by making educated lifestyle changes if their risk for the disease is identified early. This project fills the gap between self-assessment and expert medical advice by converting the CANRISK questionnaire into an interactive tool.

Technical Execution
Python libraries for programming Datetime (Timestamp logging), tkinter (GUI), and messagebox (Alerts & Notifications) were utilised.
Algorithm: To provide an accurate risk assessment, the application employs a structured point-based risk scoring system that was adapted from CANRISK.


Obstacles and Advancements
-Correct question display: Fixed by debugging list structures and making sure all questions show up as intended.
-Hosting Online: Flask or Streamlit can be used to create a web-based assessment tool in future iterations of Tkinter, which is a desktop GUI framework.
-User Experience (UX) Enhancements: To reach a wider audience, future versions may incorporate data visualisation, graphical results, and multilingual support.

Citations

CITATIONS & REFERENCES - 

https://healthycanadians.gc.ca/apps/canrisk-diabetes/index-eng.php

Diabetes Canada - https://www.diabetes.ca/resources/tools---resources/my-risk-for-developing-diabetes?

Diabetes Canada - https://www.diabetes.ca/about-diabetes

Python Downloads - https://www.python.org/downloads/

CANRISK Questionnaire - https://health.canada.ca/apps/canrisk-standalone/pdf/canrisk-en.pdf?

CANRISK Base Research - https://www.sciencedirect.com/science/article/abs/pii/S1499267109340083?

https://www.sciencedirect.com/science/article/pii/S1499267119307269?

https://www.sciencedirect.com/science/article/pii/S1499267121001799?

https://www.sciencedirect.com/science/article/pii/S1499267120300757?

CANRISK - Data Collection and Data Analysis - Canadian Journal of Diabetes - https://www.canadianjournalofdiabetes.com/article/S1499-2671%2821%2900179-9/fulltext

https://www.canadianjournalofdiabetes.com/action/showPdf?pii=S1499-2671%2821%2900179-9

Tkinter Tutorials - https://www.youtube.com/watch?v=yQSEXcf6s2I&list=PLCC34OHNcOtoC6GglhF3ncJ5rLwQrLGnV

Learn Python  - https://www.learnpython.org/

Python DateTime Logging -https://docs.python.org/3/howto/logging.html#:~:text=To%20display%20the%20date%20and,when%20this%20event%20was%20logged.

Tkinter Python Message Box - https://docs.python.org/3/library/tkinter.messagebox.html

YouTube - https://www.youtube.com/watch?v=ix9cRaBkVe0|
https://www.youtube.com/watch?v=nMXUJUOv7Qs&pp=ygUacHl0aG9uIG1lc3NhZ2Vib3ggdHV0b3JpYWw%3D

https://www.youtube.com/watch?v=S3AaSwpb5GE&pp=ygUacHl0aG9uIG1lc3NhZ2Vib3ggdHV0b3JpYWw%3D

Acknowledgement

I would like to express my gratitude to my honorable teacher Mrs. Chrissy Osicki for her support and encouragement. Her passion for science has been a great source of motivation for me. She has inspired me to explore new ideas and has given me this opportunity to participate in this science fair. 


I would also like to extend my heartfelt appreciation to my mother who contantly supported and encouraged me to make this project possible. 

 

Thank You