在過去集貨場中,大都以目視檢測(Visual Inspection)的方式檢出表面有瑕疵的果品,但因該類工作重複性高且乏味,使得檢測員的判斷及專注力會隨時間而下降,造成出貨品質不一。本研究以你只看過一次版本四(You Only Look Once version 4,簡稱YOLOv4)為基礎發展一套鳳梨釋迦(Custard Apple)表面瑕疵偵測演算法,該演算法亦結合實驗設計(Design of Experiment,簡稱DOE)客觀地幫忙決定輸入影像尺寸上限、是否開啟學習率餘弦退火(Cosine Annealing)機制以及是否開啟馬賽克影像擴增(Mosaic Image Augmentation)機制來訓練模型。實驗結果顯示,最佳的模型的訓練mAP可達65.045%,而測試mAP則達57.63%。此外,若將預訓練模型應用至一般釋迦的影像集時,其相對應的測試mAP 高達69.95%,可知該模型在它類品種、背景複雜、光照條件不同時仍可進行可靠的推論。本研究所提之方法是一套無特徵擷取(Feature-free)、不須人為介入改進策略實驗的演算法,對於品種多元的水果表面檢測任務而言是一大誘因。
In the past cargo yards, most of the fruits with defects embedding on the surface were detected by visual inspection. Due to the high repetitiveness and tedious work of this kind of work, however, the judgment and concentration of the inspectors will decrease over time. The quality of inspection is in consist. Based on the you only look once version 4 (YOLOv4), this study develops a surface defect detection algorithm for custard apples. This algorithm is combined with the design of experiment (DOE) which is able to determine the upper limit of the input image size, whether to use the learning rate cosine annealing or not, and whether to use the mosaic image augmentation or not objectively as training the YOLOv4 model. The experimental results showed that the training mAP of the best model was up to 65.045%, while the test mAP was over to 57.63%. In addition, if the pre-trained model was applied to the image set of general sugar apples, the corresponding test mAP was as high as 69.95%. The result indicated that the pre-trained model can still make reliable inferences in other varieties, complex backgrounds, and different lighting conditions. The method proposed in this study is a feature-free algorithm and does not require human intervention in improved strategy experiments. Those advantages are major incentives for the task of measuring multiple varieties of fruit surface defects.