Efficient Weather Classification Using DenseNet and EfficientNet

Mirza Alim Mutasodirin, Faiq Miftakhul Falakh

Abstract


Classifying images of weather conditions using deep learning models is a challenging task due to the computational intensity and resource requirements. To deploy AI models on resource-constrained devices like smartphones and IoT devices, compact and computationally lightweight models are necessary. Efficient deep learning models for weather classification are essential to reduce energy consumption and costs, making AI more accessible and sustainable. To the best of our knowledge, there are limited studies comparing MobileNet, DenseNet, and EfficientNet as efficient models and did not report any hyperparameter optimization. Our study contributes by investigating efficient models with hyperparameter optimization. Firstly, we measured the inference speed of 14 models, namely MobileNet, MobileNetV2, MobileNetV3, EfficientNetB0, EfficientNetV2B0, NASNetMobile, DenseNet121, VGG16, Xception, InceptionV3, ResNet50, ResNet50V2, ConvNeXtTiny, and InceptionResNetV2. Then, the top-7 fast models, which are MobileNet, MobileNetV2, MobileNetV3, EfficientNetB0, EfficientNetV2B0, NASNetMobile, and DenseNet121, were benchmarked for their accuracy. The models were compared by a small dataset having four classes: cloudy, rain, shine, and sunrise. Batch size and learning rate for each model were optimized by grid search method. It turns out that DenseNet121 achieved the best and the most balanced validation and testing accuracy, 0.9821 and 0.9837, followed by EfficientNetB0 with 0.9821 and 0.9740 respectively. This study is important to find efficient models with optimal comparison.

Keywords


densenet; efficientnet; hyperparameter optimization; weather classification

Full Text:

References


Z. Sun, P. Wang, Y. Jin, J. Wang, and L. Wang, “A Practical Weather Detection Method Built in the Surveillance System Currently Used to Monitor the Large-Scale Freeway in China,” IEEE Access, vol. 8, pp. 112357–112367, 2020, doi: 10.1109/ACCESS.2020.3002959.

Q. A. Al-Haija, M. Gharaibeh, and A. Odeh, “Detection in Adverse Weather Conditions for Autonomous Vehicles via Deep Learning,” AI, vol. 3, no. 2, pp. 303–317, 2022, doi: 10.3390/ai3020019.

N. A. Mashudi, N. Ahmad, S. M. Sam, N. Mohamed, and R. Ahmad, “Deep Learning Approaches for Weather Image Recognition in Agriculture,” in 2022 IEEE Symposium on Future Telecommunication Technologies (SOFTT), 2022, pp. 72–77. doi: 10.1109/SOFTT56880.2022.10010161.

T. Q. Nam, “Evaluation of Stacked Ensemble Model on Weather Image Recognition,” Procedia Comput Sci, vol. 234, pp. 1664–1671, 2024, doi: https://doi.org/10.1016/j.procs.2024.03.171.

C. Yuan et al., “Enhancing Road Safety: Real-Time Classification of Low Visibility Foggy Weather Using ABNet Deep-Learning Model,” J Transp Eng A Syst, vol. 150, no. 10, p. 4024060, 2024, doi: 10.1061/JTEPBS.TEENG-8492.

R. U. Rani, J. Kakarla, and B. Sundar, “Weather image classification using EfficientNet and Dual Attention Block,” in 2023 2nd International Conference on Smart Technologies and Systems for Next Generation Computing (ICSTSN), 2023, pp. 1–4. doi: 10.1109/ICSTSN57873.2023.10151564.

R. Pillai, N. Sharma, and R. Gupta, “Fine-Tuned EfficientNetB4 Transfer Learning Model for Weather Classification,” in 2023 3rd Asian Conference on Innovation in Technology (ASIANCON), 2023, pp. 1–6. doi: 10.1109/ASIANCON58793.2023.10270698.

M. Samo, J. M. Mafeni Mase, and G. Figueredo, “Deep Learning with Attention Mechanisms for Road Weather Detection,” Sensors, vol. 23, no. 2, 2023, doi: 10.3390/s23020798.

