An arbitrary style transfer method and system based on double retrieval and aesthetic guidance

By employing a dual retrieval and aesthetic guidance approach, utilizing CLIP and ArtCLIP models to filter style maps and optimizing the AesCAST network, the problems of style selection difficulties and aesthetic neglect in existing technologies are solved, generating high-quality style transfer images.

CN122288972APending Publication Date: 2026-06-26BEIJING ELECTRONICS SCI & TECH INST

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING ELECTRONICS SCI & TECH INST
Filing Date
2026-03-30
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Existing arbitrary style transfer techniques lack automated high-quality style selection mechanisms, making it difficult for users to select high-quality style images. The generated results neglect aesthetic quality, and aesthetic enhancement methods lack refined evaluation, resulting in visual disharmony and insufficient artistic value in the generated images.

Method used

A dual retrieval and aesthetic guidance approach is adopted. The semantic similarity between the content image and the style image library is calculated by the CLIP model to screen candidate images. The ArtCLIP aesthetic scoring model is used to evaluate the candidate images. Combined with the AesCAST style transfer network and a composite loss function, high aesthetic quality style transfer images are generated.

Benefits of technology

It enables the automatic selection of the best matching style image without user intervention, generating images with high artistic value and visual appeal, thus enhancing the artistic integrity and aesthetic value of style transfer.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122288972A_ABST
    Figure CN122288972A_ABST
Patent Text Reader

Abstract

This invention discloses an arbitrary style transfer method and system based on dual retrieval and aesthetic guidance. The method includes: acquiring a user-input content image, which is a regular image to be style transferred; constructing a style image library containing multiple images of paintings, each of which has its feature vector extracted and stored beforehand using an image encoder; performing a dual retrieval on the content image to select a suitable target style image from the style image library; inputting the content image and the target style image into a pre-trained AesCAST style transfer network, and performing style transfer on the content image using the AesCAST style transfer network and a composite loss function to generate a style transfer result image; ensuring from the source that the input for style transfer passes the dual verification of "content suitability" and "high aesthetic value," achieving the best match without user intervention.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer vision and image processing technology, and more specifically to an arbitrary style transfer method and system based on dual retrieval and aesthetic guidance. Background Technology

[0002] Currently, with the rapid development of deep learning and computer vision technologies, image style transfer technology has been widely applied in fields such as social media, digital art creation, and advertising design. Existing arbitrary style transfer techniques, such as methods based on adaptive instance normalization or contrastive learning, while achieving significant progress in transferring texture and geometric features, still suffer from the following major problems and limitations in practical applications:

[0003] 1. Lack of an automated high-quality style selection mechanism (“style selection dilemma”): Existing style transfer systems typically require users to manually provide style images. However, ordinary users often lack professional art backgrounds and find it difficult to visually judge and select style images that match the content image semantically, structurally, and tonally, and possess high artistic value from a vast collection of artworks. If the style image provided by the user is of low quality or severely mismatched with the content image—for example, transferring a melancholic painting onto a cheerful landscape photo—it will result in a visually jarring image, severely impacting the final effect.

[0004] 2. Neglecting Aesthetic Quality in Generated Results: The closest existing technology, represented by CAST, focuses on minimizing the statistical error of content and style features, emphasizing "similarity" while neglecting "aesthetics." This results in generated images that, while mimicking the style map in texture, often perform poorly in higher-level aesthetic attributes such as color harmony, compositional balance, and lighting, making it difficult to produce high-quality works with genuine artistic beauty.

[0005] 3. Existing aesthetic enhancement methods have limitations: Although recent methods such as AesUST (Aesthetic-Enhanced Universal Style Transfer) have attempted to introduce aesthetic discriminators, these methods are usually trained on general aesthetic scoring models or generalized art datasets. They lack refined evaluation and guidance for specific painting art attributes, such as brushstrokes, genres, and emotional atmosphere, which limits their ability to improve the artistic integrity and aesthetic value of style-transferred images.

