Book Image

The Deep Learning with Keras Workshop

By : Matthew Moocarme, Mahla Abdolahnejad, Ritesh Bhagwat
1 (1)
Book Image

The Deep Learning with Keras Workshop

1 (1)
By: Matthew Moocarme, Mahla Abdolahnejad, Ritesh Bhagwat

Overview of this book

New experiences can be intimidating, but not this one! This beginner’s guide to deep learning is here to help you explore deep learning from scratch with Keras, and be on your way to training your first ever neural networks. What sets Keras apart from other deep learning frameworks is its simplicity. With over two hundred thousand users, Keras has a stronger adoption in industry and the research community than any other deep learning framework. The Deep Learning with Keras Workshop starts by introducing you to the fundamental concepts of machine learning using the scikit-learn package. After learning how to perform the linear transformations that are necessary for building neural networks, you'll build your first neural network with the Keras library. As you advance, you'll learn how to build multi-layer neural networks and recognize when your model is underfitting or overfitting to the training data. With the help of practical exercises, you’ll learn to use cross-validation techniques to evaluate your models and then choose the optimal hyperparameters to fine-tune their performance. Finally, you’ll explore recurrent neural networks and learn how to train them to predict values in sequential data. By the end of this book, you'll have developed the skills you need to confidently train your own neural network models.
Table of Contents (11 chapters)
Preface

Introduction

Machine learning is the science of utilizing machines to emulate human tasks and to have the machine improve its performance of that task over time. By feeding machines data in the form of observations of real-world events, they can develop patterns and relationships that will optimize an objective function, such as the accuracy of a binary classification task or the error in a regression task.

In general, the usefulness of machine learning is in the machine's ability to learn highly complex and non-linear relationships in large datasets and to replicate the results of that learning many times. One branch of machine learning algorithms has shown a lot of promise in learning highly complex and non-linear relationships associated with large, often unstructured datasets such as images, audio, and text data—Artificial Neural Networks (ANNs). ANNs, however, can be complicated to program, train, and evaluate, and this can be intimidating for beginners in the field. Keras is a Python library that presents a facile introduction to building, training, and evaluating ANNs that is incredibly useful to those studying machine learning.

Take, for example, the classification of a dataset of pictures of either dogs or cats into classes of their respective type. For a human, this is simple, and the accuracy would likely be very high. However, it may take around a second to categorize each picture and scaling the task can only be achieved by increasing the number of humans, which may not be feasible. While it may be difficult, though certainly not impossible, for machines to reach the same level of accuracy as humans for this task, machines can classify many images per second, and scaling can be easily done by increasing the processing power of a single machine or making the algorithm more efficient:

Figure 1.1: The classification of images as either dog or cat is a simple task for humans, but quite difficult for machines

Figure 1.1: The classification of images as either dog or cat is a simple task for humans, but quite difficult for machines

While the trivial task of classifying dogs and cats may be simple for us humans, the same principles that are used to create a machine learning model that classifies dogs and cats can be applied to other classification tasks that humans may struggle with. An example of this is identifying tumors in Magnetic Resonance Images (MRIs). For humans, this task requires a medical professional with years of experience, whereas a machine may only need a dataset of labeled images. The following image shows MRI images of the brain, some of which include tumors:

Figure 1.2: A non-trivial classification task for humans – MRIs of brains, some of which include the presence of tumors

Figure 1.2: A non-trivial classification task for humans – MRIs of brains, some of which include the presence of tumors