Robust real-time blueberry counting in greenhouses using small-object detection and mamba-driven multi-step trajectory completion

• Hybrid loss and multi-scale fusion boost small-object detection accuracy. • GamaKAN encoder models multi-object trajectory interactions with high efficiency. • Two-stage trajectory completion recovers occluded targets for stable counting. • Mamba decoder predicts six-frame trajectories, reducing ADE to 15.4 px at 42 FPS. • Validated on PEST24 and MOT17 datasets, demonstrating strong generalization. Accurate counting is essential for enabling automated blueberry harvesting and logistics decision-making in greenhouse environments. However, the features of small size, dense distribution, and frequent occlusion of blueberries result in severe missed detections and duplicate counting, making accurate counting highly challenging for yield estimation. To address these challenges, we propose an effective technical framework for real-time accurate counting of ripe blueberries in greenhouse environments, including specific deep-learning algorithms of lightweight small-object detection and mamba-based trajectory completion. First we introduce a hybrid loss function and a multi-scale feature fusion module, both integrated into the YOLOv12n model to enhance small object detection performance. Then in the trajectory prediction phase, we design encoders based on KAN and decoders based on Mamba, integrating multi-target positions and trajectories to achieve efficient and accurate position prediction. Thereafter we put forward a prediction-driven two-stage matching strategy based on ByteTrack, which effectively reduces duplicate counting caused by missed detections. Experimental results demonstrate the validity and robustness of the framework, and also highlight the algorithms’ performance advantages. The proposed lightweight small-object detection method increases precision by 8.3% and mAP@50 by 2.9% compared to the baseline on the public PEST24 dataset, and achieves an object detection mAP@50 of 0.877 on the real blueberry greenhouse dataset, The trajectory prediction based on our mamba-based trajectory completion algorithm results in an ADE of 15.4 pixels and an FDE of 24.8 pixels over 6 frames, and a single-frame ADE of 3.68 pixels. For blueberry greenhouse counting task, the overall pipeline achieves an accuracy of 92.5% and a processing speed of 35 FPS on the edge device. It effectively addresses repeated counting caused by occlusion and small target size, thereby achieving reliable fruit detection and accurate counting.

Authors

Institutions

Publication Details

Journal
Smart Agricultural Technology
Published
2025-08-30
DOI
https://doi.org/10.1016/j.atech.2025.101402
Citations
1
Primary Topic
Smart Agriculture and AI
Type
article
Field-Weighted Citation Impact
1.75
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Robust real-time blueberry counting in greenhouses using small-object detection and mamba-driven multi-step trajectory completion

Naiqi Zhang, Jianhua Cao
1 citations
Smart Agricultural Technology
Smart Agriculture and AI
1.75
article

Robust real-time blueberry counting in greenhouses using small-object detection and mamba-driven multi-step trajectory completion

Naiqi Zhang, Jianhua Cao
article en
1 citations

Abstract

• Hybrid loss and multi-scale fusion boost small-object detection accuracy. • GamaKAN encoder models multi-object trajectory interactions with high efficiency. • Two-stage trajectory completion recovers occluded targets for stable counting. • Mamba decoder predicts six-frame trajectories, reducing ADE to 15.4 px at 42 FPS. • Validated on PEST24 and MOT17 datasets, demonstrating strong generalization. Accurate counting is essential for enabling automated blueberry harvesting and logistics decision-making in greenhouse environments. However, the features of small size, dense distribution, and frequent occlusion of blueberries result in severe missed detections and duplicate counting, making accurate counting highly challenging for yield estimation. To address these challenges, we propose an effective technical framework for real-time accurate counting of ripe blueberries in greenhouse environments, including specific deep-learning algorithms of lightweight small-object detection and mamba-based trajectory completion. First we introduce a hybrid loss function and a multi-scale feature fusion module, both integrated into the YOLOv12n model to enhance small object detection performance. Then in the trajectory prediction phase, we design encoders based on KAN and decoders based on Mamba, integrating multi-target positions and trajectories to achieve efficient and accurate position prediction. Thereafter we put forward a prediction-driven two-stage matching strategy based on ByteTrack, which effectively reduces duplicate counting caused by missed detections. Experimental results demonstrate the validity and robustness of the framework, and also highlight the algorithms’ performance advantages. The proposed lightweight small-object detection method increases precision by 8.3% and mAP@50 by 2.9% compared to the baseline on the public PEST24 dataset, and achieves an object detection mAP@50 of 0.877 on the real blueberry greenhouse dataset, The trajectory prediction based on our mamba-based trajectory completion algorithm results in an ADE of 15.4 pixels and an FDE of 24.8 pixels over 6 frames, and a single-frame ADE of 3.68 pixels. For blueberry greenhouse counting task, the overall pipeline achieves an accuracy of 92.5% and a processing speed of 35 FPS on the edge device. It effectively addresses repeated counting caused by occlusion and small target size, thereby achieving reliable fruit detection and accurate counting.

Smart Agricultural TechnologyVol. 12
Tianjin University of Science and Technology (CN)
Climate action
Openalex Percentile: Top 13%
Smart Agriculture and AI
1.75
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.