Rank Diminishing in Deep Neural Networks
Anonymous Author(s)
AffiliationAddress email
Abstract
The rank of neural networks measures information flowing across layers.
It isan instance of a key structural condition that applies across broad domains ofmachine learning.
In particular, the assumption of low-rank feature representationsleads to algorithmic developments in many architectures.
For neural networks,however, the intrinsic mechanism that yields low-rank structures remains vague andunclear.
To fill this gap, we perform a rigorous study on the behavior of networkrank, focusing particularly on the notion of rank deficiency.
We theoreticallyestablish a universal monotonic decreasing property of network rank from the basicrules of differential and algebraic composition, and uncover rank deficiency ofnetwork blocks and deep function coupling.
By virtue of our numerical tools, weprovide the first empirical analysis of the per-layer behavior of network rank inpractical settings, i .
e ., ResNets, deep MLPs, and Transformers on ImageNet.
Theseempirical results are in direct accord with our theory.
Furthermore, we reveala novel phenomenon of independence deficit caused by the rank deficiency ofdeep networks, where classification confidence of a given category can be linearlydecided by the confidence of a handful of other categories.
The theoretical resultsof this work, together with the empirical findings, may advance understanding ofthe inherent principles of deep neural networks.
Introduction
In mathematics, the rank of a smooth function measures the volume of independent informationcaptured by the function [23].
Deep neural networks are highly smooth functions, thus the rankof a network has long been an essential concept in machine learning that underlies many taskssuch as information compression [53, 63, 38, 61, 54], network pruning [33, 62, 6, 27, 10], datamining [7, 26, 11, 64, 19, 30], computer vision [66, 65, 32, 28, 30, 67] and natural languageprocessing [9, 29, 8, 12].
Numerous methods are either designed to utilize the mathematical propertyof network ranks or are derived from an assumption that low-rank structures are to be preferred.
Yet a rigorous investigation to the behavior of rank of general networks, combining both theoreticaland empirical arguments, is still absent in current research, weakening our confidence in the being ableto
predict performance.
To the best of our knowledge, there are only a few previous works discussingthe rank behavior of specific network architectures, like attention blocks [15] and BatchNorms [13, 5]in pure MLP structures.
The empirical validation of those methods are also limited to shallownetworks, specific architectures, or merely the final layers of deep networks, leaving the globalbehavior of general deep neural networks mysterious due to prohibitive space-time complexity formeasuring them.
Rigorous work on network rank that combines both strong theoretical and empiricalevidence would have significant implications.
In this paper, we make several contributions towards this challenging goal.
We find that thetwo essential ingredients of deep learning, the chain rules of differential operators and matrixmultiplications, are enough to establish a universal principle—that network rank decreasesmonotonically with the depth of networks.
Two factors further enhance the speed of decreasing: a)the explicit rank deficiency of many frequently used network modules, and b) an intrinsic potentialof spectrum centralization enforced by the nature of coupling of massive composite functions.
Toempirically validate our theory, we design numerical tools to efficiently and economically examinethe rank behavior of deep neural networks.
This is a non-trivial task, as rank is very sensitive tonoise and perturbation, and computing ranks of large networks is computationally prohibitive in timeand space.
Finally, we uncover an interesting phenomenon of independence deficit in multi-classclassification networks.
We find that many classes do not have their own unique representations inthe classification network, and some highly irrelevant classes can decide the outputs of others.
Thisindependence deficit can significantly deteriorate the performance of networks in generalized datadomains where each class demands a unique representation.
In conclusion, the results of this work,together with the numerical tools we invent, may advance understanding of intrinsic properties ofdeep neural networks, and provide foundations for a broad study of low-dimensional structures inmachine learning.
Preliminaries
Settings We consider the general deep neural network with L layers.
It is a smooth vector-valuedfunction F : R n → R d , where R n and R d are the ambient space of inputs and outputs, respectively.
Deep neural networks are coupling of multiple layers, thus we write F as:
[Equation]
For simplicity, we further write the k -th sub-network 1 of F as
[Equation]
and we use F k = F k ( X ) to denote the feature space of the k -th sub-network on the data domain X .
We are more interested in the behavior of network rank in the feature spaces rather than scalar outputs(which trivially have rank 1).
Thus for classification or regression networks that output a scalar value,we will consider F = F L as the transformation from the input space to the final feature space instead.
Thus, we always have n ≫ 1 and d ≫ 1 .
For example, for ResNet-50 [21] architecture on ImageNet,we only consider the network slice from the inputs to the last feature layer of 2,048 units.
Rank of Function
The rank of a function f = ( f 1 , ..., f d ) T : R n → R d refers to the highest rankof its Jacobian matrix J f over its input domain X , which is defined as
[Equation]
It is well-known that the region of non-highest rank is a zero-measure set on the feature manifoldby Sard’s theorem [23], so we are safe to ignore them in the definition of the function ranks.
Therank of a function represents the volume of information captured by it in the output [23].
That iswhy it is so important to investigate the behavior of neural networks and many practical applications.
Theoretically, by the rank theorem and Sard’s theorem of manifolds [23], we can know that rank ofthe function equals the intrinsic dimension of its output feature space, as in the following lemma.
Lemma 1.
Suppose that f : R n → R d is smooth almost everywhere.
Let Rank( f )
=
r .
If datadomain X is a manifold embedded in R n and ϕ : U → O is a smooth bijective parameterizationfrom an open subset U ⊂ R s to O ⊂ X , then we have dim( f ( X )) =
Rank( J f ◦ ϕ ) ≤ r .
Thus, therank of function f gives an upper bound for the intrinsic dimension dim( f ( X )) of the output space.
It is worth mentioning that the intrinsic dimension dim( f ( X )) of the feature space is usually hard tomeasure, so the rank of the network gives an operational estimate of it.
Numerical Tools
Validating the rank behavior of deep neural networks is a challenging task because it involvesoperations of high complexity on large-scale non-sparse matrices, which is infeasible both in timeand space.
Computing the full Jacobian representation of sub-networks of ResNet-50, for example,consumes over 150G GPU memory and several days at a single input point.
In accuracy, this iseven more challenging as rank is very sensitive to small perturbations.
The numerical accuracy offloat32 , 1 . 19 e − 7 [43], cannot be trivially neglected in computing matrix ranks.
Thus, in this sectionwe establish some numerical tools for validating our subsequent arguments, and provide rigoroustheoretical support for them.
3.1 Numerical Rank: Stable Alternative to Rank
The rank of large matrices is known to be unstable: it varies significantly under even small noiseperturbations [46].
Matrices perturbed by even small Gaussian noises are almost surely of full rank,regardless of the true rank of the original matrix.
Thus in practice we have to use an alternative: wecount the number of singular values larger than some given threshold ϵ as the numerical rank of thematrix.
Let W ∈ R n × d be a given matrix.
Its numerical rank with tolerance ϵ is
[Equation]
where ∥ W ∥ 2 is the ℓ 2 norm (spectral norm) of matrix W , σ i , i = 1 , ..., min { n, d } are its singularvalues, and # is the counting measurement for finite sets.
We can prove that the numerical rank isstable under small perturbations.
Based on Weyl inequalities [55], we have the following theorem.
Theorem 1.
For any given matrix W , almost every tolerance ϵ > 0 , and any perturbation matrix D ,there exists a positive constant δ max ( ϵ ) such that ∀ δ ∈ [0 , δ max ( ϵ )) ,
Rank ϵ ( W + δ D )
=
Rank ϵ ( W ) .
If W is a low-rank matrix without random perturbations, then there is a ϵ max such that for anyϵ < ϵ max , Rank ϵ ( W + δ D
=
Rank ϵ ( W ) =
Rank( W ) for all δ ∈ [0 , δ max ( ϵ )) .
This property of the numerical rank metric makes it a suitable tool for investigating the rank behaviorof neural networks.
Possible small noises can be filtered out in Jacobian matrices of networks byusing numerical rank.
It is worth mentioning that random matrices no longer have full rank almostsurely under the numerical rank.
Instead their rank distribution can be inferred from the well-known
Marcenko–Pastur distribution [36] of random matrices.
So under numerical rank, low-rank matriceswill be commonly seen.
In this paper, we always use the numerical rank when measuring ranks.
3.2 Partial Rank of the Jacobian: Estimating Lower Bound of Lost Rank in Deep Networks
To enable the validation of trend of the network ranks, we propose to compute only the rank ofsub-matrices of the Jacobian as an alternative.
Those sub-matrices are also the Jacobian matriceswith respect to a fixed small patch of inputs.
Rigorously, given a function f and its Jacobian J f , wedenote partial rank of the Jacobian as the rank of a sub-matrix of the Jacobian that consists of thej 1 -th, j 2 -th,..., j K -th column of the original Jacobian
[Equation]
where 1 ≤ j 1 < . . .
< j K ≤ n.
The partial rank can be efficiently computed and the varianceof partial ranks of adjacent sub-networks gives a lower bound on the variance of their ranks.
Wedemonstrate this in appendix F.
3.3 Classification Dimension: Estimating Final Feature Dimension
Measuring the intrinsic dimension of feature manifolds is known to be intractable.
So we turn toan approximation procedure.
For most classification networks, a linear regression over the finalfeature manifold decides the final network prediction and accuracy.
So we can estimate the intrinsicdimension as the minimum number of principal components in the final feature space to preserve ahigh classification accuracy.
Let cls : R d → R c be the classification predictions based on the final
Networks
ResNetResNet-
GluMixerResMLP-S
Swin-T
ViT-T
ClsDim
Ambient Dim.
feature representation F ( x ) ,
Pro k be the operator that project a vector to the subspace spanned bythe top- k PCA components of the final feature representations, and 1 cond the indicator for conditioncond .
The classification dimension is then defined as
[Equation]
which is the minimum dimensionality needed to reconstruct the classification accuracy of the wholemodel.
Simple Principle of Rank Diminishing for General Networks
The specific designs of neural networks are vast and diverse, but most of them share two fundamentalingredients of deep networks, i .
e ., the chain rule and matrix multiplication .
This provides us a chanceto analyze the behavior of deep networks that is architecture-agnostic.
So in the theoretical aspect,we will focus on how these two intrinsic structures endow impetus of rank diminishing to neuralnetworks.
A most straightforward observation comes from the basic rule of matrix multiplication that forany two matrices A and B , we have Rank( AB ) ≤ min { Rank( A ) , Rank( B ) } [24].
Takingthis into the chain rule of differential of J F = J f L J f L − 1 ...
J f 1 , we then have Rank( J F k ) =
Rank( J f k ◦ F k − 1 ) =
Rank( J f k J F k − 1 ) ≤ Rank( J F k − 1 ) , k = 2 , ..., L, which is Eq.
We canthen get the following principle of rank diminishing.
Theorem 2 (Principle of Rank Diminishing) .
Suppose that each layer f i , i = 1 , ..., L of network Fis almost everywhere smooth 3 and data domain
X is a manifold, then both the rank of sub-networksand intrinsic dimension of feature manifolds decrease monotonically by depth:
[Equation]
[Equation]
This principle describes the behavior of generic neural networks with almost everywhere smoothcomponents, which exhibits the monotonic decreasing (but not strictly) of network ranks and intrinsicdimensionality of feature manifolds.
A flaw of the above principle is that it does not tell whether the rank must decrease.
So we needfurther analysis for the chance of strictly decreasing.
A most direct reason to support the strictlydecreasing comes from the structural impetus of rank deficiency of numerous network components.
Frequently used operations like pooling, downsampling, and dense layer can loose ranks considerablyas they explicitly decrease the ambient dimensions of feature representations, or have low rank weightmatrices [37].
Specifically, we can have a global criterion for whether a network component will loseranks as follows.
Theorem 3 (Structural Impetus of Strictly Decreasing) .
4 Roughly speaking, if almost everywhereon the input feature manifold, there is a direction such that moving along this direction keeps theoutput invariant, then the intrinsic dimension of the output feature manifold will be strictly lowerthan that of the input.
The maximum number of independent such directions gives a lower bound onthe number of lost intrinsic dimensions.
[Figure]
a r t i a l
[Figure]
i
[Figure]
n
[Figure] [Figure]
eigenvectors (principal components) of the final feature manifolds.
For all networks a small percentage (see Tab. 1) of eigenvectors are enough to reproduce the classification accuracy of the whole network, indicating a low intrinsic dimension of final feature manifolds.
Note that the x -axes are non-linear.
For example, the ReLU activation gives the same output for all inputs that only differs from eachother in the negative parts.
Thus the feature manifold after a ReLu activation will lose the dimensionfor those negative parts.
For general linear layers ( e.g., pure convolution and dense layers), the featuredimensions that belong to the orthogonal complementary spaces of the weights will be lost afterapplying the linear transformations, as the weight matrices are inactive to changes in their orthogonalcomplementary spaces.
Limiting Behavior of Network Ranks for Infinitely Deep Networks
From a theoretical perspective, it is of great interest to consider the limiting behavior—the rank ofinfinitely deep neural networks.
However, it is infeasible to directly consider this problem and giveany rigorous analysis for general cases— it is impossible to exhaust the tedious discussion of howspecific structures can influence network ranks.
Thus we need to concentrate to a simplified but stillrepresentative math model of this problem.
Theory Setup and Its Necessity In brief, we will assume in this section that the Jacobi matricesare random matrices independently following some distributions in a fixed Euclidean space.
Wethen consider the limiting behavior of the singular values of series { J F n } ∞ n =1 .
Modeling the Jacobi
[Figure]
matrices with random matrices allows us to neglect the influence of specific architectures and revealthe intrinsic property using large number law of probability.
While limiting them in the same space isa common practice in analyzing infinitely deep networks [48, 40, 44, 3, 34], as it offers the feasibilityto define limits of variables.
For example, if the sizes of Jacobi matrices changes from time to time,some singular values may suddenly disappear or appear in the series { J F n } ∞ n =1 , thus it is unable todefine limits for them.
After this simplification, the problem is still representative for understanding what happens in reality.
The transformer, recurrent neural networks, and some very deep CNN architectures with constantwidth [59] can be viewed as examples of this setting.
Another interesting setting is to assume that
the
Jacobi matrices follow the most simple distribution—Gaussian distributions.
This can lead to a muchstronger yet intuitive result on network ranks.
So we are most interested in the limiting behaviorwhen the Jacobi matrices follow weak regularized distributions and the Gaussian distributions.
Thesetwo cases then lead to Theorems 4 and 5 correspondingly.
Theorem 4.
Let the network be F = f L ◦ · · · ◦ f 1 , and all the ambient dimensions of featuremanifolds be the same as the ambient dimension of inputs, i.e., f k : R n → R n , k = 1 , . . .
, L .
Suppose the Jacobian matrix of each layer f
i independently follows some distribution µ , and 186 E µ [max { log ∥ J ± 1 f k ∥ 2 , 0 } ] < ∞ .
Let σ k denote the k -th largest singular value of J F .
Then there isan integer r < n and positive constants µ r , . . .
, µ n that only depend on µ such that we have forµ -almost everywhere,
[Equation]
meaning that for any tolerance ϵ > 0 , Rank ϵ ( F ) drops below r + 1 as L → ∞ .
Theorem 5.
Let the network be F = f L ◦ ... ◦ f 1 , and all the ambient dimensions of featuremanifolds be the same as the ambient dimension of inputs, i.e., f k : R n → R n , k = 1 , ..., L .
Supposethat J f i independently follows the standard Gaussian distribution.
Let σ k denote the k -th largestsingular value of J F .
Then almost surely
[Equation]
where ψ = Γ / Γ ′ and Γ is the Gamma function.
That means for a large L and any tolerance ϵ ,
Rank ϵ ( F ) drops to 1 exponentially with speed nC L , where C < 1 is a positive constant that onlydepends on n .
The proofs of these two theorems rely on the advances of random matrix theory, especially the studyof Lyapunov exponents of linear co-cycle systems [49, 57, 17, 45, 31] (see appendix A for detail).
Both of the two theorems reveal that infinitely deep networks have an intrinsic intention to drop ranksrapidly and centralize energy in the largest singular vectors.
This intention is purely aroused by thetwo essential ingredients, chain rule and matrix multiplication, as here we omit the consideration ofspecific network designs, but focus on the large number law of coupling of massive smooth functions.
These two theorems point out that the ratio of non-largest singular value divided by the largest onewill converge to zero with an exponential speed.
As a result, the numerical rank of the network willdecrease quickly after the layer is deep enough.
While this is not the hard rank we use in Theorem 2,we can still use it to infer the low rank structure of feature representations.
Let q 1 , · · · , q n be thesingular vectors of J F corresponding to the singular values in Theorem 4, and α i = ⟨ ∆ x / ∥ ∆ x ∥ 2 , q i ⟩ ,then when the depth L → ∞ and ∆ x is small, we have F ( x +∆ x ) =
F ( x )+ J F ∆ x + o ( ∥ ∆ x ∥ 2 ) =
σ 1 (cid:80) ri
=
α i q i + σ 1 (cid:80) nj
=
σ j σ 1 α j q j + o ( ∥ ∆ x ∥ 2 ) ≈ σ 1 (cid:80) ri
=
α i q i , which means the neighborhoodof data x is mapped into an r -dimensional subspace spanned by the singular vectors of the largestsingular values.
This can also explain why layer-wise regularization techniques are helpful for training deep networks,as those regularization techniques re-normalize the singular value distributions of deep networks,easing the trend of the ratio σ i σ 1 becoming infinitesimal.
Specifically, if the data distribution near x isassumed to be standard Gaussian, then the feature distribution is N ( F ( x ) , J T F J F ) , which has a verylow rank covariance matrix due to σ i σ 1 , i ≥ r is tiny.
Then applying Batch Normalization will try topull this feature distribution back to Gaussian with identity covariance, thus ease the trend of featuredimension collapse.
This has also been discussed in related work of the Batch Normalization [13, 5].
We will discuss some other techniques to remiss the rank diminishing in the Appendix.
These two theorems are also connected with the famous gradient explosion issue of deep neuralnetworks [4, 42], where the largest singular value of the Jacobian matrix tends to infinity whenthe layer gets deeper.
This issue could be viewed as a special case of Theorem 5 that investigatesthe behavior of all singular values of deep neural networks.
The behavior of network ranks in factmanipulates the well-known gradient explosion issue.
Rigorously, we have the following conclusion.
Corollary 1.
Under the condition of Theorem 5, then almost surely gradient explosion happens at anexponential speed, i.e., log ∥ J F ∥ 2 = log σ 1 ∼ L 2 (log 2 + ψ ( n/ 2))
→ ∞ when L is large.
Validating the Rank Behavior
6.1 Validating Rank Diminishing by Depth
In this section, we numerically validate our theory in three types of architectures of benchmark deepneural networks, CNNs, MLPs, and Transformers, in the ImageNet [14] data domain.
Information ofthose networks is listed in Tab. A2.
For validating the tendency of network rank of Jacobian matrices,we use the numerical rank of sub-matrices of Jacobian on the central 16 × 16 × 3 image patch of inputimages.
We report the results of other choices of patches in the Appendix.
Details of the experimentsetup can be found in appendix E.
Rank Diminishing of Jacobians As is discussed in Sec.
3.2 and Lemma 2, the partial rank of the
Jacobian is a powerful weapon for us to detect the behavior of huge Jacobian matrices, which areinfeasible to compute in practice.
The decent value of partial ranks of adjacent sub-networks providesa lower bound to that of full ranks of them.
Fig.
1 (a,b,c) report the partial rank of Jacobian matricesof three types of architectures, where we can find consistent diminishing of partial ranks in each layer,indicating a larger rank losing for the full rank of Jacobian matrices.
Implicit Impetus Theorem 5 gives an exponential speed of rank decent by layers.
We find thatit corresponds well with practice.
We investigate this exponential law in a toy network of MLP-50,which is composed of 50 dense layers, each with 1,000 hidden units.
The MLP-50 network takes
Gaussian noise vectors of R 1000 as inputs, and returns a prediction of 1,000 categories.
As all thefeature manifolds are linear subspaces in this case, their intrinsic dimensions can be directly measuredby the numerical rank of their covariance matrices.
We report the full rank of Jacobian matricesand intrinsic dimensions of feature manifolds under three different randomly chosen weights in
Fig.
1 (d,e,f).
Due to the digital accuracy of float32 , we stop calculation in each setting when theabsolute values of elements of the matrices are lower than 1 .
19 e − 7 .
We can find standard curves ofexponential laws in all cases for both ranks of Jacobian and intrinsic dimensions of features.
Structural Impetus We validate the structural impetus in Fig.
To give an estimation for generalcases, here we use Gaussian noises with the size of 128 × 8 × 8 as inputs, and randomize weights of thenetwork components to be validated.
We plug those components into a simple fully-connected (FC)layer of 8,192 hidden units.
As the structure is simple, we directly measure the intrinsic dimension offeature spaces and the full rank of Jacobian matrices before and after the features pass the networkcomponents to be measured.
The dimension is determined by the number of PCA eigenvalues [25, 56]larger than 1 .
19 e − 7 × N × σ max , where N is the number of PCA eigenvalues, and σ max is thelargest PCA eigenvalue.
The batch size is set to 5,000.
We find that the convolution (the kernel sizeis 3 × 3 ) and FC layers (the weight size is 8,192) tend to lose rank considerably, while differentnormalization layers also lose rank modestly.
But none of them can preserve rank invariant.
6.2 Validating Low-Rank Terminal Spaces
This section seeks evidence to support a low-rank terminal feature space of deep networks, which canthen support the significant diminishing of ranks in the previous layers.
The evidence is consistedof a numerical validation that investigates the classification dimension of the terminal feature layer,together with a semantic validation that reveals the independence deficit of deep networks.
Numerical Validation To get an estimation of how many dimensions remain in the final featurerepresentation, we measure the classification dimension in Fig.
2 and Tab.
We report theclassification accuracy produced by projecting final feature representations to its top k % eigenvectorsin Fig.
We choose a threshold of ϵ such that this procedure can reproduce 95% of the originalaccuracy of the network.
The corresponding ClsDim is reported in Tab. 1.
As discussed in Sec.
3.3,this gives an estimation of the intrinsic dimension of the final feature manifold.
We can find auniversal low-rank structure for all types of networks.
Semantic Validation We want to show that there are only a few independent representations todecide the classification scores for all the 1,000 categories of ImageNet.
Specifically, can we predictthe outputs of the network for some categories based on the outputs for a few other categories, asillustrated in Fig.
4 (a)?
And if we can, will those categories be strongly connected to each other?
A surprising fact is that, we can find many counter examples of irrelevant categories dominatingthe network outputs for given categories regarding various network architectures.
This interestingphenomenon indicates a rather drastic competing in the final feature layer for the tight rank budgetsof all categories, which yields non-realistic dependencies of different categories.
To find the dependencies of categories in final features, we can solve the following Lasso problem [50],
[Equation]
(11) where F ( x ) ∈ R 1000 is the slice of network from inputs to the final feature representation, x is thesample from ImageNet X , and W is the final dense layer.
The solution λ ∗ will be a sparse vector,with k non-zero elements λ i 1 ≥ λ i 2 ≥ ...
≥ λ i k , k ≪ 1000 .
We can then getlogits( x , i )
≈ λ
i 1 logits( x , i 1 ) + ...
+ λ
i k logits( x , i k ) , i / ∈ { i 1 , ..., i k } , k ≪ 1000 , ∀ x ∈ X , (12)
where logits( x , i j ) , j = 1 , . . .
, k is the logits of network for category i
j , i .
e ., logits( x , i j ) =
W i j F ( x ) .
It is easy to see that outputs for category i are linearly decided by outputs for i 1 , ..., i kand are dominated by outputs for i 1 .
Fig.
4 demonstrates the solutions of Eq.
(12) for three different categories in ImageNet with η = 20 ,and network architectures ResNet-50, GluMixer-24, and
Swin-T.
The results are surprising.
It showsthat many categories of the network predictions are in fact ‘redundant’, as they are purely decided bythe predictions of the other categories with simple linear coefficients.
In this case, the entanglementof different categories cannot be avoided, thus the network may perform poorly under domain shift.
An even more surprising finding is that, some very irrelevant categories hold the largest weights whendeciding the predictions of the redundant categories, which means that the networks just neglect theunique representations of those categories in training and yield over-fitting when predicting them.
[Figure]
, to predict the label is reported in blue (if tested on positive samples only, the accuracy rates are 98%, 90%, 82% for cases in (b,c,d) correspondingly).
For comparison, the original accuracy for the corresponding categories are reported in green .
We can find that 1) a few other categories can decide the confidence of the target category i ; 2) some very irrelevant categories contribute the largest weights.
For example in (c), the logits of class ‘junco’ is the negative of ‘triumphal arch’.
Both of them indicate a rather drastic competition of different categories for independent representations in final features due to the tight rank budgets.
Related Work
Previous studies of rank deficiency in deep neural networks follow two parallel clues.
One is thestudy of rank behavior in specific neural network architectures.
[15] studies deep networks consistingof pure self-attention networks, and proves that they converge exponentially to a rank-1 matrixunder the assumption of globally bounded weight matrices.
[13] studies the effect of BatchNorm on
MLPs and shows that BatchNorm can prevent drastic diminishing of network ranks in some smallnetworks and datasets.
Both of those works avoid directly validating the behavior of network ranks inintermediate layers due to the lacking of efficient numerical tools.
An independent clue is the studyof implicit self-regularization, which finds that weight matrices tend to lose ranks after training.
[37]studies this phenomenon in infinitely-wide, over-parametric neural networks with tools from randommatrix theory.
[1] studies this phenomenon in deep matrix decomposition.
Those works focus on thetheoretical behavior of rank of weight matrices induced by the training instead of network ranks.
Conclusion
This paper studies the rank behavior of deep neural networks.
In contrast to previous work, we 310 focus on directly validating rank behavior with deep neural networks of diverse benchmarks andvarious settings for real scenarios.
We first formalize the analysis and measurement of network ranks.
Then under the proposed numerical tools and theoretical analysis, we demonstrate the universal rankdiminishing of deep neural networks from both empirical and theoretical perspectives.
We further 314 support the rank-deficient structure of networks by revealing the independence deficit phenomenon,where network predictions for a category can be linearly decided by a few other, even irrelevant 316 categories.
The results of this work may advance understanding of the behavior of fundamental
network architectures and provide intuition for a wide range of work pertaining to network ranks.
A Proofs
A.1 Proof to Lemma
This Lemma is the direct result of the rank theorem of manifolds .
Theorem 6 (Rank Theorem [23]) .
Suppose f : M → N is a smooth function from m -dimensionalmanifold M to n -dimensional manifold N , and Rank M , N ( J f )
= r .
Then for each x ∈ M , thereexists a smooth chart ( U , m ) around x and a smooth chart ( V , n ) around f ( x ) , such that
[Equation]
(A13) is given by n ◦ f ◦ m − 1 ( x 1 , x 2 , · · · , x m ) =
( x 1 , x 2 , · · · , x m , 0 , · · · , 0) .
The rank of a function Rank M , N defined on the manifold is the rank under local chart systems ofthe input manifold M and output manifold N .
Let ϕ be the chart for point x ∈ O ⊂ M , and theidentity map be the chart for point f ( x ) ∈ R d .
Then it is easy to find that
[Equation]
Then by Theorem 6, we know that
[Equation]
The last equal sign comes from the rank inequality of matrix multiplication Rank( AB ) ≤min { Rank( A ) , Rank( B ) } , which we will discuss later.
A.2 Proof to Theorem
Proof to this Theorem needs Weyl’s inequalities [55] for singular values of sum of matrices.
Theorem 7 (Weyl’s inequalities) .
Let A , B be p × n complex matrices, σ i ( · ) be the i -th largestsingular value of the matrix.
Then
[Equation]
Let p be the number of singular values of W and D .
By this theorem, we have
[Equation]
To measure the numerical rank, we need to estimate the relative quantities of singular values, whichare,
[Equation]
Now assume that ϵ does not belong to the following set (which is a zero measure set in R + )
[Equation]
(A19) and Rank ϵ ( W ) =
r .
We know that
[Equation]
(A20)
Thus, we have that ∀ δ < δ max ,
[Equation] [Equation]
) provided that
[Equation]
Thus we can conclude
Rank ϵ
[Equation]
(A24)
When Rank( W ) =
r < p , it is then easy to see if ϵ < σ r ( W ) σ 1 ( W ) , we haveσ
i ( W )
[Equation]
Thus setting ϵ max =
σ r ( W ) σ 1 ( W ) , we can always have δ max acquired by Eq.
(A23), such that
[Equation]
A.3 Proof to Lemma
Let A i be the i -th column of matrix A .
Given two matrices A ∈ R m × n , B ∈ R n × d , we have
AB = ( AB 1 , · · · AB d ) .
(A27)
Thus for any 1 ≤ i 1 < · · · < i K ≤ d ,( AB ) i 1 , ··· ,i K =
( AB i 1 , · · · , AB i K ) =
A ( B ) i 1 , ··· ,i K .
(A28)
By the rank theorem [24] of matrices, we have
Rank(( AB ) i 1 , ··· ,i K ) =
Rank(( B ) i 1 , ··· ,i K ) − dim(Ker( A ) ∩
Im(( B ) i 1 , ··· ,i K )) , (A29) and
Rank( AB ) =
Rank( B )
[Equation]
dim(Ker( A ) ∩
Im( B ) .
(A30)
As ( B ) i 1 , ··· ,i K ) ⊂
B , it is straightforward to get that
Im(( B ) i
[Equation] [Equation]
Im( B ) .
(A31)
Thus
Ker
[Equation]
A
[Equation] [Equation]
( B
[Equation]
(A32)
Then we have
[Equation]
) =
Rank((
[Equation]
(A33)
Note that Rank( f 2 ◦ f 1 ) =
Rank( J f 2 J f 1 ) .
Then we complete the proof.
A.4 Proof to Theorem 2
The key to this principle is the rank theorem of matrices [24], which is
[Equation]
∩ Im( B )) .
[Equation]
Note that Rank( AB ) =
Rank( B T A T ) and Rank( A T ) =
Rank( A ) .
Then we have
[Equation]
The dimension of a linear subspace will at least be zero, thus the above equations suggest
[Equation]
Applying this argument to the chain rule of differentials then yields the conclusion.
Further using
Lemma 1 gives the diminishing of intrinsic dimensions of feature manifolds.
A.5 Proof to Theorem 3
We first give the rigorous version of this theorem as follows.
Theorem 8.
Let e x be the exponential map from a small neighborhood U x of point x on theinput feature manifold to its tangent space at x , and v x = e x ( x ) .
Let X be the input manifold,s = dim( X ) , f i be the layer network, r = Rank( f i ) , and f i ( X ) be the output manifold.
If foralmost everywhere on the input feature manifold, there is a unit vector v ∈ e x
( U x ) , such that thelayer network f i satisfies
[Equation]
then dim( f i ( X ))
<
s .
If the number of such independent v in e x ( U x ) is k , then dim( f i ( X ))
≤s − k .
Now we prove this theorem.
Note that Eq.
(A37) implies
[Equation]
As it is also easy to see
[Equation]
we can conclude
[Equation]
where 0 ̸ =
J e − 1 x v comes from the full rank property of exponential map and its inverse.
Thus wehave
[Equation]
Specifically, if linearly independent v 1 , · · · , v k satisfy Eq.
(A37), we can conclude
[Equation]
As J e − 1 x has full rank due to the property of exponential map, we know that J e − 1 x v i , i = 1 , · · · , kare linearly independent.
Then
[Equation]
Thus the rank theorem of matrices [24] reads
[Equation]
Combining this result with Theorem 6 proves our result.
A.6 Proof to Theorem
The proof to this theorem relies on the existence of Lyapunov exponents of dynamic systems.
Givena linearized dynamic system
[Equation]
its (largest) Lyapunov exponent is defined as
[Equation]
Further, for a sequence of subspace L h ⊂ L r − 1 ⊂ · · · ⊂ L 1 ⊂ L 0 = R n , we can define thecorresponding Lyapunov exponents of all those subspaces as
[Equation]
and we have
[Equation]
It may be surprising to find that such Lyapunov exponents exist, as v 0 can traverse the entiresubspace L i − 1 \L i .
We will demonstrate the existence of the Lyapunov exponents for our case later in
Sec.
A.6.3, which is the classical results from the Furstenberg-Kesten theorem [17] and multiplicativeergodic theorem [45].
Before that, we will first assume the existence of those Lyapunov exponentsfor simplicity of analysis.
Now consider the case of function couplings
[Equation]
which has the Jacobian matrix
[Equation]
Apparently, the following dynamic system induces the Jacobi matrix of F ,
[Equation]
Thus its Lyapunov exponents are given by
[Equation]
for a chain of subspaces { 0 } =
[Equation]
A.6.1 Lyapunov exponents are limits
of logarithms of subspace spectral
norm divided bylayer depth L
We first demonstrate that the Lyapunov exponents are limits of logarithm of the spectral norm of Fon L i − 1 \L i divided by layer depth L when L → ∞ , for i = 1 , ..., r .
It is easy to see
[Equation]
When L → ∞ , 1 L log ∥ v 0 ∥ 2 → 0 for any v 0 , we have
[Equation]
Let
[Equation]
Note that
[Equation]
and
[Equation]
where ∥ · ∥ 2 ,i denote the spectral norm of a linear operator constrained on L i − 1 \L i .Then
we have
[Equation]
Let e i 1 , · · · , e i k be a set of standard orthogonal basis of i k dimensional subspace L i − 1 \L i .
If the
Lyapunov exponents exist, by Eq.
(A55) we have for any ϵ > 0 , there is N ∈ N such that for all
L > N ,
[Equation]
Let v = (cid:80) i
k j =
α j e j ∈ L i − 1 \L i , where α j , i = 1 , · · · , i k , (cid:80)
i k
j
=1 α 2 j
= 1 is the coordinate of unitvector v under the basis e j , j = 1 , · · · , i k .
Assume that ∥ J F e 1 ∥ 2 ≥ ∥ J F e j ∥ 2 , j = 2 , · · · , i k .
We then have
[Equation]
and
[Equation]
Thus, if we set N 0 = max { N, 2 i k − 2+log i k ϵ } , then when L > N 0 we have 1 L
( i k − 1)+ 12 L log i k <
ϵ 2and
[Equation]
A
[Equation]
Combining Eqs.
(A60) and (A70), we have for any ϵ > 0 , there is N 0 ∈ N , such that when L > N 0 ,we always have
[Equation]
Thus, if the Lyapunov exponents exist, i .
e ., the existence of limits of Eq.
(A53) , we have
[Equation]
A
[Equation]
A.6.2 Singular value
distributions of Jacobian matrices of deep function coupling
In Sec.
A.6.1 we have proved that the Lyapunov exponents (if they exist) are limits of logarithms ofsubspace spectral norms divided by L .
Here we use this property to prove the deficiency of numericalranks, i .
e ., Eq.
We first introduce the Courant-Fischer min-max theorem [24] of sigular values.
Theorem 9 (Courant-Fischer Min-max Theorem) .
Let A be a d × n complex matrix and σ i ( A )denote its i -th largest singular value, i = 1 , · · · , min { d, n } .
Then we have
[Equation]
where V traverses subspaces of R n .
This theorem also serves as one of the definitions to singular values.
Now assume that dim( L 0 \L 1 ) = r , and we consider only the case of d = n for simplicity.
For anyϵ > 0 , we have N ∈ N such that when L > N ,
[Equation]
due to Eq.
(A55).
As dim( L 0 \L 1 ) =
r , by Theorem 9, we have
[Equation]
For v ∈ L 0 = R n and ∥ v ∥ 2 = 1 , as L 0 =
L 0 \L 1 ⊕ · · · ⊕ L h \L h +1 ( ⊕ denotes direct sum of linearquotient subspaces in the Banach space), there is v i ∈
L i − 1 \L i , i = 1 , · · · , h + 1 , such that
[Equation]
) and
[Equation]
Then by the conclusion of Sec.
A.6.1, we have
[Equation]
Thus there is N 1 ∈ N , such that when L > N 1 , we have
[Equation]
A83)
As dim( L 1 ) = n − 1 + 1 , by Theorem 9, we have when L > N 1 ,
[Equation]
In conclusion, when L > N 0 = max { N, N 1 } , we have
[Equation]
Thus when L → ∞ , we have
[Equation]
Using the same argument for σ 2 ( J F ) , · · · , σ n ( J F ) , we can find that if let ˆ λ 1 ≥ ˆ λ 2 · · · ≥ ˆ λ n be the
Lyapunov exponents counting repetitions, i .
e .,ˆ
[Equation]
, if
[Equation]
then
[Equation]
A
[Equation]
Note that
[Equation]
Thus we have
[Equation]
As a consequence, Rank ϵ ( F ) ≤ r for any ϵ > 0 when L → ∞ .
A.6.3 Existence of Lyapunov exponents for Jacobian matrices of deep function coupling
In above analysis, we have proven Theorem 4 under the existence of Lyapunov exponents.
In thissection, we introduce the classical result of multiplicatve ergodic theorem in the specific domain ofrandom matrices, which is proposed by Furstenberg and Kesten [17, 18].
Theorem 10 (Multiplicatve Ergodic Theorem (Theorem 3.9 of [18])) .
Let µ be a probability measureon all convertible matrices of R n × n which satisfies
[Equation]
If each J f k independently follows µ , then we have a chain of subspaces { 0 } =
L h +1 ⊂
L h ⊂ · · · ⊂
L 1 ⊂ L 0 = R n and corresponding postive real constants λ 1 > λ 2 > · · · > λ h +1 such that almostsurely
[Equation]
which means the existence of the Lyapunov exponents.
Combining this theorem and the arguments above, we can finally prove Theorem 4.
A.7 Proof to Theorem 5
This theorem can be deduced from the Lyapunov components of Ginibre matrices (polynomialensemble of square matrices sampled i.i.d from standard Gaussian).
Theorem 11 (Exact Lyapunov Exponent Distribution for Ginibre Matrices [41]) .
If µ in Theorem 10is standard Gaussian, then h + 1 = n , and
[Equation]
Combining this theorem with Theorem 4 can directly yield our result.
A.8 Proof to Corollary
This theorem is the direct result of Theorems 4 and 11.
Note that it is easy to get
[Equation]
for standard Gaussian µ .
B Influences of Structures
Skip Connection Skip Connection is the most direct method to solve rank diminishing at theinitialization period.
In our formulation, the definition of a layer network requires it to accept inputspurely from its predecessor layer as
[Equation]
However, when we add a skip connection from its ancestor layer f s , s < i − 1 , we have
[Equation]
It actually makes the coupling of layers
[Equation]
the true predecessor layer to f i , as
[Equation]
Thus the true layer depth is cut down by i − s , remaining L − ( i − s ) layers.
Skip connection isusually used with the residual network.
This structure can ease rank diminishing inside the layer ˆ f s ,which we will discuss later.
Overall, skip connection shortens the length of the chain of Jacobianmatrices, thus restraining rank diminishing.
[Figure]
BatchNorm Some previous works [13, 5] discuss the role of BatchNorm in restraining rankdiminishing.
They show that BatchNorm may slow down the speed of rank diminishing in neuralnetworks in some specific cases.
Residual Network Residual Network is another useful tool to restrain rank diminishing at theinitialization period.
The residual network r has the form
[Equation]
where x o and x i are the output feature and input feature, respectively.
Usually the residual term
Res( x i ) is small compared with the input x
i at the initialization period, as is pointed out by relatedworks [20].
Assume that
[Equation]
where ϵ is very small.
Then we have
[Equation]
is a diagonally dominant matrix, thus it has full rank.
This means its kernel space Ker( J r ) = { 0 } isa zero dimension space.
Thus by the Rank Theorem, for any predecessor layer f , r ◦ f will not loserank as
[Equation]
However, in the well-trained ResNet18 and ResNet50 networks, we still observe considerablediminishing of ranks in Fig.
The reason for this phenomenon could be that, during training themagnitude of the residual term Res( x ) becomes large.
Then the argument above no longer standand hence the rank becomes lower.
Taking the 16-th layer of the ResNet50 as example, we find thatthe rank of this layer drops from 530 to 119 after training, while the relative magnitude ∥ Res( x ) ∥ 2 ∥ x ∥ 2increases from 0.5127 to 0.9557 after training.
This may explain why the residual connection is lesseffective in preventing network ranks after training.
Influences of the Pooling Layers and Width To better validate the rank behavior of deep neuralnetworks ( e.g. , ResNet), we remove the operation of downsampling in the ResNet so that the featuredimension ( e.g. , x ∈ R H × W × C =802 , 816 for ResNet-50) will not change.
This modified ResNetcan exclude the effect of pooling layers and changes of layer width.
As shown in Fig.
A5,
we
R a t i o
o f S i n g u l a r s
R a nk o f Ja c o b i
[Figure]
show the partial rank of Jacobian matrices and perturbed PCA dimensions at the i -th layer of themodified ResNet-18 and ResNet-50 on ImageNet.
We can find that the curves of partial ranks andperturbed PCA dimensions share a similar and consistent trend of decreasing as the initial networks.
The consistent behavior of partial ranks and perturbed PCA dimensions also shows a monotonicdecreasing property of network ranks.
Thus the overall trend of rank diminishing seems to beindependent of the pooling layers and changes of width.
On the other hand, the partial rank witnessesa considerable drop near the terminal layer after applying pooling layers, which means it does havean effect on the network ranks.
C Orthogonal Initialization
Previous work [60] has demonstrated that under carefully designed initialization rule, we can trainvery deep (1,0000 layer) plain CNNs.
It is then curious to investigate that whether the phenomenonof rank diminishing happens in this case.
To this end, we empirically measure the numerical rankof Jacobi matrices and perturbed PCA dimensions of an extremely deep CNN initialized by the
Delta-Orthogonal method [60].
While computing the Jacobi matrices of very deep networks isinfeasible in time, we only compute the 4-1,004 layer of the network.
We omit the first 4 layers asthere are downsampling architectures.
We measure two metrics of each layer:
the numerical rank of the Jacobi matrix;
the ratio between sum of small singular values and large singular values
[Figure]
where3,072 is the width of this network, and σ 1 ≥ σ 2 ≥ · · · ≥ σ 3072 are singular values of the
Jacobi matrix.
As shown in FigA6, a generally decreasing trend of the Jacobi rank and singular ratio can be observed.
This result is consistent with Theorem 4.
Although orthogonal initialization can suppress rankdecrease to a certain extent, the impact of low rank cannot be ignored when the network is deepenough.
D Code
Algorithm A1 provides the pseudo-code of partial rank of the Jacobian.
The implementation of the
Algorithm A1 can refer to the ‘rank_jacobian.py’ python file.
Algorithm A2 provides the pseudo-code of perturbed PCA dimension of feature spaces.
Theimplementation of the Algorithm A2 can refer to the ‘rank_perturb.py’ python file.
Arch.
Network
Activ.
#Param.
Main Block #Layer
Top-1 Acc.
ResNets
ResNet-18 [21]
ReLU [39] 11.7M
Bottleneck 69.8%
ResNet-50 [21]
ReLU [39] 25.6M
Bottleneck 76.1%
MLP-like
GluMixer-
SiLU [22] 25.0M
Mixer-Block 78.1%
ResMLP-S24 [51]
GELU [22] 30.0M
Mixer-Block 79.4%
Transformer
ViT-T [16]
GELU [22] 5.7M
ViT-Block 75.5%
Swin-T [35]
GELU [22] 29.0M
Swin-Block 81.3%
Algorithm A3 provides the pseudo-code of the classification dimension.
The implementation ofthe Algorithm A3 can refer to the ‘run_cls_dim.py’ python file
Algorithm A4 provides the pseudo-code of independence deficit.
The implementation ofthe Algorithm A4 can refer to the ‘run_deficit.py’ python file.
E Experiments Setup
Information of those networks used in validations is listed in Tab. A2.
When measuring rank, we setϵ = eps × N , where eps is the digital accuracy of float32 ( i .
e ., 1 .
19 e − 7 ) and N is the number ofsingular values of the matrix to measure.
This threshold represents the minimum digital accuracy ofnumerical rank we can capture in data stored as float32 .
All the experiments are conducted on thevalidation set of ImageNet and NVIDIA A100-SXM-80G GPUs.
F Partial Rank of the Jacobian: Estimating Lower Bound of Lost Rank inDeep Networks
To enable the validation of trend of the network ranks, we propose to compute only the rank ofsub-matrices of the Jacobian as an alternative.
Those sub-matrices are also the Jacobian matriceswith respect to a fixed small patch of inputs.
Rigorously, given a function f and its Jacobian J f , wedenote partial rank of the Jacobian as the rank of a sub-matrix of the Jacobian that consists of thej 1 -th, j 2 -th,..., j K -th column of the original Jacobian
PartialRank
[Equation]
where 1 ≤ j 1 < . . .
<
j K ≤ n.
We can efficiently compute sub-matrix of the Jacobian by zeropadding to small patches of input images.
For any data point x ∈ R n , let Sub( x , j 1 , ..., j K ) =( x
j 1 , ..., x j K ) T ∈ R K , and ψ pad Sub( x , j 1 , ..., j K ) to the spatial size of x with zeros:ψ (Sub( x , j 1 , ..., j K ))
=
(0 , .., 0 , x j 1 , 0 , ..., x j K , 0 , ..., 0) T ∈ R n with ψ (Sub( x , j 1 , ..., j K ))
j k =x j k , k = 1 , ..., K. We then have J f ◦ ψ =
Sub( J f , j 1 , ..., j K ) .
As K can be very small comparedwith n , computing J f ◦ ψ can be very cheap in time and space.
The partial rank of Jacobian matricesof the network layers measures information captured among the spatial footprint j 1 , ..., j K of theoriginal input.
They inherit the order relation of the rank of full Jacobian matrices.
Thus we canvalidate the rank diminishing of network Jacobian matrices through the partial rank.
Lemma 2.
For differentiable f 1 , f 2 , | Rank( f 1 ) − Rank( f 2 ◦ f 1 ) | ≥ | Rank(Sub( f 1 , j 1 , . . .
, j K ))
−
Rank(Sub( f 2 ◦ f 1 , j 1 , . . .
, j K ))
| , ∀ 1 ≤ K ≤ n, 1 ≤ j 1 , . .
, j K ≤ n .
Thus variance of partialranks of adjacent sub-networks gives a lower bound on the variance of their ranks.
F.1 Partial Rank of Jacobians under Different Input Patches
In Fig.
A7 we report partial ranks of different input image patches (marked with colored boxesin Fig.
A7(a)) for the layers of ResNet-50 on ImageNet.
We can find that the curves of partial ranksshare a similar and consistent trend among different input patches.
Thus, picking one patch, forexample, the central patch of 16 × 16 × 3 pixels we use in Sec. 6.1, could be enough to demonstrate the overall behavior of network ranks.
The consistent behavior of all those partial ranks also showsthat partial rank is a good tool to investigate network ranks.
P a r t i a l R a nk
P a r t i a l R a nk
The 𝒊𝒊 -
[Figure]
Layer of ResNet
P a r t i a l R a nk P a r t i a l R a nk
The 𝒊𝒊 -th Layer of ResNet
The 𝒊𝒊 -th Layer of ResNet The 𝒊𝒊 -th Layer of ResNet
The 𝒊𝒊 -th Layer of ResNet The 𝒊𝒊 -th Layer of ResNet
The 𝒊𝒊 -th Layer of ResNet
P a r t i a l R a nk
P a r t i a l R a nk P a r t i a l R a nk
[Figure]
G Estimating Dimension Diminishing in Features
Measuring the intrinsic dimension of feature manifolds is known to be hard.
However, we manage togive a rough estimation to the dimension dropped by different layer networks.
To do this, we use anew metric called the Perturbed PCA Dimension.
It measures the expectation of PCA dimension ofsmall local neighborhoods over the feature manifold.
Let F k be the k -th sub-network of the whole network F .
We want to measure the Perturbed PCA
Dimension of F k ( X ) , where X is the input data domain.
To this end, we compute
[Equation]
A
[Equation]
where PCADim for a set is the number of PCA eigenvalues larger than a threshold ξ .
For each pointx , we sample 50,000 different perturbation ϵ to compute the PCA dimension of the neighborhood of
F k ( x ) .
When computing the PCA dimension, we set δ = 1 e − 3 and ξ = 1 .
19 e − 7 × 50000 × eig max ,where eig max is the largest PCA eigenvalue.
We then compute the mean value of PCA dimensionsover the neighborhood of 100 random samples in the validation set of ImageNet as the final result.
We do not use PCA dimension of the feature manifolds directly as it is unable to cope with the highlynon-linear structure of intermediate feature manifolds.
However, the Perturbed PCA Dimension isable to estimate the dimensions of local neighborhoods of points in the feature manifolds.
As localneighborhoods can be viewed as linear if the network is smooth, the Perturbed PCA Dimensioncould be more feasible than PCA dimension in our case.
We provide the pseudo-code to compute the
Perturbed PCA Dimension in Algorithm A2.
However, the perturbation is made in the ambient space of the input data manifold X rather than thedata manifold itself.
Thus this estimation may considerably overestimate the intrinsic dimensionsof feature manifolds.
So we merely care about how many Perturbed PCA Dimensions are lost bya sub-network instead of its own Perturbed PCA Dimension.
We call this quantity ∆ Dimension,which is the difference between the Perturbed PCA Dimension of the current layer and that of theinput layer for the given deep network.
As shown in Fig.
A8, we show the dropped dimensions ofdifferent feature layers of the CNN, MLP, and Transformer architectures on ImageNet.
The resultsshow that the Perturbed PCA Dimensions of feature manifolds of most networks decrease as thenetworks get deeper, thus confirming the rank diminishing principle we propose in Theorem 2.
[Figure]
i
[Figure]
H More Examples of Independence Deficit
We provide more examples of independence deficit, which shows that classification confidence ofsome categories can be lineally decided by a few other categories with fixed coefficients.
The resultsobtained by ResNet-18, ResNet-50, GluMixer-24, ResMLP-S24, ViT-T, and Swin-T are reportedin Fig.
A9 - Fig.
A14, respectively.
All the results are obtained by solving the Lasso problem in
Sec. 6.2.
In each figure, we report the classification accuracy for category ‘ i ’:
the accuracy bycalculating logits with Eq.
(12) is reported as ‘acc.’; and the original model accuracy is reported as‘ori.
acc.’.
Both the metrics are measured in the whole ImageNet validation set.
We further reportthe classification accuracy on positive samples only for both metrics as ‘pos’ following ‘acc.’ and‘ori.
acc.’
correspondingly.
The results show a universal independence deficit phenomenon
[Figure]
[Table]
[Figure]
[Figure]
[Table] [Figure] [Table] [Figure]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure] [Table] [Figure] [Table]
[Figure]
[Table] [Figure] [Table]
[Figure]
[Table]
[Figure]
[Table] [Figure] [Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Table]
[Table]
: input images # model: network # target: ground-truth labels # acc_ratio: threshold for measuring intrinsic dimensions of final features def PCA(X, n_components): n = X.shape[0]
X_mean = mean(X, dim=0, keepdim=
True) X
= X - X_mean covariance_matrix = 1 / n * matmul(X.T, X) eigenvalues, eigenvectors =
evd(covariance_matrix, eigenvectors=
True) eigenvalues = norm(eigenvalues, dim=1)
# modulus of complex numbers idx = argsort(-eigenvalues) eigenvectors =
eigenvectors[:, idx] eigenvectors =
eigenvectors
[:, :n_components] return eigenvectors def Feature_projection(X, V): X_proj =
zeros_like(X) for component_idx in range(V.size(1)): eig_vec =
V[:, component_idx].unsqueeze(-1) eig_vec_norm = eig_vec / norm(eig_vec, p=2, keepdim=
True) w_proj = matmul(X, eig_vec_norm)
X_proj_i = w_proj * eig_vec_norm.
T X_proj += X_proj_i return X_proj def Intrinsic_dimension(image, model, target, acc_ratio=0.95): # pre-extract features and calculate original classification accuracy feats = model(image)
# [n_samples * n_channels] acc_ori =
calc_acc(feats, target) for n_component in range(1, feats.size(1)): # compute the eigenvalues and eigenvectors of a real square matrix components =
PCA(feats, n_component) # [n_channels * n_component] # reconstruct features with principal components feats_rec = Feature_projection(feats
[Table] [Table]