Tutorialspoint

April Learning Carnival is here, Use code FEST10 for an extra 10% off

Keras Deep Learning & Generative Adversarial Networks (GAN)

person icon Abhilash Nelson

4.2

Keras Deep Learning & Generative Adversarial Networks (GAN)

Learn From the Scratch to Expert Level: Deep Learning & Generative Adversarial Networks (GAN) using Python with Keras

updated on icon Updated on Apr, 2024

language icon Language - English

person icon Abhilash Nelson

English [CC]

category icon Deep Learning,Machine Learning,Development,Data Science

Lectures -134

Resources -1

Duration -17 hours

4.2

price-loader

30-days Money-Back Guarantee

Training 5 or more people ?

Get your team access to 10000+ top Tutorials Point courses anytime, anywhere.

Course Description

Hi There!

Hello and welcome to my new course Deep Learning with Generative Adversarial Networks (GAN). This course is divided into two halves. In the first half we will deal with Deep Learning and Neural Networks and in the second half on top of that, we will continue with Generative Adversarial Networks or GAN or we can call it as 'gan'. So let's see what are the topics that are included in each module. At first, the Deep Learning one..

As you already know the artificial intelligence domain is divided broadly into deep learning and machine learning. In fact deep learning is machine learning itself but Deep learning with its deep neural networks and algorithms try to learn high-level features from data without human intervention. That makes deep learning the base of all future self-intelligent systems.

I am starting from the very basic things to learn like learning the programming language basics and other supporting libraries at first and proceed with the core topic. 

Let's see what are the interesting topics included in this course. At first, we will have an introductory theory session about Artificial Intelligence, Machine learning, Artificial Neuron based Deep Learning, and Neural Networks. 

After that, we are ready to proceed with preparing our computer for Python coding by downloading and installing the Anaconda package and will check and see if everything is installed fine. We will be using the browser-based IDE called Jupyter Notebook for our further coding exercises.

I know some of you may not be coming from a python based programming background. The next few sessions and examples will help you get the basic python programming skill to proceed with the sessions included in this course. The topics include Python assignment, flow-control, functions List and Tuples, Dictionaries, Functions, etc. 

Then we will start with learning the basics of the Python Numpy library which is used to adding support for large, multi-dimensional arrays and matrices, along with a large collection of classes and functions. Then we will learn the basics of matplotlib library which is a plotting library for Python for corresponding numerical expressions in NumPy. And finally the pandas library which is a software library written for the Python programming language for data manipulation and analysis. 

After the basics, we will then install the deep learning libraries theano, tensorflow and the API for dealing with these called as Keras. We will be writing all our future codes in keras.

Then before we jump into deep learning, we will have an elaborate theory session about the basic Basic Structure of an Artificial Neuron and how they are combined to form an artificial Neural Network. Then we will see what exactly is an activation function, different types of most popular activation functions and the different scenarios we have to use each of them.

After that we will see about the loss function, the different types of popular loss functions and the different scenarios we have to use each of them. 

Like the Activation and loss functions, we have optimizers which will optimize the neural network based on the training feedback. We will also see the details about most popular optimizers and how to decide in which scenarios we have to use each of them.

Then finally we will discuss about the most popular deep learning neural network types and their basic structure and use cases.

Further the course is divided into exactly two halves. The first half is about creating deep learning multi-layer neural network models for text based dataset and the second half about creating convolutional neural networks for image based dataset. 

In Text based simple feed forward multi-layer neural network model we will start with a regression model to predict house prices of King County USA. The first step will be to Fetch and Load Dataset from the kaggle website into our program. 

Then as the second step, we will do an EDA or an Exploratory Data Analysis of the loaded data and we will then prepare the data for giving it into our deep learning model. Then we will define the Keras Deep Learning Model. 

Once we define the model, we will then compile the model and later we will fit our dataset into the compiled model and wait for the training to complete. After training, the training history and metrics like accuracy, loss etc can be evaluated and visualized using matplotlib. 

