Intelligent contract access control vulnerability detection method based on neural network

By constructing a smart contract sample set and an improved graph neural network, the shortcomings of existing technologies in smart contract access control vulnerability detection are addressed, achieving efficient and accurate vulnerability detection and improving the model's detection capability and robustness.

CN121723481APending Publication Date: 2026-03-24SOUTH CHINA UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-11
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing methods for detecting smart contract access control vulnerabilities struggle to handle complex semantic structures and dynamic behaviors, and lack the ability to detect vulnerabilities without predefined critical instructions, resulting in incomplete vulnerability detection and poor robustness.

Method used

We construct a smart contract sample set, and build a semantic attribute graph specific to access control vulnerabilities by parsing the contract source code. We use an improved graph neural network for feature extraction and training, and perform multiple rounds of iterative training by combining labeled and unlabeled samples to improve the model's detection capability.

Benefits of technology

It achieves accurate and efficient detection of smart contract access control vulnerabilities, enhances the model's training and structural reasoning capabilities, and significantly improves the accuracy and robustness of vulnerability detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121723481A_ABST
    Figure CN121723481A_ABST
Patent Text Reader

Abstract

The invention discloses an intelligent contract access control vulnerability detection method based on a neural network. The method comprises the following steps: constructing a label-containing intelligent contract sample set and a label-free intelligent contract sample set; performing project-level analysis on the contract source code, and constructing a semantic attribute graph of explicit modeling inheritance, modifier application and data / control flow relationships; processing the semantic attribute graph into a multi-modal feature vector; inputting the extracted features into an improved graph neural network model to train a teacher model; performing estimation by utilizing Monte Carlo, screening false labels from unlabeled samples round by round, performing iterative self-training to construct a curriculum type learning strategy, and finally obtaining a model with optimal performance; and under unified preprocessing, the optimal model is used for reasoning the new contract and accurately predicting the access control vulnerability. According to the method, the stable gain is realized on the strong supervision baseline, the false alarm / missing report rate is remarkably reduced, the method is suitable for security auditing of access control vulnerabilities in the block chain, and the security of the smart contract is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of distributed application security technology in blockchain, and in particular to a method for detecting smart contract access control vulnerabilities based on neural networks. Background Technology

[0002] A smart contract is a decentralized program that can automatically execute pre-defined logic without the need for a centralized institution. It is deployed on a blockchain in a self-sufficient manner and relies on the joint execution of its contents by various parties. Within the contract, the signatories must fulfill the conditions and responsibilities stipulated therein, and after verification by external data sources (such as oracles), the smart contract automatically performs its obligations on the blockchain. For example, contracts on Ethereum can trigger payments or state updates based on user input. With the increasing popularity of blockchain technology and decentralized applications, smart contracts have been widely used in DeFi, NFTs, art trading, supply chain finance, and other fields, significantly improving transaction efficiency and transparency.

[0003] Due to limited developer experience or insufficient security awareness, smart contracts are often deployed without adequate testing, potentially leading to access control vulnerabilities and significant asset losses. The severe consequences of access control vulnerabilities urgently necessitate the development of more effective and accurate detection tools.

[0004] Existing methods for detecting smart contract access control vulnerabilities mostly rely on static rules or predefined logic, which struggle to handle the complex semantic structures and dynamic behaviors within contracts. Graph convolutional networks, however, can learn from the semantic attribute graphs of code, capturing high-order patterns in contracts and offering significant advantages in detecting logical vulnerabilities.

