BinCtx: Multi-Modal Representation Learning for Robust Android App Behavior Detection

Zichen Liu, Shao Yang, Xusheng Xiao · DOI

Abstract

Detecting malicious Android applications and "undesired behaviors"—such as deceptive payments or disruptive advertisements—is increasingly difficult due to sophisticated obfuscation and the limitations of traditional permission-based filters. This paper introduces BinCtx, a multi-modal learning framework that fuses three distinct views of an application: its raw bytecode "texture," its execution context, and its third-party SDK usage patterns. BinCtx achieves a 94.73% macro $F_1$-score, significantly outperforming state-of-the-art systems while remaining remarkably resilient to commercial-grade obfuscation and adversarial attacks.

Introduction

The landscape of Android security is a constant cat-and-mouse game. Modern malware and "potentially unwanted apps" (PUAs) have evolved to bypass traditional detectors that rely on dangerous permission requests or simple code signatures. The authors identify four primary challenges:

  1. Permission Blindness: Many undesired behaviors do not require "dangerous" permissions.
  2. Contextual Gaps: Tools often fail to model the specific events (e.g., background services vs. user actions) that trigger behaviors.
  3. Weak Commonality: Undesired behaviors are often linked to diverse third-party SDK usage rather than shared code families.
  4. Evasion: Obfuscation and adversarial code injection can easily blur features used by single-modal detectors.

The BinCtx Framework

BinCtx addresses these challenges by constructing a multi-modal representation of an app through three parallel feature extraction modules.

BinCtx System Architecture: Training and Prediction Phases.
  • Bytecode-as-Image (Visual View): The entire classes.dex file is converted into an RGB image by treating hex digits as pixel values. This captures structural "textures" and family-style patterns, which are then processed via a pre-trained DenseNet.
  • Contextual Information (Trigger View): This module parses AndroidManifest.xml for components and intent actions, and scans for hardcoded URL/IP constants to determine where and when an app communicates.
  • Third-Party Library Usage (SDK View): By building an Inter-Component Call Graph (ICCG), BinCtx quantifies interactions with external services (e.g., AdMob, PayPal), focusing on reachable code paths.

These embeddings are concatenated and classified using a Multi-Layer Perceptron (MLP). This fusion ensures that even if one modality (like bytecode) is obfuscated, others provide sufficient signal for detection.

Texture as a Fingerprint

A key insight of BinCtx is that even when identifiers are renamed or code is moved, the global "texture" of a malware family's bytecode remains visually distinct.

Visual patterns of different malware families (Fusob and Mecor) converted from bytecode.

This visual representation provides a cue that is resilient to local code changes. Furthermore, by using ICCGs to track SDK usage, BinCtx naturally ignores "dead code" injected by attackers, as those paths are unreachable from the app's entry points.

Experimental Results

The framework was evaluated on a dataset of approximately 18,000 apps, including malware families (FakeInst, Fusob, Mecor), apps with undesired behaviors (Ad Disruption, Payment Deception), and benign apps. Notably, over 90% of the malicious samples were already obfuscated.

  • Accuracy: BinCtx achieved a macro $F_1$ of 94.73%, outperforming the strongest baseline, DeepRefiner, by nearly 15%.
  • Obfuscation Resilience: Against commercial-grade reinforcement tools, BinCtx maintained an 84% $F_1$-score, while bytecode-only systems degraded significantly.
  • Adversarial Robustness: In the face of dead code injection, BinCtx achieved 77.17% $F_1$, nearly doubling the performance of state-of-the-art baselines like CodeImage (44%).

Conclusion

BinCtx demonstrates that redundancy is a powerful feature in app behavior detection. While static analysis still faces hurdles like reflection and dynamic loading, the multi-modal approach significantly raises the bar for attackers. Future work will explore multi-scale encoders and de-reflection techniques to further enhance robustness against advanced evasion.

Summary updated

BibTeX
@misc{liu2025binctx,
  author = {Zichen Liu and Shao Yang and Xusheng Xiao},
  title = {{BinCtx: Multi-Modal Representation Learning for Robust Android App Behavior Detection}},
  year = {2025},
  eprint = {2510.14344},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.14344},
}
Figure