Book Image

Applied Deep Learning with Keras

By : Ritesh Bhagwat, Mahla Abdolahnejad, Matthew Moocarme
Book Image

Applied Deep Learning with Keras

By: Ritesh Bhagwat, Mahla Abdolahnejad, Matthew Moocarme

Overview of this book

Though designing neural networks is a sought-after skill, it is not easy to master. With Keras, you can apply complex machine learning algorithms with minimum code. Applied Deep Learning with Keras starts by taking you through the basics of machine learning and Python all the way to gaining an in-depth understanding of applying Keras to develop efficient deep learning solutions. To help you grasp the difference between machine and deep learning, the book guides you on how to build a logistic regression model, first with scikit-learn and then with Keras. You will delve into Keras and its many models by creating prediction models for various real-world scenarios, such as disease prediction and customer churning. You’ll gain knowledge on how to evaluate, optimize, and improve your models to achieve maximum information. Next, you’ll learn to evaluate your model by cross-validating it using Keras Wrapper and scikit-learn. Following this, you’ll proceed to understand how to apply L1, L2, and dropout regularization techniques to improve the accuracy of your model. To help maintain accuracy, you’ll get to grips with applying techniques including null accuracy, precision, and AUC-ROC score techniques for fine tuning your model. By the end of this book, you will have the skills you need to use Keras when building high-level deep neural networks.
Table of Contents (12 chapters)
Applied Deep Learning with Keras
Preface
Preface

Architecture of a CNN


The main components of a CNN architecture are as follows:

  1. Input image

  2. Convolutional layer

  3. Pooling layer

  4. Flattening

Input Image

An input image forms the first component of a CNN architecture. An image can be of any type: a human, an animal, scenery, a medical X-ray image, and so on. Each image is converted into a mathematical matrix of zeros and ones. At a very high level, the following figure explains how a computer views an image of the letter T. All the blocks that have a value of one represent the data, while the zeros represents blank space:

Figure 7.3: Matrix for the letter 'T'

Convolution Layer

The convolution layer is the place where the image processing starts. A convolution layer consists of two steps:

  1. Feature detector or filter

  2. Feature map

Feature detector or filter: This is a matrix or pattern that you put on an image to transform it into a feature map:

Figure 7.4: Feature detector

Now, as highlighted, this feature detector is put (superimposed) on the original image and...