There's a new twist to the maxim "You are what you eat" - amazing caterpillars that look like what they eat.

In findings published Thursday in the journal Science, researcher Erick Greene said he discovered that "Emerald Wings" caterpillars mimic either the flower or the twig of an oak tree.Caterpillars that eat fuzzy, yellow oak flowers, which bloom in the spring and are called catkins, are yellow with green spots dotting their rough backs in imitation of catkin markings, Greene said.

Caterpillars that hatch in the summer after catkins are gone eat mainly oak leaves and young twigs and grow into smooth, gray-green twig imitations.

The caterpillars also displayed different behaviors that help them hide from hungry birds. Spring caterpillars take refuge among flowers, while summer caterpillars nestle among leaves or twigs.

The catkin and twig caterpillars eventually form cocoons and emerge as the same type of moth, known to scientists as Nemoria arizonaria.

Greene, of the University of California-Davis, made the discovery while studying birds in live oaks in southeastern Arizona.

"I was paying a lot of attention to the diet of birds in the top of the trees," he said. "It was through this that I stumbled across these amazing caterpillars."

Initially, Greene thought the caterpillars were different species, but when he put some in jars and waited for moths to emerge from cocoons he was surprised.

"I discovered that although the catkin mimic and the twig mimic look very different, they turned out to be the same species," he said.

Scientists have long known some insects can assume different forms, a condition known as polymorphism, but they have not been able to determine why.

Greene found the caterpillars' form apparently depends on the amount of a chemical compound, called tannin, in their food. Tannin is found in high levels in oak leaves, but in low levels in catkins.