Fatty liver disease occurs when excess fat accumulates in the liver cells. Factors such as high-fat food consumption, alcohol intake, diabetes, and obesity contribute to this condition. A high BMI (Body Mass Index)—especially over 25—can increase the risk of fatty liver.
BMI is a widely used measurement that evaluates whether a person has a healthy weight for their height. It is calculated using the formula:
[ BMI = \frac{weight (kg)}{(height (m))^2} ]
The classification is as follows:
- Underweight: BMI < 18.5
- Normal weight: BMI 18.5 - 24.9
- Overweight: BMI 25 - 29.9
- Obese: BMI ≥ 30
Although BMI is a useful indicator, diagnosing fatty liver requires medical tests such as blood analysis and ultrasound imaging. This program provides only an estimated probability of fatty liver based on BMI.
This Python-based BMI Calculator & Fatty Liver Probability Estimator provides users with:
- A graphical user interface (GUI) built with PyQt5
- Data visualization using pyqtgraph
- BMI calculation based on user input (height & weight)
- A basic estimation of fatty liver probability and severity
- Libraries: Imports
sys,PyQt5, andpyqtgraph. - BMICalculator Class:
- Defines GUI elements (labels, input fields, buttons, graph)
- Organizes layout using
QVBoxLayout
- calculate() Method:
- Computes BMI from user input
- Determines fatty liver probability and grade
- Updates the result label and plots the BMI value
- plot_data() Method:
- Uses
pyqtgraphto display BMI graphically
- Uses
- Helper Functions:
determine_fatty_liver_prob(bmi): Estimates probabilitydetermine_fatty_liver_degree(bmi): Assigns severity grade
- Main Function:
- Runs the PyQt5 application loop
Below is an example of the program in action, displaying BMI calculations with two sample images:
This project provides a simple BMI calculator with fatty liver probability estimation. While BMI is a useful health indicator, a medical diagnosis is necessary for confirming fatty liver disease.
💡 Future Improvements: Integrating medical imaging analysis (ultrasound, CT) using AI for accurate detection.
🔹 Developed as part of CS50P 2022 🔹
📜 Certification This project is a result of my participation in the CS50P 2022 course, which I have successfully completed. My certificate can be verified at the following link:

