Biology

AI Successfully Tracks Wax Moth Behavior Across Multiple Experiments

AI Insight

Researchers developed an automated tracking system for wax moth larvae (Galleria mellonella) that maintains accuracy across different experimental conditions, particularly when lighting changes between recording sessions. They compared classical computer vision methods with deep learning approaches and found that while classical methods achieved 99% detection rates consistently, deep learning models suffered severe performance drops (from high accuracy to 9.1% mAP) when lighting conditions changed between sessions. Using CycleGAN, a generative domain adaptation technique, successfully restored cross-session performance without requiring additional manual data annotation.


This work addresses a critical barrier in automated animal behavior research: maintaining tracking reliability when experimental conditions inevitably vary across studies or labs. The findings provide practical solutions for researchers studying small organisms and demonstrate that classical computer vision can outperform deep learning in limited-data scenarios, while offering methods to improve deep learning robustness when needed.


⚠️ Preprint – Noch nicht peer-reviewed

Dieser Artikel wurde noch nicht von unabhängigen Experten begutachtet. Die Ergebnisse sind vorläufig und sollten mit Vorsicht interpretiert werden.

Background: Automated behavioral tracking is increasingly used in biological and biomedical research; however, robustness across heterogeneous imaging conditions remains a major challenge. Domain shifts caused by changes in illumination, contrast, or acquisition setup can substantially degrade the performance of computer vision and deep learning models, limiting their practical applicability. This issue is particularly relevant for small-scale biological datasets, where extensive annotation and retraining are often impractical. Methods: We developed a behavioral tracking framework for Galleria mellonella larvae combining a classical computer vision (CV) pipeline, a YOLOv8s-seg + ByteTrack deep learning pipeline, and generative domain adaptation methods. Behavioral recordings were collected in two independent experimental sessions under distinct illumination conditions (top and bottom lighting), creating a natural cross-session domain shift. The classical pipeline was based on contour detection, adaptive preprocessing, temporal smoothing, and trajectory reconstruction. Deep learning models were trained on 320 manually annotated frames and evaluated in both within-session and cross-session settings. To improve generalization, we investigated generative augmentation using StyleGAN2-ADA and unpaired image-to-image translation using CycleGAN. Tracking outputs were further analyzed through behavioral descriptors, including trajectories, traveled distance, velocity, spatial occupancy heatmaps, and directional movement patterns. Results: The classical CV pipeline achieved high detection performance in both recording sessions, with mean detection rates of 99.05% and 99.71%, respectively. A YOLOv8s-seg model demonstrated strong within-session performance but exhibited severe degradation under cross-session evaluation, with larval mask segmentation performance dropping to mAP@0.5 = 9.1%, confirming the presence of a substantial domain shift. Despite differences in detection methodology, behavioral metrics derived from YOLO and CV pipelines showed strong agreement at the group level (Pearson correlation r = 0.89; median distance ratio = 0.99). Generative augmentation with StyleGAN2-ADA did not yield meaningful gains in tracking robustness – likely because baseline performance was already near ceiling – whereas CycleGAN-based domain adaptation substantially reduced the domain gap and improved cross-session detection performance while preserving biologically relevant trajectory structures and spatial behavioral patterns. Conclusions: Cross-session variability represents a critical challenge for automated behavioral tracking in biological experiments. Our results demonstrate that carefully designed classical computer vision approaches can achieve highly reliable tracking in small-data settings, while deep learning models require explicit strategies to address domain shift. Generative domain adaptation, particularly CycleGAN-based image translation, offers an effective solution for improving cross-session generalization without additional manual annotation. The proposed framework provides a robust foundation for scalable behavioral phenotyping of Galleria mellonella and other small biological model organisms.

Source: Cross-session generalization in automated behavioral tracking of Galleria mellonella larvae: comparison of classical computer vision, deep learning and generative domain adaptation