Based on the trained NN model, we build a gene regulatory network by identifying for each predicted gene at the output of the NN, the genes at the input that contribute to the predicted value. Let
F denote the function implemented by our NN model, and (
y1, …,
yN) =
F(
x1, …,
xN,
xct,
xpid) the computation of the
N output genes from the
N input genes plus the ‘ct’ and ‘pid’ variables, we would like to identify for each data point a matrix of ‘relevance scores’ of size
N ×
N containing the contribution of each input gene
i to each output gene
l.
The problem of computing these scores for some function
F evaluated at some data point
x is known as
attribution. Many approaches have been proposed for attribution, e.g. (11 (
link),24 ,25 ). Here, we use the Layer-wise Relevance Propagation (LRP) (11 (
link)) approach for its robustness and advantageous computational properties as it lets us extract for each output
yl the collection of scores in the order of a single forward/backward pass. The LRP procedure starts at the output of the NN with a particular predicted gene value
yl and redistributes this score to the input of the NN in an iterative layer-wise manner. Let
j and
k be indices for neurons at two adjacent layers, and let
aj and
ak denote their respective activations. Activations at these two layers are related via the neuron equation: where
jk,
bk are the neuron parameters learned from the data, where ρ is a ReLU or linear activation function, and where ∑
0, j sums over all input neurons
j plus a bias (represented as a constant activation
a0 = 1 and weight
0k =
bk). Denote by
Rk the relevance score that has been attributed on neuron
k by propagation of
yl from the top-layer back to the layer of neuron
k. To propagate relevance scores one layer below (i.e. onto the layer of neuron
j), we use the propagation rule: where ( · )
+ and ( · )
− are shortcut notations for max (0, ·) and min (0, ·). This rule is known as ‘generalized LRP-γ’, and used in (19 (
link),26 ). The parameter γ is a hyperparameter that needs to be selected to maximize explanation quality. When reaching the input layer, we get 2 ·
N explanation scores representing gene contributions (each gene being represented as a pair of two values at the input of the NN), plus a few more scores associated to ‘ct’ and ‘pid’ features. We reach the desired
N explanation scores by ignoring the ‘ct’ and ‘pid’ scores, and then reducing (i.e. summing) the remaining 2 ·
N scores into a
N-dimensional vector representing the contribution of each gene.
The LRP procedure is repeated
K =100 times for random sets of predicting genes and the ‘raw’ LRP score (which we denote by
LRPr) is then defined as the average over these random sets of genes.
LRPr scores are then computed for all predicted genes which leaves us with a
N ×
N matrix of LRP scores representing gene-to-gene interactions. Subsequently, self-loops are excluded and the absolute undirected
LRPau scores for every pair of genes A and B are calculated as .
Keyl P., Bischoff P., Dernbach G., Bockmayr M., Fritz R., Horst D., Blüthgen N., Montavon G., Müller K.R, & Klauschen F. (2023). Single-cell gene regulatory network prediction by explainable AI. Nucleic Acids Research, 51(4), e20.