Photoshop’s healing brush can use surrounding pixels to repair an image or remove an object — but what if the surrounding pixels don’t have enough data to fill in those holes? Researchers from Nvidia recently used artificial intelligence to help fill in those gaps to create a tool similar to the healing brush tool that is able to intelligently fill in missing pieces, a technique called image inpainting for irregular holes using partial convolutions — here’s hoping Nvidia comes up with a nickname before making the tool widely accessible.
Nvidia isn’t the first to try to reinvent the healing brush using A.I., but the researchers say that earlier attempts left artifacts and blur. Rather than using full convolutional filter responses to those holes, Nvidia instead created a partial convolution method — in other words, the software creates a layer that renormalizes the pixels to create a more normal looking image without those artifacts. The new program also uses an automatically generated layer masks.
Unlike the traditional healing brush tool that only uses surrounding pixels to determine what to fill in the gap with, Nvidia trained its tool using three different sets of images, resulting in thousands of images to train the tool with. The researchers randomly applied masks to intentionally remove sections of images to those groups of photos. By showing the computer both the before and after, the program could learn how to fill in some of those gaps. “Our model can robustly handle holes of any shape, size location or distance from the image borders,” the researchers wrote. “Further, our performance does not deteriorate catastrophically as holes increase in size.”
While more robust than previous attempts, the researchers said that the tool struggles with the largest holes and images without a lot of structure.
The research could bring some significant changes to photo editing if the tool makes its way into an image editor. Nvidia’s program, for example, could replace an eye in an old, damaged portrait, even without the other eye to replicate. The resulting eye, of course, isn’t the same eye — in one example, the replaced eye is an entirely different color. In the demonstration video, the program also appears to give a young woman and an older gentleman the same pair of eyes.
While giving a person different features using the database of images should raise ethical considerations for portraits, the concept could speed up the process of removing distractions from other types of images. The tool could potentially help remove objects in photographs, such as removing power lines or signs from the background, with more accuracy than current tools.