[0006] Therefore, there is an urgent need for an end-to-end style transfer method that can automatically retrieve high-quality adapted style images from massive image libraries and actively optimize the aesthetic quality of generated images during the transfer process. Summary of the Invention

[0007] In view of the above problems, the present invention is proposed to provide an arbitrary style transfer method and system based on dual retrieval and aesthetic guidance to overcome or at least partially solve the above problems.

[0008] To achieve the above objectives, the present invention adopts the following technical solution: In a first aspect, embodiments of the present invention provide an arbitrary style transfer method based on dual retrieval and aesthetic guidance, specifically including the following steps: S1. Obtain the content image input by the user, wherein the content image is a regular image to be style transferred; S2. Construct a style image library, which contains multiple images of paintings. Each painting image has its feature vector extracted and stored in advance using an image encoder. S3. Perform a dual search on the content image and select the appropriate target style image from the style image library; S4. Input the content image and the target style map into the pre-trained AesCAST style transfer network, and perform style transfer on the content image through the AesCAST style transfer network and the composite loss function to generate a style transfer result image.

[0009] Furthermore, in step S4, the AesCAST style transfer network adopts a three-level architecture consisting of an encoder, a transform module, and a decoder. The transformation module is used to fuse the extracted content features with style features.

[0010] Furthermore, in step S4, when constructing the AesCAST style transfer network, a pre-trained ArtCLIP aesthetic scoring model with fixed parameters is integrated into the network as an aesthetic discriminator; the aesthetic discriminator does not participate in updating its own parameters, but only participates in the backpropagation of gradients during training, and is used to evaluate the aesthetic level of the generated image in real time.

[0011] Further, in step S4, the composite loss function is composed of four parts of loss, including: Adversarial loss, which is used for adversarial training against the discriminator; Cyclic consistency loss, which is used to restore an image after style transfer and inverse mapping; Contrast style loss, which is used to narrow the distance between the generated image and the style image obtained in the feature space; Aesthetic loss is defined as the mean square error between the aesthetic score predicted by the aesthetic discriminator for the generated image and the preset full score. The composite loss function forms the overall optimization objective by weighted summation of its various components.

[0012] Furthermore, in step S4, the specific process of training the AesCAST style transfer network includes: The AesCAST style transfer network is trained using the training and validation sets partitioned from the content-style dataset. The paired content maps and style maps from the training set are input into the generator to obtain the generated image; The generated images are then input into the discriminator and the aesthetic discriminator, respectively. Calculate the total value of the composite loss function and use the optimizer to adjust the generator parameters; A strategy incorporating an aesthetic discriminator and content-style pairing data is adopted, with dynamic learning rate decay set until the AesCAST style transfer network converges.

[0013] Furthermore, the construction process of the content-style dataset includes: Obtain a painting art dataset and a photography dataset. Use a pre-trained ArtCLIP aesthetic scoring model to score the images in the painting art dataset and the photography dataset respectively. Images in the painting art dataset with scores higher than a first preset threshold are selected as a style map subset, and images in the photography dataset with scores higher than a second preset threshold are selected as a content map subset. The feature vectors of the style map subset and the content map subset are extracted by the image encoder, and the cosine similarity between the style map and the content map is calculated. Image pairs with cosine similarity higher than a preset threshold are selected to form a content-style dataset.

[0014] Furthermore, in step S3, the specific process of the dual retrieval includes: First-level retrieval: The feature vector of the image to be processed input by the user is extracted by the CLIP image encoder, and compared with the pre-stored feature vector of all images in the style map subset. The cosine similarity is calculated, and the top Y images with the highest similarity are retrieved to form a candidate style map set. The second retrieval involves calling the pre-trained ArtCLIP aesthetic scoring model to calculate the aesthetic score for each image in the candidate style map set, and selecting the image with the highest aesthetic score as the target style candidate image.

