簡易檢索 / 詳目顯示

研究生: 李俊德
LEE, Chun-De
論文名稱: 基於深度學習之咖啡豆即時辨識
Real-time Coffee Beans Recognition Based on Deep Learning
指導教授: 林忠宏
Lin, Chung-Hung
學位類別: 碩士
Master
系所名稱: 工學院 - 系統及船舶機電工程學系
Department of Systems and Naval Mechatronic Engineering
論文出版年: 2018
畢業學年度: 106
語文別: 中文
論文頁數: 91
中文關鍵詞: 咖啡豆辨識類神經網路預訓練模型
外文關鍵詞: Recognition of coffee beans, Convolutional neural network, Pre-trained model
相關次數: 點閱:93下載:5
分享至:
查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報
  • 目前咖啡豆的選別大部分仍是利用人工進行檢測,由於人工檢測的方式相當耗時費力,且作業人員在長時間的工作下視覺容易產生疲勞,以致於影響選別的速度與準確性,使選別出來的咖啡豆品質無法達到一定的標準。因此咖啡豆選別的自動化將是未來咖啡產業相當重要的趨勢,以達到節省人力資源與時間成本之目的。
    本文以自製的咖啡豆辨識機構蒐集咖啡豆的影像資料,並輸入至預訓練模型中對模型做微調(fine-tune),改變最後的輸出類別使之成為咖啡豆辨識的模型。首先以單面辨識的方式拍攝咖啡豆滑落軌道之影片,並將咖啡豆影像利用背景相減法從影片中擷取出來,分為好豆、瑕疵豆、無豆三個類別輸入至預訓練模型-Inception V3中做離線的訓練與測試,得到好豆正確率為76.67%、瑕疵豆正確率為79.31%、無豆正確率為100%。接著自製咖啡豆辨識機構,以一顆為單位利用網路攝影機(webcam)進行拍攝,蒐集更多訓練資料做訓練,最後實際將咖啡豆丟入至機構中做即時的辨識,其好豆正確率為63%、瑕疵豆為79%、無豆為100%。但單面拍攝下可能因瑕疵部份在另一面而攝影機沒有拍攝到而導致辨識錯誤,故下一步將對咖啡豆的兩面皆進行拍攝。
    將兩台網路攝影機置於機構中成為拍攝咖啡豆兩面之機構,並以此蒐集大量的咖啡豆正、反兩面的訓練資料,將輸出類別改為正面好豆、反面好豆、正面瑕疵豆、反面瑕疵豆以及無豆五類,可將單面拍攝之問題做有效的改善。測試部分一樣將咖啡豆丟入機構中做即時辨識,再將辨識分數的閥值做修正,可將好豆的召回率達到100%、精確率達到93.85%。

    This paper collects the image data of coffee beans with a self-made coffee bean recognition mechanism and inputs it into a pre-trained model to fine-tune the model. First of all, use a single-side recognition method to shoot coffee beans falling on the track, and use the background subtraction method to extract the coffee bean image from the record video. It is divided into three categories: good bean, bad bean, and no bean. Inception V3 did offline training and testing, the accuracy of good beans is 76.67%, kidney beans is 80%, and no bean is 100%. Then, the self-made coffee bean recognition mechanism uses a webcam to shoot coffee beans, collects more training data, and finally actually puts the coffee beans into the mechanism for real-time recognition. The accuracy of good bean is 63%, bad bean is 79%, and no bean is 100%. However, by the single-sided shooting, the recognition may be mistaken, the next step will photograph both sides of the coffee beans.
    Use two webcams to collect a large amount of both sides of coffee beans data. The output categories are positive good bean, reverse good bean, positive bad bean, reverse bad bean and no bean. This method can improve the mistake of single-sided shooting. In the test part, the coffee beans are thrown into the mechanism for real-time recognition, and use Bayes' theorem to improve the orginal result. The recall of good beans can reach 81% and the precision is 84.38%.

    摘要 I ABSTRACT II 致謝 VII 目錄 VIII 表目錄 XII 圖目錄 XIV 第一章 緒論 1 1.1 研究動機與目的 1 1.2 文獻回顧 2 1.2.1 咖啡作物與其他農作物識別 2 1.2.2 電子觀察員-魚類識別 8 1.3 研究特點 10 1.4 本文架構 11 第二章 預訓練模型 12 2.1 摺積類神經網路(CNN)簡介 12 2.2 TensorFlow-Inception V3模型[14] 16 2.3 Torch-ResNet模型[15] 20 第三章 咖啡豆辨識機構 23 3.1 透明壓克力半圓軌道 23 3.1.1 實驗器材 23 3.1.2 實驗環境 24 3.2 3D列印-咖啡豆單面拍攝機構 26 3.2.1 實驗器材 26 3.2.2 整體機構與做動流程 29 3.3 3D列印-咖啡豆雙面辨識機構 31 第四章 預訓練模型的應用與測試-基於少量咖啡豆訓練資料 33 4.1 資料蒐集 33 4.1.1 資料蒐集流程 33 4.1.2  咖啡豆種類 34 4.1.3  背景相減法[16] 35 4.1.4 訓練與測試資料統計 37 4.2 離線情況下的咖啡豆辨識 40 4.2.1 輸入與分類方式 40 4.2.2 辨識結果與討論 41 4.3 即時咖啡豆辨識 44 4.3.1 資料蒐集 44 4.3.2 辨識速度 47 4.3.3 辨識結果與討論 48 4.4 結果討論 52 第五章 預訓練模型的測試改善-基於大量咖啡豆訓練資料 53 5.1 資料蒐集 53 5.1.1 咖啡豆偵測 53 5.1.2 雙面咖啡豆訓練與測試資料 55 5.1.3 輸入與分類方式 57 5.2 即時的咖啡豆雙面辨識 58 5.2.1 辨識結果與討論 58 5.2.2 正、反面辨識結果 63 5.3 條件機率下的數據分析 64 5.3.1 條件機率-貝氏定理[17] 64 5.3.2 咖啡豆辨識數據修正 65 5.4 辨識分數的閥值設定 69 5.5 人眼辨識比較 71 5.6 第二組測試資料比較 73 5.7 ResNet數據測試 75 5.8 結果討論 77 第六章 結論與未來展望 78 6.1 結論 78 6.1.1 單面辨識 78 6.1.2 雙面辨識 78 6.2 未來展望 80 參考文獻 81 附錄 83 7.1 魚種辨識 83 7.1.1 研究動機與目的 83 7.1.2 研究方法 83 7.1.3 測試結果 85 7.1.4 結果討論 87 7.2 魚苗計數 87 7.2.1 研究動機與目的 87 7.2.2 研究方法 87 7.2.3 測試結果 90 7.2.4 結果討論 91

    [1] 魏子量, "基於摺積類神經網路之魚類偵測與辨識," 成功大學系統及船舶機電工程學系學位論文, pp. 1-66, 2016.
    [2] 郭俊宏, "基於影像差分直方圖於揚繩作業影像中之魚體偵測," 成功大學系統及船舶機電工程學系學位論文, pp. 1-115, 2016.
    [3] 林晋億, "全彩機械視覺於咖啡生豆檢測之研究," 碩士, 電子與光電工程研究所碩士班, 國立雲林科技大學, 雲林縣, 2013.
    [4] T. Nasution and U. Andayani, "Recognition of Roasted Coffee Bean Levels using Image Processing and Neural Network," in IOP Conference Series: Materials Science and Engineering, 2017, p. 012059.
    [5] K. Nogueira, W. R. Schwartz, and J. A. dos Santos, "Coffee crop recognition using multi-scale convolutional neural networks," in Iberoamerican Congress on Pattern Recognition, 2015, pp. 67-74.
    [6] 凃亞廷, "咖啡公豆母豆自動選別裝置之開發," 碩士, 生物產業機電工程學系所, 國立中興大學, 台中市, 2014.
    [7] 石坤城, "機器視覺應用在香菇選別系統之研究," 碩士, 食品科學系, 國立屏東科技大學, 屏東縣, 2001.
    [8] 林福源, "應用影像色澤處理技術至花粉選別機之研究," 博士, 生物產業機電工程學系所, 國立中興大學, 台中市, 2013.
    [9] A. D. Mengistu, D. M. Alemayehu, and S. G. Mengistu, "Ethiopian Coffee Plant Diseases Recognition Based on Imaging and Machine Learning Techniques," International Journal of Database Theory and Application, vol. 9, pp. 79-88, 2016.
    [10] F. A. Faria, J. A. dos Santos, R. d. S. Torres, A. Rocha, and A. X. Falcao, "Automatic fusion of region-based classifiers for coffee crop recognition," in Geoscience and Remote Sensing Symposium (IGARSS), 2012 IEEE International, 2012, pp. 2221-2224.
    [11] F. Faridah, G. O. Parikesit, and F. Ferdiansjah, "Coffee bean grade determination based on image parameter," TELKOMNIKA (Telecommunication Computing Electronics and Control), vol. 9, pp. 547-554, 2011.
    [12] C. Pinto, J. Furukawa, H. Fukai, and S. Tamura, Classification of Green coffee bean images basec on defect types using convolutional neural network (CNN), 2017.
    [13] Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner, "Gradient-based learning applied to document recognition," Proceedings of the IEEE, vol. 86, pp. 2278-2324, 1998.
    [14] C. Szegedy, V. Vanhoucke, S. Ioffe, J. Shlens, and Z. Wojna, "Rethinking the inception architecture for computer vision," in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2016, pp. 2818-2826.
    [15] K. He, X. Zhang, S. Ren, and J. Sun, "Deep residual learning for image recognition," in Proceedings of the IEEE conference on computer vision and pattern recognition, 2016, pp. 770-778.
    [16] S. S. Mohamed, N. M. Tahir, and R. Adnan, "Background modelling and background subtraction performance for object detection," in Signal Processing and Its Applications (CSPA), 2010 6th International Colloquium on, 2010, pp. 1-6.
    [17] Bayes' theorem,T. Bayes. Available:https://en.wikipedia.org/wiki/Bayes%27_theorem

    下載圖示 校內:2023-09-01公開
    校外:2023-09-01公開
    QR CODE