Awful photographers could catch a break thanks to a new AI that improves images before they’re even captured. A collaboration between researchers from Google and MIT’s Computer Science and Artificial Intelligence Laboratory, the new software uses an neural network that was trained on a set of 5,000 images, each of which was retouched by five different photographers. It uses the knowledge gained from studying those pictures to tweak colors and contrast to make the image look better. The example above shows a raw image on the left and the AI’s retouched version on the right.

But what’s impressive here isn’t the fact that an AI can retouch a photo nicely. Nope: it’s the fact that the neural network required to do it has been made so efficient that it shows the user its results in real-time, in the viewfinder of their smartphone camera. That’s achieved by having the algorithm work on a low-resolution version of the image, then making the neural net create a set of equations that are applied to enhance the image rather than doing it pixel-by-pixel. (There are more details about how it works in this paper.)

Lightweight pocket AIs like this are becoming more popular with smartphone makers like Apple, who want to work out ways to use the smarts of AI without draining batteries or providing users with laggy experiences. Expect to see more advances like it in the near future.