# Improving the Robustness of AI-Based Malware Detection Using Adversarial Machine Learning
## 7 Results
### Anamoly Detection  
The following part shows the model attempting to discover anomalies in the supplied image and classify them in the appropriate class. Initially, the model tries to reason with a standard malware/benign image, for which the column with anomaly detection can be seen.  
Malicious anomalies are more common in the'red' part of the image, while malicious anomalies are less common in the 'blue' region. The anomaly occurrences vary very intriguingly once the adversarial pictures for the attack have been generated. In some cases, it is seen that the true malicious anomalies are now completely masked due to the perturbations, as seen in the case of Vilsel and Expiro.  
This phenomenon has the potential to deceive the learning model, resulting in the misclassification of such classes. However, in other circumstances, the assault is unable to disguise malevolent anomalies. It can be shown, for example, that the anomalies of the Hlux class are not hidden. Table 6 shows visualization of the anomaly detection of normal image and an adversarial image.  
\begin{table}
\begin{tabular}{c c c c c c c c c c} \hline \hline \multirow{2}{*}{**Class**} & \multicolumn{4}{c}{**Random Forest**} & \multicolumn{4}{c}{**CNN**} & \multicolumn{4}{c}{**EfficientNet B0**} \\ \hline  & Accuracy (\%) & F1-Score & Precision & Accuracy (\%) & F1-Score & Precision & Accuracy (\%) & F1-Score & Precision \\ Elex & 96.72 & 0.97 & 0.97 & 96.72 & 0.97 & 0.97 & 100 & 0.99 & 1 \\ Vissel & 100 & 0.99 & 1 & 100 & 0.99 & 1 & 100 & 0.99 & 0.99 \\ Expiro & 80.23 & 0.84 & 0.8 & 72.22 & 0.76 & 0.72 & 92.5 & 0.94 & 0.92 \\ Hlux & 100 & 0.99 & 0.99 & 100 & 0.99 & 0.99 & 98.57 & 0.99 & 0.99 \\ Autorum & 88.31 & 0.89 & 0.88 & 86.36 & 0.88 & 0.86 & 86.66 & 0.9 & 0.87 \\ Other & 74.28 & 0.78 & 0.74 & 85.5 & 0.87 & 0.86 & 91.3 & 0.92 & 0.91 \\ (Benign) & \multicolumn{4}{c}{**After Attack (0.1 Epsilon)**} \\ \hline  & \multicolumn{4}{c}{**Random Forest**} & \multicolumn{4}{c}{**CNN**} & \multicolumn{4}{c}{**EfficientNet B0**} \\ \hline  & Accuracy (\%) & F1-Score & Precision & Accuracy (\%) & F1-Score & Precision & Accuracy (\%) & F1-Score & Precision \\ Elex & 63.23 & 0.65 & 0.63 & 61.28 & 0.61 & 0.61 & 72.34 & 0.74 & 0.73 \\ Vissel & 84.52 & 0.85 & 0.84 & 88.02 & 0.9 & 0.88 & 98.04 & 0.98 & 0.98 \\ Expiro & 55.46 & 0.42 & 0.39 & 53.64 & 0.57 & 0.54 & 68.42 & 0.7 & 0.69 \\ Hlux & 83.66 & 0.85 & 0.84 & 85.39 & 0.86 & 0.86 & 96.32 & 0.97 & 0.97 \\ Autorum & 48.93 & 0.5 & 0.49 & 52.42 & 0.55 & 0.52 & 50.69 & 0.51 & 0.51 \\ Other & 46.23 & 0.49 & 0.47 & 62.8 & 0.63 & 0.63 & 70.22 & 0.69 & 0.69 \\ \hline  & \multicolumn{4}{c}{**After Defense**} \\ \hline
**Classes** & \multicolumn{4}{c}{**Random Forest**} & \multicolumn{4}{c}{**CNN**} & \multicolumn{4}{c}{**EfficientNet B0**} \\ \hline  & Accuracy (\%) & F1-Score & Precision & Accuracy (\%) & F1-Score & Precision & Accuracy (\%) & F1-Score & Precision \\ Elex & 91.21 & 0.68 & 0.69 & 94.02 & 0.73 & 0.73 & 96.92 & 0.97 & 0.97 \\ Vissel & 95.33 & 0.98 & 0.98 & 96.87 & 0.93 & 0.93 & 97.23 & 0.99 & 0.97 \\ Expiro & 71.23 & 0.65 & 0.62 & 72.07 & 0.42 & 0.39 & 90.06 & 0.92 & 0.9 \\ Hlux & 97.01 & 0.97 & 0.95 & 97.32 & 0.86 & 0.86 & 97.51 & 0.95 & 0.98 \\ Autorum & 86.39 & 0.51 & 0.51 & 85.05 & 0.55 & 0.52 & 86.55 & 0.89 & 0.87 \\ Other (Benign) & 70.44 & 0.49 & 0.47 & 82.14 & 0.63 & 0.63 & 88.94 & 0.89 & 0.89 \\ \hline \hline \end{tabular}
\end{table}
Table 6: Anomaly detection for normal image and adversarial image.  
\begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline \multicolumn{1}{c}{} & \multicolumn{4}{c}{**Before Attack**} \\ \hline
**Classes** & \multicolumn{4}{c}{**Random Forest**} & \multicolumn{4}{c}{**CNN**} & \multicolumn{4}{c}{**EfficientNet B0**} \\ \hline  & Accuracy (\%) & F1-Score & Precision & Accuracy (\%) & F1-Score & Precision & Accuracy (\%) & F1-Score & Precision \\ Elex & 63.23 & 0.65 & 0.63 & 61.28 & 0.61 & 0.61 & 72.34 & 0.74 & 0.73 \\ Vissel & 84.52 & 0.85 & 0.84 & 88.02 & 0.9 & 0.88 & 98.04 & 0.98 & 0.98 \\ Expiro & 55.46