Characterizing and Measuring the Similarity of Neural Networks with Persistent Homology 
Authors: David Pérez Fernández
Asier Gutiérrez-Fandiño
Jordi Armengol-Estapé
Marta Villegas
Venue: ICLR 2022 Submitted (2022)
Keywords: Neural Networks
Topological Data Analysis
similarity
Persistent Homology

Abstract: Characterizing the structural properties of neural networks is crucial yet poorly understood, and there are no well-established similarity measures between networks. In this work, we observe that neural networks can be represented as abstract simplicial complex and analyzed using their topological 'fingerprints' via Persistent Homology (PH). We then describe a PH-based representation proposed for characterizing and measuring similarity of neural networks. We empirically show the effectiveness of this representation as a descriptor of different architectures in several datasets. This approach based on Topological Data Analysis is a step towards better understanding neural networks and a useful similarity measure.

Under review as a conference paper at ICLR 2022
CHARACTERIZING AND MEASURING THE SIMILARITY OF NEURAL NETWORKS WITH PERSISTENT HOMOL- OGY
Anonymous authors Paper under double-blind review
ABSTRACT
Characterizing the structural properties of neural networks is erucial yet poorly understood, and there are no well-established similarity measures between net- works. In this work, we observe that neural networks can be represented as abstract simplicial complex and analyzed using their topological 'fingerprints' via Persis- tent Homology (PH). We then describe PH-based representation proposed for characterizing and measuring similarity of neural networks. We empirically show the effectiveness of this representation as descriptor of different architectures in several datasets. This approach based on Topological Data Analysis is a step towards better understanding neural networks and a useful similarity measure.
INTRODUCTION
Machine learning practitioners can train different neural networks for the same task. Even for the same neural architecture, there are many hyperparameters, such as the number of neurons per layer or the number of layers. Moreover, the final weights for the same architecture and hyperparameters can vary depending on the initialization and the optimization process itself, which is stochastic. Thus, there is direct way of comparing neural networks accounting for the fact that neural networks solving the same task should be measured as being similar, regardless of the specific weights. This also prevents one from finding and comparing modules inside neural networks (c.g., determining if given sub-nee network does the same function as other sub-network in another model). Moreover, there are no well-known methods for effectively characterizing neural networks.
This work aims to characterize neural networks such that they can be measured to be similar once trained for the same task, with independence of the particular architecture, initialization, or optimization process. To characterize neural networks and measuring their similarity, we assume two different similarities that should be related if the characterization is correct, namely, similarity between the tasks model is trained on, and 2. similarity between neural networks themselves considered as mathematical objects.. We do not provide a mathematical definition for the first one, rather intuitive one, and understand is qualitative similarity between semantically close tasks. For instance, we think that MNIST (10 labels) is closer to MNIST restricted to labels than to language identification, and that MNIST is closer MNIST restricted to 8 labels than to MNIST restricted to labels. For the second one, in this work we propose a similarity measure.
Ideally, this similarity measure should then capture 1. the semantic similarity between the underlying tasks neural networks have been trained on (understanding that networks performing similar tasks should be similar, regardless of their specific weights and architectures), and 2. intrinsic properties of the neural network should also be captured to some degree. Thus, we consider two scenarios, that is, comparing NNs trained for similar tasks, using the mentioned task similarity, and comparing neural networks trained on identical tasks but with different architectures.
We focus on Multi-Layer Perceptrons (MLPs) for the sake of simplicity. We start by observing that we can represent a neural network directed weighted graph to which we can associate certain topological concepts Considering it as a simplicial complex, we obtain its associated Persistent Diagram. Then, we can compute distances between Persistent Diagrams of different neural networks.
See Jonsson (007)) for complete reference graph topology.

---

Under review as a conference paper at ICLR 2022
The proposed experiments aim show that the selected structural feature, Persistent Homology, serves to relate neural networks trained for similar problems and that such a comparison can be performed by means of predefined measure between the associated Persistent Homology diagrams. To test the hypothesis, we study different classical problems (MNIST, Fashion MNIST, CIFAR- 10, and language identification and text classification datasets), different architectures (number and size of layers) as well as control experiment (input order, to which neural network similarity should be invariant). The code and results are fully open source in the Supplementary Material under a MIT license.
In summary, the main contributions of this work are the following: We propose an effective graph characterization strategy of neural networks based on Persistent Homology. 2. Based on this charac- terization, we suggest similarity measure neural networks. 3. We provide empirical evidence that this Persistent Homology framework captures valuable information from neural networks and that the proposed similarity measure meaningful.
The remainder of this paper is organized as follows. In Section 2 we go through the related work. Then, Section we describe our proposal and the experimental framework to validate it. Finally, in sections 4 and 5
we report and discuss the results and arrive to conclusions, respectively.
RELATED WORK
One of the fundamental papers of Topological Data Analysis (TDA) is presented in Carlsson (009) and suggests the use of Algebraic Topology to obtain qualitative information and deal with metrics for large amounts of data. For an extensive overview of simplicial topology on graphs, see Giblin (1977) Jonsson 2007 Aktas et al. (2019) provide a thorough analysis of PH methods.
More recently, number of publications have dealt with the study of the capacity of neural networks using PH. Guss & Salakhutdinov (2018) characterize learnability of different neural architectures by computable measures of data complexity. Donier (2019) propose the concept of spatial capacity allocation analysis. Konuk& & Smith (2199) propose an empirical study of how NNs handle changes topological complexity of the input data.
Rieck et al. (2019b) introduce the neural persistence metric, complexity measure based on TDA on weighted stratified graphs. This work suggests a representation of the neural network as a multipartite graph. They perform the filtering of the Persistent Homology diagrams independently for each layer. As the filtration contains at most I-simplices (edges), they only capture cero-dimensional topological information, i.c. connectivity information. When consecutive layer analysis is used, the global topology of the network is not taken into account making the strong assumption that the NNs encode the learned information layer pairwise exclusively. Additionally, there trivial global transformations of a NN that are not captured by analyzing pairs of layers:
Superfluous cycle insertions: for example, add two neurons and connect their input to a single neuron in lower layer and their two outputs to single output neuron in upper layer with opposite weights.
Identity layer insertions: for instance, insert an intermediate identity layer with neurons and trivially connect to the next layer.
Non-planar neural networks analysis: the analysis of neural networks that use multiple connections between non- concesseeettive layers require higher order topological analysis.
In terms of pure neural network analysis, there are relevant works, like Hofer et al. (2020). that study topological regularization. Clough et al. (2020) introduce a method for training neural networks for image segmentation with prior topology knowledge, specifically via Betti numbers. [Conneauu et al.) (2020) try to estimate (with limited success) the performance gap between training and testing via neuron activations and linear regression of the Betti numbers. This type of representation depend on the input data and not only on the NN function under study. Instead, are interested in characterising and comparing NNs as functions, independently of the data to which they are applied.
On the other hand. topological analysis of decision boundaries has been very prolific area. Rama murthy et al. (2019) propose a labeled Vietoris-Pi Ripss complex to perform PH inference of decision boundaries for quantification of the complexity of neural networks, Naitzat et al. (2020) experiment
2

