Train and deploy deep learning models

Build your neural network using Keras, train it using Google AI-Platform then deploy it using Flask and Google Cloud Run
Instructor:
Nour Islam Mokhtari
2,003 students enrolled
English [Auto]
Build a deep convolutional neural network using Keras and tensorflow.
Leverage the power of transfer learning to get high accuracy on your classification task.
Use google cloud platform to make training and deploying your deep learning model easy and scalable.
Leverage the power of AI-Platform on Google Cloud Platform to focus on the training of your deep learning model and not on infrastructure.
Containerize your training code and deployment code to make sure your code runs smoothly and everywhere.
How to deploy your deep learning model as a web app using Flask and Cloud Run.

This course will take you through the steps that a machine learning engineer would take to train and deploy a deep learning model. We will start the course by defining an end goal that we want to achieve. Then, we will download a dataset that will help us achieve that goal. We will build a Convolutional Neural Network using Tensorflow with Keras and then we will train this network on Google AI-Platform. After saving the best trained model, we will deploy it as a web app using Flask and Google Cloud Run. Throughout the course, we will be using Docker to containerize our code.

Introduction and software setup

1
Introduction and course content

Introduction to the course and an outline of the course sections and content.

2
Operating System, Python IDE and Docker

Setting up your local machine with the right software.

3
Setting up Google Cloud Platform

Creating a google cloud account with 300$ free cloud credit.

4
Setting up a VS code folder and creating a virtual environment using Virtualenv

Creating a setup for our code on visual studio code.

5
Python packages we will be using and how to install them

Installing python packages that we will use during the course from a requirements.txt file that I will provide you.

6
Testing your installation and setup

Testing our setup by running a few commands and some basic import code.

Building your deep learning model

1
How do machine learning or deep learning projects usually work?

A description of how machine learning projects work from a high level perspective.

2
What is our end goal?

Defining our end goal before we start diving into building our machine learning pipeline.

3
Downloading the dataset

Where to get the dataset that we will be using throughout the course.

4
Data exploration : splitting data into category folders

How to organize our dataset by splitting the data into folders that contain images of the same class.

5
Data exploration : visualizing random samples from the dataset

Adding a function that can help us visualize random samples from our dataset.

6
Data exploration : getting insights about widths and heights of images

Getting some insights from our dataset by computing mean and medium values of widths and heights of images.

7
What to consider when building a neural network for our task?

Things that you should consider when building a neural network to solve a specific problem.

8
Building the neural network architecture using Keras and Tensorflow

Building our neural network using Keras from Tensorflow. You will also leverage the power of transfer learning to build a power CNN based classifier.

9
Creating data pipelines using generators

Creating data pipelines for augmenting our dataset. You will create generators that can generate data during the training process. All of this using ImageDataGenerator from Keras.

10
Putting everything together inside a train function

You will create a training function that makes use of the data pipelines and the deep learning model that you created before.

11
Improving and cleaning the code for robustness and automation

A clean code is a robust code. In this lecture, we will clean our code for robustness and better readability.

12
Launching training locally on a subset of our data

Testing our code on a subset of the data to make sure that our pipeline is working properly.

13
Adding evaluation at the end of training

Adding the evaluation part to our code. We will be using our evaluation generator to evaluate our model.

14
Summary

Some final notes about this section.

Introduction to Google Cloud Storage

1
Our different setups for reading data during the training

Reading data during the training is a crucial part of your machine learning pipeline. In this lecture, I will outline our current setup and what we aim for by the time we start training on google cloud platform.

2
What are buckets and how to create them

An introduction to google buckets and how to create them.

3
Uploading our data to the bucket

In this lecture you will upload your dataset to a google cloud bucket that you previously created.

4
Creating a credentials json file to allow access to our bucket

