Search bioRxiv⌕ Search

bioRxiv · 10.1101/2024.02.05.579029

Combining Unity with machine vision to create low latency, flexible, and simple virtual realities

Abstract

O_LIIn recent years, virtual reality arenas have become increasingly popular for quantifying visual behaviors. By using the actions of a constrained animal to control the visual scenery, the animal is provided the perception of moving through a simulated environment. As the animal is constrained in space, this allows detailed behavioral quantification. Additionally, as the world is generally computer-generated this allows for mechanistic quantification of visual triggers of behavior. C_LIO_LIWe created a novel virtual arena combining machine vision with the gaming engine Unity. For tethered flight, we enhanced an existing multi-modal virtual reality arena, MultiMoVR (Kaushik et al., 2020) but tracked hoverfly wing movements using DeepLabCut-live (DLC-live, Kane et al., 2020). For trackball experiments, we recorded the motion of a ball that a tethered crab was walking on using FicTrac (Moore et al., 2014). In both cases, real-time tracking was interfaced with Unity to control the movement of the tethered animals avatars in the virtual world. We developed a user-friendly Unity Editor interface, CAVE, to simplify experimental design and data storage without the need for coding. C_LIO_LIWe show that both the DLC-live-Unity and the FicTrac-Unity configurations close the feedback loop effectively with small delays, less than 50 ms. Our FicTrac-Unity integration highlighted the importance of closed-loop feedback by reducing behavioral artifacts exhibited by the crabs in open-loop scenarios. We show that Eristalis tenax hoverflies, using the DLC-live-Unity integration, navigate towards flowers. The effectiveness of our CAVE interface is shown by implementing experimental sequencing control based on avatar proximity to virtual structures. C_LIO_LIOur results show that combining Unity with machine vision tools such as DLC-live and FicTrac provides an easy and flexible virtual reality (VR) environment that can be readily adjusted to new experiments and species. This can be implemented programmatically in Unity, or by using our new tool CAVE, which allows users to design and implement new experiments without programming in code. We provide resources for replicating experiments and our interface CAVE via GitHub, together with user manuals and instruction videos, for sharing with the wider scientific community. C_LI

Source connections

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Ogawa, Y., Aoukar, R., Leibbrandt, R., Manger, J., Bagheri, Z., Turnbull, L., Johnston, C., Kaushik, P., Hemmi, J. M., Nordstrom, K.. 2024-02-06. Combining Unity with machine vision to create low latency, flexible, and simple virtual realities. https://doi.org/10.1101/2024.02.05.579029

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related preprints

Deconstructing Boldness: Latent behavioural structure across novelty, predation, and exploration in an endangered species translocation program

Risk-related behaviours including neophobia, exploration, and predator avoidance are often assumed to covary along a general boldness axis. Although some translocation studies have linked one or more of these behaviours with fitness, it is possible that the underlying behavioural structure varies under different selective environments. Conservation breeding programs provide a unique opportunity to evaluate the structure of behavioural correlations in a non-domestic species under artificial conditions. We tested whether risk-related behaviours represent a unified boldness syndrome in a captive population of the endangered Attwaters prairie chicken (APC; Tympanuchus cupido attwateri). We quantified the repeatable behaviours of 257 juveniles and compared 11 models of behavioural covariation structure using multivariate mixed models and confirmatory factor analysis. There was no support for a single risk-taking axis; instead, we found three dimensions representing responses to novelty and environmental stimuli (Engagement), predator avoidance (Threat Response), and maze exploration (Maze Progression). Our results indicate that these risk-related behaviours are not organized along a single axis in captive APCs, challenging assumptions that risk-taking represents a universal behavioural syndrome. To anticipate post-release success accurately, conservation managers should understand the exact behavioural architecture of the captive population rather than assume that the classical bold-shy structure occurs in all contexts.

animal behavior and cognition↗

Shared brain transcriptome signatures of social evolution and plasticity in shell-dwelling cichlid fishes

Inter-individual variability in phenotypic traits is widespread in nature both across and within species, with similar patterns of variation often occurring between and within species. Given that these two types of variation are generated by evolutionary and plasticity processes respectively, it raises the question to what extent the causal mechanisms underlying such variability at these two different levels are shared or not. To address this question, we studied the variation in brain transcriptomes in Tanganyikan cichlids that exhibit both intra- and interspecific variation in social behavior. We compared two facultatively social cichlid species, each containing naturally occurring solitary and social-living individuals, with a closely related obligatory solitary resembling the ancestral state. Differential gene expression and Gene Set Enrichment Analyses were performed in the telencephalon and diencephalon transcriptomes to investigate the molecular basis of both behavioral plasticity and the evolution of sociality. Behavioral plasticity involved few differentially expressed genes but extensive changes in biological pathways, supporting a highly polygenic architecture of social behavior. Across both species, social-living individuals consistently upregulated pathways involved in translation, protein homeostasis, and energy metabolism, whereas solitary individuals showed enrichment of neuronal morphogenesis, cell adhesion, and structural plasticity. Remarkably, these same functional programs were associated with the independent evolution of sociality, revealing a strong overlap between evolutionary and plastic transcriptional responses. This convergence was largely restricted to the telencephalon, while the diencephalon showed limited and inconsistent functional signatures. Together, our results support the repeated recruitment of gene regulatory programs during the evolution of sociality and demonstrate that behavioral plasticity and evolutionary transitions share common neurogenomic responses, consistent with a conserved genetic toolkit for social behavior.

animal behavior and cognition↗

Inductive bias anchors a scaling law for biological learning

The speed of animal learning varies substantially across individuals and task domains, and does not always track intuitive notions of task complexity. A nominally simple binary decision task can take thousands of rewards to reach proficiency, whereas seemingly complex naturalistic tasks can be learned within dozens. A long-standing explanation is that learning speed reflects the alignment between an animal's inductive biases and the task at hand. However, without a precise notion of alignment, it is difficult to translate this idea into quantitative predictions. Here, modeling an animal as a Bayesian learner that improves through iterative reward feedback, we use statistical learning theory to derive a scaling law for biological learning. The law makes two predictions. First, inductive bias multiplicatively sets the speed of learning through a single quantity, the effective complexity. This quantity measures how well the task aligns with the animal's prior, and corresponds to the number of bits required to represent the task solution under that prior. We demonstrate this multiplicative scaling in a human motor learning dataset, where behavioral measurements before learning can precisely predict subsequent learning speed. Second, task performance improves as a power law in experience. We validate this power law in a large-scale mouse learning dataset and show that a two-parameter rescaling collapses individual learning curves onto a universal function predicted by the theory. These results suggest that behavioral measurements before learning can be used to predict task-dependent learning speeds, and they explain why learning speed reflects alignment with prior knowledge rather than nominal task complexity.

animal behavior and cognition↗