摘要 本研究針對相機模組來料品質管理中批次品質波動所造成之品質風險進行 探討。在實際製造環境中,供應商來料品質容易受到製程條件、設備狀態及組 裝變異等因素影響,使不同批次間存在品質差異。傳統來料檢驗多於產品完成 檢驗後才能發現品質異常,較缺乏提前辨識高風險批次之能力。因此,本研究 以相機模組 Edge MTF50 量測資料為基礎,建立批次品質風險預測模型,期望 於批次正式投入生產前提前預測品質風險,作為來料品質管理與品質預警之依 據。本研究依據量測時間順序建立批次資料,並以前一批次之品質資訊預測下 一批次之品質風險。首先透過特徵工程萃取批次統計特徵,包括平均值 (Mean)、標準差(Standard Deviation, STD)、對角差異(Diagonal Difference, Diag_diff)及第 10 百分位數(Q10),並結合供應商、料號、對焦距 離及相機型號等產品與製程資訊作為模型輸入,以下一批次之批次不良比例 (Failed Ratio)作為模型預測目標。研究中分別建立 Linear Regression、 Decision Tree、Random Forest 與 XGBoost 四種機器學習模型,並採用五折交叉 驗證(5-Fold Cross Validation)評估模型之預測能力與穩定性,以比較不同模型 於批次品質風險預測之適用性。研究結果顯示,Linear Regression 難以有效描述 資料中的非線性關係,Decision Tree 雖可學習部分非線性特徵,但模型穩定性 仍受到資料切分方式影響;相較之下,Random Forest 與 XGBoost 均展現優異 之預測能力,其中 XGBoost 整體表現最佳,平均決定係數(R²)達 0.9749,平 均均方根誤差(RMSE)為 0.0132,略優於 Random Forest(R²=0.9739;RMSE =0.0135),顯示其具有較佳之預測能力與泛化能力。此外,特徵重要度分析結 果顯示,Q10 與 Mean 為影響批次品質風險之關鍵特徵,其中 Q10 能有效反映 批次中低品質樣本之分布情形,對模型預測貢獻最高,顯示低品質樣本分布相 i 較於平均品質更能反映後續批次之品質風險。為驗證模型於實際生產情境之應 用能力,本研究進一步以 22 個連續驗證批次進行模型測試,並利用 Prediction Error 分析模型預測誤差,再結合 Shewhart Control Chart 建立 Prediction Error Control Chart,以評估模型長期預測穩定性。結果顯示,模型平均 Prediction Error 為 0.00245,Mean Absolute Error(MAE)為 0.01916,Root Mean Square Error(RMSE)為 0.02357,且所有 Prediction Error 均落於±3σ 控制界限內, 未出現超出控制界限之異常點,表示模型預測誤差維持於統計控制狀態,具有 良好的穩定性與可靠性。 綜合研究結果,本研究證實結合批次統計特徵與機器學習方法,可有效提 升相機模組批次品質風險預測能力,並透過 Prediction Error 與 Shewhart Control Chart 建立模型監控機制,使品質管理由傳統事後檢驗提升為事前預警。研究成 果可作為相機模組來料品質管理、供應商品質監控、抽樣策略調整及製程改善 之決策依據,並可提供智慧製造品質預警系統建置之參考。;ABSTRACT This study investigates the problem of batch quality variation in incoming quality control of camera modules. In practical manufacturing environments, the quality of incoming camera modules is affected by variations in manufacturing processes, equipment conditions, and assembly precision, resulting in inconsistent quality among production batches. Conventional incoming inspection typically identifies quality issues only after inspection has been completed, making it difficult to detect high-risk batches in advance. Therefore, this study aims to develop a batch-level quality risk prediction model that enables early identification of quality risks before subsequent batches enter production, thereby supporting proactive quality management and quality warning applications. Batch-level datasets were constructed according to the chronological order of Edge Modulation Transfer Function 50 (MTF50) measurements. A time-series prediction framework was then established by using statistical characteristics of the current batch to predict the quality risk of the subsequent batch. Feature engineering was applied to extract batch statistical features, including Mean, Standard Deviation (STD), Diagonal Difference (Diag_diff), and the 10th percentile (Q10). In addition, manufacturing-related information, including vendor, part number, focus distance, and camera type, was incorporated as input variables. The Failed Ratio of the subsequent batch was defined as the prediction target. Four machine learning models, namely Linear Regression, Decision Tree, Random Forest, and XGBoost, were developed and evaluated using five-fold cross- validation to compare their prediction performance and determine the most suitable model for batch quality risk prediction. The experimental results indicate that Linear Regression was unable to effectively capture the nonlinear relationships within the dataset, while Decision Tree partially modeled nonlinear patterns but exhibited limited stability across different data partitions. In contrast, both Random Forest and XGBoost demonstrated excellent predictive performance. Among them, XGBoost achieved the best overall results, with an average coefficient of determination (R²) of 0.9749 and an average root mean square error (RMSE) of 0.0132, slightly outperforming Random Forest (R² = 0.9739, RMSE = 0.0135). Feature importance analysis further revealed that Q10 and Mean were the two most influential predictors of batch quality risk. In particular, Q10 effectively represented the distribution of low-quality samples within a batch and contributed the most to prediction accuracy, indicating that the distribution of low-quality samples is more informative than the overall average quality in assessing future batch quality risk. To further evaluate the practical applicability of the proposed model, the prediction performance was validated using 22 consecutive production batches. Prediction Error analysis was performed, and a Prediction Error Shewhart Control Chart was established to assess the long-term stability of the model. The results showed a mean Prediction Error of 0.00245, a Mean Absolute Error (MAE) of 0.01916, and a Root Mean Square Error (RMSE) of 0.02357. Moreover, all prediction errors remained within the ±3σ control limits, with no out-of-control observations detected, indicating that the prediction model remained under statistical control and maintained stable predictive performance throughout the validation period. Overall, the results demonstrate that integrating batch statistical features with machine learning techniques can effectively improve batch quality risk prediction for camera modules. Furthermore, incorporating Prediction Error analysis with the Shewhart Control Chart provides an effective mechanism for continuous model monitoring, transforming conventional post-inspection quality control into a proactive quality warning framework. The proposed approach can serve as a practical decision- support tool for incoming quality management, supplier quality monitoring, inspection strategy optimization, and process improvement, while providing a valuable reference for the development of intelligent quality warning systems in smart manufacturing.