Malware Image Classification Using Global Context Vision Transformers for Information Security
Article Information
Abstract
The continuous threat of malware against digital systems exists because its attack methods develop rapidly, reducing the effectiveness of traditional detection systems. Current static and dynamic analysis methods for malware detection face challenges with scalability and robustness when handling large and complex malware samples. Computer vision now shows that malware binaries contain specific structural patterns when displayed as grayscale images, which can be used for classification. This study investigates GCViT for malware detection through its application to the Malimg dataset, which contains 9,337 samples from 25 malware families. The dataset underwent preprocessing through a two-step process that involved converting binary files into grayscale images followed by applying viridis colormap transformation and normalization for better visual discrimination. The GCViT model trained using ImageNet-pretrained weights while keeping its backbone fixed and modifying only the classifier head for malware family classification. The model reached 99.46% test accuracy and showed high effectiveness across most malware families, with only a few errors among structurally similar variants. The results demonstrate that GCViT achieves better performance by detecting both local and global dependencies in images, leading to improved malware image classification. The research sets a new benchmark for the Malimg dataset and highlights the potential of Vision Transformers in cybersecurity.
Graphical Abstract
Keywords
Data Availability Statement
Funding
Conflicts of Interest
Ethical Approval and Consent to Participate
References
- Hatamizadeh, A., Yin, H., Heinrich, G., Kautz, J., & Molchanov, P. (2023, July). Global context vision transformers. In International Conference on Machine Learning (pp. 12633-12646). PMLR.
[Google Scholar] - Nataraj, L., Karthikeyan, S., Jacob, G., & Manjunath, B. S. (2011, July). Malware images: visualization and automatic classification. In Proceedings of the 8th international symposium on visualization for cyber security (pp. 1-7).
[CrossRef] [Google Scholar] - Anderson, H. S., & Roth, P. (2018). Ember: an open dataset for training static pe malware machine learning models. arXiv preprint arXiv:1804.04637.
[Google Scholar] - Dosovitskiy, A. (2020). An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929.
[Google Scholar] - Liu, Z., Lin, Y., Cao, Y., Hu, H., Wei, Y., Zhang, Z., ... & Guo, B. (2021, October). Swin Transformer: Hierarchical Vision Transformer using Shifted Windows. In 2021 IEEE/CVF International Conference on Computer Vision (ICCV) (pp. 9992-10002). IEEE.
[CrossRef] [Google Scholar] - Schultz, M. G., Eskin, E., Zadok, F., & Stolfo, S. J. (2000, May). Data mining methods for detection of new malicious executables. In Proceedings 2001 IEEE Symposium on Security and Privacy. S&P 2001 (pp. 38-49). IEEE.
[CrossRef] [Google Scholar] - Bayer, U., Moser, A., Kruegel, C., & Kirda, E. (2006). Dynamic analysis of malicious code. Journal in Computer Virology, 2(1), 67-77.
[CrossRef] [Google Scholar] - Ye, Y., Li, T., Adjeroh, D., & Iyengar, S. S. (2017). A survey on malware detection using data mining techniques. ACM Computing Surveys (CSUR), 50(3), 1-40.
[CrossRef] [Google Scholar] - He, K., & Kim, D. S. (2019, August). Malware detection with malware images using deep learning techniques. In 2019 18th IEEE international conference on trust, security and privacy in computing and communications/13th IEEE international conference on big data science and engineering (TrustCom/BigDataSE) (pp. 95-102). IEEE.
[CrossRef] [Google Scholar] - Kalash, M., Rochan, M., Mohammed, N., Bruce, N. D., Wang, Y., & Iqbal, F. (2018, February). Malware classification with deep convolutional neural networks. In 2018 9th IFIP international conference on new technologies, mobility and security (NTMS) (pp. 1-5). IEEE.
[CrossRef] [Google Scholar] - Vinayakumar, R., Alazab, M., Soman, K., & Others. (2019). Deep learning approach for intelligent intrusion detection system. IEEE Access, 7, 41525–41550.
[CrossRef] [Google Scholar] - Seneviratne, S., Shariffdeen, R., Rasnayaka, S., & Kasthuriarachchi, N. (2022). Self-supervised vision transformers for malware detection. IEEE Access, 10, 103121-103135.
[CrossRef] [Google Scholar] - Szor, P. (2005). The art of computer virus research and defense. Pearson Education.
[Google Scholar] - Egele, M., Scholte, T., Kirda, E., & Kruegel, C. (2008). A survey on automated dynamic malware-analysis techniques and tools. ACM computing surveys (CSUR), 44(2), 1-42.
[CrossRef] [Google Scholar] - Saxe, J., & Berlin, K. (2015, October). Deep neural network based malware detection using two dimensional binary program features. In 2015 10th international conference on malicious and unwanted software (MALWARE) (pp. 11-20). IEEE.
[CrossRef] [Google Scholar] - El-Shafai, W., Almomani, I., & AlKhayer, A. (2021). Visualized malware multi-classification framework using fine-tuned CNN-based transfer learning models. Applied Sciences, 11(14), 6446.
[CrossRef] [Google Scholar] - Gibert, D., Mateu, C., & Planes, J. (2020). The rise of machine learning for detection and classification of malware: Research developments, trends and challenges. Journal of Network and Computer Applications, 153, 102526.
[CrossRef] [Google Scholar] - Alshomrani, M., Albeshri, A., Alturki, B., Alallah, F. S., & Alsulami, A. A. (2024). Survey of Transformer-Based Malicious Software Detection Systems. Electronics, 13(23), 4677.
[CrossRef] [Google Scholar] - Benabdallah, I. (2021). Malimg original dataset [Data set]. Kaggle. Retrieved from https://www.kaggle.com/datasets/ikrambenabd/malimg-original (accessed: 19 December 2025).
[Google Scholar] - Anderson, K., & McGrew, D. (2015). Microsoft malware classification challenge (BIG 2015) [Data set]. Kaggle. Retrieved from https://www.kaggle.com/c/malware-classification (accessed: 19 December 2025).
[Google Scholar] - Pan, S. J., & Yang, Q. (2010). A survey on transfer learning. IEEE Transactions on Knowledge and Data Engineering, 22(10), 1345–1359.
[CrossRef] [Google Scholar] - Bouchaib, P., & Bouhorma, M. (2021, April). Transfer learning and smote algorithm for image-based malware classification. In Proceedings of the 4th International Conference on Networking, Information Systems & Security (pp. 1-6).
[CrossRef] [Google Scholar] - Venkatraman, S., Alazab, M., & Vinayakumar, R. (2019). A hybrid deep learning image-based analysis for effective malware detection. Journal of Information Security and Applications, 47, 377-389.
[CrossRef] [Google Scholar] - Akritidis, L., Fevgas, A., Alamaniotis, M., & Bozanis, P. (2023, November). Conditional data synthesis with deep generative models for imbalanced dataset oversampling. In 2023 IEEE 35th international conference on tools with artificial intelligence (ICTAI) (pp. 444-451). IEEE.
[CrossRef] [Google Scholar] - Goyal, P., Dollár, P., Girshick, R., Noordhuis, P., Wesolowski, L., Kyrola, A., ... & He, K. (2017). Accurate, large minibatch sgd: Training imagenet in 1 hour. arXiv preprint arXiv:1706.02677.
[Google Scholar] - Meng, L., Li, H., Chen, B. C., Lan, S., Wu, Z., Jiang, Y. G., & Lim, S. N. (2022, June). AdaViT: Adaptive Vision Transformers for Efficient Image Recognition. In 2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) (pp. 12299-12308). IEEE.
[CrossRef] [Google Scholar] - Karat, G., Kannimoola, J. M., Nair, N., Vazhayil, A., VG, S., & Poornachandran, P. (2024). CNN-LSTM hybrid model for enhanced malware analysis and detection. Procedia Computer Science, 233, 492-503.
[CrossRef] [Google Scholar] - Ashawa, M., Owoh, N., Hosseinzadeh, S., & Osamor, J. (2024). Enhanced Image-Based Malware Classification Using Transformer-Based Convolutional Neural Networks (CNNs). Electronics, 13(20), 4081.
[CrossRef] [Google Scholar] - Raff, E., & Nicholas, C. (2017, November). Malware classification and class imbalance via stochastic hashed lzjd. In Proceedings of the 10th ACM Workshop on Artificial Intelligence and Security (pp. 111-120).
[CrossRef] [Google Scholar] - Moisejevs, I. (2019). Adversarial attacks and defenses in malware classification: A survey. International Journal of Artificial Intelligence and Expert Systems, 8.
[Google Scholar] - Kanadath, A., Jothi, J. A. A., & Urolagin, S. (2024). Cvits-net: A cnn-vit network with skip connections for histopathology image classification. IEEE Access.
[CrossRef] [Google Scholar] - Demetrio, L., Coull, S. E., Biggio, B., Lagorio, G., Armando, A., & Roli, F. (2021). Adversarial exemples: A survey and experimental evaluation of practical attacks on machine learning for windows malware detection. ACM Transactions on Privacy and Security (TOPS), 24(4), 1-31.
[CrossRef] [Google Scholar] - Cruickshank, I. J., & Carley, K. M. (2020). Analysis of malware communities using multi-modal features. IEEE Access, 8, 77435-77448.
[CrossRef] [Google Scholar] - Dilshad, M., Almas, B., Tariq, N., Jazri, H. B., Alwakid, G. N., Khan, J. S., ... & Kumar, R. (2024, July). IoV Cyber Defense: Advancing DDoS Attack Detection with Gini Index in Tree Models. In 2024 International Conference on Emerging Trends in Networks and Computer Communications (ETNCC) (pp. 1-8). IEEE.
[CrossRef] [Google Scholar] - Ramzan, T., Tariq, N., Farooq, U., Jazri, H. B., Ashraf, H., Khan, J. S., & Kumar, P. (2024, July). An ANN-Based Resampling Approach for Handling Imbalance and Overlapped Data. In 2024 International Conference on Emerging Trends in Networks and Computer Communications (ETNCC) (pp. 1-8). IEEE.
[CrossRef] [Google Scholar] - Cohen, J. (1960). A coefficient of agreement for nominal scales. Educational and psychological measurement, 20(1), 37-46.
[CrossRef] [Google Scholar] - Matthews, B. W. (1975). Comparison of the predicted and observed secondary structure of T4 phage lysozyme. Biochimica et Biophysica Acta (BBA)-Protein Structure, 405(2), 442-451.
[CrossRef] [Google Scholar]
Cite This Article
TY - JOUR AU - Masab, Muhammad AU - Ahmad, Khubab AU - Hussain, Muzammil AU - Khan, Muhammad Shahbaz PY - 2025 DA - 2025/12/20 TI - Malware Image Classification Using Global Context Vision Transformers for Information Security JO - ICCK Transactions on Information Security and Cryptography T2 - ICCK Transactions on Information Security and Cryptography JF - ICCK Transactions on Information Security and Cryptography VL - 2 IS - 1 SP - 1 EP - 15 DO - 10.62762/TISC.2025.775760 UR - https://www.icck.org/article/abs/TISC.2025.775760 KW - malware classification KW - global context vision transformer KW - deep learning KW - information security KW - malimg dataset AB - The continuous threat of malware against digital systems exists because its attack methods develop rapidly, reducing the effectiveness of traditional detection systems. Current static and dynamic analysis methods for malware detection face challenges with scalability and robustness when handling large and complex malware samples. Computer vision now shows that malware binaries contain specific structural patterns when displayed as grayscale images, which can be used for classification. This study investigates GCViT for malware detection through its application to the Malimg dataset, which contains 9,337 samples from 25 malware families. The dataset underwent preprocessing through a two-step process that involved converting binary files into grayscale images followed by applying viridis colormap transformation and normalization for better visual discrimination. The GCViT model trained using ImageNet-pretrained weights while keeping its backbone fixed and modifying only the classifier head for malware family classification. The model reached 99.46% test accuracy and showed high effectiveness across most malware families, with only a few errors among structurally similar variants. The results demonstrate that GCViT achieves better performance by detecting both local and global dependencies in images, leading to improved malware image classification. The research sets a new benchmark for the Malimg dataset and highlights the potential of Vision Transformers in cybersecurity. SN - 3070-2429 PB - Institute of Central Computation and Knowledge LA - English ER -
@article{Masab2025Malware,
author = {Muhammad Masab and Khubab Ahmad and Muzammil Hussain and Muhammad Shahbaz Khan},
title = {Malware Image Classification Using Global Context Vision Transformers for Information Security},
journal = {ICCK Transactions on Information Security and Cryptography},
year = {2025},
volume = {2},
number = {1},
pages = {1-15},
doi = {10.62762/TISC.2025.775760},
url = {https://www.icck.org/article/abs/TISC.2025.775760},
abstract = {The continuous threat of malware against digital systems exists because its attack methods develop rapidly, reducing the effectiveness of traditional detection systems. Current static and dynamic analysis methods for malware detection face challenges with scalability and robustness when handling large and complex malware samples. Computer vision now shows that malware binaries contain specific structural patterns when displayed as grayscale images, which can be used for classification. This study investigates GCViT for malware detection through its application to the Malimg dataset, which contains 9,337 samples from 25 malware families. The dataset underwent preprocessing through a two-step process that involved converting binary files into grayscale images followed by applying viridis colormap transformation and normalization for better visual discrimination. The GCViT model trained using ImageNet-pretrained weights while keeping its backbone fixed and modifying only the classifier head for malware family classification. The model reached 99.46\% test accuracy and showed high effectiveness across most malware families, with only a few errors among structurally similar variants. The results demonstrate that GCViT achieves better performance by detecting both local and global dependencies in images, leading to improved malware image classification. The research sets a new benchmark for the Malimg dataset and highlights the potential of Vision Transformers in cybersecurity.},
keywords = {malware classification, global context vision transformer, deep learning, information security, malimg dataset},
issn = {3070-2429},
publisher = {Institute of Central Computation and Knowledge}
}
Publisher's Note
ICCK stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and Permissions
Portico