Coffee disease detection using a robust HSV color‐based segmentation and transfer learning for use on smartphones
Fraol Gelana Waldamichael, Taye Girma Debelee, Yehualashet Megersa Ayano
Abstract
Ethiopia's coffee export accounts for about 34% of all exports for the budget year 2019/2020. Making it the 10th-largest coffee exporter in the world. Coffee diseases cause around 30% loss in production annually. In this paper, we propose an approach for the detection of four classes of coffee leaf diseases, Rust, Miner, Cercospora, and Phoma by using a fast Hue, Saturation, and Value (HSV) color space segmentation and a MobileNetV2 architecture trained by transfer learning. The proposed HSV color segmentation algorithm constitutes of separating the leaf from the background and separating infected spots on the leaf by automatically finding the best threshold value for the Saturation (S) channel of the HSV color space. The algorithm was compared to the YCgCr and k-means algorithms, in terms of Mean Intersection Over Union and F1-Score. The proposed HSV segmentation algorithm outperformed these methods and achieved an MIoU score of 72.13% and an F1 score of 82.54%. The proposed algorithm also outperforms these methods in terms of execution time, taking on average 0.02 s per image for the segmentation of diseased spots from healthy leaf spots. Our MobileNetV2 classifier achieved a 96% average classification accuracy and 96% average precision. The segmentation accuracy and faster execution make the proposed algorithm suitable for deployment on mobile devices and as such has been successfully implemented on smartphones running the Android operating system.