Next Article in Journal
Modeling of Heat Phenomenon in Rolling Kinematic Pairs Using the Finite Element Method
Next Article in Special Issue
Generating Network Intrusion Detection Dataset Based on Real and Encrypted Synthetic Attack Traffic
Previous Article in Journal
Production of Microfibrillated Cellulose from Fast-Growing Poplar and Olive Tree Pruning by Physical Pretreatment
Previous Article in Special Issue
The Security Perspectives of Vehicular Networks: A Taxonomical Analysis of Attacks and Solutions
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Visualized Malware Multi-Classification Framework Using Fine-Tuned CNN-Based Transfer Learning Models

1
Security Engineering Lab, Computer Science Department, Prince Sultan University, Riyadh 11586, Saudi Arabia
2
Department of Electronics and Electrical Communications Engineering, Faculty of Electronic Engineering, Menoufia University, Menouf 32952, Egypt
3
Computer Science Department, King Abdullah II School for Information Technology, The University of Jordan, Amman 11942, Jordan
*
Author to whom correspondence should be addressed.
Appl. Sci. 2021, 11(14), 6446; https://doi.org/10.3390/app11146446
Submission received: 23 May 2021 / Revised: 6 July 2021 / Accepted: 8 July 2021 / Published: 13 July 2021

Abstract

:
There is a massive growth in malicious software (Malware) development, which causes substantial security threats to individuals and organizations. Cybersecurity researchers makes continuous efforts to defend against these malware risks. This research aims to exploit the significant advantages of Transfer Learning (TL) and Fine-Tuning (FT) methods to introduce efficient malware detection in the context of imbalanced families without the need to apply complex features extraction or data augmentation processes. Therefore, this paper proposes a visualized malware multi-classification framework to avoid false positives and imbalanced datasets’ challenges through using the fine-tuned convolutional neural network (CNN)-based TL models. The proposed framework comprises eight different FT CNN models including VGG16, AlexNet, DarkNet-53, DenseNet-201, Inception-V3, Places365-GoogleNet, ResNet-50, and MobileNet-V2. First, the binary files of different malware families were transformed into 2D images and then forwarded to the FT CNN models to detect and classify the malware families. The detection and classification performance was examined on a benchmark Malimg imbalanced dataset using different, comprehensive evaluation metrics. The evaluation results prove the FT CNN models’ significance in detecting malware types with high accuracy that reached 99.97% which also outperforms the performance of related machine learning (ML) and deep learning (DL)-based malware multi-classification approaches tested on the same malware dataset.

Graphical Abstract

1. Introduction

Malware, short for Malicious Software, is a compiled binary file that interrupts computer systems or networks aiming to steal data, modify/delete or encrypt sensitive information, and hijack core computing functions. Malware includes several types such as worms, trojans, spyware, and ransomware [1]. Recently, there has been a tremendous increase in malware development by an average of 588 cyber threats per minute according to McAfee report 2021 [2]. Consequently, Malware classification and detection have become one of the most important research fields. Malware detection is mainly performed by implementing static-based analysis or dynamic-based analysis [3,4]. In the static-based analysis, the original source code of the malware is statically scanned without executing the code. Even though this approach is inexpensive, it is insufficient in the case of encrypted or obfuscated malware attacks. However, the dynamic-based approach analyzes the behavioral features of the malicious software by executing the code in isolated or virtual environments. Hence, this approach consumes time and resources.
Another alternative to malware classification is the visualization approach. Many recent works have been used the malware visualization analysis approach [5,6,7] as an efficient solution for malicious software classification since it analyzes the malware executable file as a whole. Malware visualization is a method in which malicious software is converted into an image by extracting its binaries [8]. Since the malicious code is visualized, each malicious family presents a special texture pattern of the generated images of the malware applications that belong to the same family. An additional advantage of the malware visualization analysis that it does not require static decompilation or dynamic running of malware software. After the malware visualization, the training classifier could be implemented by deploying the texture features of the malware image. Consequently, even if the attacker has employed obfuscation or modification techniques, the texture representing the malicious software will be exhibited in the malware image [5].
One of the most prominent neural network models is Convolutional Neural Networks (CNNs) which are used in image classification. CNN provides a superior data representation, thus features engineering can be avoided. Initially, the input image is converted into an array of pixels. Subsequently, the image is processed by several convolutional layers to finally generate a predicted output [9]. To train the CNN models, huge and well-illustrated datasets are used, such as ImageNet [10]. However, to enhance the malware classification and detection, the gained knowledge out of CNNs can be transferred to a different learning task [11]. The core advantage of transfer learning is that it enables training a task with a limited dataset by using a pre-trained model with a large-scale dataset.
This research proposes a vision-based malware multi-classification framework that aims to overcome the shortcomings of the existing malware detection mechanisms. The proposed framework recruits the advantages of CNN models trained on large-scale datasets by transferring their knowledge to fine-tuning phase to improve the detection accuracy without building the training models from scratch. Moreover, the proposed framework does not need to run expensive processes applied by conventional ML and DL techniques, including features extraction and data augmentation to balance the malware datasets under study.
Therefore, the main contributions of this research work can be summarized as follows:
  • Developing eight different fine-tuned CNN-based transfer learning (TL) models for vision-based malware multi-classification applications.
  • Using CNN models for vision-based malware classification, which do not require features engineering such as binary disassembly or reverse engineering to detect visual malware samples.
  • Employing fine-tuned CNN models to function properly on 9341 images of 25 different malware families of 8 malware types.
  • Achieving high classification accuracy with fewer epochs and iterations for the developed CNN models than recent related work.
  • Succeeding to develop CNN models that can efficiently perform malware detection on imbalanced datasets (e.g., Malimg dataset [12]).
  • Applying extensive performance analysis in terms of 15 different evaluation metrics to assess the examined fine-tuned CNN models accurately.
  • Conducting in-depth comparative analysis among the employed fine-tuned models and the recent related ML and DL models in terms of the obtained classification accuracy and other detection metrics.
The rest of this paper is structured as follows. Section 2 presents a comprehensive summary of the recent related malware-based detection approaches. The proposed visualized malware multi-classification framework is explained in Section 3. The simulation results and comparisons are discussed in Section 4. Concluding remarks and some future directions are presented in Section 5.

2. Literature Survey

