A Study of Weather-Image Classification Combining VIT and a Dual Enhanced-Attention Module
Abstract
:1. Introduction
2. Related Work
3. Weather-Image-Classification Model Combining VIT and a Dual Enhanced-Attention Module
3.1. Overall Model Structure
3.2. Transfer Learning
3.3. Vision Transformer Pre-Trained Model
3.4. Convolutional Self-Attention Module
3.5. Atrous Self-Attention Module
3.6. Feature Fusion and the Classification Result Output Layer
4. Experiments and Analysis of Results
4.1. Experimental Dataset and the Task-Evaluation Metrics
4.2. Parameter Setting
4.3. Analysis of the Experimental Results
4.3.1. Comparison with Other Deep-Learning Methods
4.3.2. Module Ablation Experiment
4.3.3. Performance Comparison of the Pre-Trained Models
4.3.4. Optimizer Performance Comparison
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Zhang, Y.; Sun, J.; Chen, M.; Wang, Q.; Ma, R. Multi-Weather Classification Using Evolutionary Algorithm on EfficientNet. In Proceedings of the 2021 IEEE International Conference on Pervasive Computing and Communications Workshops and other Affiliated Events (PerCom Workshops), Kassel, Germany, 22–26 March 2021. [Google Scholar]
- Zhao, B.; Hua, L.; Li, X.; Lu, X.; Wang, Z. Weather Recognition via Classification Labels and Weather-Cue Maps. Pattern Recognit. 2019, 95, 272–284. [Google Scholar] [CrossRef]
- Wang, F.; Zhang, Z.; Liu, C.; Yu, Y.; Pang, S.; Duic, N.; Shafie-Khah, M.; Catalao, J.P.S. Generative Adversarial Networks and Convolutional Neural Networks Based Weather Classification Model for Day Ahead Short-Term Photovoltaic Power Forecasting. Energy Convers. Manag. 2019, 181, 443–462. [Google Scholar] [CrossRef]
- Zou, J.; Li, W.; Chen, C.; Du, Q. Scene Classification Using Local and Global Features with Collaborative Representation Fusion. Inf. Sci. 2016, 348, 209–226. [Google Scholar] [CrossRef]
- Adhikari, A.; Choudhuri, A.R.; Ghosh, D.; Chattopadhyay, N.; Chakraborty, R. Breast Cancer Histopathological Image Classification Using Convolutional Neural Networks. In Proceedings of the International Conference on Innovations in Software Architecture and Computational Systems, Kolkata, India, 2–3 April 2021; pp. 183–195. [Google Scholar]
- Zhang, Z.; Ma, H. Multi-Class Weather Classification on Single Images. In Proceedings of the 2015 IEEE International Conference on Image Processing (ICIP), Quebec City, QC, Canada, 27–30 September 2015; pp. 4396–4400. [Google Scholar]
- Zhu, Z.; Zhuo, L.; Qu, P.; Zhou, K.; Zhang, J. Extreme Weather Recognition Using Convolutional Neural Networks. In Proceedings of the 2016 IEEE International Symposium on Multimedia (ISM), San Jose, CA, USA, 11–13 December 2016; pp. 621–625. [Google Scholar]
- Li, Z.; Jin, Y.; Li, Y.; Lin, Z.; Wang, S. Imbalanced Adversarial Learning for Weather Image Generation and Classification. In Proceedings of the 2018 14th IEEE International Conference on Signal Processing (ICSP), Beijing, China, 12–16 August 2018; pp. 1093–1097. [Google Scholar]
- Guo, C.; Hu, Y.W.; Liu, P.; Yang, J. Feature fusion-based outdoor weather image classification. J. Comput. Appl. 2020, 40, 1023–1029. [Google Scholar]
- Xiao, H.; Zhang, F.; Shen, Z.; Wu, K.; Zhang, J. Classification of Weather Phenomenon From Images by Using Deep Convolutional Neural Network. Earth Space Sci. 2021, 8, e2020EA001604. [Google Scholar] [CrossRef]
- Zuo, J.G.; Liu, X.M.; Cai, B. Outdoor image weather recognition based on image chunking and feature fusion. Comput. Sci. 2022, 49, 197–203. [Google Scholar]
- Toğaçar, M.; Ergen, B.; Cömert, Z. Detection of Weather Images by Using Spiking Neural Networks of Deep Learning Models. Neural Comput. Appl. 2021, 33, 6147–6159. [Google Scholar] [CrossRef]
- Chen, F.; Zhang, T.; Chen, R.B. Lightweight convolutional Transformer-based image classification method and its application to remote sensing image classification. J. Electron. Inf. 2022, 44, 1–9. [Google Scholar]
- Wang, Y.; Li, Y.X. Research on Multi-Class Weather Classification Algorithm Based on Multi-Model Fusion. In Proceedings of the 2020 IEEE fourth Information Technology, Networking, Electronic and Automation Control Conference (ITNEC), Chongqing, China, 12–14 June 2020. [Google Scholar]
- Zhuang, F.; Qi, Z.; Duan, K.; Xi, D.; Zhu, Y.; Zhu, H.; Xiong, H.; He, Q. A Comprehensive Survey on Transfer Learning. Proc. IEEE 2021, 109, 43–76. [Google Scholar] [CrossRef]
- Lu, S.; Wang, S.-H.; Zhang, Y.-D. Detection of Abnormal Brain in MRI via Improved AlexNet and ELM Optimized by Chaotic Bat Algorithm. Neural Comput. Appl. 2021, 33, 10799–10811. [Google Scholar] [CrossRef]
- Lu, S.-Y.; Zhang, Z.; Zhang, Y.-D.; Wang, S.-H. CGENet: A Deep Graph Model for COVID-19 Detection Based on Chest CT. Biology 2022, 11, 33. [Google Scholar] [CrossRef]
- Dosovitskiy, A.; Beyer, L.; Kolesnikov, A.; Weissenborn, D.; Houlsby, N. An Image Is Worth 16 × 16 Words: Transformers for Image Recognition at Scale. International Conference on Learning Representations. arXiv 2021, arXiv:2010.11929. [Google Scholar]
- Chen, H.; Wang, Y.; Guo, T.; Xu, C.; Gao, W. Pre-Trained Image Processing Transformer. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Nashville, TN, USA, 20 June–25 June 2021; pp. 12299–12310. [Google Scholar]
- Liu, Z.; Lin, Y.; Cao, Y.; Hu, H.; Wei, Y.; Zhang, Z.; Lin, S.; Guo, B. Swin Transformer: Hierarchical Vision Transformer Using Shifted Windows. In Proceedings of the 2021 IEEE/CVF International Conference on Computer Vision (ICCV), Montreal, QC, Canada, 11 October 2021; pp. 9992–10002. [Google Scholar]
- Jose Valanarasu, J.M.; Yasarla, R.; Patel, V.M. TransWeather: Transformer-Based Restoration of Images Degraded by Adverse Weather Conditions. In Proceedings of the 2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), New Orleans, LA, USA, 18–24 June 2022; pp. 2343–2353. [Google Scholar]
- Wu, K.; Peng, H.; Chen, M.; Fu, J.; Chao, H. Rethinking and Improving Relative Position Encoding for Vision Transformer. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), Montreal, QC, Canada, 10–17 October 2021; pp. 10033–10041. [Google Scholar]
- Lu, Z.; Whalen, I.; Dhebar, Y.; Deb, K.; Goodman, E.D.; Banzhaf, W.; Boddeti, V.N. Multiobjective Evolutionary Design of Deep Convolutional Neural Networks for Image Classification. IEEE Trans. Evol. Computat. 2021, 25, 277–291. [Google Scholar] [CrossRef]
- Pei, Y.; Huang, Y.; Zou, Q.; Zhang, X.; Wang, S. Effects of Image Degradation and Degradation Removal to CNN-Based Image Classification. IEEE Trans. Pattern Anal. Mach. Intell. 2021, 43, 1239–1253. [Google Scholar] [CrossRef]
- Chen, X.; Xie, L.; Wu, J.; Tian, Q. Cyclic CNN: Image Classification With Multiscale and Multilocation Contexts. IEEE Internet Things J. 2021, 8, 7466–7475. [Google Scholar] [CrossRef]
- Yang, C.; Wang, Y.; Zhang, J.; Zhang, H.; Wei, Z.; Lin, Z.; Yuille, A. Lite Vision Transformer with Enhanced Self-Attention. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), New Orleans, LA, USA, 18–24 June 2022; pp. 11998–12008. [Google Scholar]
- Chen, L.C.; Papandreou, G.; Schroff, F.; Adam, H. Rethinking Atrous Convolution for Semantic Image Segmentation. arXiv 2017, arXiv:1706.05587. [Google Scholar]
- Elfwing, S.; Uchibe, E.; Doya, K. Sigmoid-Weighted Linear Units for Neural Network Function Approximation in Reinforcement Learning. Neural Netw. 2018, 107, 3–11. [Google Scholar] [CrossRef]
- Lin, D.; Lu, C.; Huang, H.; Jia, J. RSCM: Region Selection and Concurrency Model for Multi-Class Weather Recognition. IEEE Trans. Image Process. 2017, 26, 4154–4167. [Google Scholar] [CrossRef]
- Hong, D.; Gao, L.; Yao, J.; Zhang, B.; Plaza, A.; Chanussot, J. Graph Convolutional Networks for Hyperspectral Image Classification. IEEE Trans. Geosci. Remote Sens. 2021, 59, 5966–5978. [Google Scholar] [CrossRef]
- Liu, L.; Jiang, H.; He, P.; Chen, W.; Liu, X.; Gao, J.; Han, J. On the Variance of the Adaptive Learning Rate and Beyond. In Proceedings of the International Conference on Learning Representations, Rhodes, Greece, 12–18 September 2020. [Google Scholar]
- Li, Y.; Wu, X.; Li, C.; Li, X.; Chen, H.; Sun, C.; Rahaman, M.M.; Yao, Y.; Zhang, Y.; Jiang, T. A Hierarchical Conditional Random Field-Based Attention Mechanism Approach for Gastric Histopathology Image Classification. Appl. Intell. 2022, 52, 9717–9738. [Google Scholar] [CrossRef]
- Zhang, M.R.; Lucas, J.; Hinton, G.; Ba, J. Lookahead Optimizer: K Steps Forward, 1 Step Back. Adv. Neural Inf. Process. Syst. 2019, 32, 9597–9608. [Google Scholar]
Dataset | Total/Sheet | Type | Quantity/Sheet |
---|---|---|---|
MWD | 60,000 | Sunny | 10,000 |
Cloudy | 10,000 | ||
Rain | 10,000 | ||
Snow | 10,000 | ||
Misty | 10,000 | ||
Thunderstorm | 10,000 | ||
WEAPD | 6877 | Dew | 700 |
Fog | 855 | ||
Frost | 475 | ||
Glaze | 639 | ||
Hail | 592 | ||
Lightning | 378 | ||
Rain | 527 | ||
rainbow | 238 | ||
Mist | 1160 | ||
Sandstorm | 692 | ||
Snow | 621 |
Dataset | Model | Accuracy (%) | Recall (%) | Precision (%) | F1 (%) |
---|---|---|---|---|---|
MWD | AlexNet-Feature Fusion | 95.48 | 95.62 | 95.34 | 95.47 |
VGG16-TL | 95.62 | 95.77 | 95.43 | 95.59 | |
MeteCNN | 96.33 | 96.50 | 96.14 | 96.32 | |
VGG16-GNet-SNN | 96.48 | 96.74 | 96.23 | 96.47 | |
L-CT | 95.94 | 96.06 | 95.82 | 95.93 | |
VIT-DA | 97.48 | 97.52 | 97.45 | 97.47 | |
WEAPD | AlexNet-Feature Fusion | 85.44 | 85.61 | 85.27 | 85.43 |
VGG16-TL | 86.14 | 86.28 | 86.01 | 86.14 | |
MeteCNN | 85.79 | 85.85 | 85.73 | 85.77 | |
VGG16-GNet-SNN | 86.41 | 86.53 | 86.27 | 86.39 | |
L-CT | 86.56 | 86.60 | 86.47 | 86.53 | |
VIT-DA | 87.70 | 87.84 | 87.57 | 87.69 | |
MWD & WEAPD | AlexNet-Feature Fusion | 89.35 | 89.46 | 89.24 | 89.34 |
VGG16-TL | 91.13 | 91.20 | 91.07 | 91.12 | |
MeteCNN | 90.68 | 90.75 | 90.62 | 90.68 | |
VGG16-GNet-SNN | 91.24 | 91.27 | 91.20 | 91.23 | |
L-CT | 90.95 | 91.04 | 90.87 | 90.95 | |
VIT-DA | 92.74 | 92.87 | 92.61 | 92.73 |
Dataset | Model | F1 (%) |
---|---|---|
MWD | VIT | 94.61 |
VIT-CSA | 96.65 | |
VIT-ASA | 96.29 | |
VIT-DA | 97.47 | |
WEAPD | VIT | 83.41 |
VIT-CSA | 85.79 | |
VIT-ASA | 85.43 | |
VIT-DA | 87.69 | |
MWD & WEAPD | VIT | 89.41 |
VIT-CSA | 92.04 | |
VIT-ASA | 91.45 | |
VIT-DA | 92.73 |
Dataset | Model | F1 (%) |
---|---|---|
MWD & WEAPD | VGG-16 | 87.24 |
AlexNet | 86.78 | |
GoogLeNet | 88.26 | |
ResNet50 | 88.53 | |
VIT | 89.41 |
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. |
© 2023 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
Li, J.; Luo, X. A Study of Weather-Image Classification Combining VIT and a Dual Enhanced-Attention Module. Electronics 2023, 12, 1213. https://doi.org/10.3390/electronics12051213
Li J, Luo X. A Study of Weather-Image Classification Combining VIT and a Dual Enhanced-Attention Module. Electronics. 2023; 12(5):1213. https://doi.org/10.3390/electronics12051213
Chicago/Turabian StyleLi, Jing, and Xueping Luo. 2023. "A Study of Weather-Image Classification Combining VIT and a Dual Enhanced-Attention Module" Electronics 12, no. 5: 1213. https://doi.org/10.3390/electronics12051213
APA StyleLi, J., & Luo, X. (2023). A Study of Weather-Image Classification Combining VIT and a Dual Enhanced-Attention Module. Electronics, 12(5), 1213. https://doi.org/10.3390/electronics12051213