Menu

Helper Module for Deep Learning.

BrainNetCNNs are convolutional neural networks for connectomes.

class pynet.models.brainnetcnn.BrainNetCNN(input_shape, in_channels, num_classes, nb_e2e=32, nb_e2n=64, nb_n2g=30, dropout=0.5, leaky_alpha=0.33, twice_e2e=False, dense_sml=True)[source]

BrainNetCNN.

BrainNetCNN is composed of novel edge-to-edge, edge-to-node and node-to-graph convolutional filters (layers) that leverage the topological locality of structural brain networks.

An E2E filter computes a weighted sum of edge weights over all edges connected either to node i or j, like a convolution. An E2N filter summarizes the responses of neighbouring edges into a set of node responses. A N2G filter can be interpreted as getting a single response from all the nodes in the graph.

BrainNetCNN is able to predict an infant’s age with an average error of about 2 weeks, demonstrating that it can learn relevant topological features from the connectome data. BrainNetCNN can also be applied to the much more challenging task of predicting neurodevelopmental scores.

Reference: https://www2.cs.sfu.ca/~hamarneh/ecopy/neuroimage2017.pdf. Code: https://github.com/nicofarr/brainnetcnnVis_pytorch.

__init__(input_shape, in_channels, num_classes, nb_e2e=32, nb_e2n=64, nb_n2g=30, dropout=0.5, leaky_alpha=0.33, twice_e2e=False, dense_sml=True)[source]

Init class.

Parameters

input_shape: tuple

the size of the functional connectivity matrix.

in_channels: int

number of channels in the input tensor.

num_classes: int

the number of classes to be predicted.

twice_e2e: bool, default False

if set use two E2E filter twice.

nb_e2e: int, default 32

number of e2e filters.

nb_e2n: int, default 64

number of e2n filters.

nb_n2g: int, default 30

number of n2g filters.

dropout: float, default 0.5

the dropout rate.

leaky_alpha: float, default 0.33

leaky ReLU alpha rate.

twice_e2e: bool, default False

if set apply two times the Edge-to-Edge layer.

dense_sml: bool, default True

if set reduce the number of hidden dense layers otherwise set nb_n2g to 256.

forward(x)[source]
class pynet.models.brainnetcnn.Edge2Edge(input_shape, channels, filters)[source]

Implementation of the Edge-to-Edge (e2e) layer.

The E2E filter is defined in terms of topological locality, by combining the weights of edges that share nodes together.

__init__(input_shape, channels, filters)[source]

Init class.

Parameters

input_shape: int

the size of the functional connectivity matrix.

channels: int

number of input channel.

filters: int

number of output channel

forward(x)[source]

e2e by two conv2d with line filter.

class pynet.models.brainnetcnn.Edge2Node(input_shape, channels, filters)[source]

Implementation of the Edge-to-Node (e2n) layer.

__init__(input_shape, channels, filters)[source]

Init class.

Parameters

input_shape: int

the size of the functional connectivity matrix.

channels: int

number of input channel.

filters: int

number of output channel

forward(x)[source]

e2n by add two conv2d.

class pynet.models.brainnetcnn.Node2Graph(input_shape, channels, filters)[source]

Implementation of the Node-to-Graph (n2g) layer.

__init__(input_shape, channels, filters)[source]

Init class.

Parameters

input_shape: int

the size of the functional connectivity matrix.

channels: int

number of input channel.

filters: int

number of output channel

forward(x)[source]

n2g by convolution.

Follow us

© 2019, pynet developers .
Inspired by AZMIND template.