Many malware classification and identification research works have been investigated based on different analysis approaches such as static-based, dynamic-based, and machine learning-based [13,14,15,16]. This section provides a comprehensive survey of several malware classification methods. Static-based analysis deploys functional call-graph [17], features of portable executable (PE) malware files [18], function length frequencies [19], and opcode sequences [20]. Almomani et al. [21,22,23] implemented a static analysis to extract several static features from Android malware binary files such as permissions and API calls. Subsequently, they performed machine learning techniques to detect malware applications [24]. The authors of [25] developed a static analysis with Tensorflow (SAT) malware detection system. The proposed system performs a static analysis by employing a signature-based method on both known and new/modified malware. However, static-based analysis is not sufficient in the case of code obfuscation and zero-day malware [5].
In the dynamic-based analysis, the behavioral characteristics of malware are obtained, such as API calls [26], network activities [27], and log files [28]. In [27], Mohaisen et al. developed an automated malware and labeling scheme (AMAL). In the proposed system, several behavior-based features were extracted during the dynamic analysis, such as network activities, file systems, and registers. The authors of [28] integrated memory forensics techniques with a dynamic analysis approach. Initially, malicious artifacts were extracted from the memory. Subsequently, the Cuckoo Sandbox was deployed to monitor the malware behavior during its execution. Finally, the malicious artifacts and the behavioral report were combined to create the features dataset for further classification. However, malicious software may alter its behavior during its execution in a virtual environment; thus, the dynamic-based analysis might fail to capture the actual behavior of the malicious software.
Recently, extensive research on malware classification has been made by deploying the vision-based approach [6,7,8,29,30,31]. Some authors developed CNN solutions from scratch in which they did not use any pre-trained models [7,9,29,30]. In [7], the authors developed a visualized malware classification system based on Artificial Neural Network (ANN). The proposed classification system used the extracted features of the Malimg database to train ANN. Subsequently, the trained model is further employed in classifying different samples of the Malimg database. The accuracy of applying one hidden layer was 96%. However, implementing two hidden layers achieved an accuracy of 99.135%. Gibert et al. have also visualized malware as gray-scale images to develop a file agnostic deep learning scheme based on CNN [29]. The proposed scheme extract patterns to classify malicious software allowing the malicious software to be classified in a real-time environment. Besides patterns, different features could be deployed in the malware visualization process. In [30], they have included the local features in visualizing the malware application by using the FastText model. Consequently, each malware family has a unique generated local malware image since the proposed system mainly includes the local features of each malicious software.
Furthermore, the authors of [32] proved that combining deep CNN with an entropy graph contributes to enhancing the malware pattern classification process. In [33], the authors have investigated the classification on a different color scale in which they converted the malware APK files into colored images instead of gray-scale images. However, they have compared applying the classification between gray-scale and colored images and proved that applying the classification on colored images outperformed the gray-scale classification. Vasan et al. have also deployed colored images in which they have implemented IMCFN, an image-based malware classification system using Fine-tuned CNN [31]. Initially, they have converted malware into colored images using a colored map algorithm. To overcome the imbalanced dataset issue, they applied data augmentation during the fine-tuning process. Furthermore, they have also compared applying the classification between gray-scale and colored images and achieved the same result of having better classification performance in the case of using colored images. Even though IMCFN accomplished an accuracy of 98.82% in the Malimg dataset, the proposed system bears an extra complexity due to the used augmentation techniques and colored map algorithm.
Some researchers might choose to combine several training models to improve the classification process [8,34,35,36,37]. In [8], the SFTA (scale feature texture analyzer) is combined with two models of deep CNN (DCNN), AlexNet and Inception-v3 techniques, to enhance the accuracy of malware detection. Another combination of CNN models was proposed by [35] in which the authors have uses VGG16 and ResNet50 for features extraction. However, in the ensemble of CNN architectures, two classifiers have been deployed SoftMax and Multiclass SVMs. Following that, a PCA (principal component analysis) process was applied to decrease the dimensionality of the features, while a fusion process was used before the classification process. Moreover, the CNNs might be combined with other techniques such as Long Short-Term Memory (LSTM) [36]. The proposed solution by [36] implemented an ensemble classification scheme based on recurrent and convolutional neural networks by using the complied and the assembled malware files. They have classified the visualized image of the complied malware files using CNN while the LSTM was used to classify Assembly files of malicious software.
In other scenarios, the CNN might be applied to extract features while machine learning techniques are deployed in the malware classification process [38,39,40]. In [38], the visualized malware was classified by deploying a sequential multilayered Random Forest ensemble technique. The suggested solution is performed in two stages. Initially, the raw features were analyzed using different sizes of sliding windows. Subsequently, four different machine learning (ML) techniques were applied including, Random forests (RF), Xgboost, Extra trees classifier (ETC), and Logistic regression (LR). The authors of [39] developed an image feature descriptor to extract the similarities among the malware images. Then, they have deployed the k-Nearest Neighbor (KNN) algorithm to perform the classification process. Another machine learning-based classification system was proposed by [40] in which they deployed the local and global malicious patterns (LGMP) to extract the features of the visualized malware.
Table 1 presents a comprehensive comparison among the most recent related studies that have deployed the imbalanced Malimg dataset in their proposed systems. After observing the limitations of state-of-the-art malware classification approaches, different fine-tuned CNN-based TL architectures are introduced in this paper to significantly reduce the misclassification rate without increasing the complexity. Thus, different from the prior malware detection approaches, this work implemented eight CNN models for visualized malware multi-classification purposes. First, the PE (portable executable) malware samples are converted to gray-scale images to build the malware dataset in a proper format that suits the input type of the developed CNN models. An image processing stage is then introduced to the obtained malware images to resize them appropriately to meet the input size conditions of the used CNN models. After that, the fine-tuning process is performed for the pre-trained CNN-based TL models that were trained on ImageNet database. Consequently, avoiding the expected misclassification in testing the imbalanced Malimg dataset by transferring the obtained optimum weights of the pre-trained CNN-based TL models to the malware classification tasks. Subsequently, these developed fine-tuned CNN-based TL models are utilized to classify 25 malware families of the imbalanced Malimg dataset. The fine-tuning process of the CNN layers and hyperparameter values assists in identifying different malicious software families and enhancing the pre-trained models’ classification performance without employing data augmentation techniques.

3. Proposed Visualized Malware Multi-Classification Framework

Effective detection of windows malware families is a mandatory aspect in Internet security applications. Rather than employing the conventional features extraction-based ML approaches that require high computational processing in texture analysis, in this paper, efficient visualized malware multi-classification models are introduced based on deep learning (DL) approaches. Therefore, to efficiently identify malware images with reduced computations and achieve maximum identification accuracy, different fine-tuned CNN-based TL models are developed and used, as shown in the proposed malware multi-classification framework in Figure 1.
The used fine-tuned CNN models do not use reverse engineering for the malware multi-classification process. The basic procedure of the proposed malware multi-classification framework is shown in Figure 1. It consists of five different phases: (1) Dataset preparation, (2) Pre-processing, (3) Transfer learning, (4) Fine-tuning and classification, and (5) Performance evaluation. The details of these phases are as follows:

3.1. Dataset Preparation Phase

This phase is concerned with converting PE (portable executable) malware apps to gray-scale images. A PE malware binary is converted to a visual image to obtain and extract the main features and details of the malware apps. As shown in Figure 1, the malware PE application is first converted to a 1D 8-bit binary vector (unsigned integers). Then, this obtained 8-bit vector is transformed into a visual 2D gray-scale image. The main advantage of converting PE malware app to visual malware image is that it does not necessitate any domain expertise or feature engineering knowledge. Table 2 illustrates some samples of the visualized malware images after rearranging the 1D bit vectors of the malware binaries into 2D visual arrays. It can be observed from these malware images that the image width is variant for each malware family, which depends on the malware app size. Table 3 presents different widths for the malware images due to different sizes of malware files. Additionally, we can conclude from Table 2 that the obtained visual images of a variety of malware families exhibited differently in style, layout, and form. Therefore, each malware family has its own visual characteristics and similarities that are different from other malware families, where each family has various visualization features and distinct stripes. Such observations have motivated this research to adapt and tune the general CNN algorithms used for digital image classification into malware detection tasks.

3.2. Pre-Processing Phase

As discussed in the first phase, the malware binaries are converted to 2D malware images with different sizes that are not fixed among images of the tested 25 families. Thus, a pre-processing step for malware data are a mandatory stage to be introduced to reformate the input image size corresponding to the CNN algorithms’ settings. Therefore, the objective of this phase is to resize the malware images obtained in the first phase to an appropriate size to be compatible with the input size of the employed CNN model, where each fine-tuned CNN model from the eight examined models has its own standard size for the input image, as shown in Table 4. The foremost advantage of the resizing process is reducing the input image sizes, which is very beneficial in accelerating the training process and decreasing the computational overhead of the employed CNN model. Moreover, the main texture features of the malware images are preserved during the re-dimensionality process.
Furthermore, in this phase, the malware images dataset is divided into two different ratios for training and testing purposes. In this work, several simulation experiments were conducted to choose the proper ratios regarding detection accuracy and execution performance. The experiments’ results revealed that allocating 80% of the malware samples for training and 20% for testing have achieved the superior and recommended malware detection accuracy compared to the other training and testing ratios for the examined CNN models. Both 20% and 80% of the samples were selected randomly by our proposed framework.

