# Vulnerability Detection and Classification of Ethereum Smart Contracts Using Deep Learning
## 5 Conclusions  
Smart contracts are of great importance in achieving the integrity of data and transactions in the blockchain. However, the vulnerabilities targeting smart contracts may limit their ability to be widespread. Therefore, this study aims to promote the use of smart contracts and preserve data and transactions by providing an enhanced methodology for the \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Ref.** & **Algorithm/Matrix** & **Accuracy** & **F1-Score** & **Precision** & **Recall** \\ \hline This study & RF-RGB (Binary classification) & 0.86666 & 0.86666 & 0.86635 & 0.86671 \\ \hline This study & RF-RGB-Approach 1 (Multi-label classification) & 0.88389 & 0.78269 & 0.88134 & 0.70391 \\ \hline This study & RF-GRAY Approach 2 (Multi-label classification) & 0.88185 & 0.84553 & 0.86565 & 0.82633 \\ \hline This study & VGG19-RGB-Approach 3 (Multi-label classification) & 0.89142 & 0.85872 & 0.85091 & 0.86668 \\ \hline
[39] & ResNet1D (Multi-label classification) & 0.7353 & 0.8381 & - & - \\ \hline
[39] & ResNet (Multi-label classification) & 0.6841 & 0.7928 & - & - \\ \hline
[39] & Inception (Multi-label classification) & 0.6988 & 0.8015 & - & - \\ \hline
[39] & LSTM Baseline (Multi-label classification) & 0.6934 & 0.7953 & - & - \\ \hline
[22] & LSTM (Multi-label classification) & - & 0.77 & 0.88 & 0.70 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Comparison between this study and previous studies. identification and classification of their possible vulnerabilities. Deep learning algorithms, namely ResNet50, VGG19, DenseNet201, KNN, and RF, were used to detect and classify vulnerabilities found in smart contracts by utilizing binary and multi-label classification techniques using two types of image formats: the RGB and grayscale images from two different datasets. Interestingly, this research is the only and the first one that focused on binary classification in terms of studying and applying deep- and machine-learning algorithms to vulnerabilities targeting smart contracts. In that regard, the RF algorithm is considered to have the best performance in binary classification. Furthermore, we found that RGB images are better than grayscale images for binary classification tasks, with an accuracy of 86.66% and an F1 score of 86.66%. On the other hand, when moving to multi-label classification, RF using RGB images emerged as the standout algorithm in detecting vulnerabilities targeting smart contracts based on the results of the three multi-label classification approaches used in this study, achieving an impressive accuracy of 88.38%, F1-score of 78.26%, precision of 88.13%, and recall of 70.39%. The confusion matrices emphasized the result of VGG19-RGB's balanced predictions, emphasizing its reliability in categorizing positive and negative instances. In the realm of multi-label classification under VGG19 with RGB images, approach three, which deletes categories with low precision, exhibited exceptional performance with perfect scores across various metrics, suggesting a high capacity to predict vulnerabilities with an accuracy of 89.14% and an F1-score of 85.87%. The choice of the best algorithm ultimately depends on the specific requirements of the task. For binary classification of RGB images, RF is recommended, while VGG19-RGB excels in multi-label classification using the third approach when deleting classes with low accuracy. In the first two approaches, RF stands out with high performance, due to providing estimates of the importance of the selected features in classification to understand the impact of each feature and combining multiple trees predictions, which also positively affects performance. However, considerations such as interpretability, computational efficiency, and the nature of the task must guide the choice of the algorithm for effective vulnerability detection and classification.