JOURNAL ARTICLE

Smart Contract Vulnerability Detection Based on TextCNN and Attention Mechanism

Abstract

To address the problems of low detection accuracy of traditional smart contract vulnerability detection schemes and single vulnerability type detection of deep learning-based schemes, this paper proposes a smart contract vulnerability detection scheme based on TextCNN and attention mechanism. Firstly, word embedding is used to obtain the word vector representation of operation codes, and then the word vectors are input into TextCNN to extract sequential features. An attention mechanism is used to assign different weights to different features to highlight key features. Finally, normalization processing is carried out through activation functions to implement detection and recognition of smart contract vulnerabilities. The paper collected and screened 3735 valid smart contracts and used these contracts for model experiments and evaluation. The experimental results show that compared with deep learning models and traditional tools, the scheme proposed in the paper has certain improvements in terms of accuracy, precision, recall and Fl score, and can accurately identify 5 types of smart contract vulnerabilities with an accuracy of 99.20%.

Keywords:
Mechanism (biology) Vulnerability (computing) Computer science Computer security Business

Metrics

1
Cited By
0.26
FWCI (Field Weighted Citation Impact)
16
Refs
0.61
Citation Normalized Percentile
Is in top 1%
Is in top 10%

Citation History

Topics

Law, AI, and Intellectual Property
Physical Sciences →  Computer Science →  Artificial Intelligence
Artificial Intelligence in Law
Social Sciences →  Social Sciences →  Political Science and International Relations
Cybercrime and Law Enforcement Studies
Physical Sciences →  Computer Science →  Information Systems

Related Documents

JOURNAL ARTICLE

Smart Contract Vulnerability Detection Based on Mixed Channel Attention

J WangCheng ZengQing Yu QuanYi Wang

Journal:   Proceedings/Proceedings of the ... International Conference on Software Engineering and Knowledge Engineering Year: 2024 Vol: 2024 Pages: 273-278
JOURNAL ARTICLE

Attention-based Machine Learning Model for Smart Contract Vulnerability Detection

Yuhang SunLize Gu

Journal:   Journal of Physics Conference Series Year: 2021 Vol: 1820 (1)Pages: 012004-012004
© 2026 ScienceGate Book Chapters — All rights reserved.