3.3. Transfer Learning (TL) Phase

TL refers to transferring the CNN parameters of a specified detection task with a specific image database to a new classification challenge with a different detection task for another image database. Almost all deep CNN models trained and learned on natural digital images have a common phenomenon: they understand and discover the general features of the input images through their first CNN layers, where these features are not specific to a particular task or dataset. However, they can be applied to many classification tasks and different image datasets. Therefore, the benefit of TL can be a formidable solution when the target database is considerably smaller than the original database; this is to avoid the overfitting occurrence, especially in the case of imbalanced datasets.
Consequently, the malware classification task can be considered to be an image classification task, especially when the malware binary samples are converted into visual malware images. Thus, the standard CNN models used for natural image classification can be exploited to classify the visualized malware images. In this regard, the TL-based CNN models trained on the benchmark ImageNet database [41] can be efficiently adapted to detect malware families. This database is updated through an annual competition called the “ImageNet Large-Scale Visual Recognition Challenge (ILSVRC)” which is created for visual object detection challenges.
Many CNN models were already trained on natural images such as VGG16 [42], AlexNet [43], DarkNet-53 [44], DenseNet-201 [45], Inception-V3 [46], Places365-GoogleNet [47], ResNet-50 [48], and MobileNet-V2 [49]. In this paper, to obtain and extract the main features of the malware images, we used these eight pre-trained CNN models on the ImageNet database to identify general objects. Therefore, these models can be retrained and tested quickly using malware images to extract the main features from the input malware images; this is the great benefit of the TL concept. Thus, TL-based CNN architectures have started recently to be employed for intrusion detection and malware classification research. This is because TL can offer effective and promising detection solutions through knowledge transfer from standard image detection tasks to malware image detection tasks.
Among all TL-based CNN models examined in this paper, the fine-tuned VGG16 model accomplishes the best superior and promising results for visual malware multi-classification compared to other models. Therefore, we provide deep insights into its architecture, behavior, parameters, and simulation results. Thus, the proposed multi-classification framework has implemented the fine-tuned version of the pre-trained VGG16 CNN architecture model shown in Figure 2; to classify visualized malware images. The TL-based VGG16 model is already trained on more than 14 million digital images of the ImageNet dataset. It is primarily introduced to resolve various identification challenges such as plant image, plankton, lung nodules classifications [42]. As observed in Figure 2, the DL VGG16 architecture comprises different connected CNN layers (16 layers) that are (1) five max-pooling (MP) layers, (2) five groups of convolutional (Conv.) layers, (3) three fully connected (FC) layers, and (4) a SoftMax output layer. Its input image size is 224 × 224 × 3 , and its output layer includes the SoftMax classifier used for detection purposes.
First, the malware images are resized to 224 × 224 × 3 to meet the input size of the first layer of the VGG16 model. Then, these images are passed to a group of convolutional layers with filter sizes of 3 × 3 and 1 × 1. In the convolution layers, the convolution stride is fixed to 1 padding for each 1 pixel. This is to ensure similar spatial dimensions among the included activation maps of the whole model layers. The rectified linear unit (ReLU) is used in all hidden layers to speed up the training process. The non-padding kernel filters of size 2 × 2 with two strides are applied in the max-pooling layers. For the output SoftMax layer, a classifier is used to classify the 25 malware families of the tested Malimg dataset. In the proposed model, all upper layers are frozen, and the last three connected layers are equipped to detect the malware family.
The prominent benefit of the VGG16 model is that it enhances the performance of CNNs without the necessity of doing deeper training with a high number of convolutional layers. This means that each convolutional layer will have various kernels that can learn and discover distinct image features with fewer iterations. Thus, it is computationally effective in malware image detection due to its low number of layers and iterations. More details about the architectures and explanations of the other seven pre-trained CNN models (AlexNet, DarkNet-53, DenseNet-201, Inception-V3, Places365-GoogleNet, ResNet-50, MobileNet-V2), could be explored in [43,44,45,46,47,48,49].

3.4. Fine-Tuning and Classification Phase

In general, TL can be performed in three different ways [50]: (1) shallow tuning: the last layer in the model is assigned to a new task, and the constraints of the other model’s layers are frozen, (2) deep tuning: the whole end-to-end parameters of the pre-trained CNN architecture are retrained, and (3) fine-tuning: the CNN layers are gradually trained by fine-tuning the learning hyperparameters till a remarkable performance enhancement is accomplished. This paper applied fine-tuning, which is a compromised approach between the other two tuning types. Fine-tuning takes advantage of efficient classification tasks in the case of imbalanced datasets. Additionally, it causes lower complexity than the deep tuning and better classification accuracy than the shallow tuning.
The employed eight CNN models previously trained on the ImageNet dataset that contains 1000 different classes are adapted to our malware detection challenge. This adaptation is implemented through fine-tuning their layers’ parameters and weights. In these models, the output layer that contains 1000 classes is modified and fine-tuned to comprise 25 classes (25 malware families). Additionally, as will be discussed, the original weights of the primary pre-trained CNN models of the ImageNet dataset were initially used, and after that, they were optimized and fine-tuned based on the back-propagation technique [51].
The fine-tuning process of the layers’ weights is an iterative optimization procedure that is performed and repeated until determining the best value of the filter weights (w) that achieve a minimum error rate. The used cost function is expressed in Equation (1)
F ( w , K ) = 1 m j = 1 m f p k j , w , c ^ j
where m refers to the malware images contained in the training dataset K, p( k j , w) is the CNN prediction function that predicts the class c j of k j by assuming the value of w, c ^ j is the proper class of the j t h malware image, k j is the j t h malware image of K, and f( c j , c ^ j ) is the logistic error function that predicts c j rather than c ^ i .
During the fine-tuning process, the performance efficiency of three different optimizers [52]: (1) RMSprop (Root Mean Square Propagation), (2) SGDM (Stochastic Gradient Descent with Momentum), and (3) ADAM (Adaptive Moment Estimation Optimizer) were examined to select the best optimizer for estimating the optimal filter weights of the CNN layers. As a result, the ADAM optimizer was used for finding the optimal w due to its superior performance compared to other optimizers. ADAM optimizer combines the main advantages and benefits of the other two SGDM and RMSprop optimizers, where it establishes adaptive learning rates for each parameter in the training process. Hence, the significant improvement of the ADAM optimizer is that it retains an exponentially decaying average of the past squared gradient descent to reach a minimum value faster. Further details, mathematical expressions, and descriptions of the ADAM optimizer can be found in [53].
In the training process, a massive capacity of hardware memory is required to store the filter weights w of the CNN layers, so a mini-batch size is set to 64. The learning rate is regularly altered until the optimal value is reached; where high learning rates cause overfitting, while slow learning rates limit the error variants among epochs. Therefore, the initial learning rate was set to 0.00001; to efficiently regulate the update of the weight sizes. The CNN layers’ weights were updated in each iteration, and the mini-batches were iterated for every epoch. The max-epoch was set to 20, where this value was selected through observing validation errors throughout fine-tuning process using various learning rates. Furthermore, the L2-regularization (ridge regression) technique [54] with weight decay (L2-regularizer) = 0.01; was adopted to enhance and optimize the performance of the CNN models and avoid overfitting problem while analyzing small training samples. Therefore, it achieves robust and faster classification of malware images. For all examined models, the FC and SoftMax classifiers were used to detect the 25 malware images.

3.5. Performance Evaluation Phase

