Detecting Android Malware by Visualizing App Behaviors From Multiple Complementary Views

Zhaoyi Meng, Jiale Zhang, Jiaqi Guo, Wansen Wang, Wenchao Huang, Jie Cui, Hong Zhong, Yan Xiong

TL;DR

LensDroid is a new deep-learning framework that detects Android malware by "looking" at apps from three different perspectives: their API call relationships, their instruction sequences, and the raw layout of their binary files. By fusing these complementary visualizations using a sophisticated attention-based neural network, LensDroid achieves a 98.3% detection accuracy and proves remarkably resilient to "aging"—the tendency for security tools to become less effective as malware evolves over time.

What Problem Does This Paper Address?

Android malware is a moving target. Modern attackers no longer just hide malicious logic in standard Java code; they bury it in native libraries (.so files), manipulate configuration files (.xml), or use sophisticated obfuscation to bypass traditional scanners.

Existing detection methods often suffer from "tunnel vision." Some look only at API calls, others only at bytecode, and many rely on manual feature engineering that is both labor-intensive and easily defeated by new attack patterns. Furthermore, many models suffer from performance decay: a detector trained on 2018 malware often fails miserably against 2022 threats because the "vocabulary" of the apps has changed. The authors sought a way to capture the "holistic" behavior of an app in a way that remains stable even as the Android ecosystem evolves.

Methods

The core innovation of LensDroid is its multi-view visualization strategy. Instead of picking one feature, it transforms three distinct aspects of an app into formats that deep learning models excel at processing:

  1. Behavioral Sensitivities (API Callgraphs): The authors don't just map raw APIs. They abstract them into "sensitivity representations" based on their required permissions and protection levels. This makes the model resilient to API name changes across Android versions. These are processed using a Graph Convolutional Network (GCN).
  2. Operational Contexts (Opcode-gram Matrices): They extract the sequence of operations (opcodes) from the app's assembly-like smali code. By using a sliding window to create "opcode-grams," they capture the local context of how code actually executes. This is processed via a TextCNN.
  3. Supported Environments (Binary Artifacts): This is perhaps the most "visual" part. They take the .dex, .xml, and .so files and map them to the Red, Green, and Blue channels of an RGB image. Crucially, they denoise these files by stripping out headers and metadata, focusing the model purely on the data areas. This is processed using ConvNeXt, a state-of-the-art image recognition model.

Finally, LensDroid uses a stepwise fusion strategy. It first uses Multi-modal Factorized Bilinear (MFB) pooling to model interactions between pairs of views, then applies a Multi-head Self-Attention mechanism to weight which view is most important for a specific app before making a final "Benign or Malicious" judgment.

Datasets

The researchers evaluated LensDroid on a massive dataset of 51,165 apps collected from:

  • AndroZoo: A well-known repository of millions of Android apps.
  • Drebin: A classic benchmark dataset for malware research.

The data spans two distinct eras: 2010–2012 (the "old school" malware) and 2018–2022 (modern threats). This temporal spread allowed them to test how well the model handles the evolution of malware over a decade.

Key Insights and Ideas

  • The Power of Denoising: One of the most interesting findings was that "raw" binary images are noisy. By parsing the file structures and removing headers/metadata (which are often similar across all apps), the model's accuracy jumped significantly. It forced the neural network to look at the content of the code rather than the container.
  • Complementarity is Essential: The authors proved that no single view is enough. For example, image-based detection is great for spotting malicious native code in .so files but struggles with Java-based logic. By combining all three, LensDroid covers the blind spots of each individual method.
  • Resilience to Aging: Because LensDroid abstracts APIs into functional "sensitivities" rather than just tracking specific names, it maintains high performance even when tested on apps released years after its training data.

Key Results

  • Top-Tier Accuracy: LensDroid achieved an overall 98.3% accuracy and F1-score of 0.983, outperforming established baselines like Drebin, MaMaDroid, and LBDB.
  • Zero-Day Detection: In a scenario involving entirely new, "zero-day" malware families, LensDroid maintained a 93.2% accuracy, whereas some baseline models saw their performance crater.
  • Robustness Over Time: In "App Evolution" tests (measuring Area Under Time), LensDroid maintained a 99.2% recall rate over 48 months, showing almost no decay in its ability to spot new malware compared to traditional methods.
  • Efficiency: Despite the complexity, the total runtime to analyze an app is roughly 9.1 seconds, making it practical for real-world app store triaging.

Limitations and Future Work

The authors acknowledge a few hurdles:

  • Static Analysis Limits: LensDroid relies on static analysis (looking at the code without running it). It could potentially be fooled by advanced dynamic code loading or heavy encryption that only unpacks at runtime.
  • The "Black Box" Problem: While they used tools like Grad-CAM to visualize what the model "sees," deep learning is still less intuitive for human analysts than a simple list of "if-then" rules.
  • Future Directions: The team plans to explore hybrid analysis (combining static views with dynamic runtime behavior) and "disentangled representation learning" to make the features even more robust against intentional obfuscation.

Summary updated

BibTeX
@article{meng2025detecting,
  author = {Zhaoyi Meng and Jiale Zhang and Jiaqi Guo and Wansen Wang and Wenchao Huang and Jie Cui and Hong Zhong and Yan Xiong},
  title = {{Detecting Android Malware by Visualizing App Behaviors From Multiple Complementary Views}},
  journal = {IEEE Trans. Inf. Forensics Secur.},
  year = {2025},
  doi = {10.1109/tifs.2025.3547301},
}
Figure