# Product Image Generation Method Based on Morphological Optimization and Image Style Transfer
## 4 IST Model Based on GAN
### Building a Style Transfer Product Image Generation Model
#### 4.2.1 Generator Module  
In the generator module of this study, a network architecture featuring an encoder and a decoder is employed to generate images of car front ends. The detailed structure of the generator is illustrated in Figure 3.  
In the real image encoder \(E_{r}\), the input reference image undergoes a series of convolutional layers for feature down-sampling, ultimately being compressed into a high-level image feature with 512 channels and dimensions of \(1\times 1\) in height and width. Similarly, the form design scheme graph encoder \(E_{c}\) extracts multi-scale features of the  
Figure 3: Generator architecture.  
Figure 2: Technical route of image style transfer model.  
form design scheme through multiple convolutional layers. In the decoder, the high-level image features extracted by \(E_{r}\) are continuously integrated with the multi-scale form design scheme features extracted by the contour graph encoder, ultimately generating a car front image through iterative up-sampling processes.  
Compared to synthesizing random content, generating car front images guided by form design schemes poses additional challenges for the generator. As the depth of the encoder network increases, the fine-grained local form information tends to diminish, resulting in blurry or distorted outputs. In extreme scenarios, the generated content may even completely disregard the detailed information from the sketch, such as the morphology of the car front, leading to a mismatch between the synthesized car front and the user's intended form design scheme. To ensure consistency between the synthesized car front image and the morphological scheme diagram, and to enhance the propagation of morphological scheme features within the network, this study introduces the CSC module. The morphological scheme diagram serves as a constraint in each decoding process, thereby enhancing the edge and detail information of the morphological scheme. This effectively aids the generator in retaining the desired form information and achieving perfect alignment between the synthesized car front and the morphological scheme style. The CSC module integrates the strengths of residual networks and U-Net, incorporating both short and long skip connections. The short skip connections mitigate the issue of gradient vanishing, enabling deeper networks and improved model performance. The long skip connections originating from the encoder \(E_{r}\) strengthen the feature propagation between corresponding network layers, enhancing the reusability of morphological scheme features at various scales and effectively maintaining the consistency of edges and details.  
As depicted in Figure 4, upon inputting the morphological scheme diagram into the contour map encoder, the resultant features are skip-connected to the decoder. The decoder employs convolutional layers to bolster its capacity for capturing information while augmenting the dimensionality of the features. Upon completion of the i-th convolutional layer, the output decoder features serve as the new input features, which are subsequently fed into the CSC module. Within the CSC module, the decoder features and encoder features are initially concatenated along the channel dimension. This concatenation facilitates the integration of information from disparate modalities, leading to a more seamless and precise feature fusion. Subsequently, the concatenated features undergo three successive convolutional layers with dimensions of \(1\times 1\), \(3\times 3\), and \(1\times 1\), respectively. These layers are designed to derive new features that match the dimensionality of the decoder features. Ultimately, the newly acquired features are merged with the decoder features through residual connections, and the resultant features are outputted.