---

Under review as a conference paper at ICLR 2022
on the PH of a wide range of point cloud input datasets for binary classification problems to see that NNs transform a topologically rich dataset (in terms of Betti numbers) into a topologically simpler one as it passes through the layers. They also verify that the reduction in Betti numbers is significantly faster for ReI. activations than hyperbolic tangent activations.
Regarding neural network representations, (2019), focuses on topologiaal representations of neural networks. They introduce a method for computing PH over the graphical activation structure of neural networks, which provides access to the task-relevant substructures activated throughout the network for a given input.
of the most related works to ours, Gebhart al.
Interestingly, in Watanabe & Yamana 2020
authors work on neural network representations through simplicial complexes based on deep Taylor decomposition and they calculate the PH of neural networks in this representation. In Chowdhury al. (2019), they use directed homology to represent MLPs. They show that the path homology of these networks is non-trivial in higher dimensions and depends on the number and size of the network layers. They investigate homological differences between distinct neural network architectures.
As far as neural network similarity measures are concerned, the literature is not especially prolific. In Kornblith et al. (2019). authors examine similarity measures for representations (meaning, outputs of different layers) of neural networks based on canonical correlation analysis. However, note that this method compares neural network representations (intermediate outputs), not the neural networks themselves. Remarkably, in AAhhmore & Gashler (2015), authors do deal with the intrinsic similarity of neural networks themselves based Forward Bipartite Alignment. Specifically, they propose an algorithm for aligning the topological structures of two neural networks. Their algorithm finds optimal bipartite matches between the nodes of the two MLPs by solving the well-known graph cutting problem. The alignment enables applications such as visualizations or improving ensembles. However, the methods only works under very restrictive assumptions and this line of work does not appear to have been followed up.
Finally, we note that there has been a considerable growth of interest in applied topology in the [3) recent years. This popularity increase and the development of new software libraries along with the growth of computational capabilities, have empowered new works. Some of the most remarkable libraries are Ripser Tralie et al. (2018); Bauer (2021). and Flagser Lütgehetmann et al. (2019). They are focused on the efficient computation of PH. For GPU-Accelerated computation of Vietoris vietoris-Rips PH, Ripser+++ Zhang et al. (2020) offers an important speedup. The Python library we are using, Giotto- TDA Tauzin et al. (2020). makes use of both above librarics underneath.
We have seen that there is trend towards the use of algebraic topology methods for having better understanding of phenomena of neural networks and having more principled deep learning algorithms. Nevertheless, little to works have proposed neural network characterizations or similarity measures based on intrinsic properties of the networks, which is what we intend to do.
3 METHODOLOGY
In this section, we propose our method, which is heavily based on concepts from algebraic topology. We refer the reader to the Supplementary Material for the mathematical definitions. In this section, we also describe the conducted experiments.
Intrinsically characterizing and comparing neural networks is difficult, unsolved problem. First, the network should be represented in an object that captures as much information as possible and then should be compared with measure depending on the latent structure. Due to the stochasticity of both the initialization and training procedure, networks are parameterized differently. For the same task, different functions that effectively solve it can be obtained. Being able to compare the trained networks can be helpful to detect similar neural structures.
We want to obtain topological characterizations associated to neural networks trained on given task. For doing so, we use the Persistence Homology (from now on, PH) of the graph associated to a
For example, the two neural networks "must have the same number units in each of their corresponding layers". and the match is done layer by layer. https: wwww math. colostate. wtwpeeeedddddddddddddaaiiiiieeee http:////wagppiooooooooooo/o/aaa
opol
3

---