[0005] AChecker is a static detection technology tool for smart contract access control vulnerabilities published by IEEE in 2023. It combines static data flow analysis, taint analysis, and symbolic execution to achieve accurate detection of access vulnerabilities and filter false positives. Technical Approach: AChecker uses static data flow analysis to trace the dependency relationship between CALLER (caller instruction) and SLOAD (store / read instruction) in conditional statements, excluding non-access control conditions such as balance verification to identify access control checks and corresponding state variables. Then, using user input as the taint source and access control state variables (SSTORE instruction) and critical instructions (SELFDESTRUCT, DELEGATECALL, etc.) as sinks, it detects VCC (taint propagation to state variables) and MACC (taint propagation to critical instructions) through context-sensitive inter-procedural taint analysis. Finally, it uses symbolic execution to generate constraints for access control data manipulation, and combines this with an SMT solver to determine constraint satisfiability, filtering out "legal manipulation under specific non-access control constraints" scenarios to reduce false positives, thus forming a complete access control vulnerability detection method. However, it only analyzes predefined critical instructions, lacking access control coverage, and does not cover functions without predefined instructions but requiring permission protection; detection capability gaps: it does not support vulnerabilities where tx.origin is used as the verification basis; it is prone to timeouts leading to failure, affecting robustness. Therefore, developing a method for detecting smart contract access control vulnerabilities based on neural networks has significant research value and practical significance. Summary of the Invention

[0006] To address the problems existing in the prior art, this invention develops a method for detecting smart contract access control vulnerabilities based on neural networks, which enables accurate and efficient detection of access control vulnerabilities in smart contracts, thereby enhancing the security of smart contracts.

[0007] The present invention is achieved by at least one of the following technical solutions.

[0008] A method for detecting smart contract access control vulnerabilities based on neural networks includes the following steps: S1. Construct a smart contract sample set, which includes labeled and unlabeled samples; S2. Analyze the source code of the smart contract and construct a semantic attribute graph specific to the access control vulnerability; the semantic attribute graph of each smart contract includes nodes and directed edges. S3. Extract features from the semantic attribute map to obtain multimodal feature vectors; S4. Use the feature vectors of labeled samples to train the improved graph neural network and obtain the preliminary optimal model; S5. Use the feature vectors of unlabeled samples to iteratively train the initial optimal model to obtain the final detection model; S6. Input the smart contract to be tested into the final testing model, and the final testing model outputs the access control vulnerability detection results of the smart contract.

[0009] Furthermore, the specific process of step S1 is as follows: S11. Collect vulnerability sets and security sets of smart contracts with access control vulnerabilities that have been confirmed by various trusted sources through GitHub and Ethereum browsers, i.e., a set of labeled smart contract samples. S12. Obtain a large number of smart contracts through a large smart contract set SmartBugs, and then remove the vulnerability set and security set collected in step S11 to obtain the required unlabeled smart contract dataset. Flatten all the source code of the smart contracts, then remove duplicates, and finally obtain the unlabeled smart contract sample set.

[0010] Furthermore, the specific process of step S2 is as follows: S21. Use the solidity-parser parser to parse the source code of the smart contract to obtain the AST syntax tree, and then obtain the eight types of nodes predefined in the contract based on the two-pass traversal strategy. S22. After obtaining the eight types of nodes in the contract, obtain the six types of directed edges between the nodes based on semantic attributes and node positions.

[0011] Furthermore, in step S3, the text is first converted into a high-dimensional sparse vector using a global feature extractor, and then the high-dimensional vector is reduced to a fixed dimension to capture the core semantics of the text. Then, for the semantic attribute graph of each contract, the nodes and edges are converted into fixed-dimensional multimodal feature vectors.

[0012] Furthermore, the multimodal feature vector includes node feature vectors and edge feature vectors, wherein the node feature vector includes structural features, semantic features, label semantics, code snippet keywords, positional features, centrality measure and Laplacian positional encoding.

[0013] Furthermore, the structure of the improved graph neural network includes: The input layer includes node features, edge features, and edge indices describing the graph topology. The graph neural network encoder consists of three cascaded graph neural network modules, each responsible for learning and updating the representation vectors of the nodes; Multi-scale feature fusion, the outputs of three graph neural network modules are fed into the knowledge jump connection layer; The graph-level representation is generated by concatenating the node-level features and then processing them through a global summation and pooling layer. This process adds the feature vectors of all nodes in the graph to generate a single vector that represents the entire graph, which is the graph-level representation. Classification and prediction: The graph representation is fed into a multilayer perceptron classifier, and the output of the classifier is the final prediction output.

