0% found this document useful (0 votes)
15 views56 pages

MR repo3

The project report titled 'Obesity Level Estimation' presents a framework for estimating obesity levels using individual health and lifestyle parameters through machine learning techniques. It aims to provide accurate classifications of obesity categories, enhancing preventive healthcare and personalized treatment options. The report includes objectives, system requirements, implementation details, and acknowledges contributions from faculty and peers, fulfilling the requirements for a Bachelor of Computer Applications degree at Bengaluru North University.

Uploaded by

ameerhansufm
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views56 pages

MR repo3

The project report titled 'Obesity Level Estimation' presents a framework for estimating obesity levels using individual health and lifestyle parameters through machine learning techniques. It aims to provide accurate classifications of obesity categories, enhancing preventive healthcare and personalized treatment options. The report includes objectives, system requirements, implementation details, and acknowledges contributions from faculty and peers, fulfilling the requirements for a Bachelor of Computer Applications degree at Bengaluru North University.

Uploaded by

ameerhansufm
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 56

A PROJECT REPORT ON

“Obesity Level Estimation”


Submitted To

BENGALURU NORTH UNIVERSITY


Tamaka, Kolar-563103

In partial fulfilment of the requirement for the award of degree

BACHELOR OF COMPUTER APPLICATION


Submitted by

Prajwal Gowda C M (U19CJ22S0020)


Dheeraj C V (U19CJ22S0022)
Meghana R (U19CJ22S0023)

6th Semester BCA

Under the guidance of


Ms. Pramodini S P
Assistant Professor

Department of Computer Application

NAGARJUNA COLLEGE OF MANAGEMENT STUDIES


DEPARTMENT OF COMPUTER APPLICATION
2024-2025
NAGARJUNA COLLEGE OF MANAGEMENT STUDIES
(NAAC Accredited with B++ Grade, Affiliated to Bengaluru North University (BNU), Approved by AICTE,
Recognized by the Government of Karnataka)

Chikkaballapur-562101

Department of Computer Application

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.

Signature of Guide Signature of HOD


Ms. Pramodini S P Mrs. Aruna C

Assistant Professor Head, Dept. of BCA

Dept. of BCA NCMS, Chikkaballapur

NCMS, Chikkaballapur

EXTERNAL VIVA

Name of the Examiner Signature with date


DECLARATION
We, Prajwal Gowda C M, Dheeraj C V, Meghana R students of sixth semester BCA, NCMS,
Chikkaballapur affiliated to Bengaluru North University, bearing registration number

U19CJ22S0020, U19CJ22S0022, U19CJ22S0023, hereby declare that the project entitled

“Obesity Level Estimation” has been carried out by us under the supervision of internal

guide, Ms. Pramodini S P, Assistant Professor, Department of Computer Application,


Nagarjuna College of Management Studies Chikkaballapur, and submitted in partial fulfilment
of the requirements for the award of the degree Bachelor of Computer Applications by
Bengaluru North University during the academic year 2024-25. This report has not been
submitted to any other organization or university for the award of any degree or certificate.

Prajwal Gowda C M (U19CJ22S0020)

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.

Prajwal Gowda C M (U19CJ22S0020)

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

1.1 Objectives 1-2

1.2 Features 2-4

1.3 Purpose and Scope 5-6

1.4 Advantages and Disadvantages 6-7

CHAPTER II
SYSTEM REQUIREMENTS

2.1 Software Requirements 8

2.2 Hardware Requirements 8

2.3 Functional Requirements 8-10

2.4 Non Functional Requirements 10-12

CHAPTER III
IMPLEMENTATION

3.1 Introduction 13

3.2 Source Code 14-29

3.3 Future Work 29

CHAPTER IV
ANALYSIS AND DESIGN

4.1 Problem Analysis 31

4.2 User 31-34

4.3 System Perspective 34

4.4 Context diagram 34-36


4.5 Use Case diagram 36-37

4.6 Sequence diagram 37-38

4.7 Collabaration diagram 38-40


4.8 activity Diagram 40-41

4.9 Result and Evaluation 42

CHAPTER V
CONCLUSION 43

CHAPTER VI
SNAPSHOTS 44-45

