Abstract
Cybercriminals use advanced techniques to launch an attack against organizations, which causes disruption of normal business activities. The traditional signature-based malware detection methods are not effective in the detection of ransomware. Therefore, the use of machine learning and deep learning for malware detection is becoming a major area of research. There are two types of malware detection strategies, namely, static and dynamic. This work investigates the task-dependent effectiveness of static PE header-based detection by systematically evaluating three binary classification problems of increasing difficulty: ransomware vs. benign, malware vs. benign, and ransomware vs. other malware families. An end-to-end machine learning pipeline is implemented, including dataset-specific preprocessing, class imbalance handling, model training, and evaluation using imbalance-aware metrics. Random Forest, Support Vector Machine, and XGBoost models are assessed across all tasks, with SHAP used to analyze feature contribution and explain performance degradation. The experimental results demonstrate that tree-based ensemble models, particularly XGBoost, achieve strong detection performance when class boundaries are structurally distinct, but they struggle when ransomware must be distinguished from structurally similar malware. The results indicate that static analysis based on PE header features can be a viable approach for pre-execution triage, but they exhibit clear limitations for fine-grained ransomware discrimination.
1. Introduction
The growing spread of ransomware attacks poses a serious challenge to the security and functioning of modern society. These attacks have the ability to disrupt critical services and cause extensive financial and operational damage. Due to these increasingly sophisticated cyberattacks, traditional signature-based detection approaches struggle to keep up, making machine learning-based detection a major area of research. By learning patterns from large collections of binaries, machine learning approaches offer the ability to generalize beyond fixed signatures and detect previously unseen threats.
In machine learning detection, features can be extracted either dynamically or statically. Dynamic analysis observes program behavior during execution and can capture detailed runtime characteristics, while static analysis extracts structural information from binary artifacts without execution. Each approach presents trade-offs. Dynamic analysis offers richer behavioral insight but requires greater computational resources and controlled execution environments, whereas static analysis enables scalable inspection but may be limited by feature overlap across malware families. As recent work has shown, static analysis remains an effective and lightweight representation for malware detection in large-scale and resource-constrained settings [1]. However, the extent to which static PE header features generalize across different malware detection tasks remains unclear. This paper aims to characterize these limitations by evaluating static detection across multiple classification settings.
The present work creates an end-to-end learning pipeline for static analysis across three different binary classification problems: ransomware vs. benign, malware vs. benign, and ransomware vs. other malware families. While earlier studies have demonstrated the effectiveness of static feature-based ransomware detection [2], most evaluations focus on a single dataset [3] or fail to provide interpretable feature analysis [4], leaving the generalization of static PE header features across different classification tasks unclear. To address this gap, this research evaluates three classification scenarios with increasing difficulty and individual dataset preprocessing strategies to account for differences in feature distributions. Class imbalance is addressed through both data-level (SMOTE) and model-level (class weighting) techniques, ensuring that minority ransomware classes receive equal influence during training. In addition, this work evaluates models using metrics designed for imbalanced classification, including Matthews Correlation Coefficient (MCC) and precision–recall AUC, which provides a more realistic idea of detection reliability. For interpretability, SHAP is used to understand model decisions across datasets, offering insight into the structural limitations of PE header features and why certain classification tasks remain challenging.
The rest of this paper is organized as follows. Section 2 covers related work. The details of the research methodology appear in Section 3. Section 4 covers the details of the experiment and the results. In Section 5, we discuss the results and provide directions for future research. In Section 6, limitations are discussed. Finally, in Section 7, we conclude the research.
2. Related Work
Early research into ransomware detection established the efficacy of classical machine learning. Abedin et al. [5] evaluated several machine learning algorithms, including decision tree, Random Forest, Support Vector Machine (SVM), K-Nearest Neighbor (KNN), Logistic Regression, and Convolutional Neural Network, demonstrating high detection accuracy using static features. Similar research has been reported by Pal et al. [6], who incorporate feature extraction and Principal Component Analysis (PCA) to identify the most effective machine learning model for real-time, scalable, and accurate malware detection. These studies primarily focus on task-specific datasets, providing strong evidence for effectiveness but leaving open questions regarding generalization across multiple detection scenarios.
Nagendrababu et al. [7] and Akinshola-Awe et al. [8] reported their experience of machine learning techniques in malware detection. The researchers evaluated various models such as Support Vector Machine, K-Nearest Neighbor, and decision tree. Their studies evaluated model performance using confusion matrix, precision, recall, and F1 score. These studies achieve high performance and contribute to understanding model behavior, but the evaluation protocol does not explicitly address class imbalance, potentially biasing performance metrics toward the majority class.
Malware detection using PE header features has been widely explored, with early work demonstrating that classical machine learning models are effective for this task. Rezaei et al. [9] showed that traditional classifiers such as SVM, Naïve Bayes, and J48 achieve strong performance when paired with careful feature engineering, highlighting the importance of feature selection when the goal is accurate malware classification. Other studies have expanded beyond binary detection to multi-class classification of ransomware. Vehebovic et al. [10] developed a framework that identifies specific ransomware families by analyzing a small set of PE header features. Their research demonstrates that static analysis can achieve strong performance for zero-day-style evaluation settings, even with limited sample sizes.
More recent studies have evaluated whether deep learning provides benefits over classical approaches, specifically in ransomware static analysis settings. Wadho et al. [11] tested classical models such as Logistic Regression, Random Forest, and XGBoost against deep learning architectures, including MLP and TabNet, using PE header features for ransomware detection. Their results show that, when limited to static features, deep learning does not substantially outperform classical models. However, their analysis focuses on a single dataset and does not assess how preprocessing pipelines and class imbalance could affect model generalization.
Across the literature, static ransomware detection using PE header features has demonstrated strong performance within controlled experimental settings. However, many studies rely on single or closely related datasets that can introduce data leakage or family overlap, leading to overly optimistic performance estimates. In addition, when dealing with class imbalance, metrics such as accuracy can overinflate results [12]. These limitations motivate the need for a systematic evaluation of detection models across diverse datasets and the use of imbalance-aware metrics to avoid misleading performance estimates led by majority bias.
3. Materials and Methods
This analysis follows a supervised machine learning approach for static malware and ransomware detection based on Portable Executable (PE) header attributes. Three binary classification problems are evaluated: ransomware vs. benign software (Dataset 1), malware vs. benign software (Dataset 2), and ransomware vs. other malware families (Dataset 3). The methodology includes dataset preparation, preprocessing and feature engineering, class imbalance handling, model training, and evaluation.
3.1. Datasets and Problem Definitions
Three datasets in CSV format were used, each containing PE header metadata. Although the datasets differ in size and labeling conventions, all are publicly available to support reproducibility and contain static fields extracted from Windows executable files.
3.1.1. Ransomware vs. Benign (Dataset 1)
Dataset 1 was obtained from a publicly available Kaggle repository [13], containing approximately 62,405 samples with 18 PE header attributes. It provides a balanced number of benign and ransomware samples (57% ransomware, 43% benign). The attributes include CPU architecture codes, identifiers, and a binary label (Benign). This dataset is ideal for ransomware classification as it offers well-labeled PE header features with no missing values.
3.1.2. Malware vs. Benign (Dataset 2)
Dataset 2 was sourced from the public GitHub repository [14], containing approximately 19,000 samples with 78 PE header attributes, with 75% of the samples being malware from multiple families (e.g., trojans, downloaders) and 25% being benign samples. The dataset supports a general malware classification task and tests whether models can generalize beyond ransomware patterns.
3.1.3. Ransomware vs. Malware (Dataset 3)
Dataset 3 was sourced from a public GitHub repository maintained by malware researchers [15], containing PE malware samples collected from MalwareBazaar. Malware family labels were assigned using VirusTotal API results, where samples were categorized into families based on majority voting across antivirus engine detections. It contains 18,500 samples with 54 PE header attributes, with 87% being common malware families (e.g., trojans, downloaders) and 13% being ransomware samples. Since both classes share similar PE header structures, this dataset tests whether the models can pick up on subtle differences to distinguish ransomware files from common malware families.
3.2. Preprocessing and Feature Engineering
All datasets followed a similar preprocessing pipeline. Identifier fields and columns containing a single constant value were removed prior to model training, as they provide no discriminative information. Specifically:
- Dataset 1: FileName, md5Hash;
- Dataset 2: Name, e_magic;
- Dataset 3: SHA256.
Dataset 1 encoded benign samples using the value “1”; to maintain a consistency across all datasets, where “1” denotes the malicious class, this label was inverted during preprocessing, and a new ransomware target variable was created. All remaining features were confirmed in a compatible format, integers and Boolean values for the tree-based models, and strictly integer-valued features for Support Vector Machine (SVM).
Each dataset included a machine architecture field stored as an integer code (e.g., 332 for x86 architecture and 34404 for x64). To avoid the model interpreting these values as continuous magnitudes, the field was label-encoded and expanded into separate Boolean indicator columns.
Dataset 3 required additional preprocessing. Highly correlated attributes (correlation > 0.95), SizeOfOptionalHeader and Magic, were removed to reduce redundancy prior to model training. Several skewed size and address-related PE header fields were log-transformed using log1p to stabilize numerical ranges for models sensitive to scale, such as SVM. The exact list of transformed features is provided in Appendix A. The Malware_Type label was lowercased and mapped to the target binary ransomware label; the original text column was removed.
Standardization was applied only for SVM, using statistics computed on the training split and applied to the test split to avoid data leakage. The complete processing and modeling workflow is illustrated in Figure 1, which summarizes data preparation, class rebalancing, model development, and evaluation for all three classification tasks.
Figure 1.
System architecture of the proposed static ransomware detection pipeline, illustrating dataset-specific preprocessing, cross-validated hyperparameter tuning, and final evaluation on a held-out test set.
3.3. Handling Class Imbalance
Datasets 2 and 3 exhibited class imbalance, with malware representing 25% of samples in Dataset 2 and ransomware representing 13% of samples in Dataset 3. To mitigate potential majority class bias, model adjustments were applied across all datasets.
For XGBoost, the weight of the minority class was increased using scale_pos_weight, which makes the model treat errors on the minority class as more severe, preventing it from defaulting to predicting only the majority class. SVM used its built-in class-balanced mode for the same reason, ensuring both models remain sensitive to ransomware instances during training. For Random Forest, class weighting was applied for Dataset 3 only, where it improved performance under MCC-based evaluation without increasing false negatives; default weighting was retained for the remaining datasets.
3.4. Train–Test Split Validation
All datasets were split using a 60% training/40% test ratio, stratified by class to preserve the distribution ratios. The test set was held out exclusively for final evaluation and was not used during model selection. Hyperparameter optimization for all models was performed using 5-fold stratified cross-validation on the training data only.
To assess robustness under temporal drift, an additional chronological evaluation was performed on datasets containing TimeDateStamp metadata (Datasets 2 and 3). For these datasets, samples were sorted by timestamp and split using the same train/test ratio, with earlier samples assigned to training and later samples reserved for testing. Dataset 1 did not include reliable temporal metadata and, therefore, could not be evaluated under this protocol. Because PE timestamps may be manipulated or contain anomalous values, this chronological split should be interpreted as an approximate assessment of temporal robustness rather than a definitive deployment simulation.
3.5. Model Selection
Three classification models were trained for this experiment: Random Forest (RF), XGBoost (XGB), and Support Vector Machines (SVM). All models used standard implementations from scikit-learn, with XGBoost implemented using the XGBoost library.
Random Forest creates multiple decision trees and combines their outputs, which helps reduce variance in the final prediction. XGBoost combines decision trees sequentially to improve the model’s performance. Each new tree is built from a previous weak-performing tree to improve classification accuracy. SVM was included to provide a contrast to tree-based ensemble models by representing a margin-based classification approach. A linear SVM constructs a single global decision boundary, which makes it well-suited for evaluating whether static PE header features exhibit sufficient linear separability between classes.
3.6. Hyperparameter Optimization
Hyperparameter tuning was performed on the training split during the exploratory phase to identify optimal model configurations. All models were tuned using 5-fold stratified cross-validation to preserve class proportions. The primary objective metric was the Matthews Correlation Coefficient (MCC), which is robust to class imbalance and reflects performance on both classes more reliably than accuracy.
Random Forest (RF) hyperparameters were optimized using randomized search, while XGBoost and Support Vector Machine (SVM) hyperparameters were optimized using grid search. The corresponding search ranges are reported in Table 1. The final configurations for each dataset are detailed in Appendix A.2 (Table A1, Table A2 and Table A3). No algorithmic modifications were made beyond these configurations and class imbalance handling.
Table 1.
Hyperparameter search space per model.
3.7. Evaluation Metrics
To evaluate the effectiveness of the static malware detection models, the following evaluation metrics were used.
Classification Reports: Precision, recall, F1 score, and class support were obtained from scikit-learn’s classification_report. These metrics measure prediction correctness, false positives, false negatives, and the balance between them.
Accuracy, MCC, and PR-AUC: A project-specific function (evaluate_model) was used to report overall accuracy and the Matthews Correlation Coefficient, which accounts for the true distribution of both classes, making it suited for imbalanced datasets. The function also calculates the area under the precision–recall curve (PR-AUC). This metric is focused on performance on the positive class, which is necessary in malware scenarios where false negatives are more harmful than false positives.
3.8. Experimental Setup and System Configuration
All experiments in this study were implemented as a machine learning pipeline for ransomware and malware detection using static PE header attributes. The pipeline developed for this project, which includes data preprocessing, model training, hyperparameter tuning, and performance evaluation, was implemented in Python 3.11 within Visual Studio Code (v1.110.1) and Jupyter Notebook (v1.3.0) environments.
The analysis relied on the following Python libraries:
- pandas and NumPy [16] supported data processing and manipulation. NumPy supports matrix operations during model preparation, while pandas provides data loading, cleaning, type normalization, and restructuring.
- matplotlib [17] enabled data exploration, providing visualization plots, confusion matrices, and SHAP summary plots.
- scikit-learn (v1.7.1) [18] provided the core machine learning utilities for model training and evaluation.
- XGBoost (v3.0.5) [19] enabled training of gradient-boosted tree models that handle high-dimensional structured data efficiently. XGBoost was also used to compute model-based feature importance scores.
- SHAP (v0.48.0) [20] provides interpretability for model decisions by evaluating predictions for individual samples and identifying best performing features.
All experiments were executed on a macOS Sonoma 14.5 system with an Apple M1 processor and 8 GB unified memory. A full dependency list is provided in the project repository via requirements.txt to support reproducibility.
4. Experiments and Results
This section presents the results for the three binary classification tasks described in Section 4. Random Forest, XGBoost, and SVM were trained on the preprocessed training split and evaluated on the 40% test portion. The results include classification performance, confusion matrices, and interpretability analysis using SHAP. All models were implemented using the scikit-learn machine learning library.
4.1. Dataset 1: Ransomware vs. Benign
Across all evaluated models, ransomware and benign samples were well separated using static PE header features, which resulted in strong classification performance. The following results are reported using the final hyperparameter configuration selected via cross-validation; the detailed configurations can be found in Appendix A.2 (Table A1).
Random Forest and XGBoost achieved the highest overall scores, with near-perfect recall for the ransomware class, while SVM demonstrated lower performance, indicating that linear decision boundaries are less effective than tree-based models for this task (Table 2).
Table 2.
Dataset 1 evaluation report.
Confusion matrix analysis shows the lowest false negative (FN) for ransomware detection was achieved with Random Forest (RF), which had the lowest number of misclassifications (Figure 2). This positive result can be attributed to clear structural differences between ransomware and benign executables.
Figure 2.
Random Forest confusion matrix for Dataset 1.
Dataset 1 is a well-balanced dataset, where class balancing techniques had a small impact on the overall performance. However, small improvements in ransomware recall were observed when class weighting was applied, specifically for the SVM model.
4.2. Dataset 2: Malware vs. Benign
Dataset 2 presented a more challenging classification task, as it includes a more diverse set of malware samples. The detailed hyperparameter configurations can be found in Appendix A.2 (Table A2). Although Random Forest and XGBoost continued to show strong performance, a modest decline in MCC was observed when compared to Dataset 1 (Table 3). The results show that tree-based models remain effective for general malware detection under increased feature overlap. While SVM’s performance remained below that of the tree-based models, optimization of the regularization parameter C resulted in a stable performance with a modest MCC rating, at the cost of a higher false negative rate.
Table 3.
Dataset 2 evaluation report.
Both RF and XGBoost achieved similar results with low misclassification rates. XGBoost recorded 56 false positives, and the corresponding confusion matrix for RF is reported in Figure 3.
Figure 3.
RF confusion matrix for Dataset 2.
Under chronological split, Dataset 2 showed performance degradation relative to the stratified split. For the Random Forest model, accuracy decreased from 0.991 to 0.951 and MCC from 0.978 to 0.900. False negatives increased from 7 to 207, indicating that the model struggles to generalize its predictive power to future data points.
4.3. Dataset 3: Ransomware vs. Malware
Dataset 3 presented the most challenging classification task, as ransomware represented only 13% of samples and shared similar static characteristics with other malware. As a result, models can achieve high accuracy by predicting the majority class; therefore, MCC and PR-AUC are better performance evaluation metrics. The final hyperparameter configuration for this dataset can be found in Appendix A.2 (Table A3).
Although cross-validated hyperparameter selection led to improved performance across models, performance remained low relative to Datasets 1 and 2. As observed in Table 4, different classifiers followed distinct trade-offs. RF scored high accuracy but at the cost of high false negatives, which points to majority class bias. XGBoost shows stronger ranking performance (PR-AUC) but scored low MCC, showing difficulty in balancing false negatives and false positives at the decision level. SVM scored the highest MCC, indicating more stable binary decisions on this dataset.
Table 4.
Dataset 3 evaluation report.
The confusion matrix for SVM gives further insight into the balance between false negatives and false positives on Dataset 3 (Figure 4). The performance decline observed here suggests that Dataset 3 contains high class overlap in the PE header feature space. This indicates that certain malware files and ransomware families share nearly identical structural metadata, creating a “feature collision” that static analysis alone cannot resolve.
Figure 4.
SVM confusion matrix for Dataset 3.
For Dataset 3, temporal evaluation using the XGBoost model produced comparable performance to the stratified split. Accuracy decreased from 0. 590 to 0.488, and MCC remained low at 0.153. False negatives increased from 169 to 255. Temporal splitting did not result in a substantial change in performance, indicating that performance limitations in Dataset 3 are intrinsic to the dataset characteristics rather than driven by a chronological distribution shift.
4.4. Feature Importance and Interpretability (SHAP)
SHAP (SHapley Additive exPlanations) was used to examine feature importance across datasets to better understand the decision behavior of tree-based models. First, global feature importance was examined using the mean absolute SHAP values, provided in Appendix A.3, followed by SHAP summary (beeswarm) plots that were used to analyze feature directionality and distribution, demonstrating how different feature values affect classification results. In addition, SHAP variance was analyzed to determine whether PE header features continue to produce distinct contributions across samples, allowing quantitative evaluation of the feature collision observed in Dataset 3. To maintain consistency in feature interpretation across the three datasets, analysis was conducted using XGBoost. The model was selected as the representative model due to its stable performance across tasks and its compatibility with the TreeExplainer algorithm, which provides mathematically consistent feature importance [21].
For Dataset 1, global importance ranking SHAP analysis (Figure A1) shows that DLL handling (DllCharacteristics), executable architecture (Machine_x86, Machine_x64), and debug metadata (DebugSize, DebugRVA) were the features with the strongest influence on classification outcomes. DllCharacteristics demonstrates the highest mean |SHAP| value (2.085) and substantial variance (0.836). The SHAP summary (beeswarm) plot shows how individual feature values influence XGBoost predictions (Figure 5). Lower values of DllCharacteristics push predictions towards ransomware, while higher values push towards benign. A similar pattern is seen for debug-related metadata, where smaller DebugSize and DebugRVA values contribute toward ransomware classification and larger values favor benign predictions. Machine architecture values also display directional influence; Machine_x86 (value = 1) pushes predictions toward ransomware, whereas Machine_x64 pushes toward benign classification.
Figure 5.
SHAP summary (beeswarm) plot for XGBoost on Dataset 1.
In Dataset 2, file timestamp (TimeDateStamp) and linker version (MajorLinkVersion) had the strongest influence on classification (mean |SHAP| = 1.806 and 1.255; variance = 0.976 and 0.401). This demonstrates that build environment metadata had a greater contribution than any single structural or entropy-based feature. However, no single feature was dominant in isolation. Instead, the model’s prediction was influenced by interactions among multiple features (Figure 6), reflecting XGBoost’s ability to learn non-linear decision boundaries that capture complex relationships within the data.
Figure 6.
SHAP summary (beeswarm) plot for XGBoost on Dataset 2.
In Dataset 3, the SHAP global ranking (Figure A3) shows a substantial reduction in feature influence compared to Datasets 1 and 2. Although DllCharacteristics remains the highest-ranked feature, its mean |SHAP| drops to 0.222, with variance limited to 0.0029. No feature exceeds a mean |SHAP| of 0.25, and overall variance values remain below 0.0035, indicating minimal differentiated contribution across samples. The summary (beeswarm) plot further reflects this weak and inconsistent directional influence across features, with significant overlap between ransomware and non-ransomware samples (Figure 7). Unlike the ransomware–benign task, feature values in Dataset 3 contribute to both directions, with no single attribute showing a clear separation between classes.
Figure 7.
SHAP summary (beeswarm) plot for XGBoost on Dataset 3.
5. Discussion and Future Work
The findings covered in Section 4 demonstrate that the effectiveness of machine learning methods while using exclusively static PE header features is highly dependent on class separability in feature space. In the ransomware–benign and malware–benign tasks (Datasets 1 and 2), models achieved high performance across all evaluated metrics, demonstrating that PE header metadata captures sufficient structural differences when class boundaries are well defined. These results are consistent with prior work showing that static features can support reliable malware detection under constrained classification settings.
In contrast, performance dropped substantially in Dataset 3, where ransomware samples had structural overlap with other malware samples. The drop was consistent across all models and metrics, including MCC and PR-AUC, suggesting that the decline cannot be attributed to majority class bias or suboptimal thresholding alone. Instead, the results point to a representational limitation of static PE header features when applied to fine-grained malware discrimination.
SHAP analysis further explains this performance decline. In Datasets 1 and 2, several features exhibited mean |SHAP| values exceeding 0.9 and variance values above 0.4, indicating strong and differentiated contributions across samples. In Dataset 3, no feature exceeded a mean |SHAP| of 0.25, and maximum variance remained below 0.0035. For example, DllCharacteristics decreased from 2.085 (Dataset 1) and 0.372 (Dataset 2) to 0.222 in Dataset 3, while its variance dropped from 0.836 (Dataset 1) to 0.0029. This measurable collapse in both magnitude and variability indicates that PE header attributes lose discriminative strength when classes share structural characteristics, providing quantitative evidence of feature collision.
Although the datasets used in this study were collected between 2020 and 2023, these results are consistent with known patterns in modern malware development, where ransomware increasingly adopts common malware build configurations and standardized compilation pipelines. Because PE header attributes primarily encode build time and loader metadata rather than runtime behavior or malicious intent, structurally similar malware families overlap in the static feature space. This overlap produces feature-level collisions that static analysis alone cannot resolve, regardless of model complexity or ensemble depth.
The findings of this study expose the limitations of static PE header features. Future work should explore a hybrid approach, employing both static and dynamic behavior, such as short execution traces or API call frequency. This combination can provide the additional information needed for precise differentiation between closely related malware families.
Beyond hybrid modeling, hierarchical malware classification could be explored to determine whether static features are more effective for coarse malware family grouping prior to ransomware-specific detection. Representation learning approaches, such as embedding PE header fields into learned latent spaces, may reveal higher-order relationships not captured by raw metadata. Finally, robustness and evasion studies could examine how intentional manipulation of PE header fields impacts static classifiers, providing insight into adversarial resilience.
6. Limitations
6.1. Temporal Validity and Metadata Reliability
Data availability and metadata completeness remain significant challenges in the malware research domain. In this study, the evaluation of temporal generalization was constrained by the availability of dataset metadata. Chronological evaluation was restricted to Datasets 2 and 3, as Dataset 1 did not contain temporal information. Where timestamps were available, PE header TimeDateStamp values may be manipulated or anomalous and, therefore, serve only as an approximate proxy for build chronology. The reported results should be interpreted as a benchmark performance under static distribution assumptions rather than guaranteed deployment performance under evolving threat conditions.
6.2. Adversarial Vulnerability of Static Features
The models presented rely exclusively on static PE header metadata. While computationally efficient for early triage, these features are susceptible to adversarial manipulation. Header attributes such as timestamps, structural sizes, and alignment values can potentially be modified without altering runtime behavior. This study does not include adversarial training samples or explicit robustness testing against feature-space evasion, and, therefore, the models should not be considered adversarially hardened.
7. Conclusions
This study provides a systematic evaluation of malware detection using static PE header features across three classification tasks. The analysis demonstrates that these features offer strong and efficient performance when class boundaries are clearly separated, supporting their use for broad ransomware–benign discrimination. However, SHAP analysis reveals a limitation: when distinguishing ransomware from other similar malware families, features show high overlap and provide weaker class separation signals. Consequently, static PE header features do not support fine-grained ransomware discrimination when used alone.
To capitalize on the efficiency of static analysis, future systems should deploy PE header analysis as a first-stage screening mechanism to filter clearly benign or broadly malicious samples, particularly in resource-constrained or high-throughput environments. Systems designed to detect or prioritize ransomware should incorporate complementary signals, such as API call behavior, execution traces, or memory-based indicators, to resolve structural overlap within the static feature space. In practice, a hybrid pipeline, combining lightweight static triage with selective dynamic or behavioral inspection, is able to balance computational efficiency, and the discriminative power offers a more robust architecture than reliance on static headers alone.
Author Contributions
Conceptualization, G.B. and A.G.; methodology, G.B.; software, G.B.; validation, G.B. and A.G.; formal analysis, G.B.; investigation, G.B.; resources, G.B.; data curation, G.B.; writing—original draft preparation, G.B.; writing—review and editing, G.B.; visualization, G.B.; supervision, A.G.; project administration, G.B.; funding acquisition, A.G. All authors have read and agreed to the published version of the manuscript.
Funding
This research received no external funding.
Institutional Review Board Statement
Not applicable.
Informed Consent Statement
Not applicable.
Data Availability Statement
The original contributions presented in this study are included in the article material. Further inquiries can be directed to the corresponding author(s).
Conflicts of Interest
The authors declare no conflict of interest.
Appendix A. Implementation Details
Appendix A.1. Feature Preprocessing
Logarithmic Feature Transformation (Dataset 3)
Logarithmic transformation (log1p) was applied to skewed numeric PE header attributes to reduce scale dominance and improve numerical stability for linear models. The transformation was applied to the following fields when present:
- SizeOfImage;
- SizeOfCode;
- SizeOfInitializedData;
- SizeOfUninitializedData;
- AddressOfEntryPoint;
- ImageBase;
- BaseOfCode;
- FileAlignment;
- SectionAlignment;
- SizeOfStackReserve;
- SizeOfHeapReserve;
- SizeOfHeapCommit;
- SizeOfHeaders;
- PointerToSymbolTable;
- NumberOfSymbols;
- CheckSum;
- SizeOfOptionalHeader;
- TimeDateStamp.
Appendix A.2. Hyperparameter Selection
This appendix provides implementation details to support reproducibility. Dataset 1 corresponds to the ransomware vs. benign classification task, Dataset 2 corresponds to malware vs. benign, and Dataset 3 corresponds to ransomware vs. other malware.
Table A1.
Hyperparameter configuration for Dataset 1.
Table A2.
Hyperparameter configuration for Dataset 2.
Table A3.
Hyperparameter configuration for Dataset 3.
Appendix A.3. SHAP Analysis Details
This subsection reports global SHAP bar plots to complement the main-text interpretability analysis.
Figure A1.
SHAP summary plot showing the most influential PE header features for XGBoost on Dataset 1.
Figure A2.
SHAP summary plot showing the most influential PE header features for XGBoost on Dataset 2.
Figure A3.
SHAP summary plot showing the most influential PE header features for XGBoost on Dataset 3.
References
- Venčkauskas, A.; Jusas, V.; Barisas, D. Zero-Day Ransomware Attack Detection Using Static Portable Executable Header Features. Appl. Sci. 2025, 15, 10576. [Google Scholar] [CrossRef] [Scilit]
- Cen, M.; Deng, X.; Jiang, F.; Doss, R. Zero-Ran Sniff: A Zero-Day Ransomware Early Detection Method Based on Zero-Shot Learning. Comput. Secur. 2024, 142, 103849. [Google Scholar] [CrossRef] [Scilit]
- Shaukat, K.; Luo, S.; Varadharajan, V. A Novel Machine Learning Approach for Detecting First-Time-Appeared Malware. Eng. Appl. Artif. Intell. 2024, 131, 107801. [Google Scholar] [CrossRef] [Scilit]
- Manavi, F.; Hamzeh, A. Ransomware Detection Based on PE Header Using Convolutional Neural Networks. Int. J. Inf. Secur. Priv. 2022, 14, 181–192. [Google Scholar] [CrossRef]
- Abedin, S. Malware detection using machine learning techniques. Int. J. Res. Appl. Sci. 2025, 13, 1281–1297. [Google Scholar] [CrossRef] [Scilit]
- Pal, D. Malware detection system using machine learning techniques. Int. J. Sci. Res. 2025, 5, 1–9. [Google Scholar] [CrossRef] [Scilit]
- Nagendrababu, N.C.; Varadaraju, H.R.; Muniraju, M. A method of malware detection using machine learning algorithms. In Proceedings of the IEEE International Conference on Knowledge Engineering and Communication Systems (ICKECS), Chennai, India, 28–29 April 2025; IEEE: Piscataway, NJ, USA, 2025; pp. 1–5. [Google Scholar]
- Akinshola-Awe, F.J.; Obiniyi, A.A.; Aimufua, G.I.O.; Anyachebelu, T.K. Framework for the detection and classification of malware using machine learning. Dutse J. Pure Appl. Sci. 2024, 10, 177–186. [Google Scholar] [CrossRef] [Scilit]
- Rezaei, T.; Manavi, F.; Hamzeh, A. A PE Header-Based Method for Malware Detection Using Clustering and Deep Embedding Techniques. J. Inf. Secur. Appl. 2021, 60, 102872. [Google Scholar] [CrossRef] [Scilit]
- Vehabovic, A.; Zanddizari, H.; Ghani, N.; Shaikh, F.; Bou-Harb, E.; Pour, M.S.; Crichigno, J. Data-Centric Machine Learning Approach for Early Ransomware Detection and Attribution. In Proceedings of the IEEE/IFIP Network Operations and Management Symposium (NOMS 2023), Miami, FL, USA, 8–12 May 2023; IEEE: Piscataway, NJ, USA, 2023; pp. 1–6. [Google Scholar] [CrossRef] [Scilit]
- Wadho, S.; Yc, A.; Gan, M.; Lee, C.; Nadeem, M. Benchmarking classical and deep learning models for ransomware detection using static PE features. J. Appl. Res. Appl. Sci. 2025, 55, 226–235. [Google Scholar] [CrossRef] [Scilit]
- Kan, Z.; McFadden, S.; Arp, D.; Pendlebury, F.; Jordaney, R.; Kinder, J.; Pierazzi, F.; Cavallaro, L. TESSERACT: Eliminating Experimental Bias in Malware Classification across Space and Time (Extended Version). arXiv 2025, arXiv:2402.01359. [Google Scholar]
- Bensalah, A. Ransomware Detection Data Set. Kaggle. 2023. Available online: https://www.kaggle.com/datasets/amdj3dax/ransomware-detection-data-set (accessed on 4 January 2026).
- Packt Publishing. Machine-Learning-for-Cybersecurity-Cookbook. GitHub Repository. 2020. Available online: https://github.com/PacktPublishing/Machine-Learning-for-Cybersecurity-Cookbook (accessed on 4 January 2026).
- DA-Proj. PE Malware Dataset 1. GitHub Repository. 2023. Available online: https://github.com/DA-Proj/PE-Malware-Dataset1 (accessed on 4 January 2026).
- McKinney, W. Pandas: Powerful Python Data Analysis Toolkit. Available online: https://pandas.pydata.org/ (accessed on 4 January 2026).
- Hunter, J.D. Matplotlib: A 2D graphics environment. Comput. Sci. Eng. 2007, 9, 90–95. [Google Scholar] [CrossRef] [Scilit]
- Pedregosa, F.; Varoquaux, G.; Gramfort, A.; Michel, V.; Thirion, B.; Grisel, O.; Blondel, M.; Prettenhofer, P.; Weiss, R.; Dubourg, V.; et al. Scikit-learn: Machine learning in Python. J. Mach. Learn. Res. 2011, 12, 2825–2830. [Google Scholar]
- Chen, T.; Guestrin, C. XGBoost: A scalable tree boosting system. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, San Francisco, CA, USA, 13–17 August 2016; Association for Computing Machinery: New York, NY, USA, 2016; pp. 785–794. [Google Scholar] [CrossRef] [Scilit]
- Lundberg, S.M.; Lee, S.-I. A unified approach to interpreting model predictions. In Proceedings of the Advances in Neural Information Processing Systems (NeurIPS), Long Beach, CA, USA, 4–9 December 2017. [Google Scholar]
- Lundberg, S.M.; Erion, G.G.; Lee, S.-I. Consistent Individualized Feature Attribution for Tree Ensembles. arXiv 2019, arXiv:1802.03888. [Google Scholar]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.









