# Product Innovation Design Based on Deep Learning and Kansei Engineering
## 2 Methods
### Neural Style Transfer Network  
Style transfer is the technique of recomposing one image in the style of another. A content image and a style image are used to create an output image, whose \"content\" mirrors the content image and whose style resembles that of the style image. Batch normalization (BN), instance normalization (IN) and AdaIN are commonly used in neural style transfer. BN calculates the mean and variance of each channel for a batch of samples, while IN independently calculates the mean and variance for each channel and sample. The AdaIN layer is similar to IN, but it has no learnable affine parameters. Instead, it adaptively computes the affine parameters from the feature representations of an arbitrary style image. Figure 2 shows an overview of our neural style transfer network. We adopt the \"Encoder-AdaIN-Decoder\" architecture.  
Our style transfer network \(T\) takes a content image \(c\) and a style image \(s\) as inputs, and synthesizes an output image that recombines the content of the former and the style of the latter. The encoder \(f\) is a fixed Visual Geometry Group (VGG) 19 which is pre-trained on the ImageNet dataset for image classification. The structure of VGG-19 is shown in Figure 3. In VGG 19, each layer takes the output of the previous layer to extract more complex features until the object is identified. Each layer can be considered as an extractor of many local features.  
After encoding the content and style images in feature space, we feed both feature maps to an AdaIN layer that aligns the mean and variance of the content feature maps to those of the style feature maps, producing the target feature maps \(t\):  
\[t=\text{AdaIN}(f(c),f(s))=\sigma(f(s))\bigg{(}\frac{f(c)-\mu(f(c))}{\sigma(f(c) )}\bigg{)}+\mu(f(s)) \tag{1}\]  
where: \(f\) is the encoder; \(c\) and \(s\) are the content and style image; \(\mu\) and \(\sigma\) are the mean and variance.  
A randomly initialized decoder \(g\) is trained to map \(t\) back to the image space, generating the stylized image \(T\)\((c,\,s)\):  
\[T(c,s)=g(t)\]  
Figure 3: The structure of VGG-19.  
Figure 2: Style transfer algorithm.  
The decoder mostly mirrors the encoder, with all pooling layers replaced by nearest up-sampling to reduce checkerboard effects. We use reflection padding in both \(f\) and \(g\) to avoid border artifacts.  
We use the pre-trained VGG-19 to compute the loss function to train the decoder:  
\[L=\alpha L_{c}+\beta L_{s} \tag{3}\]  
where: \(L\) is the loss function; \(L_{c}\) and \(\alpha\) are the content loss and its weight; and \(L_{s}\) and \(\beta\) are the style loss and its weight.  
The content loss is the Euclidean distance between the target features and the features of the output image. We use the AdaIN output \(t\) as the content target, instead of the commonly used feature responses of the content image:  
\[L_{c}=\parallel f(g(t))-t\parallel_{2} \tag{4}\]  
Since our AdaIN layer only transfers the mean and variance of the style features, our style loss only matches these statistics:  
\[L_{s}=\sum_{i=1}^{L}\parallel\mu(\phi_{i}(g(t)))-\mu(\phi_{i}(s))\parallel_{2 }+\sum_{i=1}^{L}\parallel\sigma(\phi_{i}(g(t)))-\sigma(\phi_{i}(s))\parallel_{2} \tag{5}\]  
where each \(\phi_{i}\) denotes a layer in VGG-19 used to compute the style loss. The objective is to minimize the content and style losses.