Year: 2019

Abstract:
The nonlocal network is designed for capturing long-range spatial-temporal dependencies in several computer vision tasks. Although having shown excellent performances, it needs an elaborate preparation for both the number and position of the building blocks. In this paper, we propose a new formulation of the nonlocal block and interpret it from the general graph signal processing perspective, where we view it as a fully-connected graph filter approximated by Chebyshev polynomials. The proposed nonlocal block is more efficient and robust, which is a generalized form of existing nonlocal blocks (e.g. nonlocal block, nonlocal stage). Moreover, we give the stable hypothesis and show that the steady-state of the deeper nonlocal structure should meet with it. Based on the stable hypothesis, a full-order approximation of the nonlocal block is derived for consecutive connections. Experimental results illustrate the clear-cut improvement and practical applicability of the generalized nonlocal block on both image and video classification tasks.

heading: 1 INTRODUCTION
text: Capturing the long-range spatial-temporal dependencies is crucial for the Deep Convolutional Neural Networks (CNNs) to extract discriminate features in vision tasks such as image and video classification. However, the traditional convolution operator only focuses on processing local neighborhood at a time. This makes the CNNs need to go deeper with convolutional operations to enlarge the receptive fields, which lead to higher computation and memory. Moreover, going deeper cannot always increase the effective receptive fields due to the Gaussian distribution of the kernel weight (Luo et al. (2016)). To eliminate this limitation, some recent works focus on designing the network architecture with wider and well-designed modules to catch the long-range dependencies such as (Peng et al. (2017), Chen et al. (2017), Zhao et al. (2017)). Although having larger receptive fields, these modules still need to be applied recursively to catch the dependencies of the pairs in large distances.
Inspired by the classical non-local means method in image denoising, Wang et al. (2018) proposes the nonlocal neural network which uses the nonlocal (NL) block to concern the “full-range” dependencies in only one module by exploring the correlations between each position and all other positions. In the NL block, the affinity matrix is first computed to represent the correlations between each position pair. Then the weight means of features are calculated based on the affinity matrix to refine the feature representation. Finally, the residual connection is added to the refined feature map. Due to its simplicity and effectiveness, the nonlocal block has been widely used in image and video classification (Wang et al. (2018); Yue et al. (2018); Tao et al. (2018); Chen et al. (2018)), image segmentation (Huang et al. (2018); Yue et al. (2018); Wang et al. (2018)) and person re-identification (Liao et al. (2018); Zhang et al. (2019)) recently.
However, due to the complexity of the affinity matrix, the nonlocal block 1 needs much more computational effort and is sensitive to its number and position in the neural network (Tao et al. (2018)). Some works solve the first problem by simplifying the calculation of the affinity matrix such as Huang et al. (2018), He et al. (2019), Yue et al. (2018), Chen et al. (2018). Only a few works try to solve the second problem which limits the robustness of the nonlocal network 2. Tao et al. (2018)
1The nonlocal block is composed of a nonlocal operator and a residual connection 2The nonlocal network is composed of several nonlocal blocks
proposes the nonlocal stage (NS) block which concerns the diffusion nature and maintains the same affinity matrix for all the nonlocal units in the NS block. Comparing with the NL block, the NS block is insensitive to the numbers and allows deeper nonlocal structure. However, the deeper nonlocal structure of NS block increases the complexity and do not have a remarkable improvement.
In this work, we focus on elaborating a robust nonlocal block which is more flexible when using in the neural network. We prove that the nonlocal operator in the nonlocal block is equivalent to the Chebyshev-approximated fully-connected graph filter with irrational constraints that limits its liberty for learning. To remove these irrational constraints, we propose the Spectral-based Nonlocal (SNL) block which is more robust and can degrade into the NL and NS with specific assumptions. We also prove that the deeper nonlocal structure satisfies the stable hypothesis with the help of steadystate analysis. Based on this hypothesis, we give the full-order approximated spectral nonlocal (gSNL) block which is well-performed for deeper nonlocal structure. Finally, we add our proposed nonlocal blocks into the deep network and evaluate them on the image and video classification tasks. Experiments show that the networks with our proposed blocks are more robust and have a higher accuracy than using other types of nonlocal blocks. To summarize, our contributions are threefold:
• We propose a spectral nonlocal (SNL) block as an efficient, simple, and generic component for capturing long-range spatial-temporal dependencies with deep neural networks, which is a generalization of the classical nonlocal blocks.
• We propose the stable hypothesis, which can enable the deeper nonlocal structure without an elaborate preparation for both the number and position of the building blocks. We further extend SNL into generalized SNL (gSNL), which can enable multiple nonlocal blocks to be plugged into the existing computer vision architectures with stable learning dynamics.
• Both SNL and gSNL have outperformed other nonlocal blocks across both image and video classification tasks with a clear-cut improvement.

