Accurate malware family classification from dynamic sandbox reports continues to be a fundamental cybersecurity challenge. Most prior works depend on random splits that tend to overestimate accuracy, whereas deployment requires robustness under temporal drift as well as changing behaviors. We present a leakage-aware pipeline that transforms CAPEv2 sandbox JSON reports into structured visual heatmaps and evaluate models under stratified and chronological splits. The pipeline rigorously flattens behavioral keys, builds normalized representations, and benchmarks Random Forest, MLP, CNN64, HybridNet, and a modern ResNeXt-50 backbone. On the Avast–CTU CAPEv2 dataset containing ten malware families, Random Forest achieves nearly state-of-the-art accuracy (97.2% accuracy, 0.993 AUC) with high efficiency on CPUs, making it attractive for triage. ResNeXt-50 achieves the best overall performance (98.4% accuracy, 0.998 AUC) and provides visual interpretability via Grad-CAM, enabling analysts to verify predictions. We further quantify efficiency trade-offs (inference throughput and GPU memory) and report ablation studies on vocabulary size and keyset choices. These results affirm that though ensemble methods are still robust, heatmap-based CNNs provide better accuracy, interpretability, and robustness against drift.
The ever-evolving nature of malware renders conventional detection techniques increasingly ineffective against adaptive threats. This work proposes a behavior-driven detection framework that converts dynamic sandbox reports into human-readable narratives and learns semantic patterns with a fine-tuned BERT model. The narrative transformation captures higher-order relations among system activities (e.g., process creation, registry persistence, and network communication), enabling contextual representation beyond handcrafted features. Validation was conducted on both a controlled Cuckoo-based benchmark (binary) and the large-scale public Avast–CTU CAPEv2 dataset (ten malware families). On CAPEv2, the method achieved 96.2% accuracy and 95.8% macro-F1 under chronological partitioning, and strong performance under 5-fold cross-validation, outperforming TF–IDF +SVM baselines. Robustness studies with textual perturbations (token masking and synonym substitution at 5–20%) and time-aware evaluation indicate resilience to obfuscation and temporal drift. An ablation analysis shows that narrative-based modeling improves accuracy by ≈12 percentage points over raw feature baselines and by ≈5 points over TF–IDF representations, highlighting the contribution of semantic abstraction. Besides accuracy, the approach can provide practical interpretability: the predictions can be traced back to behavioral descriptive indicators, allowing analyst auditability and forensic use. These results show that behavioral data contextualized language modeling is a scalable, explainable, and generalizable next-generation basis for malware detection.