Under review as a conference paper at ICLR 2022
neural network. We compute the PH for various neural networks learned on different tasks. We then compare all the diagrams for each one of the task.
More specifically, for each of the studied tasks (image classification MNIST, Fashion MNIST and CIFAR- 10; language identification, and text classification on the Reuters dataset), a we proceed as follows: 1. We train several neural network models on the particular problem. 2. We create directed graph from the weights of the trained neural networks (after changing the direction of the negative edges and normalising the weights of the edges). 3. We consider the directed graph simplicial complex and calculate its PH, using the weight of the edges as the filtering parameter, which range from 0 1. This way we obtain the so-called Persistence Diagram. 4. We compute the distances between the Persistence Diagrams (prior discretization of the Persistence Diagram so that can be computed) of the different networks. 5. Finally, we analyze the similarity between different neural networks trained for the same task, for a similar task, and for a completely different task, independently of the concrete architecture, to see whether there is topologiaal similarity.
As baselines, we set two standard matrix comparison methods that are the 1-Norm and the Frobenius norm. Having adjacency matrix A and B, we compute the difference as norm(A A - B). However, these methods only work for matrices of similar size and thus, they are not general enough. We could also have used the Fast Approximate Quadratic assignment algorithm suggested in Vogelstein et al. (2013). but for large networks this method becomes unfeasible to compute.
3.1 PROPOSAL
Our method is as follows. We start by associating to neural network a weighted directed graph that is analyzed as an abstract simplicial complex consisting on the union of points, edges, triangles, tetrahedrons and larger dimension polytopes (those are the elements referred as simplices). Abstract simplicial complexes are used in opposition to geometric simplicial complexes, generated by a point cloud embedded in the Euclidean space I...
Given a trained neural network, we take the collection of neural network parameters as directed and weighted edges that join neurons, represented by graph nodes. Biases are considered new vertices that join target neurons with an edge having a given weight. Note that, in this representation, we lose the information about the activation functions, for simplicity and avoid representing the network as a multiplex network. Bias information could also have been ignored because we want large PH groups that characterize the network, while these connections will not change the homology group dimension of any order.
For negative edge weights, we reverse edge directions and maintain the absolute value of the weights We discard the use of weight absolute value since neural networks are not invariant under weight sign transformations. This representation is consistent with the fact that every neuron can be replaced by neuron from which two edges with opposite weights emerge and converge again on another neuron with opposite weights. From the point of view of homology, this would be represented as a closed cycle. We then normalize the weights of all the edges as expressed in Equation [| where the weight to normalize, W are all the weights and Č is an smoothing parameter that we set to 0.000001. This smoothing parameter is necessary we want to avoid normalized weights of edges to be O. This because implies a lack of connection.
W
max(1 1
max WT) 5)
Given this weighted directed graph, we then define a directed flag complex associated to it. Topology of this directed flag complex can be studied using homology groups Hn In this work we calculate homology groups up to degree 3 (H)-H3) due to computational complexity and our neural network representation method's layer connectivity limit.
The dimensions of these homology groups are known as Betti numbers. The i-th Betti number is the number of i-dimensional voids in the simplicial complex (Bo gives the number of connected components of the simplicial complex, Bn gives the number of non reducible loops and so on). For a
4orr more details, see Section 3.2
4

---

Under review as a conference paper at ICLR 2022
deeper introduction to algebraic topology and computational topology, we refer to Edelsbrunner & Harer (2009): Ghrist (2014).
We work with family of simplicial complexes, Ke, for range of values of & IR that the complex at step E is embedded in the complex at E for i j. i.c. Kg C Kg In our case, E is the minimum weight of included edges of our graph representation of neural networks. Filtration parameter could also be used to select active nodes thought, the library we used does not include this capability.
The nested family of simplicial complexes is called filtratio. We calculate sequence of homology groups by varying the E parameter, obtaining a persistence homology diagram. PH calculations are performed on Z2.
This filtration gives a collection of contained directed weighted graph or simplicial complex Kenin S ... Ke, C Ke, S... .... S Ke where I [0, 1] and Emin = 0, Emax (recall that edge weights are normalized).
Given filtration, one can look the birth, when a homology class appears, and death, the time when the homology class disappears. The PH treats the birth and the death of these homological features in Kg for different values. Lifespan of each homological feature can be represented an interval (birth,death) of the homological feature. For each filtration, we can record all these intervals by a Persistence Barcode (PB) Carlsson (2009). or in a Persistence Diagram (PD), as a collection of multiset of intervals.
As mentioned previously, our interest in this work is to compare PDs from two different simplicial complexes. There are two distances traditionally used to compare PDs, Wasserstein distance and Bottleneck distance. Their stability with respect to perturbations on PDs has been object of different studies Chazal et al. (2012); Cohen-Steiner et al. (2005). As shown in comparative studies such as in Fasy ct al. (2020), different distances and different ways of vectorising persistence diagrams have results with different levels of stability and quality.
In order to make computations feasible and to obviate noisy intervals, we filter the PDs by limiting the minimum PD interval size. We do so by setting minimum threshold n 0.01. Intervals with a lifespan under this value are not considered. Additionally, for computing distances, we need to remove infinity values. As we are only interested in the deaths until the maximum weight value, replace all the infinity values by 1.0.
Wasserstein distance calculations are computationally hard for large PDs (each PD of our NN models has a million persistence intervals per diagram). Therefore we use a vectorized version of PDs instead, also called PD discretization. This vectorized version summaries have been proposed and used on recent literature Adams et al. )) Berry et al. (2020); Bubenik (2015); Lawson et al. (2019): [Rieck] al. (0119)). For the persistence diagram distance calculation, we use the Giotto TDA library Tauzin et al. (2020) and compute the following supported vectorized persistence summaries: 1. Persistence landscape. 2. Weighted silhouette, 3. Heat vectorizations.
3.2 EXPERIMENTAL FRAMEWORK
To determine the topological structural properties of trained NNs, select different kinds of datasets. We opt for four well-known benchmarks in the machine learning community and one regarding language identification: (1) the S dataset for classifying handwritten digit images, (2) the Fashion MNIST Xiao et al. (017) dataset for classifying clothing images into 10 categories, (3) the CIFAR- (CIFAR) dataset for classifying 10 different objects, (4) the Reuters dataset for classifying news into 46 topics, and (5) the Language Identification Wikipedia datase for identifying 7 different languages. For CIFAR- 10 and Fashion MNIST, we pre-train Convolutional NN (CNN), and the convolutional layers are shared between all the models of the same dataset as a feature extractor. Recall that we are focusing on MLPs, so we do not consider that convolutional weights. For MNIST, Reuters and Language Identification, we use an MLP. For Reuters and Language identification datasets, we vectorize the sentences with character frequency.
https::/www.cs. http::/wwww.....oorrooo.eee///aa https///////oooooooooooooooo///t
https://www. fl ht::as///wwwiiyyyyooooooo//////s
cttntifiiaaiio/////ooo on/
data
5

