in Machine learning

Neuroph: GraphML export

Neuroph is an awesome java neural network framework for machine learning. While I use the framework’s API, it also provides a graphical user interphase which allows visualization of neural networks. Unfortunately, the visualization fails for networks with a large number of nodes. Here I introduce a GraphML export functionality for Neuroph allowing visualization in Gephi.

In my work I use neural networks with several hundred input and hidden nodes. I would like to use interactive visualization and some graph theory algorithms to perform exploratory analysis. For such analyses I normally use Gephi and the R package iGraph, respectively. Both of these tools can import network architectures saved in the GraphML format, which uses XML syntax to describe structural properties of graphs.

I contributed a package to the Neuroph project neuroph.contrib.graphml, which allows export of a trained neural network as a GraphML file, specifying network topology as well as node-labels and learned weights. Export is performed with a few lines of code as shown in

Visualization of the exported network allows easy identification of important network nodes. Let's define important nodes as those with edges with large absolute weight. The GraphML is imported into Gephi, the network visualized in a space-filling way and edges colored by weight:

Neuroph: GraphML export. Neural network. Edges colored according to weight.

Neural network. Nodes are represented as circles, edges as green lines connecting nodes. Edges are colored according to weight.

While this visualization is aesthetically appealing, the edges with large weight are difficult to spot due to the number of edges. This is where the interactive potential of Gephi comes into play. We can selectively show edges with large positive weight (left) or large negative weight (right):

Neuroph: GraphML export. Edges with large positive weight.

Edges with large positive weight.

Neuroph: GraphML export. Edges with large negative weight.

Edges with large negative weight.

We can thus easily identify nodes with high contributing potential. While this example just shows the start of an exploratory analysis, I hope it demonstrates how quick and interactive the GraphML export functionality for Neuroph can make it.

Write a Comment