Animals survive by making flexible decisions as they move through complex environments. They look around, gather information, change strategies, and act on internal goals, but it remains difficult to determine how the brain produces these behaviors. Modern recording technologies can now measure brain activity and behavior in great detail, creating an opportunity to study behavior in settings that are closer to everyday life than highly simplified laboratory tasks. This project will develop computational tools that connect natural behavior to brain activity and help answer not only what an animal did, but why it behaved that way. The work will advance basic understanding of how the brain supports flexible behavior and may improve future studies of neurological and psychiatric disorders, brain-machine interfaces, and artificial intelligence systems that adapt to changing conditions. The project will also create new educational opportunities through research-based courses, undergraduate participation in neuroscience and artificial intelligence research, mentoring for K-12 teachers and students, and broader access to interdisciplinary training. The research is based on the idea that natural behavior contains measurable evidence about the internal computations that support perception, decision-making, and action. It will pursue three independent and complementary threads. The first objective will discover sensory strategies from freely moving behavior by developing inverse rein