heading: 2 PRELIMINARY
text: Nonlocal block The NL block consist of NL operator with residual connection and is expressed as: Y = X + F(A,Z) with Z = XWg, (1)
where X ∈ RN×C1 is the input feature map, F(A,Z) is the NL operator, Z ∈ RN×Cs is the transferred feature map that compresses the channels of X ∈ RN×C1 by a linear transformation with kernel Wg ∈ RC1×Cs . Here N is the number of positions. The affinity matrix A ∈ RN×N is composed by pairwise correlations between pixels.
In the NL block, the NL operator explores the “full-range” dependencies by concerning the relationships between all the position pairs:
F(A,Z) = AZW with A = (aij)N×N , Aij = f(Xi,:,Xj,:), (2) where W ∈ RCs×C1 is the weight matrix of a linear transformation. f(·) is the affinity kernel which can adopt the “Dot Product”, “Traditional Gasuassian”, “Embedded Gasussian” or other kernel matrix with a finite Frobenius norm.
Nonlocal stage To make the NL operator follow the diffusion nature that allows deeper nonlocal structure (Tao et al. (2018)), the nonlocal stage (NS) operator uses the graph laplacian L = DA−A to replace the affinity matrix A in the NL operator:
F̄(A,Z) = (A−DA)ZW with DA = diag(di), (3) where F̄(A,Z) is the NS operator. di = ∑ j aij is the degree of node i. Moreover, when adding multiple blocks with the same affinity matrix A and replacing the NL operator by the NS operator, these consecutively-connected blocks become the NS block. We called these nonlocal blocks in the NS block as the NS units.

heading: 3 METHOD
text: The nonlocal operator can be divided into two steps: calculating the affinity matrix A to represent the correlations between each position pairs and refining the feature map by calculating the
weighted means based on A. In this section, a fully-connected graph filter is utilized for explaining the nonlocal operator. With the Chebyshev approximation, we propose the SNL operator which is proved to be a generalized form of NL and NS operator and is more robust with higher performance in computer vision tasks. Furthermore, based on the stable hypothesis that deeper nonlocal structure tends to learn a stable affinity matrix, we extend our SNL operator into a full-order Chebyshev approximation version, i.e. the gSNL.

