GENEVA, N.Y. — Every spring, a host of unwelcome visitors descends on the Hansen farm in upstate New York. Diamondback moths blown in from the South threaten rows of cabbages to be sold for slaw and sauerkraut.

The moths can’t be fought off with a single insecticide. Workers must spray a series of chemicals throughout the growing season to keep the moths’ numbers in check.

“You have to rotate what chemical you use so you don’t get a buildup in resistance,” said Ed Hansen Jr., whose family has farmed the land for nearly a century. This adaptability, he said, makes the moths one of the worst pests to deal with each season.

At a university laboratory down the road, scientists are hoping to substitute sex for sprays. They have genetically modified thousands of diamondback moths, infusing them with DNA designed to kill female larvae. In August, the researchers began introducing the altered moths into outdoor cages in a field, where their mating habits will be monitored.