Kristen Stewart co-wrote a paper on machine learning

It's all about 'style transfers' in 'Come Swim,' her latest short film.

Axelle/Bauer-Griffin via Getty Images

Kristen Stewart, best known for her role as Bella in the Twilight saga, has co-authored a paper on machine learning. It details her use of a technique known as 'style transfers' for select scenes in Come Swim, a short film that will be shown at Sundance and marks her directorial debut. The process has become popular with apps such as Prisma, which allow the user to apply filters in the style of famous paintings. At its core, the system relies on deep neural networks to identify the "content" of your photo and the "style" of another, blending them together into a completely new image.

Stewart and her team used style transfers to create some unusual, dream-like sequences in the film. Come Swim is a "poetic, impressionistic portrait of a heartbroken man underwater," so it made sense to pepper some scenes with these surreal, mind-bending shots. Rather than imitate Picasso or Dali, Stewart used one of her own paintings as inspiration. It was difficult, however, to achieve the exact look she wanted, especially over multiple frames. The paper outlines some of the tricks she picked up to better control the effect -- cropping the painting in different ways, for instance, forced the algorithm to focus on particular colors or brush strokes.

She also found that the quality of the style image had drastic effects on the final result. Initially, the team worked with a photo captured on a smartphone, but later swapped it for a better lit, higher resolution image. The change allowed for a "more faithful transfer of the subtleties in the contrast, color and texture." They then experimented "style transfer ratio," or the number of times the technique should be applied. Increasing the iterations would improve the image's texture, but at a certain point -- roughly 256 -- the improvements were perceived to be negligible.

For the final cut, the team used a cross-dissolve effect to subtly transition between the original footage and the style-transferred version.

Stewart's paper, co-authored with special effects engineer Bhautik J Joshi and producer David Shapiro, was released through the online repository arXiv. That means it hasn't been peer-reviewed -- a footnote that's bound to make some researchers scoff. Whether it gets the all-important rubber stamp of approval doesn't really matter, however. What's interesting is that more people, including directors and actresses, are starting to look at the technology as a way to execute their most daring and imaginative ideas.