Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Advanced Deep Learning with TensorFlow 2 and Keras
Advanced Deep Learning with TensorFlow 2 and Keras

Advanced Deep Learning with TensorFlow 2 and Keras: Apply DL, GANs, VAEs, deep RL, unsupervised learning, object detection and segmentation, and more , Second Edition

eBook
€8.99 €26.99
Paperback
€32.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Advanced Deep Learning with TensorFlow 2 and Keras

Deep Neural Networks

In this chapter, we'll be examining deep neural networks. These networks have shown excellent performance in terms of the accuracy of their classification on more challenging datasets like ImageNet, CIFAR10 (https://www.cs.toronto.edu/~kriz/learning-features-2009-TR.pdf), and CIFAR100. For conciseness, we'll only be focusing on two networks: ResNet [2][4] and DenseNet [5]. While we will go into much more detail, it's important to take a minute to introduce these networks.

ResNet introduced the concept of residual learning, which enabled it to build very deep networks by addressing the vanishing gradient problem (discussed in section 2) in deep convolutional networks.

DenseNet improved ResNet further by allowing every convolution to have direct access to inputs, and lower layer feature maps. It's also managed to keep the number of parameters low in deep networks by utilizing both the Bottleneck and Transition layers...

1. Functional API

In the Sequential model API that we first introduced in Chapter 1, Introducing Advanced Deep Learning with Keras, a layer is stacked on top of another layer. Generally, the model will be accessed through its input and output layers. We also learned that there is no simple mechanism if we find ourselves wanting to add an auxiliary input at the middle of the network, or even to extract an auxiliary output before the last layer.

That model also had its downsides; for example, it doesn't support graph-like models or models that behave like Python functions. In addition, it's also difficult to share layers between the two models. Such limitations are addressed by the Functional API and are the reason why it's a vital tool for anyone wanting to work with deep learning models.

The Functional API is guided by the following two concepts:

  • A layer is an instance that accepts a tensor as an argument. The output of a layer is another tensor....

2. Deep Residual Network (ResNet)

One key advantage of deep networks is that they have a great ability to learn different levels of representation from both inputs and feature maps. In classification, segmentation, detection, and a number of other computer vision problems, learning different feature maps generally leads to a better performance.

However, you'll find that it's not easy to train deep networks because the gradient may vanish (or explode) with depth in the shallow layers during backpropagation. Figure 2.2.1 illustrates the problem of vanishing gradient. The network parameters are updated by backpropagation from the output layer to all previous layers. Since backpropagation is based on the chain rule, there is a tendency for the gradient to diminish as it reaches the shallow layers. This is due to the multiplication of small numbers, especially for small loss functions and parameter values.

The number of multiplication operations will be proportional to...

3. ResNet v2

The improvements for ResNet v2 are mainly found in the arrangement of layers in the residual block as shown in Figure 2.3.1.

The prominent changes in ResNet v2 are:

  • The use of a stack of 1 x 1 – 3 x 3 – 1 × 1 BN-ReLU-Conv2D
  • Batch normalization and ReLU activation come before two dimensional convolution

Figure 2.3.1: A comparison of residual blocks between ResNet v1 and ResNet v2

ResNet v2 is also implemented in the same code as resnet-cifar10-2.2.1.py, as can be seen in Listing 2.2.1:

Listing 2.2.1: resnet-cifar10-2.2.1.py

