# Hybrid Quantum-Classical Deep Neural Networks Based Smart Contract Vulnerability Detection
## 3 Materials and Methods
### Data Preprocessing and Feature Extraction  
In our study, feature extraction was performed using the Term Frequency-Inverse Document Frequency (TF-IDF) method, and a 2-g (bigram) analysis was applied. This choice was made because the experiments showed that the performance metrics--recall, precision, accuracy, and F1-score--were low in the 1-g analysis. In particular, it was observed that the lack of contextual information hindered the proper representation of word relationships. On the other hand, the 3-g analysis could not be conducted due to insufficient resources.  
Additionally, an ANOVA test and effect size analysis were performed to examine the impact of TF-IDF parameters on model performance. The ANOVA results indicated a statistically significant difference between TF-IDF parameters (F = 12.81, \(p\) = 3.74 \(\times\) 10\({}^{-6}\)). According to the effect size (\(\eta^{2}\)) calculations, these parameters accounted for approximately 4.9% of the variance in model performance. The tests showed that the \"default\" TF-IDF settings achieved the highest recall (0.992) and F1-score (0.966), making them the most successful in terms of overall model performance.  
Furthermore, the \"Sublinear=True\" parameter improved some model results; however, it was insufficient compared to the \"default\" setting. The \"Sublinear=True & Norm=L1\"  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Tool** & **Avg. Execution Time** & **Total Execution Time** \\ \hline Honeybadger & 0:00:46 & 0:53:11 \\ Maian & 0:02:57 & 3:23:50 \\ Manticore & 0:08:11 & 5:03:04 \\ Mythril & 0:01:13 & 1:23:42 \\ Osiris & 0:00:44 & 0:50:03 \\ Oyente & 0:00:36 & 0:41:29 \\ Securify & 0:01:00 & 1:09:08 \\ Slither & 0:00:03 & 0:03:35 \\ Smartcheck & 0:00:06 & 0:06:34 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Tool execution times.  
option had the lowest average metrics, with a notable drop in precision. In conclusion, the results indicate that TF-IDF parameters directly impact model performance, with the best overall accuracy and balance achieved using the \"default\" parameter settings. Although alternative configurations may enhance specific aspects of the model, the \"default\" settings are considered the most suitable option for optimal performance.  
TF-IDF is a statistical approach used to determine the significance of a term (word or phrase) within a given text [55]. This method allows for distinguishing between frequently occurring but generally insignificant words and rarely occurring but important ones. By assessing the occurrence rate of a term within a text (TF) and its distribution across multiple texts (IDF), the significance of the term in the given context is determined [56].  
The 2-g analysis allows us to examine the frequency of groups of two words in the text. This approach allows a deeper understanding of important word combinations by analyzing consecutive word pairs. In this way, the distribution and importance of word pairs in the text are analyzed instead of single words [57].  
Operational codes (opcodes) are instructions that determine the logic of the software. When analyzing the vulnerabilities of software, the sequential use of certain opcode pairs can be essential in identifying the types of vulnerabilities present in that software. Analyzing opcodes in pairs is thought to provide a better understanding of how these instructions interact with each other and how certain combinations are associated with certain types of vulnerabilities. For example, the consecutive use of two specific opcodes may indicate a limit overflow or a specific type of vulnerability. While individual opcodes may fail to reveal such relationships, binary combinations provide a clearer picture of such relationships. Therefore, examining opcodes in pairs using TF-IDF and 2-g analysis enables more accurate and faster detection of software vulnerabilities. This method makes the vulnerability detection process more effective by analyzing the importance and distribution of opcodes in the text in more detail.