BIBLIOGRAPHY 46
LIST OF FIGURES:

FIGURE 4.4 CONTEXT DIAGRAM 35

FIGURE 4.5 USE CASE DIAGRAM 36

FIGURE 4.6 SEQUENCE DIAGRAM 37

FIGURE 4.7 COLLABORATIONDIAGRAM 39

FIGURE 4.8 ACTIVITY DIAGRAM 41


NCMS 2024-25 OBESITY LEVEL ESTIMATION

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,

behavioral, and biometric data.

Specific Objectives:
1. Data Collection & Preparation

o Gather comprehensive data on individuals including age, gender, height, weight,

physical activity, eating habits, and medical history.

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

level, calorie intake).

o Use statistical methods or machine learning explainability tools (like SHAP or

feature importance from tree-based models).

1
NCMS 2024-25 OBESITY LEVEL ESTIMATION

3. Obesity Classification

o Define obesity levels based on standards (e.g., WHO BMI categories:

underweight, normal, overweight, obese I/II/III).

o Train classification models to predict obesity levels using input features.


4. Model Development

o Implement and compare multiple machine learning models (e.g., Logistic

Regression, Decision Trees, Random Forest, XGBoost, Neural Networks).


Optimize model performance using cross-validation and hyperparameter tuning.

5. Performance Evaluation

o Evaluate models using metrics like accuracy, precision, recall, F1-score, and

confusion matrix.

o Ensure the model is generalizable and performs well on unseen data.

6. Personalized Feedback & Risk Assessment (Optional)

o Provide users with personalized recommendations or risk levels.

o Highlight lifestyle changes that can reduce obesity risk.

7. Deployment (Optional)

o Create a user-friendly interface or app for end-users to input data and receive

obesity level predictions.

o Ensure data privacy and secure handling of user information.

1.2 FEATURES
The most common and effective features grouped by type, based on health data and machine

learning best practices:

3rd Year BCA 4


NCMS 2024-25 OBESITY LEVEL ESTIMATION

1. Demographic Features

• Age
• Gender
• Height
• Weight
• BMI (can be calculated: weight / height²)
2. Eating Habits

• Number of meals per day


• Frequent consumption of high-calorie foods
• Consumption of vegetables
• Consumption of alcohol
• Consumption of sugary drinks
• Daily water intake
• Snacking frequency
3. Physical Activity

• Frequency of physical activity per week


• Duration of physical activity per session
• Sedentary time (e.g., screen time, sitting hours)
• Daily steps (if wearable data is available)

4. Lifestyle and Health Habits

• Sleep duration
• Sleep quality (self-rated or wearable data)
• Smoking habit
• Stress levels (self-reported or measured)
• Family history of obesity

3rd Year BCA 3


NCMS 2024-25 OBESITY LEVEL ESTIMATION

5. Work & Environment

• Occupation type (sedentary, moderate, active)


• Work hours per week
• Access to healthy food (optional, if known)
6. Optional Medical Features

• Blood pressure
• Cholesterol levels
• Blood sugar levels
• Thyroid function
7. Engineered Features

• BMI category (underweight, normal, overweight, obese)


• Calories consumed vs. calories burned (if known)
• Physical activity index (e.g., total MET-minutes/week)

1.3 PURPOSE AND SCOPE

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.

1 Prediction of Obesity Levels

3rd Year BCA 4


NCMS 2024-25 OBESITY LEVEL ESTIMATION

• Use of machine learning or statistical models to classify individuals into obesity categories

(e.g., normal weight, overweight, obese I/II/III).

2 Data-Driven Health Assessment

• Focus on collecting or using personal health and lifestyle data (e.g., eating habits, physical

activity, BMI) to estimate risk levels.

3 Feature Engineering and Analysis

• In-depth analysis of which features (like calorie intake or physical inactivity) are most

predictive of obesity levels.

4 Model Building and Evaluation

• Development and comparison of multiple predictive models using real-world or synthetic

datasets.

Evaluation using accuracy, precision, recall, F1-score, and confusion matrix.

5 User-Centric Application (Optional)

• Implementation of a prototype system (web/mobile app or dashboard) for real-time obesity

risk assessment.

6 Target Audience

