If you like your big human brain, you can thank your nose — or at least the noses of your earliest mammal cousins.

That’s because 200 million years ago, a keen sense of smell drove an explosive growth in brain size that pushed mammals out from under the shadow of dinosaurs and other creepy crawlies, a new study concludes.

Enhanced smell probably gave the first mammals — tiny shrewlike critters — the ability to sniff out insects and grubs at night while allowing them to avoid stinky, predatory dinosaurs, the study authors suggest.

That enhanced sense of smell “gave mammals our head start,” said Timothy Rowe, the paleontologist who led the work, published Thursday in the journal Science.

For the study, Rowe and his colleagues deployed powerful X-ray machines to scan the fossilized skulls of two of the earliest, and tiniest, mammals.

Although the brains of these early human cousins disappeared long ago, the organs left imprints on the inner surface of the skull. Reading those impressions, called endocasts, revealed for the first time the size, shape and structure of early mammalian brains.

These brains were much bigger, relative to body size, than those of the squat, reptilian ancestors of mammals, Rowe said. Particularly enlarged was the olfactory bulb, a dual-lobed structure at front of the brain that processes odors. An enlarged olfactory bulb implies an exquisitely sensitive sniffer.

Many modern mammals retain this keen sense of smell, as dogs can distinguish between millions of scents, for instance, and bats can sniff and identify their offspring from thousands of others in a dark cave.

But for the tiny shrewlike creatures that scurried underfoot of giant reptiles, a sense of smell was vital. It allowed them to navigate the world at night, when dinosaurs were probably asleep, Rowe said, while steering them away from danger and toward their kin.

“Being able to smell a lot better than your reptile counterparts would be a huge advantage,” said Anjali Goswami, a paleontologist at University College London who was not involved in the research.

The two fossilized skulls Rowe scanned were found in southwest China in the 1980s and date to about 195 million years ago, a period dubbed the Mesozoic that was dominated by the rapid evolution of dinosaurs. But the earliest mammals were born then, too, eking out a living on the margins.

The Chinese paleontologist who discovered the two fossils, Zhe-Xi Luo, invited Rowe to study the specimens in the mid-1980s. As Rowe nervously held the smallest of the skulls, from a paper clip-size species dubbed Hadrocodium, he yearned to peek inside. But 25 years ago, the only way to see inside a fossilized skull was to slice it apart.

In the time since, Rowe and colleagues at the University of Texas helped develop powerful X-ray scanning machines. These scanners work much like CT machines at hospitals, using sophisticated software to reconstruct three-dimensional images of hidden structures.

Rowe began scanning skulls from the reptilian ancestors of mammals, cat-size creatures called cynodonts. The scans showed cynodont brains to be simple and relatively small, with tiny olfactory bulbs.

In contrast, when Rowe finally scanned the Hadrocodium skull, he saw that it already displayed many of the features of modern mammalian brains. In addition to the larger olfactory bulb, the Hadrocodium brain sported a wrinkly, topmost layer missing in reptiles, the neocortex. The neocortex processes tactile information from the skin — and from hair, which the earliest mammals almost certainly possessed, said Rowe’s colleague Thomas Macrini, who worked on the study.

While providing warmth, individual hairs also act like whiskers, sensing the wind and helping animals navigate tight spaces, such as underground dens. It takes a lot of brain power to process all that sensory information, brain power located in the neocortex.

A large neocortex also implies improved agility and better motor coordination, Rowe said, other skills handy for scurrying away from predators. As the neocortex grew, so did cognitive abilities, thinking power.

And so with their noses — and pelts — leading the way, the brains of our tiniest, most distant cousins laid the groundwork for an explosion in ever-larger mammalian brains that evolved after the dinosaurs died out.