From manual counting to YOLO: Using computer vision to automate large-scale fecundity assays in C. elegans - Linyao Peng; Hongyi Shui; Anne Nicole Janisch; Sarah Dede Hesse; Victoria Kathleen Feist; Amanda Kyle Gibson (PLoS ONE, 2026)
Fecundity measurements play a crucial role in life history research, providing insights into reproductive fitness, population dynamics, and environmental responses. In the model nematode Caenorhabditis elegans , fecundity assays are widely used to study development, aging, and genetic or environmental influences on reproduction. C. elegans hermaphrodites have large numbers of offspring (>100), so manual counting of viable offspring is time-consuming and susceptible to human error. Automated counting methods have the potential to enhance throughput, accuracy, and precision in data collection. We applied computer vision to 9972 images of broods from individual C. elegans hermaphrodites from several strains under multiple treatments to capture variation in fecundity. We trained models using You Only Look Once (YOLO) versions v8 to v11 (large and extra-large variants) to detect and count viable offspring, then compared the model results to estimates from manual counting. The best-performing model, YOLO v11-L, detected offspring with high accuracy after fine-tuning, achieving 92.6% recall and 94.9% precision. Manual counts differed from verified ground-truth counts by an average of 2.16 offspring per image, compared to 0.9 for the trained computer vision model. In addition, we detected significant effects of counter identity, experimental block, and their interaction on manual counts. Computer vision counts were not affected by these biases and outperformed manual counting in both speed, consistency, and accuracy. We demonstrate that computer vision can be a powerful tool for fecundity assays in C. elegans and provide a pipeline for applying this approach to new image sets. More broadly, applying computer vision to digital collections can advance ecological and evolutionary research by accelerating the study of fitness and life history. In practice, this reduces months of manual counting to about 2 hours on a consumer GPU, lowering barriers to large-scale fecundity assays.