Accurate perception of tomato inflorescences and flower states can often be required to support key operations in greenhouse tomato production, such as pollination and topping at the flowering and fruiting stage. However, inflorescences and flowers are characterized by small target size, dense spatial distribution, complex backgrounds, and frequent occlusion by leaves and stems in practical greenhouse environments. Single-stage detection models cannot simultaneously realize stable inflorescence localization and high-precision flower state recognition when operating on whole-plant images. In this study, a two-stage cascaded framework of visual perception was developed to detect tomato inflorescence and flower states using an improved YOLO version 11 network. A “spatial localization followed by fine-grained recognition” strategy was adopted to decompose the overall perception task into two sequential subtasks. In the first stage, an inflorescence detection model was constructed to enhance the baseline YOLO version eleven network with a Deformable Large Kernel Attention mechanism and a Dynamic Head detection structure. Deformable Large Kernel Attention Mechanism also employed large convolutional kernels with deformable convolution to capture long-range contextual information between inflorescences and adjacent peduncles, while morphological variations were also considered at different growth stages and plant structures. The dynamic head module incorporated scale- and spatial-aware feature modeling, thereby enabling the detector to robustly handle inflorescences of varying sizes for the complex regions, where inflorescences and leaves overlapped. The output precise spatial regions corresponded to inflorescences, which served as reliable regions of interest for subsequent analysis. In the second stage, a flower state recognition model was designed to operate exclusively within the inflorescence regions in the first stage. A lightweight backbone network, MobileNetV4, was adopted to reduce computational complexity for inference efficiency, while preserving feature representation. An Adaptive Task-aligned Focal Loss function was introduced to balance sample distribution among different flower developmental states. This loss function dynamically adjusted category weights, according to classification difficulty and sample frequency, thereby enhancing recognition performance for the minority and easily confused flower states under occlusion and cluttered backgrounds. Experiments were conducted on a greenhouse tomato image dataset at multiple growth stages and complex environments. In the inflorescence task, the first-stage model achieved substantial improvements in performance, compared with the baseline network, with the precision, recall, mean average precision at an intersection-over-union threshold of 0.5, and F1-score increasing by 4.02, 5.25, 8.49, and 4.66 percentage point, respectively. These results demonstrated that the attention and detection head enhancements significantly improved small-target detection stability in complex scenes. In the flower state recognition task, the second-stage model further improved precision, recall, mean average precision at the same threshold, and F1-score by 5.24, 2.97, 5.31, and 4.07 percentage point, respectively, indicating stronger identification for fine-grained flower state classification. The cascaded framework achieved an average processing speed of 38.4 frames per second under a single-input condition, fully meeting the real-time requirements of continuous greenhouse monitoring and online agricultural operations. The cascaded framework effectively balanced detection accuracy and computational efficiency to decouple spatial localization from fine-grained recognition. The reliable inflorescence and flower state recognition from whole-plant images can provide a practical visual perception for pollination, topping, and intelligent operations in greenhouse tomato production.
| 科 Family | 属数 Number of genus | 种数 Number of species | 占总种数比例 Percentage of total species (%) | 属 Genus | 种数 Number of species | 占总种数比例 Percentage of total species (%) |
|---|---|---|---|---|---|---|
| 鹅膏菌科Amanitaceae | 2 | 11 | 5.26 | 鹅膏菌属 Amanita | 10 | 4.78 |
| 小菇科 Mycenaceae | 2 | 12 | 5.74 | 丝盖伞属 Inocybe | 5 | 2.39 |
| 多孔菌科 Polyporaceae | 8 | 14 | 6.70 | 蜡蘑属 Laccaria | 5 | 2.39 |
| 红菇科 Russulaceae | 3 | 23 | 11.00 | 小皮伞属 Marasmius | 6 | 2.87 |
| 小菇属 Mycena | 11 | 5.26 | ||||
| 光柄菇属 Pluteus | 5 | 2.39 | ||||
| 红菇属 Russula | 17 | 8.13 | ||||
| 栓菌属 Trametes | 5 | 2.39 |