[0014] Furthermore, the graph neural network module structure is as follows: First, the node representation vector is fed into a graph transformer convolutional layer for information aggregation. The output of the graph transformer convolutional layer undergoes a non-linear transformation through a modified linear unit activation function. Then, through a residual connection, the transformed features are added to the original input features. The result of the addition is fed into a layer normalization module for stable training. Finally, regularization is performed through a random deactivation layer to prevent overfitting.

[0015] Furthermore, the specific process of step S5 is as follows: S51. Apply the preliminary optimal model obtained in step S4 to the multimodal feature vector of unlabeled samples, and use Monte Carlo Dropout to estimate uncertainty. S52. Based on the uncertainty estimation index, use a pseudo-label selector to filter out some of the samples that the model is currently most confident in from the unlabeled data, and mark the samples that are most confident and their corresponding prediction results as high-quality pseudo-labels. S53. Add the pseudo-labeled samples to the labeled sample set to form a new training set; S54. Using an improved graph neural network, train the student model on the new training set based on a unified training pipeline. S55. Use the student model as the teacher model for the next round, and repeat steps S51 to S54 for multiple rounds of iteration. S56. After multiple iterations, evaluate the performance of each round of models on a fixed subset of validations at each fold, and select the best model in the iteration process using the vulnerability F1 score as the indicator.

[0016] A computer device according to the present invention includes a memory and a processor, the memory being electrically connected to the processor, the memory storing a computer program, which, when executed by the processor, causes the processor to implement the method described herein.

[0017] The present invention provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor implements the method described herein.

[0018] Compared with the prior art, the present invention has the following advantages and beneficial effects: 1. The present invention designs proprietary semantic attributes to address access control vulnerabilities in smart contracts. The diagram illustrates key elements of smart contracts, such as access control logic and modifier semantics, enhancing semantic understanding capabilities.

[0019] 2. This invention improves the graph neural network by adding edge feature perception and hierarchical fusion mechanisms, making the neural network more suitable for the semantic attribute graph specific to this invention, while also improving the model's training and structural reasoning capabilities.

[0020] 3. This invention not only utilizes labeled smart contract access control sample sets but also makes full use of readily available unlabeled smart contract sample sets. After extracting the semantic attribute graphs and multimodal vectors of all sample sets, the labeled data is first input into an improved graph neural network for training. Based on this, uncertainty estimation is performed, and three rounds of iterative self-training are conducted. This allows the unlabeled data to effectively assist the model in improving its performance, significantly enhancing the model's ability to detect access control vulnerabilities. Attached Figure Description

[0021] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0022] Fig. 1 This is a flowchart illustrating a method for detecting smart contract access control vulnerabilities based on neural networks, as an example.

[0023] Fig. 2 This is a schematic diagram of an improved graph neural network for an example embodiment.

[0024] Fig. 3 This is a schematic diagram of the iterative self-training process in an embodiment of the present invention. Detailed Implementation

[0025] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0026] like Figs. 1-3As shown, this embodiment provides a method for detecting smart contract access control vulnerabilities based on neural networks, including the following steps: S1. Construct a smart contract sample set (labeled samples + unlabeled samples).

[0027] As one embodiment, the specific process of step S1 is as follows: S11. Collect a set of vulnerabilities and security measures for smart contracts containing access control vulnerabilities that have been confirmed by various trusted sources through GitHub and the Ethereum browser. This is known as a tagged sample set.

[0028] S12. Obtain a large number of smart contracts through a large smart contract set, SmartBugs. After removing the previously collected vulnerability and security sets, the required unlabeled smart contract dataset is obtained. All smart contract source code is flattened and then deduplicated. In this embodiment, 679 access control vulnerability contracts, 3836 vulnerability-free contracts, and 7922 unlabeled sample contracts are finally obtained.