• Designed for use by healthcare professionals, fitness trainers, health-conscious individuals,

and public health researchers.

3rd Year BCA 5


NCMS 2024-25 OBESITY LEVEL ESTIMATION

1.4 Advantages and Disadvantages


1.4.1 Advantages

1. Early Risk Identification

• Helps detect individuals at risk of obesity-related diseases (e.g., diabetes, heart conditions)

before clinical symptoms appear.

2. Personalized Health Feedback

• Provides tailored recommendations for healthier lifestyles based on individual data.

3. Cost-Effective Screening

• Automated estimation can reduce the burden on healthcare systems by enabling

selfassessment or pre-screening tools.

4. Supports Public Health Policy

• Aggregated insights can help governments and organizations target awareness campaigns

and health interventions effectively.

5. Data-Driven Decision Making

• Encourages use of real data in health assessments, leading to more accurate and scalable

solutions.

6. Educational & Behavioral Awareness

• Raises awareness about the impact of lifestyle choices on health outcomes.

3rd Year BCA 6


NCMS 2024-25 OBESITY LEVEL ESTIMATION

1.4.2 Disadvantages

1. Data Quality Issues

• Self-reported lifestyle and dietary data can be inaccurate or biased.

• Missing or inconsistent data can reduce model accuracy.

2. Privacy Concerns
• Handling health-related personal data requires strict privacy and ethical guidelines (e.g., HIPAA,

GDPR).

3. Limited Medical Insight


• ML models can estimate risk but cannot replace medical diagnosis or detect all contributing

medical conditions (e.g., hormonal imbalance, genetic factors).

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

People may not act on recommendations or may mistrust AI-generated results.

3rd Year BCA 7


NCMS 2024-25 OBESITY LEVEL ESTIMATION

CHAPTER II SYSTEM REQUIREMENTS

2.1 Software Requirements

• Operating System: The application is compatible with major operating systems such as

Windows, macOS, and various Linux distributions, ensuring broad accessibility.

• Python: Version 3.8 or higher is required to leverage the latest language features and libraries

essential for development and deployment.

• Django Framework: The application runs on the latest stable version of Django,

incorporating its powerful features and security updates.

• SQLite Database: Included with Django, SQLite requires no separate installation and is used for

local data storage, providing reliability and ease of setup.

• Web Browser: The app supports modern web browsers like Google Chrome, Mozilla

Firefox, and Safari, ensuring a consistent user experience across different platforms.

2.2 Hardware Requirements

• Processor: A minimum dual-core processor (e.g., Intel Core i3 or equivalent) ensures smooth

execution of computational tasks required by the application.

• Memory: A minimum of 4 GB RAM is recommended to handle concurrent user sessions

and data processing efficiently.

• Storage: Solid-state drives (SSDs) are preferred over traditional hard disk drives

(HDDs) for faster data access and improved application responsiveness.

3rd Year BCA 8


NCMS 2024-25 OBESITY LEVEL ESTIMATION

2.3 Functional Requirements


Functional requirements describe the specific functionalities or features that the Obesity
Estimation App must provide to its users. These requirements outline what the system should
do in terms of specific behaviors and actions.

1.User Registration and Authentication:

◦ Description: Users should be able to register for an account and authenticate themselves

to access the app's functionalities.

◦ Detailed Requirements:

▪ Users can register using their email address and password.

▪ Upon registration, users receive a confirmation email (if implemented).

▪ Users can log in securely using their credentials.

▪ Password reset functionality should be available for users.

2.Prediction Functionality:

◦ Description: The core functionality of the app involves predicting obesity levels based

on user-provided health metrics.

◦ 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.

3rd Year BCA 9


NCMS 2024-25 OBESITY LEVEL ESTIMATION

▪ Predictions are displayed to users in a clear and understandable format.


▪ Optionally, users can view their prediction history if logged in.

3.User Profile Management:

◦ Description: Users should be able to manage their profiles and view their prediction history

(if applicable).

◦ Detailed Requirements:

▪ Users can update their profile information, including health metrics.

▪ They can view a history of their previous predictions.

▪ Profile updates and prediction history should be securely stored and accessible only

to the respective user.

4.Administrator Dashboard (if applicable):

