In this simple TensorFlow Computer Vision Guided Project in Python we a convolution neural network or deep learning model to predict a binary classification problem and predict with an X-ray image containing a chest X-ray image with or without pneumonia.
Medical Image classification is a common and important type of computer vision problem In future projects we will explore the many various types of image preprocessing available on our images to enhance our predictions.
In this TensorFlow Computer Vision Project, we will build a neural network with a Conv2D layer and a MaxPooling2D layer right after. This is then followed by a drop-out layer to help prevent overfitting. The final part of our TensorFlow deep learning computer vision model is a block of dense and dropout layers to allow for the extraction of higher-level features from the convolution.
As our output layers we use Categorical Crossentropy will means we will be treating our binary classification the same way we set up a multi-classification problem and will have a neuron for each class. In this case, we use 2 neurons on the output layers with a softmax activation. This is in contrast to the other binary classification for a TensorFlow Neural Network, we could have chosen to use only a 1 neuron with sigmoid activation. Either choice for our binary classification will result in the same final score of the model.
In our TensorFlow Deep Learning project using the Sequential model we will also go through how to connect our model to the file with the images using a Data Image Augmentor the will generate slightly alternated images and allows us to further increase our test accuracy.
Follow Data Science Teacher Brandyn
We will use the Python library os to set of the file paths for our image data augmentation.
Tensorflow Image Data Generator to generate and augment images of each epoch allowing us to simulate many many more pictures to train from normally increasing the accuracy of our test predictions.
TensorFlow ComputerVison deep learning binary classification model with the Sequential Model in TensorFlow.
Plot your Sequential Models training history with Pandas plotting.