Abstract
<title>Abstract</title> <p>Parasitoid wasps are crucial biological control agents in agricultural ecosystems; however, their small body size and subtle morphological differences make manual identification slow and highly dependent on expert taxonomists. This study presents a computer vision framework for the automatic detection and identification of parasitoid wasps in standard laboratory images. A low-cost microscopy image dataset comprising 3,420 individually imaged and annotated parasitoid specimens from 36 species was assembled and mapped to 38 biological classes. This dataset was used to benchmark five generations of YOLO object detectors (v5–12) alongside six representative CNN/ViT classification architectures. The benchmark results identified YOLO11m as the strongest baseline detector under a class-balanced regime of 60 training images per biological class. Building on this baseline, we developed an improved single-stage detector, YOLO11m-opt. The model incorporates an additional small-object detection head, optimized sampling modules, an attention mechanism, and a loss function and hyperparameters tailored to this dataset. YOLO11m-opt achieved an mAP@0.5 of 0.994, mAP@0.5:0.95 of 0.930, precision of 0.975, and recall of 0.974 on the test set. Compared with the YOLO11m baseline, YOLO11m-opt substantially improved the high-IoU localization accuracy while maintaining comparable overall detection performance. Eigen-CAM visualizations indicated that the detector focused on taxonomically informative structures such as antennae, ovipositors and wing bases. Overall, YOLO11m-opt provides a practical approach for automated parasitoid wasp identification, and the accompanying Windows desktop software supports batch processing for routine laboratory use, biodiversity monitoring, and ecology-based pest management.</p>