---

Under review as a conference paper at ICLR 2022
Number
Experiment
Index
1
Layer size
1-4
2
Number of layers
5-9
3
Input order
10-14
4
Number of labels
15-19
Table 1: Indices of the experiments of the distance matrices.
We study the following variables (hyperparameters): 1. Layer width, 2. Number of layers, 3. Input orde[].. Number of labels (number of considered classes). We define the base architecture as the one with layer width of 512, layers, the original features order, and considering all the classes (10 in the case of MNIST, Fashion MNIST and CIFAR, 46 in the case of Reuters and 7 in the case of the language identification task). Then, doing one change at a time, keeping the rest of the base architecture hyperparameters. we experiment with architectures with the following configurations: Layer width: 128, 256, 512 (base) and 1024. 2. Number of layers: (base), 4, 6, and 10. 3. Input order: 5 different randomizations (with base structure), the control experiment. 4. Number of labels (MNIST, Fashion MNIST, CIFAR-10): 2, 4, 6, 8 and 10 (base). 5. Number of labels (Reuters): 2, 6, 12, 23 and 46 (base). 6. Number of labels (Language Identification): 2, 3, 4, 6 and 7 (base). Note that this is not a grid search over all the combinations. We always modify one hyperparameter at time, and keep the rest of them in the base architecture. In other words, we experiment with all the combinations such that only one of the hyperparameters is set to non-base value at time. For each dataset, we train times (each with a different random weight initialization) each of these neural network configurations. Then, we compute the topological distances (persistence landscape, weighted silhouette, heat) among the different architectures. In total, we obtain x x distance matrices (5 datasets, 5 random initializations, 3 distance measures). Finally, we average the 5 random initializations, such that we get x matrices, one for each distance on each dataset. All the matrices have dimensions 19 x 19, since 19 is the number of experiments for each dataset (corresponding to the total the number of architectural configurations mentioned above). Note that the base architecture appears times (1, the number of neurons per layer, 1 on the number of layers, on the number of labels and the randomizations of weight initializations). All experiments were executed in machine with NVIDIA V100 of 32GB, Intel(R) Xeon(R) Platinum 8176 CPU @ 2. 10GHz, and of 1.5TB RAM, for a total of around days.
Note that this work focuses on MLPs, however, the method proposed is also applicable CNNs, The resulting NN is highly sparse simplicial complex with large number of parameters which makes PH calculation out of our computation capability for all combination of proposed experiments.
as they have a MLP equivalent 9
4 RESULTS & DISCUSSION
Results from control experiments can be seen in the third group on Figures and 4 In these figures, groups are separated visually using white dashed lines. Experiments groups specified in Table Control experiments in all the images appear very dimmed, which means that they are very similar, as expected. Recall that the control experiments consist of 5 (randomizations) that 25 different neural networks have been trained; each one of the network has more than 690,000 parameters that have been randomly initialized. After the training, results show that these networks have very close topological distance, as expected.
(executions) and
For Figure we computed both 1-norm and Frobenius norm (the baselines) for graphs' adjacency matrices of control experiments. Note that as we ran the experiment five times, we make the mean for each value of the matrix. order to show whether the resulting values are positive or negative, we subtract to the maximum difference of each dataset the norm of each cell separately, we take the absolute value and we divide by the maximum difference of each dataset. Therefore, we obtain five values per dataset. Table 2 shows the statistics reflecting that the distance among the experiments large and, thus, they are not characterizing any similarity but rather an important dissimilarity.
*Order of the imput features, the control experiment. hhttps://aul 12, me. /ma ch ne eareenniinnn wtt///////// 0ttp://229900/// 90099/00//222
html

---

Under review as a conference paper at ICLR 2022
5
10
11
12
12
13
13
14
14
16
16
17
18
18
19
(a) Reuters
(b) Language Identification
0,0
Figure 1: Distance matrices using Silhouette discretization.
MNIST
MNIST
Fashion MNIST
Pashion MNIST
CIFAR-10
CIFAR-I0
Reuters
Reuturs
Langunge
Language
MNIST
Fashiim MNIST
CIFAR-I
Reaters
Language
MNIST
Fachion MNIST
CIFAR-10
Reutem
Langiage
(a) 1-norm
(b) Frobenius norm
Figure Control experiments using norms.
Norm
Minimum
Maximum
Mean
Standard deviation
1-Norm Frobenius
0.6683
4.9159
1.9733 0.4514
1.5693 0.3074
0.0670
0.9886
Table 2: Normalized difference comparison of self-norm against maximum mean distance experiment.
7

---

