{'fraction_non_alphanumeric': 0.03859885134785533, 'fraction_numerical': 0.010037770993946293, 'mean_word_length': 4.704693034238489, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Efficient Deep Learning of Non-local Features for Hyperspectral Image Classification

Deep learning based methods, such as Convolution Neural Network (CNN), have demonstrated their efficiency in hyperspectral image (HSI) classification. These methods can automatically learn spectral-spatial discriminative features within local patches. However, for each pixel in an HSI, it is not only related to its nearby pixels but also has connections to pixels far away from itself. Therefore, to incorporate the long-range contextual information, a deep fully convolutional network (FCN) with an efficient non-local module, named ENL-FCN, is proposed for HSI classification. In the proposed framework, a deep FCN considers an entire HSI as input and extracts spectral-spatial information in a local receptive field. The efficient non-local module is embedded in the network as a learning unit to capture the long-range contextual information. Different from the traditional non-local neural networks, the long-range contextual information is extracted in a specially designed criss-cross path for computation efficiency. Furthermore, by using a recurrent operation, each pixel's response is aggregated from all pixels of HSI. The benefits of our proposed ENL-FCN are threefold: 1) the long-range contextual information is incorporated effectively, 2) the efficient module can be freely embedded in a deep neural network in a plug-and-play fashion, and 3) it has much fewer learning parameters and requires less computational resources. The experiments conducted on three popular HSI datasets demonstrate that the proposed method achieves state-of-the-art classification performance with lower computational cost in comparison with several leading deep neural networks for HSI.

to the abundant spectral and spatial information, hyperspectral images (HSIs) enable the ability for pixel-wise classification, which aims at assigning a class label to each pixel and generating a thematic map of HSI.
Many machine learning based classifiers have been developed for HSI classification. For example, some pixel-wise methods, such as support vector machine (SVM) [2], extreme learning machine (ELM) [3] and dictionary representation [4], have been successful in HSI classification. These methods focus on spectral features for class membership assignment. Due to the existence of noise and mixed pixels in HSIs, pixelwise approaches can result in considerable errors in thematic maps. To address this problem, on the one hand, kernel tricks, such as the composite kernel SVM (SVMCK) [5], are proposed to improve the linear separability. On the other hand, researchers have exploited spectral-spatial contextual information and developed a variety of classification algorithms. These methods assume that neighboring pixels share similar spectral signatures and thus belong to the same land-cover types. Based on this assumption, spectral-spatial feature extraction methods, such as Gabor filtering [6], [7], wavelet transformation [8], [9], object voting [10], [11], and local binary pattern (LBP) [12], [13], are proposed to improve the discrimination of classes. Random field based methods have also been used as postprocessing approaches in HSI classification [14], [15], [16]. For example, in [17], Markov Random Field (MRF) is used as the post-processing strategy after multi-nominal logistic regression (MLR) to improve pixel-wise classification results.
Although the CNN framework is able to extract spectralspatial contextual information by convolutional kernels, the extracted information is still limited in a fixed small patch and the non-local information is barely utilized. For a pixel in a remote sensing image, it is not only related to its nearby pixels but also has connections to some pixels far away, e.g., the same land cover may appear in different locations of the scene. Therefore, to extract long-range contextual information, an intuitive approach is to expand the kernel size in convolution operations. In [42], a multi-scale approach is used to fuse the spectral-spatial information extracted from different scales of convolutional kernels. Although a larger convolutional kernel can acquire more contextual information, it may lead to oversmooth and blur image details.
Recently, two strategies have been presented to incorporate long-range information in deep learning networks. One solution is to combine a deep neural network with conditional random field (CRF) for HSI classification [43]. In [44], Xu et al. introduce CRF after a CNN to balance local and non-local information. However, this approach divides the training step into two individual phases and thus the global optimization is difficult to achieve. Another solution is to apply non-local based neural modules [45]. Non-local based methods consider each pixel's response from the whole image, which was first used in image denoising [46]. After that, non-local based methods are integrated with a variety of machine learning methods, such as dictionary learning [47] and collaborative representation [48], for HSI classification. Inspired by the non-local mean filtering algorithm [46], a non-local network [49] is proposed by Wang et al. for incorporating long-range dependencies, which is able to compute the responses of a pixel with all other pixels in the image. In [50], Sun et al. propose to add non-local modules to a CNN framework, and then spectral-spatial information from non-local areas can be captured for HSI classification. However, the HSI is still processed in individual small patches and the long-range contextual information is difficult to be modeled. Moreover, the computational cost of the non-local module is very high. Compared with common RGB images, HSI is a data cube that has both high spatial and spectral dimensions. The non-local operation will consume significant computational resources because the correlation of each pixel is calculated based on the whole HSI.
From the analysis of prior work, how to efficiently model long-range contextual information remains unsolved for HSI classification. To this end, in this paper, an FCN with an efficient non-local module, named ENL-FCN, is proposed to extract both local and non-local spectral-spatial information. Specifically, the FCN extracts the local spectral-spatial information from HSI, while an efficient non-local module [51] is embedded in the network to aggregate each pixel's response from the whole HSI. The proposed efficient non-local module is developed from the criss-cross attention module [51], which was used for semantic segmentation. Compared with the original non-local module, the efficient non-local module computes the pixels' relation in a criss-cross path for computation efficiency. By using a recurrent operation, each pixels response is aggregated from all pixels of HSI. Furthermore, to help understand the long-range contextual information modeling of the network, we conduct visualization analysis to observe the correlation of each pixel in the entire image. The main contributions of this paper can be summarized as follows.
• An end-to-end trainable deep learning framework is proposed for HSI classification. By integrating FCN with the efficient non-local module, the framework is able to extract both local and non-local information. • The efficient non-local module offers computation and memory efficiency, making it feasible to stack multiple efficient non-local modules for further boosting the performance. • Compared with the original non-local module [49], the efficient non-local module saves more than three times computational memory and one hundred times learning parameters. Extensive experiments demonstrate that the proposed ENL-FCN achieves state-of-the-art classification performance on several HSI datasets. Comprehensive ablation studies and parameter analysis are carried out to validate the effectiveness of each component of the proposed method.
The remainder of this paper is organized as follows. In Section II, we review the works related to HSI classification. Section III introduces the proposed framework. Section IV provides comprehensive experimental results and parameter analysis. Finally, conclusion is drawn in Section V.

A. HSI Classification with Machine Learning Methods
Supervised HSI classification has been widely investigated and many machine learning based methods have been proposed, such as logistic regression [17], SVM [2], ELM [3] and sparse representation [52]. Among these methods, SVM is effective in HSI classification with limited training samples. The classic SVM treats each pixel independently and the class label is determined by its spectral signature. Due to the existence of spectral noise, the classification results of these pixel-wise approaches are still unsatisfactory. To overcome this limitation, the spatial correlation of HSI is considered. Therefore, more works include spectral-spatial information for HSI classification [53], [54]. Filtering based methods, such as Gabor filtering [7] and bilateral filtering [55], are utilized for HSI classification. Random fields [15], relearning methods, Fig. 1: Network architecture of the proposed ENL-FCN. The HSI is first fed into FCN for local spectral-spatial information extraction. After Conv.2 layer of the network, two efficient non-local modules are embedded in parallel for integrating longrange contextual information of HSI. s denotes the convolutional kernel size, N denotes the number of convolutional kernels. and object voting [56], are also developed to exploit spatial correlation of pixels.
The aforementioned methods represent HSI pixels with handcrafting features, which highly depend on experts' experience. Different from these traditional classifiers, deep learning methods can automatically obtain high-level features by several representation layers. In [57], Chen et al. first introduce a deep learning method in HSI classification, which uses a stacked auto-encoder (SAE) for high-level feature extraction. Recently, CNN based approaches have emerged for HSI classification. For instance, in [58], a five-layer 1-D CNN is introduced to extract spectral features and has achieved promising performance. To further exploit the spectral-spatial information of HSI, more effective CNN architectures have developed. In [58], 2D-CNN is encoded to explore spatial correlation and the classification is conducted with a multi-layer perceptron. In [59], more convolutional layers are grouped and used in pyramidal bottleneck to increase the depth of CNN. Moreover, a multi-scale representation is used to fuse the spectral-spatial information from different scales to obtain more discriminative features.
There are mainly two type frameworks or pipelines for CNN based HSI classification. One is the patch-based framework, where local patches are first extracted from HSI with fixed window size (e.g., 7 × 7). This framework involves modeling a patch classification task, where each extracted patch is assigned with a class label. Usually, the label of a small patch is determined by that of the center pixel in the patch. Although patch-based frameworks have achieved remarkable success in HSI classification, it requires much computational cost because a series of overlapping patches need to be generated, and it is difficult for CNN to sufficiently model non-local information. To alleviate these issues, FCN based frameworks have emerged as an alternative solution. In an FCN framework, the fully connected layer of CNN is replaced by the 1 × 1 kernel. In this way, FCN enables the whole HSI as input and produces a corresponding class map. In [60], a pre-trained FCN is used to extract HSI feature. However, this framework is not end-to-end and the extracted feature is fed into SVM for classification. In [41], an end-to-end FCN is proposed and achieves better classification performance than some patched based frameworks.

B. Non-local Information Modeling
With the rapid development of deep learning methods, researchers have exploited non-local information in deep neural networks. Similar to traditional methods, random field based methods are first combined with CNN for semantic segmentation [61]. After that, a trainable end-to-end CRF based network is introduced [62]. On the other hand, non-local based neural networks have also developed. Inspired by the classic nonlocal mean filtering [46], Wang et al. [49] proposed a nonlocal neural network to capture long-range pixel dependencies, which achieves great improvement on the video classification task. Subsequently, a variety of non-local network extensions have been introduced [45]. Fu et al. [63] present a dual attention segmentation framework, which applies non-local modules to spatial and spectral domain respectively. In [64], Liu et al. demonstrate that non-local similarity is an effective prior in image restoration.
However, the computational memory usage of the nonlocal neural module [49] is extremely high. Since each pixel's response is calculated on the whole image, the cost of computing memory is prohibitive when the input data has a large size. To overcome this drawback, the pooling strategy is widely used to reduce the input image or feature map size. However, this operation would lose fine image details. Therefore, in this study, our motivation is to design a deep FCN classification framework that efficiently integrates nonlocal information with a lower computation cost. Specifically, an FCN is first built as the backbone for local spectral-spatial feature learning. Then an efficient non-local module [51] is introduced to explore spatial correlation in the whole image. As a result, the entire framework is capable of capturing local and non-local information and can be trained end-to-end for HSI classification.

III. THE PROPOSED METHOD
The proposed network architecture is illustrated in Fig. 1. Let an HSI be X ∈ R B×H×W , and the corresponding output be Y ∈ R C×H×W indicating the class probability of each pixel, where H, W , B, and C represent the height, width, number of spectral bands, and number of land-cover classes, respectively. As shown in Fig. 1, the original HSI is used as input to the network. Two main parts are in the proposed network, i.e., an efficient non-local module for long-range contextual information learning and an FCN as the backbone network. The details of each part are described in the following subsections.

A. Original Non-local Module
The non-local network in [49] integrates the non-local mean operation in the deep neural networks. Let x i be the input signal at position i. Then a general non-local operation in a deep neural network can be defined as: where y i is the i-th output, and x j is the j-th signal used to compute the response of x i , the pairwise function f (·) calculates the relationship of x i and x j , the unary function g(·) calculates the representation of input signal at position j, and Z is a normalization factor. In a deep neural network, g(x j ) is considered as a weight matrix, which can be implemented by a 1 × 1 convolutional kernel. For the pairwise function f (x i , x j ), a dot-product similarity is used, which is defined as where both θ(x i ) and φ(x j ) can be implemented with 1 × 1 convolutional kernels. Then a non-local neural unit is created. Fig. 2(a) shows the basic architecture of a non-local module.

B. Efficient Non-local Module
According to Eq. 2, each pixel's response is calculated from all other pixels of HSI. For an image with a size of H × W , as denoted in Fig. 2(a), the attention feature acquired by Eq. 2 has a size of HW × HW . Obviously, this operation would consume much computational memory resources. Therefore, in order to reduce memory usage, an efficient non-local module is adopted as the learning unit to integrate long-range contextual information of HSI. As shown in Fig. 2(b), let E ∈ R N ×H×W be the output feature map after two convolutional operation, where N is the number of convolutional kernels. At first, the efficient non-local module applies 1×1 convolutional filter on E to generate an individual feature map, which can be formulated as where W l q denotes the lth convolutional kernel, * is the convolutional operation, b l q is the bias, and σ represents the activation function (e.g., sigmoid). L is the band number of output feature and is smaller than N . Here we denote the output feature as Q ∈ R L×H×W . A similar 1×1 convolution is applied and we can obtain another feature map K ∈ R L×H×W which has the same shape as Q.
To reduce the memory cost, the dependencies of long-range pixels are aggregated in a criss-cross manner. Let Q i ∈ R L be a feature vector at the spatial position of i from Q. Meanwhile, we can extract a feature vector set Ω i from the same row or column i in K, where Ω i ∈ R L×(H+W −1) . H + W − 1 is the number of feature vectors that are in the same row or column of i. Then we can calculate the first non-local correlation of pixel i from its criss-cross pass by the affinity operation: where d i ∈ R H+W −1 . Obviously, d i records the feature relations between Q i and Ω i . We apply the same operation on each pixel of Q, and then a feature map D can be generated, where D ∈ R (H+W −1)×H×W . A softmax layer is used along the spectral dimension of D to obtain an attention map A ∈ R (H+W −1)×H×W . Meanwhile, another 1 × 1 covolutional filter is operated on feature E to generate V ∈ R N ×H×W . Similarly, a feature vector A i ∈ R H+W −1 can be extracted from A at spatial position i. Correspondingly, the feature vector set Φ i ∈ R N ×(H+W −1) is extracted from the same row or column at position i in V.
Then non-local information related to pixel i can be described as: where E i ∈ R N . The same affinity operation is applied on each position of A and thus a new feature map E ∈ R N ×H×W can be obtained. To enhance the local feature E, the contextual information is added to E. In the efficient nonlocal module, the output E is in the same shape (N ×H ×W ) with the input feature E. Therefore, this learning unit can be embedded in any position of a deep neural network for nonlocal information extraction. The architecture of the efficient non-local module is illustrated in Fig. 2(b).

C. Message Passing via Recurrent Operation
Although the non-local information can be aggregated via the criss-cross path, the relations between pixels are still sparse because the contextual information is mainly captured from horizontal and vertical directions. To obtain more contextual information, the recurrent operation is introduced based on the efficient non-local module. First, the feature E extracted from FCN is used as input of the efficient non-local module and the feature map E can be obtained as output. Then we take E as the new input of the efficient non-local module and a new output E can be produced. Fig. 3 shows the message passing procedure between any two pixels that are not in the same row or column. Let A be the attention map obtained after the recurrent operation. Before the recurrent operation, the feature map is obtained from position (i, j) to position (m, j) and (i, n). Thus, we define the mapping functions as f (A i,j , m, j) and f (A i,j , i, n). As pixel (m, j) and (i, n) are in the same row and column with the target position (m, n), similar mapping functions can be formulated as f (A m,j , m, n) and f (A i,n , m, n). Therefore, we can represent the message passing procedure between pixels (i, j) and (m, n) as Generally, in the recurrent efficient non-local module, the relation between two pixels can be captured by a criss-cross based message passing procedure. Fig. 4 illustrates the pixel correlation map after applying the recurrent operation, where a pixel is selected to show the message passing procedure when applying the recurrent operation. From Fig. 4, we can observe more contextual information is captured around the selected pixel. The recurrent operation does not need more learning parameters, yet can provide more contextual information with one recurrent operation. Therefore, a better classification performance can be achieved.

D. Computational Complexity and Memory Usage
As discussed in Section III-A, the correlation between two pixels is calculated by a dot-production in the original non-local module. Since the response of a pixel is calculated from a whole image, the dot-product operation requires HW × HW × L times of multiplication. In contrast, the affinity operation in the efficient non-local module needs (H +W −1)×HW ×L times of multiplication. For simplicity, we assume that H = W = L = n. Then the computational complexity of the original non-local module [49] is O(n 5 ) and is reduced to O(n 4 ) by using the efficient module.
As displayed in Fig. 2, the attention map of the original non-local module has a size of (H × W ) × (H × W ), while the one from efficient non-local module is of size (H + W − 1)×H ×W . For an image with 145×145 pixels, the attention map of the original non-local module would consume 1760MB of memory while the memory usage of the efficient non-local module is only about 24MB. Therefore, by using the efficient non-local module, the memory footprint can be significantly reduced.

E. Classification with Fully Convolutional Network
Different from previous CNN based classifiers using local patches as training data, a whole HSI is fed into the FCN for feature extraction. In the convolutional layer, a regular convolutional kernel is used to extract spectral-spatial features. The convolutional layer can be written as: where E i is the i-th channel of the feature map of convolutional layer, W i is the convolutional kernel, X j is the jth channel of the input HSI or previous convolutional layer, b i is the bias term, and σ(·) is an activation function (e.g., sigmoid function in this study).
To further enhance the robustness of the network, we fuse the features from the low-level convolutional layer and efficient non-local module, which can be expressed as where E cat represents the concatenated feature, which is further passed to the subsequent convolutional layers. By using the concatenation operation, features from low-level convolutions can be reused, leading to enhanced feature representation.
Although an FCN can be trained using the whole HSI, there are unlabeled pixels in an HSI. To ensure only the labeled training samples are considered in the loss function, a training mask is used. Let Y train ∈ R H×W be the training map of an HSI, where Y train (i, j) ∈ {0, 1, ..., C} with 0 representing an unlabeled pixel. A training mask can be defined as H(i, j) is used to indicate whether pixel (i, j) should be included in the loss function. Then, the final cross-entropy loss function can be formulated as where t c ij denotes the cth value of a label vector at position (i, j), and P c ij represents the corresponding probability.

IV. EXPERIMENTS A. Datasets
To evaluate the classification performance of the proposed method, three widely used HSI datasets are tested in our experiments, including Indian Pines (IP), Pavia University (PU) and the Kennedy Space Center (KSC). The details of the three datasets are described as follows.
(1) Indiana Pines: Indian Pines (IP) is captured by the AVIRIS sensor over Northwestern Indiana. It was generated with 220 spectral bands (400-2500nm) and 20m per pixel resolution. The whole dataset is a 145×145× 200 data cube and the spectral bands are reduced to 200 after the water absorption and noisy bands are removed. The ground truth includes 10366 labeled pixels for 16 land cover classes. In our experiment, 10%, 1% and 89% of samples from each class are randomly selected as training, validation and testing sets, respectively. The detailed sample numbers are listed in Table  I. (2) Pavia University: The second dataset is Pavia University (PU), which is an urban image captured over Northern Italy by Reflective Optics System Imaging Spectrometer (ROSIS) in 2002. The whole image has 9 classes with 610×340 pixels. The image contains 115 spectral bands ranging from 430 to 860nm. The 12 noisy bands are removed. For this dataset, 1%, 1% and 98% of samples from each class are randomly selected for training, validation and testing, respectively, as listed in Table II.   (3) Kennedy Space Center: The third dataset is Kennedy Space Center (KSC), which is collected by the AVIRIS sensor over Kennedy Space Center, Florida, in 1996. After removing water absorption and other noisy bands, the KSC dataset contains 176 spectral bands. The spatial resolution of KSC is 18m with 512 × 614 pixels. It includes 13 land cover classes are included in KSC dataset. For each class, 5%, 1% and 94% of samples are randomly selected for training, validation and testing, respectively. The detailed numbers are listed in Table  III.

B. Experimental Setup
In the proposed framework, a five-layer FCN is used as the backbone and the efficient non-local module is embedded as a learning unit. To further boost the classification performance, two parallel efficient non-local modules are used in FCN as shown in Fig. 1. The convolutional kernel number is set to 150 and the kernel size is 5 × 5. In the efficient non-local module, the number of convolutional kernels is also set to 150. The Adam optimizer is used to train the network. The learning rate is set to 0.0005 and the weight decay is 0.0002. The batch size is 1. The number of learning iterations is 800.
The network is implemented under PyTorch environment with an Intel i9-9920X CPU and an NVIDIA TITAN-V GPU. Our code is available at https://github.com/ShaneShen/ENL-FCN.

C. Classification Performance
In the experiments, several state-of-the-art deep learning based classifiers are used in comparison with the proposed ENL-FCN, including 2D-CNN [38], 3D-CNN [39], spectralspatial residual network (SSRN) [65], deep pyramidal residual network (PyraCNN) [59], HybridSN [66], and FCN-CRF [44]. These algorithms exploit spectral-spatial information for HSI classification. Particularly, FCN-CRF uses the CRF model to incorporate long-range contextual information. The parameters of these deep learning methods are set according to their reference papers. We also employ the original non-local module [49] in our FCN backbone as a baseline, denoted as Original non-local. In other words, we replace the efficient non-local module with the original non-local unit in the FCN. Due to the limitation of GPU memory, only one original non-local unit can be embedded in the FCN architecture.
In the experiments, besides per-class accuracy, the overall accuracy (OA), average accuracy (AA) and kappa coefficient [67] are calculated to evaluate the classification performance comprehensively. OA is calculated by the ratio between the correctly classified test pixels and the total number of test pixels. AA is the average of the classification accuracy of each class. The kappa coefficient is computed by weighting the measurement accuracy [67]. It incorporates both of the diagonal and off-diagonal entries of the confusion matrix. The experiment is repeated ten times for all approaches to yield the average performance for a fair comparison. The classification maps and corresponding accuracies of different methods over three datasets are reported in Figs. 5-7 and Tables IV-VI. For the IP dataset, our method provides the best classification performance in terms of OA and kappa index. For the classifiers that do not consider long-range contextual information (i.e., 2D-CNN and 3D-CNN), more mis-classification can be found at the edges of different land-cover regions, as shown in Fig. 5. Table IV reveals that 2D-CNN shows a significant decline (up to 3%) on OA compared with our method, indicating that a simple CNN framework fails to characterize the features of different regions. Due to the data imbalance, the OA of FCN based frameworks, including FCN-CRF, original non-local and our method, show an accuracy decline on Class 9. Overall, the proposed ENL-FCN generates the most accurate classification map.
From Table V, we can observe that our framework also achieves a better classification performance than other CNN based classifiers on PU dataset. The PU dataset contains more isolated points and small regions, which would increase the difficulty in distinguishing land cover classes. For example, 3D-CNN fails to provide a better performance on PU, whose OA declines to 88.69%. Compared with other classifiers, our method offers obvious better classification accuracy in Table  V, and the OA of our method is up to 99%. Furthermore, according to the classification results of Fig. 6, less misclassification can be found in the classification map of our method compared with other deep learning approaches.
Table VI reports the experimental results of different methods on KSC dataset. From this table, the OA of our method is much higher than other CNN based classifiers (up to 8%). In Fig. 7, we zoom in two critical regions of KSC for better visualization, which are marked with red and yellow rectangles. As shown in the zoomed regions, the class Oak/broadleaf is difficult to distinguish. In Figs. 7(c) and (d), the Oak/broadleaf is almost mis-classified. Compared with other classifiers, our method achieves much better accuracy on class Oak/broadleaf. Fig. 8 reports the classification performance under the case of small training sample size. In this experiment, the number of training samples varies from 5 to 30 per class over three datasets. It is evident that there is a clear improvement on the classification performance as the number of training samples increases. The 2D-CNN and 3D-CNN usually provide the lowest OA over three datasets. Some more complicated networks, such as SSRN, PyraCNN and FCN-CRF, achieve better classification performance than 2D-CNN and 3D-CNN. Since FCN-CRF separates the network into two phases, the OA is lower than SSRN and PyraCNN. In Fig. 8(b), the OA of our method is slightly lower than SSRN and PyraCNN when the number of training samples is 5. Generally, the proposed method provides higher OA compared with other deep learning networks.
From the above tables, we can also observe that the proposed network achieves the classification accuracy similar to the original non-local network. This is reasonable because both approaches are able to extract the long-range contextual information from HSI. Owing to the efficient non-local module being applied twice in the proposed framework, we can find that the proposed ENL-FCN provides a slightly better overall accuracy than the original non-local approach.

D. Analysis of Computational Cost and Memory Usage
As discussed in Section III-D, the efficient non-local module consumes much less computational resources than the original one [49]. It is worth mentioning that we have to divide the PU and KSC datasets into smaller data cubes because the memory usage of the original non-local module exceeds our experimental limitation. The PU dataset is equally divided into six regions. Although our proposed method does not have to divide a dataset for network training, we still keep the same setup with the original non-local module. Table. VII compares the computational cost and GPU memory usage (MB) of the proposed framework and the original non-local network over three HSI datasets. The computational cost is calculated by floating point operations (FLOPs). From the results, we can observe that the original non-local network uses over three times GPU memory and one hundred times FLOPs than our proposed network on KSC dataset, indicating that the efficient non-local module can significantly save the computational resources.

E. Ablation Study for Efficient Non-local Module
In this section, to further evaluate the effectiveness of the efficient non-local module, several ablation experiments are conducted. (1) In the proposed network, the efficient nonlocal modules are replaced with the regular 1×1 convolutional kernels, while keeping the number of learning parameters the same. (2) The influence of applying multiple efficient nonlocal modules is analyzed. (3) The structure of employing multiple efficient non-local modules (in parallel or in series) is also discussed.
Compared with the performance of baseline (only FCN), the network with efficient non-local modules provides a significant improvement in OA, as shown in Table VIII. We can also observe that the OA of efficient non-local modules outperforms that of regular convolutions (1 × 1 conv) when the number of learning parameters is the same, which demonstrates the effectiveness of the efficient non-local module.
The impact of the number of efficient non-local modules on the classification performance is evaluated. For comparison, we embed different numbers of efficient non-local modules (i.e., 1∼3 modules) in parallel in the network. Based on the results in Table VIII, an improvement can be observed when more efficient non-local modules are added in the network. To balance between the computational efficiency and classification accuracy, we use two efficient non-local modules in the proposed framework.
We also investigate the structure of embedding the efficient non-local modules in the network, including two modules in parallel and two modules in series. From Table VIII, we can observe a similar performance when the efficient nonlocal modules are placed in parallel or in series. The parallel architecture slightly outperforms the series one.
To evaluate the effectiveness of feature concatenation in our framework, Table IX reports the classification performance with and without feature concatenation in the proposed framework. As illustrated in Table IX, the feature concatenation is beneficial for further improving the classification performance of our framework.
The embedded position for the efficient non-local module is also discussed. As shown in Fig. 1, it is placed after the second convolutional layer (Conv.2). In this experiment, it is placed after the first (Conv.1), third (Conv.3) or fourth (Conv.4) convolutional layer, and then the classification accuracy of each position is recorded. As shown in Fig. 10, the network performs better when the efficient non-local module is embedded after the second and third convolutional layers. The OA is the highest when the module is placed after the second convolutional layer (Conv.2). When the efficient nonlocal module is embedded after the fourth convolutional layer, a sharp accuracy decline can be observed in Fig. 10. For the PU dataset, almost 5% accuracy is dropped when the efficient non-local module is placed after Conv.4. This could indicate that a high-level feature representation may not be helpful for capturing the long-range contextual information. Therefore,    based on this ablation study, we embed the efficient non-local module after the second convolutional layer to achieve the optimal performance.

F. Visualization of Efficient Non-local Module
As discussed in Section III, non-local information is captured and saved in attention maps A and A . The response of a pixel with others is established by Eq. 6 in a message passing procedure. Therefore, for each pixel in an HSI, there is a corresponding H × W pixel correlation map that records the responses from the whole image. In Fig. 9, we select three pixels from IP dataset and visualize the corresponding pixel correlation maps according to Eq. 6. As shown in Fig. 9, the response of each pixel is significant in its criss-cross way. It can be seen that the efficient non-local module can capture semantic information from long-range regions in an HSI. For example, considering the pixel at position (5, 5) (the red dot at the top-left corner in Fig. 9(a)), its correlation map ( Fig. 9(b)) reveals that the long-range region, which is highlighted in the red circle, yields the responses similar to the neighboring area of pixel (5,5). This indicates that the contextual information is captured not only from a pixel's surrounding area but also from other regions (highlighted in the red circle) belonging to the same class.

G. Sensitivity Analysis of Parameters
In this section, our proposed framework with different parameters are studied over three datasets. Three important parameters, including the convolutional kernel size, the number of convolutional kernels (N ), and the number of convolutional kernels in the efficient non-local module (L), are analyzed to find the optimal values.   11 reports the classification accuracy when the convolutional kernel size varies from 3 to 7. As shown in Fig. 11, the OA climes with the increasing of kernels size. The OA improves obviously over IP dataset, from 96.7% to 98.9%. However, when the kernel size reaches to 7, the improvement is very small. Therefore, the convolutional kernel size of our network is set to 5.
We jointly investigate the effect of the number of convolutional kernels in FCN and efficient non-local module (i.e., N and L). Specifically, N is set from 50 to 175, while L varies from 25 to 150. The kernel number in efficient non-local module is smaller than that in FCN for dimension reduction. Fig. 12 shows a climbing trend when the kernel numbers N and L increase. It is notable that the OA improves more clearly with the parameter N increasing. It is reasonable because there are five convolutional layers and more learning parameters are added in the network with a larger N . However, on the other hand, a larger kernel number will also increase the network complexity, leading to more training time. Therefore, to ensure a good classification performance and keep efficiency simultaneously, we set N and L to 150 and 150, respectively.

V. CONCLUSION
In this study, we propose a deep neural network (ENL-FCN) to learn non-local information for spectral-spatial HSI classification. By introducing an efficient non-local module into the fully convolutional network, both local and nonlocal information is extracted. Different from the original nonlocal module, the long-range contextual feature is aggregated in a criss-cross path to facilitate computation and memory efficiency. By using a recurrent operation, each pixel's response can be captured from all other pixels. The efficient non-local module uses fewer learning parameters and less computational memory. Extensive experiments and ablation study over three HSI datasets demonstrate that the proposed method provides promising classification performance with lower computational cost compared with several state-of-theart deep learning methods.