A. G. Howard et al., “MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications,” Apr. 2017.

D. Patterson et al., “Carbon Emissions and Large Neural Network Training,” Apr. 2021.

S. Pei, J. Luo, S. Liang, H. Ding, X. Ye, and M. Chen, “Carbon Emissions Reduction of Neural Network by Discrete Rank Pruning,” CCF Transactions on High Performance Computing, vol. 5, no. 3, pp. 334–346, 2023, doi: 10.1007/s42514-023-00144-0.

M. Tan and Q. Le, “EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks,” in Proceedings of the 36th International Conference on Machine Learning, K. Chaudhuri and R. Salakhutdinov, Eds., in Proceedings of Machine Learning Research, vol. 97. PMLR, Aug. 2019, pp. 6105–6114. [Online]. Available: https://proceedings.mlr.press/v97/tan19a.html

G. Huang, Z. Liu, L. Van Der Maaten, and K. Q. Weinberger, “Densely Connected Convolutional Networks,” in 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017, pp. 2261–2269. doi: 10.1109/CVPR.2017.243.

M. Sandler, A. Howard, M. Zhu, A. Zhmoginov, and L.-C. Chen, “MobileNetV2: Inverted Residuals and Linear Bottlenecks,” in 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2018, pp. 4510–4520. doi: 10.1109/CVPR.2018.00474.

A. Howard et al., “Searching for MobileNetV3,” in 2019 IEEE/CVF International Conference on Computer Vision (ICCV), 2019, pp. 1314–1324. doi: 10.1109/ICCV.2019.00140.

M. Tan and Q. Le, “EfficientNetV2: Smaller Models and Faster Training,” in Proceedings of the 38th International Conference on Machine Learning, M. Meila and T. Zhang, Eds., in Proceedings of Machine Learning Research, vol. 139. PMLR, Aug. 2021, pp. 10096–10106. [Online]. Available: https://proceedings.mlr.press/v139/tan21a.html

V. Kukreja, V. Solanki, A. Baliyan, and V. Jain, “WeatherNet: Transfer Learning-based Weather Recognition Model,” in 2022 International Conference on Emerging Smart Computing and Informatics (ESCI), 2022, pp. 1–5. doi: 10.1109/ESCI53509.2022.9758183.

P. Młodzianowski, “Weather Classification with Transfer Learning - InceptionV3, MobileNetV2 and ResNet50,” in Digital Interaction and Machine Intelligence, J. and K. W. and O. J. W. and R. A. and S. M. Biele Cezary and Kacprzyk, Ed., Cham: Springer International Publishing, 2022, pp. 3–11.

P. Revathi, S. Bhavani, G. Karthika Priya Dharshini, G. Rajaram, S. Siddhan, and R. K. Dwibedi, “Weather Prediction(analysis) using Soft kind of Computing techniques,” in 2024 4th International Conference on Advance Computing and Innovative Technologies in Engineering (ICACITE), 2024, pp. 1337–1340. doi: 10.1109/ICACITE60783.2024.10616994.

C. Szegedy, V. Vanhoucke, S. Ioffe, J. Shlens, and Z. Wojna, “Rethinking the Inception Architecture for Computer Vision,” in 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016, pp. 2818–2826. doi: 10.1109/CVPR.2016.308.

K. He, X. Zhang, S. Ren, and J. Sun, “Deep Residual Learning for Image Recognition,” in 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016, pp. 770–778. doi: 10.1109/CVPR.2016.90.

A. S. Raj and A. S. Pillai, “Performance Comparison of Convolution Neural Networks on Weather Dataset,” in 2022 4th International Conference on Inventive Research in Computing Applications (ICIRCA), 2022, pp. 1505–1510. doi: 10.1109/ICIRCA54612.2022.9985500.

K. Simonyan and A. Zisserman, “Very Deep Convolutional Networks for Large-Scale Image Recognition,” Sep. 2014.

