One of the most spectacular displays of social behavior is the synchronized movements that many animal groups perform to travel, forage and escape from predators. However, elucidating the neural mechanisms underlying the evolution of collective behaviors, as well as their fitness effects, remains challenging. Here, we study collective motion patterns with and without predation threat and predator inspection behavior in guppies experimentally selected for divergence in polarization, an important ecological driver of coordinated movement in fish. We find that groups from artificially selected lines remain more polarized than control groups in the presence of a threat. Neuroanatomical measurements of polarization-selected individuals indicate changes in brain regions previously suggested to be important regulators of perception, fear and attention, and motor response. Additional visual acuity and temporal resolution tests performed in polarization-selected and control individuals indicate that observed differences in predator inspection and schooling behavior should not be attributable to changes in visual perception, but rather are more likely the result of the more efficient relay of sensory input in the brain of polarization-selected fish. Our findings highlight that brain morphology may play a fundamental role in the evolution of coordinated movement and anti-predator behavior.