Science has spoken: Getting a border collie to stop herding city pigeons or a Doberman pinscher to be more companionable or a springer spaniel to stop flushing prey is going to be a heavy lift for even an expert dog whisperer. On the bright side, even humans who struggle to train their canine companion to leave the upholstery alone will almost certainly not mess up their whippet’s ability to hunt by scent, their miniature schnauzer’s talent for controlling vermin, or their golden retriever’s instinct for living up to its name.

In the first study of its kind, scientists have documented how brain structure varies across dog breeds and corresponds to the specific behaviors each breed is known for, the researchers reported on Monday in the Journal of Neuroscience.

Dogs’ different skills are reflected in, and undoubtedly caused by, different neuroanatomy, scientists led by evolutionary biologist Erin Hecht of Harvard University found. The study shows that, for instance, “herding really is in the brain of border collies,” she said, “and these findings give us the first window on how.” The reason, she and her colleagues write, is that for hundreds of years humans “have been systematically shaping the brains of another species.”

That brain structure is related to function is well-known, but the study offers hints about the interaction between genetically determined neuroanatomy and learned behavior. Border collies aren’t born knowing how to herd; they have to learn. But they pick up that skill quickly because their brains come prewired to do so. Similarly, humans aren’t born knowing language. But our brains must be prewired to learn it, given how quickly and universally toddlers start speaking.

Understanding the relationship between innate brain wiring and the emergence of learned behavior “might tell us something about our own brains and how that happens,” Hecht said.

Once dogs split off from wolves, evolutionarily, and began to be domesticated some 20,000 years ago, humans selected some to breed and others not to: a female border collie that masterfully herded sheep in its Northumberland homeland might be introduced to a similarly adept male, but her inept sister was kept well away from potential suitors. A few hundred years ago, that intense selection pressure for valued traits began producing breeds as different in appearance as Great Danes and Pomeranians which, looks notwithstanding, both belong to the subspecies Canis lupus familiaris.

It also produced starkly different behavioral traits. Since the brain is the organ of behavior, results of selection pressure for companionship or hunting or guarding the homestead should be written in the gray matter. But until now scientists hadn’t looked for the neuroanatomical basis for why some breeds excel at one skill while others have different talents—a surprising missed opportunity, Hecht said: “It’s kind of amazing to me that we’re the first to publish a paper on this.” The neuroanatomical basis for dog breeds’ specific skills “is the perfect experiment” to investigate how brains evolve.

The scientists analyzed MRIs of 62 purebred dogs representing 33 breeds, from basset hounds and beagles to Welsh corgis and Yorkshire terriers. They identified six brain networks that vary the most across breeds and reflect “plainly visible” neuroanatomical differences. (They controlled for head size and shape, among other variables, focusing on features most likely to reflect selection for desired traits.)

The neuroanatomical differences predicted behavioral specializations. A network that makes the brain respond strongly to reward (a function centered in the mesolimbic system) supports social bonding, since dogs readily associate treats with the people who dispense them; in terriers, known for the intense bond they form with their humans, this network is especially highly developed, its components tightly linked.

A second network, involving the olfactory cortex and insula, encodes taste and smell, and includes the medial frontal cortex, which attaches meaning to those perceptions. Its components were especially tightly linked in the German short-haired pointer, known for its outstanding hunting skills. A network that involves the medial prefrontal cortex and supports sociality stands out in dogs known for interacting with people, which may explain the bichon frise’s playfulness and affection. One made up by circuits for vision and smell is prominent in police and military dogs, such as the Dobermans that led U.S. army patrols through jungles during World War II. Their brains made them do it, or at least let them.

Republished with permission from STAT. This article originally appeared on September 7, 2019