[0029] S2. Analyze the source code of the smart contract. For each smart contract, its semantic attribute graph includes predefined nodes and directed edges. Construct a semantic attribute graph specific to access control vulnerabilities.

[0030] In this embodiment, the specific process of step S2 is as follows: S21. Static analysis of the smart contract's source code using a graph structure based on a two-pass traversal strategy: First, the existing solidity-parser is called to perform lexical and syntactic analysis on the Solidity source code file, generating an abstract syntax tree (AST). Then, the following two core stages are used to obtain the eight predefined types of nodes in the contract: First pass: Declaration extraction phase. This phase prioritizes traversing the entire AST, focusing on identifying and creating global, context-independent declaration class nodes. This phase includes: First, function and modifier nodes are identified and created, and a unique signature is generated for each node. Then, parameter nodes within functions and modifiers are identified and created. Finally, state variable nodes are identified and created. During this process, variables are categorized as permission variables (PermissionVar) or general variables (GeneralVar) based on a set of predefined heuristics (e.g., whether the variable name contains keywords such as owner, admin, or role, or whether the variable type is an address or a boolean).

[0031] Second Traversal: Relationship and Context Extraction Phase. After the first traversal built the basic node framework, the AST is traversed again. This phase focuses on analyzing the execution logic inside functions and decorators to create context-dependent nodes and the edges between them. This phase includes: First, within the function or decorator, identify conditional statements (such as require, if, etc.) and create Check nodes. Then, identify state changes or sensitive operations (such as assignment, selfdestruct, delegatecall) and create Action nodes. Finally, identify entities that interact with the outside world (such as msg.sender, tx.origin) and create Actor nodes.

[0032] The eight types of nodes predefined in this embodiment are shown in Table 1 below.

[0033] Table 1. Node types of the Semantic Attribute Graph (SPG)

[0034] S22. After obtaining the eight predefined types of nodes in the contract, obtain the directed edges between the nodes and output the starting node and type information of the edges. The six predefined edge types are shown in Table 2.

[0035] Table 2. Edge types of the Semantic Attribute Graph (SPG)

[0036] S3. Extract features from the semantic attribute map to obtain multimodal feature vectors.

[0037] In this embodiment, the specific process of step S3 is as follows: The nodes and edges obtained in step S2 are vectorized using a preprocessing technique that integrates existing verifiable technologies. This preprocessing is not a standalone black-box tool, but a standardized data processing pipeline whose core function is to vectorize graph information using publicly available and reproducible machine learning techniques (e.g., text feature extraction and dimensionality reduction methods implemented using the scikit-learn library). This preprocessing process consists of two stages: Phase 1: Training the global feature extractor.

[0038] First, we collect the corpus: we traverse the semantic attribute graph of all contracts in the dataset, extract the label text of all nodes, and compile it into a global text corpus.

[0039] Then, a global feature extractor is trained: a TF-IDF (Term Frequency-Inverse Document Frequency) text feature extraction model and an SVD (Singular Value Decomposition) dimensionality reduction model are trained using this corpus. TF-IDF is used to convert the text into a high-dimensional sparse vector, while SVD is used to reduce this high-dimensional vector to a fixed dimension (32 dimensions in this example), thereby capturing the core semantics of the text. The trained model will be saved for subsequent processing.

[0040] Phase 2: Single-graph multimodal feature vectorization.

[0041] For each contract's semantic attribute graph, perform the following operations to transform nodes and edges into fixed-dimensional multimodal feature vectors: A. The node feature vector (78 dimensions) is generated by concatenating the following parts: Structural features (23 dimensions): Encode the metadata of nodes, including node type (8-dimensional one-hot encoding), visibility (5-dimensional one-hot encoding), variability (4-dimensional one-hot encoding), and normalized risk level and code line count, etc.

