1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Deep Learning with Keras

Connected

Exercise

Building a CNN model

Building a CNN model in Keras isn't much more difficult than building any of the models you've already built throughout the course! You just need to make use of convolutional layers.

You're going to build a shallow convolutional model that classifies the MNIST digits dataset. The same one you de-noised with your autoencoder! The images are 28 x 28 pixels and just have one channel, since they are black and white pictures.

Go ahead and build this small convolutional model!

Instructions

100 XP
  • Import the Conv2D and Flatten layers and instantiate your model.
  • Add a first convolutional layer with 32 filters of size 3x3 and the corresponding 3D tuple as input_shape.
  • Add a second convolutional layer with 16 filters of size 3x3 with relu activation.
  • Flatten the previous layer output to create a one-dimensional vector.