If you have ever used Instagram or Snapchat, you are familiar with using filters that alter the brightness, saturation, contrast, and so on of your images. Neural style, a deep learning algorithm, goes beyond filters and allows you to transpose the style of one image, perhaps Van Gogh’s “Starry Night,” and apply that style onto any other image.
Neural style, one of many models available on Somatic.io, uses a deep neural network in order to separate and recombine content and style of any two images. It is one of the first artificial neural networks (ANNs) to provide an algorithm for the creation of artistic imagery.
How Does it Work?
The model is given two input images, one that will be used for styling, the other for content. At each processing stage in the convolutional neural network’s (CNN) hierarchy, the images are broken into a set of filtered images. While the number of different filters increases along the processing hierarchy, the overall size of the filtered images is reduced, leading to a decrease in the total number of units per layer of the network.
The above figure visualizes the information at different processing stages in the CNN. The content reconstructions from lower layers (a,b,c) are almost exact replicas of the original image. In the higher layers of the network however, the detailed pixel information is lost while the high-level structures and details remain the same (d,e). Meanwhile, the model captures the style of the other input image on top of the content CNN representations. Then, the style representation draws connections between the different features in different layers of the CNN. The model then reconstructs the style of the input image on top of the content representations within each of the CNN layers. This creates images that match the style on an increasing scale as you move through the network’s hierarchy.
Try It Out!
Experiment with the model for yourself. All you need to do is select an image you want to use for style and anther one for the content. Here are some creations of the latest creations the model has generated.