# A machine learning approach to facilitate parasitic egg identification in a conspecific brood parasite

**Authors:** Anna E. Hughes, Lisandrina Mari, Jolyon Troscianko, Václav Jelínek, Tomas Albrecht, Michal Šulc

PMC · DOI: 10.1098/rspb.2025.2085 · 2025-11-26

## TL;DR

This study uses machine learning to accurately identify parasitic eggs in barn swallows, outperforming human assessments and offering a replicable method for future research.

## Contribution

The study introduces a machine learning pipeline that significantly improves parasitic egg detection in conspecific brood parasitism.

## Key findings

- Machine learning models outperformed humans in identifying parasitic eggs with up to 97% accuracy.
- Egg dimensions were the most important trait for model accuracy, followed by color and spotting patterns.
- The proposed pipeline is replicable and applicable to other species for studying egg phenotype evolution.

## Abstract

Avian brood parasitism offers an excellent system for studying coevolution. While more common than interspecific parasitism, conspecific brood parasitism (CBP) is less studied owing to the challenge of detecting parasitic eggs. Molecular genotyping accurately detects CBP, but its high cost has led researchers to explore egg appearance as a more accessible alternative. Barn swallows (Hirundo rustica) are suspected conspecific brood parasites, yet parasitic egg detection has largely relied on subjective human assessment. Here, we used UV–visible photographs of genetically confirmed non-parasitized barn swallow clutches and simulated parasitism to compare the accuracy of human assessment with supervised machine learning models. Participants and models completed two classification tasks, identifying parasitic eggs from either six or two options. Both humans and the ‘leave-one-clutch-out’ model performed better than chance, with accuracies of 72 and 87% (humans) and 76 and 92% (models). An improved ‘leave-one-egg-out’ model achieved 97% accuracy, greatly exceeding human performance, likely by integrating more visual information, with egg dimensions being the most important trait, followed by colour and spotting pattern. We present a complete and accessible pipeline for replicating our supervised models, offering a powerful tool to identify parasitic eggs in other species also, and advance research on the evolution of egg phenotypes.

## Linked entities

- **Species:** Hirundo rustica (taxon 43150)

## Full-text entities

- **Species:** Hirundo rustica (Barn swallow, species) [taxon 43150], Homo sapiens (human, species) [taxon 9606]

## Figures

4 figures with captions in the complete paper: https://tomesphere.com/paper/PMC12646787/full.md

---
Source: https://tomesphere.com/paper/PMC12646787