Image-Based Malware Family Classification: A Corrected, Controlled Comparison of CNN, CNN-to-LSTM and Fully Connected Networks

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.

Authors

Publication Details

Journal
Research Square
Published
2026-11-25
DOI
https://doi.org/10.21203/rs.3.rs-11817145/v1
Primary Topic
Advanced Malware Detection Techniques
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
preprint

Image-Based Malware Family Classification: A Corrected, Controlled Comparison of CNN, CNN-to-LSTM and Fully Connected Networks

Abiola Richie Imafidon
Research Square
Advanced Malware Detection Techniques
preprint

Image-Based Malware Family Classification: A Corrected, Controlled Comparison of CNN, CNN-to-LSTM and Fully Connected Networks

Abiola Richie Imafidon
preprint en

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.

Research Square
Advanced Malware Detection Techniques
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon