Stephen Lawlor and David Hunt have witnessed a lot of bullying. Among the principal victims, in their experience, are young, first-time mothers, who are sometimes so intimidated that they’re unable to eat. Isolating their tormentors in a separate group isn’t a solution, Hunt told me: “They just knock the crap out of each other.”

The bullies and victims we were discussing are cows. Lawlor milks about three hundred Holsteins on a farm in County Meath, Ireland, an hour northwest of Dublin. The farm has been in his family for four generations; his calf barn, which is long and narrow and made of primeval-looking gray stone, was a horse stable in his grandfather’s time. He, Hunt, and I were standing in a more recent structure a few feet away, a hangar-size cowshed with a corrugated-metal roof. Directly in front of us, a cow that weighed maybe seventeen hundred pounds was using her anvil-shaped head to push a smaller cow away from a pile of bright-green grass, which had been cut that morning and heaped on the floor. For Lawlor, this was an act with economic consequences. A mature lactating Holstein will eat well over a hundred pounds of grass and other feed in a day, and produce about nine gallons of milk. Immature cows yield less to begin with, and their output falls further if they have trouble reaching their food.

It was partly in the hope of resolving this issue that Lawlor had engaged Hunt’s company, Cainthus, an artificial-intelligence startup based in Dublin. Hunt, the company’s president, describes its specialty as “facial recognition for cows”; it uses surveillance cameras, computer vision, and predictive imaging to track animals and analyze their behavior. Not long before my visit, a crew had installed cameras on slender aluminum beams several feet above Lawlor’s feed areas and water troughs. (The installers had learned from experience to mount the cameras higher than cows can reach with their tongues.) Price competition has put pressure on farmers in many countries to enlarge their herds and increase their output, even as their children are deciding they’d rather work for Google. Lawlor’s next big farm-equipment purchase, he said, is likely to be a robot.

Cainthus’s chief financial officer is David Hunt’s fraternal twin, Ross. They’re thirty-six years old. They grew up in a tiny farming community in Connemara, near the country’s west coast, and for a long time they were the only people they knew whose family owned a personal computer. After college, they held jobs in business and finance. When they were in their late twenties, they went to work for their father’s grain company (first Ross, then David) and, with their father’s encouragement, quickly took it over. They replaced its ancient trading software with a cloud-based system that they designed, and they proved that speculating in grain futures, which the company’s traders had always believed to be a source of profit, was a consistent money loser. In two and a half years, the company’s annual revenue roughly doubled. Then they got bored and left (first David, then Ross). They attended a Silicon Valley incubator started by Peter Diamandis and Ray Kurzweil, and founded Cainthus in 2016, with a third partner, Robin Johnston, who had grown up around dairy farms in Canada and later helped to develop computer-vision systems. The company’s name comes from the word for the corner of an eye, “canthus”; the added “i” creates a mild internal pun on the abbreviation of “artificial intelligence.” Ross said, “If you want to Google well, invent your name.”

“Agriculture is the least digitized industry in the world right now,” David told me. He and his brother believe that artificial intelligence can reduce the environmental impact of food production, by making it more efficient, and can also make it more humane. Cainthus’s first outside investor was Aidan Connolly, the director of innovation at Alltech, an American agricultural-technology company, who told me that he believes Cainthus “will change the world.” One way it will do that, he said, is by enabling farmers with large herds to know as much about the behavior of individual cows as farmers with small herds do. In January, the global food conglomerate Cargill became a significant minority shareholder in Cainthus, and also a development partner. During the week I was in Ireland, Cainthus was installing five dairy-farm systems in addition to Lawlor’s: three in Canada and two in Italy.

The Hunts’ long-term ambitions don’t necessarily end at agriculture. “Anytime I talk about doing something with bovines, I’m painfully aware of how transferrable that is,” David said. Working with animals gives Cainthus a research advantage over facial-recognition companies focussing on people, he said, because cows don’t hide behind hats, sunglasses, or clothes, and they don’t object if you spy on them, and you can interfere at will with their behavior. (“Don’t mess with the mammal whose fight-or-flight response involves lawyers,” he said.) “A number of years from now, we will have a difficult decision to make,” he continued. “All the core competencies we’ve built up on cows—at what point do we transition them to humans?” The company’s goals involve not merely identifying individuals but closely analyzing their behavior. Potential applications, in his view, include helping professional athletes train more effectively and diagnosing illnesses before their sufferers notice symptoms, but it’s easy to imagine less benign uses. “If you put it in the wrong hands, facial-recognition technology is a dangerous tool,” he said. “If you don’t feel incredibly threatened the first time you hear about it, you don’t understand what it is.”

One afternoon twenty years ago, I was walking on the Upper East Side and barely paying attention to where I was going. Suddenly, I realized that a person who’d just passed me on the sidewalk had seemed kind of familiar. I stopped, thought for a moment, and hollered, “Wilson!” He turned around. It was a guy I’d gone to high school with. He’d never been one of my close friends, I hadn’t seen him in more than twenty years, he’d lost most of his hair and grown a beard, I had no reason to think he’d be in New York, and I’d only glimpsed him as he walked past. Yet somehow I’d known who he was.

Putting names to faces, like formulating conspiracy theories, relies on pattern recognition. Some people are remarkably bad at it, and have trouble recognizing their spouses, their children, and even themselves in photographs. And some people are remarkably good at it. When, in September, Scotland Yard charged two suspects in the poisoning of the former Russian spy Sergei Skripal and his daughter, its investigative team included so-called “super recognizers,” who have a preternatural talent for noticing and remembering facial features and other distinguishing characteristics. Most people fall between those extremes: we’re occasional Wilson-spotters who nevertheless don’t believe our wives when they tell us that the actor who played the con artist in “American Hustle” is the same actor who played the F.B.I. agent in “Public Enemies.”

In the late sixties and early seventies, computer scientists began trying to use a digital form of pattern recognition to identify faces in photographs. The first challenge was programming a computer simply to determine whether a given image contained a face. Harder still, years later, was identifying people in images that weren’t composed like mug shots; in one technique, scientists had to create digital three-dimensional models of the human head so that they could “normalize” photographs that hadn’t been taken face on. A major advance occurred two decades ago, with the introduction of the first graphics-processing units (G.P.U.s) for desktop computers. The original market was gamers, but the devices were so fast at handling certain kinds of repetitive calculations that artificial-intelligence researchers rapidly made use of them as well.