Vulnerability Detection and Classification of Ethereum Smart Contracts Using Deep Learning
Abstract
:1. Introduction
- Novelty in Binary Classification: to the best of the author’s knowledge, this study is the first known research to explore binary classification for Ethereum smart contract vulnerabilities using deep learning algorithms.
- Effectiveness in Classification Approach: to the best of the author’ knowledge, and according to experimental results, this study outperforms the currently available literature on multi-label classification for Ethereum smart contract vulnerabilities using deep learning algorithms.
- Real-world Dataset and Algorithm Evaluation: this work utilizes a novel, real-world smart contract dataset for classification using five deep learning algorithms (ResNet50, VGG19, DenseNet201, KNN, and RF). This allows for a comprehensive evaluation of their effectiveness based on real-world data
- Innovative Data Representation: this research introduces a unique approach of converting smart contracts’ bytecode into RGB and grayscale images. Then, the effectiveness of this image conversion process in achieving optimal accuracy and F1-score for vulnerability detection is verified.
2. Related Work
- (a)
- Arithmetic (ARTHM): Defines the integer overflow/underflow. An Arithmetic vulnerability occurs when an arithmetic operation in a smart contract exceeds a type’s maximum or minimum size. This type of vulnerability occurs when an arithmetic operation creates a numeric value that can be represented by a certain number of bits out of the range so that the values are set up to the maximum or minimum size of the representable value. The attacker can exploit the Arithmetic vulnerability and change the behavior of the smart contract unexpectedly, which leads to tampering with the smart contract or performing unauthorized actions [23,24].
- (b)
- Denial of Service (DoS): Smart contracts are categorized based on two types of DoS: DoS with a Failed Call and DoS Block Gas Limit. DoS with Block Gas Limit occurs when the gas limit specified for the block set by the Ethereum network is exceeded. Each function or procedure within smart contracts has a certain amount of gas that should not be exceeded when executing these functions or deploying smart contracts. DoS with Failed Call represents the failure (intentionally or unintentionally) to make external calls, and this usually occurs when there are many calls in the same single transaction [15,25,26].
- (c)
- Locked Ether (LE): A payable function increases the balance of the contract from ether so that when the contract is executed, the funds are reserved without being paid. This will not allow the expected ether to be received due to the job’s execution. Such vulnerabilities occur on private Ethereum contracts [16,27].
- (d)
- Reentrancy (RENT): A recursive call attack that occurs during the execution of the first call to the function so that the malicious contract invokes the call contract before the execution of the first call is completed. Invitations within a function can cause it to interact in undesirable ways [16,28].
- (e)
- Block values as a proxy for time (TimeM): In some cases, unsafe values, such as “block. number” and “block. timestamp”, are used to obtain the time values that some functions need to be executed. In smart contracts, such values can provide an idea regarding the current time or time delta between blocks required to trigger events. Since the block time is not constant and provides no precise values, this may create unexpected effects [29].
- (f)
- Transaction Order Dependence (TimeO): The vulnerability is caused by Ethereum’s block processing, where miners prioritize transactions with high gas prices. Transactions sent to the network are distributed to nodes for processing, allowing node operators to predict their order. A race condition vulnerability occurs when code relies on the transaction sequence, which will impact the outcomes. In addition, this matter is frequently and significantly repeated with rewards or approvals, as it leads to unintended token transfers, which happens in ERC20 tokens [30].
- (g)
- Unchecked Call Return Value (UE): This vulnerability occurs when the return values from different calls are not checked in the smart contract code, mainly when low-level calling methods are used. The effect of this vulnerability is that the call fails by mistake or intentionally because of the attacker who exploited its presence, in addition to an unexpected change in behavior [31].
- (h)
- Authorization through tx-origin (TX-Origin): This vulnerability occurs when returning the account address that sent the transaction and authorizing the “tx.origin” variable to return it. The “tx.origin” is a variable found in Solidity, and its purpose is to return the account that sent the transaction. However, using the “tx.origin” variable is not secure, and risks the smart contract. This may be due to sending another address of a malicious smart contract instead of calling the account address that sent the transaction. This could change the behavior of the smart contract unexpectedly [32,33].
Classification and Detection of Vulnerabilities in Smart Contracts
3. Methodology
3.1. Preparation of the Dataset
3.1.1. Datasets Used
- The ScrawlD dataset, comprising 9253 smart contracts, represents the first real-world dataset labeled for vulnerabilities. There were two phases to the labeling process: the first phase included 6780 labeled smart contracts, and the second phase, which took place a few months later, had 9123 labeled smart contracts [20]. Five distinct tools were used, each with various versions and dependencies, making it difficult to label the full dataset at once and creating compatibility problems [20]. The Mythril tool’s large memory usage—roughly 10 GB—also made things more difficult [20]. The process of labeling smart contracts for vulnerabilities requires using tools like smart-check and Mythril. The “majority of results” standard was used, which means that if two or more tools found a vulnerability, it was confirmed to be present. Furthermore, this process consumes a lot of time. The dataset, and its labeled vulnerabilities, are publicly available on GitHub [40].
- The Slither dataset is an extensive assemblage of 35,000 smart contracts that represent the heterogeneous terrain of Ethereum-driven applications. The Slither dataset has been labeled based on no-vulnerabilities and vulnerabilities, Shadowing, Uninitialized variables, Suicidal Contracts, and arbitrary sending of ether vulnerabilities and safe smart contracts. Interestingly, this work used a sample of this dataset, which included 3000 smart contracts with safe labels (no vulnerability) [20]. The choice of contracts with safe labels emphasizes the need to find security flaws and vulnerabilities in the bytecodes. This was made possible in large part by the Slither tool, which was created as a platform for static analysis of the Ethereum smart contract [21].
3.1.2. Extraction
3.1.3. Contract Filtering and Selection
3.1.4. Image Representation
3.2. Binary Classification
3.2.1. Binary Classification Using VGG19
3.2.2. Binary Classification Using ResNet50
3.2.3. Binary Classification Using DenseNet201
3.2.4. Binary Classification Using Random Forests
3.2.5. Binary Classification Using KNN
3.3. Multi-Label Classification
- (a)
- Approach 1: Multi-label classification using all the labels contained in the dataset. This method was carried out by using the eight vulnerabilities: ARTHM, DOS, RENT, TimeM, TimeO, UE, LE, and TX-Origin.
- (b)
- Approach 2: Multi-label classification with the deletion of labels with few repetitions. Four of the vulnerabilities ‘DOS, TimeO, UE and TX-Origin’ were deleted and replaced with one class under the name ‘Others’.
- (c)
- Approach 3: Multi-label classification with the deletion of low-accuracy labels. Four of the vulnerabilities ‘UE, LE, DOS and ARTHM’ were deleted and replaced with one class under the name ‘Others’. This makes the dataset used in this approach more balanced and, hence, gives better accuracy.
Multi-Label Classification with Deep Learning Algorithms Using the Three Different Approaches
3.4. Performance Metrics
- F1-Score: This is the harmonic meaning between precision and accuracy. Also, the F1-score is used to provide a balanced assessment of a model’s performance and handle the complexities introduced by the multiple labels in multi-label classification [60].
4. Results and Discussion
4.1. Results of Binary Classification
4.2. Results of Multi-Label Classification
4.3. Comparative Study
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Wen, Y.; Lu, F.; Liu, Y.; Huang, X. Attacks and countermeasures on blockchains: A survey from layering perspective. Comput. Netw. 2021, 191, 107978. [Google Scholar] [CrossRef]
- Alizadeh, M.; Andersson, K.; Schelen, O. A survey of secure internet of things in relation to blockchain. J. Internet Serv. Inf. Secur. (JISIS) 2020, 10, 47–75. [Google Scholar]
- Farahani, B.; Firouzi, F.; Luecking, M. The convergence of IoT and distributed ledger technologies (DLT): Opportunities, challenges, and solutions. J. Netw. Comput. Appl. 2021, 177, 102936. [Google Scholar] [CrossRef]
- Uddin, M.A.; Stranieri, A.; Gondal, I.; Balasubramanian, V. A survey on the adoption of blockchain in iot: Challenges and solutions. Blockchain Res. Appl. 2021, 2, 100006. [Google Scholar] [CrossRef]
- Hewa, T.; Ylianttila, M.; Liyanage, M. Survey on blockchain based smart contracts: Applications, opportunities and challenges. J. Netw. Comput. Appl. 2021, 177, 102857. [Google Scholar] [CrossRef]
- Atzei, N.; Bartoletti, M.; Cimoli, T. A survey of attacks on ethereum smart contracts (sok). In Proceedings of the Principles of Security and Trust: 6th International Conference, POST 2017, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2017, Uppsala, Sweden, 22–29 April 2017; Proceedings 6. pp. 164–186. [Google Scholar]
- Vigliotti, M.G. What do we mean by smart contracts? Open challenges in smart contracts. Front. Blockchain 2021, 3, 553671. [Google Scholar] [CrossRef]
- Künnapas, K. From Bitcoin to Smart Contracts: Legal Revolution or Evolution from the Perspective of de lege ferenda? Future Law E Technol. 2016, 111–131. [Google Scholar] [CrossRef]
- Khan, S.N.; Loukil, F.; Ghedira-Guegan, C.; Benkhelifa, E.; Bani-Hani, A. Blockchain smart contracts: Applications, challenges, and future trends. Peer-Peer Netw. Appl. 2021, 14, 2901–2925. [Google Scholar] [CrossRef]
- Kushwaha, S.S.; Joshi, S.; Singh, D.; Kaur, M.; Lee, H.-N. Systematic review of security vulnerabilities in ethereum blockchain smart contract. IEEE Access 2022, 10, 6605–6621. [Google Scholar] [CrossRef]
- Tikhomirov, S.; Voskresenskaya, E.; Ivanitskiy, I.; Takhaviev, R.; Marchenko, E.; Alexandrov, Y. Smartcheck: Static analysis of ethereum smart contracts. In Proceedings of the 1st International Workshop on Emerging Trends in Software Engineering for Blockchain, Melbourne, Australia, 20 May 2023; pp. 9–16. [Google Scholar]
- Sayeed, S.; Marco-Gisbert, H.; Caira, T. Smart contract: Attacks and protections. IEEE Access 2020, 8, 24416–24427. [Google Scholar] [CrossRef]
- Zhou, H.; Milani Fard, A.; Makanju, A. The state of ethereum smart contracts security: Vulnerabilities, countermeasures, and tool support. J. Cybersecur. Priv. 2022, 2, 358–378. [Google Scholar] [CrossRef]
- Hu, B.; Zhang, Z.; Liu, J.; Liu, Y.; Yin, J.; Lu, R.; Lin, X. A comprehensive survey on smart contract construction and execution: Paradigms, tools, and systems. Patterns 2021, 2, 2. [Google Scholar] [CrossRef] [PubMed]
- Qian, P.; Liu, Z.; He, Q.; Huang, B.; Tian, D.; Wang, X. Smart contract vulnerability detection technique: A survey. arXiv 2022, arXiv:2209.05872. [Google Scholar]
- Perez, D.; Livshits, B. Smart contract vulnerabilities: Vulnerable does not imply exploited. In Proceedings of the 30th USENIX Security Symposium (USENIX Security 21), Vancouver, BC, USA, 11–13 August 2021; pp. 1325–1341. [Google Scholar]
- Rouhani, S.; Deters, R. Security, performance, and applications of smart contracts: A systematic survey. IEEE Access 2019, 7, 50759–50779. [Google Scholar] [CrossRef]
- Zaidi, S.Y.A.; Shah, M.A.; Khattak, H.A.; Maple, C.; Rauf, H.T.; El-Sherbeeny, A.M.; El-Meligy, M.A. An attribute-based access control for IoT using blockchain and smart contracts. Sustainability 2021, 13, 10556. [Google Scholar] [CrossRef]
- Wang, S.; Ouyang, L.; Yuan, Y.; Ni, X.; Han, X.; Wang, F.-Y. Blockchain-enabled smart contracts: Architecture, applications, and future trends. IEEE Trans. Syst. Man Cybern. Syst. 2019, 49, 2266–2277. [Google Scholar] [CrossRef]
- Yashavant, C.S.; Kumar, S.; Karkare, A. Scrawld: A dataset of real world ethereum smart contracts labelled with vulnerabilities. arXiv 2022, arXiv:2202.11409. [Google Scholar]
- Feist, J.; Grieco, G.; Groce, A. Slither: A static analysis framework for smart contracts. In Proceedings of the 2019 IEEE/ACM 2nd International Workshop on Emerging Trends in Software Engineering for Blockchain (WETSEB), Montreal, QC, USA, 27 May 2019; pp. 8–15. [Google Scholar]
- Hu, T.; Liu, X.; Chen, T.; Zhang, X.; Huang, X.; Niu, W.; Lu, J.; Zhou, K.; Liu, Y. Transaction-based classification and detection approach for Ethereum smart contract. Inf. Process. Manag. 2021, 58, 102462. [Google Scholar] [CrossRef]
- Smart Contract Weakness Classification (SWC) Registry, Integer Overflow and Underflow. 2020. Available online: https://swcregistry.io/docs/SWC-101/ (accessed on 12 August 2024).
- Khor, J.; Masama, M.A.; Sidorov, M.; Leong, W.; Lim, J. An improved gas efficient library for securing IoT smart contracts against arithmetic vulnerabilities. In Proceedings of the 2020 9th International Conference on Software and Computer Applications, Langkawi, Malaysia, 18–21 February 2020; pp. 326–330. [Google Scholar]
- Smart Contract Weakness Classification (SWC) Registry, DoS with Failed Call. 2020. Available online: https://swcregistry.io/docs/SWC-113/ (accessed on 12 August 2024).
- Smart Contract Weakness Classification (SWC) Registry, DoS with Block Gas Limit. 2020. Available online: https://swcregistry.io/docs/SWC-128 (accessed on 12 August 2024).
- Durieux, T.; Ferreira, J.F.; Abreu, R.; Cruz, P. Empirical review of automated analysis tools on 47,587 ethereum smart contracts. In Proceedings of the ACM/IEEE 42nd International Conference on Software Engineering, Seoul, Republic of Korea, 27 June 2020; pp. 530–541. [Google Scholar]
- Smart Contract Weakness Classification (SWC) Registry, Reentrancy. 2020. Available online: https://swcregistry.io/docs/SWC-107/ (accessed on 12 August 2024).
- Smart Contract Weakness Classification (SWC) Registry, Block Values as a Proxy for Time. 2020. Available online: https://swcregistry.io/docs/SWC-116/ (accessed on 12 August 2024).
- Smart Contract Weakness Classification (SWC) Registry, Transaction Order Dependence. 2020. Available online: https://swcregistry.io/docs/SWC-114/ (accessed on 12 August 2024).
- Smart Contract Weakness Classification (SWC) Registry, Unchecked Call Return Value. 2020. Available online: https://swcregistry.io/docs/SWC-104/ (accessed on 12 August 2024).
- Smart Contract Weakness Classification (SWC) Registry, Authorization through tx.origin. 2020. Available online: https://swcregistry.io/docs/SWC-115/ (accessed on 12 August 2024).
- Zhao, H.; Tan, J. A critical-path-based vulnerability detection method for tx. origin dependency of smart contract. In Proceedings of International Conference on Smart Computing and Communication, New York, NY, USA, 18–20 November 2022; pp. 393–402. [Google Scholar]
- Wu, C.; Xiong, J.; Xiong, H.; Zhao, Y.; Yi, W. A review on recent progress of smart contract in blockchain. IEEE Access 2022, 10, 50839–50863. [Google Scholar] [CrossRef]
- Soud, M.; Qasse, I.; Liebel, G.; Hamdaqa, M. Automesc: Automatic framework for mining and classifying ethereum smart contract vulnerabilities and their fixes. In Proceedings of the 2023 49th Euromicro Conference on Software Engineering and Advanced Applications (SEAA), Durres, Albania, 6–8 September 2023; pp. 410–417. [Google Scholar]
- Aldweesh, A.; Alharby, M.; Mehrnezhad, M.; Van Moorsel, A. OpBench: A CPU performance benchmark for Ethereum smart contract operation code. In Proceedings of the 2019 IEEE International Conference on Blockchain (Blockchain), Atlanta, GA, USA, 4–17 July 2019; pp. 274–281. [Google Scholar]
- Jiang, Z.; Chen, K.; Wen, H.; Zheng, Z. Applying blockchain-based method to smart contract classification for CPS applications. Digit. Commun. Netw. 2022, 8, 964–975. [Google Scholar] [CrossRef]
- Khodadadi, M.; Tahmoresnezhad, J. Hymo: Vulnerability detection in smart contracts using a novel multi-modal hybrid model. arXiv 2023, arXiv:2304.13103. [Google Scholar]
- Rossini, M.; Zichichi, M.; Ferretti, S. Smart contracts vulnerability classification through deep learning. In Proceedings of the 20th ACM Conference on Embedded Networked Sensor Systems, Boston, MA, USA, 6–9 November 2022; pp. 1229–1230. [Google Scholar]
- Chavhan Sujeet Yashavant, Saurabh Kumar, and Amey Karkare. ScrawlD Dataset. Available online: https://github.com/sujeetc/ScrawlD (accessed on 12 August 2024).
- Rossini, M. Slither Audited Smart Contracts Dataset. Available online: https://huggingface.co/datasets/mwritescode/slither-audited-smart-contracts/viewer/all-multilabel/train (accessed on 12 August 2024).
- Ethereum, Etherscan. 2015. Available online: https://etherscan.io/apis (accessed on 12 August 2024).
- Whang, S.E.; Roh, Y.; Song, H.; Lee, J.-G. Data collection and quality challenges in deep learning: A data-centric ai perspective. VLDB J. 2023, 32, 791–813. [Google Scholar] [CrossRef]
- Alon, U.; Zilberstein, M.; Levy, O.; Yahav, E. code2vec: Learning distributed representations of code. Proc. ACM Program. Lang. 2019, 3, 1–29. [Google Scholar] [CrossRef]
- Vasilev, I.; Slater, D.; Spacagna, G.; Roelants, P.; Zocca, V. Python Deep Learning: Exploring Deep Learning Techniques and Neural Network Architectures with Pytorch, Keras, and TensorFlow; Packt Publishing Ltd.: Birmingham, UK, 2019. [Google Scholar]
- Sarkar, D.; Bali, R.; Ghosh, T. Hands-On Transfer Learning with Python: Implement Advanced Deep Learning and Neural Network Models Using TensorFlow and Keras; Packt Publishing Ltd.: Birmingham, UK, 2018. [Google Scholar]
- Jeremy Andrews, Google Colab. 2017. Available online: https://colab.research.google.com/ (accessed on 12 August 2024).
- Reghunath, A.; Nair, S.V.; Shah, J. Deep learning based customized model for features extraction. In Proceedings of the 2019 International Conference on Communication and Electronics Systems (ICCES), Coimbatore, India, 17–19 July 2019; pp. 1406–1411. [Google Scholar]
- Gergerli, B.; Çelebi, F.V.; Rahebi, J.; Şen, B. An Approach Using in Communication Network Apply in Healthcare System Based on the Deep Learning Autoencoder Classification Optimization Metaheuristic Method. Wirel. Pers. Commun. 2023, pp. 1–24. [CrossRef]
- Mascarenhas, S.; Agarwal, M. A comparison between VGG16, VGG19 and ResNet50 architecture frameworks for Image Classification. In Proceedings of the 2021 International Conference on Disruptive Technologies for Multi-Disciplinary Research and Applications (CENTCON), Bengaluru, India, 19–21 November 2021; pp. 96–99. [Google Scholar]
- Meghana, Resnet50. 2023. Available online: https://datagen.tech/guides/computer-vision/resnet-50/ (accessed on 12 August 2024).
- Sanghvi, H.A.; Patel, R.H.; Agarwal, A.; Gupta, S.; Sawhney, V.; Pandya, A.S. A deep learning approach for classification of COVID and pneumonia using DenseNet-201. Int. J. Imaging Syst. Technol. 2023, 33, 18–38. [Google Scholar] [CrossRef]
- Jaiswal, A.; Gianchandani, N.; Singh, D.; Kumar, V.; Kaur, M. Classification of the COVID-19 infected patients using DenseNet201 based deep transfer learning. J. Biomol. Struct. Dyn. 2021, 39, 5682–5689. [Google Scholar] [CrossRef]
- Kong, Y.; Yu, T. A deep neural network model using random forest to extract feature representation for gene expression data classification. Sci. Rep. 2018, 8, 16477. [Google Scholar] [CrossRef]
- Ham, J.; Chen, Y.; Crawford, M.M.; Ghosh, J. Investigation of the random forest framework for classification of hyperspectral data. IEEE Trans. Geosci. Remote Sens. 2005, 43, 492–501. [Google Scholar] [CrossRef]
- Fuadah, Y.N.; Pramudito, M.A.; Lim, K.M. An optimal approach for heart sound classification using grid search in hyperparameter optimization of machine learning. Bioengineering 2022, 10, 45. [Google Scholar] [CrossRef]
- An, J.; Ying, L.; Zhu, Y. Why resampling outperforms reweighting for correcting sampling bias with stochastic gradients. arXiv 2020, arXiv:2009.13447. [Google Scholar]
- Heydarian, M.; Doyle, T.E.; Samavi, R. MLCM: Multi-label confusion matrix. IEEE Access 2022, 10, 19083–19095. [Google Scholar] [CrossRef]
- Grandini, M.; Bagli, E.; Visani, G. Metrics for multi-class classification: An overview. arXiv 2020, arXiv:2008.05756. [Google Scholar]
- Ganda, D.; Buch, R. A survey on multi label classification. Recent Trends Program. Lang. 2018, 5, 19–23. [Google Scholar]
Predicted Positive | Predicted Negative | |
---|---|---|
Actual Positive | True Positive (TP) TP: The model correctly predicted a positive label or vulnerability; the true label is also positive. Notably, the model correctly identified the presence of a particular vulnerability. | False Negative (FN) FN: The model incorrectly predicted a negative label or vulnerability; the true label is also positive. Notably, the model incorrectly identified the presence of a particular vulnerability that should be expected and found in the dataset used. |
Actual Negative | False Positive (FP) FP: The model incorrectly predicted a positive label or vulnerability, and the true label is also negative. Notably, the model incorrectly identified the presence of a particular vulnerability that is not found in the dataset used. | True Negative (TN) TN: The model correctly predicted a negative label or vulnerability; the true label is also negative. Notably, the model correctly identified the presence of a particular vulnerability. |
No. | Algorithm-Image Format | Accuracy | F1-Score | Precision | Recall | Time Spent (s) |
---|---|---|---|---|---|---|
1 | ResNet50-RGB | 0.84102 | 0.84102 | 0.8443735 | 0.83926 | 1401 |
2 | VGG19-RGB | 0.80085 | 0.80085 | 0.80073 | 0.80106 | 3009 |
3 | KNN-RGB | 0.77008 | 0.77008 | 0.7836855 | 0.765018 | 10,800 |
4 | Random Forest-RGB | 0.86666 | 0.86666 | 0.866355 | 0.8667155 | 9000 |
5 | DenseNet201-RGB | 0.82307 | 0.82307 | 0.82723 | 0.82102 | 4911 |
6 | ResNet50-GRAY | 0.811111 | 0.811111 | 0.81186 | 0.81004 | 597 |
7 | VGG19-GRAY | 0.82136 | 0.82136 | 0.82576 | 0.81925 | 952 |
8 | KNN-GRAY | 0.790598 | 0.790598 | 0.81062 | 0.78490 | 9800 |
9 | Random Forest-GRAY | 0.85641 | 0.85641 | 0.85666 | 0.85556 | 9900 |
10 | DenseNet201-GRAY | 0.80598 | 0.80598 | 0.80754 | 0.80455 | 9870 |
No. | Model-Based Multi-Label Classification | Accuracy | F1-Score (Micro) | Precision | Recall | Time Spent (s) |
---|---|---|---|---|---|---|
1 | VGG19-RGB Approach 1 | 0.86435 | 0.76467 | 0.77208 | 0.75740 | 8051 |
2 | VGG19-RGB Approach 2 | 0.81288 | 0.78753 | 0.79379 | 0.78136 | 1988 |
3 | VGG19-RGB Approach 3 | 0.89142 | 0.85872 | 0.85091 | 0.86668 | 2160 |
4 | VGG19-GRAY Approach 1 | 0.80616 | 0.67648 | 0.67083 | 0.68222 | 6449 |
5 | VGG19-GRAY Approach 2 | 0.73714 | 0.73509 | 0.67307 | 0.80970 | 2412 |
6 | VGG19-GRAY Approach 3 | 0.84078 | 0.80637 | 0.76479 | 0.85273 | 1593 |
7 | Random Forest-RGB- Approach 1 | 0.88389 | 0.78269 | 0.88134 | 0.70391 | 15,300 |
8 | Random Forest-RGB Approach 2 | 0.84256 | 0.819520 | 0.85190 | 0.78950 | 8100 |
9 | Random Forest-RGB Approach 3 | 0.87946 | 0.84154 | 0.86655 | 0.81793 | 7740 |
10 | Random Forest-GRAY Approach 1 | 0.87759 | 0.77789 | 0.84371 | 0.72159 | 14,600 |
11 | Random Forest-GRAY Approach 2 | 0.88185 | 0.84553 | 0.86565 | 0.82633 | 8700 |
12 | Random Forest-GRAY Approach 3 | 0.83076 | 0.80319 | 0.84812 | 0.76278 | 9300 |
13 | ResNet50-RGB Approach 1 | 0.80896 | 0.68556 | 0.65781 | 0.71576 | 62,722 |
14 | ResNet50_RGB Approach 2 | 0.74565 | 0.73275 | 0.68652 | 0.78566 | 33,822 |
15 | ResNet50_RGB Approach 3 | 0.81725 | 0.77623 | 0.72706 | 0.83254 | 38,840 |
16 | ResNet50-GRAY Approach 1 | 0.80287 | 0.69150 | 0.63480 | 0.75932 | 38,178 |
17 | ResNet50_GRAY Approach 2 | 0.73915 | 0.73092 | 0.67405 | 0.79828 | 9632 |
18 | ResNet50_GRAY Approach 3 | 0.82532 | 0.78646 | 0.73558 | 0.84490 | 12,063 |
19 | DenseNet201_RGB Approach 2 | 0.73411 | 0.72013 | 0.67574 | 0.77076 | 10,856 |
20 | DenseNet201_RGB Approach 3 | 0.76033 | 0.73873 | 0.63144 | 0.88993 | 1440 |
21 | DenseNet201_GRAY Approach 2 | 0.77523 | 0.74716 | 0.74603 | 0.74829 | 8995 |
22 | DenseNet201_GRAY Approach 3 | 0.80291 | 0.77129 | 0.69089 | 0.87286 | 10,800 |
23 | KNN_RGB Approach 2 | 0.81941 | 0.79006 | 0.81192 | 0.76936 | 9000 |
24 | KNN_RGB Approach 3 | 0.86631 | 0.82103 | 0.83761 | 0.80509 | 12,312 |
25 | KNN_GREY Approach 2 | 0.81523 | 0.78973 | 0.79391 | 0.78559 | 11,664 |
26 | KNN_GREY Approach 3 | 0.87617 | 0.83085 | 0.86601 | 0.79843 | 11,160 |
Ref. | Algorithm/Matrix | Accuracy | F1-Score | Precision | Recall |
---|---|---|---|---|---|
This study | RF-RGB (Binary classification) | 0.86666 | 0.86666 | 0.86635 | 0.86671 |
This study | RF-RGB-Approach 1 (Multi-label classification) | 0.88389 | 0.78269 | 0.88134 | 0.70391 |
This study | RF-GRAY Approach 2 (Multi-label classification) | 0.88185 | 0.84553 | 0.86565 | 0.82633 |
This study | VGG19-RGB-Approach 3 (Multi-label classification) | 0.89142 | 0.85872 | 0.85091 | 0.86668 |
[39] | ResNet1D (Multi-label classification) | 0.7353 | 0.8381 | - | - |
[39] | ResNet (Multi-label classification) | 0.6841 | 0.7928 | - | - |
[39] | Inception (Multi-label classification) | 0.6988 | 0.8015 | - | - |
[39] | LSTM Baseline (Multi-label classification) | 0.6934 | 0.7953 | - | - |
[22] | LSTM (Multi-label classification) | - | 0.77 | 0.88 | 0.70 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Bani-Hani, R.M.; Shatnawi, A.S.; Al-Yahya, L. Vulnerability Detection and Classification of Ethereum Smart Contracts Using Deep Learning. Future Internet 2024, 16, 321. https://doi.org/10.3390/fi16090321
Bani-Hani RM, Shatnawi AS, Al-Yahya L. Vulnerability Detection and Classification of Ethereum Smart Contracts Using Deep Learning. Future Internet. 2024; 16(9):321. https://doi.org/10.3390/fi16090321
Chicago/Turabian StyleBani-Hani, Raed M., Ahmed S. Shatnawi, and Lana Al-Yahya. 2024. "Vulnerability Detection and Classification of Ethereum Smart Contracts Using Deep Learning" Future Internet 16, no. 9: 321. https://doi.org/10.3390/fi16090321
APA StyleBani-Hani, R. M., Shatnawi, A. S., & Al-Yahya, L. (2024). Vulnerability Detection and Classification of Ethereum Smart Contracts Using Deep Learning. Future Internet, 16(9), 321. https://doi.org/10.3390/fi16090321