◦ Description: Administrators should have access to a dashboard for managing user accounts

and monitoring application health.

◦ Detailed Requirements:
▪ Access to view user accounts and their associated data.

▪ Ability to modify user information or delete user accounts if necessary.

▪ Monitor application performance metrics (optional). 5.Security

and Privacy:

◦ Description: The app must ensure the security and privacy of user data and interactions.

◦ Detailed Requirements:

3rd Year BCA 10


NCMS 2024-25 OBESITY LEVEL ESTIMATION

▪ User data (including health metrics and personal information) should be securely

stored and transmitted using encryption protocols.

▪ Compliance with data protection regulations (e.g., GDPR, HIPAA) if applicable.

▪ Implement measures to prevent unauthorized access and data breaches.

2.4 Non Functional Requirements


Non-functional requirements define the quality attributes or constraints that the Obesity
Estimation App must satisfy. These requirements focus on aspects such as performance,
usability, security, and scalability.

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

without significant degradation in performance.

◦ Concurrency: Support multiple concurrent user sessions efficiently.

2. Usability:
◦ User Interface: The user interface should be intuitive, responsive, and accessible across

different devices (desktops, tablets, mobile phones).

◦ Ease of Use: Users should find it easy to navigate through the app and input their health

metrics for predictions.

◦ 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.

◦ Authentication and Authorization: Implement secure authentication mechanisms