In this phase, extensive performance analysis in terms of 15 different evaluation metrics is presented to assess the examined models. Thus, the performance of the eight fine-tuned CNN classifiers was evaluated through detection assessment metrics, including accuracy and loss curves, specificity (TNR) (true negative rate), confusion matrix, NPV (negative predictive value), AROC (Area under the receiver operating characteristic curve), FPR (false positive rate), validation accuracy, FNR (false negative rate), precision (PPV) (positive predictive value), FDR (false discovery rate), recall (TPR) (true positive rate), FOR (false omission rate), sensitivity, F1-Score, and misclassification rate. These classification performance metrics have been comprehensively used in the research community to offer exhaustive evaluations of classification approaches [55,56].
The mathematical expressions of these evaluation metrics are formulated as follows:
Accuracy = T P + T N T P + F P + T N + F N
Specificity ( TNR ) = T N T N + F P
NPV = T N T N + F N
FPR = F P F P + T N
FNR = F N F N + T P
Precision ( PPV ) = T P T P + F P
FDR = F P F P + T P
Recall ( TPR ) = Sensitivity = T P T P + F N
FOR = F N F N + T N
F 1 - Score = 2 T P 2 T P + F P + F N
Misclassification rate = F P + F N T P + F P + T N + F N
where TP (true positive) implies that both actual and predicted malware types are positive, TN (true negative) means that both actual and predicted malware types are negative, FP (false positive) implies that the actual malware type is negative, while the predicted malware type is positive, and FN (false negative) means that the actual malware type is positive, while the predicted malware type is negative.
The TP, TN, FP, and FN values can be estimated as shown in Figure 3, which is the confusion matrix of multi-classification tasks, which is different from the traditional confusion matrix of binary classification tasks. In this paper, we have a confusion matrix of classification with N malware families (classes). For example, considering a specific malware family F x where both the actual and predicted values are given, the four different classification results that can be obtained are: true positive (green), true negative (yellow), false positive (blue), and false negative (red).
More details, debates, and explanations about these evaluation metrics can be explored in [57].

4. Experimental Results and Comparisons

This section presents and discusses the results of applying eight FT CNN-based TL models on an imbalanced malware dataset.

4.1. Malimg Dataset

The performance of the proposed FT CNN-based TL models was evaluated using the Malimg dataset [12]. Malimg consists of 9341 malware samples. Each sample corresponds to one of the 25 malware families as illustrated in Table 5. The malware samples of the Malimg dataset are visualized as gray-scale images within the range (0: black—255: white). Different fragments of the malware binary file demonstrate various image textures as shown in Figure 4. This figure illustrates the first fragment of the malware image which has a fine-grained texture since its corresponding .text section contains the malware executable code [6]. However, the remaining part of the .text section is visualized as a black block indicating zero paddings. Furthermore, the .data section, also, consists of a fine-grained texture that visualizes the initialized and uninitialized variables. Finally, the generated resources of the malware by the compiler are visualized in the .rsrc fragment. The Malimg dataset was deployed to train the CNN layers on the main characteristics of these families to identify and classify them correctly.

4.2. Results Analysis

In the simulation studies, we tested eight different CNN models (VGG16, AlexNet, DarkNet-53, DenseNet-201, Inception-V3, Places365-GoogleNet, ResNet-50, and MobileNet-V2) on the families of the Malimg dataset presented in Table 5. As discussed before, we divided the dataset as 80% for training and 20% for testing. As shown in Table 5, this dataset is imbalanced. Therefore, to handle this challenge, we applied the fine-tuning process for the CNN layers and hyperparameters without employing any data augmentation, as discussed in Section 3.4. The performance analysis of the simulation tests in terms of the confusion matrix, loss and accuracy curves, and other different evaluation metrics were carried out by MATLAB 2020b. An Intel Core i7-4500 processor with 8 GB RAM was used for training and classification processes.
For simplicity in presenting the simulation results, the accuracy and loss curves, the confusion matrix, and the other calculated evaluation metrics are presented in detail for VGG16, the best accomplished fine-tuned model among the eight examined CNN models. For the other fine-tuned CNN models, we give the average values of all tested evaluation metrics to provide deep comparisons among them.
The accuracy and loss curves of the training and testing processes of the fine-tuned VGG16 model across 20 epochs are shown in Figure 5. As can be observed from these curves, both loss and accuracy curves were steady before less than ten epochs. Additionally, there is no overfitting of the training samples because there is a complete similarity between the training and testing curves for the proposed fine-tuned VGG16 model. Therefore, by using a smaller number of epochs, the performance of the proposed fine-tuned VGG16 CNN model was superior. Likewise, we observed similar accuracy and loss curves for the other seven fine-tuned CNN models.
The confusion matrix obtained for the fine-tuned VGG16 model is shown in Figure 6. This is a multi-classification confusion matrix for the tested 25 malware families of the imbalanced Malimg dataset. The TN, FN, TP, and FP values for the individual detected malware families could be calculated with the aid of the multi-classification confusion matrix given in Figure 3. It is noticed that the attained TN, FN, TP, and FP values for the fine-tuned VGG16 model were as desired and close to the optimal values. This is due to the fine-tuning process of the CNN layers and hyperparameters. These achieved results confirm the low misclassification rate, where almost all malware families were correctly classified with high accuracy. Minimal families reported misclassification of their tested instances, which did not exceed two cases of malware images. The model succeeded in achieving 100% accuracy by 60% of the malware families where all their tested instances were classified correctly. For the rest of families most of them had only one misclassification such as ‘C2LOP_gen!g’ family with one FN; and only one family with 2 misclassifications which is ‘Lolyda_AA2’.
We tested the capability of each fine-tuned CNN model of the eight examined models in classifying individual malware families. We calculated the accuracy (Acc.), precision (Prec.), recall (Rec.), specificity (Spec.), NPV, FPR, FNR, FDR, FOR, F1-Score, and misclassification rate (Mis. Class. Rate) for each malware family in the Malimg dataset. Then, we computed the average values of these evaluation metrics. Table 6 shows the obtained results of each malware family in addition to the overall average per evaluation metric after applying the fine-tuned VGG16 classifier. The results revealed that the proposed fine-tuned VGG16 model achieves significant values near optimum for all examined assessment metrics. Thus, this model is highly recommended to be applied in the context of efficient detection and classification of visualized malware samples.
Moreover, Table 7 provides a comparison among the eight fine-tuned CNN models in terms of the evaluation metrics: Acc., Prec., Rec., Spec., NPV, FPR, FNR, FDR, FOR, F1-Score, and Mis. Class. Rate. In general, all employed CNN models achieved excellent classification results. Therefore, detecting malware images using imbalanced datasets can use these models effectively. Additionally, the results disclose again that the FT VGG16 model outperformed the other seven CNN models in almost all tested metrics.
Furthermore, Table 8 introduces a quantitative comparison of the computational overhead among the used CNN models in the proposed visualized malware multi-classification framework in terms of the (a) number of layers of the employed CNN model including the consecutive series or the parallel layers used for extracting features from the input malware images, (b) storage requirement which is defined as the allocated size of the employed model on the storage disk, (c) total number of the parameters in the original CNN model calculated based on the number of filters, weights, and stride values, (d) number of non-trainable parameters of the frozen layers in the used CNN-based TL model, (e) number of trainable parameters of the unfrozen layers in the employed CNN-based TL model, (f) total execution time of the training and validation processes of the employed CNN model (g), average time per malware sample which is calculated by dividing the total execution time by the total number of input malware samples, and finally (h) the percentage of reduced non-trainable parameters to the overall number of parameters of a specific CNN model. The obtained results in Table 8 show how the computational time of the training and validation processes various from one CNN model to another. The complexity variation is based on the used number of layers and the number of trainable parameters. In addition, the average time spent to classify the malware type and its family is adequate for all employed CNN models. This is due to the use of the transfer learning and the significant reduction in the training parameters that reaches 99.9% in some of the models. Most of the training parameters and layers were frozen, as discussed in Section 3.3. For example, the best accurate VGG16 CNN-based TL model used in the proposed framework achieved a low execution time of 0.7065 s to identify the malware sample. Only 102,400 parameters were trained from 138 million parameters that existed in the original CNN model.

