The Road Less Traveled: Investigating Robustness and Explainability in CNN Malware Detection

Matteo Brosolo, Vinod P, Mauro Conti · 2025

Read The Road Less Traveled: Investigating Robustness and Explainability in CNN Malware Detection by Matteo Brosolo, Vinod P, Mauro Conti (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2503-01391.txt.

Introduction

Matteo Brosolo, Vinod Puthuvath, and Mauro Conti study robustness and clarity in neural malware detectors in 2025. Convolutional networks sort malware images built from binary code with high accuracy. Their verdicts, though, read as black boxes to analysts.

The team pairs score analysis with three explanation tools that highlight the pixels driving each call. Obfuscation tricks cut accuracy by up to half in their tests. A counter-strategy restores much of the lost ground. Heatmap reading across tests yields a method to spot artifacts that fool the network. The work aims at detectors that analysts can both trust and audit.

Catalog record

CREATORMatteo Brosolo, Vinod P, Mauro Conti
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE46 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2503-01391

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

The Road Less Traveled: Investigating Robustness and Explainability in CNN Malware Detection Matteo Brosolo, Vinod P, Mauro Conti Abstract Machine learning has become a key tool in cybersecurity, improving both attack strategies and defense mechanisms. Deep learning models, particularly Convolutional Neural Networks (CNNs), have demonstrated high accuracy in detecting malware images generated from binary data. However, the decision-making process of these black-box models remains difficult to interpret. This study addresses this challenge by integrating quantitative analysis with explainability tools such as Occlusion Maps, HiResCAM, and SHAP to better understand CNN behavior in malware classification. We further demonstrate that obfuscation techniques can reduce model accuracy by up to 50%, and propose a mitigation strategy to enhance robustness. Additionally, we analyze heatmaps from multiple tests and outline a methodology for identification of artifacts, aiding researchers in conducting detailed manual investigations. This work contributes to improving the interpretability and resilience of deep learning-based intrusion detection systems. 1 Introduction Technology has rapidly evolved over the past decade, providing individuals and corporations with advanced tools tailored to their needs. However, this growth, along with widespread internet accessibility, has also created opportunities for cyber threats. The rapid increase in malware presents a major challenge for cybersecurity experts 1 1 1 Av-Test, Accessed 2023-5-15 . Its relentless growth shows no signs of abating, with a continuous surge in reported cases across both security and non-cybersecurity corporations, including government agencies. The mounting pressure on cybersecurity research has encouraged the creation of novel detection and classification techniques aimed at countering the escalating sophistication of modern malware [ 34 , 10 ] . Modern antivirus solutions rely on machine learning, especially deep learning techniques, to enhance threat detection and prevention. Beyond traditional signature-based detection, these advanced algorithms offer a novel approach to analyzing threats. One promising technique involves visualization, where a binary file is converted into an image to represent suspected malware. This approach enables the use of well-established computer vision tools and models for malware analysis [ 17 ] . Since Nataraj et al. [ 23 ] introduced malware visualization in 2011, researchers have developed various techniques to improve visual classifiers for classifying malware families, achieving state-of-the-art results on benchmark datasets [ 14 ] . However, many of these models have been adopted without a deep understanding of their decision-making processes. Most high-performing visual models rely on black-box architectures, such as Convolutional Neural Networks (CNNs), which offer strong predictive performance but lack interpretability. This lack of transparency poses challenges, especially when models fail or require modifications for new threats. When analyzing advanced malware, equipping human analysts with supportive tools—such as neural networks—enhances detection and response. A more interpretable system fosters smoother collaboration between humans and AI [ 26 , 1 ] . Beyond practical concerns, governments worldwide are increasingly prioritizing machine learning explainability to ensure fairness in decision-making [ 35 ] . In this study, we aim to assess the robustness of a state-of-the-art CNN classifier by evaluating its performance against a newly constructed dataset designed to test specific scenarios. We investigate how CNN classifiers respond to common adversarial tactics employed by malware developers, including obfuscation and packing. At each stage, we leverage interpretability tools, such as Class Activation Maps (CAMs) [ 37 ] , SHAP [ 15 ] values, and occlusion maps [ 36 ] to explain the reasons behind the model’s success or failure. Our findings demonstrate how these eXplainable Artificial Intelligence (XAI) [ 26 ] tools can benefit defenders in developing more resilient defenses and improving classifier performance. This study aims to answer the following research questions: • RO1 : How robust is a malware visualization CNN model when evaluated on a modern dataset with diverse malware samples? • RO2 : Can deep learning-based visualization models effectively detect obfuscated or packed malware, or do these techniques degrade their performance? • RO3 : How effectively do black-box interpretability tools (SHAP, HiResCAM, and occlusion) explain CNN predictions, and under what conditions do they produce conflicting interpretations of the model’s decision-making process? The contributions we made with this research are: 1. We introduced a new dataset designed to better represent emerging malware and its various forms as observed in the wild. 2. To assess the robustness of state-of-the-art CNN models, we conducted experiments using different dataset modifications. Specifically, we performed partial training and benchmarking on a standard dataset. Additionally, we proposed a simple dataset enhancement technique that improves accuracy on obfuscated malware by up to 30% without adding new samples. 3. To gain insights into the model’s classification process, we applied three different Explainable AI techniques and conducted an in-depth analysis of their results. This allowed us to identify varying levels of understanding within the CNN, based on the regions it highlights in the input samples. 2 Dataset When talking about malware classification on the Windows platform, which is by far the historically most targeted, two datasets emerge as the de facto standard used by researchers when benchmarking their models. This two datasets are called MalImg [ 23 ] and Big2015 [ 28 ] . We evaluate our model’s performance on benchmark datasets to demonstrate that it represents a state-of-the-art classifier. The primary difference between our model and the highest-performing visual malware classifiers lies in the additional techniques they employ, such as embedding extra information in images before training or using ensemble methods. For example, some techniques enhance classification performance by embedding metadata, such as file entropy. Others modify the visualization by applying transformations like color encoding, feature stacking, or multi-channel representations to highlight key malware characteristics. These approaches improve detection but are not the focus of our research, as they still rely on a well-performing CNN, similar to the one we developed. Analyzing such modifications would reduce generalizability and offer limited new insights to the field. After checking other datasets that still did not provided what needed, we decided to develop a dataset of our own. The results of our effort is VXZoo, which has been summarized in Table 2 . The fundamental principles guiding the development of this malware dataset included: 1. Incorporating new malware : As malware continuously evolves, we designed a dataset that represents current threats. MalImg and Big2015 are becoming outdated, and testing on them may no longer accurately reflect the behavior of modern malware variants; 2. Year-wise identification : To analyze how malware evolves, we included samples from different years whenever possible. This approach helps researchers evaluate classifier performance against malware that has mutated over time; 3. Maintaining imbalanced characteristics : Emulating the natural variation observed in the wild, where malware classes are not evenly distributed, we preserved the imbalanced nature of sample distribution. This decision aligns with the reality of cybersecurity threats, where certain malware classes are widespread, while others are more niche; 4. Ensuring variety in malware types : We designed the classifier to detect malware broadly rather than specializing in a specific type. While incorporating diverse malware samples, we ensured the model could distinguish between classes without overemphasizing differences between malware types; 5. No distinction between obfuscated and non-obfuscated malware : Instead of grouping all obfuscated malware into a single category, we treated obfuscated and non-obfuscated samples the same. Our goal was to ensure classifiers accurately identify malware classes, regardless

Read the complete text