heading: 3.1 THE PROPOSED SPECTRAL NONLOCAL OPERATOR
text: Nonlocal operator in the graph view The nonlocal operator F(A,Z) is a filter that computes a weighted mean of all the positions in the feature map Z based on the affinity matrix A and then conduct the feature transformation with the kernel W. This is the same as filtering the signal Z by a graph filter Ω in the graph domain defined by the affinity matrix A (Shuman et al. (2013)). Based on this perspective (Shuman et al. (2013)), we further define the nonlocal operator as: Theorem 1. Given an affinity matrix A ∈ RN×N and the signal Z ∈ RN×Cs , the nonlocal operator is the same as filtering the signal Z in the graph domain of a fully-connected weighted graph G:
F(A,Z) = Z ∗ g = Ugθ(Λ)UTZ = UΩUTZ with L = DL −A = UTΛU,
(4)
where the graph filter Ω ∈ RN×N is a diagonal parameter matrix, i.e. Ω = diag(ω), ω = (ω1, ω2, ..., ωn). G = (V,A) is a fully-connected graph with the vertex set V and affinity matrix A. Λ = diag({λ1, λ2, ..., λi, ..., λN}) and U = {u1,u2, ...,ui, ...,uN} are the eigenvectors and eigenvalues of the graph laplacian L.
This definition requires that the graph laplacian L has non-singular eigenvalue and eigenvector, so the affinity matrix A should be a symmetric, non-negative, row-normalized matrix. To meet this requirement, the affinity matrix A can be obtained by the following steps. First, the affinity kernel is used to calculate the matrix A (we use the dot product with embeded weight matrix Wφ ∈ RC1×Cs and Wϕ ∈ RC1×Cs as the affinity kernel, i.e. A = (XWφ)(XWϕ)). Then we make the matrix A symmetric: Ā = A
T+A 2 . We normalize the row of Ā to make it satisfy di = 1 and having Ǎ =
D−1A Ā. For the simplicity, in the following sections the symmetric, non-negative, row-normalized matrix Ǎ is denoted as A.
The proposed spectral nonlocal operator The graph filter Ω in Eq. (4) contains N parameters. To simplify it, we use the Chebyshev polynomials which can reduce the N parameters into k (k N ). For simplicity, we firstly assume that the input Z, the output F(A,Z) and the output F(A,Z) have only one channel.
Following the similar method as Defferrard et al. (2016), the kst-order Chebyshev polynomials is used to approximate the graph filter function gθ(Λ):
F(A,Z) = K−1∑ k=0 θkTk(L ′ )Z with L ′ = 2L/λmax − In, s.t. T0(L ′ ) = In, T1(L ′ ) = L ′ , Tk(L ′ ) = 2L ′ Tk−1(L ′ )− Tk−2(L ′ ).
(5)
Due to L is a random walk laplacican, the maximum eiginvalue λmax satisfies λmax = 2 which makes L ′ = A (Shuman et al. (2013)). Then Eq. (5) becomes:
F(A,Z) = K−1∑ k=0 θkTk(A)Z = θ0Z + θ1AZ + K−1∑ k=2 θkTk(A)Z, (6)
If k = 1, the first-order Chebyshev approximation of Eq. (6) becomes:
F(A,Z) = θ0Z + θ1AZ, (7) where θ0 and θ1 are the coefficients for the first and second term which are approximated by learning with SGD. Then, extending Eq. (7) into multi-channel conditions, we can get the formation of our SNL operator:
Fs(A,Z) = ZW1 + AZW2, (8)
where Fs(A,Z) is the SNL operator, W1 ∈ RCs×C1 , W2 ∈ RCs×C1 . Finally, a residual connection is added with the SNL operator to form the SNL block:
Y = X + Fs(A,Z) = X + ZW1 + AZW2. (9)
Relation with other nonlocal operators As shown in fig. 1, our SNL operator can degrade into the NL operator by setting W1 = 0, i.e. θ0 = 0. However, its analytic solution: θ0 = 2N ∑N j=0 ωj controls the total filtering intensity, which cannot be guaranteed to be 0. This setting will limit the search space when training the network and reduce the robustness of the NL block. The NL operator cannot magnify features of a large range and damp some discriminative features such as the beak of the waterfowl. Our SNL operator can also degrade into the NS operator by setting W1 = −W2, i.e. θ1 + θ0 = 0. However, the analytic solution of this equation is θ1 + θ0 = 2N ∑N j=0 ωj(λj + 1) = 0. When setting it to zero, the filter strength of the high-frequency signal (with high λ) such as the small part or twig is suppressed. Thus, it still cannot magnify the discriminative part such as the beak of the waterfowl as shown in fig. 1. Comparing with NL and NS, our SNL does not have these irrational constraints and give these two parameters a liberal learning space. Thus, θ0 can control the preserve strength of the discriminative features, while θ1 can pay more attention to the low-frequency signal to diminish the noise.

heading: 3.2 THE PROPOSED GENERALIZED SPECTRAL NONLOCAL OPERATOR
text: To fully exploit the “full-range” dependencies, the nonlocal block should have the ability to be consecutively stacked into the network to form a deeper nonlocal structure. However, some types of nonlocal blocks such as the NL and CGNL block cannot achieve this purpose (Tao et al. (2018)). To show the robustness of our SNL block when used in the deeper nonlocal structure, we firstly study the steady-state of deeper nonlocal structure when consecutively adding our SNL block. We also prove the stable hypothesis that the deeper nonlocal structure tends to learn a stable affinity. Based on this hypothesis, we can extend our SNL block into a full-order Chebyshev approximation, i.e. the gSNL block which is more applicable for deeper nonlocal structure.
The stable hypothesis The Steady-state analysis can be used to analyze the stable dynamics of the nonlocal block. Here we give the steady-state analysis of our SNL block when consecutively adds into the network structure and get the Stable Hypothesis:
Lemma 1. The Stable Hypothesis: when adding more than two consecutively-connected SNL blocks with the same affinity matrix A into the network structure, these SNL blocks are stable when the variable affinity matrix A satisfies: Ak = A.
Proof. The stability holds when the weight parameters in W1,W2 and W are small enough such that the CFL condition is satisfied (Tao et al. (2018)). So we ignore them for simplicity. The discrete nonlinear operator of our SNL have a similar formulation as the NS operator:
LhZN := −LZ,
where h is the discretization parameter. ZN is the input of the N th block in the deeper nonlocal structure with Z0 = X. The stable assumption demands that ZN+1 = ZN , so the steady-state equation of the last SNL block can be written as:
ZN+1 − ZN = LhZN = −LZN = 0.
The deeper nonlocal structure has more than one SNL blocks. So the ZN−1 and LhZN−1 can be used to express ZN :
−LZN = −(I−A)ZN = −(I−A)(ZN−1 + LhZN−1) = −(I−A)ZN−1 + (I−A)(I−A)ZN−1 = 0.
Finally, the steady-state equation becomes:
(I−A)ZN−1 = (I−A)2ZN−1 ⇐⇒ A2 = A
This equation can naturally extend to the k-hop affinity matrix Ak, i.e. Ak = A.
To verify the stable hypothesis, we add five consecutively-connected SNL blocks (and NS blocks) into the PreResnet56 He et al. (2016) and train this model on the train set of the CIFAR100 dataset with the initial learning rate 0.1 which is subsequently divided by 10 at 150 and 250 epochs (total 300 epochs). A weight decay 1e − 4 and momentum 0.9 are also used. Then we test the trained model on the test set and output the affinity matrix of each image. Figure. 2 shows the statistics that reflects the strength of the affinity matrix, 2-hop, 3-hop, and 4-hop affinity matrix: A,A2,A3,A4. We can see that the number of elements in each histogram bin are nearly the same. This means that
the A, A2, A3, A4 have similar distribution of all the elements in k-hop affinity matrixes, which also empirically verifies the stable-state equation: Ak = A. Full-order spectral nonlocal operator With the stable hypothesis, the Chebyshev polynomials can be simplified into a piece-wise function (details in Appendix B). Taking this piece-wise function into the Eq. 7, we can get the full-order approximation of the SNL operator:
F∗s (A,Z) = ∑ k θkTk(A)Z = Zθ̃1 + AZθ̃2 + (2A− I)Zθ̃3, (10)
where θ̃1 = ∑k%4=0 i1 θi1 , θ̃2 = ∑k%4=1||k%4=2 i2 θi1 , θ̃3 = ∑k%4=3 i1
θi1 , whose upper bound is less than 1. Then, extending it into multi-channel input and output with the residual connection, we can get our gSNL block:
Y = X + F∗s (A,Z) = X + ZW1 + AZW2 + (2A− I)ZW3 (11)
The gSNL block is well-performed when the stable affinity hypothesis is satisfied, i.e. adding more than two nonlocal blocks with the same affinity matrix as shown in Table. 4.

heading: 3.3 IMPLEMENTATION DETAILS
text: The implementation details of the gSNL block is shown in fig. 3. The input feature map X ∈ RW×H×C1 is first fed into three 1x1 convolutions with the weight kernel: Wφ ∈ RC1×Cs , Wϕ ∈ RC1×Cs , Wg ∈ RC1×Cs to subtract the number of channel. One of the output Z ∈ RW×H×Cs is used as the transferred feature map to reduce the calculation complexity, while the other two output Φ ∈ RW×H×Cs , Ψ ∈ RW×H×Cs are used to get the affinity matrix A. The sub-channel Cs are usually two times less than the input channel C1. The affinity matrix is calculated by the affinity kernel function f(·) and then use the operation in Sec3.1 to make it non-negative, symmetric and normalized. Finally, with the affinity matrix A and the transferred feature map Z, the output of the nonlocal block can be obtained by the equation Eq. (11). Specifically, the three weight matrixes W1 ∈ RCs×C1 , W2 ∈ RCs×C1 , W3 ∈ RCs×C1 are implemented as three 1x1 convolutions.

