# Fish Body Pattern Style Transfer Based on Wavelet Transformation and Gated Attention
## 1 Introduction  
Koi fish are a popular ornamental species worldwide, admired for their vibrant colors and auspicious symbolism. As people's aesthetic preferences evolve, the market demand for ornamental fish continues to grow. However, traditional fish farming faces challenges, such as high breeding costs and environmental limitations, while different fish species exhibit significant variations in body patterns. This issue has attracted attention not only from ichthyologists but also from computer vision researchers. To address this demand, we explore semantic image style transfer methods. By leveraging neural style transfer (NST) technology, we can dynamically generate diverse fish body patterns, enhancing the economic potential of fish breeding while catering to personalized aesthetic preferences. Traditional style transfer methods, such as patch-based synthesis [1], often struggle with maintaining global coherence and stylistic fidelity, limiting their applicability to complex styles. Similarly, traditional image segmentation techniques face challenges, likecomputational complexity, sensitivity to image variations, and subjective interpretation issues, which can hinder their effectiveness in real-world applications. Neural style transfer extracts high-level semantic features from images using deep neural networks, allowing it to preserve the structural content of an image while integrating the texture characteristics of a style image. This technique has been widely applied in artistic rendering, visual effects in film production, and virtual reality environments [2]. Compared to traditional texture synthesis and optimization-based algorithms, NST enables more flexible cross-domain style transfer, such as applying oil painting brushstrokes to natural landscape photographs or achieving a unified artistic style in dynamic videos [3]. As illustrated in Figure 1, by integrating instance segmentation with style transfer, we can achieve localized control over the application of stylistic transformations within an image. To achieve high-quality, visually appealing, and real-time high-resolution fish body pattern video style transfer, we propose the fish body pattern sync-styling network (FBP-SNet), a localized video style transfer model applicable to various ornamental fish species. Our method adapts the appearance of ornamental fish in video sequences by performing style matching. To process an input video, our approach first leverages a pre-trained Mask2 Former [4] model to extract instance segmentation masks for multiple fish objects in each frame, thereby effectively separating the foreground fish from the background. Based on these segmentation masks, we apply an improved style transfer network to accurately extract fish body patterns, capturing their morphology and texture characteristics. This enables the generation of videos with novel styles, incorporating modifications in shape, texture, and color contrast. To address the common challenges of style consistency and frame jitter in generated videos, we incorporate contrastive coherence preserving loss [5] (CCPL). This significantly enhances the temporal consistency of our generated videos by preserving structural coherence over time. Additionally, through spatial control mechanisms, users can selectively specify different style effects for the fish bodies and the background, enabling artistic and region-specific stylization. Our main contributions are as follows:  
* High-precision mask-based local style transfer: We propose FSSNet, a style transfer model tailored for various ornamental fish species, optimizing the accuracy of fish body mask generation in complex underwater scenes. Using segmentation masks, we achieve fast and synchronized pattern transformations while supporting distinct style transfers for foreground fish and the background. Our model effectively adapts multiple styles, such as oil painting and blue-and-white porcelain, enhancing visual diversity. Figure 1: Comparison between local style transfer and global style transfer.