# Vulnerability Detection and Classification of Ethereum Smart Contracts Using Deep Learning
## 4 Results and Discussion
### Results of Binary Classification
The reason could be due to the sensitivity to choosing k. As for the ResNet50 algorithm, the increase in false positives (125) and false negatives (96) in Figure 18 indicates less accurate prediction performance. Compared to ResNet50-GRAY, Figure 17 shows an improvement in false positives (120) and a decrease in false negatives (66), and the ResNet50 algorithm with RGB images is the second-best algorithm for second classification. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**No.**} & **Algorithm-Image** & \multirow{2}{*}{**Accuracy**} & \multirow{2}{*}{**F1-Score**} & \multirow{2}{*}{**Precision**} & \multirow{2}{*}{**Recall**} & \multirow{2}{*}{**Time Spent (s)**} \\  & **Format** & & & & & \\ \hline
1 & ResNet50-RGB & 0.84102 & 0.84102 & 0.8443735 & 0.83926 & 1401 \\ \hline
2 & VGG19-RGB & 0.80085 & 0.80085 & 0.80073 & 0.80106 & 3009 \\ \hline
3 & KNN-RGB & 0.77008 & 0.77008 & 0.7836855 & 0.765018 & 10,800 \\ \hline
4 & Random Forest-RGB & 0.86666 & 0.86666 & 0.866355 & 0.8667155 & 9000 \\ \hline
5 & DenseNet201-RGB & 0.82307 & 0.82307 & 0.82723 & 0.82102 & 4911 \\ \hline
6 & ResNet50-GRAY & 0.811111 & 0.811111 & 0.81186 & 0.81004 & 597 \\ \hline
7 & VGG19-GRAY & 0.82136 & 0.82136 & 0.82576 & 0.81925 & 952 \\ \hline
8 & KNN-GRAY & 0.790598 & 0.790598 & 0.81062 & 0.78490 & 9800 \\ \hline
9 & Random Forest-GRAY & 0.85641 & 0.85641 & 0.85666 & 0.85556 & 9900 \\ \hline
10 & DenseNet201-GRAY & 0.80598 & 0.80598 & 0.80754 & 0.80455 & 9870 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: The performance metrics of models used in binary classification. Figure 15: VGG19-RGB-Binary. Figure 16: VGG19-GRAY-Binary. Figure 17: ResNet50-RGB-Binary. Figure 18: ResNet50-GRAY–Binary. Figure 21: Random Forest-RGB-Binary. Figure 19: DenseNet201-RGB-Binary. Figure 20: DenseNet201-GRAY–Binary. Figure 23: KNN-RGB-Binary. Figure 24: KNN-GRAY-Binary. Figure 15:0 Random Forest-GRAY-Binary. As for the DenseNet201 and VGG19 algorithms for grayscale and RGB images, the increases in DenseNet201 TP, TN, FP, and FN were slight compared to VGG19, as shown in Figures 15, 16, 19 and 20, where the DenseNet201 algorithm for both RGB and grayscale image types was as follows: 430, 533, 135 533, 431, 512, 134 and 93. Finally, the results of the confusion matrix of the VGG19 algorithm for RGB and grayscale images were 456, 481, 109, 124, 428, 533, 137, and 72. DenseNet201 results are better, due to the number of layers and to the nature of its structure being better than VGG19, which is considered unsuitable compared to DenseNet201 and the other algorithms used. The results of RGB images being better than grayscale images in binary classification can be attributed to the richer and more detailed information provided by color channels. With their three-color channels--Red, Green, and Blue--RGB images can capture the subtle subtleties and complex color patterns that grayscale images, which only have one intensity channel, may be unable to capture. When the classification job depends on color-related features, this extra color information improves feature discrimination and enables the representation of intricate color patterns. Color information can transmit more complete and discriminative visual qualities which are important to the classification problem, which is generally why RGB is superior to grayscale. So, in image classification, RGB images are better than grayscale images, and the best algorithm is RF. The result of the f1-score is 0.86666.