Please use this identifier to cite or link to this item: http://ir-ithesis.swu.ac.th/dspace/handle/123456789/1165
Title: COFFEE BEANS FEATURE EXTRACTION AND SELECTION FOR QUALITY CLASSIFICATION USING IMAGE PROCESSING
การสกัดและคัดเลือกคุณลักษณะของเมล็ดกาแฟเพื่อจำแนกประเภทตามคุณภาพ ด้วยการประมวลผลภาพถ่าย
Authors: SAENGDAO DUANJAM
แสงดาว เดือนแจ่ม
Nuwee Wiwatwattana
นุวีย์ วิวัฒนวัฒนา
Srinakharinwirot University. Faculty of Science
Keywords: เมล็ดกาแฟ
การประมวลผลภาพถ่าย
การจำแนกภาพ
การเรียนรู้ด้วยเครื่อง
Coffee Beans
Image Processing
Image Classification
Machine Learning
Issue Date:  14
Publisher: Srinakharinwirot University
Abstract: This research aims to propose feature extraction methods from the images of coffee beans for quality classification. The samples used were separated into two groups, and the balanced data reported an equal amount of 1,303 good quality and bad quality beans, and the imbalanced data reported 1,303 good quality beans and 4,607 bad quality beans. The entire process consisted of five steps: data preparation, image preprocessing, feature extraction, feature analysis, and coffee bean classification. Firstly, pictures of coffee beans acquired from fixed settings were processed with foreground segmentation, lost pixel retrieval, and edge detection. There were three groups of features and a total of 32 features, were extracted from the images of coffee beans.  The four features are size and shape, twenty-four are color-related and four are grayscale-related. The machine learning techniques used for the classification were Logistic Regression and Random Forest. The results showed that for both balanced and imbalanced data, the Random Forest model yielded slightly better classification performance than the Logistic Regression model with hyperparameter tuning and cross-validation, except for the recall in the imbalanced situation. The accuracy of the Random Forest model on the balanced data was 92.34 % and the imbalanced data was 92.13 %. The precision and recall on the balanced data were 92.35 % and 92.34 % and the imbalanced data were 89.89 and 86.58 %, respectively. The F1-score on the balanced data was 92.34 % and the imbalanced data was 88.08 %. The research suggested that coffee bean images classified with the Random Forest model can be applied in real settings in coffee plantations.
งานวิจัยนี้นำเสนอวิธีการสกัดคุณลักษณะของภาพถ่ายเมล็ดกาแฟ เพื่อจำแนกประเภทตามคุณภาพของเมล็ดกาแฟ ตัวอย่างที่ใช้ในการศึกษาแบ่งออกเป็น 2 กลุ่ม โดยกลุ่มตัวอย่างชุดข้อมูลสมดุล มีจำนวนเมล็ดดีและเมล็ดเสียอย่างละ 1,303 เมล็ด และชุดข้อมูลไม่สมดุล มีจำนวนเมล็ดดี 1,303 เมล็ด และเมล็ดเสียจำนวน 4,607 เมล็ด โดยผ่านกระบวนการ 5 ขั้นตอน คือ 1) การเตรียมข้อมูล 2) การประมวลผลภาพเบื้องต้น 3) การสกัดคุณลักษณะ 4) การวิเคราะห์คุณลักษณะ และ 5) การจำแนกประเภทเมล็ดกาแฟ สำหรับการประมวลผลภาพเบื้องต้นประกอบด้วย (1) การแยกเมล็ดกาแฟจากภาพพื้นหลัง (2) การเติมเต็มส่วนขาดหาย (3) การตรวจจับขอบของเมล็ดกาแฟ และสำหรับการสกัดคุณลักษณะ ได้ทำการสกัดคุณลักษณะจำนวน 3 กลุ่ม โดยมีคุณลักษณะทั้งหมด 32 คุณลักษณะประกอบด้วย (1) กลุ่มของขนาดและรูปร่าง จำนวน 4 คุณลักษณะ (2) กลุ่มของค่าสี จำนวน 24 คุณลักษณะ (3) กลุ่มของค่าสีเทา จำนวน 4 คุณลักษณะ และ สำหรับการจำแนกเมล็ดกาแฟ ใช้เทคนิคการเรียนรู้ของเครื่องในการพัฒนาแบบจำลองพื้นฐาน 2 แบบจำลอง ประกอบด้วย Logistic Regression และ Random Forest จากผลการทดลองได้แสดงให้เห็นว่าแบบจำลอง Random Forest มีประสิทธิภาพสูงกว่าเล็กน้อย ยกเว้นค่า Recall ของชุดข้อมูลไม่สมดุล ที่มีค่าต่ำกว่าเล็กน้อย โดยที่ค่าความแม่นยำ ชุดข้อมูลสมดุลคิดเป็น 92.34 เปอร์เซ็นต์ ชุดข้อมูลไม่สมดุลคิดเป็น 92.13 เปอร์เซ็นต์ ค่า Precision และค่า Recall ชุดข้อมูลสมดุลคิดเป็น 92.35 เปอร์เซ็นต์ และ 92.34 เปอร์เซ็นต์ ชุดข้อมูลไม่สมดุลคิดเป็น 89.89 เปอร์เซ็นต์ และ 86.58 เปอร์เซ็นต์ ค่าเฉลี่ย F1 ชุดข้อมูลสมดุลคิดเป็น 92.34 เปอร์เซ็นต์ และชุดข้อมูลไม่สมดุลคิดเป็น 88.08 เปอร์เซ็นต์ ในการวิจัยนี้แสดงให้เห็นว่าการจำแนกประเภทเมล็ดกาแฟเป็นเมล็ดกาแฟดีและเมล็ดกาแฟเสียโดยใช้ภาพถ่ายบนพื้นฐานของแบบจำลอง Random Forest สามารถนำไปประยุกต์ใช้ในการคัดแยกเมล็ดกาแฟในไร่กาแฟได้ต่อไป 
Description: MASTER OF SCIENCE (M.Sc.)
วิทยาศาสตรมหาบัณฑิต (วท.ม.)
URI: http://ir-ithesis.swu.ac.th/dspace/handle/123456789/1165
Appears in Collections:Faculty of Science

Files in This Item:
File Description SizeFormat 
gs601130299.pdf4.35 MBAdobe PDFView/Open


Items in DSpace are protected by copyright, with all rights reserved, unless otherwise indicated.