Quantitative Performance Assessment of CNN Units via Topological Entropy Calculation

1 INTRODUCTION . Convolutional neural networks ( CNNs ) have achieved great success in various vision tasks Szegedy et al . ( 2016 ) ; Redmon et al . ( 2016 ) ; He et al . ( 2017a ) . The key to such success is the powerful ability of feature representations to input images , where network units1 play a critical role . But impacted by the diverse training deployments and huge hypothesis space , networks even with the same architecture may converge to different minima on a given task . Although units between these networks could present similar function for the same task , yet they may have completely different activation magnitudes . Consequently , this makes it fairly hard to give a general indication of the status for a given network unit with respect to how well features are represented by it from images in the same class . Being rough indicators in practice , magnitude responses of units are usually chosen simply Zhang et al . ( 2018 ) or processed statistically ( such as average mean ) Li et al . ( 2016 ) ; Luo et al . ( 2017 ) based on the idea of matched filtering . However , firstly these indicators are apparently sensitive to rescaling operations in magnitude . If performing a simply rescaling operation to the weights such as the strategy introduced in Neyshabur et al . ( 2015 ) , the results of the network and the function of each unit would all remain unchanged , but these indicators would vary along with the rescaling coefficient . Secondly , as the spatial information in the unit is completely discarded , they could not give discrimination between units with and without random patterns , for example units separately outputted by a well-trained and random-initialized CNN filter . Without a valid indication regarding the mentioned situations , these indicators fail to ensure the universal applicability for units in different network models . In this paper , we attempt to investigate the status of units from a new perspective . Roughly speaking , natural images in the same class have common features , and meanwhile the locations of these features are spatially correlated in global . For effective units , features are picked out and represented by high activation values in the units . And due to the locality nature in feature extraction by convolution , this global spatial pattern between the common features would be preserved synchronously 1Regarding the term unit , a unit is the perceptive node in networks , which generally refers to the activated feature map outputted by a convolutional filter in CNNs . in the counterpart representations in the effective units . In contrast , for ineffective units , being incapability of effectively representing these common features , representations would be in chaos and marks of this pattern is vague . This provides a valid road for performance assessment of individual units , and critically it is rescaling-invariant and universally applicable to any CNN architecture . The investigation of such pattern could naturally lead to topological approaches because knowledge of topological data analysis such as barcodes Ghrist ( 2008 ) provides valuable tools to resolve the intrinsic patterns in raw data . Along this line , firstly we introduce a method for characterizing the spatial pattern of feature representations in units for a single sample by incorporating with the topological tools , and then use information entropy to evaluate the stability of this spatial characterizations for various images sampled from the same class , where we call it feature entropy . In this way , a unit is judged to be effective if its feature entropy is high , otherwise ineffective . In our experiments , we find that feature entropy would gradually decrease as the layer goes deeper and the evolution trends of feature entropy and losses are almost the same during network training . We show that the feature entropy could provide reliable indication of unit status in situations like weight-rescaling and the emergence of random pattern . Finally , we show the value of feature entropy in giving discrimination between networks with different generalization ability by investigating only the training set . 2 RELATED WORKS . One line of research that attracts many researchers is seeking solutions in a way of visualizing what features have learned by the units Zeiler & Fergus ( 2014 ) ; Zhou et al . ( 2014 ) ; Mahendran & Vedaldi ( 2015 ) ; Simonyan et al . ( 2013 ) . Status is generally identified depending on the degree of alignment between the visualized features and the human-visual concepts Bau et al . ( 2017 ) ; Zhou et al . ( 2018a ) ; Bau et al . ( 2020 ) . On the one hand , they meanwhile give excellent visual interpretation of each unit ; on the other hand , it hinders its universal application to arbitrary tasks and models in which units ’ functionalities may be unrecognized to human Wang et al . ( 2020 ) . Another related research trace lies in the field of network pruning , where they concentrate on using simple methods to roughly select less important units within a network . Typical approaches include the L1-Norm of units Luo et al . ( 2017 ) , Average Percentage of Zeros ( APoZ ) in units Hu et al . ( 2016 ) , some sparse-based methods Li et al . ( 2019 ) ; Yoon & Hwang ( 2017 ) , and so on . Despite commonly used in practice , since without a specific processing on units in diverse situations , they are unable to provide a general indication for units in different networks . Besides , Morcos et al . ( 2018 ) introduce the class selectivity from neuroscience to investigate the selectivity over classes for a specific unit , on the basis of calculating the mean units . Alain & Bengio ( 2016 ) propose linear classifier probe , where they report the degree of linear classification of units in intermediate layers could somehow characterize the status of units . Lastly , we would like to discuss some recent works related to topological approaches in deep learning . Naitzat et al . ( 2020 ) demonstrates the superiority of using ReLu activation by studying the changes in Betti numbers of a two-class neural network . Montúfar et al . ( 2020 ) use neural networks to predict the persistent homology features . In Gabrielsson & Carlsson ( 2019 ) , by using barcode , they show the topological structure changes during training which correlates to the generalization of networks . Rieck et al . ( 2018 ) proposes neural persistence , a topological complexity measure of network structure that could give a criterion on early stopping . Guss & Salakhutdinov ( 2018 ) empirically investigates the connection between neural network expressivity and the complexity of dataset in topology . In Hofer et al . ( 2017 ) , topological signatures of data are evaluated and used to improve the classification of shapes . 3 METHOD . In general , input images for a network model are commonly resized to be square for processing . For input image sample I of a given class with size n×n to be represented by a unit U with sizem×m via feature extraction processing f in CNN , we have , f : I → U ( 1 ) For image I , features are specifically arranged , where each feature has an associated spatial location in the image . After perceived by U , features are represented by high activation values at the corresponding locations in the unit . Basically , there are two steps in our assessment of unit performance : firstly , characterizing the spatial pattern hidden in these high activation values in a unit for a single image ; secondly , evaluate the stability of this characterization when giving multiple image samples . 3.1 CHARACTERIZING THE SPATIAL PATTERN OF FEATURE REPRESENTATIONS IN A UNIT . For Ui , j with a grid structure , the location of an element generally refers to its coordinate index ( i , j ) . And intuitively , the spatial pattern hidden in the elements denotes certain regular relationship among their coordinate indices . So , it is natural to model such relationship with graph structure and tackle it with topological tools in the following . Unit and graph We use the edge-weighted graphs Mehmet et al . ( 2019 ) as our basic model and construct the weighted graph G = ( V , E ) from unit Ui , j , where V is the vertex set and E is the edge set . Define the adjacency matrix A of G as follows , A ∈ Rm×m : Ai , j = Ui , j ( 2 ) It should be noted that the individual element of A is the weight of edge in G , which conveys the intensity of corresponding point in the U . A family of undirected graphs G ( v ) with adjacency matrices A ( v ) could be constructed by following the typical implementation of the sublevel set , A ( v ) i , j = 1Ai , j≥a ( v ) ( 3 ) where a ( v ) is the vth value in the descend ordering of elements of A and 1 ( · ) is indicator function . Here , we take the adjustment of A ( v ) = max ( A ( v ) , ( A ( v ) ) T ) to ensure the adjacency matrices A ( v ) of undirected graphs to be symmetric . So G ( v ) = ( V ( v ) , E ( v ) ) is the subgraph of G where V ( v ) = V and E ( v ) ⊂ E only includes the edges whose weights are greater than or equal to a ( v ) . We have the following graph filtration , G1 ⊂ G2 ⊂ G3 ⊂ · · · ⊂ G ( 4 ) To be more specifically , in this sublevel set filtration , it starts with the vertex set , then rank the edge weights from the maximum amax to minimum amin , and let the threshold parameters decrease from amax to amin . At each step , we add the corresponding edges to obtain the threshold subgraph G ( v ) . Fig.2 illustrates the construction of certain subgraph through a toy example . Consider the unit Ui , j . We circle the locations of the top 4 largest elements in Ui , j ( Fig.2A ) . Then the nonzero elements in adjacency matrix A ( 4 ) , { ( 1 , 2 ) , ( 4 , 3 ) , ( 2 , 4 ) , ( 3 , 1 ) } , is located ( Fig.2B ) and corresponding subgraph G ( 4 ) is constructed ( Fig.2C ) . Complex filtration To further reveal the correlation structure in the graphs , they are typically converted into certain kinds of topological objects , where topological invariants are calculated for capturing the high-level abstraction of correlation structure . Here , by following the common method in Horak et al . ( 2009 ) ; Giovanni et al . ( 2013 ) , each graph G ( v ) is converted to simplicial complex ( also called clique complex ) τ ( v ) , as shown in Fig.2D . In this way , we have complex filtration corresponding to graph filtration ( Eq.4 ) . τ ( 1 ) ⊂ τ ( 2 ) ⊂ τ ( 3 ) ⊂ · · · ⊂ τ ( 5 ) This filtration describes the evolution of correlation structure in graph G along with the decreasing of threshold parameter . Fig.3A shows the complex filtration of the previous example ( Fig.2 ) . So far , we have completed the characterization from unit to the topological objects . Other than our strategy , we also discuss other alternative method , which maps the unit to the cubical complex Kaczynski et al . ( 2004 ) . See Appendix for more details . Betti curve and its charaterization Next , kth Betti number Hatcher ( 2002 ) of each element in the complex filtration could be calculated using the typical computational approach of persistent homology Ninna et al . ( 2017 ) . τ ( v ) 7→ β ( τ ( v ) ) ( 6 ) Intuitively , kth Betti number β ( τ ( v ) ) could be regarded as the number of k-dimensional ’ circle ’ s or ’ hole ’ s or some higher order structures in complex τ ( v ) . On the other hand , many meaningful patterns in the unit would lead to the ’ circle ’ s or ’ hole ’ s of complexes in the filtration ( Eq.5 ) , see Fig.2 for illustration . In particular , the number of ’ hole ’ s is typically used as an important quantitative index for featuring such patterns . Hence , the kth Betti numbers β ( τ ( v ) ) , v ∈ { 1 , · · · , n } could be arranged into so called kth Betti curves β ( U , v , k ) for the unit U . Fig.3B shows the 1th Betti curve of filtration in Fig.3A . Once having obtained the Betti curve , one needs to interpret the Betti curve and extract its core characterization . Although there exists many choices of distance between two topological diagrams such as persistence images Adams et al . ( 2017 ) , persistence landscape Bubenik et al . ( 2015 ) and persistence entropyNinna et al . ( 2017 ) , we find that the simple birth time of the Betti curves β ( U , v , k ) is sufficient in this characterization , b ( U , k ) = inf { v|β ( U , v , k ) 6= 0 } ( 7 ) We call b ( U , k ) the birth point . Birth point is the indication of the critical element in complex filtration that begins to carry ” hole ” structure ( Betti number is nonzero ) . It is an important sign that some essential change has occurred in complex filtration , which implies the appearance of regularized spatial pattern of notable components in the unit . Meanwhile , in some cases , no spatial pattern appear in the components in the unit , so β ( U , v , k ) constantly equals to zero , meaning that birth point doesn ’ t exist . In general , this would happen when the unit is unable to give representations for the image , where its values are almost all zeros .

Summary: This paper proposes a novel method to tell whether a unit (feature map) is effective in CNNs quantitatively, via "feature entropy". The proposed method builds a weighted graph based on a feature map and calculates the Betti curve. Then it defines the "birth point" that implies the appearance of regularized spatial pattern of notable components in the feature map. By computing the "birth point" based on a sample of images from a specified class, it can get a birth distribution, upon which the "feature entropy" is computed.