Creating the model

For the model's architecture, we will use a variation of the VGG network. This architecture is taken from a publicly available script from the forums ( and here we will adapt this example to DeepLearning4j.

VGG is a model that took 2nd place in the image net 2014 challenge, and it uses only 3 x 3 and 2 x 2 convolutional filters.
It is always a good idea to use the existing architectures, as it solves a lot of time--coming up with a good architecture on your own is a challenging task.

The architecture we will use is as follows:

  • Two layers of 3 x 3 convolution with 32 filters
  • Max pooling
  • Two layers of 3 x 3 convolution with ...

Get Mastering Java for Data Science now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.