[0015] Secondly, embodiments of the present invention provide an arbitrary style transfer system based on dual retrieval and aesthetic guidance, used to execute an arbitrary style transfer method based on dual retrieval and aesthetic guidance, including: An input receiving module is used to receive images of content to be processed uploaded by the user; A dual retrieval processing module is used to calculate the semantic similarity between the input image and the database image and output a candidate list; The style transfer generation module is used to perform forward inference operations, transfer the texture, color and brush stroke characteristics of the best style image to the content image, and output the style-transferred result image. The output display module is used to render the generated high-aesthetic-quality image and present it to the user on a display device.

[0016] As can be seen from the above technical solution, compared with the prior art, the present invention discloses a method and system for arbitrary style transfer based on dual retrieval and aesthetic guidance, which has the following beneficial effects: 1. This invention proposes and constructs a style image recommendation network, employing a "dual retrieval mechanism" to overcome this problem. First, the CLIP model is used to calculate the semantic similarity between the content image and the style image library, filtering out candidate images with similar semantics and structure. Then, the ArtCLIP aesthetic scoring model is used to evaluate the candidate images, automatically selecting the image with the highest aesthetic score as the final style image. This mechanism ensures from the source that the input for style transfer passes the dual verification of "content suitability" and "high aesthetic value," achieving the best match without user intervention.

[0017] 2. This invention designs an aesthetically pleasing AesCAST style transfer network (AesCAST), which innovatively introduces an aesthetic discriminator based on a pre-trained ArtCLIP model into the generator training architecture and designs a dedicated aesthetic loss function. Through adversarial training, the aesthetic discriminator evaluates the artistic value of the generated images in real time and feeds it back to the generator. This forces the model to encode widely recognized aesthetic features, such as color consistency and the rationality of lighting, into the generated images while learning style textures, thereby significantly improving the visual appeal and artistic score of the output results. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0019] Figure 1 This is a flowchart of an arbitrary style transfer method provided in an embodiment of the present invention; Figure 2 This is a flowchart of the AesCAST style transfer network training provided in an embodiment of the present invention; Figure 3 This is a structural diagram of the AesCAST style transfer network provided in an embodiment of the present invention; Figure 4 This is a flowchart of AesCAST style transfer network inference provided in an embodiment of the present invention; Figure 5 This is a structural diagram of an arbitrary style transfer system provided in an embodiment of the present invention; Figure 6 The style diagram provided in the embodiments of the present invention; Figure 7 This is a content diagram provided in the embodiments of the present invention; Figure 8 This is the output image obtained after style transfer in an embodiment of the present invention. Detailed Implementation

[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0021] This invention discloses an arbitrary style transfer method based on dual retrieval and aesthetic guidance, such as... Figure 1 As shown, the specific steps include: S1. Obtain the content image input by the user, wherein the content image is a regular image to be style transferred; S2. Construct a style image library, which contains multiple images of paintings. Each painting image has its feature vector extracted and stored in advance using an image encoder. S3. Perform a dual search on the content image and select the appropriate target style image from the style image library; S4. Input the content image and the target style map into the pre-trained AesCAST style transfer network, and perform style transfer on the content image through the AesCAST style transfer network and the composite loss function to generate a style transfer result image.

[0022] This invention proposes and constructs a style image recommendation network, employing a "dual retrieval mechanism" to overcome this problem. First, the CLIP model is used to calculate the semantic similarity between the content image and the style image library, filtering out candidate images with similar semantics and structure. Then, the ArtCLIP aesthetic scoring model is used to evaluate the candidate images, automatically selecting the image with the highest aesthetic score as the final style image. This mechanism ensures from the source that the input for style transfer passes the dual verification of "content suitability" and "high aesthetic value," achieving the best match without user intervention.

[0023] Phase 1: Model training; such as Figure 2 The training flowchart shows the construction and preprocessing of a high-quality training dataset; In order to train a model that can perceive aesthetics, it is first necessary to build a pairwise dataset that has been semantically aligned and aesthetically filtered. Style image library construction: Based on the painting art dataset, the pre-trained aesthetic scoring model ArtCLIP is used to score all painting images, and images with aesthetic scores higher than the first preset threshold (preferably 7.1 in this embodiment) are selected to form a high-quality style image subset.

