Creating these AI detective programs works the same way as any other machine learning task, says Yong Jae Lee, a computer scientist at the University of Wisconsin–Madison. “You collect a data set of real images, and you also collect a data set of AI-generated images,” Lee says. “Then you can train a machine-learning model to distinguish the two.”