Under review as a conference paper at ICLR 2022
1.0
MNIST
Fashion MNIST
CTF CT-
Heuters
Language
MNIST
Fashiaa MNSST
CIEAR- 10
Renteys
Language
Figure 3: Control experiment comparison matrix using Silhouette discretization.
Heat distance
Silhouette distance
Dataset
Mean
Deviation
Mean
Deviation
MNIST
0.0291
0.0100
0.1115
0.0364
F. MNIST
0.0308
0.0132
0.0824
0.0353
CIFAR-10 10
0.0243
0,0068
0.0769
0.0204
Language I.
0.0159
0.0040
0.0699
0.0159
Reuters
0.0166
0.0051
0.0387
0.0112
Table 3: PH distances across input order (control) experiments, normalized by dataset.
In contrast, Figure 3 with our method (Silhouette), shows perfect diagonal of similarity blocks. In the corresponding numeric results, obtained small distances, shown in Table We can appreciate that each dataset has its own hub. This confirms the validity of our proposed similarity measure.
The method we present also seems capture some parts of hyperparameter setup. For instance, in Figure 4 we can observe gradual increase of distances in the first group regarding layer size meaning that, as layer size increases, the topological distance increases too. Similarly, for the number of layers (second group) and number of labels (fourth group) the same situation holds. Note that in Fashion MNIST and CIFAR-10. 10, the distances are dimmer because we are not dealing with the weights of the CNNs. Recall that the CNN acts frozen extractor and are pretrained for all runs (with the same weights), such that the MLP layers themselves are the only potential source of dissimilarity between runs. Thus, our characterization is sensitive to the architecture (e.g., if increase the capacity, distances vary), but at the same time, as we saw before, it is not dataset-agnostic, meaning that it also captures whether two neural networks are learning the same problem not.
In Figure Fashion MNIST (Figure 4b) and CIFAR (Figure 4c dataset results are interestingly different from those of MNIST (Figure 4a) dataset. This is, presumably, because both Fashion MNIST and CIFAR use a pretrained CNN for the problem. Thus, we must analyze the results taking into account this perspective. The first fully connected layer size is important it can avoid bottleneck from the previous CNN output. Some works in the literature show that adding multiple fully connected layers does not necessarily enhance the prediction capability of CNNs Basha et al.) (2019), which is congruent with our results when adding fully connected layers (experiments 5 to 9) that result in dimmer matrices than the one from. Concerning the experiments on input order, there slightly more homogeneity than in MNIST, again showing that the order of sample has negligible influence. Moreover, there could have been even more homogeneity taking into account that the fully connected network reduced its variance thanks to the frozen weights of the CNN. This also supports the fact that the CNN is the main feature extractor of the network. As in MNIST results, CIFAR results show that the topological properties are, indeed, mapping of the practical properties of neural networks. We refer to the Supplementary Material for all distance matrices for all datasets and all distances, well for the standard deviations matrices and experiment group statisties.
8

---

Under review as a conference paper at ICLR 2022
10
14
16
16
19
(a) MNIST
(b) Fashion MNIST
18
14
17
18
19
6
(c) CIFAR-10
0.0
18
Figure 4: Distance matrices using Heat discretization.
CONCLUSIONS & FUTURE WORK
1.0
Results in five different datasets from computer vision and natural language lead to similar topo- logical properties and are interpretable, which yields to general applicability. The best dis- cretizations found are Heat and Silhouette. They show better separation of experiment groups, and are effectively reflecting changes in a sensi- tive way (unlike Landscape discretization).
The most remarkable conclusion comes from the control experiments. The corresponding neu- ral networks, with different input order but the same architecture, very close each other. The PH framework does, indeed, abstract away the specific weight values, and captures latent information from the networks, allowing com- parisons to be based on the function they approx- imate. The selected neural network representation is reliable and complete, and yields coherent and meaningful results. Instead, the baseline measures, the 1-Norm and the Frobenius norm, implied an important dissimilarity between the experiments in the control experiments, meaning that they did solved problem.
Figure 5: Language Identification (Landscape).
not capture the fact that these neural networks were very similar in terms
Our proposed characterization does, indeed, capture meaningful properties. To the best of our knowledge, our proposed similarity measure between neural networks is the first its kind. future work, suggest adapting the method to architectures such CNNs, RNNs, and Transformers (Vaswani et al. 2017). Finally, we suggest performing more analysis regarding the learning of neural network from topological point of view.

---