def resnet_v2(input_shape, depth, num_classes=10):
    """ResNet Version 2 Model builder [b]

    Stacks of (1 x 1)-(3 x 3)-(1 x 1) BN-ReLU-Conv2D or 
    also known as bottleneck layer.
    First shortcut connection per layer is 1 x 1 Conv2D.
    Second and onwards shortcut connection is identity.
    At the beginning of each stage, 
    the feature map size...

4. Densely Connected Convolutional Network (DenseNet)

Figure 2.4.1: A 4-layer Dense block in DenseNet.The input to each layer is made of all the previous feature maps.

DenseNet attacks the problem of vanishing gradient using a different approach. Instead of using shortcut connections, all the previous feature maps will become the input of the next layer. The preceding figure shows an example of a Dense interconnection in one Dense block.

For simplicity, in this figure, we'll only show four layers. Notice that the input to layer l is the concatenation of all previous feature maps. If we let BN-ReLU-Conv2D be represented by the operation H(x), then the output of layer l is:

xl = H (x0,x1,x2, ,xl-1) (Equation 2.4.1)

Conv2D uses a kernel of size 3. The number of feature maps generated per layer is called the growth rate, k. Normally, k = 12, but k = 24 is also used in the paper Densely Connected Convolutional Networks by Huang et al. (2017) [5]. Therefore...

5. Conclusion

In this chapter, we've presented the Functional API as an advanced method for building complex deep neural network models using tf.keras. We also demonstrated how the Functional API could be used to build the multi-input-single-output Y-Network. This network, when compared to a single branch CNN network, achieves better accuracy. For the rest of the book, we'll find the Functional API indispensable in building more complex and advanced models. For example, in the next chapter, the Functional API will enable us to build a modular encoder, decoder, and autoencoder.

We also spent a significant amount of time exploring two important deep networks, ResNet and DenseNet. Both of these networks have been used not only in classification but also in other areas, such as segmentation, detection, tracking, generation, and visual semantic understanding. In Chapter 11, Object Detection, and Chapter 12, Semantic Segmentation, we will use ResNet for object detection and...

6. References

  1. Kaiming He et al. Delving Deep into Rectifiers: Surpassing Human-Level Performance on ImageNet Classification. Proceedings of the IEEE international conference on computer vision, 2015 (https://www.cv-foundation.org/openaccess/content_iccv_2015/papers/He_Delving_Deep_into_ICCV_2015_paper.pdfspm=5176.100239.blogcont55892.28.pm8zm1&file=He_Delving_Deep_into_ICCV_2015_paper.pdf).
  2. Kaiming He et al. Deep Residual Learning for Image Recognition. Proceedings of the IEEE conference on computer vision and pattern recognition, 2016a (http://openaccess.thecvf.com/content_cvpr_2016/papers/He_Deep_Residual_Learning_CVPR_2016_paper.pdf).
  3. Karen Simonyan and Andrew Zisserman. Very Deep Convolutional Networks for Large-Scale Image Recognition. ICLR, 2015 (https://arxiv.org/pdf/1409.1556/).
  4. Kaiming He et al. Identity Mappings in Deep Residual Networks. European Conference on Computer Vision. Springer International Publishing, 2016b (https://arxiv.org/pdf/1603...
Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Explore the most advanced deep learning techniques that drive modern AI results
  • New coverage of unsupervised deep learning using mutual information, object detection, and semantic segmentation
  • Completely updated for TensorFlow 2.x

Description

Advanced Deep Learning with TensorFlow 2 and Keras, Second Edition is a completely updated edition of the bestselling guide to the advanced deep learning techniques available today. Revised for TensorFlow 2.x, this edition introduces you to the practical side of deep learning with new chapters on unsupervised learning using mutual information, object detection (SSD), and semantic segmentation (FCN and PSPNet), further allowing you to create your own cutting-edge AI projects. Using Keras as an open-source deep learning library, the book features hands-on projects that show you how to create more effective AI with the most up-to-date techniques. Starting with an overview of multi-layer perceptrons (MLPs), convolutional neural networks (CNNs), and recurrent neural networks (RNNs), the book then introduces more cutting-edge techniques as you explore deep neural network architectures, including ResNet and DenseNet, and how to create autoencoders. You will then learn about GANs, and how they can unlock new levels of AI performance. Next, you’ll discover how a variational autoencoder (VAE) is implemented, and how GANs and VAEs have the generative power to synthesize data that can be extremely convincing to humans. You'll also learn to implement DRL such as Deep Q-Learning and Policy Gradient Methods, which are critical to many modern results in AI.

Who is this book for?

This is not an introductory book, so fluency with Python is required. The reader should also be familiar with some machine learning approaches, and practical experience with DL will also be helpful. Knowledge of Keras or TensorFlow 2.0 is not required but is recommended.

What you will learn

  • Use mutual information maximization techniques to perform unsupervised learning
  • Use segmentation to identify the pixel-wise class of each object in an image
  • Identify both the bounding box and class of objects in an image using object detection
  • Learn the building blocks for advanced techniques - MLPss, CNN, and RNNs
  • Understand deep neural networks - including ResNet and DenseNet
  • Understand and build autoregressive models – autoencoders, VAEs, and GANs
  • Discover and implement deep reinforcement learning methods

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Feb 28, 2020
Length: 512 pages
Edition : 2nd
Language : English
ISBN-13 : 9781838825720
Category :
Languages :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Feb 28, 2020
Length: 512 pages
Edition : 2nd
Language : English
ISBN-13 : 9781838825720
Category :
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 98.97
Deep Learning with TensorFlow 2 and Keras
€32.99
Hands-On Mathematics for Deep Learning
€32.99
Advanced Deep Learning with TensorFlow 2 and Keras
€32.99
Total 98.97 Stars icon
Banner background image

Table of Contents

15 Chapters
Introducing Advanced Deep Learning with Keras Chevron down icon Chevron up icon
Deep Neural Networks Chevron down icon Chevron up icon
Autoencoders Chevron down icon Chevron up icon
Generative Adversarial Networks (GANs) Chevron down icon Chevron up icon
Improved GANs Chevron down icon Chevron up icon
Disentangled Representation GANs Chevron down icon Chevron up icon
Cross-Domain GANs Chevron down icon Chevron up icon
Variational Autoencoders (VAEs) Chevron down icon Chevron up icon
Deep Reinforcement Learning Chevron down icon Chevron up icon
Policy Gradient Methods Chevron down icon Chevron up icon
Object Detection Chevron down icon Chevron up icon
Semantic Segmentation Chevron down icon Chevron up icon
Unsupervised Learning Using Mutual Information Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.4
(11 Ratings)
5 star 72.7%
4 star 9.1%
3 star 9.1%
2 star 0%
1 star 9.1%
Filter icon Filter
Top Reviews

Filter reviews by




WU. Mar 20, 2020
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Unlike other authors that release new editions yearly with few revisions, Atienza has packed more than 40% worth of content versus the 1st edition. This is a first for me.The 1st edition is just about identical to the 2nd up to chapter 10, save for some stylistic changes, but half of chapter 10, as well as chapters 11, 12, 13, are brand new.Everything that made the 1st edition great is till here: great exposition of the fundamentals, the math for those that'd like to dig a bit deeper, the great references, as well as clean, understandable, working code.This book is highly recommended as a reference for those looking to move into deeper waters in the production of ML models for use cases that would strain conventional Neural Networks.If I could, however, make a suggestion to all authors of ML books, it would be to PLEASE move away from MNIST, and the CIFAR datasets. I know these are the standard benchmarks in the field but you could just as easily cite this in your repositories and use the real estate in your books to explore other use cases such as anomaly detection in categorical data, time series, etc. This would make your books much more valuable in the hands of industry practitioners not looking to work strictly with images. So let's stop beating those horses yes?Highly Recommended!
Amazon Verified review Amazon
Matthew Emerick Apr 14, 2020
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Disclaimer: The publisher and asked me to review this book and gave me a review copy. I promise to be 100% honest in how I feel about this book, both the good and the less so.Overview:This book is for the advanced student or experienced practitioner of artificial intelligence. It assumes you have a general level of knowledge of implementing various neural network architectures, or at least a good understanding. One caveat I would very much like to point out is that the Preface states that most of the code requires use of a GPU, which is not mentioned in the book's description. Thankfully, there are free options which mitigate this requirement, which can be found through a simple web search.What I Like:The introductory chapter gives enough information on Keras to allow even a novice AI developer to work through the book and get a lot out of it. As someone in the middle of beginner and expert, I appreciate things like that, as they can the reader a refresher of the material in case they haven't used it in a while. In this case, the author thoughtfully runs through examples using common neural network architectures, such as the multilayer perceptron, recurrent neural network, and convolutional neural network. Each section of the review also gives a refresher of the math at just the right level to get the reader ready for the advanced material later in the book. A final reason to appreciate the first chapter is that is gives clear and concise definitions of common terms used by AI practitioners.The overall organization is also well done. I appreciate a book that flows well, as it greatly adds to the understanding when learning from it as well as lends to finding information easier when using it as a reference. Each chapter adds to the complexity of the reader's understanding, but gradually enough to aid with comprehension.What I Don't LikeThis is a difficult section to write. It's not that there is too much to write about, bu the opposite. This book is well written, both by structure and by prose. It's a balanced book to learn from and to refer to. It's a practitioner's book in that it focuses on code over math, but covers both. The topics covered are useful, interesting, and wide ranging. I did mention at the beginning the GPU requirement, but that's all I'm seeing right now.What I Would Like to SeeThis is a great book overall. I would like to see more, either by expanding the book or writing another one. At 512 pages and the number of topics that could have been covered in addition to what is already on there, I would have been fine with the book being longer.Overall, I give this book a 4.9 out of 5 stars. The author did an excellent job writing this book. I can find little fault.
Amazon Verified review Amazon
Prayson Daniel Apr 21, 2020
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Advanced Deep Learning with TensorFlow 2 and Keras is a high-level introduction to Multilayer Perceptron (MLP), Convolutional Neural Network (CNN) and Recurrent Neural Network (RNN). This book is a powerful tool for AI practitioners that already have knowledge of Deep Learning but wish to understand MLP, CNN, and RNN in a technical sense, namely building and training such models.The first chapters introduce basic of Python library Keras via TensorFlow API as a tool for building models architectures. Concepts of such as regularisation, regularisation, performance evaluation, model structures are presented in a way that both novice and a Deep Learning practitioners would find valuable.There is a clear flow of ideas as the author moves from basics to advance models building. This book could have been longer. Natural Language Processing and Audio Processing are topics that are not covered. Nevertheless, what is covered is covered very well.
Amazon Verified review Amazon
Alessandro Apr 27, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
That's really what I needed. A very well written book an advanced deep learning techniques. I have mostly focused my attention on autoencoders and Gans, but the other chapters sound interesting either.
Amazon Verified review Amazon
Ryan Zurrin Apr 21, 2022
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Great reference for anyone looking to get into deep learning and working with tensorflow
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.