Researchers have found a way to use artificial intelligence to fight a complication of diabetes that affects the eyes.