Network topology

You may have encountered a diagram similar to the aforementioned that depicts a convolutional neural network to a feedforward neural network architecture. We'll be building something such as this very soon! But what's being depicted here? Check it out:

In the preceding diagram, on the very left, we have our input. These are the extracted features of our image, the matrix (as was the case with the grayscale cat burrito) of values ranging from 0 to 255 that describe the pixel intensities present in the image.

Next, we pass the data through alternating convolutional and max-pooling layers. These layers define the convolutional neural network component of the architecture depicted. We'll describe what each of these layer types do in the following two sections.

After this, we pass the data to a fully-connected layer before arriving at the output layer. These two layers describe a fully-connected neural network. You're free to use any multi-class classification algorithm you like here, instead of a fully-connected neural network—a logistic regression or random forest classifier, perhaps—but for our dataset, we'll be using a fully-connected neural network.

The output layer depicted is the same as for any other multi-class classifier. Sticking with our cat burrito example, let's suppose we were building a model to predict what kind of cat burrito an image was from five distinct classes: chicken cat burrito, steak cat burrito, cat burrito al pastor, vegetarian cat burrito, or fish cat burrito (I'll let you use your imagination to visualize what our training data might look like). The output layer would be the predicted probability that the image belonged to one of the five classes, with max(probability) indicating what our model believes to be the most likely class.

At a high level, we've walked through the architecture, or topology of the preceding network. We've discussed our input versus the convolutional neural network component versus the fully-connected neural network component of the preceding topology. Let's dig just a bit deeper now and add some concepts that allow us to describe the topology in more detail:

  • How many convolutional layers does the network have? Two.
  • And in each convolutional layer, how many feature maps are there? There are seven in convolutional layer 1 and 12 in convolutional layer 2.
  • How many pooling layers does the network have? Two.
  • How many fully-connected layers are there? One.
  • How many neurons are in the fully-connected layer? 10.
  • What is the output? Five.

The modeler's decision to use two convolutional layers versus any other number or just a single fully-connected layer versus any other number should be thought of as the hyperparameters of the model. That is, it's something that we, as the modelers, should experiment with and cross-validate but not a parameter our model is explicitly learning and optimizing.

There are other useful things you can infer about the problem you're solving just by looking at the network's topology. As we discussed, the fact that our network's output layer contains five nodes lets us know that this neural network was designed to solve a multi-class classification task for which there are five classes. If it were a regression or a binary classification problem, our network's architecture would (in most cases) have a single output node. We also know that the modeler used seven filters in the first convolutional layer and 12 kernels in the second convolutional layer because of the number of feature maps resulting from each layer (we'll discuss what these kernels are in some more detail in the next section).

Great! We learned some useful jargon that will help us describe our networks and build our conceptual understanding of how they work. Now let's explore the convolutional layers of our architecture.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.82.21