[0042] Semantic features (43 dimensions): Label semantics (32 dimensions) + Location features (12 dimensions) Label semantics (32-dimensional): Using the TF-IDF and SVD dimensionality reduction models trained in the first stage, the label text of the current node is transformed into a 32-dimensional dense semantic vector.

[0043] Code snippet keywords (11-dimensional): Checks whether the source code snippet of a node contains a set of predefined key operation words (such as require, selfdestruct, etc.) and generates an 11-dimensional multi-hot encoded vector.

[0044] Location features (12 dimensions): Centrality measure (4 dimensions) + Laplace position code (8 dimensions) Centrality measure (4-dimensional): Treat the graph as a network and calculate the degree centrality, betweenness centrality, proximity centrality and centrality of each node to form a 4-dimensional topological importance vector.

[0045] Laplacian positional encoding (8-dimensional): Calculate the eigenvectors of the Laplacian matrix of the graph, and take the first 8 non-trivial eigenvectors as the positional encoding of the nodes, providing the model with global positional information of the nodes in the graph.

[0046] B. The edge feature vector (12-dimensional) is generated by concatenating the following two parts: Edge type features (6 dimensions): One-hot encoding is performed on the edge type (CONTAINS, APPLIES, CALLS, etc.).

[0047] Edge attribute features (6 dimensions): Encode other attributes of the edge, such as risk level, whether it is unprotected, etc.

[0048] Through the above two stages, the graph structure of the contract is transformed into a multimodal feature vector containing rich structural, semantic, and positional information, so that it can be input into the neural network for training. The specific meaning of the transformation from semantic attribute graph to multimodal vector is shown in Table 3 below.

[0049] Table 3 Structural parameters of multimodal vectors

[0050] S4. Use the feature vectors of labeled samples to train the improved graph neural network and obtain the preliminary optimal model.

[0051] In this embodiment, the specific process of step S4 is as follows: For the multimodal feature vectors of all labeled samples, ten-fold cross-validation is used for training. As one implementation, the labeled smart contract sample set (a set of secure smart contracts and a set of vulnerable smart contracts) is randomly divided into 10 equal subsets. Nine subsets are selected each time to train the improved graph neural network, with the remaining subset serving as the validation set. This process is repeated 10 times, ensuring each subset plays a validation role in each training iteration. By averaging the results of the 10 training iterations, a preliminary overall performance evaluation of the model can be obtained. The vulnerability F1 score is used as the standard to determine the preliminary best model obtained in this training step, which serves as the teacher model for subsequent self-training.

[0052] like Fig. 2 As shown, the structure of the improved graph neural network used in this invention includes: 1. Input layer: The model input consists of three parts: node features, edge features, and edge indices describing the graph topology.

[0053] 2. Graph Neural Network Encoder: This encoder consists of three cascaded graph neural network modules: Graph Neural Network Module 1, Graph Neural Network Module 2, and Graph Neural Network Module 3. Each module is responsible for learning and updating the representation vectors of the nodes. Taking Graph Neural Network Module 1 as an example, its internal structure is as follows: First, the input features are fed into a graph transformer convolutional layer for information aggregation. The output of the convolutional layer undergoes a non-linear transformation using a rectified linear unit (ReLU) activation function. Next, the transformed features are added to the original input features through a residual connection (represented by the + symbol in the diagram) to prevent gradient vanishing. The result of the addition is fed into a layer normalization module for stable training. Finally, regularization is performed through a random deactivation layer to prevent overfitting. (Graph neural network modules 2 and 3 have similar internal structures to graph neural network module 1.)

[0054] 3. Multi-scale Feature Fusion: To integrate graph features of different depths and suppress oversmoothing, the outputs of the three graph neural network modules are fed into a knowledge jump connection layer. As one example, the knowledge jump connection layer uses a concatenation method, stitching together the output feature vectors of the three modules along the channel dimension to form an enhanced feature representation containing multi-scale information.

