## 3 Methodology
### Image Augmentation  
The imbalanced datasets are a communal problem in computer vision and harm classification problems. A deficiency of images in each class may cause under-fitting and over-fitting [10], which has a large influence on the performance of the DCNNs. Hence, to overcome this problem, a data augmentation method is proposed within the malware datasets to enhance the classifier performance. Image augmentation is a method that is used to increase the dataset that is commonly used to train the neural network [49]. In the augmentation phase, we generate new data from classes that have less population in the dataset [50]. This process overcomes the restrictive impact on data to avoid uneven representation. To escape over-fitting complications successfully, proper data augmentation schemes can be helpful and improve the strength of the model. Let \(D_{1}\) be a given malware dataset, \(D_{1}=\{a_{i}\ldots\ldots\ldots a_{n}\}\), where \(a_{n}\) represents the \(n\)th image sample in the dataset. Assume that \(a_{n}\) has N pixels. The pixel coordinate matrix \(A_{k}\) for \(a_{j}\) is given below in Equation (2). Figure 2: Conversion process of malware binaries into grayscale images for further processing. \[A_{k}=\left[ \begin{array}{ccc}x_{1}&y_{1}&1\\ x_{2}&y_{2}&1\\.&.&.\\ x_{N}&y_{N}&1\end{array} \right] \tag{2}\]  
here each row shows similar coordinates of one pixel. For data augmentation on image \(a_{n}\), we apply an affine transform matrix, \(p\), on the coordinate matrix, \(M_{k}\), and obtain a transformed coordinate matrix, \(M_{t}^{k}\), for the image. The operation is given in Equation (3) as follows:  
\[M_{t}^{k}=p*M_{k}, \tag{3}\]  
where each row of \(M_{t}^{k}\) is the transformed coordinate for one pixel. The transform matrix operations are also shown in Table 2.  
There are different approaches to decide the affine transformation matrix M. We utilize three sorts of arbitrary irritations for creating new augmentation data as follows. Flipping operation flips the image along the horizontal dimension. Rotation operation pivots the image with a point inspected from \(0^{\circ}\) to \(180^{\circ}\). Scaling operation moves the image in both the x and y dimension of the image. The respective affine transform matrices are shown in Table 2, where \(\beta\) shows the angle of rotation \(T_{x}\), and \(T_{y}\) shows the balances on the arrange hub. Let \(a_{k}\) be a given image the augmented details denote as \(A_{k}\), and the dataset is denoted as \(D_{1}\). The augmentation process is formulated in the following equations:  
\[A_{k}=[T_{1}(a_{k}),T_{2}(a_{k}),T_{3}(a_{k})], \tag{4}\]  
\[D_{1}=\{A_{1}\dots\dots\dots A_{k}\}=\cup_{k=1}^{k}\cup_{j=1}^{3}\ T_{i}(a_{k}), \tag{5}\]  
where \(T_{1}\) is flipping, \(T_{2}\) is rotation, and \(T_{3}\) is scaling operations. The expanded dataset, \(D_{1}\), alongside the compared class names, is then employed to train a deep CNN with the end goal of malware recognition and classification. It ought to be noticed that we misuse flips, rotation, and scaling as the data augmentation tasks since they do not modify the texture topologies in malware classes, as shown in Figure 3.  
\begin{table}
\begin{tabular}{c  
The augmentation process for example flips, rotates, and scales up a decent variety of training data and improves the classification accuracy of deep CNNs. The data augmentation method in Algorithm 1 describes how the malware images are rotated and flipped to deal with the problem of class imbalance, as given in Algorithm 1. ```
0: Malware images \(Y=\left\{(y_{i}),i=1,2,3........,X_{y}\right\}\), image flipping (Vertical and Horizontal) and rotation \(MR=mr_{k},k=1,2,........,mil_{xi}\) where \(mr_{k}\) is the rotation angle. 0: Rotation of malware image \(RI\) and flipped malware image \(FI\). 1:for each Image \(y_{i}\in Y\) do
2:for\(k=1\) to
3: Angle of rotation \(mr_{k}\) to \(X_{y}\)
4:endfor
5:for\(MI=\left\{Horizontal,Vertical\right\}\)
6: Flipping
7:endfor
8:endfor
9:return\(RI\) and \(FI\)
```  
**Algorithm 1** Malware Image Augmentation