4.3. Comparative Analysis

Many existing conventional ML and DL approaches use various data balancing methods to enhance the classification performance in the case of imbalanced dataset. In contrast, in this research, we used the imbalanced malware families of the benchmark Malimg database to classify malware images with high accuracy and without employing any data augmentation or any other balancing techniques.
Therefore, this section compares the performance of the proposed multi-classification framework with numerous well-established ML and DL classifiers; to prove its efficiency in detecting and classifying visualized malware images even when applied to same datasets with imbalanced malware families.
Table 9 summarizes the performance comparison in terms of the accuracy, precision, recall, and F1-Score metrics of the proposed multi-classification framework using fine-tuned VGG16 CNN model and the baseline-related ML and DL classifiers. The comparison results confirm that the developed multi-classification framework outperforms all other conventional approaches in all tested evaluation metrics. The classification accuracy of the proposed framework reached 99.97% after applying fine-tuned VGG16 which is considered superior compared to traditional classifiers. This is due to the use of an efficient FT process and well-developed CNN-based TL models.

5. Conclusions and Future Work

There is an ongoing competition between anti-malware software and cyber-attackers’ methods. Malware is one of the most widespread cyber-attacks on the Internet. Consequently, it is essential to continue building innovative, intelligent security tools to mitigate these security attacks. Thus, efficient artificial intelligence (AI) tools are designed and used to detect malicious software. Unfortunately, AI-based anti-malware solutions based on ML algorithms introduce considerable development costs by generating an extensive set of handcrafted features identification and extraction, which requires the time and expertise of data scientists and malware analysts.
On the other hand, AI-based anti-malware solutions based on DL algorithms and CNN architectures have exhibited outstanding performance in identifying malware quickly and efficiently. Therefore, this paper introduced a DL-based visualized malware multi-classification framework to classify different unbalanced families of malware images. This framework was built based on malware visualization, fine-tuning, and CNN-based transfer learning phases that were well-developed to accurately detect different categories of malware families.
The proposed framework comprises eight fine-tuned CNN models, VGG16, AlexNet, DarkNet-53, DenseNet-201, Inception-V3, Places365-GoogleNet, ResNet-50, and MobileNet-V2, that were already pre-trained on the ImageNet database. The main contribution of the proposed framework is the cost-effectiveness in handling the imbalanced malware families while achieving high detection performance and without the need for data augmentation processes or complex features engineering. Extensive simulation experiments based on various evaluation metrics were conducted on the benchmark imbalanced Malimg dataset, which proved the outstanding classification capability and proficiency of the proposed framework.
Furthermore, a comprehensive comparative analysis among the proposed work and recent well-known ML and DL-based malware classification algorithms was presented and discussed. The comparison results demonstrated that the proposed framework achieved superior outcomes for all examined classification metrics.
For future work, different balanced and imbalanced malware datasets can be tested and explored. Additionally, building and testing a new malware dataset with the recent well-known malicious software is one of our aims to be considered. Moreover, we intend to investigate and examine the detection of cyber-attacks and malicious software in IoT cybersecurity applications.

Author Contributions

Conceptualization, W.E.-S. and I.A.; methodology, W.E.-S. and I.A.; software, W.E.-S. and A.A.; validation, W.E.-S., I.A. and A.A.; formal analysis, W.E.-S. and I.A.; investigation, W.E.-S., I.A. and A.A.; resources, W.E.-S., I.A. and A.A.; data curation, W.E.-S., I.A. and A.A.; writing—original draft preparation, W.E.-S. and A.A.; writing—I.A.; visualization, W.E.-S., I.A. and A.A.; supervision, W.E.-S. and I.A.; project administration, W.E.-S. and I.A.; funding acquisition, I.A. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by Prince Sultan University, Saudi Arabia, [Grant number: SEED-CCIS-2021-84].

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

No new data were created or analyzed in this study. Data sharing is not applicable to this article.

Acknowledgments

