深入探討

使用 Keras 進行影像建模

Ariel Rokem

Senior Data Scientist, University of Washington

單一卷積層的網路

使用 Keras 進行影像建模

單一卷積層網路:實作

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'))
使用 Keras 進行影像建模

建構更深的網路

使用 Keras 進行影像建模

打造深層網路

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'))
使用 Keras 進行影像建模

為什麼要用深層網路?

使用 Keras 進行影像建模

前期層的特徵

使用 Keras 進行影像建模

中期層的特徵

使用 Keras 進行影像建模

後期層的特徵

使用 Keras 進行影像建模

要多深?

  • 深度會帶來計算成本
  • 可能需要更多資料
使用 Keras 進行影像建模

一起來練習吧!

使用 Keras 進行影像建模

Preparing Video For Download...