An Opcode-Based Android Malware Detection Using Explainable Feature Selection and Global Graph Modeling
Abstract
Since Android is the mobile platform most targeted by malicious software, the accurate detection of new and evolving threats remains a critical challenge. Although deep learning-based malware detectors have improved detection performance, most existing methods rely on opaque models and provide limited interpretability, reducing their trustworthiness and practical adoption. In this study, we propose an Android malware detection framework based on static opcode analysis that integrates explainable AI (XAI)-based feature selection with a global class-based graph pruning strategy. Unlike existing opcode-based approaches that often truncate sequences or perform local pruning, our method analyzes individual Android Package (APK) opcode sequences from two complementary perspectives: a truncation-free opcode-to-image representation that preserves complete structural information, and an opcode transition graph that explicitly models opcode relationships. We introduce a two-stage XAI-guided feature selection mechanism in which gradient-based saliency maps identify discriminative opcode transitions that drive model predictions. Based on these transitions, we construct global class-specific opcode graphs for benign and malware applications, which are then used to prune APK graphs while retaining the structural patterns most indicative of class behavior. We evaluate the proposed framework on benchmark Android datasets, including Drebin, CICMalDroid 2020, and AndroZoo, and further validate it on Windows Portable Executable (PE) ransomware executables to demonstrate cross-platform generalization. Experimental results show that our model achieves up to 99.6% accuracy and a 99.5% F1 score on the Android datasets, and 99% accuracy on PE ransomware executables, outperforming representative opcode- and graph-based methods. These results highlight the transparent and behaviorally meaningful explanations provided by the proposed approach.