Abstract
Defensive behavior among honeybees at the hive entrance, such as colony defense against intruders, appears as a group-level pattern rather than in individual bees. This study investigates its automatic recognition from single frames as a single-class object-detection task suitable for edge deployment. A dataset of 20,000 annotated images was built from 87 videos (13 h) recorded at 20 hive entrances; defense was observed at 6 entrances in 32 instances totaling about 6 min. YOLOv8, YOLO11, and YOLO26 detectors at five scales were evaluated by five-fold cross-validation, with folds grouped by defense instance, and exported to ONNX and NCNN for CPU-only benchmarking on a Raspberry Pi 5. The models reached of 0.728–0.800 and of 0.447–0.541, with YOLO11 and YOLO26 generally more accurate than YOLOv8, although not in every split. Larger models improved by 4.6–6.4 percentage points, which is consistent across all splits but small relative to the 14–20× increase in time per frame, and export changed accuracy by, at most, 2.5 percentage points on average. NCNN was the fastest and most energy-efficient format, with nano-models reaching about 13–14.5 FPS at 0.4–0.5 J per frame. YOLO11n, YOLO26n and YOLO11s appear to offer the best frame-level accuracy–speed trade-off; generalization beyond one apiary and event-level performance remain to be verified.