[0024] Content image library construction: Based on the photography dataset, all images are scored using a photography aesthetics scoring model. Images with aesthetic scores higher than the second preset threshold (preferably 4.5 in this embodiment) are selected to form a high-quality content image subset.

[0025] Semantic alignment pairing: The image encoder of the CLIP model extracts the feature vectors of the filtered style map and content map, and calculates the cosine similarity between the content map and the style map. Image pairs with similarity higher than a set threshold (preferably 0.5 in this embodiment) are selected to construct the final content-style pair dataset for training.

[0026] Training the Aesthetic-Enhanced Contrastive Arbitrary Style Transfer Network (AesCAST): First, an aesthetic-enhanced AesCAST style transfer network is constructed. Based on the basic contrastive arbitrary style transfer architecture, the architecture is improved to obtain the aesthetic-enhanced AesCAST style transfer network of this invention. The architecture of the aesthetic-enhanced AesCAST style transfer network is as follows: Figure 3 As shown in the figure, wikiart is the art dataset, Stylerecommend is the style suggestion, Style transfer is the style transfer, A is the aesthetic score calculation node, S is the semantic similarity calculation node, G is the generator, MSP is the multi-layer style projector, and D is the style transfer function. A As a authenticity discriminator, DR For the domain discriminator, D C As an aesthetic discriminator, L adv To combat the losses, L aes For aesthetic loss, z-symbols with different superscripts represent positive and negative sample feature vectors in contrastive learning, used to align content and style in the feature space; Generator architecture: It adopts an encoder-transformation module-decoder structure; the transformation module is responsible for fusing the extracted content features with style features.

[0027] The encoder uses the first four convolutional blocks (conv1 to conv4) of VGG-19 to extract multi-scale features of content and style images. Each convolutional kernel is 3×3 with a stride of 1, and downsampling is performed by max pooling. The multi-layer style projector (MSP) performs adaptive average pooling on the features of each layer and then maps them to 256-dimensional style encoding through a fully connected layer. The transformation module is based on adaptive instance normalization AdaIN to fuse content features and style encoding, and introduces a contrastive learning mechanism to align positive and negative samples in the feature space with an InfoNCE loss of 0.07 temperature coefficient (positive samples are the transfer results of different content with the same style, and negative samples are the transfer results of different styles), thereby enhancing the accuracy of style representation. The decoder adopts a transposed convolution structure symmetrical to the encoder. It upsamples gradually through four 4×4 transposed convolutions with a stride of 2, and finally outputs the migrated image after a 3×3 convolution and Tanh activation. An aesthetic discriminator is introduced: A pre-trained ArtCLIP model with fixed parameters is integrated into the network as an aesthetic discriminator. This discriminator does not participate in its own parameter updates, but it participates in the backpropagation of gradients to evaluate the aesthetic level of the generated images.

[0028] Constructing an aesthetically guided composite loss function: To train the generator, a composite loss function with four parts is defined, and the total optimization objective is formed by weighted summation of the parts. (1) Adversarial loss: used to ensure that the generated image has a realistic artistic texture distribution through adversarial training with a normal discriminator; (2) Cyclic consistency loss: used to ensure that the image can be restored after style transfer and inverse mapping, ensuring the integrity of content and style information; (3) Contrast style loss: used to narrow the distance between the generated image and the style image in the feature space, ensuring the accurate transfer of style features; (4) Aesthetic loss: defined as the mean square error between the aesthetic score predicted by the aesthetic discriminator of the generated image and the preset full score. By minimizing this loss, the generator is forced to update its parameters in the direction of generating images with high aesthetic scores.