C. Szegedy, S. Ioffe, V. Vanhoucke, and A. Alemi, “Inception-v4, Inception-ResNet and the Impact of Residual Connections on Learning,” Proceedings of the AAAI Conference on Artificial Intelligence, vol. 31, no. 1, Feb. 2017, doi: 10.1609/aaai.v31i1.11231.

T. Yu, Q. Kuang, J. Hu, J. Zheng, and X. Li, “Global-Similarity Local-Salience Network for Traffic Weather Recognition,” IEEE Access, vol. 9, pp. 4607–4615, 2021, doi: 10.1109/ACCESS.2020.3048116.

X. Zhang, X. Zhou, M. Lin, and J. Sun, “ShuffleNet: An Extremely Efficient Convolutional Neural Network for Mobile Devices,” in 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2018, pp. 6848–6856. doi: 10.1109/CVPR.2018.00716.

Y. Wang and Y. Li, “Research on Multi-class Weather Classification Algorithm Based on Multi-model Fusion,” in 2020 IEEE 4th Information Technology, Networking, Electronic and Automation Control Conference (ITNEC), 2020, pp. 2251–2255. doi: 10.1109/ITNEC48623.2020.9084786.

Sri Venkata Divya Madhuri Challa and Hemendra Kumar, “Weather Categorization Using Foreground Subtraction and Deep Transfer Learning,” in Innovations in Computer Science and Engineering: Proceedings of 7th ICICSE, R. and B. R. and A. G. Saini Harvinder Singh and Sayal, Ed., Singapore: Springer Singapore, 2020, pp. 595–601. doi: 10.1007/978-981-15-2043-3_64.

Saleh A Albelwi, “Deep Architecture based on DenseNet-121 Model for Weather Image Recognition,” International Journal of Advanced Computer Science and Applications, vol. 13, no. 10, 2022.

C. Szegedy et al., “Going deeper with convolutions,” in 2015 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2015, pp. 1–9. doi: 10.1109/CVPR.2015.7298594.

A. Krizhevsky, I. Sutskever, and G. E. Hinton, “ImageNet Classification with Deep Convolutional Neural Networks,” in Advances in Neural Information Processing Systems, F. Pereira, C. J. Burges, L. Bottou, and K. Q. Weinberger, Eds., Curran Associates, Inc., 2012. [Online]. Available: https://proceedings.neurips.cc/paper_files/paper/2012/file/c399862d3b9d6b76c8436e924a68c45b-Paper.pdf

M. Kalkan et al., “Cloudy/clear weather classification using deep learning techniques with cloud images,” Computers and Electrical Engineering, vol. 102, p. 108271, 2022, doi: https://doi.org/10.1016/j.compeleceng.2022.108271.

X. and R. S. and S. J. He Kaiming and Zhang, “Identity Mappings in Deep Residual Networks,” in Computer Vision – ECCV 2016, J. and S. N. and W. M. Leibe Bastian and Matas, Ed., Cham: Springer International Publishing, 2016, pp. 630–645.

A. Gupta and S. Goel, “Deep Learning Empowered Weather Image Classification for Accurate Analysis,” in 2023 IEEE 2nd International Conference on Industrial Electronics: Developments & Applications (ICIDeA), 2023, pp. 567–572. doi: 10.1109/ICIDeA59866.2023.10295216.

I. Radosavovic, R. P. Kosaraju, R. Girshick, K. He, and P. Dollár, “Designing Network Design Spaces,” in 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2020, pp. 10425–10433. doi: 10.1109/CVPR42600.2020.01044.

F. Chollet, “Xception: Deep Learning with Depthwise Separable Convolutions,” in 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017, pp. 1800–1807. doi: 10.1109/CVPR.2017.195.

Z. Liu, H. Mao, C.-Y. Wu, C. Feichtenhofer, T. Darrell, and S. Xie, “A ConvNet for the 2020s,” in 2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2022, pp. 11966–11976. doi: 10.1109/CVPR52688.2022.01167.