Under review as a conference paper at ICLR 2022
REFERENCES
H. Adams, Tegan Emerson, M. Kirby, R. Neville, C. Peterson, P. Shipman, Sofya Chepushtanova, E. Hanson, F. Motta, and Lori Ziegelmeier. Persistence images: stable vector representation of persistent homology. J. Mach. Learn. Res., 18:8:1-8:35. 2017.
M. Aktas, E. Akbaş, and Ahmed Fatmaoui. Persistence homology of networks: methods and applications. Applied Network Science, 4:1-28, 2019.
Stephen Ashmore and Michael Gashler. method for finding similarity between multi-layer perceptrons by forward bipartite alignment. In 2015 International Joint Conference on Neural Networks (LJCNN), pp. 1-7, 2015. doi: 10.1 119//CCN.20115.288770
S. H. Shabbeer Basha, Shiv Ram Dubey, Viswanath Pulabaigari, and Snchasis Mukherjee. Impact of fully connected layers on performance of convolutional neural networks for image classification. CoRR, abs/1990.00271, 2019. BtL.htp::/ /bttt::/axxi...../// wrxiv. www./rgggss........... 1902. 02771
Ulrich Bauer. Ripser: efficient computation of vietoris-rips persistence barcodes, 2021.
E. Berry, Yen-Chi Chen, J. Cisewski-Kehe and Brittany Terese Fasy. Functional summaries of persistence diagrams. Journal of Applied and Computational Topology, 4:211-262, 2020.
Peter Bubenik. Statistical topological data analysis using persistence landscapes. J. Mach. Learn. Res., 16:77-102, 2015.
G. Carlsson. Topology and data. Bulletin of the American Mathematical Society, 46:255-308, 2009.
F. Chazal, V. D. Silva, and S. Oudot. Persistence stability for geometric complexes. Geometriae Dedicata, 173:193-214,22 2012.
Samir Chowdhury, T. Gebhart, Steve Huntsman, and Matvey Yutin. Path homologies of deep feedforward networks. 2019 18th IEFE International Conference Machine Learning And Applications (ICMLA), pp. 1077-1082, 2019.
Clough, I. Öksüz, Nicholas Byrne, V. Zimmer, J. Schnabel, and A. King. A topological loss function for deep-learning based image segmentation using persistent homology. IEEE transactions on pattern analysis and machine intelligence, PP, 2020.
D.
H. Fdelsbrunner, and J. Harer. Stability of persistence diagrams. Proceedings of the twenty-first annual symposium on Computational geometry, 2005.
C. Comeenu,, M. Madadi, S. Escalera, and A. Martínez. Computing the testing error without testing set. 2020 JEEF/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp- 2674-2682, 2020.
Jonathan Donier. Capacity allocation analysis neural networks: A tool for principled architecture design. ArXiv, abs/190 htss1992.044885. 2019.
H. Edelsbrunner and J. Harer. Computational Topology an Introduction. American Mathematical Society, 2009.
Brittany Fasy, Yu Qin, Brian Summa, and Carola Wenk. Comparing distance metrics vectorized persistence summaries. In NeurIPS 2020 Workshop on Topological Data Analysis and Beyond, 2020.
T. Gebhart, Paul Schrater, and A. Hylton. Characterizing the shape of activation space in deep neural networks. 2019 18th IEEE International Conference On Machine Learning And Applications (ICMLA), pp. 1537-1542, 2019.
R. Ghrist. Elementary Applied Topology. Self-published, 2014.
Giblin. Graphs, surfaces, and homology an introduction to algebraic topology. Chapman and Hall, 1977.
10

---

