One day at work last year, Lade Obamehinti encountered an algorithm that had a problem with black people.

The Facebook program manager was helping test a prototype of the company’s Portal video chat device, which uses computer vision to identify and zoom in on a person speaking. But as Obamehinti, who is black, enthusiastically described her breakfast of French toast, the device ignored her and focused instead on a colleague—a white man.

Obamehinti related that experience Wednesday at Facebook’s annual developer conference. The day prior, CEO Mark Zuckerberg claimed his company’s many products would become more private.

The conference’s second day, headlined by Facebook’s chief technology officer Mike Schroepfer, was more sober. He, Obamehinti, and other technical leaders reflected on the challenges of using technology—particularly artificial intelligence—to safeguard or enhance the company’s products without creating new biases and problems. “There aren’t simple answers,” Schroepfer said.

Schroepfer and Zuckerberg have said that, at Facebook’s scale, AI is essential to remedy the unintended consequences of the company digitizing human relationships. But like any disruptive technology, AI creates unpredictable consequences of its own, Facebook’s director of AI, Joaquin Candela, said late Wednesday. “It’s just impossible to foresee,” he said.

Obamehinti’s tale of algorithmic discrimination showed how Facebook has had to invent new tools and processes to fend off problems created by AI. She said being ignored by the prototype Portal spurred her to develop a new “process for inclusive AI” that has been adopted by several product development groups at Facebook.

That involved measuring racial and gender biases in the data used to create the Portal’s vision system, as well as the system’s performance. She found that women and people with darker skin were underrepresented in the training data, and that the prerelease product was less accurate at seeing those groups.

Facebook program manager Lade Obamehinti discovered that a prototype of the company's video chat device, Portal, had a problem seeing people with darker skin tones. Facebook

Many AI researchers have recently raised the alarm about the risk of biased AI systems as they are assigned more critical and personal roles. In 2015, Google’s photo organizing service tagged photos of some black people as “gorillas”; the company responded by blinding the product to gorillas, monkeys, and chimps.

Obamehinti said she found a less-sweeping solution for the system that had snubbed her, and managed to ameliorate the Portal’s blindspots before it shipped. She showed a chart indicating that the revised Portal recognized men and women of three different skin tones more than 90 percent of the time—Facebook’s goal for accuracy—though it still performed worse for women and the darkest skin tones.