2 min read

Exploring Neural Networks

Exploring Neural Networks

This is an exploration into the inner mechanics of neural networks. Each image in this series emphasizes a different layer in the network, showing how different components come together in a complex algorithm.

sleeping brain

But first, a primer…

Deep neural networks combine layers of artificial “neurons” that apply transformations to data. It starts with our input data. In our case, it’s a bunch of numerical values representing pixels in an image. The network takes that input and passes it through a series of layers where the output from the previous layer is the input to the next layer (roughly). Each layer transforms its inputs using what it has learned about the dataset so far. After going through many of these layers, it becomes possible to identify complex objects.

This process works similarly to human vision where there are a number of progressive layers of neurons. Each layer enhances the signal it receives by interpreting increasingly complex objects. In both artificial and biological neural networks, earlier layers will identify basic patterns like edges of objects and shading while later layers identify more complex patterns like an eye or leaves.

These images were generated by emphasizing the influence of particular layers. They are in progressive order moving from earlier to later layers. The original image is at the end.

You can see how enhancing the first couple layers results in strokes and other basic patterns. This is because they have learned basic edges and their orientation.

With higher level layers, we see more complex (and sometimes downright strange) effects. Since the model was originally trained on an image dataset with many animals, you’ll see eyes and the faces of dogs.  In one layer, you also see my chest covered with dog fur and a dog face. In the final layers, you see far fewer distortions as those layers have learned more complex objects.

This is a complex process and I glossed over many of the details. But that’s the gist of how human and computer vision operates. In brief: information is processed in a hierarchical manner where low level inputs are gradually abstracted into more complex representations.

See this link to walk through the images in more detail.