Disease Detection and Consultation Using Django and Machine Learning
Disease Detection and Consultation Using Django and Machine Learning
Disease Detection and Consultation Using Django and Machine Learning
E-ISSN: 2663-3590
P-ISSN: 2663-3582
IJECS 2022; 4(1): 40-48 Disease detection and consultation using django and
Received: 06-05-2022
Accepted: 28-05-2022 machine learning
Divya
Assistant Professor, HMR Divya, Tanvi Dhingra, Rajat Nagar, Pawan Kant Tiwari and Deepika
Institute of Technology and
Management, India
Singh
Tanvi Dhingra DOI: https://doi.org/10.33545/26633582.2022.v4.i1a.67
Student, HMR Institute of
Technology and Management, Abstract
India The design and implementation of various well-known data mining techniques in a variety of real-
world applications (e.g., industry, healthcare, and bioscience) has led to their use in machine learning
Rajat Nagar
environments to extract meaningful information from provided data in healthcare communities,
Student, HMR Institute of
Technology and Management,
biological disciplines, and other fields. Early illness prediction, patient treatment, and community
India services all benefit from precise medical database analysis. Machine learning techniques have been
effectively used in a variety of applications, including disease prediction. The goal of developing a
Pawan Kant Tiwari classifier system utilising machine learning algorithms is to greatly assist physicians in predicting and
Student, HMR Institute of diagnosing diseases at an early stage, which will greatly aid in solving health-related difficulties. For
Technology and Management, our study, a sample of 4920 patient records diagnosed with 41 disorders was chosen. We chose 95 out
India of 132 independent variables (symptoms) that are strongly associated to illnesses and improved them.
The disease prediction system built utilising Machine learning techniques such as Decision Tree
Deepika Singh classifier, Random forest classifier, and Nave Bayes classifier is demonstrated in this research paper.
Student, HMR Institute of This paper “Disease Prediction Using Django and Machine Learning” gives a comparison of the
Technology and Management, outcomes of the aforementioned algorithms.
India
Keywords: Machine learning, data mining, decision tree classifier, random forest classifier, naive bayes classifier
Introduction
Objective
The purpose of this research is to see if the premise that supervised machine learning
algorithms may enhance health care by detecting illnesses accurately and early is true. In this
paper, we look into research that use several supervised machine learning models for each
illness detection issue. The system is meant to use intelligent decision tree data processing
technique to guess the foremost accurate illness supported patient’s symptoms. Many
symptoms are fed into the system, and hence diseases associated with it. The user describes
his or her symptoms and looks for further ones. As a result, the algorithm checks the
database, extracts the data, and forecasts the precise disease that the person is suffering from.
Several techniques will be tested for illness identification, including DT, RF, GB, KNN and
GNB. The most important aspect of this strategy is that it provides many symptom
possibilities so that the patient may search for any conceivable symptom. As a result,
prediction accuracy improves.
After performing feature selection, the top performing ML models for each illness will be
determined at the conclusion of this literature and would be used for building the desired
machine learning model that would predict the disease a patient is suffering from and
furthermore provide online consultation with the concerned Doctor.
Overview
The dataset we studied at has 132 symptoms, which may be combined or permuted to
produce 41 disorders. We aim to build a prediction model based on the 4920 patient data that
Correspondence takes the user's symptoms and forecasts the ailment he is most likely to have.
Divya
Assistant Professor, HMR
Institute of Technology and
Management, India
~ 40 ~
International Journal of Engineering in Computer Science https://www.computersciencejournals.com/ijecs
Table 1: Symptoms
Symptoms
Back pain Bloody stool scurrying
Constipation depression Passage of gases
Abdominal pain Irritation in anus Weakness in limbs
diarrhoea Neck pain Fast heart rate
Mild fever dizziness Internal itching
Yellow urine cramps Toxic look
Yellowing of eyes bruising palpitations
Fluid overload Swollen legs Prominent veins on calf
Swelling of stomach irritability Fluid overload
Swelled lymph nodes Swollen blood vessels Excessive hunger
malaise Muscle pain Black heads
Blurred and distorted vision Pain in anal region Pain during bowel movements
phlegm Brittle nails Rusty sputum
Throat irritation Belly pain Mucoid sputum
Redness of eyes Enlarged thyroid Puffy face and eyes
Sinus pressure Slurred speech Hip joint pain
Runny nose Knee pain polyuria
congestion Skin peeling Family history
Chest pain Extra marital contacts Swollen extremities
Yellow crust ooze Swelling joints Coma
Loss of smell Stiff neck Unsteadiness
Movement stiffness Muscle weakness Drying and tingling lips
Spinning movements Red sore around nose Weakness of one body side
Bladder discomfort Foul smell of urine Continuous feel of urine
Altered sensorium Red spots over body Abnormal menstruation
Dyschromic patches Watering from eyes Increases appetite
Lack of concentration Blood in sputum Receiving blood transfusion
Receiving unsterile injections Blood in sputum History of alcohol consumption
Puss filled pimples Blood in sputum History of alcohol consumption
Silver like dusting Small dents in nails Inflammatory nails
blister
Table 2: Diseases
Diseases
Fungal Infection Malaria Varicose veins
Allergy Chickenpox Hypothyroidism
Gerd Dengue Vertigo
Chronic cholestasis Peptic ulcer disease acne
Drug reaction Hepatitis A Urinary tract infection
Piles Hepatitis B Psoriasis
AIDS Hepatitis C Impetigo
Diabetes Hepatitis D Hyperthyroidism
Gastroenteritis Hepatitis E Hypoglycaemia
Bronchial Asthma Alcoholic hepatitis Cervical Spondylosis
Hypertension Tuberculosis Arthritis
Migraine Common cold Osteoarthritis
Paralysis Pneumonia Typhoid
Jaundice Heart Attack
~ 41 ~
International Journal of Engineering in Computer Science https://www.computersciencejournals.com/ijecs
~ 42 ~
International Journal of Engineering in Computer Science https://www.computersciencejournals.com/ijecs
Starting with the Home page, there would be five template your package or next to your module and it will be available
HTML files to be used for the website – admin, at /static on the application. A special endpoint ‘static’ is
consultation, Doctor, patient, and sign-in page. After the used to generate URL for static files.
successful login of the user, sign-in is loaded where the user
gets to sign-in as either Doctor, Patient or Admin. After Django as Framework
successfully logging in into the concerned role, the user gets The Interface is built upon Django which is a high-level
more options to explore, in case of patient - getting Python web framework that encourages rapid development
consultation facility and incase of Doctor - viewing profile and clean, pragmatic design. In Django, every web app you
of patient and consultation History menu. It is an interactive want to create is called a project; and a project is a sum of
web page with responsive buttons and links and various applications. An application is a set of code files relying on
resources such as Google font, Bootstrap, Owl Carousel, the MVT pattern. As example, let's say we want to build a
Magnific popup, CSS and Awesome Icon. The web website, the website is our project and the forum, news,
application also takes into use static files such as javascript contact engine are applications. This structure makes it
and CSS, supporting the display of a web page. Usually, the easier to move an application between projects since every
web server is configured to serve them for us, but during the application is independent.
development, these files are served from the static folder in Every web-app in Django has the following structure –
We have the following web apps in the system besides the Postgre SQL, which is an advanced, enterprise class open
main app: source relational database that supports both SQL
Accounts: This manages the register/login of the user. (relational) and JSON (non-relational) querying. We first
Chats: This web app handles the chat application used installed pgAdmin4 then clicking onto the server, we
during the consultation between patient and the Doctor. created our database Predico. Then we get the database
Disease prediction: This web app handles the config part as,
password validation and authentication. Databases = {
'Default': {
After having the patient input the symptoms, we ran our 'Engine': 'django.db.backends.postgresql',
machine learning model to predict what kind of disease the 'Name': 'predico',
patient is suffering from and from thereon provide 'User': 'postgres',
consultation facility to the patient. 'Password': 'tiger',
'Host': 'localhost'
Postgre SQL as Database Storage }
We save the login details of patients and Doctors using the }
~ 43 ~
International Journal of Engineering in Computer Science https://www.computersciencejournals.com/ijecs
5. Workflow implementation
6. Implementation and Results From these results, we can infer that all the three algorithms
Performance of Algorithms on Training data work exceptionally well on the dataset. However, Decision
The system was trained on medical record of 4920 patients Tree is perhaps working a little better when compared to the
prone to 41 diseases which was due to the combination of other four algorithms. The accuracy score of each algorithm
various symptoms. We have considered 95 symptoms out of after training were:
132 symptoms to avoid over fitting.
Performance of Algorithms on test data records considering 95 symptoms. The accuracy score came
After training, the system was tested on 41 new patient’s out to be 97.11% and the confusion matrix are given as by:
From the above table, we can infer that all the algorithms percentage: 97.11 percentage.
have equal accuracy score. The accuracy in terms of
~ 44 ~
International Journal of Engineering in Computer Science https://www.computersciencejournals.com/ijecs
GUI results
~ 45 ~
International Journal of Engineering in Computer Science https://www.computersciencejournals.com/ijecs
~ 46 ~
International Journal of Engineering in Computer Science https://www.computersciencejournals.com/ijecs
~ 47 ~
International Journal of Engineering in Computer Science https://www.computersciencejournals.com/ijecs
https://www.kaggle.com/neelima98/disease-prediction-
using-machine-learning
11. Supervised and Unsupervised Machine Learning
Algorithms, Jason Brownlee, 16.03.2016, published in
Machine Learning Algorithms, last accessed
12.09.2018.
12. Decision trees, scikit-learn.org last accessed
12.09.2018.
13. Random Forest Classifier, scikit-learn.org last accessed
12.09.2018.
14. Gradient Boosting Classifier, scikit-learn.org last
accessed 12.09.2018.
~ 48 ~