# Vulnerability Detection and Classification of Ethereum Smart Contracts Using Deep Learning
## 4 Results and Discussion
### Results of Multi-Label Classification  
The multi-label classification in the context of vulnerability detection involves the classification of the multi-dataset into one or multiple classes. Five algorithms including RF, KNN, DenseNet201, VGG19, and ResNet50 were used in multi-label classification based on both RGB and grayscale images. These algorithms were investigated by applying the three approaches detailed in Section 3, to ensure the best and most accurate results. Each approach differs from the other by the nature of the dataset used. The second and the third approaches were applied to better balance the dataset and increase accuracy. The most important insights into the performance metrics of these algorithms and approaches are given in Table 3. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**No.** & **Model-Based Multi-Label Classification** & **Accuracy** & \
\begin{tabular}{c} **F1-Score (Micro)** \\ \end{tabular} & **Precision** & **Recall** &
\begin{tabular}{c} **Time Spent (s)** \\ \end{tabular} \\ \hline
1 & VGG19-RGB & 0.86435 & 0.76467 & 0.77208 & 0.75740 & 8051 \\ \hline
2 & VGG19-RGB & 0.81288 & 0.78753 & 0.79379 & 0.78136 & 1988 \\ \hline
3 & VGG19-RGB & 0.89142 & 0.85872 & 0.85091 & 0.86668 & 2160 \\ \hline
4 & VGG19-GRAY & 0.80616 & 0.67648 & 0.67083 & 0.68222 & 6449 \\ \hline
5 & VGG19-GRAY & 0.73714 & 0.73509 & 0.67307 & 0.80970 & 2412 \\ \hline
6 & VGG19-GRAY & 0.84078 & 0.80637 & 0.76479 & 0.85273 & 1593 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: The performance metrics of models used in multi-label classification. In terms of the first approach, where none of the labels were deleted while resampling was applied to obtain a balanced dataset, Table 3 shows that the RF algorithm based on RGB images has provided the best results. The obtained accuracy and F1-score results were 88.39% and 78.27%, respectively. The RF algorithm based on grayscale images has also achieved the second-highest performance metric and provided results almost like those of RGB images. Accordingly, RF can be considered as the best algorithm when considering all the labels of the multi-dataset. The VGG19 algorithm based on RGB images  
has achieved good results as well, and can be considered the second-best algorithm for this approach when performing multi-label classification. The accuracy and F1-score reached 86.43% and 76.46%, respectively. Yet, when applying this approach to grayscale images, the performance metrics were lower than those of RGB images. The accuracy declined to 80.61% and the F1-score to 67.64%. Hence, it is not possible to generalize that the VGG19 algorithm is suitable for the classification of all vulnerabilities. The results obtained based on ResNet50 were almost like VGG19-Gray. The DenseNet201 and KNN algorithms could not be trained using the first approach either on RGB images or grayscale images due to the prolonged time required for the training and the limitation of the available devices. In terms of the second approach, where labels with few repetitions have been deleted and combined in one class called 'Others', Table 3 shows that the RF has again achieved clear superiority in this approach. The accuracy in grayscale images reached 88.18% and the F1-score 84.55%. As for the RGB images, there was a slight decrease, as the accuracy reached 84.25% and the F1-Score was 81.95%. VGG19-RGB and KNN based on both RGB, and grayscale images have achieved the second-best results after RF, with their accuracy and F1-score around 81.5% and 79%, respectively. The results of the remaining algorithms were around 74% for both accuracy and F1-score values. In terms of the third approach, where low-accuracy labels have been deleted and combined in one class called 'Others', Table 3 shows that the VGG19 algorithm based on RGB images has provided the best performance metrics. An accuracy level of 89.14%, an F1-score of 85.87%, a precision of 85.09%, and a recall of 86.66% were achieved.