A. E. Nagib, H. Mohamed, and A. Ashraf, “Comparative Analysis of Pre-Trained CNN Architectures for Multi-Class Weather Classification: A Study on Deep Learning Techniques,” in 2023 Intelligent Methods, Systems, and Applications (IMSA), 2023, pp. 297–302. doi: 10.1109/IMSA58542.2023.10217616.

Y. Zhang, J. Sun, M. Chen, Q. Wang, Y. Yuan, and R. Ma, “Multi-Weather Classification using Evolutionary Algorithm on EfficientNet,” in 2021 IEEE International Conference on Pervasive Computing and Communications Workshops and other Affiliated Events (PerCom Workshops), 2021, pp. 546–551. doi: 10.1109/PerComWorkshops51409.2021.9430939.

F. Rajabi, N. Faraji, and M. Hashemi, “An intelligent method for detecting weather conditions using deep learning on a combined dataset,” in 2022 8th Iranian Conference on Signal Processing and Intelligent Systems (ICSPIS), 2022, pp. 1–5. doi: 10.1109/ICSPIS56952.2022.10043995.

R. T. Sadia, Md. A. Ahamed, and Md. A. Hossain, “Multiple Weather Scene Detection Utilizing the EfficientNet Family,” in 2021 International Conference on Computer, Communication, Chemical, Materials and Electronic Engineering (IC4ME2), 2021, pp. 1–4. doi: 10.1109/IC4ME253898.2021.9768411.

S. Xie, R. Girshick, P. Dollár, Z. Tu, and K. He, “Aggregated Residual Transformations for Deep Neural Networks,” in 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017, pp. 5987–5995. doi: 10.1109/CVPR.2017.634.

F. N. Iandola, S. Han, M. W. Moskewicz, K. Ashraf, W. J. Dally, and K. Keutzer, “SqueezeNet: AlexNet-level accuracy with 50x fewer parameters and <0.5MB model size,” Feb. 2016.

A. Palvanov and Y. I. Cho, “VisNet: Deep Convolutional Neural Networks for Forecasting Atmospheric Visibility,” Sensors, vol. 19, no. 6, 2019, doi: 10.3390/s19061343.

Z. Liu et al., “Swin Transformer V2: Scaling Up Capacity and Resolution,” in 2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2022, pp. 11999–12009. doi: 10.1109/CVPR52688.2022.01170.

A. Yang, T. T. Toe, Z. Ran, and S. Xiao, “Multi-class Weather Classification using EfficientNet-B4 with Attention,” in 2022 IEEE 13th International Conference on Software Engineering and Service Science (ICSESS), 2022, pp. 89–92. doi: 10.1109/ICSESS54813.2022.9930176.

V. Afxentiou and T. Vladimirova, “Multi-Label Weather Image Classification for Embedded Computing Platforms,” in 2023 IEEE Smart World Congress (SWC), 2023, pp. 1–8. doi: 10.1109/SWC57546.2023.10449086.

Huy Cong Phim and Nam Quy Tran, “EVALUATION OF VISION TRANSFORMER ON WEATHER IMAGE RECOGNITION,” Tra Vinh University Journal of Science, vol. 13, no. 3, Sep. 2023.

Alexey Dosovitskiy et al., “An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale,” in International Conference on Learning Representations, 2021.

B. Zoph, V. Vasudevan, J. Shlens, and Q. V Le, “Learning Transferable Architectures for Scalable Image Recognition,” in 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2018, pp. 8697–8710. doi: 10.1109/CVPR.2018.00907.

A. Gbeminiyi Oluwafemi and W. Zenghui, “Multi-Class Weather Classification from Still Image Using Said Ensemble Method,” in 2019 Southern African Universities Power Engineering Conference/Robotics and Mechatronics/Pattern Recognition Association of South Africa (SAUPEC/RobMech/PRASA), 2019, pp. 135–140. doi: 10.1109/RoboMech.2019.8704783.




DOI: https://doi.org/10.30591/jpit.v9i2.7539

Refbacks

  • There are currently no refbacks.


Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.

JPIT INDEXED BY

  
  

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.