Abstract:
งานวิจัยนี้เป็นการศึกษาและออกแบบเครื่องคัดแยกเพศของเมล็ดกัญชาโดยกระบวนการ Machine Learning และ Deep Learning โดยทำการเก็บข้อมูลภาพของเมล็ดกัญชาทั้งหมด 5,000 ภาพ แบ่งเป็นเพศผู้ 2,500 ภาพ และเพศเมีย 2,500 ภาพ ไปเข้าสู่กระบวนการสร้างแบบจำลองทั้ง Machine Learning และ Deep Learning เพื่อทำการเปรียบเทียบค่าประสิทธิภาพความแม่นยำในการทำนายเพศของเมล็ดกัญชา ซึ่งกระบวนการ Machine Learning ทางผู้วิจัยได้เลือกใช้แบบจำลองทั้งหมด 4 แบบ คือ KNN (K-Nearest Neighbors), CART (Classification and Regression Trees), การวิเคราะห์จำแนกเชิงเส้น (Linear Discriminant Analysis: LDA) และ Support Vector Machine (SVM) ส่วนกระบวนการ Deep Learning ได้เลือกใช้แบบจำลอง Yolov5 มาใช้ในการวิเคราะห์ข้อมูล จากผลการวิจัยพบว่าแรงดูดที่เหมาะสมสำหรับเครื่องคัดแยกเพศของเมล็ดกัญชาที่ผู้วิจัยได้ทำการออกแบบจะอยู่ที่ 500 mmHg โดยสามารถดูดคัดแยกเมล็ดสำเร็จทั้ง 30 เมล็ด และความเร็วในการเคลื่อนที่ของ Motor Servo ในแต่ละแกนที่เหมาะสมและสอดคล้องกับระบบประมวลผลภาพจะอยู่ที่ 70 mm/s ซึ่งใช้เวลาเพียง 4.50 นาทีในการคัดแยกเมล็ดจำนวน 30 เมล็ด ในส่วนของประสิทธิภาพความแม่นในการคัดแยกเพศของแต่ละแบบจำลองนั้น การคัดแยกเมล็ดเพศผู้นั้น แบบจำลอง Yolov5, LDA, SVM, Decision Tree และ KNN, NB มีความแม่นอยู่ที่ 93.33%, 83.33%, 63.33%, 56.67%, 50.00% ตามลำดับ การคัดแยกเมล็ดเพศเมียนั้น แบบจำลอง Yolov5, NB, Decision Tree, KNN, SVM, LDA ความแม่นอยู่ที่ 96.67%, 80.00%, 76.67%, 60.00%, 36.67% ตามลำดับ ส่วนการคัดแยกเมล็ดเพศผู้และเมียรวมกันนั้น แบบจำลอง Yolov5, NB, Decision Tree, KNN, SVM, LDA ความแม่นอยู่ที่ 93.33%, 76.67%, 73.33%, 70.00%, 66.67%, 60.00% ตามลำดับ
This research involves the study and design of a machine that sorts cannabis seeds by gender using machine learning and deep learning processes. A dataset of 5,000 images of cannabis seeds was collected and divided equally into 2,500 male and 2,500 female seeds for the modeling process. The research compared the efficiency of sex prediction accuracy between Machine Learning and Deep Learning.In the Machine Learning process, four models were used: K-Nearest Neighbors (KNN), Classification and Regression Trees (CART), Linear Discriminant Analysis (LDA), and Support Vector Machine (SVM). For the Deep Learning process, the YOLOv5 model was utilized for data analysis. The research results indicated that the optimal suction force for the cannabis seed sorting machine was 500 mmHg. This setting enabled the successful sorting of all 30 seeds at a motor servo movement speed of 70 mm/s in each axis, taking only 4.50 minutes for sorting.For gender separation, the YOLOv5, LDA, SVM, Decision Tree, and KNN models achieved accuracies of 93.33%, 83.33%, 63.33%, 56.67%, and 50.00%, respectively. Additionally, the simulated accuracies of YOLOv5, NB, Decision Tree, KNN, SVM, and LDA were 96.67%, 80.00%, 76.67%, 60.00%, 36.67%, and 60.00%, respectively