Enhancing Malware Detection With Deep Learning Convolutional Neural Networks: Investigating the Impact of Image Size Variations

Ahmed Hawana, Emad S. Hassan, Walid El‐Shafai, Sami A. El‐Dolil · Security and Privacy · 2025

ABSTRACT To address the growing challenges posed by cyber threats, anti‐malware organizations have increasingly turned to machine learning (ML), a well‐established field in computer science known for its proficiency in tasks like image recognition and decision‐making. Leveraging ML enables these organizations to enhance their ability to detect and classify malware. However, identifying an optimal method for malware detection remains a critical challenge in cybersecurity. This paper proposes a simplified detection model using deep learning (DL)‐based convolutional neural networks (CNNs) to achieve effective malware classification while maintaining simplicity. The proposed model focuses on employing a minimalistic architecture without compromising detection accuracy, even when working with an imbalanced dataset. The primary objective is to evaluate the impact of varying malware image sizes (32 × 32, 64 × 64, 128 × 128, and 256 × 256) on detection performance. The malware images dataset was divided into 80% for training and 20% for testing. The data were preprocessed to generate image datasets of the specified sizes, which were then fed into a two‐layer CNN model. The model's performance was assessed using key metrics such as accuracy, precision, recall, and F1‐score. Experimental results demonstrate that the size of malware images inversely affects detection performance, with smaller images yielding better results. Specifically, the 32 × 32‐pixel size emerged as the most efficient for malware detection using the proposed model, achieving 99.601% accuracy, 98.942% precision, 98.910% recall, and 98.915% F1‐score. Additionally, the 32 × 32 images required the least training time, highlighting the model's computational efficiency.

Read the paper · More papers on PaperTik