The authors would like to acknowledge the support of Prince Sultan University for paying the Article Processing Charges (APC) of this publication.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Komatwar, R.; Kokare, M. A survey on malware detection and classification. J. Appl. Secur. Res. 2020, 1–31. [Google Scholar] [CrossRef]
  2. McAfee Report Threat Center. Available online: https://www.mcafee.com/enterprise/en-us/threat-center/mcafee-labs/reports.html (accessed on 3 June 2021).
  3. Almomani, I.; Khayer, A. Android applications scanning: The guide. In Proceedings of the 2019 International Conference on Computer and Information Sciences (ICCIS), Sakaka, Saudi Arabia, 3–4 April 2019; pp. 1–5. [Google Scholar]
  4. Almomani, I.M.; Al Khayer, A. A Comprehensive Analysis of the Android Permissions System. IEEE Access 2020, 8, 216671–216688. [Google Scholar] [CrossRef]
  5. Hemalatha, J.; Roseline, S.A.; Geetha, S.; Kadry, S.; Damaševičius, R. An Efficient DenseNet-Based Deep Learning Model for Malware Detection. Entropy 2021, 23, 344. [Google Scholar] [CrossRef] [PubMed]
  6. Roseline, S.A.; Geetha, S.; Kadry, S.; Nam, Y. Intelligent Vision-Based Malware Detection and Classification Using Deep Random Forest Paradigm. IEEE Access 2020, 8, 206303–206324. [Google Scholar] [CrossRef]
  7. Moussas, V.; Andreatos, A. Malware Detection Based on Code Visualization and Two-Level Classification. Information 2021, 12, 118. [Google Scholar] [CrossRef]
  8. Nisa, M.; Shah, J.H.; Kanwal, S.; Raza, M.; Khan, M.A.; Damaševičius, R.; Blažauskas, T. Hybrid malware classification method using segmentation-based fractal texture analysis and deep convolution neural network features. Appl. Sci. 2020, 10, 4966. [Google Scholar] [CrossRef]
  9. Roseline, S.A.; Hari, G.; Geetha, S.; Krishnamurthy, R. Vision-Based Malware Detection and Classification Using Lightweight Deep Learning Paradigm. In Proceedings of the International Conference on Computer Vision and Image Processing, Jaipur, India, 27–29 September 2019; Springer: Singapore, 2019; pp. 62–73. [Google Scholar]
  10. Deng, J.; Dong, W.; Socher, R.; Li, L.J.; Li, K.; Li, F.-F. Imagenet: A large-scale hierarchical image database. In Proceedings of the 2009 IEEE Conference on Computer Vision and Pattern Recognition, Miami, FL, USA, 20–25 June 2009; pp. 248–255. [Google Scholar]
  11. Basha, S.S.; Vinakota, S.K.; Pulabaigari, V.; Mukherjee, S.; Dubey, S.R. Autotune: Automatically tuning convolutional neural networks for improved transfer learning. Neural Netw. 2021, 133, 112–122. [Google Scholar] [CrossRef]
  12. Nataraj, L.; Karthikeyan, S.; Jacob, G.; Manjunath, B.S. Malware images: Visualization and automatic classification. In Proceedings of the 8th International Symposium on Visualization for Cyber Security, Pittsburgh, PA, USA, 20 July 2011; pp. 1–7. [Google Scholar]
  13. Al Khayer, A.; Almomani, I.; Elkawlak, K. ASAF: Android Static Analysis Framework. In Proceedings of the 2020 First International Conference of Smart Systems and Emerging Technologies (SMARTTECH), Riyadh, Saudi Arabia, 3–5 November 2020; pp. 197–202. [Google Scholar]
  14. Nassiri, M.; HaddadPajouh, H.; Dehghantanha, A.; Karimipour, H.; Parizi, R.M.; Srivastava, G. Malware elimination impact on dynamic analysis: An experimental machine learning approach. In Handbook of Big Data Privacy; Springer: Berlin/Heidelberg, Germany, 2020; pp. 359–370. [Google Scholar]
  15. Martins, N.; Cruz, J.M.; Cruz, T.; Abreu, P.H. Adversarial machine learning applied to intrusion and malware scenarios: A systematic review. IEEE Access 2020, 8, 35403–35419. [Google Scholar] [CrossRef]
  16. Qaddoura, R.; Aljarah, I.; Faris, H.; Almomani, I. A Classification Approach Based on Evolutionary Clustering and Its Application for Ransomware Detection. In Evolutionary Data Clustering: Algorithms and Applications; Springer: Singapore, 2021; pp. 237–248. [Google Scholar] [CrossRef]
  17. Yang, Y.; Du, X.; Yang, Z.; Liu, X. Android Malware Detection Based on Structural Features of the Function Call Graph. Electronics 2021, 10, 186. [Google Scholar] [CrossRef]
  18. Poudyal, S.; Gupta, K.D.; Sen, S. PEFile analysis: A static approach to ransomware analysis. Int. J. Comput. Sci. 2019, 1, 34–39. [Google Scholar]
  19. Jose, R.R.; Salim, A. Integrated Static Analysis for Malware Variants Detection. In Proceedings of the International Conference on Inventive Computation Technologies, Coimbatore, India, 29–30 August 2019; Springer: Cham, Switzerland, 2019; pp. 622–629. [Google Scholar]
  20. Nar, M.; Kakisim, A.G.; Yavuz, M.N.; Soğukpinar, İ. Analysis and comparison of disassemblers for opcode based malware analysis. In Proceedings of the 2019 4th International Conference on Computer Science and Engineering (UBMK), Samsun, Turkey, 11–15 September 2019; pp. 17–22. [Google Scholar]
  21. Alsoghyer, S.; Almomani, I. Ransomware detection system for Android applications. Electronics 2019, 8, 868. [Google Scholar] [CrossRef] [Green Version]
  22. Alsoghyer, S.; Almomani, I. On the Effectiveness of Application Permissions for Android Ransomware Detection. In Proceedings of the 2020 6th Conference on Data Science and Machine Learning Applications (CDMA), Riyadh, Saudi Arabia, 4–5 March 2020; pp. 94–99. [Google Scholar] [CrossRef]
  23. Faris, H.; Habib, M.; Almomani, I.; Eshtay, M.; Aljarah, I. Optimizing extreme learning machines using chains of salps for efficient Android ransomware detection. Appl. Sci. 2020, 10, 3706. [Google Scholar] [CrossRef]
  24. Almomani, I.; AlKhayer, A.; Ahmed, M. An Efficient Machine Learning-based Approach for Android v. 11 Ransomware Detection. In Proceedings of the 2021 1st International Conference on Artificial Intelligence and Data Analytics (CAIDA), Riyadh, Saudi Arabia, 6–7 April 2021; pp. 240–244. [Google Scholar]
  25. Jeon, J.; Kim, J.; Jeon, S.; Lee, S.; Jeong, Y.S. Static Analysis for Malware Detection with Tensorflow and GPU. In Advances in Computer Science and Ubiquitous Computing; Springer: Berlin/Heidelberg, Germany, 2021; pp. 537–546. [Google Scholar]
  26. Amer, E.; Zelinka, I. A dynamic Windows malware detection and prediction method based on contextual understanding of API call sequence. Comput. Secur. 2020, 92, 101760. [Google Scholar] [CrossRef]
  27. Mohaisen, A.; Alrawi, O.; Mohaisen, M. AMAL: High-fidelity, behavior-based automated malware analysis and classification. Comput. Secur. 2015, 52, 251–266. [Google Scholar] [CrossRef]
  28. Sihwail, R.; Omar, K.; Zainol Ariffin, K.A.; Al Afghani, S. Malware detection approach based on artifacts in memory image and dynamic analysis. Appl. Sci. 2019, 9, 3680. [Google Scholar] [CrossRef] [Green Version]
  29. Gibert, D.; Mateu, C.; Planes, J.; Vicens, R. Using convolutional neural networks for classification of malware represented as images. J. Comput. Virol. Hacking Tech. 2019, 15, 15–28. [Google Scholar] [CrossRef] [Green Version]
  30. Jang, S.; Li, S.; Sung, Y. Fasttext-based local feature visualization algorithm for merged image-based malware classification framework for cyber security and cyber defense. Mathematics 2020, 8, 460. [Google Scholar] [CrossRef] [Green Version]
  31. Vasan, D.; Alazab, M.; Wassan, S.; Naeem, H.; Safaei, B.; Zheng, Q. IMCFN: Image-based malware classification using fine-tuned convolutional neural network architecture. Comput. Netw. 2020, 171, 107138. [Google Scholar] [CrossRef]
  32. Xiao, G.; Li, J.; Chen, Y.; Li, K. MalFCS: An effective malware classification framework with automated feature extraction based on deep convolutional neural networks. J. Parallel Distrib. Comput. 2020, 141, 49–58. [Google Scholar] [CrossRef]
  33. Naeem, H.; Ullah, F.; Naeem, M.R.; Khalid, S.; Vasan, D.; Jabbar, S.; Saeed, S. Malware detection in industrial internet of things based on hybrid image visualization and deep learning model. Ad Hoc Netw. 2020, 105, 102154. [Google Scholar] [CrossRef]
  34. Saadat, S.; Raymond, V.J. Malware Classification Using CNN-XGBoost Model. In Artificial Intelligence Techniques for Advanced Computing Applications; Springer: Berlin/Heidelberg, Germany, 2021; pp. 191–202. [Google Scholar]
  35. Vasan, D.; Alazab, M.; Wassan, S.; Safaei, B.; Zheng, Q. Image-Based malware classification using ensemble of CNN architectures (IMCEC). Comput. Secur. 2020, 92, 101748. [Google Scholar] [CrossRef]
  36. Narayanan, B.N.; Davuluru, V.S.P. Ensemble malware classification system using deep neural networks. Electronics 2020, 9, 721. [Google Scholar] [CrossRef]
  37. Almomani, I.; Qaddoura, R.; Habib, M.; Alsoghyer, S.; Khayer, A.A.; Aljarah, I.; Faris, H. Android ransomware detection based on a hybrid evolutionary approach in the context of highly imbalanced data. IEEE Access 2021. [Google Scholar] [CrossRef]
  38. Roseline, S.A.; Sasisri, A.; Geetha, S.; Balasubramanian, C. Towards Efficient Malware Detection and Classification using Multilayered Random Forest Ensemble Technique. In Proceedings of the 2019 International Carnahan Conference on Security Technology (ICCST), Chennai, India, 1–3 October 2019; pp. 1–6. [Google Scholar]
  39. Ouahab, I.B.A.; Bouhorma, M.; Boudhir, A.A.; El Aachak, L. Classification of Grayscale Malware Images Using the K-Nearest Neighbor Algorithm. In Proceedings of the Third International Conference on Smart City Applications; Springer: Berlin/Heidelberg, Germany, 2019; pp. 1038–1050. [Google Scholar]
  40. Naeem, H.; Guo, B.; Naeem, M.R.; Ullah, F.; Aldabbas, H.; Javed, M.S. Identification of malicious code variants based on image visualization. Comput. Electr. Eng. 2019, 76, 225–237. [Google Scholar] [CrossRef]
  41. Krizhevsky, A.; Sutskever, I.; Hinton, G.E. Imagenet classification with deep convolutional neural networks. Adv. Neural Inf. Process. Syst. 2012, 25, 1097–1105. [Google Scholar] [CrossRef]
  42. Theckedath, D.; Sedamkar, R. Detecting Affect States Using VGG16, ResNet50 and SE-ResNet50 Networks. Sn Comput. Sci. 2020, 1, 1–7. [Google Scholar] [CrossRef] [Green Version]
  43. He, K.; Zhang, X.; Ren, S.; Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 27–30 June 2016; pp. 770–778. [Google Scholar]
  44. Hong, F.; Lu, C.; Jiang, W.; Ju, W.; Wang, T. RDNet: Regression Dense and Attention for Object Detection in Traffic Symbols. IEEE Sens. J. 2021. [Google Scholar] [CrossRef]
  45. Huang, G.; Liu, Z.; Van Der Maaten, L.; Weinberger, K.Q. Densely connected convolutional networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Honolulu, HI, USA, 21–26 July 2017; pp. 4700–4708. [Google Scholar]
  46. Szegedy, C.; Vanhoucke, V.; Ioffe, S.; Shlens, J.; Wojna, Z. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 27–30 June 2016; pp. 2818–2826. [Google Scholar]
  47. Zhou, B.; Lapedriza, A.; Khosla, A.; Oliva, A.; Torralba, A. Places: A 10 million image database for scene recognition. IEEE Trans. Pattern Anal. Mach. Intell. 2017, 40, 1452–1464. [Google Scholar] [CrossRef] [Green Version]
  48. Rezende, E.; Ruppert, G.; Carvalho, T.; Ramos, F.; De Geus, P. Malicious software classification using transfer learning of resnet-50 deep neural network. In Proceedings of the 2017 16th IEEE International Conference on Machine Learning and Applications (ICMLA), Cancun, Mexico, 18–21 December 2017; pp. 1011–1014. [Google Scholar]
  49. Sandler, M.; Howard, A.; Zhu, M.; Zhmoginov, A.; Chen, L.C. Mobilenetv2: Inverted residuals and linear bottlenecks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–22 June 2018; pp. 4510–4520. [Google Scholar]
  50. El-Hag, N.A.; Sedik, A.; El-Shafai, W.; El-Hoseny, H.M.; Khalaf, A.A.; El-Fishawy, A.S.; Al-Nuaimy, W.; Abd El-Samie, F.E.; El-Banby, G.M. Classification of retinal images based on convolutional neural network. Microsc. Res. Tech. 2021, 84, 394–414. [Google Scholar] [CrossRef] [PubMed]
  51. Hegazy, T.; Fazio, P.; Moselhi, O. Developing practical neural network applications using back-propagation. Comput. Aided Civ. Infrastruct. Eng. 1994, 9, 145–159. [Google Scholar] [CrossRef]
  52. Bera, S.; Shrivastava, V.K. Analysis of various optimizers on deep convolutional neural network model in the application of hyperspectral remote sensing image classification. Int. J. Remote Sens. 2020, 41, 2664–2683. [Google Scholar] [CrossRef]
  53. Jais, I.K.M.; Ismail, A.R.; Nisa, S.Q. Adam optimization algorithm for wide and deep neural network. Knowl. Eng. Data Sci. 2019, 2, 41–46. [Google Scholar] [CrossRef]
  54. Gao, H.; Yang, Y.; Lei, S.; Li, C.; Zhou, H.; Qu, X. Multi-branch fusion network for hyperspectral image classification. Knowl. Based Syst. 2019, 167, 11–25. [Google Scholar] [CrossRef]
  55. Ni, S.; Qian, Q.; Zhang, R. Malware identification using visualization images and deep learning. Comput. Secur. 2018, 77, 871–885. [Google Scholar] [CrossRef]
  56. Namanya, A.P.; Awan, I.U.; Disso, J.P.; Younas, M. Similarity hash based scoring of portable executable files for efficient malware detection in IoT. Future Gener. Comput. Syst. 2020, 110, 824–832. [Google Scholar] [CrossRef]
  57. Stamp, M.; Alazab, M.; Shalaginov, A. Malware Analysis Using Artificial Intelligence and Deep Learning; Springer: Berlin/Heidelberg, Germany, 2021; pp. 1–655. [Google Scholar]
Figure 1. Proposed visualized malware multi-classification framework.
Figure 1. Proposed visualized malware multi-classification framework.
Applsci 11 06446 g001
Figure 2. Architecture of the fine-tuned VGG16 model.
Figure 2. Architecture of the fine-tuned VGG16 model.
Applsci 11 06446 g002
Figure 3. Multi-classification confusion matrix.
Figure 3. Multi-classification confusion matrix.
Applsci 11 06446 g003
Figure 4. A sample of malware binary file sections and their corresponding fragments in the visualized version.
Figure 4. A sample of malware binary file sections and their corresponding fragments in the visualized version.
Applsci 11 06446 g004
Figure 5. Accuracy and loss curves for the fine-tuned VGG16 classification model.
Figure 5. Accuracy and loss curves for the fine-tuned VGG16 classification model.
Applsci 11 06446 g005
Figure 6. Confusion matrix of the fine-tuned VGG16 classification model.
Figure 6. Confusion matrix of the fine-tuned VGG16 classification model.
Applsci 11 06446 g006
Table 1. Comparison among the recent related works that have employed Malimg in their studies.
Table 1. Comparison among the recent related works that have employed Malimg in their studies.
WorkThe AimClassification ApproachModelInputAccuracy
[5]To propose a malware detection solution that handles imbalanced dataDeep learningDenseNetgray-scale images97.55%
[6]To develop a deep forest model by implementing a layered ensemble approachDeep Random ForestSliding Windowgray-scale images98.65%
[7]To develop a visualized malware classification system based on ANNANNScratch modelfile properties, gray-scale image99.135%
[8]To improve the accuracy of malware detection by combining AlexNet and Inception-v3 techniquesDCNN, SFTAAlexNetgray-scale images99.3%
[9]To implement a lightweight CNN to classify malware imagesLightweight CNNScratch modelgray-scale images97.68%
[29]To develop a file agnostic deep learning scheme to effectively group malware into families based on their patternsCNNScratch modelgray-scale images98.4%
[31]To implement a CNN classification system based on colored images of malwareCNNVGG16, ResNet50colored images98.82%
[34]To develop an accurate and fast classification system by integrating CNN with Gradient Boosting algorithmCNNXG-Boostgray-scale images98.7%
[32]To combine deep CNN with an entropy graph to enhance the malware pattern classification processCNNScratch modelgray-scale images99.67%
[33]To implement an industrial Internet of things malware classification system based on colored image visualizationDCNNScratch modelcolored images98.79%
[35]To implement a visualization-based malware detection system using VGG16 and ResNet50 CNN modelsCNNVGG16, ResNet50gray-scale images98.11%
[38]To perform malware classification by deploying a sequential multilayered Random Forest ensemble techniqueMLRF, Xgboost, ETC, LRgray-scale images98.91%
[39]To classify malware images using an image feature descriptor to extract the similarities among themMLKNNgray-scale images97%
[40]To deploy the local and global malicious patterns in the malware classification processMLLGMPgray-scale images98%
Table 2. Samples of 2D visualized malware images.
Table 2. Samples of 2D visualized malware images.
Applsci 11 06446 i001 Applsci 11 06446 i002 Applsci 11 06446 i003 Applsci 11 06446 i004
Adialer_CAgent_FYIAllaple_AAlueron_gen!J
Applsci 11 06446 i005 Applsci 11 06446 i006 Applsci 11 06446 i007 Applsci 11 06446 i008
Autorun_KDialplatform_BDontovo_AFakerean
Applsci 11 06446 i009 Applsci 11 06446 i010 Applsci 11 06446 i011 Applsci 11 06446 i012
Rbot!genLolyda_AA3VB_ATSwizzor_gen!E
Table 3. Various malware image widths for different malware files’ sizes.
Table 3. Various malware image widths for different malware files’ sizes.
Malware File SizeMalware Image Width
>1000 KB1024
500∼1000 KB768
200∼500 KB512
100∼200 KB384
60∼100 KB256
30∼60 KB128
10∼30 KB64
<10 KB32
Table 4. The tested fine-tuned CNN models and their input size.
Table 4. The tested fine-tuned CNN models and their input size.
No.Tested CNN ModelInput Image Size
1VGG16224 × 224 × 3
2AlexNet227 × 227 × 3
3DarkNet-53256 × 256 × 3
4DenseNet-201224 × 224 × 3
5Inception-V3299 × 299 × 3
6Places365-GoogleNet224 × 224 × 3
7ResNet-50224 × 224 × 3
8MobileNet-V2224 × 224 × 3
Table 5. The distribution of malware families among Malimg samples.
Table 5. The distribution of malware families among Malimg samples.
Malware TypeFamily Class NameClass IDNo. of ImagesPercentageTotal
WormVB_AT234084.37%5748
Yuner_A258008.56%
Allaple_A3294931.57%
Allaple_L4159117.03%
TrojanAlueron_gen!J51982.12%760
C2LOP_gen!g72001.56%
C2LOP_P81462.14%
Malex_gen!J171361.46%
Skintrim_N20800.86%
DialerAdialer_C11221.31%730
Dialplatform_B91771.89%
Instantaccess124314.61%
PWSLolyda_AA1132132.28%679
Lolyda_AA2141841.97%
Lolyda_AA3151231.32%
Lolyda_AT161591.70%
Trojan DownloaderDontovo_A101621.73%661
Obfuscator_AD181421.52%
Swizzor_gen!E211281.37%
Swizzor_gen!I221321.41%
Wintrim_BX24971.04%
RogueFakerean113814.08%381
BackdoorAgent_FYI21161.24%274
Rbot!gen191581.69%
Worm:AutoITAutorun_K61081.16%108
Total9341
Table 6. Evaluation metrics of the fine-tuned VGG16 classification model.
Table 6. Evaluation metrics of the fine-tuned VGG16 classification model.
Family NameAcc.Prec. (PPV)Rec. (TRP)Spec. (TNR)NPVFPRFNRFDRFORF1-ScoreMis Class. Rate
Adialer_C11111000010
Agent_FYI11111000010
Allaple_A11111000010
Allaple_L11111000010
Alueron_gen!J11111000010
Autorun_K11111000010
C2LOP_gen!g0.99890.9750.9750.99940.99940.00050.0250.0250.00050.9750.0011
C2LOP_P0.999410.965510.999500.034500.00050.98250.0005
Dialplatform_B0.999510.971410.999500.028600.00050.98550.0005
Dontovo_A11111000010
Fakerean11111000010
Instantaccess11111000010
Lolyda_AA10.99890.955610.998910.001100.044400.97730.0011
Lolyda_AA20.99840.97220.94590.99940.99890.00060.05410.02780.00110.95890.0016
Lolyda_AA311111000010
Lolyda_AT0.99950.969710.999510.000500.030300.98460.0005
Malex_gen!J0.99890.96270.9630.99950.99950.00050.0370.0370.00050.96290.0011
Obfuscator_AD11111000010
Rbot!gen0.999510.968710.999500.031300.00050.98410.0005
Skintrim_N11111000010
Swizzor_gen!E0.99890.96150.96150.99950.99950.00050.03850.03850.00050.96150.0011
Swizzor_gen!I0.99950.96310.999510.000500.03700.98110.0005
VB_AT11111000010
Wintrim_BX11111000010
Yuner_A11111000010
Average0.99970.99040.99010.99980.99980.00020.0010.00960.00020.99020.0003
Table 7. Average values of the evaluation metrics of the eight examined fine-tuned CNN classification models.
Table 7. Average values of the evaluation metrics of the eight examined fine-tuned CNN classification models.
Evaluation MetricVGG16AlexNetDarkNet-53DenseNet-201Inception-V3Places365-GoogleNetResNet-50MobileNet-V2
Acc.0.99970.99960.99960.99960.99950.99950.99940.9994
Prec. (PPV)0.99040.98570.98970.98680.98660.98340.97990.9775
Rec. (TPR)0.99010.98580.9860.98670.98380.98360.97890.9771
Spec. (TNR)0.99980.99980.99980.99980.99980.99970.99970.9997
NPV0.99980.99980.99980.99980.99980.99970.99970.9997
FPR0.00020.00020.00020.00020.00020.00030.00030.0003
FNR0.0010.01420.0140.01190.01620.01640.02110.0229
FDR0.00960.01430.01030.01320.01340.01660.02010.0225
FOR0.00020.00020.00020.00020.00020.00030.00030.0003
F1-Score0.99020.98570.98770.98590.98320.98320.97850.977
Mis Class. Rate0.00030.00040.00040.00040.00050.00050.00060.0006
Table 8. Experimental specifications and execution time of the tested FT CNN-based TL models.
Table 8. Experimental specifications and execution time of the tested FT CNN-based TL models.
CNN ModelNo. of LayersStorage Requirement (MB)Total No. of Parameters (Millions)Non-Trainable ParametersTrainable ParametersTotal Execution Time (s)Avg. Time per Malware (s)Reduced Training Parameters (%)
VGG1616515138137,897,600102,40066000.706599.92
AlexNet82276160,897,600102,40023400.250599.83
DarkNet535315541.641,574,40025,60049800.533199.93
DenseNet-2012011672019,952,00048,00081600.873699.76
InceptionV3488923.923,848,80051,20064200.687399.78
Places365-GoogleNet222776,974,40025,60022200.237799.63
ResNet50509625.625,548,80051,20034200.366199.80
MobileNetV253133.53,468,00032,00033600.359799.08
Table 9. Comparative analysis between the proposed multi-classification framework and related ML and DL-based malware multi-classification approaches tested on the Malimg dataset.
Table 9. Comparative analysis between the proposed multi-classification framework and related ML and DL-based malware multi-classification approaches tested on the Malimg dataset.
ModelAcc. (%)Prec. (%)Rec. (%)F1-Score (%)
[5]97.5597.4397.5097.46
[6]98.6598.8698.6398.74
[7]99.14---
[8]99.30-96.00-
[9]97.6898.0098.0098.00
[29]98.40--97.45
[31]98.8298.8598.8198.75
[32]99.6799.02--
[33]98.7998.7998.4798.46
[34]98.70---
[35]98.1198.5398.6498.24
[38]98.9199.0099.0099.00
[39]97.0097.0097.0097.00
[40]98.0098.2098.4097.10
Proposed99.9799.0499.0199.02
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

El-Shafai, W.; Almomani, I.; AlKhayer, A. Visualized Malware Multi-Classification Framework Using Fine-Tuned CNN-Based Transfer Learning Models. Appl. Sci. 2021, 11, 6446. https://doi.org/10.3390/app11146446

AMA Style

El-Shafai W, Almomani I, AlKhayer A. Visualized Malware Multi-Classification Framework Using Fine-Tuned CNN-Based Transfer Learning Models. Applied Sciences. 2021; 11(14):6446. https://doi.org/10.3390/app11146446

Chicago/Turabian Style

El-Shafai, Walid, Iman Almomani, and Aala AlKhayer. 2021. "Visualized Malware Multi-Classification Framework Using Fine-Tuned CNN-Based Transfer Learning Models" Applied Sciences 11, no. 14: 6446. https://doi.org/10.3390/app11146446

APA Style

El-Shafai, W., Almomani, I., & AlKhayer, A. (2021). Visualized Malware Multi-Classification Framework Using Fine-Tuned CNN-Based Transfer Learning Models. Applied Sciences, 11(14), 6446. https://doi.org/10.3390/app11146446

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop