Visualisation of neuronal networks

By Marcel Bock
April 2019

Hire Marcel

For more than 50 years, machine learning methods are developed. Methods like k-nearest Neighbor or Decision Trees are used to find patterns in data and to classify data. That way, new knowledge can be gained. The first neural network was developed in the 1950s. Neural networks are a machine learning method and are inspired by the functionality of the human brain. A neural network consists of nodes, the neurons, which are arranged into layers. Each neuron computes a mathematical function and send it to neurons of a subsequent layer.

Neural networks are used in many domains. Convolutional Neural Networks can detect objects and persons on pictures, the car industry uses them to develop new driver assistance systems and autonomous cars and software like AlphaGo can beat the Go world champion and even develop new moves with the help of a neural network.

Those networks present developers with a problem: Because of their complexity, it is very difficult to comprehend why the neural network has computed a certain result. That is why detecting and fixing errors in neural networks is very hard.

Related Work

The results of neural networks can be improved by testing different parameter values while the improvements are based on the experience of the programmer. An indicator for an improvement of the model is the precision value. The precision can be checked by using test-data which will be classified by the neural network while the classes of the test-data is known, already. The change of the precision value indicates the impact of the change of the parameter values. But this method does not enable an insight into the model and the user does not know at which point in the computation an error has occurred or why a certain parameter affects the outcome of the model.

For a better comprehensibility of neural networks and their results, some techniques were developed, already. Saliency Maps project the activation of neurons onto the input image. A neuron is called “active” when its function computes a positive result. That projection helps to understand which regions in a picture were used for the classification by the network. Class Activation Maps enhance this technique by adding the probability values for each class which was detected on an input image.

In 2017, the software ActiVis was introduced, which visualizes a neural network as a computational graph. For each layer, information is provided in structured menus. For example, the activation values of each neuron can be displayed or the distribution of classes.

TensorFlow Playground is a web-based application which is aimed at beginners with neural networks. The application visualizes a simple neural network, the connections between the neurons and the results of each neuron. It is possible for the user to adjust different settings of the model and to watch their influence for the results.

The prototype

For my master thesis, I decided to visualize a neural network in 3D, as there are only a few approaches which do that. My leading question was if such a visualization could enhance the comprehensibility. The prototype was developed with Unreal Engine 4 for which a TensorFlow Plug-in is available to use neural networks. A Convolutional Neural Network, which classifies images of numbers, was used as the base for the prototype. After a user created and send a neural network to the Unreal Engine, the model will be generated automatically in a 3D-scene. Layers are displayed as flat Cubes and for each layer, the neurons can be displayed as Spheres. This way the structure of the model should be more comprehensible for the user.

Each neuron has a menu which provides information in a structured way. Besides the result image of the neuron, the user can have a look at the results for different test-data images, as well. This should help the user better understand the function of a specific neuron. Dense Layer are a special form of a layer which returns an activation value as a result. This activation values are represented by green colour and the brighter a neuron shines the higher its activation value will be. This way the user can see which neurons are active or inactive without opening menus. The user has the opportunity to enable and disable neurons, as well, to see how the result of the model is influenced by those changes.

Models of neural networks can become very large with thousands of neurons. Even modern graphic-cards can be overchallenged by that. Because of that, a Level-of-Detail method was used to visualize the neural network partly. The closer the user approaches the model the more layers and neurons will be displayed. This way the neural network will not be displayed at once and graphic-memory can be saved.

During an evaluation of the prototype, standards for visualizations of neural networks to enhance the comprehensibility could be registered. Different kinds of neural network models should be supported and a flexible way to load those models should be provided, for example, an own file format. When the user changes settings of the model the changes should be visualized during runtime in the 3D-scene. The information of the neural network should be displayed or hide by the user individually and for each level of detail, the information should be summarized.


At the end of my master thesis, a prototype for the visualization of a neural network was developed. The evaluation could help to provide standards for future developments of visualization to enhance the comprehensibility of neural networks. The evaluation helped to provide ideas for enhancements, too. The information of neurons could be summarized and displayed in a special menu for layers. For example, the result images of the neurons could be computed into one single image for the layer or the mean of activation values could be computed. This way the user could better decide which layers are of interest for finding errors. Saliency Maps and Class Activation Maps could be integrated, as well, to enhance the comprehensibility of the model. Those techniques are enabled by the plug-in and could be integrated easily.

A software for visualization of neural networks needs to support a different kind of neural networks and data. For audio- or text-data, new classes have to be developed which enable to display information for those data types. It would be possible to play audio files in the 3D scene or to display texts. Users should not need to enhance the code of the software, themselves. Therefore, a new file format could be developed which enables the user to deliver the neural network and data which should be used by the software. The software itself creates the necessary model for the visualization, automatically. In the future, the prototype could be used for Virtual- or Mixed Reality environments, as well. Gesture control would need to be implemented to enable the user to interact with the menus and the model in those environments. The Oculus Rift is supported by the Unreal Engine, already. There exist plug-ins for the HoloLens, as well. It would be very exciting to understand if a visualization in a virtual reality can enhance the comprehensibility of neural networks even further and has more - yet unkown - advantages.

Author: Marcel Bock, Computer Visualist Expert

Marcel completed his master in "Computer Vision" (Computervisualistik) at the University of Koblenz. In cooperation with the DLR (German Aerospace Center) he researched and developed visualization techniques. His findings have been published by the DLR and will contribute to future research.

Hire Marcel