Finally we have our already trained model. We will try doing a prediction of the king county real estate price using our deep learning model and evaluate the results.

That was a text based regression model. Now we will proceed with a text based binary classification model. We will be using a derived version of Heart Disease Data Set from the UCI Machine Learning Repository. Our aim is to predict if a person will be having heart disease or not from the learning achieved from this dataset. The same steps repeat here also. 

The first step will be to Fetch and Load Dataset into our program. 

Then as the second step, we will do an EDA or an Exploratory Data Analysis of the loaded data and we will then prepare the data for giving it into our deep learning model. Then we will define the Keras Deep Learning Model. 

Once we define the model, we will then compile the model and later we will fit our dataset into the compiled model and wait for the training to complete. After training, the training history and metrics like accuracy, loss etc can be evaluated and visualized using matplotlib. 

Finally we have our already trained model. We will try doing a prediction for heart disease using our deep learning model and evaluate the results.

After the text based binary classification model. Now we will proceed with a text based multi class classification model. We will be using the Red Wine Quality Data Set from the kaggle website. Our aim is to predict the multiple categories in which a redwine sample can be placed from the learning achieved from this dataset. The same steps repeat here also. 

The first step will be to Fetch and Load Dataset into our program. 

Then as the second step, we will do an EDA or an Exploratory Data Analysis of the loaded data and we will then prepare the data for giving it into our deep learning model. Then we will define the Keras Deep Learning Model. 

Once we define the model, we will then compile the model and later we will fit our dataset into the compiled model and wait for the training to complete. After training, the training history and metrics like accuracy, loss etc can be evaluated and visualized using matplotlib. 

Finally we have our already trained model. We will try doing a prediction for wine quality with a new set of data and then evaluate the categorical results.

We may be spending much time, resources and efforts to train a deep learning model. We will learn about the techniques to save an already trained model. This process is called serialization. We will at first serialize a model. Then later load it in another program and do the prediction without having to repeat the training.

That was about text based data. We will now proceed with image based data. In the preliminary session we will have an introduction to Digital Image Basics in which we learn about the composition and structure of a digital image.

Then we will learn about Basic Image Processing using Keras Functions. There are many classes and functions that help with pre processing an image in the Keras library api. We will learn about the most popular and useful functions one by one.

Another important and useful image processing function in keras is Image Augmentation in which slightly different versions of images are automatically created during training. We will learn about single image augmentation, augmentation of images within a directory structure and also data frame image augmentation. 

Then another theory session about the basics of a Convolutional neural network or CNN. We will learn how the basic CNN layers like convolution layer, the pooling layer and the fully connected layer works. 

There are concepts like Stride Padding and Flattening in convolution for image processing. We will learn them also one by one.

Now we are all set to start with our CNN Model. We will be designing a model that can classify 5 different types of flowers if provided with an image of a flower in any of these categories. We will be at first downloading the dataset from the kaggle website. Then the first step will be to Fetch and Load this Dataset from our computer into our program. 

Then as the second step, we have to split this dataset manually for training and then later testing the model. We will arrange them into training and testing folders with each class labelled in separate folders.

Then we will define the Keras Deep Learning Model. Once we define the model, we will then compile the model and later we will fit our dataset into the compiled model and wait for the training to complete. After training, the training history and metrics like accuracy, loss etc can be evaluated and visualized using matplotlib. 

Finally, we have our already trained model. We will try doing a prediction for five different types of flowers with a new set of image data and then evaluate the categorical results.

There are many techniques that we can use to improve the quality of a model. Especially an image based model. The most popular techniques are doing dropout regularization of the model. 

The next technique is doing the optimization and adjustment of the padding and also the filters in the convolution layers. 

And finally, optimization using image augmentation. We will tweak different augmentation options in this session.

Doing these optimization techniques manually one by one and comparing results is a very tedious task. So we will be using a technique called Hyper parameter tuning in which the keras library itself will switch different optimization techniques that we specify and will report and compare the results without we having to interfere in it.