In order to access your data (that you've put on the cloud) from anywhere, you need to have the right credentials. In this lecture, I will show you how to create credentials in a form of a JSON file.

5
Problem with our credentials file and how to fix it

The previous credentials file that we created did not allow us to access the data on our google bucket. In this lecture, I will show you why and how to fix that.

6
Adding code for downloading data from the bucket

In this lecture, we will add a function that allows us to download data from google bucket.

7
Verifying that our training pipeline is working properly with the new modificati

In this lecture, we will run our training pipeline to see if everything is working as it should.

Dockerizing our code

1
What is docker and how to use it for our project? (optional)

A brief description of what Docker is and how to use it from a high level perspective.

2
Small modifications to our files

Modifying our previous code to prepare it for docker.

3
Building a docker image using dockerfiles

How to create a Dockerfile for building docker images.

4
Running a docker container using our docker image

How to run docker containers using our docker image.

5
Adding arguments to our training application using Argparse

Adding arguments to our training script.

6
Necessary steps to use Docker with GPUs

Adding all the necessary steps to be able to use GPUs with Docker.

7
Building our docker image with GPU support

Building our new image after we set up our machine to use GPUs with Docker.

8
Summary

Summary and final notes about this section.

Training our deep learning model on AI-Platform

1
What is cloud computing and what is AI-Platform? (optional)

A brief explanation of what cloud computing is and what AI-Platform is.

2
What other APIs do we need?

Enabling google cloud APIs that we need for our training process on the cloud.

3
Pushing our image to Google Container Registry

In this lecture, you will learn how to push your docker image to google container registry.

4
Setting up things for our training job

Preparing all the necessary setup to run a training job on AI-Platform.

5
Launching a training job on AI-Platform and checking the logs

Launching our training job on AI-Platform and checking the logs coming from the machine that is running the training on the cloud.

6
What is hyperparameters tuning?

An introduction to hyperparameters tuning.

7
Configuring hyperparameters tuning

Configuring our code to allow AI-Platform to perform hyperparameters tuning automatically.

8
Building a new docker image with the new setup

Building a new docker image with the hyperparameters tuning setup.

9
Launching a training job with the new setup

Launching the training process with hyperparameters tuning configured.

10
Saving our trained model (but there is a problem)

Saving our trained deep learning models by adding callbacks from Keras.

11
Adding function to upload trained models to a google bucket

In this lecture, you will learning how to upload data to google cloud buckets from your python code.

12
Zipping and uploading trained models to google storage

In this lecture, you will learn how to zip and upload your best trained models to google cloud bucket.

13
Running the final training job

In this video, we will configure our code to finally run the training on the complete dataset.

14
Summary

Summary and final notes about this section.

Serving our trained model as a web app using Cloud Run and Flask

1
What is Cloud Run and what is Flask? (optional)

A brief introduction to the tools that we will be using to deploy our model. Namely, Google Cloud Run and Flask.

2
Creating the skeleton of our Flask web app

In this lecture we will create the skeleton of our Flask app and start adding the first building blocks of our web app.

3
Adding a helping function to only accept certain images

Here, we create a function that can verify the extension of the uploaded image.

4
Creating a view function to show our main web page

In this lecture, we create a function (also called the view) that represents the main page of our web app.

5
Quick test to verify that everything is working properly

Running flask server to test how our app is looking so far.

6
Finishing the main web page

In this lecture, we will finish up the main page of our web app.

7
Adding a web page for viewing the uploaded image

In this video, we add another view function that can handle uploading our images to the server.

8
Finishing the web app and testing our code locally

In this lecture, we finish the last parts of our web app.

9
Using gunicorn to serve the web app instead of Flask server

In this lecture we will learn how to use Gunicorn instead of Flask server.

10
Dockerizing our code

In this video, we will use Docker to containerize our application.

11
Deploying our web app to Cloud Run

In this lecture, I will show you how to deploy our web app using Google Cloud Build and Google Cloud Run.

12
Summary

Summary and last lecture of the section.

You can view and review the lecture materials indefinitely, like an on-demand channel.
Definitely! If you have an internet connection, courses on Udemy are available on any device at any time. If you don't have an internet connection, some instructors also let their students download course lectures. That's up to the instructor though, so make sure you get on their good side!

Be the first to add a review.

Please, login to leave a review
12fb03cd6b5e33e6190278ce6e1c9a0f
30-Day Money-Back Guarantee

Includes

8 hours on-demand video
Full lifetime access
Access on mobile and TV
Certificate of Completion

External Links May Contain Affiliate Links read more

Join our Telegram Channel To Get Latest Notification & Course Updates!
Join Our Telegram For FREE Courses & Canva PremiumJOIN NOW