光學鏡頭設計為精密光學產品研發之核心環節。傳統設計流程高度依賴工程師之光學專業知識,需藉由商業模擬軟體反覆進行光線追跡迭代,耗費大量人力與時間。近年機器學習以資料驅動方式輔助光學設計逐漸受到重視,然而現有研究多侷限於單一鏡頭系統,缺乏跨異質系統之泛化能力,且難以同時處理問題診斷與參數最佳化兩個層面。因此本研究旨在建立一套能跨越多種異質光學系統、整合自動化診斷與最佳化能力之機器學習架構,以提升鏡頭設計流程之效率與可重現性。 本研究提出一套三層階層式機器學習架構。第一層以圖注意力網路(GATv2)對光學系統幾何結構進行圖建模,融合節點特徵(曲率、厚度、玻璃材料等)、邊特徵(面間耦合)與全域特徵,學習各系統之結構嵌入向量並預測 19 項光學性能指標。第二層以多任務學習模型(LightGBM 與 MLP)進行動作排序診斷,於同一基準系統下以雙頭架構同時輸出優先調整分數(priority)與改善機率(is_improved),作為後續最佳化之動作先驗。第三層訓練代理模型取代高成本之光線追跡計算,並結合 Greedy Search、Beam Search 及近端策略最佳化(PPO)三種搜尋策略規劃調整動作序列。訓練資料涵蓋 Tessar、Triplet、Double Gauss、Wide Angle、Cassegrain RC 及 Schmidt 六種光學系統,透過拉丁超立方取樣自 CODE V 生成約 12,000 筆設計樣本及其延伸之擾動樣本。 實驗結果顯示,第一層 GNN 於混合多系統訓練下,MTF 與波前誤差之決定係數(R²)達 0.97 以上,光斑大小 R² 達 0.85–0.95,且混合訓練優於單一系統訓練,驗證跨系統泛化能力。第二層診斷模型 Top-3 命中率(Hit@3)達 0.938(LightGBM)、NDCG@3 達 0.915,並經消融與跨系統留一法(LOSO)測試確認其穩健性與表現邊界。第三層代理模型對主要性能指標之預測 R² 達 0.918,PPO 之設計改善成功率達 0.69,與 Greedy、Beam Search 平手,惟在短步數搜尋下為較簡單方法展現額外優勢。綜合三層結果,本系統能有效辨識關鍵問題鏡面並提供具體參數調整建議,為多種異質光學系統提供可量化、可重現的自動化設計最佳化方案。;Optical lens design is a core component of precision optical product development. Traditional design workflows rely heavily on engineers′ optical expertise, requiring iterative ray-tracing computations through commercial simulation software, which is both labor-intensive and time-consuming. In recent years, data-driven machine learning approaches for assisting optical design have gained growing attention; however, existing studies are largely limited to single lens systems, lacking generalization across heterogeneous systems and rarely addressing both problem diagnosis and parameter optimization simultaneously. This study therefore aims to develop a machine learning framework capable of spanning multiple heterogeneous optical systems and integrating automated diagnosis and optimization, thereby improving the efficiency and reproducibility of the lens design process. This study proposes a three-layer hierarchical machine learning framework. The first layer employs a Graph Attention Network (GATv2) to model the geometric structure of optical systems as graphs, fusing node features (curvature, thickness, glass material, etc.), edge features (inter-surface coupling), and global features to learn structural embeddings and predict 19 optical performance metrics. The second layer applies a multi-task model (LightGBM and MLP) for action-ranking diagnosis, using a dual-head architecture to jointly output a priority adjustment score (priority) and an improvement probability (is_improved) per candidate action under each baseline system, serving as action priors for subsequent optimization. The third layer trains a surrogate model to replace costly ray-tracing computations and combines three search strategies—Greedy Search, Beam Search, and Proximal Policy Optimization (PPO)—to plan parameter adjustment sequences. The training data covers six optical systems—Tessar, Triplet, Double Gauss, Wide Angle, Cassegrain RC, and Schmidt—comprising approximately 12,000 design samples generated from CODE V via Latin Hypercube Sampling, together with perturbation samples derived from them. Experimental results show that the first-layer GNN, trained jointly on multiple systems, achieves a coefficient of determination (R²) above 0.97 for MTF and wavefront error and 0.85–0.95 for spot size, with mixed-system training outperforming single-system training and confirming cross-system generalization. The second-layer diagnostic model attains a Top-3 hit rate (Hit@3) of 0.938 (LightGBM) and NDCG@3 of 0.915, with ablation and leave-one-system-out (LOSO) tests confirming its robustness and capability boundary. The third-layer surrogate model achieves a prediction R² of 0.918 for key performance metrics, and the PPO strategy reaches a design improvement success rate of 0.69, matching Greedy and Beam Search but showing no additional gains over the simpler methods under short-horizon search. Overall, the proposed system effectively identifies critical problematic surfaces and provides concrete parameter adjustment recommendations, offering a quantifiable and reproducible automated optimization solution for multiple heterogeneous optical systems.