Even though these techniques and creation of a model from the scratch is fun. Its very time consuming and may take ages if you are planning to design a large model. In this situation a technique called transfer learning can help us. 

We will take the world renounced, state of the art, most popular pre-trained deep learning models designed by experts and we will transfer the learning into our model so that we can make use of the architecture of that model into our custom model that we are building.

The popular state of the art model architectures that we are going to use are the VGG16, VGG19 designed by deep learning experts from the University of Oxford and also ResNet50 created in  ImageNet challenge to address the vanishing gradient problem.

We will at first download these models using keras and will try simple predictions using these pre-trained models. Later we will try the network training for our flower dataset itself using the VGG16. we will make few changes in the model to incorporate our dataset into it. Since the network architecture is not that simple, in our computer it will take a lot of time to complete the training. 

So instead of CPU, we have to use a GPU to enhance parallel processing. We will be using a cloud based Free GPU service provied by goggle called Google Colab. At first we will try training with VGG16 in google colab. We will prepare, zip and upload the dataset into google colab. Then we will extract it using linux comands and then do the training. The training is almost ten times faster compared to the local computer. Once we have the trained model we will serialize the model and will do the prediction. 

The same procedure will be repeated for VGG19 and also for ResNet.

And after having enough knowledge about Deep Learning, we will then move on with our Generative Adversarial Network or GAN

At first we will have an introduction to GAN. We will discuss about the the basic things inside the GAN, the two different types of networks called the Generator and the Discriminator. And then we will attempt to do a simple Transpose Convolution using a grayscale image. 

Transpose convolution is the opposite of the convolution operation that we had in Deep Learning and in the next session, we will once again have a thorough discussion about the Generator and the Discriminator mechanism inside a GAN. After that we will try to implement a Fully Connected, simple GAN using MNIST dataset. We will have a step by step approach in creating this fully connected GAN or fully connected GAN. 

At first we will be loading the MNIST dataset. Then we will proceed with defining the Generator function. Once we have the Generator function, we will then define the Discriminator function. And then we will combine this Generator and Discriminator models for our fully connected GAN so that we will have a composite model. And then this model will be compiled so that it can be used for training. After the compilation, we will proceed with training. We will train the discriminator at first and then we will proceed with the generator training. We will also define functions so that during the training of this fully connected gan, we will save the log at regular intervals and also we will plot the graph. Along with the graph,the image generated after each batch of training. And once the training is complete, we will

see how it performed. We will see the generated images by this fully connected GAN and also we will save this model

so that we can use it for future image generation without having to train it again. We will see how we can do that. 

Once we completed the fully connected GAN, we will then proceed with a more advanced Deep Convoluted GAN or DCGAN. For DCGAN also, we will discuss what is a DCGAN. What's the difference between DCGAN with a Fully Connected GAN. Then we will try to implement the Deep Convolution GAN or DCGAN At first we will define the Generator function then we will define the Discriminator function. After that we will combine this generator and discriminator models and we will have a composite model. We will then compile this model. Once the compilation is complete, we will proceed with training the model. Since deep convoluted GAN or DCGAN is complex than a fully connected GAN, it will take much time in training it.

So we will move the training from our local computer to our Google Colab using GPU. we will train the model and we will use that to generate the MNIST hand written digits.

We will use this same deep convolution GAN with other dataset also like the MNIST Fashion dataset. We will train the model using GPU and we will generate images. Then we will have the MNIST hand written digits and also the MNIST Fashion dataset are all simple grayscale images. 

We will try with color images also. We will be having the CIFAR-10 dataset. We will define the generator at first. Because its a color dataset, we need to adjust the model. So we will define the generator, then we will define the discriminator once again. Then we will proceed with training using the CIFAR-10 dataset. The training will be done using Google Colab GPU and then we will try to generate images using that trained model.