heading: 4 EXPERIMENT

heading: 4.1 SETTING
text: Datasets Our proposed SNL and gSNL blocks have been evaluated across several computer vision tasks, including image classification and video-based action recognition. For the image classification, both CIFAR-10 and CIFAR-100 datasets (Krizhevsky & Hinton (2009)) are tested. The CIFAR10 dataset contains 60, 000 images of 10 classes, and CIFAR-100 dataset contains 60, 000 images of 100 classes. For these two datasets, we use 50, 000 images as the train set and 10, 000 images as
the test set. We also generate experiments for the fine-grained classification on the Birds-200-2011 (CUB-200) dataset (Welinder et al. (2010)) which contains 11, 788 images of 200 bird categories. For the action recognition, the experiments are conducted on the UCF-101 dataset (Soomro et al. (2012)), which contains 101 different actions.
Backbones For the image classification, the ResNet-50 and the PreResNet variations (including both PreResNet-20 and PreResNet-56) are used as the backbone networks. For the video classification task, we follow the I3D structure (Hara et al. (2018)) which uses k × k × k kernels to replace the convolution operator in the residual block.
Setting for the network In the main experiments, we setCs = C1/2. Without loss of the generality, we use the “Dot Product” as the affinity kernel in the experiments. We add one SNL (or gSNL) block into these backbone networks to construct the SNL (or gSNL) network. For the ResNet and the I3D (Hara et al. (2018)), following Wang et al. (2018) we add the SNL block right before the last residual block of res4. For the PreResNet series, we add the SNL block right after the second residual block in res1. For the other nonlocal-base block including the NL (Wang et al. (2018)), the NS (Tao et al. (2018)), the Compact Generalized Nonlocal Block (CGNL) (Yue et al. (2018)) and the Double Attention Block (A2), the settings are all the same as ours. The difference of these blocks are shown in Table. 1, in which the Approximated Condition shows the strategy for the Chebyshev approximation and Channel-wise reflect the consideration of the channel relations.
Setting for the training For the image classification on CIFAR-10 dataset and CIFAR-100 dataset, we train the models end-to-end without using pretrained model. The initial learning rate 0.1 is used for these two datasets with the weight decay 1e− 4 and momentum 0.9. The learning rate is divided by 10 at 150 and 250 epochs. The models are trained for total 300 epochs.
For the fine-grained classification on CUB-200 dataset, we use the models pretrained on ImageNet (Russakovsky et al. (2015)) to initialize the weights. We train the models for total 200 epochs with the initial learning rate 0.1 which is subsequently divided by 10 at 31, 61, 81 epochs. The weight decay and momentum are the same as the setting of CIFAR-10 and CIFAR-100.
For the video classification on the UCF-101 dataset, the weights are initialized by the pretrained I3D model on Kinetics dataset (Kay et al. (2017)). We train the models with the initial learning rate 0.1 which is subsequently divided by 10 each 40 epochs. The training stops at the 100 epochs. The weight decay and momentum are the same as the setting of CIFAR-10 and CIFAR-100.

