Skip navigation

DSpace

機構典藏 DSpace 系統致力於保存各式數位資料(如:文字、圖片、PDF)並使其易於取用。

點此認識 DSpace
DSpace logo
English
中文
  • 瀏覽論文
    • 校院系所
    • 出版年
    • 作者
    • 標題
    • 關鍵字
    • 指導教授
  • 搜尋 TDR
  • 授權 Q&A
    • 我的頁面
    • 接受 E-mail 通知
    • 編輯個人資料
  1. NTU Theses and Dissertations Repository
  2. 電機資訊學院
  3. 電機工程學系
請用此 Handle URI 來引用此文件: http://tdr.lib.ntu.edu.tw/jspui/handle/123456789/98476
完整後設資料紀錄
DC 欄位值語言
dc.contributor.advisor郭斯彥zh_TW
dc.contributor.advisorSy-Yen Kuoen
dc.contributor.author黃閔昭zh_TW
dc.contributor.authorMin-Chao Huangen
dc.date.accessioned2025-08-14T16:15:52Z-
dc.date.available2025-08-15-
dc.date.copyright2025-08-14-
dc.date.issued2025-
dc.date.submitted2025-07-31-
dc.identifier.citation[1] S. Albawi, T. A. Mohammed and S. Al-Zawi. Understanding of a convolutional neural network. In Proceedings of the 2017 International Conference on Engineering and Technology (ICET), pages 1-6, 2017.
[2] H. A. Bhat, F. A. Khanday, B. K. Kaushik, F. Bashir and K. A. Shah. Quantum Computing: Fundamentals, Implementations and Applications. in IEEE Open Journal of Nanotechnology, 3:61–77, 2022.
[3] K. R. Brown, J. Kim, and C. Monroe. Co-designing a scalable quantum computer with trapped atomic ions. npj Quantum Information, 2:16034, 2016.
[4] Cambridge Quantum Computing (now Quantinuum). Pytket. [Online]. Available: https://docs.quantinuum.com/tket/api-docs/index.html, accessed: Jul. 2025.
[5] K. Clark, M.-T. Luong, Q. V. Le, and C. D. Manning. ELECTRA: Pre-training Text Encoders as Discriminators Rather Than Generators. arXiv preprint arXiv:2003.10555, 2020.
[6] A. W. Cross, L. S. Bishop, J. A. Smolin, and J. M. Gambetta. Open Quantum Assembly Language. arXiv preprint arXiv:1707.03429, 2017.
[7] S. Das and S. Ghosh. Quantum-TrojanNet. [Online]. Available: https://github.com/das-subrata/Quantum-TrojanNet/tree/main, 2024, accessed: Apr. 2025.
[8] S. Das and S. Ghosh. Trojan Attacks on Variational Quantum Circuits and Countermeasures. In Proceedings of the 2024 25th International Symposium on Quality Electronic Design (ISQED), pages 1–8, 2024.
[9] S. Das and S. Ghosh. Trojan Taxonomy in Quantum Computing. In Proceedings of the 2024 IEEE Computer Society Annual Symposium on VLSI (ISVLSI), pages 644–649, 2024.
[10] J. Devlin, M. Chang, K. Lee, and K. Toutanova. BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 4171–4186, 2019.
[11] E. Farhi, J. Goldstone, and S. Gutmann. A Quantum Approximate Optimization Algorithm. arXiv preprint arXiv:1411.4028, 2014.
[12] Z. Feng, D. Guo, D. Tang, N. Duan, X. Feng, M. Gong, L. Shou, B. Qin, T. Liu, D. Jiang, and M. Zhou. CodeBERT: A Pre-Trained Model for Programming and Natural Languages. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 1536-1547, 2020.
[13] J. M. Gambetta, J. M. Chow, and M. Steffen. Building logical qubits in a superconducting quantum computing system. npj Quantum Information, 3:2, 2017.
[14] Y. Ge, W. Wenjie, C. Yuheng, P. Kaisen, L. Xudong, Z. Zixiang, W. Yuhan, W. Ruocheng, and Y. Junchi. Quantum circuit synthesis and compilation optimization: Overview and prospects. arXiv preprint arXiv:2407.00736, 2024.
[15] Z. Gedik, I. A. Silva, B. Çakmak, G. Karpat, E. L. G. Vidoto, D. O. Soares-Pinto, E. R. deAzevedo, and F. F. Fanchini. Computational speed-up with a single qudit. Scientific Reports, 5:14671, 2015.
[16] Y. Liu, M. Ott, N. Goyal, J. Du, M. Joshi, D. Chen, O. Levy, M. Lewis, L. Zettlemoyer, and V. Stoyanov. RoBERTa: A Robustly Optimized BERT Pretraining Approach. arXiv preprint arXiv:1907.11692, 2019.
[17] W. Luo, L. Cao, Y. Shi, L. Wan, H. Zhang, S. Li, G. Chen, Y. Li, S. Li, Y. Wang, S. Sun, M. F. Karim, H. Cai, L. C. Kwek, and A. Q. Liu. Recent progress in quantum photonic chips for quantum communication and internet. Light: Science & Applications, 12:175, 2023.
[18] M. Mohammadi and M. Eshghi. Behavioral description of quantum V and V^† gates to design quantum logic circuits. In Proceedings of the 2008 5th International Multi-Conference on Systems, Signals and Devices, pages 1-5, 2008
[19] S. Mugel, M. Abad, M. Bermejo, J. Sánchez, E. Lizaso, and R. Orús. Hybrid quantum investment optimization with minimal holding period. Scientific Reports, 11:19587, 2021.
[20] N. K. Parida, C. Jatoth, V. D. Reddy, M. M. Hussain, and J. Faizi. Post-quantum distributed ledger technology: a systematic survey. Scientific Reports, 13:20729, 2023.
[21] L. M. Procopio, A. Moqanaki, M. Araújo, F. Costa, I. A. Calafell, E. G. Dowd, D. R. Hamel, L. A. Rozema, Č. Brukner, and P. Walther. Experimental superposition of orders of quantum gates. Nature Communications, 6:7913, 2015.
[22] R. Roy, S. Das and S. Ghosh. Hardware Trojans in Quantum Circuits, Their Impacts, and Defense. In Proceedings of the 2024 25th International Symposium on Quality Electronic Design (ISQED), pages 1–8, 2024.
[23] M. A. Shafique, A. Munir and I. Latif. Quantum Computing: Circuits, Algorithms, and Applications. in IEEE Access, 12:22296-22314, 2024.
[24] P. W. Shor. Algorithms for quantum computation: discrete logarithms and factoring. In Proceedings of the 35th Annual Symposium on Foundations of Computer Science (FOCS), pages 124–134, 1994.
[25] M. Treinish, L. Bello, J. Lishman, J. Gambetta, D. M. Rodríguez, M. Marques, J. Gacon, P. Nation, et al. Qiskit/qiskit: Qiskit 2.0.0. Zenodo, 2025. [Online]. Available: https://doi.org/10.5281/zenodo.15116124
[26] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, Ł. Kaiser, and I. Polosukhin. Attention is All You Need. In Proceedings of the 31st International Conference on Neural Information Processing Systems, pages 6000–6010, 2017.
[27] R. Wille, D. Große, L. Teuber, G. W. Dueck, and R. Drechsler. RevLib: An Online Resource for Reversible Functions and Reversible Circuits. In Proceedings of the 38th International Symposium on Multiple-Valued Logic, pages 220–225, 2008.
[28] S. Woerner and D. J. Egger. Quantum risk analysis. npj Quantum Information, 5:15, 2019.
-
dc.identifier.urihttp://tdr.lib.ntu.edu.tw/jspui/handle/123456789/98476-
dc.description.abstract隨著量子計算技術的迅速發展,其應用已拓展至密碼學、組合最佳化等重要領域,使量子電路的安全性日益受到重視。本研究針對量子電路中可能潛藏的硬體木馬進行分析,並提出一套自動化偵測方法,採用基於深度學習 Transformer 的模型架構,能有效辨識嵌入於量子組合語言格式電路中的木馬異常行為。
透過模擬實驗,我們發現即使僅插入單一個量子閘(如泡利-X閘、哈達馬閘、受控反閘或交換閘),亦足以使電路輸出產生顯著偏差。本研究以 RevLib 資料集中的 4gt12 與 Decod24 電路為例,模擬其在插入木馬閘後的行為變化,結果顯示此類電路對於惡意閘插入具有高度敏感性。
本研究選用由微軟研究院開發之 CodeBERT(microsoft/codebert-base)預訓練語言模型,該模型以 RoBERTa 為基礎架構,具備理解自然語言與程式語法結構的能力。我們將量子組合語言格式的量子電路視為結構化的程式碼序列,建構二元分類與多類別分類模型,以辨識電路中是否存在硬體木馬及其對應的插入閘類型。透過微調 CodeBERT 模型,能夠自動學習閘門序列中的語法異常與結構變化,無須額外人工特徵工程,即可有效執行木馬偵測任務。
本研究建構包含超過 2,500 筆樣本之資料集,包括泡利-X閘、哈達馬閘、受控反閘或交換閘木馬插入類型與無木馬電路樣本。在測試集中,模型於二元分類任務中達成96.1%的準確率與 97.0%的F1分數,且對所有木馬類型皆有超過 97.5% 的召回率,展現出極佳的偵測能力與泛化表現。在更具挑戰性的多類別分類任務中,模型達到 91.1% 的測試準確率,顯示其具備區分不同木馬閘類型的能力。
本研究亦實作傳統卷積神經網路模型作為比較基準,其輸入為量子電路所對應之酉矩陣,儘管可達一定分類準確度,但其召回率明顯不如 CodeBERT 模型,顯示其在結構異常偵測方面的能力較為受限。
綜合上述結果,本研究證實 CodeBERT模型可有效處理具語法與順序結構的量子電路資料,並能自動辨識潛藏的木馬異常行為。此方法不僅具有高度準確性與穩定性,也為未來量子電路驗證與部署過程中的安全檢測提供一項實用且可擴展的解決方案。
zh_TW
dc.description.abstractWith the rapid advancement of quantum computing technologies, their applications have expanded to critical domains such as cryptography and combinatorial optimization, making the security of quantum circuits increasingly important. This study investigates the potential presence of hardware Trojans in quantum circuits and proposes an automated detection framework based on a deep learning Transformer architecture, which can identify Trojan-induced anomalies embedded in circuits written in the Quantum Assembly Language (QASM) format.
Through simulation experiments, we found that the insertion of a single quantum gate, such as a Pauli-X, Hadamard, controlled-NOT, or SWAP gate, can significantly alter circuit outputs. Using the 4gt12 and Decod24 circuits from the RevLib benchmark as case studies, we simulated behavioral changes after Trojan insertion and confirmed that such circuits are highly sensitive to malicious gate-level modifications.
This study employs the pretrained CodeBERT model (microsoft/codebert-base) developed by Microsoft Research. Based on the RoBERTa architecture, the model can comprehend the syntax of both natural and programming languages. By treating QASM-formatted quantum circuits as structured code sequences, we constructed both binary and multiclass classification models to determine whether a circuit contains a hardware Trojan and to identify the specific inserted gate type. Through fine-tuning, the CodeBERT model can automatically learn syntactic and structural anomalies from gate sequences without manual feature engineering, enabling effective Trojan detection.
We built a dataset comprising over 2,500 samples, including circuits with Pauli-X, Hadamard, controlled-NOT, or SWAP gate Trojans, as well as Trojan-free circuits. On the test set, the model achieved 96.1% accuracy and a 97.0% F1 score in the binary classification task, with recall rates exceeding 97.5% for all Trojan types. These results demonstrate excellent detection capability and generalization. In the more challenging multiclass classification setting, the model achieved 91.1% test accuracy, showing its ability to distinguish between different Trojan gate types.
In addition, we implemented a conventional convolutional neural network (CNN) as a baseline for comparison, using the unitary matrix of each quantum circuit as input. Although it achieved moderate classification accuracy, its recall was significantly lower than that of the CodeBERT-based model. This suggests that the CNN is more limited in detecting structural anomalies in gate sequences.
Overall, this study confirms that CodeBERT -based models are effective for analyzing quantum circuits with syntactic and sequential structure. They can automatically detect hidden Trojan behavior and provide a practical and scalable solution for security verification during quantum circuit deployment.
en
dc.description.provenanceSubmitted by admin ntu (admin@lib.ntu.edu.tw) on 2025-08-14T16:15:52Z
No. of bitstreams: 0
en
dc.description.provenanceMade available in DSpace on 2025-08-14T16:15:52Z (GMT). No. of bitstreams: 0en
dc.description.tableofcontentsVerification Letter from the Oral Examination Committee i
Acknowledgements ii
摘要 iii
Abstract v
Contents vii
List of Figures x
List of Tables xi
Chapter 1 Introduction 1
1.1 Introduction 1
1.2 Contributions and Thesis Structure 3
Chapter 2 Background 5
2.1 Fundamentals of Qubits 5
2.2 Quantum States and Their Composite Properties 6
2.2.1 Superposition 6
2.2.2 Entanglement 6
2.3 Quantum Gates 6
2.3.1 Pauli-X Gate 7
2.3.2 Hadamard Gate 7
2.3.3 Controlled-NOT Gate 8
2.3.4 Multi-Controlled X Gate (MCCX) 9
2.3.5 SWAP Gate 9
2.4 Quantum Circuits 10
2.5 Quantum Compilation 11
2.6 Quantum Trojans 12
2.7 CodeBERT: microsoft/codebert-base 13
2.7.1 Transformer Encoder Architecture 14
2.7.2 BERT 18
2.7.3 RoBERTa 19
2.7.4 CodeBERT Model 19
2.7.5 Reasons for Selecting the CodeBERT Model 24
Chapter 3 Related Work 27
3.1 Revlib Dataset 27
3.2 Related Work 1 30
3.3 Related Work 2 31
3.4 Comparison of Trojan Detection Methods in Quantum Circuits 32
Chapter 4 Types and Locations of Quantum Trojan 33
4.1 4gt12 Circuit 34
4.1.1 Trojan Insertion in the 4gt12 Quantum Circuit 34
4.1.2 Simulation Results of 4gt12 Circuit with Trojans 35
4.2 Decod24 Circuit 36
4.2.1 Simulation Results of Decod24 Circuit with Trojans 36
4.3 Implications of Circuit Sensitivity to Trojan Insertions 40
Chapter 5 Experimental and Results 44
5.1 Data Selection 44
5.2 Data Preprocessing 44
5.3 Model Architecture and Training Setup 45
5.4 Binary Trojan Detection Results 46
5.4.1 Overall Training and Validation Performance 47
5.4.2 Test Set Evaluation 48
5.4.3 Test Set Confusion Matrix Analysis 49
5.4.4 Test Set Gate-specific Trojan Detection Performance 49
5.5 Multiclass Trojan Type Classification Results 50
5.5.1 Multiclass Performance 50
5.5.2 Overall Summary of Model Performance 51
5.6 CNN Baseline Performance Evaluation 52
Chapter 6 Conclusion 65
References 67
-
dc.language.isoen-
dc.subject硬體木馬zh_TW
dc.subject量子電路zh_TW
dc.subjectQASMzh_TW
dc.subjectCodeBERTzh_TW
dc.subjectTransformer 模型zh_TW
dc.subjectTransformer Modelen
dc.subjectQASMen
dc.subjectHardware Trojanen
dc.subjectQuantum Circuiten
dc.subjectCodeBERTen
dc.title基於codeBERT模型偵測量子電路中的硬體木馬zh_TW
dc.titleDetecting Hardware Trojans in Quantum Circuits Based on CodeBERT modelen
dc.typeThesis-
dc.date.schoolyear113-2-
dc.description.degree碩士-
dc.contributor.oralexamcommittee林宗男;雷欽隆;顏嗣鈞;陳俊良;陳英一zh_TW
dc.contributor.oralexamcommitteeTsung-nan Lin;Chin-Laung Lei;Hsu-chun Yen;Jiann-Liang Chen;Ying-i Chenen
dc.subject.keyword量子電路,硬體木馬,Transformer 模型,CodeBERT,QASM,zh_TW
dc.subject.keywordQuantum Circuit,Hardware Trojan,Transformer Model,CodeBERT,QASM,en
dc.relation.page69-
dc.identifier.doi10.6342/NTU202502584-
dc.rights.note未授權-
dc.date.accepted2025-08-04-
dc.contributor.author-college電機資訊學院-
dc.contributor.author-dept電機工程學系-
dc.date.embargo-liftN/A-
顯示於系所單位:電機工程學系

文件中的檔案:
檔案 大小格式 
ntu-113-2.pdf
  未授權公開取用
3.14 MBAdobe PDF
顯示文件簡單紀錄


系統中的文件,除了特別指名其著作權條款之外,均受到著作權保護,並且保留所有的權利。

社群連結
聯絡資訊
10617臺北市大安區羅斯福路四段1號
No.1 Sec.4, Roosevelt Rd., Taipei, Taiwan, R.O.C. 106
Tel: (02)33662353
Email: ntuetds@ntu.edu.tw
意見箱
相關連結
館藏目錄
國內圖書館整合查詢 MetaCat
臺大學術典藏 NTU Scholars
臺大圖書館數位典藏館
本站聲明
© NTU Library All Rights Reserved