Then we will have a brief discussion about Conditional Generative Adversarial Networks or Conditional GAN. We will compare the normal Vanilla GAN with Conditional GAN. What's the difference between a normal GAN and a Conditional GAN. And then we will proceed with implementing the Conditional GAN, which is a bit different from our normal GAN. We will at first define the basic generator function and then we will have a Label Embedding for this generator. Then we will define the basic discriminator function and also we will have the label embedding for this discriminator function. Then we will combine this generator and discriminator. We will combine and we will compile. After that, we will proceed with

training the GAN model using our local computer. And we will try to display the generated images. And then we will use the same code, upload it to google colab and do the training with google Colab. And that was for the MNIST hand written digits dataset. We will then proceed with training the Conditional GAN using the MNIST Fashion dataset. The same dataset that we used for our fully connected and also deep convoluted GAN. Once we completed  the training, we will try to generate images using the conditional GAN for our Fashion MNIST dataset. And in the next session, we will discuss about the other popular types of GAN and also I will provide you with a git repository which was shared by a deep learning and machine learning expert. I will share that link so that you can try those exercises by yourself and also I will teach you how you can fork that repository into your personal git repository so that you can try the code, change the code

and see how it performs.

And that's all about the topics which are currently included in this quick course. The code, images, models and weights used in this course has been uploaded and shared in a folder. I will include the link to download them in the last session or the resource section of this course. You are free to use the code in your projects with no questions asked.

Also after completing this course, you will be provided with a course completion certificate which will add value to your portfolio.

So that's all for now, see you soon in the class room. Happy learning and have a great time.

Goals

What will you learn in this course:

  • No programming experience required. Just be enthusiastic about Generative Adversarial Networks (GAN) and Deep Learning. Learn Python and Keras Generative Adversarial Networks and Deep Learning From the Scratch to Expert Level

Prerequisites

What are the prerequisites for this course?

  • No programming experience is required.
Keras Deep Learning & Generative Adversarial Networks (GAN)

Curriculum

Check out the detailed breakdown of what’s inside the course

Course Introduction and Table of Contents
1 Lectures
  • play icon Course Introduction and Table of Contents 22:55 22:55
