AiDroid: When Heterogeneous Information Network Marries Deep Neural Network for Real-time Android Malware Detection

Yanfang Ye, Shifu Hou, Lingwei Chen, Jingwei Lei, Wenqiang Wan, Jiabin Wang, Qi Xiong, Fudong ShaoarXiv 2018

Abstract

The explosive growth and increasing sophistication of Android malware call for new defensive techniques that are capable of protecting mobile users against novel threats. In this paper, we first extract the runtime Application Programming Interface (API) call sequences from Android apps, and then analyze higher-level semantic relations within the ecosystem to comprehensively characterize the apps. To model different types of entities (i.e., app, API, IMEI, signature, affiliation) and the rich semantic relations among them, we then construct a structural heterogeneous information network (HIN) and present meta-path based approach to depict the relatedness over apps. To efficiently classify nodes (e.g., apps) in the constructed HIN, we propose the HinLearning method to first obtain in-sample node embeddings and then learn representations of out-of-sample nodes without rerunning/adjusting HIN embeddings at the first attempt. Afterwards, we design a deep neural network (DNN) classifier taking the learned HIN representations as inputs for Android malware detection. A comprehensive experimental study on the large-scale real sample collections from Tencent Security Lab is performed to compare various baselines. Promising experimental results demonstrate that our developed system AiDroid which integrates our proposed method outperforms others in real-time Android malware detection. AiDroid has already been incorporated into Tencent Mobile Security product that serves millions of users worldwide.

Introduction

Android malware is becoming increasingly sophisticated, often employing "on-demand" execution and other evasion tactics to bypass traditional scanners. While graph-based methods—specifically Heterogeneous Information Networks (HINs)—are excellent at capturing complex ecosystem relationships (e.g., developer affiliations or device co-occurrence), they face a significant hurdle: the out-of-sample problem. In a real-time environment, thousands of new apps arrive every hour. Traditional graph embedding techniques require rerunning the entire embedding process for the whole network to incorporate a single new node, which is computationally prohibitive for real-time detection.

The AiDroid Framework

To address these challenges, we propose AiDroid, a real-time malware detection system that combines the relational power of HINs with the classification prowess of Deep Neural Networks (DNNs). The system follows a three-stage pipeline:

  1. HIN Construction: The Android ecosystem is modeled as a graph with five entity types (App, API, IMEI, Signature, Affiliation) and six types of relations. Semantic meaning is captured through "meta-paths" (e.g., App $\xrightarrow{Invoke}$ API $\xrightarrow{Invoke^{-1}}$ App) to identify relatedness between apps.
  2. HinLearning: This is the system's core innovation. Instead of recomputing the entire graph, it uses HINE to learn embeddings for existing (in-sample) nodes. For new (out-of-sample) apps, the Hin2Img method finds the app's $k$-order neighbors and aggregates their pre-computed embeddings into a matrix. This matrix acts as a relational "image" of the app's neighborhood.
  3. DNN Classifier: This neighborhood image is fed into a DNN utilizing an Inception module. This architecture allows the model to capture features at multiple scales, which is highly effective for identifying subtle patterns of malicious behavior.
Overview of the developed system AiDroid for real-time Android malware detection.

HinLearning: Bridging Graphs and Deep Learning

HinLearning proves that you don't need to re-optimize the entire global manifold to understand a new node; you just need to look at its immediate relational neighbors. By representing a node's neighborhood as a matrix, we bridge the gap between graph theory and computer vision. This allows the use of highly optimized Convolutional Neural Network (CNN) architectures for non-image data, enabling high-quality embeddings for newly arrived apps in milliseconds.

HinLearning: representation learning of in-sample and out-of-sample nodes in HIN.

Experimental Evaluation

We conducted a comprehensive study using a massive, real-world dataset provided by Tencent Security Lab, featuring over 190,000 apps for training and nearly 18,000 newly arrived apps to simulate real-time conditions. The resulting HIN contained 286,421 nodes and over 4.1 million edges.

Key Results

AiDroid significantly outperformed standard baselines like DeepWalk, LINE, and metapath2vec:

  • Accuracy: Achieved 99.08% accuracy, surpassing the theoretical upper bound of traditional "rerunning" methods.
  • Efficiency: The average prediction time was only 4.3 ms per app, making it truly viable for real-time deployment.
  • Production Success: The system has been integrated into the Tencent Mobile Security product, serving millions of users worldwide.

Conclusion

AiDroid demonstrates that the marriage of HINs and DNNs provides a robust and efficient solution for modern Android malware detection. By solving the out-of-sample problem through HinLearning, the system maintains high performance in dynamic, large-scale environments. Future work will focus on automated meta-path discovery and enhancing resilience against adversarial metadata spoofing.

Summary updated

BibTeX
@misc{ye2018aidroid,
  author = {Yanfang Ye and Shifu Hou and Lingwei Chen and Jingwei Lei and Wenqiang Wan and Jiabin Wang and Qi Xiong and Fudong Shao},
  title = {{AiDroid: When Heterogeneous Information Network Marries Deep Neural Network for Real-time Android Malware Detection}},
  year = {2018},
  eprint = {1811.01027},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1811.01027},
}
Figure