Used Convolutional Neural Networks (CNNs), an advanced machine learning technique, to develop predictive models that accurately diagnoses if a patient has pneumonia based on their X-rays. This project was done analyzing pneumonia cases in children under 5 years old in Uganda.
# Pneumonia-Detection-Using-CNN
Used Convolutional Neural Networks (CNNs), an advanced machine learning technique, to develop predictive models that accurately diagnoses if a patient has pneumonia based on their X-rays. This project was done analyzing pneumonia cases in children under 5 years old in Uganda.
#import os
#os.system ("pip install keras==2.4.3")
!pip install tensorflow
import keras
print('The keras version is {}.'.format(keras.__version__))
# IPython display functions
import IPython
from IPython.display import display, HTML, SVG, Image
# General Plotting
import matplotlib.pyplot as plt
plt.style.use('seaborn-paper')
plt.rcParams['figure.figsize'] = [10, 6] ## plot size
plt.rcParams['axes.linewidth'] = 2.0 #set the value globally
## notebook style and settings
display(HTML(" .container { width:90% !important; } "))
display(HTML(" .output_png { display: table-cell; text-align: center; vertical-align: middle; } "))
display(HTML(" .MathJax {font-size: 100%;} "))
# For changing background color
def set_background(color):
script = ( "var cell = this.closest('.code_cell');" "var editor = cell.querySelector('.input_area');" "editor.style.background='{}';" "this.parentNode.removeChild(this)" ).format(color)
display(HTML(' '.format(script)))
Library Imports
import os
import sys
import random
import numpy as np
import pandas as pd
from os import walk
# Metrics
from sklearn.metrics import *
# Keras library for deep learning
#
keras.io
import tensorflow as tf
import keras
from keras.datasets import mnist # MNIST Data set
from keras.models import Sequential # Model building
from keras.layers import * # Model layers
from keras.preprocessing.image import *
from tensorflow.keras.utils import *
from sklearn.model_selection import train_test_split
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
# 1. Helper Functions
## 1.1 Confusion Matrix
Confusion matrices are an important toolkit in every data scientist's box. We create …