heading: 4.2 ABLATION EXPERIMENT
text: The number of channels in transferred feature space The nonlocal-based block firstly reduces the channels of original feature mapC1 into the transferred feature spaceCs by the 1×1 convolution to reduce the computation complexity. When Cs is too large, the feature map will contain redundant information which introduces the noise when calculating the affinity matrix A. However, if Cs is too small, it is hard to reconstruct the output feature map due to inadequate features. To test the robustness for the number of the Cs, we generate three types of models with different number of the transferred channels with the setting: “Sub 1” (Cs = C1), “Sub 2” (Cs = C12 ), “Sub 4” (Cs = C1 4 ) as shown in Table. 2. Other parameters of the models and the training steps are the same as the setting in Sec.4.1. Table. 2 shows the experimental results of the three types of models with different nonlocal blocks. Our SNL and gSNL blocks outperforms other models profited by their flexible for learning. Moreover, from Table. 2, we can see that the performances of the CGNL steeply drops when the number of the transferred channels increases. This is because the CGNL block concerns
the relationship between channels, when the number of the sub-channel increases, the relationship between the redundant channels seriously interferes its effects. Overall, our proposed nonlocal block is the most robust for the large number of transferred channels (our model rise 1.1% in Top1 while the best of others only rise 0.4% compared to the baseline).
The stage for adding the nonlocal blocks The nonlocal-based blocks can be added into the different stages of the preResNet (or the ResNet) to form the Nonlocal Net. In Tao et al. (2018), the nonlocalbased blocks are added into the early stage of the preResNet to catch the long-range correlations. Here we experiment the performance of adding different types of nonlocal blocks into the three stages (the first, the second and the third stage of the preResNet) and train the models on CIFAR100 dataset with the same setting discussed in Sec.5.2. The experimental results are shown in Table. 3. We can see that the performances of the NL block is lower than the backbones when adding into the early stage. However, our proposed SNL block has 0.81% improvement compared with the backbone when respectively adding into all the three stages, which is much higher than the other type nonlocal blocks (only 0.42% for the best case).
To intuitively show the stability and robustness of our SNL, we give the spectrum analysis for the estimated weight matrices (Tao et al. (2018)). We extract the self-attention weight matrix: Wg,W of the NL block and the NS block, Wg,W2 of our proposed SNL block. The dimension of the weight matrix satisfies: Wg ∈ RC1×Cs , W ∈ RCs×C1 W2 ∈ RCs×C1 . To make all the eigenvalues real, we let: W̃ = (WgW)+(WgW) T
2 . We do the same to the W2. Figure. 5 shows the top thirtytwo eigenvalues of the weight matrix of W̃ on the models in Table. 3. We can see that the density of the negative eigenvalues is higher than the positive eigenvalues of the NL block when adding into all three stages. This phenomenon makes the NL operator F(A,Z) in Eq. (1) less than zero. So the output feature map is less than the input feature map, i.e. Y < X (more detail of this phenomenon can be seen in Tao et al. (2018)). The NS block can avoid “the damping effect” to some extent by concerning the diffusion nature. However, when adding into the early stage, only six eigenvalues of the nonlocal stage are not equal to zero. This phenomenon makes the nonlocal stage cannot effectively magnify the discriminated feature. Comparing with these two models, our proposed SNL block has more positive eigenvalues which takes effect to enhance the discriminated features and also avoids the “damping effect”.
The number of the nonlocal blocks We test the robustness for adding multiple nonlocal blocks into the backbone network which forms the three type network “Different Position 3 (DP 3)”, “Same Position 3 (SP 3)” “Same Position 5 (SP 5)” as shown in Table. 4. The result are shown in Table. 4. For the model “DP3”, three blocks are added into the stage 1, stage 2, and stage 3 (right after the second residual block). We can see that adding three proposed nonlocal operators into different stages of the backbone generate a larger improvement than the NS operator and NL operator (2.4% improvement). This is because when adding NS and NL into the early stage, these two models cannot better aggregate the low-level features and interfere the following blocks. For the model “SP 3” (“SP 5”), we add three (five) consecutively-connected nonlocal blocks into the stage 1. Note that different from the experiment in Tao et al. (2018) and Wang et al. (2018), these consecutivelyconnected nonlocal blocks have the same affinity matrix. From Table. 4, we can see that profited by concerning the stable hypothesis discussed in Sec 3.3, our gSNL outperform all other models when adding consecutively-connected nonlocal blocks (rises average 0.72% to the backbone and 0.41% higher than the best performance of other type nonlocal blocks) and has a relatively stable performance. However, one drawback is that our gSNL may interfere the learning when adding only one nonlocal block (the stable hypothesis is not satisfied).

