fchollet / deep-learning-with-python-notebooks

Jupyter notebooks for the code samples of the book "Deep Learning with Python"
MIT License
18.17k stars 8.53k forks source link

5.2 Worse result when use SeparableConv2D to replace Conv2D #138

Closed XZLeo closed 4 years ago

XZLeo commented 4 years ago

Since the depthwise convnet is highlighted in the book several times and seems promising. I tried to replace all the Conv2D with SeperableConv2D in the code of 5.2 - Using convnets with small datasets. I ran all the programs on colaboratory.

First, I didn't change the model structure, in which data augumentation was adopted.

  1. The accuracy of original Conv2d is around 84% after training for 100 epochs. Conv2D
  2. The accuracy of SeperableConv2D is around 73% after training for 100 epochs.

Secondly, I replaced the second last FC layer with a GlobalAveragePooling layer, since most of the parameters belong to FC layers.

To summary, through the experiments, I didn't find the SeperateConv2D as promising as it's described in the book, though it did reduce the parameters largely. And it didn't reduce the training time very much. Maybe it's because colab needs extra time for data transimission.