Skip to content
Open access

Lightweight CNN with Multi-Head Attention for Image-Based Malware Classification

Aug 2026 · Zanco Journal of Pure and Applied Sciences · 0 citations

TL;DR

A compact convolutional neural network architecture integrated with a multi-head attention mechanism to enhance feature discrimination in malware family classification that attains high weighted Precision, Recall, and F1 scores and enhanced macro-averaged performance, particularly enhancing classification for minority families that the baseline misclassified or failed to detect.

Abstract

This paper introduces a compact convolutional neural network (CNN) architecture integrated with a multi-head attention mechanism to enhance feature discrimination in malware family classification. The novelty lies in combining attention-based refinement within a lightweight framework that achieves comparable accuracy to larger model while maintaining computational efficiency. The integrated multi-head attention module emphasizes small yet highly discriminative regions, which often correspond to obfuscated or subtly modified code segments that traditional models overlook. In contrast to reverse engineering or handcrafted feature methods, the framework is fully automated and computationally efficient, requiring only 2.03 M parameters approximately one-fifth of the baseline CNN while reducing training time by 42% and inference latency by 37% on the same hardware configuration. Experiments were conducted on the widely used Malimg dataset, which comprises 9,342 grayscale images across 25 malware families, under multiple train–test splits (50/50 to 90/10). The results consistently demonstrate superior performance relative to the baseline CNN, the model achieving an average accuracy of 98.7 ± 0.3% across five randomized train–test splits, with a peak performance of 99% on the 80/20 partition. Data partitions were strictly disjoint to prevent leakage between training and test sets. Furthermore, the proposed model attains high weighted Precision, Recall, and F1 scores (≈0.99) and enhanced macro-averaged performance (up to 0.97), particularly enhancing classification for minority families that the baseline misclassified or failed to detect. Confusion matrix analysis further highlights that residual misclassifications occur primarily in families with limited samples or high morphological similarity. Comparative evaluation against recent studies confirms the superiority of the proposed approach in terms of both accuracy and computational efficiency. Despite these strengths, limitations remain, including dependence on labeled datasets, restricted interpretability, and the need for validation on more diverse, real-world malware corpora.

Read PDF

Similar papers

Open access Sep 2026

A Hybrid CNN–LSTM Deep Learning Framework for Automated Malware Classification using Spatial–Sequential Feature Fusion

The high rate of growth of advanced and highly obfuscated malware has made the use of conventional signature detection mechanisms less viable. In order to overcome this problem, this paper suggests a hybrid framework for malware classification based on the combination of Convolutional Neural Networks (CNNs) and Long Sh...

Chevella Anil Kumar, Saradha S, Mithila Ayyavoo et al. · 0 citations
Open access 2026

Hybrid Convolutional-Hopfield Neural Networks for Image-Based Malware Classification

A novel hybrid CNN-Hopfield Neural Network (CNN-HNN) framework that replaces traditional dense classification heads with continuous Modern Hopfield associative memory layers is proposed, achieving top-tier accuracy and reducing classification-head parameter counts while reducing floating-point operations (FLOPs) and ac...

Uma Kannan, Rajendran Swamidurai · 0 citations
Sep 2026

Image-Based Malware Detection Using Deep Convolutional Autoencoder and Random Forest

Image-based analysis has been extensively used for malware classification by converting binary files into grayscale images to extract structural and behavioral patterns. However, common deep learning approaches generally suffer from problems such as non-interpretability, class imbalance, and computational overhead....

Shajjia Mazhar, Sadia Fatima, Irfanud Din et al. · 0 citations
Conference Aug 2026

Representation-Aware Knowledge Distillation for Efficient Malware Family Classification

Malware family classification is an important cybersecurity task, but designing models that are both accurate and compact remains challenging due to malware obfuscation and computational constraints. This paper investigates efficient malware image classification by jointly considering byte-to-image representation, teac...

Minh-Quan Duong, T. Trần, Kieu-Oanh Nguyen-Ngoc et al. · 0 citations
Open access Sep 2026

TFC-MAL: APPLICATION OF TRIPLET LOSS FOR MALWARE DETECTION BASED ON IMAGE REPRESENTATION

Detecting polymorphic and zero-day malware remains a significant challenge due to the high similarity in characteristics between malicious variants and benign files, which reduces the effectiveness of traditional Cross-Entropy-based approaches. This paper proposes the TFC-MAL (Triplet-based Feature Compactness for Malw...

Dang Thi Mai, Hien Cong Dinh · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.