The pipeline

We will go about this intelligently. There are a lot of pipeline model structures made by Google using different networks in their TensorFlow library. What we'll do here is take one of those model structures and networks and modify the code to our needs.

This is good because we won't waste our time building a pipeline from scratch and won't have to worry about incorporating the TensorBoard visualization stuff as it is already present in the Google pipeline models.

We will use a pipeline model from here:

https://github.com/tensorflow/models/

As you can see, there are a lot of different models made in TensorFlow in this repository. You can dive deeper into some models that are related to natural language processing (NLP), recursive neural networks, and other topics. This is a really good place to start if you want to understand complex models.

For this chapter, we will use the Tensorflow-Slim image classification model library. You can find the library here:

https://github.com/tensorflow/models/tree/master/research/slim

There are a lot of details already present on the website that explain how to use this library. They also tell you how to use this library in a distributed environment and also how to utilize multiple GPUs to get a faster training time and even deploy to production.

The best thing about using this is that they provide you with the pre-trained model snapshot, which you can use to dramatically reduce the training time of your network. So, even if you have slow GPUs, you won't have to train your network this large for weeks to get to a reasonable level of training.

This is called fine-tuning of the model, in which you just have to provide a different dataset and tell the network to reinitialize the final layers of the network in order to retrain them. Also, you tell it how many output label classes you have in your dataset. In our case, there are five unique classes to identify different levels of diabetic retinopathy (DR).

The pre-trained snapshot can be found here:

https://github.com/tensorflow/models/tree/master/research/slim#Pretrained

As you can see in the preceding link, they provide many types of pre-trained models that we can leverage. They have used the ImageNet dataset to train these models. ImageNet is a standard dataset of 1,000 classes with dataset sizing almost 500 GB. You can find more about it here:

http://image-net.org/

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.46.130