## 4 Applications of GenAI-Driven CV in Smart Agriculture
### Fruit and Vegetable Maturity Detection and Harvesting Automation  
The evolution of fruit and vegetable maturity detection began with traditional CV techniques, which employed manual feature engineering such as colour thresholding and texture analysis. Early approaches, including using visual saliency maps and CNNs for citrus ripeness classification [126] and morphological operations for coconut maturity assessment [127], achieved moderate success in controlled environments. However, these methods exhibited pronounced limitations under field conditions, particularly sensitivity to illumination fluctuations and occlusion, leading to reduced accuracy in detection. Such constraints highlighted the inadequacy of rule-based systems for complex agricultural settings, prompting the adoption of data-driven methodologies. To address these shortcomings, deep learning architectures revolutionised maturity assessment through automated feature extraction and contextual understanding, CNNs, notably YOLO variants, enabled real-time detection of fruits like apples [128; 129; 130; 131], strawberries [132; 133], and cherry tomatoes [134] in occluded canopies and have been used for tasks like predicting feed quantity for harvesters [135], often achieving high accuracies. Vision Foundation Models (VFMs) utilising transformer architectures further enhanced performance in dense clusters by leveraging attention mechanisms to resolve overlapping fruit instances and address occlusion challenges in complex orchard environments [136]. Despite these advancements, challenges persisted in deploying deep neural networks on edge devices due to substantial resource demands, necessitating optimised architectures such as DNNShifter's pruned variants [137] and lightweight detection models for specific produce like broccoli heads in complex field environments [138]. The integration of multimodal sensing emerged as a pivotal advancement, combining hyperspectral, thermal, and RGB data to assess maturity based on biochemical indicators, rather than just appearance. Hyperspectral imaging, for instance, enabled non-destructive quantification of chlorophyll degradation in grapes [139] and sugar accumulation in melons [140], while fusion models improved robustness against environmental noise by correlating visual features with complementary sensor data [141]. These systems bridged the gap between superficial appearance and internal quality metrics, though issues of sensor interoperability and cost hindered widespread adoption. GenAI offers powerful techniques to overcome the data limitations and environmental variations that challenge maturity detection models. For example, to tackle data scarcity and class imbalance, in contrast to conventional image data augmentation techniques, GANs can synthetically augment datasets with images of rare maturity stages or underrepresented fruit types [142; 143]. More advanced diffusion models, such as the text-guided D4 method, generate fully annotated images of vineyard shoots that are adapted to diverse domain conditions, boosting object detection performance in field trials by up to 28.65% [144]. These models also provide a path for domain adaptation. For instance, generative techniques can be used to translate visual features from one orchard environment to another, helping a harvesting robot trained on one farm generalise to another with different lighting or tree structures. Similarly, conditional GANs can reconstruct images of occluded grapevine berries, providing a clearer view for more accurate yield estimation in dense foliage [145]. These algorithmic advancements underpinned the development of autonomous harvesting systems, which integrated 3D vision, LiDAR, and reinforcement learning to synchronise perception and action [146], including stereo vision for tasks like the precise automatic steering of combine harvesters through edge detection [147].