A novel technique for ransomware detection using image based dynamic features and transfer learning to address dataset limitations
- PMID: 40897752
- PMCID: PMC12405504
- DOI: 10.1038/s41598-025-17647-1
A novel technique for ransomware detection using image based dynamic features and transfer learning to address dataset limitations
Abstract
The increasing frequency of ransomware attacks necessitates the development of more effective detection methods. Existing image-based ransomware detection approaches have largely focused on static analysis, overlooking specialized ransomware behaviors such as encryption, privilege escalation, and system recovery disruption. Although dynamic and memory forensics-based visualization methods exist in the broader malware domain, they primarily target generic malware families and often rely on memory dumps or system snapshots without transforming behavioral features into spatially meaningful representations. Moreover, traditional machine learning methods such as Random Forest (RF), Support Vector Machine (SVM), and K-Nearest Neighbors (KNN) typically depend on manual feature engineering and large labelled datasets, limiting scalability and adaptability. To address these limitations, we propose a novel behavior-to-image ransomware detection framework that transforms dynamic behavioral features extracted from sandbox-generated JSON reports into two-dimensional (2D) grayscale and color image representations, optimized for transfer learning (TL), enabling effective classification under small-data conditions. Our approach integrates domain-specific feature filtering and impact analysis to ensure the selection of the most ransomware-relevant attributes. TL subsequently automates feature extraction and classification, eliminating the need for separate feature selection procedures and overcoming the time-consuming process of manual feature engineering. Furthermore, by leveraging prior knowledge from large-scale image datasets, TL significantly mitigates the need for extensive labelled data while maintaining high detection accuracy and strong generalization. Experimental results demonstrate that fine-tuned pretrained models, notably ResNet50, achieve up to 99.96% accuracy with a minimal loss factor of 0.0026, even with a small dataset of 500 ransomware and 500 benign samples. We further validated the model's interpretability through t-SNE visualizations and saliency maps, confirming its ability to focus on class-discriminative behavioral patterns. The low misclassification rate, along with the transparency of the model, highlights its potential for practical deployment in ransomware detection systems.
Keywords: Convolutional neural network; Dynamic analysis; Image classification; Portable executable (PE); Pretrained models; Ransomware; Transfer learning.
© 2025. The Author(s).
Conflict of interest statement
Declarations. Competing interests: The authors declare no competing interests.
Figures
References
-
- Yu, Z., Kaplan, Z., Yan, Q. & Zhang, N. Security and privacy in the emerging cyber-physical world: A survey. IEEE Commun. Surv. Tutorials. 23 (3), 1879–1919. 10.1109/COMST.2021.3081450 (2021). - DOI
-
- Jean, B. L. & Tour Howden’s 2024 Cyber Insurance Report- Risk, Resilience and Relevance. (Accessed 05 November 2024). https://www.howdengroupholdings.com/reports/2024-cyber-report (2024).
-
- SOPHOS. Ransomware Payments Increase 500% In the Last Year, Finds Sophos State of Ransomware Report. (Accessed 12 November 2024). https://www.sophos.com/en-us/press/press-releases/2024/04/ransomware-pay... (2024).
-
- Ferdous, J., Islam, R., Mahboubi, A. & Islam, M. Z. A Review of State-of-the-Art Malware Attack Trends and Defense Mechanisms. IEEE Access11, 121118–121141. 10.1109/access.2023.3328351 (2023). - DOI
-
- Sophos Maturing criminal marketplaces present new challenges to defenders, Sophos 2023 Threat Report. (Accessed 21 September 2024). https://www.scribd.com/document/628559505/Sophos-Threat-Report-2023 (2023).
LinkOut - more resources
Full Text Sources
