1 of 50

Deep Learning Adventures TensorFlow In Practice - Presentation 3

A quick overview of Courseraโ€™s Tensorflow in Practice specialization course

Robert Kraig, David Patton, George Zoto

https://www.meetup.com/Deep-Learning-Adventures

2 of 50

In the beginning...

3 of 50

Get to know our community

Hello, my name is ___ and this is my ___ meetup.

I enjoy ___ and I am interested in learning more about ___

Training set ๐Ÿ˜€

Hello, my name is George and this is my 4th meetup. I enjoy applying deep learning to solve interesting problems and I am interested in learning more about data augmentation, transfer learning and NLP.

4 of 50

Not a typical Meetupโ€ฆ Get ready for a fun game ๐Ÿ˜€๐ŸŽ‰

5 of 50

Attribution to Coursera and deeplearning.ai

6 of 50

Chapter 1 - TensorFlow in Practice Specialization

7 of 50

Chapter 1 - TensorFlow in Practice Specialization

8 of 50

Setup

Colaboratory is a free Jupyter notebook environment that requires no setup and runs entirely in the cloud. You can write and execute code, save and share your analyses, and access powerful computing resources, all for free from your browser.

https://colab.research.google.com

9 of 50

Course 2: Convolutional Neural Networks in TensorFlow

Week 1: Exploring a Larger Dataset

Week 2: Augmentation: A technique to avoid overfitting

Week 3: Transfer Learning

Week 4: Multiclass Classifications

10 of 50

Exploring a Larger Dataset

Human-Interactive Proof:

Kaggle Competition: Dogs vs Cats

https://www.kaggle.com/c/dogs-vs-cats/

Metric: Binary Classification Accuracy (i.e. no partial credit)

Winner: Pierre Sermanet ---> Overfeat

https://cilvr.nyu.edu/doku.php?id=software:overfeat:start

https://arxiv.org/abs/1312.6229

https://www.youtube.com/watch?v=3U-bZgKFS7g

11 of 50

Exploring a Larger Dataset

12 of 50

Exploring a Larger Dataset

13 of 50

Exploring a Larger Dataset

Model is badly overfitting!

Training Loss Decreasing

Validation Loss Increasing

Bug fix:

Min Loss

14 of 50

Course 2: Convolutional Neural Networks in TensorFlow

Week 1: Exploring a Larger Dataset

Week 2: Augmentation: A technique to avoid overfitting

Week 3: Transfer Learning

Week 4: Multiclass Classifications

15 of 50

Augmentation: A technique to avoid overfitting

16 of 50

Augmentation: A technique to avoid overfitting

17 of 50

Augmentation: A technique to avoid overfitting

18 of 50

tf.keras.preprocessing.image.ImageDataGenerator

zoom_range: Float or [lower, upper]. Range for random zoom. If a float, [lower, upper] = [1-zoom_range, 1+zoom_range].

fill_mode: One of {"constant", "nearest", "reflect" or "wrap"}. Default is 'nearest'.Points outside the boundaries of the input are filled according to the given mode:

    • 'constant': kkkkkkkk|abcd|kkkkkkkk (cval=k)
    • 'nearest': aaaaaaaa|abcd|dddddddd
    • 'reflect': abcddcba|abcd|dcbaabcd
    • 'wrap': abcdabcd|abcd|abcdabcd

cval: Float or Int. Value used for points outside the boundaries when fill_mode = "constant".

preprocessing_function: function that will be applied on each input. The function will run after the image is resized and augmented.

19 of 50

l

original

constant (cval=0)

constant (cval=100)

nearest

reflect

wrap

20 of 50

Augmentation: A technique to avoid overfitting

21 of 50

Augmentation: A technique to avoid overfitting

22 of 50

Content added after Week 1 and 2, based on group feedback

23 of 50

Course 2: Convolutional Neural Networks in TensorFlow

Week 1: Exploring a Larger Dataset

Week 2: Augmentation: A technique to avoid overfitting

Week 3: Transfer Learning

Week 4: Multiclass Classifications

24 of 50

Transfer Learning

25 of 50

Extra Content - Classic Networks

1998

26 of 50

Extra Content - Classic Networks

2012

27 of 50

Extra Content - Classic Networks

2014

28 of 50

Extra Content - Classic Networks

2015

29 of 50

Extra Content - Classic Networks

2014

30 of 50

Extra Content - Classic Networks

31 of 50

Transfer Learning

The ILSVRC 2014 classification challenge involves the task of classifying the image into one of 1000 leaf-node categories in the Imagenet hierarchy. There are about 1.2 million images for training, 50,000 for validation and 100,000 images for testing. Each image is associated with one ground truth category, and performance is measured based on the highest scoring classifier predictions.

top-1 accuracy rate compares the ground truth against the first predicted class

top-5 error rate compares the ground truth against the first 5 predicted classes. An image is deemed correctly classified if the ground truth is among the top-5, regardless of its rank in them. The challenge uses the top-5 error rate for ranking purposes.

32 of 50

Transfer Learning

33 of 50

Transfer Learning

34 of 50

Course 2: Convolutional Neural Networks in TensorFlow

Week 1: Exploring a Larger Dataset

Week 2: Augmentation: A technique to avoid overfitting

Week 3: Transfer Learning

Week 4: Multiclass Classifications

35 of 50

Multiclass Classifications

36 of 50

Multiclass Classifications

Loss Functions for Multi-Class:

One-Hot Encoding: categorical_crossentropy

Integer Representation: sparse_categorical_crossentropy

37 of 50

Multiclass Classifications

The American Sign Language letter database of hand gestures represent a multi-class problem with 24 classes of letters (excluding J and Z which require motion).

Source: https://www.kaggle.com/datamunge/sign-language-mnist

38 of 50

Course 2: Convolutional Neural Networks in TensorFlow

Week 1: Exploring a Larger Dataset

Week 2: Augmentation: A technique to avoid overfitting

Week 3: Transfer Learning

Week 4: Multiclass Classifications

39 of 50

Extra Content - Regularization

40 of 50

Extra Content - Batch Normalization

41 of 50

Extra Content - Overfitting in Neural Networks

Total params: Tiny: 0.5K

Small: 0.7K

Medium: 10K

Large: 800K

The Higgs Dataset: 11M samples, 28 features, binary class

42 of 50

Content added after Week 3 and 4, based on group feedback

Source: https://tfhub.dev

43 of 50

Course 2: Convolutional Neural Networks in TensorFlow - Questions

  1. โ€ฆ
  2. โ€ฆ
  3. ...

44 of 50

Check out these resources

45 of 50

Check out these events and Meetups

46 of 50

Check out this new certification and new event

47 of 50

Letโ€™s keep it up and continue our TensorFlow journey ๐Ÿ˜€

48 of 50

Time for a fun game ๐Ÿ˜€๐ŸŽ‰

49 of 50

Time for a fun game ๐Ÿ˜€๐ŸŽ‰

50 of 50

Questions

Discussion