Going deeper

Image Modeling with Keras

Ariel Rokem

Senior Data Scientist, University of Washington

Network with one convolutional layer

Image Modeling with Keras

Network with one convolutional layer: implementation

model = Sequential()
model.add(Conv2D(10, kernel_size=2, activation='relu', 
                 input_shape=(img_rows, img_cols, 1)))
model.add(Flatten())
model.add(Dense(3, activation='softmax'))
Image Modeling with Keras

Building a deeper network

Image Modeling with Keras

Building a deep network

model = Sequential()
model.add(Conv2D(10, kernel_size=2, activation='relu', 
                 input_shape=(img_rows, img_cols, 1), 
                 padding='equal'))

# Second convolutional layer model.add(Conv2D(10, kernel_size=2, activation='relu')
model.add(Flatten()) model.add(Dense(3, activation='softmax'))
Image Modeling with Keras

Why do we want deep networks?

Image Modeling with Keras

Features in early layers

Image Modeling with Keras

Features in intermediate layers

Image Modeling with Keras

Features in late layers

Image Modeling with Keras

How deep?

  • Depth comes at a computational cost
  • May require more data
Image Modeling with Keras

Let's practice!

Image Modeling with Keras

Preparing Video For Download...