(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

the app continues to function in case of failures.

5. Regulatory Compliance:
◦ Data Protection: Ensure compliance with relevant data protection laws and regulations
(e.g., GDPR, HIPAA) if handling personal health data.

6. Maintenance and Support:


◦ Documentation: Maintain comprehensive documentation for the app's functionalities, APIs,

and deployment procedures.

◦ 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.

3rd Year BCA 12


NCMS 2024-25 OBESITY LEVEL ESTIMATION

CHAPTER III
IMPLEMENTATION

3.1 INTRODUCTION

The implementation of obesity level estimation involves the development of a data-driven


system capable of predicting an individual's obesity category based on personal, behavioral, and
physiological factors. This system leverages machine learning techniques to analyze patterns in
lifestyle and health data, aiming to provide an efficient and scalable method for early detection
and risk assessment of obesity.

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.

3rd Year BCA 13


NCMS 2024-25 OBESITY LEVEL ESTIMATION

3.2 SOURCE CODE

3.2.1 templates/base.html

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<title>{% block title %}Obesity Estimation{% endblock %}</title>

<linkrel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">

<style>

body {

background-color: #f8f9fa;

.navbar {

background-color: #dc3545;

.navbar-brand, .nav-link, .btn {

color: #fff !important;

.container {

margin-top: 30px;

3rd Year BCA 14


NCMS 2024-25 OBESITY LEVEL ESTIMATION

.card-header {

background-color: #dc3545;

color: white;

.btn-danger {

background-color: #dc3545;

border-color:

#dc3545;

</style>

</head>

<body>

<nav class="navbar navbar-expand-lg">

<a class="navbar-brand" href="{% url 'home' %}">Obesity Estimation</a>

<div class="collapse navbar-collapse">

<ul class="navbar-nav ml-auto">

<li class="nav-item">

<a class="nav-link" href="{% url 'prediction' %}">Predict</a>

</li>

<li class="nav-item">

<a class="nav-link" href="{% url 'old_predictions' %}">Previous Predictions</a>

</li>

{% if user.is_authenticated %}
3rd Year BCA 15
NCMS 2024-25 OBESITY LEVEL ESTIMATION

<li class="nav-item">

<a class="nav-link" href="{% url 'logout' %}">Logout</a>

</li>

{% else %}

<li class="nav-item">

<a class="nav-link" href="{% url 'login' %}">Login</a>

</li>

<li class="nav-item">

<a class="nav-link" href="{% url 'register' %}">Register</a>

</li>

{% endif %}

</ul>

</div>

</nav>

<div class="container">

{% block content %}{% endblock %}

</div>

</body>

</html>

3.2.2 templates/old_predictions.html

<!DOCTYPE html>

3rd Year BCA 16


NCMS 2024-25 OBESITY LEVEL ESTIMATION

<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;

3rd Year BCA 17


NCMS 2024-25 OBESITY LEVEL ESTIMATION

border-radius: 5px;

margin-top: 10px;

</style>

</head>

<body>

<div class="container mt-5">

<h1 class="text-center colored-text">Old Predictions</h1>

<div class="col-md-8 offset-md-2 mt-5">

{% if predictions %}

<ul class="list-group">

{% for prediction in predictions %}

<li class="list-group-item">

<strong>{{ prediction.timestamp }}</strong> -

Gender: {{ prediction.gender }},

Age: {{ prediction.age }},

Height: {{ prediction.height }},

Weight: {{ prediction.weight }},

Result: {{ prediction.result }}

</li>

{% endfor %}

</ul>

{% else %}

3rd Year BCA 18


NCMS 2024-25 OBESITY LEVEL ESTIMATION

<p class="text-center">No predictions found.</p>

{% endif %}

</div>

<div class="chart-container mt-5">

<h2 class="text-center colored-text">Pie Chart</h2>

<canvas id="pieChart"></canvas>

</div>

<div class="chart-container mt-5">

<h2 class="text-center colored-text">Bar Chart</h2>

<canvas id="barChart"></canvas>

</div>

<div class="chart-container mt-5">

<h2 class="text-center colored-text">Line Chart</h2>

<canvas id="lineChart"></canvas>

</div>

</div>

<script> document.addEventListener('DOMContentLoaded',

function() {

var pieCtx = document.getElementById('pieChart').getContext('2d');

var pieChart = new Chart(pieCtx, { type: 'pie', data: {

labels: {{ pie_labels|safe }},

3rd Year BCA 19


NCMS 2024-25 OBESITY LEVEL ESTIMATION

datasets: [{ data:

{{ pie_values|safe

}},

backgroundColor: [

'rgba(255, 99, 132, 0.2)',

'rgba(54, 162, 235, 0.2)',

'rgba(255, 206, 86, 0.2)',

'rgba(75, 192, 192, 0.2)',

'rgba(153, 102, 255, 0.2)',

'rgba(255, 159, 64, 0.2)'

],

borderColor: [

'rgba(255, 99, 132, 1)',

'rgba(54, 162, 235, 1)',

'rgba(255, 206, 86, 1)',

'rgba(75, 192, 192, 1)',

'rgba(153, 102, 255, 1)',

'rgba(255, 159, 64, 1)'

],

borderWidth: 1

}] },

options: {

3rd Year BCA 20


NCMS 2024-25 OBESITY LEVEL ESTIMATION

responsive: true,

plugins: {

legend: {

position: 'top', },

tooltip:

{ mode: 'index',

intersect: false,

});

var barCtx = document.getElementById('barChart').getContext('2d');

var barChart = new Chart(barCtx, {

type: 'bar',

data: {

labels: {{ bar_labels|safe }},

datasets: [{

label: 'Value',

data: {{ bar_values|safe }},

backgroundColor:

'rgba(153, 102, 255,

0.2)',

3rd Year BCA 21


NCMS 2024-25 OBESITY LEVEL ESTIMATION

borderColor: 'rgba(153, 102, 255,

1)', borderWidth: 1

}]

},

options: {

responsive: true,

plugins: {

legend: {

position: 'top',

},

tooltip: {

mode: 'index',

intersect: false,

},

scales: {

y: {

beginAtZero: true

});

var lineCtx = document.getElementById('lineChart').getContext('2d');


3rd Year BCA 22
NCMS 2024-25 OBESITY LEVEL ESTIMATION

var lineChart = new Chart(lineCtx, {

type: 'line', data: {

labels: {{ line_labels|safe }},

datasets: {{ line_datasets|safe }}

},

options:

responsive: true,

plugins: {

legend: {

position: 'top',

},

tooltip: {

mode: 'index',

intersect: false, }

}, scales:

{ y:

beginAtZero: true

});

3rd Year BCA 23


NCMS 2024-25 OBESITY LEVEL ESTIMATION

});

</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:

flex; justifycontent: center; align-items:

center; flex-direction: column;

.colored-text {

3rd Year BCA 24


NCMS 2024-25 OBESITY LEVEL ESTIMATION

color: #007bff;

.colored-bg {

background-color:#f8f9fa;

padding:10px;

borderradius:5px;

margintop: 10px;

</style>

</head>

<body>

<div class="container mt-5">

<h1 class="text-center colored-text">Old Predictions</h1>

<div class="col-md-8 offset-md-2 mt-5">

{% if predictions %}

<ul class="list-group">

{% for prediction in predictions %}

<li class="list-group-item">

<strong>{{ prediction.timestamp }}</strong> -

Gender: {{ prediction.gender }},

Age: {{ prediction.age }},

Height: {{ prediction.height }},

3rd Year BCA 25


NCMS 2024-25 OBESITY LEVEL ESTIMATION

Weight: {{ prediction.weight }},

Result: {{ prediction.result }}

</li>

{% endfor %}

</ul>

{% else %}

<p class="text-center">No predictions found.</p>

{% endif %}

</div>

<div class="chart-container mt-5">

<h2 class="text-center colored-text">Pie Chart</h2>

<canvas id="pieChart"></canvas>

</div>

<div class="chart-container mt-5">

<h2 class="text-center colored-text">Bar Chart</h2>

<canvas id="barChart"></canvas>

</div>

<div class="chart-container mt-5">

<h2 class="text-center colored-text">Line Chart</h2>

<canvas id="lineChart"></canvas>

3rd Year BCA 26


NCMS 2024-25 OBESITY LEVEL ESTIMATION

</div>

</div>

<script> document.addEventListener('DOMContentLoaded', function()

{ var pieCtx =

document.getElementById('pieChart').getContext('2d'); var

pieChart = new Chart(pieCtx, {

type: 'pie',

data: {

labels: {{ pie_labels|safe }},

datasets: [{

data: {{ pie_values|safe }},

backgroundColor: [

'rgba(255, 99, 132, 0.2)',

'rgba(54, 162, 235, 0.2)',

'rgba(255, 206, 86, 0.2)',

'rgba(75, 192, 192, 0.2)',

'rgba(153, 102, 255, 0.2)',

'rgba(255, 159, 64, 0.2)'

],

borderColor: [

'rgba(255, 99, 132, 1)',

'rgba(54, 162, 235, 1)',

3rd Year BCA 27


NCMS 2024-25 OBESITY LEVEL ESTIMATION

'rgba(255, 206, 86, 1)',

'rgba(75, 192, 192, 1)',

'rgba(153, 102, 255, 1)',

'rgba(255, 159, 64, 1)'

],

borderWidth: 1

}] }, options:

{ responsive:

true, plugins: {

legend: {

position: 'top',

},

tooltip: {

mode: 'index',

intersect: false,

});

var barCtx = document.getElementById('barChart').getContext('2d');

var barChart = new Chart(barCtx, {

3rd Year BCA 28


NCMS 2024-25 OBESITY LEVEL ESTIMATION

type: 'bar',

data: {

labels: {{ bar_labels|safe }},

datasets: [{

label: 'Value', data: {{

bar_values|safe }},

backgroundColor: 'rgba(153, 102, 255, 0.2)',

borderColor: 'rgba(153, 102, 255, 1)',

borderWidth: 1

}] }, options: {

responsive: true,

plugins: {

legend: {

position: 'top',

},

tooltip: {

mode: 'index',

intersect: false,

},

scales: {

y: {

beginAtZero: true

3rd Year BCA 29


NCMS 2024-25 OBESITY LEVEL ESTIMATION

});

var lineCtx = document.getElementById('lineChart').getContext('2d'); var

lineChart = new Chart(lineCtx, {

type: 'line', data: {

labels: {{ line_labels|safe }},

datasets: {{ line_datasets|safe }}

},

options: {

responsive: true,

plugins: {

legend: {

position: 'top',

}, tooltip: {

mode: 'index',

intersect: false,

}, scales: { y:

beginAtZero: true

3rd Year BCA 30


NCMS 2024-25 OBESITY LEVEL ESTIMATION

});

});

</script>

</body>

</html>

3.3 Future Work

• Integration with Wearable Devices: Collect real-time health data from wearable devices to

enhance prediction accuracy.

• Personalized Recommendations: Provide personalized diet and exercise recommendations

based on predicted obesity levels.

• 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.

3rd Year BCA 31


NCMS 2024-25 OBESITY LEVEL ESTIMATION

CHAPTER IV
ANALYSIS AND DESIGN

4.1 Problem Analysis


The goal of this project is to create a real-time system capable of detecting and
classifying human emotions based on facial expressions. This can be useful in a variety of
applications, including enhancing user experience in interactive systems, aiding in
psychological analysis, improving security monitoring, and creating assistive technologies for
individuals with communication difficulties. The challenge lies in accurately detecting facial
emotions in diverse environments, under varying lighting conditions, and with people of
different ages, genders, and ethnicities.

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

estimate their obesity levels based on personal health metrics.

◦ Functional Requirements:

▪ Access the prediction functionality of the app.

▪ Provide necessary health metrics such as gender, age, height, weight, etc.

3rd Year BCA 32


NCMS 2024-25 OBESITY LEVEL ESTIMATION

▪ Receive predictions for obesity levels based on input data.

▪ View historical predictions if logged in (if applicable).

▪ Register and log in to the app (if user authentication is implemented).

2. Administrators:

◦ Description: Administrators oversee and manage the application, ensuring its smooth

operation and user management.

◦ Functional Requirements:

▪ Access to administrative dashboard or backend panel for managing user accounts.

▪ Ability to view user data, including predictions and user profile information.

▪ Modify user information or delete user accounts if necessary.

▪ Monitor application performance and health metrics.

▪ Ensure data security and compliance with privacy regulations.

User Interactions:

• Registration and Login:

◦ 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.

3rd Year BCA 33


NCMS 2024-25 OBESITY LEVEL ESTIMATION

◦ 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.

◦ Password reset functionality is available to ensure secure access to user accounts.

Non-functional Requirements:

• Performance: The app should handle multiple concurrent user sessions efficiently, ensuring

minimal latency in prediction responses.

• 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

and transmitted using encryption protocols.

• Scalability: The application should scale seamlessly to accommodate a growing user base and

increased data processing demands.

Constraints:

• Compliance with Data Protection Regulations: The app must adhere to local and international data

protection laws, safeguarding user privacy and confidentiality.

• Compatibility: The app should be compatible with modern web browsers and accessible across

different devices (desktops, tablets, mobile phones).

Assumptions:

3rd Year BCA 34


NCMS 2024-25 OBESITY LEVEL ESTIMATION

• Users have basic knowledge of using web applications and are comfortable providing necessary

health metrics for obesity prediction.

• 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.

4.3 System Perspective


The Obesity Estimation App is designed as a web-based application that leverages the Django
framework for backend development and integrates with frontend technologies such as
HTML, CSS, and JavaScript. The application follows a client-server architecture where the
server-side processing is handled by Django, while the client interacts with the app through a
web browser.

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.

• Server-Side (Backend): The backend is powered by Django, a high-level Python web


framework. It handles data processing, business logic, and integration with the machine learning

model for predicting obesity levels based on user inputs.

• 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.

3rd Year BCA 35


NCMS 2024-25 OBESITY LEVEL ESTIMATION

• 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.

4.4 Context Diagram


A context diagram provides a high-level view of how the Obesity Estimation App interacts
with external entities and systems. It illustrates the boundaries of the system and its
interactions with users and external services.

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

additional functionalities (e.g., data analytics, external databases).

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

frontend interface, backend processing, and database management.

• Machine Learning Model: Pre-trained models stored as pickle files and loaded into the

Django environment for predicting obesity levels.

• SQLite Database: Integrated with Django for storing user profiles, prediction history, and

other application data.

• External APIs (Future Integration): Potential APIs that might be integrated for additional

3rd Year BCA 36


NCMS 2024-25 OBESITY LEVEL ESTIMATION

data sources or functionalities.

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

results, and retrieve historical data.

• Machine Learning Integration: Integration of machine learning models for predicting

obesity levels based on user inputs.

Fig 4.4: Context Diagram

4.5 Use Case Diagram


A Use Case Diagram illustrates the interactions between users (actors) and the system (use cases).

Here’s an outline of what it might look like for your app:

Actors:

• User: Interacts with the system to predict obesity levels and view predictions.

3rd Year BCA 37


NCMS 2024-25 OBESITY LEVEL ESTIMATION

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.

• Register: New users can create an account to access prediction features.

• Login: Existing users can log in to their accounts.

• Logout: Allows users to securely log out from their accounts.

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.

3rd Year BCA 38


NCMS 2024-25 OBESITY LEVEL ESTIMATION

Fig 4.5 : Use Case Diagram

4.6 Sequence Diagram


A Sequence Diagram represents interactions between objects or components in a particular scenario.

Here’s a simplified Sequence Diagram for the "Predict Obesity" use case:

Scenario: Predict Obesity

1. User: Initiates the prediction process by entering health metrics.

2. Web Browser (View): Sends a request to the Django server.

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:

• Objects/Components: Web Browser, Django Controller, Machine Learning Model.

• Messages: Request/response interactions between components.

• Time Flow: Shows the chronological order of interactions during the prediction process.

3rd Year BCA 39


NCMS 2024-25 OBESITY LEVEL ESTIMATION

Fig 4.6 : Sequence Diagram

4.7 Collaboration Diagram

Participants:

- User

- Web Browser

- Django Controller- Machine Learning Model

Scenario:
1. User: Enters health metrics and submits the prediction request.

2. Web Browser: Sends a POST request to the Django server.

3. Django Controller: Receives and validates user inputs.

4. Django Controller: Sends data to the Machine Learning Model for prediction.

5. Machine Learning Model: Processes inputs and predicts obesity level.

3rd Year BCA 40


NCMS 2024-25 OBESITY LEVEL ESTIMATION

6. Django Controller: Receives prediction result from the model.

7. Web Browser: Displays the predicted obesity level to the user.

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.

- Django Controller receives the prediction result and prepares a response.

- Web Browser displays the prediction result to the user.

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.

3rd Year BCA 41


NCMS 2024-25 OBESITY LEVEL ESTIMATION

Fig 4.7 :Collaboration Diagram

4.8 Activity Diagram

Participants:

- User
- Web Browser
- Django Controller- Database (SQLite)

3rd Year BCA 42


NCMS 2024-25 OBESITY LEVEL ESTIMATION

Activities:

1. User: Clicks on the Register link.


2. Web Browser: Displays the registration form.
3. User: Enters registration details and submits the form.
4. Web Browser: Sends a POST request to the Django server.
5. Django Controller: Receives and validates registration data.
6. Django Controller: Saves user details in the SQLite Database.
7. Django Controller: Redirects user to the login page upon successful registration.

Activity Flow:

- User starts the registration process by clicking on the Register link.


- Web Browser displays the registration form to the user.
- User enters required details (username, email, password) and submits the form.
- Web Browser sends a POST request to the Django server.
- Django Controller receives the data, validates it, and saves the user details in the database.
- Upon successful registration, Django Controller redirects the user to the login page.
Notes:

- Depicts the sequence of activities involved in the user registration process.

- Shows how the user interacts with the web interface, and how Django processes and stores user data.

Fig 4.8 :Activity Diagram

3rd Year BCA 43


NCMS 2024-25 OBESITY LEVEL ESTIMATION

4.9 Result and Evaluation

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.

3rd Year BCA 44


NCMS 2024-25 OBESITY LEVEL ESTIMATION

CHAPTER V

CONCLUSION

The Obesity Estimation App represents a significant advancement in healthcare technology by


leveraging machine learning to predict obesity levels based on user-provided health metrics.
Through the use of Django framework and Python programming language, the application
delivers a robust and user-friendly interface that facilitates easy interaction and accurate
predictions.

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.

3rd Year BCA 45


NCMS 2024-25 OBESITY LEVEL ESTIMATION

CHAPTER VI

SNAPSHOTS

Figure 5.1 : Home page of obesity level estimation

Figure 5.2 : Register page

3rd Year BCA 46


NCMS 2024-25 OBESITY LEVEL ESTIMATION

Figure 5.3 : Result page

3rd Year BCA 47


NCMS 2024-25 OBESITY LEVEL ESTIMATION

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

5. Academic Record Management Research

6. REST API for Educational Platforms

3rd Year BCA 48

You might also like