Rebecca AlindaBenjamin Mutumba MubeeziIsaac Nickson Nziriga2026-09-022026-09-022026-06-03https://hdl.handle.net/20.500.12311/3604UndergraduateUganda’s coffee sector, which contributes 20–30% of the country’s foreign exchange earnings, faces persistent quality challenges rooted in manual sorting practices. Ninety percent of Uganda’s coffee is produced by smallholder farmers who lack access to affordable sorting technology. Manual sorting is labour-intensive, inconsistent, and prone to human error rates of 20–25% after prolonged operation, limiting farmers’ access to specialty markets that pay 40–60% premium prices. This project presents the design, development, and evaluation of an Automated Coffee Bean Quality Sorting System, which is a low-cost (UGX 450,000–562,500) solution combining multi-sensor integration, machine learning, and embedded systems. The system employs a Raspberry Pi 4 as the central processing unit, a TCS3200 colour sensor for RGB-based bean assessment, a Camera Module 2 for visual inspection, and an Arduino Uno for motor control via an L298N driver. Beans are transported on a conveyor belt and assessed at sequential sensing stations before a servo motor diverts defective beans. The machine learning pipeline employs a dual-model fusion strategy: a Decision Tree classifier trained on colour sensor readings achieves approximately 98% accuracy, while a MobileNetV2 CNN model processed via TensorFlow Lite provides visual classification. A conservative fusion strategy defaults to rejection when model outputs conflict, ensuring food safety. The system achieves a throughput of 1–2 beans per second with inference latency below 50 ms. Key findings include: (1) the Decision Tree outperforms the CNN in the current deployment due to a domain gap between training data and Ugandan Robusta beans under real field conditions; (2) the conservative reject-on-conflict strategy provides a defensible default for food quality systems; (3) the total cost represents a 97–98% reduction versus commercial alternatives costing UGX 18,750,000–56,250,000. The system demonstrates technical feasibility and strong potential for adoption among smallholder cooperatives across East Africa. Keywords: coffee bean sorting, machine learning, Decision Tree, MobileNetV2, TensorFlow Lite, Raspberry Pi, multi-sensor integration, smallholder agriculture, Uganda, precision agriculture.enAutomated coffee bean quality sorting using machine learning and multi-sensor integration: A low-cost solution for Ugandan smallholder farmersDissertation