Atomistic structure learning algorithm (ASLA) teaches itself to build pristine graphene and other compounds by using an image recognition approach.