Image-Based Malware Family Classification: A Corrected, Controlled Comparison of CNN, CNN-to-LSTM and Fully Connected Networks
Year: 2026
Type: preprint
Abstract: Malware authors produce new variants by repacking and modifying existing code, yet variants of one family often keep a recognizable byte structure. Converting binaries into grayscale images lets standard image classifiers learn that structure without hand-crafted features. This study compares three neural-network designs on the same data: a convolutional neural network (CNN), a fully connected artificial neural network (ANN), and a CNN-to-LSTM pipeline in which a long short-term memory network classifies the CNN's outputs. The models were trained and validated on 8,684 images from nine Windows malware families and evaluated on a held-out test set of 2,176 images over three random seeds. The CNN achieved 94.24% ± 0.82% accuracy and a macro F1-score of 0.905 ± 0.019, while the ANN reached only 30.47% ± 3.46% accuracy and a macro F1-score of 0.112, close to always predicting the largest family. Adding the LSTM stage gave 94.73% accuracy against 94.19% for the same CNN code, a difference within seed-to-seed variation. Per-family results show near-perfect classification of Kelihos_ver3 (F1 0.995) and the weakest results for Simda, the smallest family, and for Tracur. The study also corrects an evaluation error in earlier master's thesis work on these models. Code, logs and evaluation scripts are publicly released.
Source: Research Square
Author: Abiola Richie Imafidon
Language: English
Subfield: Software
Field: Computer Science
Domain: Physical Sciences
Open Access status: green
OpenAlex ID: W7239804378