[0029] The discriminator part includes a realism discriminator and a domain discriminator, both of which adopt a 5-layer PatchGAN structure (4×4 convolutional kernels, stride 2 or 1, LeakyReLU activation). The aesthetic discriminator directly reuses the pre-trained ArtCLIP model to calculate the aesthetic loss. The expression for the composite loss function is: L total = λ adv L adv + λ cyc L cyc + λ cs L cs + λ aes L aes in, L adv To combat the losses, L cyc For cycle consistency loss, L cs To compare style loss, L aes For aesthetic loss, λ adv , λ cyc , λ cs , λ aes These are the weights for adversarial loss, cyclic consistency loss, contrastive style loss, and aesthetic loss, respectively.

[0030] The composite loss function is a weighted combination of adversarial loss (weight 1), cycle consistency loss (weight 2), contrast style loss (weight 0.2), and aesthetic loss (weight 1). The aesthetic loss is calculated based on the mean square error of the ArtCLIP score. By optimizing the aesthetic score of the generated image towards a perfect score of 10, the network is guided to improve the aesthetic quality of the generated result while maintaining the style transfer effect.

[0031] The training process of the aesthetic transfer network includes: The network is jointly trained using the paired datasets constructed above.

[0032] Input the content image and style image in pairs into the generator to obtain the generated image.

[0033] The generated images are then input into both the general discriminator and the aesthetic discriminator.

[0034] Calculate the total value of the above composite loss function, and use the optimizer to adjust the generator parameters.

[0035] In terms of training strategy, an approach is adopted that includes an aesthetic discriminator and content-style pairing data, and a dynamic learning rate decay is set until the model converges and training stops.

[0036] The trained AesCAST style transfer network is validated using a validation set, and the optimal AesCAST style transfer network is selected and used as the model for subsequent inference.

[0037] In training the aesthetic AesCAST style transfer network, this invention employs the Adam optimizer to jointly optimize the generator and discriminator. The initial learning rate is set to 0.0001, the momentum parameters are β1=0.9 and β2=0.999, and the weight decay is set to 0. The dynamic learning rate decay strategy adopts a 400-epoch training scheme with linear decay. That is, the learning rate is kept constant for the first 200 epochs, and the learning rate is linearly decayed from 0.0001 to 0 for the last 200 epochs. This ensures that the model converges stably in the early stage of training and is finely tuned in the later stage, thereby obtaining the optimal style transfer and aesthetic enhancement effect.

[0038] Phase Two: User Reasoning; such as Figure 4 As shown in the inference flowchart, the system first receives a content image input by the user and performs a dual search to determine the target style candidate image; First-level retrieval: The feature vector of the image to be processed input by the user is extracted by the CLIP image encoder, and it is compared with the pre-stored feature vector of all images in the style map subset. The cosine similarity is calculated, and the top several images with the highest similarity (preferably 10 in this embodiment) are retrieved to form a candidate style map set. The second retrieval involves calling the pre-trained ArtCLIP aesthetic scoring model to calculate the aesthetic score for each image in the candidate style map set, and selecting the image with the highest aesthetic score as the target style candidate image.

[0039] The generator G receives the content image and the target style image, and outputs the initial generated result. To ensure the high quality of the generated result, it needs to undergo two constraints: First, there are texture and structural constraints: through the MSP module and the contrastive learning mechanism, the contrast loss between the generated image features and the source image features is calculated to ensure that the generated image retains the architectural structure of the original image and learns the texture of the oil painting.

[0040] Second, aesthetic constraints: The generated image is fed into the aesthetic discriminator DC, shown in the red box in the figure. DC scores the image based on an aesthetic scoring model. If the generated image has a chaotic composition or disharmonious colors, it will produce a large aesthetic loss (Laes). This loss signal will be backpropagated to the generator G, forcing the generator to optimize the generated image in the next iteration so that it approaches a high aesthetic score.

