MR repo3
MR repo3
Chikkaballapur-562101
CERTIFICATE
This is to certify that, the project work carried by Prajwal Gowda C M (U19CJ22S0020),
Dheeraj C V (U19CJ22S0022), Meghana R (U19CJ22S0023), has completed sixth semester
project work entitled “Obesity Level Estimation” as a partial fulfilment for the award of
Bachelor in Computer Applications Degree, during the academic year 2024-2025 under my
supervision. It is certified that all correction/suggestions indicated for internal assessment
have been incorporated in the report deposited in the department library. The project report
has been approved as it satisfies the academic requirements in respect of project work
prescribed for the degree.
NCMS, Chikkaballapur
EXTERNAL VIVA
“Obesity Level Estimation” has been carried out by us under the supervision of internal
Dheeraj C V (U19CJ22S0022)
Meghana R (U19CJ22S0023)
ACKNOWLEDGEMENT
The completion of this project work would not have been possible without the help of the
following people and department to whom we would like to express our deepest appreciation
and gratitude.
We, wish to express our sincere gratitude to Dr. Anandamma N, Principal, Nagarjuna College
of Management Studies for her valuable support and encouragement during the course of this
project work.
We, also express our deep gratitude to Mrs. Aruna C, Head, Department of Computer
Application, for her valuable support and encouragement during the course of this project work.
We, also take this opportunity to express our profound and whole hearted thanks to our internal
guide Ms. Pramodini S P, Assistant Professor, Department of Computer Application, for her
valuable guidance and support during the course of this project work.
We, would like to express our deep gratitude to all the staff members of Nagarjuna College of
Management Studies for their valuable support and encouragement during the course of this
project work.
Last but not least, we also like to heartily thank to our parents and friends for their valuable
support and encouragement throughout the project work.
Dheeraj C V (U19CJ22S0022)
Meghana R (U19CJ22S0023)
Abstract
Obesity is a growing public health concern globally, associated with numerous chronic diseases
such as diabetes, cardiovascular conditions, and certain cancers. Accurate estimation of obesity
levels is essential for early diagnosis, personalized treatment, and preventive healthcare. This
study aims to develop a reliable framework for estimating obesity levels based on various
individual health and lifestyle parameters, including age, gender, physical activity, eating
habits, and body measurements such as Body Mass Index (BMI), waist-to-hip ratio, and body
fat percentage. Leveraging a combination of statistical analysis and machine learning
techniques, the model classifies individuals into categories such as normal weight, overweight,
and varying classes of obesity. The proposed approach demonstrates high accuracy and
robustness across diverse datasets, highlighting its potential for integration into healthcare
systems and mobile health applications for real-time monitoring and intervention. Future work
will focus on expanding the model's adaptability across different populations and incorporating
real-time data from wearable devices.
Keywords: Obesity, Obesity Level Estimation, Body Mass Index (BMI), Machine Learning,
Health Risk Assessment, Lifestyle Factors, Predictive Modeling, Body Fat Percentage, Waistto
Hip Ratio, Preventive Healthcare, Classification Algorithms, Personalized Medicine, Public
Health.
TABLE OF CONTENTS
CHAPTER I INTRODUCTION
CHAPTER II
SYSTEM REQUIREMENTS
CHAPTER III
IMPLEMENTATION
3.1 Introduction 13
CHAPTER IV
ANALYSIS AND DESIGN
CHAPTER V
CONCLUSION 43
CHAPTER VI
SNAPSHOTS 44-45
BIBLIOGRAPHY 46
LIST OF FIGURES:
CHAPTER I
INTRODUCTION
In today's digital age, the intersection of healthcare and technology continues to redefine how
individuals monitor and manage their well-being. Predictive analytics, powered by machine
learning algorithms, has emerged as a transformative tool in healthcare applications. The
Obesity Estimation App developed using Django exemplifies this integration, offering a
sophisticated platform for predicting obesity levels based on a comprehensive set of health
parameters. By leveraging Django's robust web framework and machine learning capabilities,
this application provides users with personalized health insights in a user-friendly and
accessible manner.
1.1 OBJECTIVES
To develop a reliable method for estimating an individual's obesity level based on personal,
Specific Objectives:
1. Data Collection & Preparation
o Preprocess the data: handle missing values, normalize features, and encode
categorical variables.
2. Feature Analysis
o Identify the most influential factors contributing to obesity (e.g., BMI, activity
1
NCMS 2024-25 OBESITY LEVEL ESTIMATION
3. Obesity Classification
5. Performance Evaluation
o Evaluate models using metrics like accuracy, precision, recall, F1-score, and
confusion matrix.
7. Deployment (Optional)
o Create a user-friendly interface or app for end-users to input data and receive
1.2 FEATURES
The most common and effective features grouped by type, based on health data and machine
1. Demographic Features
• Age
• Gender
• Height
• Weight
• BMI (can be calculated: weight / height²)
2. Eating Habits
• Sleep duration
• Sleep quality (self-rated or wearable data)
• Smoking habit
• Stress levels (self-reported or measured)
• Family history of obesity
• Blood pressure
• Cholesterol levels
• Blood sugar levels
• Thyroid function
7. Engineered Features
1.3.1 Purpose
The purpose of an obesity development app is to assist individuals in managing and reducing
excess body weight through personalized, data-driven interventions. These mobile applications
leverage technology to promote healthier lifestyles by offering features such as calorie tracking,
exercise monitoring, personalized meal plans, and behavioral support.
1.3.2 Scope
The scope of a project or study on obesity level estimation outlines what the project will cover,
its impact, limitations, and who will benefit from it. Here's a detailed take on the scope for this
topic especially useful if you're writing a report, thesis, or proposal.
• Use of machine learning or statistical models to classify individuals into obesity categories
• Focus on collecting or using personal health and lifestyle data (e.g., eating habits, physical
• In-depth analysis of which features (like calorie intake or physical inactivity) are most
datasets.
risk assessment.
6 Target Audience
• Helps detect individuals at risk of obesity-related diseases (e.g., diabetes, heart conditions)
3. Cost-Effective Screening
• Aggregated insights can help governments and organizations target awareness campaigns
• Encourages use of real data in health assessments, leading to more accurate and scalable
solutions.
1.4.2 Disadvantages
2. Privacy Concerns
• Handling health-related personal data requires strict privacy and ethical guidelines (e.g., HIPAA,
GDPR).
4. Overgeneralization
• Models trained on one population may not perform well on others due to cultural, genetic, or
lifestyle differences.
5. Model Bias
• Biased training data can lead to discriminatory results or unfair health risk predictions for certain
groups.
6. Behavioral Resistance
• Operating System: The application is compatible with major operating systems such as
• Python: Version 3.8 or higher is required to leverage the latest language features and libraries
• Django Framework: The application runs on the latest stable version of Django,
• SQLite Database: Included with Django, SQLite requires no separate installation and is used for
• Web Browser: The app supports modern web browsers like Google Chrome, Mozilla
Firefox, and Safari, ensuring a consistent user experience across different platforms.
• Processor: A minimum dual-core processor (e.g., Intel Core i3 or equivalent) ensures smooth
• Storage: Solid-state drives (SSDs) are preferred over traditional hard disk drives
◦ Description: Users should be able to register for an account and authenticate themselves
◦ Detailed Requirements:
2.Prediction Functionality:
◦ Description: The core functionality of the app involves predicting obesity levels based
◦ Detailed Requirements:
▪ Users input their health metrics (e.g., gender, age, height, weight, lifestyle factors).
▪ The app processes this data using machine learning algorithms to predict obesity
levels.
◦ Description: Users should be able to manage their profiles and view their prediction history
(if applicable).
◦ Detailed Requirements:
▪ Profile updates and prediction history should be securely stored and accessible only
◦ Description: Administrators should have access to a dashboard for managing user accounts
◦ Detailed Requirements:
▪ Access to view user accounts and their associated data.
and Privacy:
◦ Description: The app must ensure the security and privacy of user data and interactions.
◦ Detailed Requirements:
▪ User data (including health metrics and personal information) should be securely
1. Performance:
◦ Response Time: The app should respond to user interactions (e.g., prediction
requests) within a reasonable time frame, aiming for responses under a few
seconds.
◦ Scalability: The application should handle increasing user loads and data processing demands
2. Usability:
◦ User Interface: The user interface should be intuitive, responsive, and accessible across
◦ Ease of Use: Users should find it easy to navigate through the app and input their health
◦ Accessibility: Ensure accessibility standards are met for users with disabilities (e.g., screen
readers).
3. Security:
3rd Year BCA 11
NCMS 2024-25 OBESITY LEVEL ESTIMATION
◦ Data Encryption: User data should be encrypted both at rest and in transit to prevent
unauthorized access.
(e.g., OAuth, JWT) to verify user identities and restrict access based on roles.
◦ Secure Development: Follow best practices for secure coding and conduct regular security
audits.
4. Reliability:
◦ Availability: The app should be available and accessible to users without frequent downtime.
◦ Fault Tolerance: Implement measures (e.g., error handling, backup mechanisms) to ensure
5. Regulatory Compliance:
◦ Data Protection: Ensure compliance with relevant data protection laws and regulations
(e.g., GDPR, HIPAA) if handling personal health data.
◦ Support: Provide user support mechanisms (e.g., helpdesk, FAQs) to assist users with issues
or queries.
By adhering to these functional and non-functional requirements, the Obesity Estimation App
aims to deliver a robust, secure, and user-friendly experience for its users while supporting
efficient management and oversight by administrators.
CHAPTER III
IMPLEMENTATION
3.1 INTRODUCTION
To achieve this, a structured implementation process is followed, starting with the collection and
preprocessing of data, followed by feature selection, model training, evaluation, and
deployment. The dataset used may include variables such as age, gender, height, weight,
physical activity, eating habits, and other lifestyle indicators. These features are used to train
classification models that can estimate an individual's obesity level based on standard medical
categories such as underweight, normal weight, overweight, and various grades of obesity.
Various machine learning algorithms are employed and compared to determine the most
effective approach. Commonly used models include Logistic Regression, Decision Trees,
Random Forest, and more advanced techniques like Support Vector Machines and Neural
Networks. Model performance is evaluated using appropriate metrics such as accuracy,
precision, recall, F1-score, and confusion matrix analysis.
The final goal of the implementation is not only to create a predictive model but also to lay the
foundation for developing tools that can assist healthcare professionals, fitness coaches, and
individuals in making informed decisions about health and lifestyle. Through this approach, the
project contributes to public health efforts by promoting awareness and early intervention in the
management of obesity.
3.2.1 templates/base.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<linkrel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<style>
body {
background-color: #f8f9fa;
.navbar {
background-color: #dc3545;
.container {
margin-top: 30px;
.card-header {
background-color: #dc3545;
color: white;
.btn-danger {
background-color: #dc3545;
border-color:
#dc3545;
</style>
</head>
<body>
<li class="nav-item">
</li>
<li class="nav-item">
</li>
{% if user.is_authenticated %}
3rd Year BCA 15
NCMS 2024-25 OBESITY LEVEL ESTIMATION
<li class="nav-item">
</li>
{% else %}
<li class="nav-item">
</li>
<li class="nav-item">
</li>
{% endif %}
</ul>
</div>
</nav>
<div class="container">
</div>
</body>
</html>
3.2.2 templates/old_predictions.html
<!DOCTYPE html>
<html>
<head>
<title>Old Predictions</title>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<linkrel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<style>
.chart-container {
position: relative;
margin: auto;
height: 400px;
width: 80%;
.center-content {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
.colored-text {
color: #007bff; }
.colored-bg {
background-color: #f8f9fa;
padding: 10px;
border-radius: 5px;
margin-top: 10px;
</style>
</head>
<body>
{% if predictions %}
<ul class="list-group">
<li class="list-group-item">
Result: {{ prediction.result }}
</li>
{% endfor %}
</ul>
{% else %}
{% endif %}
</div>
<canvas id="pieChart"></canvas>
</div>
<canvas id="barChart"></canvas>
</div>
<canvas id="lineChart"></canvas>
</div>
</div>
<script> document.addEventListener('DOMContentLoaded',
function() {
datasets: [{ data:
{{ pie_values|safe
}},
backgroundColor: [
],
borderColor: [
],
borderWidth: 1
}] },
options: {
responsive: true,
plugins: {
legend: {
position: 'top', },
tooltip:
{ mode: 'index',
intersect: false,
});
type: 'bar',
data: {
datasets: [{
label: 'Value',
backgroundColor:
0.2)',
1)', borderWidth: 1
}]
},
options: {
responsive: true,
plugins: {
legend: {
position: 'top',
},
tooltip: {
mode: 'index',
intersect: false,
},
scales: {
y: {
beginAtZero: true
});
datasets: {{ line_datasets|safe }}
},
options:
responsive: true,
plugins: {
legend: {
position: 'top',
},
tooltip: {
mode: 'index',
intersect: false, }
}, scales:
{ y:
beginAtZero: true
});
});
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Old Predictions</title>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<linkrel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<style>
.chart-container {
position: relative;
margin: auto;
height: 400px;
width: 80%;
.center-content { display:
.colored-text {
color: #007bff;
.colored-bg {
background-color:#f8f9fa;
padding:10px;
borderradius:5px;
margintop: 10px;
</style>
</head>
<body>
{% if predictions %}
<ul class="list-group">
<li class="list-group-item">
Result: {{ prediction.result }}
</li>
{% endfor %}
</ul>
{% else %}
{% endif %}
</div>
<canvas id="pieChart"></canvas>
</div>
<canvas id="barChart"></canvas>
</div>
<canvas id="lineChart"></canvas>
</div>
</div>
{ var pieCtx =
document.getElementById('pieChart').getContext('2d'); var
type: 'pie',
data: {
datasets: [{
backgroundColor: [
],
borderColor: [
],
borderWidth: 1
}] }, options:
{ responsive:
true, plugins: {
legend: {
position: 'top',
},
tooltip: {
mode: 'index',
intersect: false,
});
type: 'bar',
data: {
datasets: [{
bar_values|safe }},
borderWidth: 1
}] }, options: {
responsive: true,
plugins: {
legend: {
position: 'top',
},
tooltip: {
mode: 'index',
intersect: false,
},
scales: {
y: {
beginAtZero: true
});
datasets: {{ line_datasets|safe }}
},
options: {
responsive: true,
plugins: {
legend: {
position: 'top',
}, tooltip: {
mode: 'index',
intersect: false,
}, scales: { y:
beginAtZero: true
});
});
</script>
</body>
</html>
• Integration with Wearable Devices: Collect real-time health data from wearable devices to
• User Profiles and History: Enable users to track their prediction history and monitor progress
over time.
• Multi-language Support: Extend support for multiple languages to cater to diverse user
demographics.
CHAPTER IV
ANALYSIS AND DESIGN
4.2 User
The software requirements specifications (SRS) related to users define the roles,
responsibilities, and interactions of various stakeholders who engage with the Obesity
Estimation App. These specifications ensure that user needs are met effectively and that the
application operates efficiently in line with user expectations.
User Roles:
1. General Users:
◦ Description: General users of the Obesity Estimation App include individuals seeking to
◦ Functional Requirements:
▪ Provide necessary health metrics such as gender, age, height, weight, etc.
2. Administrators:
◦ Description: Administrators oversee and manage the application, ensuring its smooth
◦ Functional Requirements:
▪ Ability to view user data, including predictions and user profile information.
User Interactions:
◦ Users can register for an account using their email address and password.
◦ Upon successful registration, users receive confirmation and can subsequently log in to the
application.
• Prediction Functionality:
◦ Users input their health metrics through a user-friendly interface provided by the app.
◦ The app processes this data using machine learning algorithms to predict obesity levels.
◦ Predictions are displayed to users in a clear and understandable format, enhancing user
experience.
• Profile Management:
◦ Registered users have access to a profile where they can view their past predictions
(if applicable).
◦ They can update their profile information, including health metrics if necessary.
Non-functional Requirements:
• Performance: The app should handle multiple concurrent user sessions efficiently, ensuring
• Usability: The user interface should be intuitive and accessible, catering to users of varying
technical proficiency.
• Security: User data, including health metrics and personal information, must be securely stored
• Scalability: The application should scale seamlessly to accommodate a growing user base and
Constraints:
• Compliance with Data Protection Regulations: The app must adhere to local and international data
• Compatibility: The app should be compatible with modern web browsers and accessible across
Assumptions:
• Users have basic knowledge of using web applications and are comfortable providing necessary
• Adequate network connectivity is assumed for users to interact with the application seamlessly.
These software requirements specifications ensure that the Obesity Estimation App meets user
expectations, provides accurate predictions, and supports effective management and oversight by
administrators. Each requirement is designed to enhance user engagement, maintain data integrity, and
deliver a reliable healthcare solution.
Components:
• Client-Side (User Interface): This includes the frontend components that users interact
with, such as forms for entering health metrics and viewing predictions. HTML
templates, styled with CSS and enhanced with JavaScript (if necessary), provide the user interface.
• Database: SQLite is used as the relational database management system (RDBMS) for
storing user data, predictions, and other application-related information. Django's ORM
(Object-Relational Mapping) simplifies database interactions.
• Machine Learning Model: Scikit-learn is employed for training and deploying machine
learning models that predict obesity levels based on user-provided health metrics. The
models are trained offline and loaded into the application using Joblib for inference.
Entities:
• Users: Individuals who interact with the app to predict their obesity levels based on health
metrics.
• External Services: Third-party services or APIs that might be integrated in the future for
Key Components:
• Web Browser: Users access the app through modern web browsers (e.g., Chrome, Firefox,
Safari).
• Obesity Estimation App: The core application developed using Django, which includes the
• Machine Learning Model: Pre-trained models stored as pickle files and loaded into the
• SQLite Database: Integrated with Django for storing user profiles, prediction history, and
• External APIs (Future Integration): Potential APIs that might be integrated for additional
Interactions:
• User Interactions: Users input their health metrics through the app's frontend interface to receive
predictions.
• Data Processing: The app processes user inputs, preprocesses data for machine learning
model compatibility, and invokes the machine learning model for prediction.
• Database Operations: Interaction with the SQLite database to store user profiles, prediction
Actors:
• User: Interacts with the system to predict obesity levels and view predictions.
Use Cases:
• Predict Obesity: Allows users to input their health metrics and receive an obesity prediction.
• View Prediction History: Users can view their past obesity predictions.
Relationships:
• Users interact directly with the system through the web interface.
• Each use case corresponds to specific user actions and functionalities provided by the app.
Here’s a simplified Sequence Diagram for the "Predict Obesity" use case:
3. Django Controller (Form Submission): Receives the request and validates user inputs.
4. Machine Learning Model: Executes to predict obesity level based on received inputs.
5. Django Controller (Response): Receives the prediction result from the model.
6. Web Browser (View): Displays the predicted obesity level to the user.
Key Elements:
• Time Flow: Shows the chronological order of interactions during the prediction process.
Participants:
- User
- Web Browser
Scenario:
1. User: Enters health metrics and submits the prediction request.
4. Django Controller: Sends data to the Machine Learning Model for prediction.
Interaction Flow:
- User initiates the process by entering health metrics and clicking the submit button.
- Web Browser sends a POST request to the Django server with entered data.
- Django Controller handles incoming request, validates inputs, and prepares data for prediction.
- Django Controller communicates with the Machine Learning Model to obtain predictions.
- Machine Learning Model processes the data and sends back the predicted obesity level.
Notes:
- Represents the interaction between different components during the prediction process.
- Shows how messages flow between User, Web Browser, Django Controller, and Machine Learning
Model.
Participants:
- User
- Web Browser
- Django Controller- Database (SQLite)
Activities:
Activity Flow:
- Shows how the user interacts with the web interface, and how Django processes and stores user data.
The results of the obesity level estimation model demonstrate strong potential for accurately
predicting individual obesity categories based on a combination of lifestyle, anthropometric,
and demographic features. Multiple machine learning algorithms were trained and evaluated,
with ensemble models such as Random Forest and XG Boost delivering the highest performance
in terms of accuracy, precision, recall, and F1-score.
These models consistently outperformed traditional classifiers, likely due to their ability to
capture complex, nonlinear relationships within the data. The evaluation process included both
a standard train-test split and k-fold cross-validation to ensure model generalizability and to
minimize overfitting. Among the different obesity levels including underweight, normal weight,
overweight levels I and II, and obesity types I, II, and III the models performed best on well
represented classes, while minor misclassifications occurred in closely related categories, such
as between overweight levels and early-stage obesity, likely due to overlapping features.
The confusion matrix and ROC-AUC analyses confirmed that the models maintained a good
balance between sensitivity and specificity across most classes. Feature importance analysis
further revealed that body mass index (BMI), daily physical activity, frequency of high-calorie
food consumption, water intake, and screen time were the most influential predictors, aligning
well with established clinical insights.
Despite the promising results, limitations such as class imbalance, potential biases in
selfreported data, and limited demographic diversity in the dataset were noted, suggesting that
additional data collection and refinement may be needed for broader deployment. In conclusion,
the evaluation indicates that the model is not only statistically robust but also interpretable,
making it a valuable tool for early obesity detection and personalized health interventions.
CHAPTER V
CONCLUSION
Throughout the development process, careful consideration was given to user experience, data
security, and system performance. The integration of machine learning models, supported by
Scikit learn and Job lib libraries, ensures reliable predictions while maintaining data integrity
through SQLite database integration.
CHAPTER VI
SNAPSHOTS
BIBLIOGRAPHY
[List all references, books, websites, and tools used during the internship.]
1. https://www.w3schools.com/html/
2. https://www.w3schools.com/css/default.asp
3. https://developer.mozilla.org/en-US/docs/Web/HTML
4. Django Documentation