[0055] 4. Graph-level representation generation: The concatenated node-level features are processed by a global summation pooling layer, which adds the feature vectors of all nodes in the graph to generate a single vector representing the entire graph, i.e., the graph-level representation.

[0056] 5. Classification and Prediction: The graph representation is fed into a multilayer perceptron classifier (MLP), which typically consists of two fully connected layers and is used to make the final classification decision.

[0057] The classifier's output is the final prediction, which is in the form of log odds, representing the probability score of a sample belonging to each class.

[0058] S5. The final model is obtained through multiple rounds (three rounds) of iterative self-training using the feature vectors of unlabeled samples. In this embodiment, this step employs an uncertainty-aware self-training (UAST) course learning strategy, the core process of which is as follows: Fig. 3 As shown, the specific process is as follows: First, the preliminary optimal model trained in step S4 is used as the initial teacher model. Then, an iterative self-training loop begins: 51. Model Prediction: The teacher model receives labeled data for training or fine-tuning and makes predictions on unlabeled data to produce preliminary prediction results.

[0059] 52. Uncertainty Assessment: The teacher model's predictions on unlabeled data are fed into an uncertainty estimator. This estimator uses Monte Carlo Dropout to perform multiple forward propagation inferences for each unlabeled sample, thereby calculating the uncertainty metrics (such as prediction confidence, variance, and consistency) for each sample.

[0060] 53. Pseudo-label selection: Based on the metrics output by the uncertainty estimator and according to preset criteria (e.g., selecting samples with high confidence, low variance, and high consistency), the pseudo-label selector selects a small subset of samples from the unlabeled dataset that the model is currently most confident in, and labels these samples and their prediction results as high-quality pseudo-labels.

[0061] 54. Model Retraining (Student Model): The selected high-quality pseudo-labels are merged with the original labeled data to form a new, expanded training set. This new training set is then used to retrain a new student model. Because the new dataset contains the most certain parts of the information that the model was previously uncertain about, the student model is able to learn new knowledge from it.

[0062] 55. Model Iteration: After retraining, the improved student model is used as the teacher model for the next iteration, and steps 51 to 54 above are repeated. Through multiple iterations, the model continuously mines information from unlabeled data and optimizes itself, forming a course-based learning process that progresses from easy to difficult.

[0063] After a predetermined number of iterations, the model that performs best on the validation set throughout all iterations is selected as the final model used for vulnerability detection.

[0064] S6. After obtaining features from the source code of the contract to be tested through the same preprocessing pipeline (steps S2-S3), input it into the final model. The model output is the detection result of whether the smart contract has access control vulnerabilities.

[0065] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0066] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. The various embodiments of this application can be combined with each other. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for detecting smart contract access control vulnerabilities based on neural networks, characterized in that, Includes the following steps: S1. Construct a smart contract sample set, which includes labeled and unlabeled samples; S2. Analyze the source code of the smart contract and construct a semantic attribute graph specific to the access control vulnerability; the semantic attribute graph of each smart contract includes nodes and directed edges. S3. Extract features from the semantic attribute map to obtain multimodal feature vectors; S4. Use the feature vectors of labeled samples to train the improved graph neural network and obtain the preliminary optimal model; S5. Use the feature vectors of unlabeled samples to iteratively train the initial optimal model to obtain the final detection model; S6. Input the smart contract to be tested into the final testing model, and the final testing model outputs the access control vulnerability detection results of the smart contract.

2. The method for detecting smart contract access control vulnerabilities based on neural networks according to claim 1, characterized in that, The specific process of step S1 is as follows: S11. Collect vulnerability sets and security sets of smart contracts with access control vulnerabilities that have been confirmed by various trusted sources through GitHub and Ethereum browsers, i.e., a set of labeled smart contract samples. S12. Obtain a large number of smart contracts through a large smart contract set SmartBugs, and then remove the vulnerability set and security set collected in step S11 to obtain the required unlabeled smart contract dataset. Flatten all the source code of the smart contracts, then remove duplicates, and finally obtain the unlabeled smart contract sample set.

