Ailment
About the project
Project Details
Disease Predictor is a unified web-based application capable of predicting four major diseases — Pneumonia, Malaria, Liver Disease, and Cardiovascular Disease — using machine learning and deep learning models.
The Flask Web Application
The Web Application has been built with Flask in the backend and HTML and Bootstrap for the frontend.
Respective images (.jpg, .jpeg, .png) can be uploaded to get predictions for Pneumonia and Malaria.
Functionality for preventing upload of file of any format other than .jpg, .jpeg and .png has been included.
Sample images are included in the Sample images folder.
Execution
The prerequisites for running the Flask Application are included in the requirements.txt file.
To run the application:
export FLASK_APP=run.py
export FLASK_ENV=development
flask run
The Models
Pneumonia Model
The Chest X-Ray Images (Pneumonia) dataset from Kaggle has been used to train this model.
This model has been trained to identify 2 classes (Positive or negative for Pneumonia) using transfer learning on the InceptionV3 model till layer ‘mixed7’, followed by a Dense layer with 512 nodes (RelU), and a sigmoid layer with 1 output node using Keras with Tensorflow backend.
It was trained using the RMSprop optimizer with a batch size of 64. Input size of the images were (150, 150, 3). The images were rescaled before training. (trainPneumonia.ipynb)
The final trained model resulted in an accuracy of 85.2% on the test set with 777 images.
Each image is resized to 150x150 and then normalized before feeding into the network to make a prediction.
Malaria Model
The Malaria Cell Images Dataset dataset from Kaggle has been used to train this model.
It was trained using the public Kaggle notebook Detecting Malaria (val accuracy > 97%).





