This article targets Android malware detection and proposes a hybrid machine learning + deep learning detection framework called ShielDroid, which combines Random Forest with a Multilayer Perceptron, and validates its performance on a public dataset.
This hybrid detection framework converts the prediction output of the Random Forest into an supplementary input feature for the neural network.
The execution pipeline of the overall design is as follows: after the preliminary steps of data preparation and selecting relevant features from a large pool of candidate features, multiple decision trees are first built via a Random Forest classifier to generate a corresponding prediction column, which is ultimately fed as an additional input into the feedforward neural network for subsequent training.
The complete execution pipeline of the hybrid detection method consists of four sequential stages: data preprocessing, feature selection, Random Forest prediction column generation, and feedforward neural network training.
The study uses the MLPClassifier component of the SKlearn library to build the multilayer perceptron neural network model. Its input layer contains 121 neurons in total: 120 neurons correspond to the native feature dimensions of the dataset, and the remaining 1 neuron receives the additional predicted feature generated by the Random Forest classifier. The model has 4 hidden layers with 256, 128, 64, and 32 neurons respectively, all using ReLU as the activation function. The ReLU activation function effectively alleviates the vanishing gradient problem during deep network training, which is why it was chosen as the default activation function for this multilayer perceptron.
The dataset used in this study is CICMalDroid 2020, whose samples were collected from 2017 to 2018 from multiple public sources including the VirusTotal service, the Contagio security blog, and the AMD dataset. Compared with other public datasets, it contains more recent and complex dynamic malware samples, and all samples are divided into 5 categories: adware, banking malware, SMS malware, riskware, and benign apps.
Under the experimental setup on the CICMalDroid 2020 dataset, the proposed hybrid model combining Random Forest with a multilayer perceptron achieved the highest accuracy among all compared methods, reaching 0.98 with a total training time of 22.945 seconds. For comparison, Random Forest alone achieved an accuracy of 0.94, MLP alone achieved 0.93, and SVM achieved only 0.45, the worst among all comparison baselines. You can refer to the accuracy comparison bar chart that follows to visually compare the overall accuracy differences across models.
The hybrid scheme outperformed all other compared methods in classification scores for every malware category as well as the benign category: the Adware class reached a classification accuracy of 97%, the Banking class 96%, the Actual SMS class the highest at 99%, the Riskware class 96%, and the Benign class 97%. The higher feature relevance brought by the additionally introduced Random Forest predicted feature is the core reason for the hybrid model's performance improvement; this scheme simultaneously achieves higher performance, flexibility, robustness, and accuracy, with lower computational complexity. SVM, on the other hand, could not achieve satisfactory results due to dataset heterogeneity and the large number of independent features.
The hybrid model also corrected many misclassified samples from the single models: 89 samples that Random Forest alone could not correctly identify were successfully detected by the hybrid model. With MLP alone, a total of 308 samples were misclassified, of which the largest share, 124 banking malware samples, were all correctly identified by the hybrid model. In addition, some Riskware samples that were misclassified by both Random Forest alone and MLP alone were also effectively detected by the hybrid scheme.
Training a model on an imbalanced dataset causes the model to favor the majority class, leading to obvious bias when focusing on predictions for minority classes. To mitigate this potential issue, the study adopts a stratified train-test split strategy to divide the dataset, ensuring that the proportions of each class of samples in the training and test sets are exactly the same as in the original dataset.
The detection capability of the current scheme only covers application malware identification on the Android platform.
The authors' proposed future extensions include two parts: first, transforming the deployed application corresponding to the current scheme into a dynamic version; second, extending the detection capability to application malware identification on the iOS platform, provided a suitable dataset becomes available.