3. The method for detecting smart contract access control vulnerabilities based on neural networks according to claim 1, characterized in that, The specific process of step S2 is as follows: S21. Use the solidity-parser parser to parse the source code of the smart contract to obtain the AST syntax tree, and then obtain the eight types of nodes predefined in the contract based on the two-pass traversal strategy. S22. After obtaining the eight types of nodes in the contract, obtain the six types of directed edges between the nodes based on semantic attributes and node positions.

4. The method for detecting smart contract access control vulnerabilities based on neural networks according to claim 1, characterized in that, In step S3, the text is first converted into a high-dimensional sparse vector using a global feature extractor, and then the high-dimensional vector is reduced to a fixed dimension to capture the core semantics of the text. Then, for the semantic attribute graph of each contract, the nodes and edges are converted into fixed-dimensional multimodal feature vectors.

5. The method for detecting smart contract access control vulnerabilities based on neural networks according to claim 4, characterized in that, Multimodal feature vectors include node feature vectors and edge feature vectors. Node feature vectors include structural features, semantic features, label semantics, code snippet keywords, positional features, centrality measures, and Laplacian positional encoding.

6. The method for detecting smart contract access control vulnerabilities based on neural networks according to claim 1, characterized in that, The structure of the improved graph neural network includes: The input layer includes node features, edge features, and edge indices describing the graph topology. The graph neural network encoder consists of three cascaded graph neural network modules, each responsible for learning and updating the representation vectors of the nodes; Multi-scale feature fusion, the outputs of three graph neural network modules are fed into the knowledge jump connection layer; The graph-level representation is generated by concatenating the node-level features and then processing them through a global summation and pooling layer. This process adds the feature vectors of all nodes in the graph to generate a single vector that represents the entire graph, which is the graph-level representation. Classification and prediction: The graph representation is fed into a multilayer perceptron classifier, and the output of the classifier is the final prediction output.

7. The method for detecting smart contract access control vulnerabilities based on neural networks according to claim 6, characterized in that, The structure of the graph neural network module is as follows: First, the node representation vector is fed into a graph transformer convolutional layer for information aggregation. The output of the graph transformer convolutional layer undergoes a non-linear transformation through a modified linear unit activation function. Then, through a residual connection, the transformed features are added to the original input features. The result of the addition is fed into a layer normalization module for stable training. Finally, regularization is performed through a random deactivation layer to prevent overfitting.

8. The method for detecting smart contract access control vulnerabilities based on neural networks according to claim 1, characterized in that, The specific process of step S5 is as follows: S51. Apply the preliminary optimal model obtained in step S4 to the multimodal feature vector of unlabeled samples, and use Monte Carlo Dropout to estimate uncertainty. S52. Based on the uncertainty estimation index, use a pseudo-label selector to filter out some of the samples that the model is most confident about from the unlabeled data, and mark the samples that are most confident and their corresponding prediction results as high-quality pseudo-labels. S53. Add the pseudo-labeled samples to the labeled sample set to form a new training set; S54. Using an improved graph neural network, train the student model on the new training set based on a unified training pipeline. S55. Use the student model as the teacher model for the next round, and repeat steps S51 to S54 for multiple rounds of iteration. S56. After multiple iterations, evaluate the performance of each round of models on a fixed subset of validations at each fold, and select the best model in the iteration process using the vulnerability F1 score as the indicator.

9. A computer device comprising a memory and a processor, the memory being electrically connected to the processor, the memory storing a computer program, characterized in that: When the computer program is executed by the processor, it causes the processor to implement the method as described in any one of claims 1 to 8.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the processor implements the method as described in any one of claims 1 to 8.