heading: 4.3 MAIN RESULTS
text: We test the networks with the Nonlocal Block (NL), the Nonlocal Stage (NS), the Compact Generalized Nonlocal block (CGNL), the Double Attention Block (A2) and our SNL (gSNL) blocks in the different visual learning tasks. The experiment settings are discussed in Sec.4.1. Our models outperform other types of the nonlocal blocks across several standard benchmarks. Table. 5 shows the experimental results on the CIFAR10 dataset, we can see that by adding one proposed block, the Top1 rises about 0.65%, which is higher than adding other type nonlocal blocks (0.3%). As the experiments on CIFAR100 dataset shown in Table. 7, using our proposed block brings improvement about 1.8% with ResNet50. While using a more simple backbone PreResnet56, our model can still generate 1.1% improvement as shown in Table. 6.
Table. 9 shows the experimental results on the fine-grained image classification task on CUB-200 datasets. Our model outperforms other non-channel-concerning blocks and generate (0.42%) im-
provement. Comparing with the channel-wise concerning CGNL block, our model is only a bit lower in Top1. Fig. 4 also shows the visualized feature map which is formed by adding the upsampled feature output with the source image. We can see that the feature maps of our proposed block can cover more critical area of the birds. For example, both the left and right wings (red square) of the birds can be focused profited by the better long-range concerning of our SNL. Moreover, benefited from the flexibility of the W1, our proposed SNL can also catch a relatively large range of the discriminative parts. Table. 8 shows the experimental results on the action recognition task. The network with our proposed block can generate 1.8% improvement than the I3D model and outperforms all other nonlocal models on the UCF-101 dataset.
Table 8: The Results on UCF101
model top1 top5 I3D 81.57% 95.40% + NL 81.37% 95.76% + NS 82.50% 95.84% + A2 82.68% 95.85% + CGNL 83.16% 96.16 % + *SNL 82.30% 95.56% + *gSNL 83.21% 96.53%
Table 9: The Results on CUB
model top1 top5 R-50 85.43% 96.70% + NL 85.34% 96.77% + NS 85.54% 96.56% + A2 86.02% 96.56% + CGNL 86.14% 96.34% + *SNL 85.91% 96.65% + *gSNL 85.95% 96.79%

heading: 5 CONCLUSION
text: In this paper, we explain the nonlocal block in the graph view and propose the spectral nonlocal (SNL) block which is more robust and well-behaved. Our SNL block is a generalized version of the NL and NS block and having more liberty for the parameter learning. We also give the stable hypothesis for deeper nonlocal structure and extend the SNL to gSNL that can be applied to the deeper nonlocal structures. The experiments on multiple computer vision tasks show the high robustness and performance of our proposed nonlocal block. Feature works will focus on using the SNL block into different vision task and its roubustness for the other type of neural network such as the Generative Adversarial Networks (GAN).

heading: A ANALYTIC SOLUTION OF THE CHEBYSHEV APPROXIMATE
text: Here we give the analytic solution for the coefficients in Chebyshev polynomials (Phillips (2003)):
Theorem 2. Giving a function f(x), x = {x1, x2, ..., xN}, it can be optimally approximated by Chebyshev polynomials: f(x) ≈ ∑K−1 k=0 akTk(x), only when ak satisfies: ak = 2 N ∑N j=0 f(xj)Tk(xj). We call the ak as the analytic solution of the Chebyshev coeffcients.
Based on these theorem, we can get the analytic solution of the parameter θ for Eq. (7):
Lemma 2. The spectral nonlocal operator can be best approximated when the function g(λ) = ω can be best approximated by the Chebyshev polynomials, i.e. the analytic solutions of the Chebyshev coeffcients satisfy:
θk = ak = 2
N N∑ j=0 g(λj)Tk(λj) = 2 N N∑ j=0 ωjTk(λj) (12)

heading: B THE PIECEWISE CHEBYSHEV POLYNOMIALS
text: Taking Ak = A into the Chebyshev polynomials of the affinity matrix A, the Chebyshev polynomials becomes:
T0(A) = I
T1(A) = A
T2(A) = 2AT1(A)− T0(A) = 2AA− I = 2A− I T3(A) = 2AT2(A)− T1(A) = 2A(2A− I)−A = A T4(A) = 2AT3(A)− T2(A) = 2AA− 2A + I = I = T0(A) T5(A) = 2AT4(A)− T3(A) = 2AI−A = A = T1(A) T6(A) = 2AT5(A)− T4(A) = 2 ∗ T2(A)− T1(A) = T2(A)
(13)
This cyclic form of Chebshev polynomials Tk(A) can be reformulated as a piecewise function:
Tk(A) =
{ I k%4 = 0
A k%4 = 1 || k%4 = 3 2A− I k%4 = 2
(14)

heading: C EXPERIMENT OF SEMANTIC SEGMENTATION ON VOC2012 DATASET
text: For the semantic segmentation tasks, we generate experiment on the VOC2012 dataset with the model proposed by Chen et al. (2017).We add different types of nonlocal blocks on right before the last residual block in res4 of the ResNet50. The models are trained for 50 epochs with the SGD optimize algorithm. The learning rate is set 0.007 with the weight decay 5e− 4 and momentum 0.9. Experimental results show that the model with our proposed block can the best results.

heading: D THE EXAMPLE OF THE AFFINITY MATRIX ON CUB DATASETS
text: Experiments to verify the stable hypothesis is also generated on the CUB datasets, we add three consecutively-connected SNL blocks (and NS blocks) into the ResNet50 (right before the last residual block of res4) and train this model on the train set of the CUB dataset with the initial learning rate 0.1 which is subsequently divided by 10 at 31, 61 and 81 epochs (total 200 epochs). A weight decay 1e− 4 and momentum 0.9 are also used. Figure. 6 shows the histogram of the strength statistics of the affinity matrix A. We can see that although using different backbone and dataset, the distribution of the k-hop affinity matrixes are corresponded with the experiments on CIFAR100.

heading: E EXPERIMENTS ON VIDEO-BASED PERSON RE-IDENTIFICATION
text: Experiments are also conducted on the challenging datasets on Video-based Person Re-identification task including the Mars, ILID-SVID and PRID2011. For the backbone, we follow the strategy of Gao & Nevatia (2018) that uses the pooling (RTMtp) and attention (RTMta) to fuse the spatialtemporal features. Note that the models are totally trained on ilidsvid and prid2011 rather than finetuning the pre-trained model on Mars dataset. The experimental results are shown in Table.11, 12, 13. We can see that in these datasets, our proposed block can still generate consistent improvements.
Table 11: The Results on Mars dataset
model mAP Rank1 RTMta 77.70% 79.10% + NL 72.90% 80.90% + *SNL 74.00% 81.98% RTMtp 75.70% 82.30% + NL 75.54% 83.40% + *SNL 76.80% 99.92%
Table 12: The Results on ILIDSVID dataset
model mAP Rank1 RTMta 69.70% 58.70% + NL 66.30% 56.00% + *SNL 79.40% 70.00% RTMtp 81.60% 74.70% + NL 83.00% 75.30% + *SNL 84.80% 76.60%
Table 13: The Results on PRID2011 dataset
model mAP Rank1 RTMta 86.60% 79.80% + NL 90.70% 85.40% + *SNL 91.50% 86.50% RTMtp 90.50% 86.50% + NL 89.70% 85.40% + *SNL 92.40% 88.80%

heading: F ADDITIONAL EXPERIMENTS ON ACTION CLASSIFICATION
text: Ours SNL can also improve the performance of other network structures such as the Pseudo 3D Convolutional Network (P3D) (Qiu et al. (2017)), the Motion-augmented RGB Stream (MARS) (Crasto et al. (2019)), the Slow-Fast Network (Slow-Fast) (Feichtenhofer et al. (2019)) and the Video Transformer Network (VTN) (Kozlov et al. (2019)). For P3D and MARS, our SNL block is inserted right before the last residual layer of the res3. For the Slow-Fast, we replace its original NL block with our SNL block. For the VTN, we replace its multi-head self-attention blocks (paralleledconnected NL blocks) with our SNL blocks. The Slow-Fast network are trained end-to-end on the UCF-101 dataset while others use the model pretrained on Kinetic400 dataset and finetuning on the UCF-101 dataset. From Table. 14, We can see that all the performances are improved when adding our proposed SNL model.
Experiments on Kinetics-400 dataset are also given in Table. 15. We can see that inserting SNL block into the Slow-Fast Network can generate 2.1% improvement.

Review summaries:
In this paper, authors propose a spectral nonlocal block. First, they re-interpret the nonlocal blocks in a graph view and then use Chebyshev approximation to obtain the spectral nonlocal block which is quite simple by adding a ZW_1 term. Furthermore, they analyze the steady-state to build up a deeper nonlocal structure. Also, the gSNL is simple by adding a (2A-I)ZW_3 term.

The paper proposes a spectral non-local block, which is a generalized method of the non-local block and non-local stage in the literature. The proposed spectral non-local block can be plugged into a neural network to improve its effectiveness. The paper also provides theoretical analyses of the stability of the proposed method, and also extend the method by including more  Chebyshev polynomial terms. Experiments are conducted on image classification and action recognition tasks, and they valid the effectiveness of the proposed method.