[0041] Based on the same inventive concept, embodiments of the present invention also provide an arbitrary style transfer system based on dual retrieval and aesthetic guidance, such as... Figure 5 As shown, it includes: An input receiving module is used to receive images of content to be processed uploaded by the user; A dual retrieval processing module is used to calculate the semantic similarity between the input image and the database image and output a candidate list; The style transfer generation module is used to perform forward inference operations, transfer the texture, color and brush stroke characteristics of the best style image to the content image, and output the style-transferred result image. The style transfer generation module includes: a generator G, a multi-layer style projector MSP, a discriminator group, and a loss calculation unit; Generator G: Receives the content image and the recommended best style image as input, and is responsible for generating the style-transferred image.

[0042] Multi-layer style projector (MSP): Used to map images to a feature space.

[0043] Discriminator group and loss calculation unit: includes discriminators responsible for authenticity discrimination and domain discrimination, as well as the aesthetic discriminator, which is the core of this invention.

[0044] Authenticity and Domain Discriminator Correspondence Diagram L adv The dashed box represents the calculation of adversarial losses.

[0045] The aesthetic discriminator corresponds to L in the diagram. aes The red dashed box represents the calculation of aesthetic loss using the ArtCLIP model.

[0046] The output display module is used to render the generated high-aesthetic-quality image and present it to the user on a display device.

[0047] In this embodiment, the various modules of the system are connected via a data bus.

[0048] This invention designs an aesthetically pleasing AesCAST style transfer network (AesCAST), which innovatively introduces an aesthetic discriminator based on a pre-trained ArtCLIP model into the generator training architecture and designs a dedicated aesthetic loss function. Through adversarial training, the aesthetic discriminator evaluates the artistic value of the generated images in real time and feeds it back to the generator. This forces the model to encode widely recognized aesthetic features, such as color consistency and the rationality of lighting, into the generated images while learning style textures, thereby significantly improving the visual appeal and artistic score of the output results.

[0049] Example: Taking the transfer of artistic style in natural landscape visual content as an example; First, the style image uploaded by the user is obtained through the input receiving module of the style transfer system. Figure 6 , as the content image to be processed; The system performs the retrieval through a dual retrieval processing module, matching the optimal target style map from a subset of style maps. Specifically: First-level semantic retrieval: Extracting data via CLIP image encoder Figure 7 The feature vectors in the image are compared one by one with the pre-stored feature vectors of all images in the style map subset, and the cosine similarity is calculated. The top 10 images are selected from high to low similarity to form a candidate style map set. Figure 6 The cosine similarity rank 1st in this set; The second aesthetic retrieval involves calling the pre-trained ArtCLIP aesthetic scoring model to calculate aesthetic scores for the 10 candidate style maps, selecting the image with the highest score as the target style map. In this embodiment... Figure 6 The ArtCLIP score was the highest in the candidate set, therefore it was determined Figure 6 This is the target style diagram for this style transfer.

[0050] Will Figure 7 (Content image) and Figure 6 The target style map is input into the system's style transfer generation module. It undergoes forward inference through the optimal AesCAST network. After multiple rounds of iterative optimization, the generator outputs the final style-transferred image. Figure 8 The image has been completely preserved. Figure 7 The core content of the natural scenery, while integrating Figure 6 The style of oil painting brushstrokes, colors, and light and shadow.

[0051] The system's output display module has Figure 8 Image rendering is performed to present the high-aesthetic-quality style transfer result to the user on the display device, while the ArtCLIP aesthetic scoring model is used to evaluate the results. Figure 8The final aesthetic score was 7.65.

[0052] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.

[0053] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for arbitrary style transfer based on dual retrieval and aesthetic guidance, characterized in that, Specifically, the following steps are included: S1. Obtain the content image input by the user, wherein the content image is a regular image to be style transferred; S2. Construct a style image library, which contains multiple images of paintings. Each painting image has its feature vector extracted and stored in advance using an image encoder. S3. Perform a dual search on the content image and select the appropriate target style image from the style image library; S4. Input the content image and the target style map into the pre-trained AesCAST style transfer network, and perform style transfer on the content image through the AesCAST style transfer network and the composite loss function to generate a style transfer result image.

