Book Image

Neural Networks with Keras Cookbook

By : V Kishore Ayyadevara
Book Image

Neural Networks with Keras Cookbook

By: V Kishore Ayyadevara

Overview of this book

This book will take you from the basics of neural networks to advanced implementations of architectures using a recipe-based approach. We will learn about how neural networks work and the impact of various hyper parameters on a network's accuracy along with leveraging neural networks for structured and unstructured data. Later, we will learn how to classify and detect objects in images. We will also learn to use transfer learning for multiple applications, including a self-driving car using Convolutional Neural Networks. We will generate images while leveraging GANs and also by performing image encoding. Additionally, we will perform text analysis using word vector based techniques. Later, we will use Recurrent Neural Networks and LSTM to implement chatbot and Machine Translation systems. Finally, you will learn about transcribing images, audio, and generating captions and also use Deep Q-learning to build an agent that plays Space Invaders game. By the end of this book, you will have developed the skills to choose and customize multiple neural network architectures for various deep learning problems you might encounter.
Table of Contents (18 chapters)

What this book covers

Chapter 1, Building a Feedforward Neural Network, will teach you about the basics of building a neural network by building a feedforward network from scratch and looking at backward propagation in Python. Additionally, you will be learning about the various components of building a neural network in Keras.

Chapter 2, Building a Deep Feedforward Neural Network, will teach you about the various hyperparameters that impact the accuracy of neural networks by having you implement multiple models on a handwritten digit dataset.

Chapter 3, Applications of Deep Feedforward Neural Networks, will see you appreciate the flexibility of neural networks by having you implement models to predict the likelihood of a customer defaulting on a loan, identify the sentiment of a text review, and classify audio signals. Additionally, you will learn about fine-tuning a neural network to assign higher weightage to certain rows and certain classes of output.

Chapter 4, Building a Deep Convolutional Neural Network, will explore how CNNs work by having you implement one from scratch in Python. You will also learn about how CNNs help in improving prediction accuracy when images are translated. Finally, you will learn about classifying gender of person in image along with improving network accuracy through data augmentation.

Chapter 5, Transfer Learning, will look at leveraging pre-trained models, such as VGG16, VGG19, ResNet50, Inception architectures that were built on millions of images, based on which we fine-tune the weights of our model to further improve its accuracy. Finally, you will learn about detecting the locations of key points in the image of a face.

Chapter 6, Detecting and Localizing Objects in Images, will teach you about the various components of building a model that detects the location of objects in an image. Additionally, you will build a region proposal-based algorithm and an anchor box-based algorithm from scratch to identify the location of objects in image.

Chapter 7, Image Analysis Applications in Self-Driving Cars, will teach you about building a U-Net architecture so that you can perform semantic segmentation on images to group similar objects in an image of a road together. Additionally, you will be performing analysis to identify the angle at which a car needs to be steered based on the image of a road.

Chapter 8, Image Generation, delves into the technique of adversarial attacks to fool a neural network. Additionally, you will also learn about different ways of generating new images while changing the input pixel values of image, as well as by leveraging GANs.

Chapter 9, Encoding Inputs, is where we will pivot from image analysis to text analysis, by converting high-dimensional input values to low-dimensional values and performing vector arithmetic to identify ways to encode an image, encode users, and recommend new movies to a user.

Chapter 10, Text Analysis Using Word Vectors, will dive deep into understanding the various ways of encoding text, such as word2vec, GloVe, and FastText. Additionally, we will be working on predicting the sentiment of text using generated word vectors.

Chapter 11, Building a Recurrent Neural Network, is where we will build an RNN from scratch using Python. Additionally, we'll be learning about the limitations of RNNs and will be building an LSTM-based architecture to overcome the RNN's limitations. Finally, we'll contrast the sentiment classification accuracy of word vector-based models with RNN-based models and LSTM-based models.

Chapter 12, Applications of a Many-to-One Architecture RNN, will dive deep into multiple applications leveraging the RNN architecture that we will have learned about. We'll build a model that is able to generate text, predict the next movie a user can be recommended, and forecast stock prices, and we'll look at the various pitfalls associated with the model.

Chapter 13, Sequence-to-Sequence Learning, explores returning sequences of output. We'll be leveraging bidirectional LSTMs and encoder-decoder architecture, along with attention mechanisms, to build machine translation models and a chatbot.

Chapter 14, End-to-End Learning, will teach you about using CNNs and RNNs together to solve case studies on handwritten text recognition and caption generation for images. We will also learn about a new loss function, Connectionist Temporal Classification (CTC). Finally, you will also learn about beam search to generate plausible captions.

Chapter 15, Audio Analysis, will dive deep into multiple applications,including ones about the classification of songs by genre as well as the generation of music. Finally, you will learn about transcribing audio to text.

Chapter 16, Reinforcement Learning, will be about how to find the optimal action to take in a certain state of a game. You will also learn about using the OpenAI Gym environment, and you will leverage Q-learning and Deep Q-learning to navigate games of Frozen lake, Cart-pole and Space Invaders.