Introduction to AI and Machine Learning
1 Lectures
Tutorialspoint
Introduction to Deep learning and Neural Networks
1 Lectures
Tutorialspoint
Setting up Computer - Installing Anaconda
1 Lectures
Tutorialspoint
Python Basics - Flow Control
2 Lectures
Tutorialspoint
Python Basics - List and Tuples
1 Lectures
Tutorialspoint
Python Basics - Dictionary and Functions
2 Lectures
Tutorialspoint
Numpy Basics
2 Lectures
Tutorialspoint
Matplotlib Basics
2 Lectures
Tutorialspoint
Pandas Basics
2 Lectures
Tutorialspoint
Basic Structure of Artificial Neuron and Neural Network
1 Lectures
Tutorialspoint
Activation Functions Introduction
1 Lectures
Tutorialspoint
Popular Types of Activation Functions
1 Lectures
Tutorialspoint
Popular Types of Loss Functions
1 Lectures
Tutorialspoint
Popular Optimizers
1 Lectures
Tutorialspoint
Popular Neural Network Types
1 Lectures
Tutorialspoint
King County House Sales Regression Model - Step 1 Fetch and Load Dataset
1 Lectures
Tutorialspoint
Step 2 and 3 EDA and Data Prepration
2 Lectures
Tutorialspoint
Step 4 Defining the Keras Model
2 Lectures
Tutorialspoint
Step 5 and 6 Compile and Fit Model
1 Lectures
Tutorialspoint
Step 7 Visualize Training and Metrics
1 Lectures
Tutorialspoint
Step 8 Prediction Using the Model
1 Lectures
Tutorialspoint
Heart Disease Binary Classification Model - Introduction
1 Lectures
Tutorialspoint
Step 1 - Fetch and Load Data
1 Lectures
Tutorialspoint
Step 2 and 3 - EDA and Data Preparation
2 Lectures
Tutorialspoint
Step 4 - Defining the model
1 Lectures
Tutorialspoint
Step 5 - Compile Fit and Plot the Model
1 Lectures
Tutorialspoint
Step 5 - Predicting Heart Disease using Model
1 Lectures
Tutorialspoint
Step 6 - Testing and Evaluating Heart Disease Model
2 Lectures
Tutorialspoint
Redwine Quality MultiClass Classification Model - Introduction
2 Lectures
Tutorialspoint
Step 2 - EDA and Data Visualization
1 Lectures
Tutorialspoint
Step 3 - Defining the Model
1 Lectures
Tutorialspoint
Step 4 - Compile Fit and Plot the Model
1 Lectures
Tutorialspoint
Step 5 - Predicting Wine Quality using Model
1 Lectures
Tutorialspoint
Serialize and Save Trained Model for Later Usage
1 Lectures
Tutorialspoint
Digital Image Basics
1 Lectures
Tutorialspoint
Basic Image Processing using Keras Functions
3 Lectures
Tutorialspoint
Keras Single Image Augmentation
2 Lectures
Tutorialspoint
Keras Directory Image Augmentation
1 Lectures
Tutorialspoint
Keras Data Frame Augmentation
1 Lectures
Tutorialspoint
CNN Basics
1 Lectures
Tutorialspoint
Stride Padding and Flattening Concepts of CNN
1 Lectures
Tutorialspoint
Flowers CNN Image Classification Model - Fetch Load and Prepare Data
1 Lectures
Tutorialspoint
Flowers Classification CNN - Create Test and Train Folders
1 Lectures
Tutorialspoint
Flowers Classification CNN - Defining the Model
3 Lectures
Tutorialspoint
Flowers Classification CNN - Training and Visualization
1 Lectures
Tutorialspoint
Flowers Classification CNN - Save Model for Later Use
1 Lectures
Tutorialspoint
Flowers Classification CNN - Load Saved Model and Predict
1 Lectures
Tutorialspoint
Flowers Classification CNN - Optimization Techniques - Introduction
1 Lectures
Tutorialspoint
Flowers Classification CNN - Dropout Regularization
1 Lectures
Tutorialspoint
Flowers Classification CNN - Padding and Filter Optimization
1 Lectures
Tutorialspoint
Flowers Classification CNN - Augmentation Optimization
1 Lectures
Tutorialspoint
Hyper Parameter Tuning
2 Lectures
Tutorialspoint
Transfer Learning using Pretrained Models - VGG Introduction
1 Lectures
Tutorialspoint
VGG16 and VGG19 prediction
2 Lectures
Tutorialspoint
ResNet50 Prediction
1 Lectures
Tutorialspoint
VGG16 Transfer Learning Training Flowers Dataset
2 Lectures
Tutorialspoint
VGG16 Transfer Learning Flower Prediction
1 Lectures
Tutorialspoint
VGG16 Transfer Learning using Google Colab GPU - Preparing and Uploading Dataset
1 Lectures
Tutorialspoint
VGG16 Transfer Learning using Google Colab GPU - Training and Prediction
1 Lectures
Tutorialspoint
VGG19 Transfer Learning using Google Colab GPU - Training and Prediction
1 Lectures
Tutorialspoint
ResNet50 Transfer Learning using Google Colab GPU - Training and Prediction
1 Lectures
Tutorialspoint
Popular Neural Network Type
1 Lectures
Tutorialspoint
Generative Adversarial Networks GAN Introduction
1 Lectures
Tutorialspoint
Simple Transpose Convolution using a grayscale image
3 Lectures
Tutorialspoint
Generator and Discriminator Mechanism Explained
1 Lectures
Tutorialspoint
A fully Connected Simple GAN using MNIST DataSet - Introduction
1 Lectures
Tutorialspoint
Fully Connected GAN - Loading the Dataset
1 Lectures
Tutorialspoint
Fully Connected GAN - Defining the Generator Function
2 Lectures
Tutorialspoint
Fully Connected GAN - Defining the Discriminator Function
2 Lectures
Tutorialspoint
Fully Connected GAN - Combining Generator and Discriminator Models
1 Lectures
Tutorialspoint
Fully Connected GAN - Compiling Discriminator and Combined GAN Models
1 Lectures
Tutorialspoint
Fully Connected GAN - Discriminator Training
3 Lectures
Tutorialspoint
Fully Connected GAN - Generator Training
1 Lectures
Tutorialspoint
Fully Connected GAN - Saving Log at Each Interval
1 Lectures
Tutorialspoint
Fully Connected GAN - Plot the log at intervals
1 Lectures
Tutorialspoint
Fully Connected GAN - Display Generated Images
2 Lectures
Tutorialspoint
Saving the Trained Generator for Later Use
1 Lectures
Tutorialspoint
Generating fake images using the saved GAN Model
1 Lectures
Tutorialspoint
Fully Connected GAN vs Deep Convoluted GAN
1 Lectures
Tutorialspoint
Deep Convolutional GAN - Loading the MNIST Hand Written Digits Dataset
1 Lectures
Tutorialspoint
Deep Convolutional GAN - Defining the Generator Function
2 Lectures
Tutorialspoint
Deep Convolutional GAN - Defining the Discriminator Function
1 Lectures
Tutorialspoint
Deep Convolutional GAN - Combining and Compiling the Model
1 Lectures
Tutorialspoint
Deep Convolutional GAN - Training the Model
1 Lectures
Tutorialspoint
Deep Convolutional GAN - Training the Model using Google Colab GPU
1 Lectures
Tutorialspoint
Deep Convolutional GAN - Loading the Fashion MNIST Dataset
1 Lectures
Tutorialspoint
Deep Convolutional GAN - Training the MNIST Fashion Model using Google Colab GPU
1 Lectures
Tutorialspoint
Deep Convolutional GAN - Loading the CIFAR-10 Dataset and Defining the Generator
2 Lectures
Tutorialspoint
Deep Convolutional GAN - Defining the Discriminator
1 Lectures
Tutorialspoint
Deep Convolutional GAN CIFAR 10 - Training the Model
1 Lectures
Tutorialspoint
Deep Convolutional GAN - Training the CIFAR10 Model using Google Colab GPU
1 Lectures
Tutorialspoint
Vanilla GAN vs Conditional GAN
1 Lectures
Tutorialspoint
Conditional GAN - Defining the Basic Generator Function
1 Lectures
Tutorialspoint
Conditional GAN - Label Embedding for Generator
2 Lectures
Tutorialspoint
Conditional GAN - Defining the Basic Discriminator Function
1 Lectures
Tutorialspoint
Conditional GAN - Label Embedding for Discriminator
1 Lectures
Tutorialspoint
Conditional GAN - Combining and Compiling the Model
1 Lectures
Tutorialspoint
Conditional GAN - Training the Model
2 Lectures
Tutorialspoint
Conditional GAN - Display Generated Images
1 Lectures
Tutorialspoint
Conditional GAN - Training the MNIST Model using Google Colab GPU
1 Lectures
Tutorialspoint
Conditional GAN - Training the Fashion MNIST Model using Google Colab GPU
1 Lectures
Tutorialspoint
Other Popular GANs - Further Refrence and Source Code Link
2 Lectures
Tutorialspoint
Download Complete Source Code
1 Lectures
Tutorialspoint

Instructor Details

Abhilash Nelson

Abhilash Nelson

e


Course Certificate

Use your certificate to make a career change or to advance in your current career.

sample Tutorialspoint certificate

Our students work
with the Best

Related Video Courses

View More

Annual Membership

Become a valued member of Tutorials Point and enjoy unlimited access to our vast library of top-rated Video Courses

Subscribe now
Annual Membership

Online Certifications

Master prominent technologies at full length and become a valued certified professional.

Explore Now
Online Certifications

Talk to us

1800-202-0515