Abstract
Android malware detection typically relies on static analysis of program flows, yet existing methods often overlook the synergistic clues between different flow types or suffer from "semantic confusion" due to context-unaware graph modeling. We present MalFlows, a framework that integrates control, data, and inter-component communication (ICC) flows into a context-aware Heterogeneous Information Network (HIN). Using a novel embedding technique called flow2vec and a channel-attention fusion mechanism, MalFlows achieves 98.34% detection accuracy on a large-scale dataset of 31,301 apps. Our results demonstrate that context-aware graph refinement is critical, improving accuracy by over 14%, and that MalFlows exhibits superior resilience to app evolution over time.
Introduction
Modern Android malware detection frameworks generally categorize program flows into three types: control flows (execution logic), data flows (information movement from sources to sinks), and inter-component communications (ICC). Despite the richness of these data sources, current research faces two major hurdles. First, most tools analyze these flows in isolation, missing the synergistic patterns that emerge when they are combined. Second, standard graph-based models are often context-unaware; for instance, they might link a source API and a sink API simply because they reside in the same application, even if no actual data path connects them. This "semantic confusion" leads to inaccurate feature representations and increased false positives.
Methodology
The MalFlows architecture is divided into four primary stages: data collection, HIN construction, the flow2vec embedding process, and malware detection.
HIN Construction and flow2vec
After extracting raw flow features using tools like FlowDroid and IccTA, MalFlows models the relationships between apps, APIs, conditions, and components as a Heterogeneous Information Network (HIN). The core innovation, flow2vec, addresses the context-unawareness problem through Graph Refinement. By "cloning" nodes to ensure that links only exist if they are contextually valid (e.g., a specific source and sink are part of the same data-flow path), MalFlows prevents the model from learning impossible semantic paths.
Following refinement, the system utilizes "meta-path groups" to guide random walks. These groups combine content-oriented and action-oriented paths to capture a comprehensive view of app behavior. These walks are then processed via Skip-gram to generate vector representations.
Channel-Attention Fusion
The embeddings from the three distinct flow views (control, data, and ICC) are fed into a Deep Neural Network (DNN). A channel-attention mechanism dynamically weights these views, allowing the model to prioritize the flow type most indicative of malicious intent for any given sample.
Experimental Results
Performance and Accuracy
Evaluated on a dataset of 31,301 real-world apps (16,667 benign and 14,634 malware) from AndroZoo, MalFlows achieved an Accuracy of 98.34% and an F1-score of 0.9881. This performance significantly outperforms established baselines such as Drebin (93.97%), HinDroid (95.33%), and the LLM-based AppPoet (95.81%).
The Importance of Context
Ablation studies highlight the necessity of the Graph Refinement step. Removing this component caused detection accuracy to plummet from 98.34% to 84.30%, confirming that context-awareness is the primary driver of the system's success in resolving semantic confusion.
Resilience to App Evolution
MalFlows demonstrates remarkable stability against "app aging." While models trained on older data typically see performance degradation when applied to newer apps, MalFlows showed the slowest decline among all tested tools. This suggests that high-level flow semantics are more stable invariants than surface-level features like API names or strings.
Conclusion
MalFlows provides a robust solution for Android malware detection by leveraging the complementarity of heterogeneous program flows within a refined, context-aware HIN. While static analysis remains vulnerable to heavy obfuscation and dynamic code loading, the integration of context-aware embeddings and attention-based fusion sets a new benchmark for accuracy and longitudinal resilience in the field.
Summary updated