Under review as a conference paper at ICLR 2022
William H. Guss and R. Salakhutdinov. On characterizing the capacity of neural networks using algebraic topology. ArXiv, abs/1802.04443, 2018.
C. Hofer, Florian Graf, M. Niethammer, and R. Kwitt. Topologically densified distributions. ArXiv, abs/2002.04805, 2020.
Jonsson. Simplicial complexes of graphs. PhD thesis, KTH Royal Institute of Technology, 2007.
Emir Konuk and K. Smith. An empirical study of the relation between network architecture and complexity. 2019 IEEE/CVF International Conference on Computer Vision Workshop (ICCVW), pp. 4597-4599, 2019.
Simon Kornblith, Mohammad Norouzi, Honglak Lee, and Geoffrey E. Hinton. Similarity of neural network representations revisited. CoRR, abs/1905.0041 2019. URL httphttp///arxi.orrggg
abs/1905.00 00414
P. Lawson, A. Sholl, J. Brown, Brittany Terese Fasy, and C. Wenk. Persistent homology for the quantitative evaluation of architectural features in prostate cancer histology. Scientific Reports, 9, 2019.
Daniel Lütgehetmann, Dejan Gove, Jason Smith, and R. Levi. Computing persistent homology of directed flag complexes. arXiv: Algebraic Topology, 2019.
Gregory Naitzat, A. Zhitnikov, and L. Lim. Topology of deep neural networks. J. Mach. Learn. Res., 21:184:11184:40, 2020.
K. Ramamurthy, Kush R. Varshney, and Krishnan Mody. Topological data analysis of decision boundaries with application to model selection. ArXiv, (bs/1900,,0949, 2019.
Bastian Alexander Rieck, F. Sadlo, and H. Leitte. Topological machine learning with persistence indicator functions. ArXiv, abs/ htss/1977.14966. 2019a.
Bastian Alexander Rieck, Matteo Togninalli, C. Bock, Michael Moor, Max Horn, Thomas Gumbsch, and K. Borgwardt. Neural persistence: A complexity measure for deep neural networks using algebraic topology. ArXiv, abs/1812.09764, 2019b.
Guillaume Tauzin, Umberto Lupo, Lewis Tunstall, Julian Burella Pérez, Matteo Caorsi, Anibal Medina-Mardones, Alberto Dassatti, and Kathryn Hess. giotto-tda: A topological data analysis toolkit for machine learning and data exploration, 2020.
Christopher Tralie, Nathaniel Saul, and Rann Bar-On. Ripser.y:: A lean persistent homology library for python. The Journal of Open Source Software, 3(25):925, Sep 2018. doi: 10.21 2221100//oss.000 00025.. URL http:://rrv..ooggga////66....33 wtw.://///.............. 03762
org/ 10. 21105/ joss 00925
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. CoRR, abs/1706.03762, 2017. URL
Joshua T. Vogelstein, John M. Conroy, Vince Lyzinski, Louis J. Podrazik, Steven G. Kratzer, Eric Harley, Donniell E. Fishkind, R. Jacob Vogelstein, and Carey E. Priebe. Fast approximate quadratic programming for graph matching PLOS ONE, 10(4):1-17, 04 2015. doi: 10. 10.1137/jjo /jjuralll.........
0121002. URL httph:t/////cc. /ttt::://6ii.oo//00... 1371 htwp://jouunaaaam pone. 0121002
S. Watanabe and Hayato Yamana. Topological measurement of deep neural networks using persistent homology. In ISAIM, 2020.
Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-mnist a novel image dataset for benchmarking machine learning algorithms, 2017.
Zhang, Mengbai Xiao, and H. Wang. Gpu-accelerated computation of vietoris-rips persistence barcodes. In Symposium Computational Geometry, 2020.
11


Reviews:
[{"review_id": "xRStNhchQ_0", "reviewer": "Reviewer_WhHV", "summary": "", "questions": "", "limitations": "", "rating": 5, "confidence": 3, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "main_review": "## Strength\n1.\tThis paper presents a new approach to represent neural networks which includes abstract simplicial complex representation and PH method. It is novel and insightful to combine neural networks similarity measure and topological methods. Especially, using PD discretization to measure the similarity is intuitive and reasonable.\n2.\tThis paper is well-supported theoretically. Both the topological characterizations associated to neural networks and PH methods for measuring similarity are technically sound and significant for the problem studied.\n3.\tThis paper is well written and easy to understand. Although I think the display of experimental results could be arranged more reasonably (see weaknesses 1)\n\n## Weakness\n1.\tAs mentioned in the introduction, a correct characterization should be able to distinguish whether two neural networks are trained for the same task, regardless of subtle differences in architecture, input order, etc. However, discussion about how PD discretization recognizes the different types of tasks better than 1-norm and Frobenius norm (similar to figure3), not only in the control experiments, is not clear and sufficient.\n2.\tVery few details are given about the calculation of PD discretization, i.e., Persistence landscape, Weighted silhouette and Heat vectorizations. Their calculation and topological meaning may explain partly why Heat and Silhouette separate the experimental group better than Landscape, which is worth exploring as well.\n\n", "summary_of_the_paper": "In order to characterize and measure the similarity of two neural networks, this paper uses abstract simplicial complex to represent neural networks. The Persistent Homology of the constructed graph associated to a neural network is computed to obtain the corresponding Persistence Diagram. To calculate and quantify the similarity, the authors use supported vectorized persistence summaries: Persistence landscape, Weighted silhouette, and Heat vectorizations respectively and compare their ability to measure the similarities between neural networks. Detailed and complete experiments are conducted on different kinds of datasets. Each experiment only contains one modification on hyperparameter.  Results show that the PH-based representation did characterize and capture latent information from the networks.", "summary_of_the_review": "The motivation and the problem studied in this paper is interesting. The authors present a novel and effective approach to represent neural networks in a topological way and propose a similarity measure using PD discretization, which is supported by the experimental results. However, the discussion part could be more focused on the discretization’s ability to separate the experiment groups, rather than sensitivity to parameter changes. ", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "extra_scores": {"correctness": "3: Some of the paper’s claims have minor issues. A few statements are not well-supported, or require small changes to be made correct.", "technical_novelty_and_significance": "3: The contributions are significant and somewhat new. Aspects of the contributions exist in prior work.", "empirical_novelty_and_significance": "3: The contributions are significant and somewhat new. Aspects of the contributions exist in prior work."}, "extra_text": {}}, {"review_id": "TdNzaOdCREF", "reviewer": "Reviewer_rtBj", "summary": "", "questions": "", "limitations": "", "rating": 3, "confidence": 4, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "main_review": "The article is well written and proposes an interesting approach, but I have some trouble figuring out how powerful and meaningful the method actually is, due to the lack of theoretical back-ups and the vague, hand-waving interpretations of the set of experiments. \n\nI have the following comments:\n\na. I understand that thresholding persistence diagrams is important for keeping the running time reasonable, but, on the other hand, setting the lifespan threshold to 0.01 seems pretty arbitrary. It would be nice to comment about how this threshold was chosen in the text.\n\nb. It is quite difficult to interpret the proposed distance matrices and values. Increasing and decreasing values of distances can be caused by many factors, and not only the ones suggested by the authors. For instance, simply increasing the size of the graphs sometimes results in larger distances just because the persistence diagrams have more points, invalidating some of the authors interpretation. In order to be fully convincing, I think some null statistical model should be provided and compared to, with some corresponding p-values. See for instance https://openreview.net/pdf?id=rHaiOtGdRS. Otherwise, it is impossible to go beyond vague comments and explanations of the results.\n\nc. I am not sure about how useful are these distances. Even though they seem to detect a few properties of the network, they do not seem to always be very discriminative: some architectures with very different hyper parameters coming from different experiment groups can end up quite close in the proposed distance. Indeed, values that are outside of the blocks corresponding to the various experiments can still be very small in the distance matrices. Hence, I am not sure if there are settings in which using this distance actually make sense, practically speaking. Would it be possible, for instance, to do model selection based on it?\n\nd. Topological uncertainty (https://www.ijcai.org/proceedings/2021/367), is a good reference to add in the related work section, since it also aims at characterizing the shape of neural nets with persistence (for another application though).\n\n[Post rebuttal comment] Even though I appreciate the author's responses and suggestions, I still think that the paper requires substantial improvements before publication, so I did not change my grade.\n   ", "summary_of_the_paper": "In this work, the authors propose to characterize neural networks with Topological Data Analysis, more precisely with its main descriptor, the so-called persistence diagram, in order to be able to compare neural networks with different numbers of layers, different numbers of neurons, or trained on different data sets. More specifically, they show that the computational graphs corresponding to the neural networks can be filtered using the edge weights that are learnt during training, in order to produce filtered flag complexes, from which persistent homology can be computed. Then, the authors interpreted the distances between the persistence diagrams obtained from networks with varying parameters (number of layers, neurons, labels), and showed that, often, the distances have intuitive correlation with the complexity of the networks.\n", "summary_of_the_review": "While the approach is novel and interesting, I think the experiments are not convincing enough and too hand-waving to definitely validate the procedure. Since the approach is purely experimental, I think the work is too preliminary for publication.", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "extra_scores": {"correctness": "2: Several of the paper’s claims are incorrect or not well-supported.", "technical_novelty_and_significance": "2: The contributions are only marginally significant or novel.", "empirical_novelty_and_significance": "2: The contributions are only marginally significant or novel."}, "extra_text": {}}, {"review_id": "9MdbKRFTGfX", "reviewer": "Reviewer_HwgX", "summary": "", "questions": "", "limitations": "", "rating": 5, "confidence": 4, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "main_review": "Strength\n- This paper shows that the distance between graphs calculation using TDA is more suitable for comparing tasks than the general method of calculating the distance between graphs.\n- Constructed a framework for comparing trained NNs and demonstrated its effectiveness for simple methods.\n\nWeakness\n- As mentioned in the Related work section of this paper, Rieck et.al.(2019b) have shown a method for representing NNs as graphs and analyzing them with TDA. On the other hand, when the intrinsic graph structures of NNs are similar, they correspond to almost the same task, and when the tasks are completely different, the NN structures are often very different.（It is possible that the structure of NNs will be similar for different tasks, but I don’t think we need to worry about it practically.）The proposed method is based on the fact that NNs for similar tasks have similar graph structures, and TDA is good at analyzing graph structures. Therefore, the idea of the proposed method is not particularly new.\n- The structure of a trained NN depends on the training data, loss function, and optimization algorithm. Even if the NN is for the same task, the structure of the NN is often different if they are different. In this study, verification under different conditions is lacking, and we cannot say that the proposed method measures whether the NNs are for the same task or not. However, it is worthwhile as a comparison under the same conditions, so it will be a sufficient contribution if specific applications are shown.\nMinor comment\nTable captions are usually written above the table.\n", "summary_of_the_paper": "In this paper, the authors give a method to evaluate the closeness of a task considered by a neural network. They represent a trained NN as a weighted graph and extract features of the NN by calculating persistent homology from the graph.\nThe distance between NNs is calculated by calculating the distance between persistent homologies, and it is experimentally shown that the corresponding tasks of each NN can be determined whether they are similar or different.", "summary_of_the_review": "The contribution to the proposal and validation of a more effective framework for comparing trained NNs is acknowledged. On the other hand, the novelty of the idea is low and its applicability is questionable.\n\n[Post rebuttal comment] I appreciate the author's responses. The author's perception was clear to me, but I think it still needs to be improved with additional validation, so I did not change my grade.", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "extra_scores": {"correctness": "3: Some of the paper’s claims have minor issues. A few statements are not well-supported, or require small changes to be made correct.", "technical_novelty_and_significance": "2: The contributions are only marginally significant or novel.", "empirical_novelty_and_significance": "2: The contributions are only marginally significant or novel."}, "extra_text": {}}, {"review_id": "6jkzn9v-7Bd", "reviewer": "Reviewer_ZGgm", "summary": "", "questions": "", "limitations": "", "rating": 5, "confidence": 5, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "main_review": "I think the paper is interesting and novel. The idea of converting the NN that way to PD is something I have not seen before. However, I have many concerns about the paper.\n\nNeural networks are functions, and it it is not clear if two neural networks that have different architectures should be not similar. This method suffers from this in my opinion. You might have two neural networks that are totally different, one of them is giant and one of them is small and yet they are similar in the function they do--this will not be captured by the the method presented--at least this is not justified.\n\n- also, more importantly, why do you want to measure similarity between two NNs? I think it is interesting mathematical purpose but it is not clear from a practical perspective why you want or need to do that?  ", "summary_of_the_paper": "The paper converts a given NN to a weighted directed graph and consider the flag complex on the top of it and use that object to compute the PD of the input NN. Two neural networks are then considered to be similar iff the PDs are close enough with respect to WD. ", "summary_of_the_review": "While the paper is interesting and offers fresh point of view, I feel the paper lacks justification of important parts : such as why do we need a similarity between two NNs.", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "extra_scores": {"correctness": "1: The main claims of the paper are incorrect or not at all supported by theory or empirical results.", "technical_novelty_and_significance": "2: The contributions are only marginally significant or novel.", "empirical_novelty_and_significance": "3: The contributions are significant and somewhat new. Aspects of the contributions exist in prior work."}, "extra_text": {}}]

Author rebuttal:

Meta-review: *Summary:* Compare neural networks and tasks using TDA, particularly persistence diagrams. 

*Strengths:* 
- Some reviewers found this a fresh perspective. 
- Distance calculation using TDA can offer advantages and a theoretical basis. 

*Weaknesses:* 
- Insufficient motivation and experimental evidence for utility of the proposed approach. 
- Computational cost and hyperparameter choices in PD computation. 
- Difficulty of interpreting proposed distance matrices. 

*Discussion:* 

ZGgm found the paper interesting and that it offered a fresh perspective, but that the purpose of the comparison was not sufficiently well motivated. The authors provide some explanations, particularly about the method allowing to compare networks of different sizes, but ZGgm found their comments were not adequately addressed. rtBj found that even though the authors made efforts to address their comments, the paper still requires substantial improvements. HwgX appreciated the authors’ responses but considers that the paper needs to be improved with additional validation. They expressed doubts about the adequacy of the approach and found that although it improves upon certain methods, it is insufficiently verified. 


*Conclusion:* 

All reviewers agree that this work has some strengths but also significant weaknesses and does not reach the acceptance bar for this conference. Main weaknesses are insufficient motivation and experimental evidence. The reviewers made several suggestions on how the paper could be improved. I agree with the reviewers and hence I must reject this article.
Decision: Reject