From 7acec7227ec380123d8f8ed423c215423517ac14 Mon Sep 17 00:00:00 2001 From: danielburdeno <92398209+danielburdeno@users.noreply.github.com> Date: Fri, 7 Jan 2022 14:46:25 -0500 Subject: [PATCH] Delete Untitled1.ipynb --- Untitled1.ipynb | 241 ------------------------------------------------ 1 file changed, 241 deletions(-) delete mode 100644 Untitled1.ipynb diff --git a/Untitled1.ipynb b/Untitled1.ipynb deleted file mode 100644 index c8268ab..0000000 --- a/Untitled1.ipynb +++ /dev/null @@ -1,241 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Pediatric Pneumonia Image Classification" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Overview" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Business Understanding" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Pneumonia is a form of acute respiratory infection that affects the lungs. The lungs are made up of small sacs called alveoli, which fill with air when a healthy person breathes. When an individual has pneumonia, the alveoli are filled with pus and fluid, which makes breathing painful and limits oxygen intake.\n", - "\n", - "According to the Wolrd Health Organization(WHO),Pneumonia is the single largest infectious cause of death in children worldwide. Pneumonia killed 740 180 children under the age of 5 in 2019, accounting for 14% of all deaths of children under five years old but 22% of all deaths in children aged 1 to 5. Pneumonia affects children and families everywhere, but deaths are highest in South Asia and sub-Saharan Africa. Children can be protected from pneumonia, it can be prevented with simple interventions, and treated with low-cost, low-tech medication and care.\n", - "Pneumonia in the pediatric population can be caused by various bacteria and viruses which sometimes maybe age-specific.Neonates are at risk for bacterial pathogens present in the birth canal.Viruses are the main cause of pneumonia in older infants and toddlers between 30 days and 2 years old. In children 2 to 5 years old, respiratory viruses are also the most common.\n", - "\n", - "Despite the fact that there are multiple laboratory procedures applied to diagnose pneumonia including blood work and bacterial or viral identifcation; there are no clear guidelines for the routine use of chest x-ray in the pediatric population.\n", - "Although the chest x-ray can be helpful in diagnosis and confirmation of pneumonia it carries with it risks, including radiation exposure, healthcare-associated costs, and false-negative results, increasing the use of unwarranted antibiotics.\n", - "\n", - "\n", - "In this project, we developed a neural network model to predict whether a chest x-ray image has penumomia or not using atificial intelligence algorithms. The model output from this project can be used to support the diagnosis of pneumonia by radiologists and medical professionals.The risk of flase negative result is one of the decisive fator that compromize the use of x-ray for pneumonia diagnosis.Thereofre,we wanted to address the context of \"false negative\" in our study, which is classifcation of an x-ray image as normal or without pneumonia when actually the image is from a pneumonic patient. Our objective is to decrease the chance of false negative result by taking care of not increasing false positve results as well.\n", - "We will evaluate the model result by calculating the recall score(so as to specifically know the status of false negative) and accuarcy score(to predict all x-ray images accuarately.Hneceforth, the recall and accuracy scores will be the metrices used for our project." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Data Understanding" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Requirement already satisfied: tensorflow in c:\\users\\tamev\\anaconda3\\envs\\learn-env\\lib\\site-packages (2.3.1)\n", - "Requirement already satisfied: keras-preprocessing<1.2,>=1.1.1 in c:\\users\\tamev\\anaconda3\\envs\\learn-env\\lib\\site-packages (from tensorflow) (1.1.2)\n", - "Requirement already satisfied: wrapt>=1.11.1 in c:\\users\\tamev\\anaconda3\\envs\\learn-env\\lib\\site-packages (from tensorflow) (1.12.1)\n", - "Requirement already satisfied: wheel>=0.26 in c:\\users\\tamev\\anaconda3\\envs\\learn-env\\lib\\site-packages (from tensorflow) (0.35.1)\n", - "Requirement already satisfied: six>=1.12.0 in c:\\users\\tamev\\anaconda3\\envs\\learn-env\\lib\\site-packages (from tensorflow) (1.15.0)\n", - "Requirement already satisfied: h5py<2.11.0,>=2.10.0 in c:\\users\\tamev\\anaconda3\\envs\\learn-env\\lib\\site-packages (from tensorflow) (2.10.0)\n", - "Requirement already satisfied: protobuf>=3.9.2 in c:\\users\\tamev\\anaconda3\\envs\\learn-env\\lib\\site-packages (from tensorflow) (3.11.2)\n", - "Requirement already satisfied: tensorboard<3,>=2.3.0 in c:\\users\\tamev\\anaconda3\\envs\\learn-env\\lib\\site-packages (from tensorflow) (2.3.0)\n", - "Requirement already satisfied: grpcio>=1.8.6 in c:\\users\\tamev\\anaconda3\\envs\\learn-env\\lib\\site-packages (from tensorflow) (1.31.0)\n", - "Requirement already satisfied: gast==0.3.3 in c:\\users\\tamev\\anaconda3\\envs\\learn-env\\lib\\site-packages (from tensorflow) (0.3.3)\n", - "Requirement already satisfied: numpy<1.19.0,>=1.16.0 in c:\\users\\tamev\\anaconda3\\envs\\learn-env\\lib\\site-packages (from tensorflow) (1.18.5)\n", - "Requirement already satisfied: opt-einsum>=2.3.2 in c:\\users\\tamev\\anaconda3\\envs\\learn-env\\lib\\site-packages (from tensorflow) (3.3.0)\n", - "Requirement already satisfied: tensorflow-estimator<2.4.0,>=2.3.0 in c:\\users\\tamev\\anaconda3\\envs\\learn-env\\lib\\site-packages (from tensorflow) (2.3.0)\n", - "Requirement already satisfied: google-pasta>=0.1.8 in c:\\users\\tamev\\anaconda3\\envs\\learn-env\\lib\\site-packages (from tensorflow) (0.2.0)\n", - "Requirement already satisfied: astunparse==1.6.3 in c:\\users\\tamev\\anaconda3\\envs\\learn-env\\lib\\site-packages (from tensorflow) (1.6.3)\n", - "Requirement already satisfied: termcolor>=1.1.0 in c:\\users\\tamev\\anaconda3\\envs\\learn-env\\lib\\site-packages (from tensorflow) (1.1.0)\n", - "Requirement already satisfied: absl-py>=0.7.0 in c:\\users\\tamev\\anaconda3\\envs\\learn-env\\lib\\site-packages (from tensorflow) (0.10.0)\n", - "Requirement already satisfied: setuptools in c:\\users\\tamev\\anaconda3\\envs\\learn-env\\lib\\site-packages (from protobuf>=3.9.2->tensorflow) (50.3.0.post20201103)\n", - "Requirement already satisfied: google-auth-oauthlib<0.5,>=0.4.1 in c:\\users\\tamev\\anaconda3\\envs\\learn-env\\lib\\site-packages (from tensorboard<3,>=2.3.0->tensorflow) (0.4.1)\n", - "Requirement already satisfied: requests<3,>=2.21.0 in c:\\users\\tamev\\anaconda3\\envs\\learn-env\\lib\\site-packages (from tensorboard<3,>=2.3.0->tensorflow) (2.24.0)\n", - "Requirement already satisfied: google-auth<2,>=1.6.3 in c:\\users\\tamev\\anaconda3\\envs\\learn-env\\lib\\site-packages (from tensorboard<3,>=2.3.0->tensorflow) (1.22.0)\n", - "Requirement already satisfied: markdown>=2.6.8 in c:\\users\\tamev\\anaconda3\\envs\\learn-env\\lib\\site-packages (from tensorboard<3,>=2.3.0->tensorflow) (3.3.2)\n", - "Requirement already satisfied: werkzeug>=0.11.15 in c:\\users\\tamev\\anaconda3\\envs\\learn-env\\lib\\site-packages (from tensorboard<3,>=2.3.0->tensorflow) (1.0.1)\n", - "Requirement already satisfied: tensorboard-plugin-wit>=1.6.0 in c:\\users\\tamev\\anaconda3\\envs\\learn-env\\lib\\site-packages (from tensorboard<3,>=2.3.0->tensorflow) (1.7.0)\n", - "Requirement already satisfied: requests-oauthlib>=0.7.0 in c:\\users\\tamev\\anaconda3\\envs\\learn-env\\lib\\site-packages (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard<3,>=2.3.0->tensorflow) (1.3.0)\n", - "Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in c:\\users\\tamev\\anaconda3\\envs\\learn-env\\lib\\site-packages (from requests<3,>=2.21.0->tensorboard<3,>=2.3.0->tensorflow) (1.25.10)\n", - "Requirement already satisfied: certifi>=2017.4.17 in c:\\users\\tamev\\anaconda3\\envs\\learn-env\\lib\\site-packages (from requests<3,>=2.21.0->tensorboard<3,>=2.3.0->tensorflow) (2021.10.8)\n", - "Requirement already satisfied: idna<3,>=2.5 in c:\\users\\tamev\\anaconda3\\envs\\learn-env\\lib\\site-packages (from requests<3,>=2.21.0->tensorboard<3,>=2.3.0->tensorflow) (2.10)\n", - "Requirement already satisfied: chardet<4,>=3.0.2 in c:\\users\\tamev\\anaconda3\\envs\\learn-env\\lib\\site-packages (from requests<3,>=2.21.0->tensorboard<3,>=2.3.0->tensorflow) (3.0.4)\n", - "Requirement already satisfied: pyasn1-modules>=0.2.1 in c:\\users\\tamev\\anaconda3\\envs\\learn-env\\lib\\site-packages (from google-auth<2,>=1.6.3->tensorboard<3,>=2.3.0->tensorflow) (0.2.7)\n", - "Requirement already satisfied: rsa<5,>=3.1.4; python_version >= \"3.5\" in c:\\users\\tamev\\anaconda3\\envs\\learn-env\\lib\\site-packages (from google-auth<2,>=1.6.3->tensorboard<3,>=2.3.0->tensorflow) (4.6)\n", - "Requirement already satisfied: cachetools<5.0,>=2.0.0 in c:\\users\\tamev\\anaconda3\\envs\\learn-env\\lib\\site-packages (from google-auth<2,>=1.6.3->tensorboard<3,>=2.3.0->tensorflow) (4.1.1)\n", - "Requirement already satisfied: aiohttp<4.0.0dev,>=3.6.2; python_version >= \"3.6\" in c:\\users\\tamev\\anaconda3\\envs\\learn-env\\lib\\site-packages (from google-auth<2,>=1.6.3->tensorboard<3,>=2.3.0->tensorflow) (3.6.3)\n", - "Requirement already satisfied: oauthlib>=3.0.0 in c:\\users\\tamev\\anaconda3\\envs\\learn-env\\lib\\site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard<3,>=2.3.0->tensorflow) (3.1.0)\n", - "Requirement already satisfied: pyasn1<0.5.0,>=0.4.6 in c:\\users\\tamev\\anaconda3\\envs\\learn-env\\lib\\site-packages (from pyasn1-modules>=0.2.1->google-auth<2,>=1.6.3->tensorboard<3,>=2.3.0->tensorflow) (0.4.8)\n", - "Requirement already satisfied: async-timeout<4.0,>=3.0 in c:\\users\\tamev\\anaconda3\\envs\\learn-env\\lib\\site-packages (from aiohttp<4.0.0dev,>=3.6.2; python_version >= \"3.6\"->google-auth<2,>=1.6.3->tensorboard<3,>=2.3.0->tensorflow) (3.0.1)\n", - "Requirement already satisfied: yarl<1.6.0,>=1.0 in c:\\users\\tamev\\anaconda3\\envs\\learn-env\\lib\\site-packages (from aiohttp<4.0.0dev,>=3.6.2; python_version >= \"3.6\"->google-auth<2,>=1.6.3->tensorboard<3,>=2.3.0->tensorflow) (1.5.1)\n", - "Requirement already satisfied: attrs>=17.3.0 in c:\\users\\tamev\\anaconda3\\envs\\learn-env\\lib\\site-packages (from aiohttp<4.0.0dev,>=3.6.2; python_version >= \"3.6\"->google-auth<2,>=1.6.3->tensorboard<3,>=2.3.0->tensorflow) (20.2.0)\n", - "Requirement already satisfied: multidict<5.0,>=4.5 in c:\\users\\tamev\\anaconda3\\envs\\learn-env\\lib\\site-packages (from aiohttp<4.0.0dev,>=3.6.2; python_version >= \"3.6\"->google-auth<2,>=1.6.3->tensorboard<3,>=2.3.0->tensorflow) (4.7.5)\n" - ] - } - ], - "source": [ - "!pip install tensorflow" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": {}, - "outputs": [], - "source": [ - "import tensorflow as tf\n", - "from matplotlib import pyplot as plt\n", - "from tensorflow.keras import datasets, layers, models" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": {}, - "outputs": [], - "source": [ - "import pandas as pd\n", - "import numpy as np\n", - "import seaborn as sns\n", - "import matplotlib.pyplot as plt\n", - "import matplotlib.image as mpimg\n", - "\n", - "# Neural network libraries\n", - "from tensorflow import keras\n", - "from keras import models, layers\n", - "from keras.preprocessing.image import ImageDataGenerator, array_to_img, img_to_array, load_img\n", - "from keras.layers import Dense, Dropout, Conv2D, MaxPooling2D, Flatten, Activation, BatchNormalization\n", - "from keras.regularizers import l2\n", - "from tensorflow.keras.optimizers import Adam, SGD\n", - "\n", - "# Model evaluation and modeling libraries\n", - "from sklearn.model_selection import train_test_split\n", - "from sklearn.metrics import confusion_matrix, ConfusionMatrixDisplay\n", - "\n", - "# load and evaluate a saved model\n", - "from numpy import loadtxt\n", - "from keras.models import load_model\n", - "\n", - "\n", - "import warnings\n", - "warnings.filterwarnings('ignore')\n", - "\n", - "np.random.seed(123)" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "'ls' is not recognized as an internal or external command,\n", - "operable program or batch file.\n" - ] - } - ], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.8.5" - } - }, - "nbformat": 4, - "nbformat_minor": 4 -}