arXiv:2610.25264cs.CROct 2026

Manuscript Offprint

arXiv:2610.25264

Federated Learning for Malware Image Classification under Data Heterogeneity

Victor Taiwo, Cemal Nisan, Muhammad Athallah, M. Emre Gursoy, Oznur Ozkasap

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Victor Taiwo 1^{1}, Cemal Nişan 1^{1}, Muhammad Athallah 2^{2}, M. Emre Gürsoy 1^{1}, and Öznur Özkasap 1^{1}

1^{1}Department of Computer Engineering, Koç University, Istanbul, Türkiye

2^{2}Informatics Institute, Istanbul Technical University, Istanbul, Türkiye

{vtaiwo25, cnisan21, emregursoy, oozkasap}@ku.edu.tr, athallah24@itu.edu.tr

Keywords: Federated learning, malware, malware image classification, data heterogeneity, entropy.

Abstract: Malware image classification (MIC), in which binary files are converted into visual representations and deep neural networks are trained to identify malware families, has recently emerged as an effective approach for malware detection. Federated learning (FL) enables malware image classifiers to be trained collaboratively by multiple clients without sharing raw data. However, a fundamental challenge in FL is data heterogeneity (non-IID), which is particularly relevant but understudied in the malware context. In this paper, we address this gap via three contributions. First, we present an empirical study of federated MIC under varying degrees of data heterogeneity across three popular malware image datasets (MalImg, Virus-MNIST, and MalNet). We show that while FL achieves strong accuracy under IID conditions, both accuracy and training stability degrade as data becomes increasingly non-IID. Second, we introduce a set of round-level statistics that characterize the data contributed by participating clients in each FL round, and demonstrate that class entropy (diversity of class labels present in a given round) exhibits strong positive correlation with global model accuracy. Third, leveraging this insight, we propose an entropy-aware client selection strategy that filters candidate client subsets based on class entropy, and show that our strategy outperforms standard random selection. Our results highlight the role of client composition in federated MIC and underscore the importance of distribution-aware classifier training under data heterogeneity.

1 Introduction

Malware continues to pose a major threat to modern computing systems, with attacks growing in scale, diversity, and sophistication. Deep learning-based approaches are actively being developed for malware detection and classification, particularly using image-based representations of binaries (Gibert et al., 2020; Freitas et al., 2022; Brosolo et al., 2024). In this line of work, often termed malware image classification (MIC), binary files are transformed into visual representations (images) and vision models (e.g., convolutional neural networks) are trained to identify structural patterns associated with different malware families (Nataraj et al., 2011; Vasan et al., 2020a; Vasan et al., 2020b; Kumar and Janet, 2022; Tekerek and Yapici, 2022).

Despite their effectiveness, conventional deep learning approaches require aggregating data from multiple sources into a single location. In the context of malware classification, such data collection raises significant privacy, security, and regulatory concerns, since the raw data of a client may reveal sensitive information about installed software, system vulnerabilities, and malware infections. Here, federated learning (FL) (McMahan et al., 2017) provides a compelling solution by enabling clients to collaboratively train a malware classifier without sharing their data. In FL, clients locally train models using their own data and transmit only the updated model weights to the FL server that coordinates the training process, aggregates local updates and computes the weights of the global model. Indeed, successful approaches applying FL to malware image classification have recently been proposed (Abdel-Basset et al., 2022; Ambekar et al., 2025).

However, a fundamental challenge in FL is data heterogeneity, where client data is non-independent and identically distributed (non-IID). This issue is particularly pronounced in malware-related applications, as different client devices (e.g., personal devices running different operating systems, enterprise systems, IoT devices) are exposed to distinct threats and malware, resulting in highly imbalanced data and skewed class distributions. While non-IID data is a known challenge in FL (Li et al., 2020b; Li et al., 2022; Karimireddy et al., 2020; McMahan et al., 2017), there is limited coverage or consideration of it in the MIC context.

To address this gap, in this paper, we first present an extensive empirical study of federated MIC under varying degrees of data heterogeneity (non-IID) and datasets. Using three popular malware image datasets (MalImg, Virus-MNIST, and MalNet), we show that FL can achieve strong performance under IID conditions, but its accuracy and stability degrade as data becomes increasingly non-IID. Second, we introduce a set of round-level statistics (metrics) to characterize the data contributed by participating clients in each FL round, and demonstrate that these statistics (in particular, class entropy) are correlated with model accuracy. Third, we leverage this insight to design an entropy-aware client selection strategy that improves the accuracy of federated malware image classifiers over standard random selection. Overall, our methods and results provide new insights into the role of client composition in FL of malware image classifiers, and highlight the importance of distribution-aware training strategies under data heterogeneity.

The rest of this paper is organized as follows. We survey related work in Section 2. Preliminaries for MIC, FL, and our problem statement are provided in Section 3. Our methods, including the proposed round-level statistics and entropy-aware client selection strategy, are described in Section 4. Experiment results and related analyses are presented in Section 5, followed by conclusions in Section 6.

References (30)