# Image-Based Malware Detection Using \(\alpha\)-Cuts and Binary Visualisation
## 3 Materials and Methods
### Generating More Image Datasets Based on \(\alpha\)-Cuts. #### 3.4.1 Creating Crisp Sets with an \(\alpha\)-Cut  
One of the most important concepts of fuzzy sets is the \(\alpha\)-cut: According to [67], given a fuzzy set \(\bar{A}\) defined on the universal set \(X\) and any number \(\alpha\in[0,1]\), the \(\alpha\)-cut \({}^{\alpha}A\) is the crisp set  
\[{}^{\alpha}A=\{x\mid\mu_{\bar{A}}(x)\geq\alpha\}.\]  
More precisely, the \(\alpha\)-cut of a fuzzy set \(\bar{A}\) is the classical set \({}^{\alpha}A\) that contains all the elements of \(X\) that belong to \(\bar{A}\) with a membership degree that is greater than or equal to the value \(\alpha\). To put it differently, any element \(x\in{}^{\alpha}A\) is also an element of \(\bar{A}\) with a degree of membership that is greater or equal to the \(\alpha\) value [75]. It is worth noting that, in the literature, \(\alpha\)-cuts are sometimes called \(\lambda\)-cuts (or _lambda_ cuts). In Section 3.3, we fully addressed the process of converting files into images. Next, we incorporated the concept of \(\alpha\)-cuts on that first image dataset to create more image datasets that could potentially improve detection. It is worth noting that this technique was implemented on the finished image dataset, or, in other words, after each pixel had its colour tone adjusted. To achieve this, we treated the RGB colour channels of each image as fuzzy sets and reduced them into \(\alpha\)-cut sets. More specifically, we considered each colour (red, green, and blue) to be a fuzzy set, where each colour value denoted the degree of membership to this particular set. The shape of the fuzzy colour set, which is identical for all three colours, is displayed in Figure 4, along with an \(\alpha\)-cut as an example. According to this shape, the red, green, and blue fuzzy sets were reduced to an \(\alpha\)-cut of the form \({}^{\alpha}A=[a,1]\). Practically, this meant that any values (for the red, green, or blue fuzzy set, respectively) that were greater than or equal to \(\alpha\) became equal to 1 and the rest became equal to 0. We provide an example of this practice in Figure 5 for \(\alpha=0.3\). At the pixel level, in terms of colour theory, reducing images to their \(\alpha\)-cuts translates into a sparser representation of colour in the image. For example, after taking an \(\alpha\)-cut of an image with an \(\alpha=0.3\), a pixel with previously RGB values of [0.35, 0.17, 0.58] would become [1, 0, 1]. Naturally, images that are \(\alpha\)-cuts of other images are comprised of only 8 solid colours, namely, black ([0, 0, 0]), white ([1, 1, 1]), red ([1, 0, 0]), green ([0, 1, 0]), blue ([0, 0, 1]), yellow ([1, 1, 0]), magenta ([1, 0, 1]), and cyan ([0, 1, 1]). In other words, they include all possible combinations of 0 and 1 in the RGB colour model (\(2^{3}=8\)). Essentially, this whole process generates a new image, as the new values per pixel create new colourings. Figure 3: The H-curve, a Hamiltonian curve, was discovered by [74] in 1997. This is the sequential order for a 16 \(\times\) 16 representation. In our study, we tried several \(\alpha\) values on images from the initial dataset. More specifically, we extracted \(\alpha\)-cuts for \(\alpha=\{0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9\}\). According to the shape we chose to represent the fuzzy set colour (see Figure 4), it was interesting to observe the graduate darkening of colours as we increase \(\alpha\). However, for our experiments, due to large running times, we run our experiments for the original unprocessed image dataset and reduced image datasets that resulted from \(\alpha=0.3\) and \(\alpha=0.6\). In Figure 6, we display a malicious image and the various \(\alpha\)-cut images from 0.1 to 0.9. We also display the same processing to a natural image (a non-synthetic one) in Figure 7, to better convey the concept of colour segmentation. Figure 4: The fuzzy set for the value _colour_. Here, we display the colour _Red_, although the same shape applies for _Green_ and _Blue_.