Hyperspectral Image Classification Using Multi-Scale Lightweight Transformer
Abstract
:1. Introduction
2. Materials and Methods
2.1. Spectral–Spatial Feature Extraction Module
2.2. Frequency-Domain Fused Classification
2.3. Network Parameters Learning
Algorithm 1 MSA-LWFormer Overall Network |
|
3. Results
3.1. Dataset Description
3.2. Experimental Configuration
3.3. Comparative Experiments
3.3.1. Classification Results of IP
3.3.2. Classification Results of UP
3.3.3. Classification Results of SA
3.3.4. Experimental Results of Several Methods Using Varied Ratios of Training Samples
4. Discussion
4.1. Ablation Experiment
4.1.1. Ablation Experiment Results of MSA-LWFormer on the UP Dataset
4.1.2. Ablation Experiment Results for Transformer on the SA Dataset
4.2. Time Complexity and Parameter Count Analysis
4.3. Optimal Hyperparameters for MSA-LWFormer
4.3.1. Influence of Different Learning Rates
4.3.2. Influence of Different Patch Sizes
4.3.3. Influence of the Number of Principal Components
4.3.4. Influence of 3D Convolution Kernel Number
4.3.5. Influence of Multi-Scale 2D Convolution Kernel Size
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- He, N.; Paoletti, M.E.; Haut, J.M.; Fang, L.; Li, S.; Plaza, A.; Plaza, J. Feature extraction with multiscale covariance maps for hyperspectral image classification. IEEE Trans. Geosci. Remote Sens. 2018, 57, 755–769. [Google Scholar] [CrossRef]
- Paoletti, M.; Haut, J.; Plaza, J.; Plaza, A. Deep learning classifiers for hyperspectral imaging: A review. ISPRS J. Photogramm. Remote Sens. 2019, 158, 279–317. [Google Scholar] [CrossRef]
- Farmonov, N.; Amankulova, K.; Szatmári, J.; Sharifi, A.; Abbasi-Moghadam, D.; Nejad, S.M.M.; Mucsi, L. Crop type classification by DESIS hyperspectral imagery and machine learning algorithms. IEEE J. Sel. Top. Appl. Earth Obs. Remote Sens. 2023, 16, 1576–1588. [Google Scholar] [CrossRef]
- Yuan, Q.; Shen, H.; Li, T.; Li, Z.; Li, S.; Jiang, Y.; Xu, H.; Tan, W.; Yang, Q.; Wang, J.; et al. Deep learning in environmental remote sensing: Achievements and challenges. Remote Sens. Environ. 2020, 241, 111716. [Google Scholar] [CrossRef]
- Lu, B.; Dao, P.D.; Liu, J.; He, Y.; Shang, J. Recent advances of hyperspectral imaging technology and applications in agriculture. Remote Sens. 2020, 12, 2659. [Google Scholar] [CrossRef]
- Tan, Y.; Lu, L.; Bruzzone, L.; Guan, R.; Chang, Z.; Yang, C. Hyperspectral band selection for lithologic discrimination and geological mapping. IEEE J. Sel. Top. Appl. Earth Obs. Remote Sens. 2020, 13, 471–486. [Google Scholar] [CrossRef]
- Zhang, Y.; Cao, G.; Li, X.; Wang, B.; Fu, P. Active semi-supervised random forest for hyperspectral image classification. Remote Sens. 2019, 11, 2974. [Google Scholar] [CrossRef]
- Liu, B.; Yu, X.; Zhang, P.; Yu, A.; Fu, Q.; Wei, X. Supervised deep feature extraction for hyperspectral image classification. IEEE Trans. Geosci. Remote Sens. 2017, 56, 1909–1921. [Google Scholar] [CrossRef]
- Wang, Y.; Duan, H. Classification of hyperspectral images by SVM using a composite kernel by employing spectral, spatial and hierarchical structure information. Remote Sens. 2018, 10, 441. [Google Scholar] [CrossRef]
- Cariou, C.; Le Moan, S.; Chehdi, K. Improving K-nearest neighbor approaches for density-based pixel clustering in hyperspectral remote sensing images. Remote Sens. 2020, 12, 3745. [Google Scholar] [CrossRef]
- Xu, L.; Li, J. Bayesian classification of hyperspectral imagery based on probabilistic sparse representation and Markov random field. IEEE Geosci. Remote Sens. Lett. 2013, 11, 823–827. [Google Scholar] [CrossRef]
- Machidon, A.L.; Del Frate, F.; Picchiani, M.; Machidon, O.M.; Ogrutan, P.L. Geometrical approximated principal component analysis for hyperspectral image analysis. Remote Sens. 2020, 12, 1698. [Google Scholar] [CrossRef]
- Li, W.; Zhang, L.; Zhang, L.; Du, B. GPU parallel implementation of isometric mapping for hyperspectral classification. IEEE Geosci. Remote Sens. Lett. 2017, 14, 1532–1536. [Google Scholar] [CrossRef]
- Fang, Y.; Li, H.; Ma, Y.; Liang, K.; Hu, Y.; Zhang, S.; Wang, H. Dimensionality reduction of hyperspectral images based on robust spatial information using locally linear embedding. IEEE Geosci. Remote Sens. Lett. 2014, 11, 1712–1716. [Google Scholar] [CrossRef]
- Yang, Y.; Wei, X.; Xu, R.; Wang, W.; Peng, L.; Wang, Y. Jointly beam stealing attackers detection and localization without training: An image processing viewpoint. Front. Comput. Sci. 2023, 17, 173704. [Google Scholar] [CrossRef]
- Guo, K.; Wu, Z.; Wang, W.; Ren, S.; Zhou, X.; Gadekallu, T.R.; Luo, E.; Liu, C. GRTR: Gradient Rebalanced Traffic Sign Recognition for Autonomous Vehicles. IEEE Trans. Autom. Sci. Eng. 2023. [Google Scholar] [CrossRef]
- Shi, Q.; Tang, X.; Yang, T.; Liu, R.; Zhang, L. Hyperspectral image denoising using a 3-D attention denoising network. IEEE Trans. Geosci. Remote. Sens. 2021, 59, 10348–10363. [Google Scholar] [CrossRef]
- Wang, Q.; Wu, Z.; Jin, J.; Wang, T.; Shen, Y. Low rank constraint and spatial spectral total variation for hyperspectral image mixed denoising. Signal Process. 2018, 142, 11–26. [Google Scholar] [CrossRef]
- Zhang, G.; Zhao, S.; Li, W.; Du, Q.; Ran, Q.; Tao, R. HTD-Net: A deep convolutional neural network for target detection in hyperspectral imagery. Remote Sens. 2020, 12, 1489. [Google Scholar] [CrossRef]
- Zhang, Y.; Du, B.; Zhang, Y.; Zhang, L. Spatially adaptive sparse representation for target detection in hyperspectral images. IEEE Geosci. Remote Sens. Lett. 2017, 14, 1923–1927. [Google Scholar] [CrossRef]
- Song, A.; Choi, J.; Han, Y.; Kim, Y. Change detection in hyperspectral images using recurrent 3D fully convolutional networks. Remote Sens. 2018, 10, 1827. [Google Scholar] [CrossRef]
- Gong, M.; Jiang, F.; Qin, A.K.; Liu, T.; Zhan, T.; Lu, D.; Zheng, H.; Zhang, M. A spectral and spatial attention network for change detection in hyperspectral images. IEEE Trans. Geosci. Remote Sens. 2021, 60, 1–14. [Google Scholar] [CrossRef]
- Sun, L.; Fang, Y.; Chen, Y.; Huang, W.; Wu, Z.; Jeon, B. Multi-structure KELM with attention fusion strategy for hyperspectral image classification. IEEE Trans. Geosci. Remote Sens. 2022, 60, 1–17. [Google Scholar] [CrossRef]
- Gao, L.; Yao, D.; Li, Q.; Zhuang, L.; Zhang, B.; Bioucas-Dias, J.M. A new low-rank representation based hyperspectral image denoising method for mineral mapping. Remote Sens. 2017, 9, 1145. [Google Scholar] [CrossRef]
- Yang, J.; Zhao, Y.Q.; Chan, J.C.W.; Xiao, L. A multi-scale wavelet 3D-CNN for hyperspectral image super-resolution. Remote Sens. 2019, 11, 1557. [Google Scholar] [CrossRef]
- Wu, H.; Prasad, S. Convolutional recurrent neural networks for hyperspectral data classification. Remote Sens. 2017, 9, 298. [Google Scholar] [CrossRef]
- Li, J.; Xi, B.; Li, Y.; Du, Q.; Wang, K. Hyperspectral classification based on texture feature enhancement and deep belief networks. Remote Sens. 2018, 10, 396. [Google Scholar] [CrossRef]
- Liang, P.; Shi, W.; Zhang, X. Remote sensing image classification based on stacked denoising autoencoder. Remote Sens. 2017, 10, 16. [Google Scholar] [CrossRef]
- Yu, S.; Jia, S.; Xu, C. Convolutional neural networks for hyperspectral image classification. Neurocomputing 2017, 219, 88–98. [Google Scholar] [CrossRef]
- Gao, H.; Lin, S.; Yang, Y.; Li, C.; Yang, M. Convolution neural network based on two-dimensional spectrum for hyperspectral image classification. J. Sens. 2018, 2018, 8602103. [Google Scholar] [CrossRef]
- Xu, H.; Yao, W.; Cheng, L.; Li, B. Multiple spectral resolution 3D convolutional neural network for hyperspectral image classification. Remote Sens. 2021, 13, 1248. [Google Scholar] [CrossRef]
- Roy, S.K.; Krishna, G.; Dubey, S.R.; Chaudhuri, B.B. HybridSN: Exploring 3-D–2-D CNN feature hierarchy for hyperspectral image classification. IEEE Geosci. Remote Sens. Lett. 2019, 17, 277–281. [Google Scholar] [CrossRef]
- He, M.; Li, B.; Chen, H. Multi-scale 3D deep convolutional neural network for hyperspectral image classification. In Proceedings of the 2017 IEEE International Conference on Image Processing (ICIP), IEEE, Beijing, China, 17–20 September 2017; pp. 3904–3908. [Google Scholar] [CrossRef]
- Hu, Y.; Tian, S.; Ge, J. Hybrid Convolutional Network Combining Multiscale 3D Depthwise Separable Convolution and CBAM Residual Dilated Convolution for Hyperspectral Image Classification. Remote Sens. 2023, 15, 4796. [Google Scholar] [CrossRef]
- Mou, L.; Zhu, X.X. Learning to pay attention on spectral domain: A spectral attention module-based convolutional network for hyperspectral image classification. IEEE Trans. Geosci. Remote Sens. 2019, 58, 110–122. [Google Scholar] [CrossRef]
- Cui, B.; Wen, J.; Song, X.; He, J. MADANet: A Lightweight Hyperspectral Image Classification Network with Multiscale Feature Aggregation and a Dual Attention Mechanism. Remote Sens. 2023, 15, 5222. [Google Scholar] [CrossRef]
- Hong, D.; Han, Z.; Yao, J.; Gao, L.; Zhang, B.; Plaza, A.; Chanussot, J. SpectralFormer: Rethinking hyperspectral image classification with transformers. IEEE Trans. Geosci. Remote Sens. 2021, 60, 1–15. [Google Scholar] [CrossRef]
- Sun, L.; Zhao, G.; Zheng, Y.; Wu, Z. Spectral–spatial feature tokenization transformer for hyperspectral image classification. IEEE Trans. Geosci. Remote Sens. 2022, 60, 1–14. [Google Scholar] [CrossRef]
- Kong, L.; Dong, J.; Ge, J.; Li, M.; Pan, J. Efficient Frequency Domain-based Transformers for High-Quality Image Deblurring. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Vancouver, BC, Canada, 17–24 June 2023; pp. 5886–5895. [Google Scholar] [CrossRef]
LayerName | Operations | Paramaters |
---|---|---|
Norm | Norm | dim = 64 |
Frequency Self-Attention | Linear | dim = 64, head = 8 |
FFT | s = 64, dim = (−2, −1), norm = backward | |
IFFT | s = 64, dim = (−2, −1), norm = backward | |
softmax | dim = −1 | |
Linear | dim = 64 | |
Norm | Norm | dim = 64 |
GCFN | 2dConv | kernel size = 1, stride = 1, padding = 1 |
2dConv | kernel size = 3, stride = 1, padding = 1 | |
2dConv | kernel size = 1, stride = 1, padding = 1 |
No. | Land Cover Categories | Total | Training | Test |
---|---|---|---|---|
1 | Alfalfa | 46 | 5 | 41 |
2 | Corn-notill | 1428 | 143 | 1285 |
3 | Corn-mintill | 830 | 83 | 747 |
4 | Corn | 237 | 24 | 213 |
5 | Grass-pasture | 483 | 48 | 435 |
6 | Grass-trees | 730 | 73 | 657 |
7 | Grass-pasture-mowed | 28 | 3 | 25 |
8 | Hay-windrowed | 478 | 48 | 430 |
9 | Oats | 20 | 2 | 18 |
10 | Soybean-notill | 972 | 97 | 875 |
11 | Soybean-mintill | 2455 | 245 | 2210 |
12 | Soybean-clean | 593 | 59 | 534 |
13 | Wheat | 205 | 20 | 185 |
14 | Woods | 1265 | 126 | 1139 |
15 | Buildings-grass-trees-drives | 386 | 39 | 347 |
16 | Stone-steel-towers | 93 | 9 | 84 |
No. | Land Cover Classes | Total | Training | Test |
---|---|---|---|---|
1 | Asphalt | 6631 | 332 | 6299 |
2 | Meadows | 18,649 | 932 | 17,717 |
3 | Gravel | 2099 | 105 | 1994 |
4 | Trees | 3064 | 153 | 2911 |
5 | Painted metal sheets | 1345 | 67 | 1278 |
6 | Bare soil | 5029 | 251 | 4778 |
7 | Bitumen | 1330 | 67 | 1263 |
8 | Self-blocking bricks | 3682 | 184 | 3498 |
9 | Shadows | 947 | 47 | 900 |
No. | Land Cover Classes | Total | Training | Test |
---|---|---|---|---|
1 | Broccoli-green-weeds_1 | 2009 | 223 | 1786 |
2 | Broccoli-green-weeds_2 | 3726 | 366 | 3360 |
3 | Fallow | 1976 | 187 | 1789 |
4 | Fallow_rough_plow | 1394 | 145 | 1249 |
5 | Fallow_smooth | 2678 | 272 | 2406 |
6 | Stubble | 3959 | 401 | 3558 |
7 | Celery | 3579 | 362 | 3217 |
8 | Grapes_untrained | 11,271 | 1138 | 10,133 |
9 | Soil_vinyard_develop | 6203 | 618 | 5585 |
10 | Corn_senesced_green_weeds | 3278 | 336 | 2942 |
11 | Lettuce_romaine_4wk | 1068 | 105 | 963 |
12 | Lettuce_romaine_5wk | 1927 | 201 | 1726 |
13 | Lettuce_romaine_6wk | 916 | 103 | 813 |
14 | Lettuce_romaine_7wk | 1070 | 104 | 966 |
15 | Vinyard_untrained | 7268 | 741 | 6527 |
16 | Vinyard_vertical_trellis | 1807 | 179 | 1628 |
NO. | SVM | 2D-CNN | 3D-CNN | HybridSN | SSFTT | MDRDNet | MSA- LWFormer |
---|---|---|---|---|---|---|---|
1 | 83.16 | 48.78 | 87.80 | 75.60 | 95.34 | 100 | 100 |
2 | 66.73 | 93.30 | 93.61 | 93.30 | 95.33 | 96.49 | 96.90 |
3 | 76.25 | 86.61 | 97.59 | 99.46 | 99.22 | 100 | 100 |
4 | 80.64 | 98.59 | 89.67 | 86.38 | 95.45 | 99.54 | 100 |
5 | 85.89 | 97.7 | 99.31 | 100 | 97.32 | 98.87 | 97.65 |
6 | 92.41 | 99.69 | 99.08 | 99.23 | 98.23 | 99.70 | 100 |
7 | 52.32 | 96 | 100 | 80 | 100 | 100 | 100 |
8 | 59.24 | 100 | 100 | 100 | 100 | 100 | 99.29 |
9 | 62.24 | 100 | 100 | 55.55 | 47.36 | 72.22 | 83.33 |
10 | 82.73 | 97.94 | 95.65 | 98.17 | 96.46 | 98.43 | 98.25 |
11 | 84.47 | 95.65 | 97.60 | 98.32 | 99.69 | 99.73 | 99.77 |
12 | 66.11 | 90.44 | 91.38 | 89.32 | 90.39 | 94.32 | 95.98 |
13 | 89.68 | 99.45 | 98.91 | 100 | 97.38 | 100 | 100 |
14 | 84.87 | 97.71 | 99.73 | 98.94 | 100 | 100 | 99.82 |
15 | 82.59 | 100 | 92.79 | 99.71 | 96.37 | 99.71 | 100 |
16 | 86.57 | 98.80 | 100 | 98.80 | 81.39 | 97.64 | 95.12 |
OA (%) | 84.12 | 94.86 | 96.25 | 97.06 | 97.48 | 98.80 | 98.87 |
AA (%) | 82.76 | 95.49 | 96.71 | 92.05 | 96.22 | 98.63 | 98.68 |
Kappa | 0.8234 | 0.9379 | 0.9644 | 0.9664 | 0.9712 | 0.9729 | 0.9871 |
NO. | SVM | 2D-CNN | 3D-CNN | HybridSN | SSFTT | MDRDNet | MSA- LWFormer |
---|---|---|---|---|---|---|---|
1 | 92.27 | 95.44 | 95.75 | 98.88 | 98.38 | 99.38 | 100 |
2 | 99.82 | 99.11 | 99.93 | 99.87 | 99.85 | 100 | 99.97 |
3 | 64.77 | 72.56 | 79.69 | 91.94 | 96.30 | 99.10 | 99.31 |
4 | 89.02 | 92.41 | 92.77 | 97.00 | 94.43 | 99.21 | 98.94 |
5 | 100 | 100 | 100 | 100 | 99.62 | 99.38 | 100 |
6 | 81.46 | 86.80 | 94.91 | 99.56 | 100 | 100 | 100 |
7 | 96.81 | 92.17 | 96.50 | 99.14 | 99.92 | 100 | 100 |
8 | 93.11 | 78.68 | 88.23 | 96.24 | 99.02 | 99.34 | 99.09 |
9 | 79.82 | 98.50 | 90.18 | 99.45 | 97.84 | 97.24 | 99.88 |
OA (%) | 92.89 | 93.35 | 95.86 | 98.74 | 98.96 | 99.66 | 99.79 |
AA (%) | 88.56 | 90.63 | 93.11 | 98.01 | 98.37 | 99.29 | 99.68 |
Kappa | 0.9046 | 0.9113 | 0.9448 | 0.9834 | 0.9862 | 0.9956 | 0.9973 |
NO. | SVM | 2D-CNN | 3D-CNN | HybridSN | SSFTT | MDRDNet | MSA- LWFormer |
---|---|---|---|---|---|---|---|
1 | 100 | 100 | 100 | 100 | 99.94 | 100 | 99.89 |
2 | 100 | 100 | 100 | 100 | 100 | 100 | 100 |
3 | 99.79 | 97.95 | 100 | 99.69 | 100 | 100 | 100 |
4 | 99.71 | 99.85 | 99.42 | 99.63 | 99.42 | 99.78 | 99.92 |
5 | 98.56 | 98.67 | 97.62 | 98.86 | 99.09 | 99.96 | 99.59 |
6 | 100 | 100 | 100 | 100 | 99.38 | 98.97 | 100 |
7 | 99.18 | 100 | 99.88 | 99.66 | 99.94 | 99.94 | 99.88 |
8 | 94.04 | 97.19 | 98.55 | 96.68 | 99.70 | 99.47 | 99.98 |
9 | 100 | 100 | 100 | 99.86 | 99.95 | 100 | 100 |
10 | 97.96 | 99.96 | 99.96 | 98.05 | 99.90 | 99.84 | 99.97 |
11 | 97.91 | 89.30 | 99.43 | 98.95 | 100 | 99.90 | 100 |
12 | 100 | 100 | 96.69 | 100 | 99.89 | 99.63 | 100 |
13 | 75.74 | 96.69 | 67.25 | 96.03 | 95.25 | 99.00 | 100 |
14 | 96.03 | 85.55 | 97.63 | 99.05 | 99.43 | 99.81 | 100 |
15 | 85.24 | 94.03 | 90.13 | 91.02 | 98.40 | 99.04 | 100 |
16 | 99.10 | 94.13 | 98.15 | 99.44 | 100 | 99.77 | 100 |
OA (%) | 95.95 | 97.72 | 97.44 | 97.74 | 99.50 | 99.62 | 99.96 |
AA (%) | 96.45 | 97.08 | 96.54 | 98.56 | 99.39 | 99.69 | 99.95 |
Kappa | 0.9549 | 0.9746 | 0.9714 | 0.9749 | 0.9945 | 0.9958 | 0.9995 |
Datasets | Case | Component | Indicator | |||||
---|---|---|---|---|---|---|---|---|
3D Conv | 2D Conv | MS-SA | FDATE | OA (%) | AA (%) | Kappa | ||
UP | case1 | ✗ | ✓ | ✓ | ✓ | 92.88 | 90.77 | 0.9121 |
case2 | ✓ | ✗ | ✓ | ✓ | 97.21 | 94.51 | 0.9538 | |
case3 | ✓ | ✓ | ✗ | ✓ | 94.21 | 92.72 | 0.9308 | |
case4 | ✓ | ✓ | ✓ | ✗ | 90.66 | 91.11 | 0.9021 | |
case5 | ✗ | ✗ | ✓ | ✓ | 88.68 | 89.72 | 0.8866 | |
case6 | ✓ | ✓ | ✓ | ✓ | 99.79 | 99.68 | 0.9973 |
Methods | Accuracy Indicator | Efficiency Indicator | ||||
---|---|---|---|---|---|---|
OA (%) | AA (%) | Kappa | Test Time (s) | Parameters (MB) | FLOPs (MB) | |
Softmax | 98.91 | 99.07 | 0.9887 | 9.89 | 0.342773 | 1892.97 |
MSA-Transformer | 99.72 | 99.63 | 0.9971 | 10.66 | 0.328125 | 1870.95 |
Light-Transformer | 99.96 | 99.95 | 0.9995 | 9.48 | 0.310546 | 1841.97 |
Methods | Test Time (s) | Parameters (MB) |
---|---|---|
HybridSN | 7.93 | 12.59 |
SSFTT | 5.99 | 0.93 |
MDRDNet | 7.12 | 1.92 |
MSA-LWFormer | 5.81 | 0.86 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Gu, Q.; Luan, H.; Huang, K.; Sun, Y. Hyperspectral Image Classification Using Multi-Scale Lightweight Transformer. Electronics 2024, 13, 949. https://doi.org/10.3390/electronics13050949
Gu Q, Luan H, Huang K, Sun Y. Hyperspectral Image Classification Using Multi-Scale Lightweight Transformer. Electronics. 2024; 13(5):949. https://doi.org/10.3390/electronics13050949
Chicago/Turabian StyleGu, Quan, Hongkang Luan, Kaixuan Huang, and Yubao Sun. 2024. "Hyperspectral Image Classification Using Multi-Scale Lightweight Transformer" Electronics 13, no. 5: 949. https://doi.org/10.3390/electronics13050949
APA StyleGu, Q., Luan, H., Huang, K., & Sun, Y. (2024). Hyperspectral Image Classification Using Multi-Scale Lightweight Transformer. Electronics, 13(5), 949. https://doi.org/10.3390/electronics13050949