錯誤更正碼(Error Correcting Output Codes, ECOC)是一種用於解決多元分類問題的技術,其核心概念是設計編碼簿(Codebook),將每個類別映射到唯一的碼字(Codeword),並將編碼簿作為標籤讓模型學習。在基於錯誤更正碼技術的模型中,編碼簿的設計至關重要。過去的研究中,編碼簿多為人為設計、使用已知的編碼技術或隨機生成。然而,這些方法不僅需在模型訓練前額外產生,其產生的編碼簿也不一定能適用於任意資料集。本論文基於對比學習的模型框架,提出了三種自動化編碼簿學習的錯誤更正碼模型。這些模型無需在訓練前生成編碼簿,且編碼簿的生成由模型根據資料集的特性自動學習,從而解決了上述提及的編碼簿問題。我們在四種資料集中與兩種基礎模型進行比較,並評估三種錯誤更正碼模型的優劣與限制。此外,我們還實驗了自動化編碼簿學習的錯誤更正碼模型是否具有抵禦對抗攻擊的能力,並討論了未來改進的方向。;Error Correcting Output Codes (ECOC) is a technique for solving multi-class classification problems. Its core concept involves designing a codebook: each class maps to a unique codeword; these codewords are treated as labels for model training. Thus, the design of the codebook is crucial. In past research, codebooks were often manually designed based on known encoding techniques or generated randomly. However, these methods require manual codebook design before model training, and there may be better choices of codebooks for the given datasets. This paper proposes three automated codebook learning models for ECOC based on the framework of contrastive learning. These models do not require manual codebook design before training, and the model automatically learns the codebook based on the dataset′s characteristics. We compare these models with two baseline models on four open datasets and evaluate the strengths, weaknesses, and limitations of the three ECOC models. Additionally, we experiment with whether the ECOC models with automated codebook learning can resist adversarial attacks and discuss directions for future improvements.