2. The arbitrary style transfer method based on dual retrieval and aesthetic guidance as described in claim 1, characterized in that, In step S4, the AesCAST style transfer network adopts a three-level architecture consisting of an encoder, a transform module, and a decoder. The transformation module is used to fuse the extracted content features with style features.

3. The arbitrary style transfer method based on dual retrieval and aesthetic guidance as described in claim 1, characterized in that, In step S4, when constructing the AesCAST style transfer network, a pre-trained ArtCLIP aesthetic scoring model with fixed parameters is integrated into the network as an aesthetic discriminator. The aesthetic discriminator does not participate in updating its own parameters, but only participates in the backpropagation of gradients during training, and is used to evaluate the aesthetic level of the generated image in real time.

4. The arbitrary style transfer method based on dual retrieval and aesthetic guidance as described in claim 1, characterized in that, In step S4, the composite loss function is composed of four parts of loss, including: Adversarial loss, which is used for adversarial training against the discriminator; Cyclic consistency loss, which is used to restore an image after style transfer and inverse mapping; Contrast style loss, which is used to narrow the distance between the generated image and the style image obtained in the feature space; Aesthetic loss is defined as the mean square error between the aesthetic score predicted by the aesthetic discriminator for the generated image and the preset full score. The composite loss function forms the overall optimization objective by weighted summation of its various components.

5. The arbitrary style transfer method based on dual retrieval and aesthetic guidance as described in claim 1, characterized in that, In step S4, the specific process of training the AesCAST style transfer network includes: The AesCAST style transfer network is trained using the training and validation sets partitioned from the content-style dataset. The paired content maps and style maps from the training set are input into the generator to obtain the generated image; The generated images are then input into the discriminator and the aesthetic discriminator, respectively. Calculate the total value of the composite loss function and use the optimizer to adjust the generator parameters; A strategy incorporating an aesthetic discriminator and content-style pairing data is adopted, with dynamic learning rate decay set until the AesCAST style transfer network converges.

6. The arbitrary style transfer method based on dual retrieval and aesthetic guidance as described in claim 5, characterized in that, The process of constructing the content-style dataset includes: Obtain a painting art dataset and a photography dataset. Use a pre-trained ArtCLIP aesthetic scoring model to score the images in the painting art dataset and the photography dataset respectively. Images in the painting art dataset with scores higher than a first preset threshold are selected as a style map subset, and images in the photography dataset with scores higher than a second preset threshold are selected as a content map subset. The feature vectors of the style map subset and the content map subset are extracted by the image encoder, and the cosine similarity between the style map and the content map is calculated. Image pairs with cosine similarity higher than a preset threshold are selected to form a content-style dataset.

7. The arbitrary style transfer method based on dual retrieval and aesthetic guidance as described in claim 1, characterized in that, In step S3, the specific process of the dual retrieval includes: First-level retrieval: The feature vector of the image to be processed input by the user is extracted by the CLIP image encoder, and compared with the pre-stored feature vector of all images in the style map subset. The cosine similarity is calculated, and the top Y images with the highest similarity are retrieved to form a candidate style map set. The second retrieval involves calling the pre-trained ArtCLIP aesthetic scoring model to calculate the aesthetic score for each image in the candidate style map set, and selecting the image with the highest aesthetic score as the target style candidate image.

8. A system for arbitrary style transfer based on dual retrieval and aesthetic guidance, characterized in that, A method for performing any one of claims 1-7, based on dual retrieval and aesthetic guidance, for arbitrary style transfer includes: An input receiving module is used to receive images of content to be processed uploaded by the user; A dual retrieval processing module is used to calculate the semantic similarity between the input image and the database image and output a candidate list; The style transfer generation module is used to perform forward inference operations, transfer the texture, color and brush stroke characteristics of the best style image to the content image, and output the style-transferred result image. The output display module is used to render the generated high-aesthetic-quality image and present it to the user on a display device.