Graph Spectral Regularization For Neural Network Interpretability

Deep neural networks can learn meaningful representations of data . However , these representations are hard to interpret . For example , visualizing a latent layer is generally only possible for at most three dimensions . Neural networks are able to learn and benefit from much higher dimensional representations but these are not visually interpretable because nodes have arbitrary ordering within a layer . Here , we utilize the ability of the human observer to identify patterns in structured representations to visualize higher dimensions . To do so , we propose a class of regularizations we call Graph Spectral Regularizations that impose graphstructure on latent layers . This is achieved by treating activations as signals on a predefined graph and constraining those activations using graph filters , such as low pass and wavelet-like filters . This framework allows for any kind of graph as well as filter to achieve a wide range of structured regularizations depending on the inference needs of the data . First , we show a synthetic example that the graph-structured layer can reveal topological features of the data . Next , we show that a smoothing regularization can impose semantically consistent ordering of nodes when applied to capsule nets . Further , we show that the graph-structured layer , using wavelet-like spatially localized filters , can form localized receptive fields for improved image and biomedical data interpretation . In other words , the mapping between latent layer , neurons and the output space becomes clear due to the localization of the activations . Finally , we show that when structured as a grid , the representations create coherent images that allow for image-processing techniques such as convolutions . 1 INTRODUCTION . Neural networks have revolutionized many areas of machine learning including image and natural language processing . However , one of the major challenges for neural networks is that they are still black boxes to the user . It is not quite clear how network internals map from inputs to outputs or how to interpret the features learned by the nodes . This is mainly because the features are not constrained to have specific structure or characteristics . Existing regularizations constrain the learned code to have certain properties . However , they are not designed to specifically aid in interpretation of the latent encoding . For example , L1 regularization induces sparsity in the activations but does not impose specific structure between dimensions . Here , we introduce a new class of regularizations called Graph Spectral Regularizations that result in activations that are filtered on a predefined graph . We define specific members of this class for applications . First , we introduce a ( graph ) Laplacian smoothing regularization which enforces smoothly varying activations while at the same time reconstructing the data . This regularization is useful for learning features with specific topologies . For instance , we show that on a clusterstructured topology where features correspond to hierarchical cluster structure in the data it reflects the abstract grouping of features . We also show it is useful for inducing feature consistency between nodes of capsule networks ( Sabour et al. , 2017 ) . The graph regularization semantically aligns the features such that they appear in the same order in each capsule . When trained on MNIST digits , we find that each of our 10 capsules consisting of 16 nodes encodes the same transformation ( rotation , scale , skew , etc ) of a particular digit in the same node . While the Laplacian smoothing regularizations is useful in the context where the features of the data have a recognizable topology , often we don ’ t know the explicit structure of the data . Instead , we would like to extract the topology of the data itself . Thus , we design a filter that encourages the graph structure layer to learn data-shape features . We achieve this by using a spatially localized , Gaussian filter to localize the activations for any particular data point . We ensure that only one of a dictionary of localized filters is chosen as the activation via a spectral bottleneck layer preceding the graph-structured layer . We show that spatially-localized filter regularizations are useful for detecting circular and linear topologies of data that are not immediately reflected by the observed features . We also explore a biological system – a single-cell protein expression dataset depicting T cell development in the thymus – that has continuous progression structure . The graph structured layer ( with a ring graph ) reveals the data to have a Y-shaped topology reflecting the bifurcation into CD4 ( regulatory ) and CD8 ( cytotoxic ) T cells , confirming known T cell biology . Finally , we show that the graph-structured layer , when imposing a 2D grid , creates a “ pseudo ” image that can be analyzed by convolution layers . We show that such re-encoded images of MNIST digits have localized receptive fields that can be used for classification and visual interpretability . Interestingly , we find that the convolution obviates the need for a spectral bottleneck as the convolution and max pooling themselves may provide that function . Our contributions are as follows : • A framework for imposing graph structure on latent layers using graph spectral regularizations . • A Laplacian graph smoothing regularization and its applications in learning feature smooth- ness and consistency . • Spatially localized graph regularizations using a spectral bottleneck based on a dictionary of Gaussian Kernels and its application in recognizing data topology . • Applications of graph spectral regularizations , natural and biological datasets to demon- strate feature interpretability and data topology . The rest of this paper is organized as follows . We first define graph structured layers and two techniques utilizing this layer in Section 2 . Then we present experiments demonstrating improved interpretability in Section 3 . Finally , we wrap up with conclusions in Section 4 . 2 GRAPH-STRUCTURED LAYER . Consider a given layer in an artificial neural network , and let V = { ν1 , . . . , νn } be the neurons in this layer . These neurons can essentially be regarded as functions of inputs to the neural network , and map each input to an n dimensional vector ν ( x ) = [ ν1 ( x ) , . . . , νn ( x ) ] T ∈ Rn . Typically , no particular structure is being directly imposed on the range of ν beyond general notions of bounded Lp norm ( e.g. , Euclidean L2 norm or L1 norm as a proxy for sparsity ) . This is clear with fully connected layers , but even with convolutional ones that introduce some relation between neurons within each layer , there is still no clear topological structure for the representations obtained by the entire layer as a whole . Indeed , convolutional layers typically learn multiple channels ( or filters ) from input signals , and while neurons within each channel can be organized in spatiotemporal coordinates , there are no imposed relations between the different channels . Since many applications of neural networks essentially focus on supervised learning tasks ( whether predictive or generative ) , where hidden layer neurons are only used as intermediate computational units , their unstructured nature is not considered an important issue . However , when using neural networks for unsupervised and exploratory tasks , in which the hidden layers are treated as latent data representations , their lack of structure makes the interpretation of the resulting representations challenging if not impossible . To address this challenge , autoencoders and similar unsupervised deep models typically restrict their bottleneck layer to have two or three neurons , thus mapping data points to R2 or R3 , where the entire data can be visualized as a 2D or 3D cloud of points . While this approach is useful for getting a general understanding of structures ( e.g. , clustering or trends ) in the data , it significantly limits the amount of information that can be captured by such latent representations . Furthermore , it underutilizes the ability of a human observer to identify rich patterns in 2D displays . Indeed , human perception in natural settings is not tuned to observe particle clouds , but rather to recognize shapes , identify textures , and assess relative sizes of objects . Such elements are often used by visualization techniques in various fields , such as TreeMap ( Shneiderman , 1992 ) , audio spectrograms ( Flanagan , 1972 ) , and even classic box plots and histograms ( Tukey , 1977 ) . Here , we propose a new approach for producing human interpretable patterns in the latent representation obtained by hidden layers of neural networks . To this end , we impose a graph topology on the neurons in V , which enables us to control spectral properties ( e.g. , regularity and locality ) of latent representations obtained by them to produce recognizable patterns . Formally , we consider the neurons V as vertices of a graph with weighted edges between them defined by an n× n adjacency matrixW . Then , for any given input x to the network , we consider the activations [ ν1 ( x ) , . . . , νn ( x ) ] as a signal ν over this neuron graph . We propose here three ways to utilize this graph signal structure of a neural network layer . First , by considering graph signal processing notions , we can define spectral regularizations that control the regularity or smoothness of learned signals , as explained in Section 2.1 . Second , by utilizing sparse graph wavelet dictionaries , we can define a new type of bottleneck that forces autoencoder middle layers to encode inputs by sparse set of localized dictionary atoms ( e.g. , as done in compressive sensing and dictionary learning ) , as explained in Section 2.2 . Finally , by utilizing simple graph structures , such as a ring graph or a 2D lattice we can force downstream layers to be convolutional layers , regardless of whether the input of the network was structured or not . Section 3 demonstrates the utility of each of these design choices for several data exploration applications , in both supervised and unsupervised settings . 2.1 SPECTRAL GRAPH REGULARIZATION . The graph structure defined by the weighted adjacency matrix W naturally provides a notion of locality , based on local graph neighborhoods , or geosesic distances on the graph . However , recent works on graph signal processing ( e.g. , Shuman et al. , 2013 , and references therein ) also explored spectral notions provided by graph structures , which extend and generalize traditional signal processing and harmonic analysis notions . These notions are based on the definition of a graph Laplacian as L = D −W , D = diag ( deg ( ν1 ) , . . . , deg ( νn ) ) , deg ( νj ) = ‖W ( j , · ) ‖1 , j = 1 , . . . , n , which provides ( either directly or via proper normalization ) a discrete version of well-studied manifold Laplace operators from geometric harmonic analysis ( e.g. , Belkin & Niyogi , 2002 ; Coifman & Lafon , 2006 ) . Then , the eigenvectors ψ0 , . . . , ψn−1 of L ( indexed by convention in ascending order of the corresponding eigenvalues ) are considered graph Fourier harmonics . These can be shown to converge to discrete Fourier harmonics when considering a ring graph , in which case their associated eigenvalues , 0 = λ0 ≤ · · · ≤ λn−1 , correspond to squared frequencies . This understanding gives rise to the graph Fourier transform defined as a linear transformation characterized by the matrix Ψ whose columns are the graph harmonics { ψj } n−1j=0 . When applied to a neuron-activation signal ν in our setting we get its graph Fourier coefficients as ν̂ = ΨTν , where ν̂ is associated with the graph ( squared ) frequency λj . Similarly , the inverse Fourier transform is also defined via Ψ , as it can be verified that Ψν̂ = ΨΨTν = ν , since the graph Laplacian ( for all graphs considered in this work ) yields a full orthonormal set of eigenvectors , and thus Ψ is an orthogonal matrix . The graph Fourier transform allows us to consider the activations ν ( x ) for a given input x of the network in two domains . First , in their original form , these activations form a signal over the neuron graph , which can essentially be considered as a function of individual neurons , with ν ( x ) [ i ] = νi ( x ) , i = 1 , . . . , n , which we refer to as the neuron-domain representation . Alternatively , we can consider this signal in the spectral domain , via its Fourier coefficients , as a function ν̂ ( x ) [ j ] , j = 0 , . . . , n−1 , of graph-harmonic indices . This allows us to pose a new set of regularizations that are defined in the spectral domain , rather than in the neuron domain , in order to directly enforce spectral properties of the neuron activation signal . We note that one of the most popular regularization traditionally used in deep learning is the L2 regularization , which essentially adds the squared Euclidean norm of the activations in the neuron domain ( i.e. , ‖ν ( x ) ‖22 ) as another term in the main optimization target for gradient descent . Such regularization encourages the activations to all have equivalently small values , essentially providing a global notion of smoothness that is then balanced with other loss terms but typically provides stability to the optimization process ( Goodfellow et al. , 2016 ) . Since it can be verified that the graph Fourier transform is energy preserving ( i.e. , due to the orthonormality of graph harmonics ) , this regularization can equivalently be considered in the spectral domain by using ‖ν̂ ( x ) ‖22 instead of ‖ν ( x ) ‖22 . However , unlike the neuron domain , in the spectral domain we can associate with each element in ν̂ ( x ) a frequencial interpretation given by { λj } nj=0 , and therefore we can also generalize the spectral L2 regularization to be weighted by functions of these squared-frequencies . Namely , given weights µj = µ ( λj ) , j = 0 , . . . , n − 1 , for some function µ , we define the spectral L2 ( µ ) regularization as adding the term ‖ν̂ ( x ) ‖2L2 ( µ ) = n−1∑ j=0 µj ( ν̂ ( x ) [ j ] ) 2 = [ ν̂ ( x ) ] T µ ν̂ ( x ) , where µ = diag ( µ0 , . . . , µn−1 ) , to the optimization loss of the neural network . Notice that such weighting can not be directly defined in the neuron domain , as individual neurons are not associated with any a priori interpretation . Instead , to apply the spectral regularization in the neuron domain , we consider the matrix form on the RHS , and by combining it together with the definition of the graph Fourier transform we can write the L2 ( µ ) spectral regularization term in the neuron domain as the quadratic form [ ν ( x ) ] TF ( µ ) ν ( x ) , where F ( µ ) = ΨµΨT is a matrix that is independent of the network input x , and can thus be directly computed in advance from the neuron graph structure , and the predetermined spectral weights in µ . Finally , while in this work we focus on the L2 ( µ ) form of spectral regularizations , in general other weighted norms ( e.g. , L1 ( µ ) or more generally Lp ( µ ) , p ≥ 1 ) can also be used to define spectral regularizaions based on based on the harmonic structure induced by the neuron graph . Laplacian smoothing regularization : we now focus on given class of L2 ( µ ) spectral regularizations with nonnegative weights , i.e. , µ ≥ 0 . In such cases , the chosen weights determine which harmonic bands to penalize , and by how much , in the resulting regularization . Therefore , these spectral regularization enable to guide the latent representation provided by the graph-structured layer towards , or away from , certain harmonic patterns . In particular , this enables us to encourage smooth latent representations ( over the neuron graph sense ) by using weights that penalize high frequency . A natural choice for such weights is to simply set them by the identity µ ( λj ) = λj , which results in F ( µ ) = L. We refer to this regularization as Laplacian smoothing , as the resulting quadratic loss term for it is [ ν ( x ) ] TLν ( x ) , and demonstrate its utility for producing interpretable latent representations in hidden layers of neural networks in Section 3 .

Summary: Authors highlight the contribution of graph spectral regularizer to the interpretability of neural networks. Specifically, authors consider the Laplacian smoothing regularizer to enhance the local consistency/smoothness between a neuron and its neighbors. Furthermore, by extending the graph Fourier transformation to overcomplete dictionary representation, authors further propose a spectral bottleneck regularizer. Experimental results show that when suitable structural information and corresponding regularizers are imposed, the interpretability of the intermediate layers is improved.