A 30–50% reduction in Theobroma cacao L. productivity is frequently induced by the severe infestation of Anthracnose (Colletotrichum gloeosporioides) and Black Pod Rot (Phytophthora palmivora) pathogens. However, the field deployment of conventional deep learning detection systems remains widely hindered by manual hyperparameter tuning procedures that are inherently sub-optimal, inconsistent, and computationally inefficient. This study aims to develop a Bayesian-optimized deep learning framework integrating the YOLOv8 architecture and the Optuna platform to achieve robust, early multiclass cocoa disease detection across highly heterogeneous field imagery. The methodology was designed through an experimental approach using an in-field dataset acquired from Jembrana, Bali, which couples the anchor-free YOLOv8 model with automated Hyperparameter Optimization (HPO) governed by the Tree-structured Parzen Estimator (TPE) algorithm over 173 trials. The optimal model isolated at Trial 172 successfully achieved high-tier performance metrics on an independent test set, yielding an mAP50 of 0.9546, an $mAP50-95 of 0.7987, a Macro Precision of 0.9083, and a Macro Recall of 0.9370. The emergence of a remarkably narrow generalization gap (0.0019) paired with an elite average inference latency of 12.58 ms per image rigorously confirms the tactical feasibility of this framework for real-time deployment on edge computing devices within agricultural environments.