bioRxivAnimal Behavior & Cognition
Combining Unity with machine vision to create low latency, flexible, and simple virtual realities
Y. Ogawa, R. Aoukar, R. Leibbrandt, J. Manger, Z. Bagheri, L. Turnbull, C. Johnston, P. Kaushik, J. M. Hemmi, K. Nordstrom
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
Reproducibility ledger
Nobody has reported trying to reproduce this paper yet. Did you replicate an experiment or run the code? Your report saves the next lab a week.
Sign in to file a reproducibility report.
Related papers
- Virtual reality for animal navigation with camera-based optical flow tracking
Ivan Vishniakou, Paul G. Plöger, Johannes D. Seelig·Journal of Neuroscience MethodsPeer-reviewed·Aug 23, 2019
- On the adaptive behavior of head-fixed flies navigating in two-dimensional, visual virtual reality
H. Haberkern, M. A. Basnak, … V. Jayaraman·bioRxiv·Nov 4, 2018
- Studying Human Behaviour with Virtual Reality: The Unity Experiment Framework
Jack Brookes, Matthew Warburton, … Faisal Mushtaq·Behavior Research MethodsPeer-reviewed·Apr 22, 2019
- DomeVR: A setup for experimental control of an immersive dome virtual environment created with Unreal Engine 4
Katharine A. Shapcott, Marvin Weigand, … Marieke Louise Schölvinck·bioRxiv·Apr 4, 2022
- USE: An integrative suite for temporally-precise psychophysical experiments in virtual environments for human, nonhuman, and artificially intelligent agents
Marcus Watson, Benjamin Voloh, … Thilo Womelsdorf·Journal of Neuroscience MethodsPeer-reviewed·Jul 25, 2019
- VREX: An Open-Source Toolbox for Creating 3D Virtual Reality Experiments
Madis Vasser, Markus Kängsepp, … Jaan Aru·BMC PsychologyPeer-reviewed·Feb 14, 2017