Text-driven image translation method and system based on frequency spectrum reconstruction

In text-driven image translation through spectrum reconstruction technology, the spectral filter module and frequency band control network are used to achieve efficient support of a single model in diverse image translation application scenarios, solving the problem of difficulty in compatibility with diverse application scenarios in existing technologies. , improving image generation quality and flexibility.

CN118537209APending Publication Date: 2024-08-23PEKING UNIV
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202410188562.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-02-20
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

Existing text-driven image translation methods are difficult to be compatible with diverse image translation application scenarios, and require additional model fine-tuning for each new prompt text, resulting in slow inference speed and limited image generation quality.

Method used

Based on the pre-trained large-scale Vincentian graph diffusion model, spectrum reconstruction technology is used to model the correlation between different frequency bands in image translation from a frequency domain perspective, build a spectrum filter module and a frequency band control network, train different frequency band control branches, and achieve a single model Supports diverse image translation application scenarios.

Benefits of technology

It achieves the flexibility and high-quality image generation of a single model in different image translation application scenarios, improves text fidelity and reasoning speed, and supports diverse applications such as style guidance, semantic processing, style conversion, and scene conversion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118537209A
    Figure CN118537209A
Patent Text Reader

Abstract

The invention discloses a text-driven image translation method and system based on spectrum reconstruction, and belongs to the field of artificial intelligence image creation and editing. According to the method, a pre-trained text graph latent diffusion model LDM, a frequency spectrum filtering module and a frequency band control network are constructed, different incidence relations between an original image and a target image in image translation are modeled by different frequency bands of a characteristic frequency spectrum from a frequency domain perspective for the first time, and different frequency band control branches are constructed and trained through frequency spectrum filtering in different modes; and the pre-training model LDM is controlled to carry out image translation of corresponding types, so that a single model is flexibly compatible with different image translation application scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of artificial intelligence image creation and editing, and specifically relates to a text-driven image translation method and system based on spectrum reconstruction. Background Art

[0002] Image translation aims to transform the semantic content or style of an original image to obtain a specific target image. It is a widely-watched research field in computer vision and has wide and direct applications in intelligent image processing tasks such as image stylization, image editing, and image enhancement.

[0003] Image translation technology can be divided into three categories from the perspective of development stage: methods based on generative adversarial networks, methods based on image-text contrastive learning pre-training (CLIP), and methods based on text-image large-scale diffusion models. Early methods based on generative adversarial networks trained the mapping between source domain images and target domain images from the perspective of image domain migration to achieve supervised or unsupervised image translation. The disadvantage of this type of method is that after one training, image translation can only be performed between two or a few image domains, which is inflexible and easily trapped in the training instability and mode collapse problems inherent in generative adversarial networks. With the advancement of multimodal technology, the combination of image-text contrastive learning pre-training model CLIP and generative model has derived text-driven image translation technology, which allows users to indicate the target result of image translation through natural language description. This type of method uses CLIP to construct image-text similarity loss to fine-tune the generative model so that the image translation result is faithful to the prompt text. With text drive, this type of CLIP-based method generalizes image translation from limited domains to open domains, significantly improving the flexibility of application. However, this type of method requires an additional model fine-tuning process for each new prompt text, the inference speed is slow, and the quality of image generation is still relatively limited. As diffusion models quickly become the dominant force in mainstream generative models, some cutting-edge methods have achieved text-driven image translation based on pre-trained large-scale text-image diffusion models. With the outstanding image generation and text guidance capabilities of large models, such image translation methods have obvious advantages in image generation quality and flexibility.

[0004] However, the text-driven image translation problem can have a variety of application scenarios depending on the different associations between the original image and the converted target image. For example, maintaining the style of the image, editing the content of the image through prompt text (style-guided image content creation); maintaining the style and spatial structure of the image, editing the semantic features of the image through prompt text (image semantic processing); maintaining the contour information of the image, editing the style of the image through prompt text (image style conversion); and maintaining the layout of the image, changing the specific scene of the image through prompt text (image scene conversion). However, existing methods are difficult to be compatible with the above-mentioned diverse image translation application scenarios. The core challenge is that it is difficult to model the association between different original images and target images through only a single model. Summary of the invention

[0005] In view of the above problems, the present invention proposes a text-driven image translation method and system based on spectrum reconstruction based on a pre-trained large-scale text-graph diffusion model. The present invention, for the first time, models the different associations between the original image and the target image in image translation from a frequency domain perspective using different frequency bands of the feature spectrum, constructs and trains different frequency band control branches through spectrum filtering in different modes, and controls the pre-trained model LDM to perform corresponding types of image translation, thereby achieving a single model that is flexible and compatible with different image translation application scenarios.

[0006] The technical solution adopted by the present invention to solve the above problems is as follows:

[0007] A text-driven image translation method based on spectrum reconstruction comprises the following steps:

[0008] 1) Construct a pre-trained latent diffusion model (LDM), a spectrum filtering module, and a frequency band control network;

[0009] 2) In the training phase, the paired image-text data pairs in the training data set are input into the LDM, and the LDM encodes the input image to generate initial encoding features, and performs a forward diffusion process based on the initial encoding features to obtain mapping features from the original data distribution to the standard Gaussian distribution, and encodes the input text to generate text encoding features;

[0010] The initial coding features are processed by a spectrum filtering module, and two-dimensional discrete cosine transform, spectrum filtering and two-dimensional inverse discrete cosine transform are performed in sequence to generate a control signal of a specified frequency band of the input image;

[0011] The control signal and text encoding features are input into the band control network for training, the control features are generated and the noise regression loss L is calculated. recon ;

[0012] The mapping features, text encoding features and control features are input into LDM for the reverse diffusion process of step-by-step denoising, and then decoded to obtain the output image;

[0013] 3) In the inference stage, any input image is processed by LDM encoding and spectral filtering module to generate a control signal of the specified frequency band, and then the target prompt text is encoded by LDM to generate text encoding features. The control signal and text encoding features are input into the trained frequency band control network to generate a control signal, and then the control signal is generated through the reverse diffusion process of LDM step-by-step denoising and decoding processing to generate an image that matches the target prompt text description.

[0014] Furthermore, the training data set uses the data set LAION-Aesthetics 6.5+, and the images in the training data set are preprocessed. The preprocessing includes adjusting the resolution of the image to be consistent with the input and output image sizes of LDM, and normalizing the image to the [-1, 1] interval.

[0015] Furthermore, the LDM includes an image encoder, a forward diffusion network, a text encoder, a denoising U-type network and a decoder; wherein the image encoder encodes the input image to generate initial coding features, the forward diffusion network performs a forward diffusion process on the initial coding features to generate mapping features from the original data distribution to the standard Gaussian distribution, and the text encoder encodes the input text to generate text coding features; the denoising U-type network performs a step-by-step denoising reverse diffusion process according to the mapping features, text coding features and control features to restore the initial coding features, and the decoder decodes the restored initial coding features to generate an output image.

[0016] Furthermore, the denoising U-type network includes 4 groups of 3 downsampling encoder units, 1 bottleneck unit and 4 groups of 3 upsampling decoder units.

[0017] Furthermore, the spectrum filtering module uses a channel-by-channel two-dimensional discrete cosine transform to convert the initial coding features into DCT frequency domain features, and then multiplies the DCT frequency domain features with preset small-pass, low-pass, mid-pass, and high-pass filter masks to generate the frequency domain features of the specified frequency band after filtering, and then performs a two-dimensional discrete cosine inverse transform on the frequency domain features of the specified frequency band to generate the coding features of the specified frequency band of the initial coding features, i.e., the control signal.

[0018] Furthermore, the band steering network includes 4 groups of 3 downsampling encoder units and 1 bottleneck unit, each of which is a trainable copy of the corresponding unit in the denoising U-network of LDM.

[0019] Furthermore, each unit of the frequency band control network includes a residual block integrating timestamp coding, a self-attention layer and a cross-attention layer integrating text coding features in series, and the residual block is provided with 4 parallel copies corresponding to small frequency band control, low frequency band control, medium frequency band control and high frequency band control.

[0020] Furthermore, the band control network performs a zero-initialized convolution operation on the control signal at the input end, and then adds it to the input features of the LDM denoising U-type network at the current moment, and then performs subsequent feature propagation; at the output end, the output features of each encoder unit of the band control network are convolved with zero initialization, and then injected into the symmetrical upsampling decoder unit in the LDM denoising U-type network in an additive manner to control the reverse diffusion process of step-by-step denoising.

[0021] A text-driven image translation system based on spectrum reconstruction, implementing the above method, comprises:

[0022] The latent diffusion model of text image is used to encode the input image to generate initial coding features, and to perform a forward diffusion process based on the initial coding features to obtain mapping features from the original data distribution to the standard Gaussian distribution, and to encode the input text to generate text coding features; and to perform a reverse diffusion process of step-by-step denoising based on the mapping features, text coding features and control features, and then decode to obtain the output image;

[0023] A spectrum filtering module, used to perform two-dimensional discrete cosine transform, spectrum filtering and two-dimensional inverse discrete cosine transform in sequence according to the initial coding features to generate a control signal of a specified frequency band of the input image;

[0024] A band control network model is used to generate control features based on control signals and text encoding features.

[0025] The advantages of the present invention are as follows:

[0026] 1. The present invention uses the pre-trained latent diffusion model of text-generated graph as the basic model, utilizes its powerful text-driven image generation capability, and controls its reverse diffusion process (sampling process) by constructing the remaining two components, expanding it from the mode of text-generated graph to the mode of text-guided graph-generated graph, that is, text-driven image translation. In order to achieve the diversified control effect of the basic model to support different image translation application scenarios, a spectrum filtering module is constructed and the initial coding features of the input image in the latent space of the latent diffusion model are transformed from the spatial domain to the frequency domain through the two-dimensional discrete cosine transform (2D-DCT), and then mapped back to the spatial domain through the two-dimensional inverse discrete cosine transform (2D-IDCT) after spectral filtering, so as to extract the coding features of the specific frequency band of the hidden coding of the input image as the control signal. Guided by the control signal, under the optimization goal of spectrum reconstruction, a frequency band control network is constructed and trained to control the image generation process of the pre-trained latent diffusion model, so as to achieve the consistency of the input image and the output image with respect to the specific frequency band of the latent space feature, and then achieve the image translation effect of a specific type.

[0027] 2. In the training stage, the present invention extracts the coding features of a specific frequency band as a control signal for each initial coding feature of the input image in the latent space of the latent diffusion model through the spectrum filtering module. The training band control network controls and guides the pre-trained latent diffusion model to reconstruct the complete spectrum of the latent space features of the input image according to the image information of the specific frequency band (partial spectrum) in the control signal and the text information encoded by the paired text description. In order to achieve the diversification of control functions to be suitable for different image translation application scenarios, DCT spectrum filters of different modes are constructed in the spectrum filtering module to extract control signals of different frequency bands. Accordingly, multiple corresponding band control branches are constructed and integrated in the band control network. Under the same spectrum reconstruction optimization goal, each band control branch is trained separately to achieve that for input control signals of different frequency bands, the complete spectrum of the latent code of the input image can be reconstructed with the assistance of text information.

[0028] 3. In the inference stage, for any input image, the present invention selects a specific spectrum filtering mode for its latent diffusion model hidden coding features, extracts the control signal of a specific frequency band, and selects the corresponding frequency band control branch in the frequency band control network for inference. During inference, when different target prompt texts are input to the model, the frequency band control network will be guided to perform different spectrum completion processes, so that the generated image is faithful to the description of the target prompt text. At the same time, the generated image is consistent with the input image with respect to the selected specific frequency band, thereby ensuring the specific correlation between the original input image and the target conversion image in image translation. The small-band control signal extracted by the small-pass filter mainly controls the style information of the image, so it is possible to retain the style of the original image while the target prompt text is used to edit the content of the target image, that is, style-guided image content creation; the low-band control signal with a larger bandwidth extracted by the low-pass filter mainly controls the style information and spatial structure information of the image, so it is possible to retain the style and structure of the input image while the target prompt text is used to edit the semantic features of the target image, that is, image semantic processing; the high-band control signal extracted by the high-pass filter mainly controls the contour information of the image, so it is possible to retain the edge structure of the input image while the target prompt text is used to edit the style of the target image, that is, image style conversion; the medium-band control signal extracted by the medium-pass filter mainly controls the overall layout information of the image, so it is possible to retain the overall layout of the input image while the target prompt text is used to edit the specific scene of the target image, that is, image scene conversion.

[0029] Compared with the prior art, the present invention realizes for the first time a single model integrating diversified text-driven image translation application scenarios from a frequency domain perspective, and the target images converted and generated in each application scenario have improved generation quality and text fidelity compared with existing methods. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 The overall architecture diagram of the text-driven image translation method and system based on spectrum reconstruction according to the embodiment.

[0031] Figure 2 4 is a structural diagram of a spectrum filtering module of an embodiment.

[0032] Figure 3 FIG. 4 is a structural diagram of a frequency band control network according to an embodiment.

[0033] Figure 4 FIG. 5 is a diagram showing the internal structure of a single network unit of a band control network according to an embodiment of the present invention.

[0034] Figures 5 to 8 The following are effect diagrams of experimental tests of the embodiment under small pass, low pass, medium pass and high pass filtering. DETAILED DESCRIPTION

[0035] In order to make the technical solution and implementation method of the present invention more obvious and easy to understand, the model architecture and technical details of the present invention are described in detail below with reference to the accompanying drawings.

[0036] This embodiment discloses a text-driven image translation method and system based on spectrum reconstruction. The overall architecture is as follows: Figure 1 The specific step-by-step instructions are as follows:

[0037] Step 1: Collect a training dataset containing paired image-text data pairs. To improve the quality of image generation, the collected images should have high quality and high resolution, and be as diverse as possible. The corresponding text is a simple description of the image. LAION-5B is a commonly used dataset for training large-scale diffusion models of text and images. However, the present invention focuses on training a control network to control the pre-trained large model for image translation, rather than training or fine-tuning the large model itself, so the requirements for the data level are not high. It is recommended to use the sub-dataset LAION-Aesthetics6.5+ of LAION-5B after image aesthetic quality screening, which contains a total of 625K image-text data pairs. The present invention can achieve a better image translation effect at the level of 50K image-text data pairs. Since the present invention uses a pre-trained latent diffusion model LDM, the images in the dataset need to be adjusted to a resolution of 512×512 to match the requirements of LDM for input and output image sizes. The images need to be normalized to the [-1,1] interval before model training.

[0038] Step 2: Load the pre-trained latent diffusion model of Wensheng graph. Figure 1 As shown, the present invention generates a model based on the pre-trained text graph latent diffusion model LDM. The present invention specifically uses the Stable Diffusion V2-1-base version of LDM, whose input and output image size is 512×512×3, and the size of the latent space feature encoding is 64×64×4. LDM uses a pre-trained codec to project high-dimensional images into a low-dimensional latent space, and trains a conditional denoising diffusion probability model based on the low-dimensional image latent coding for text-driven image generation, wherein the conditional information is the text embedding encoded by the text encoder. The present invention specifically uses the OpenCLIP self-attention text encoder to extract the text embedding. Based on the initial encoding feature z0 obtained after the input image passes through the image encoder of LDM, LDM uses a step-by-step denoising forward diffusion process (z0, z1, z2,…, z T ) Get the mapping feature Z of the original data distribution to the standard Gaussian distribution T , and a step-by-step denoising reverse diffusion process (z T ,z T-1 ,…,z2,z1,z0) realizes sampling from the standard Gaussian distribution to the original data distribution. LDM is based on the noise regression loss L∈ Train a denoising U-shaped network ε θ , which estimates the denoising results at each moment of the reverse diffusion process by predicting the Gaussian noise added at each moment in the forward diffusion process. Figure 3 As shown, the denoising U-type network ε θ It consists of 4 groups (3 in each group) of downsampling encoder units, 1 bottleneck unit, and 4 groups (3 in each group) of upsampling decoder units. Noise regression loss L ∈ The form is:

[0039]

[0040] Wherein, E represents mathematical expectation, y represents text, τ(·) represents text encoder, and t represents the time step of current sampling. The present invention adopts a 1000-step denoising diffusion probability model, that is, T=1000.

[0041] Step 3: Construct the spectrum filtering module. Figure 1 and Figure 2 As shown in the figure, based on the initial coding feature z0 of the input image in the LDM latent space, a spectral filtering module f is constructed to extract the coding features of a specific frequency band of z0 as the control signal C. In this module, z0 is converted into DCT frequency domain features F using a channel-by-channel two-dimensional discrete cosine transform (2D-DCT), and the initial coding features of the input image in the latent space of the latent diffusion model are transformed from the spatial domain to the frequency domain:

[0042]

[0043] in F (n) and The nth channels of F and z0, respectively, h and w are the height and width of the feature, i, j represent the two-dimensional coordinates of the feature in the spatial domain (the upper left corner is the origin of the coordinates), and u, v represent the two-dimensional coordinates of the feature in the 2D-DCT frequency domain space (the upper left corner is the origin of the coordinates). In the two-dimensional DCT domain, the elements closer to the upper left corner correspond to lower frequency components, and vice versa, the elements closer to the lower right corner correspond to higher frequency components. Therefore, the following small pass, low pass, medium pass, and high pass filter masks are designed:

[0044]

[0045] The specific thresholds of each spectrum filter mask can be adjusted flexibly, and there is no unique and strict requirement. The frequency domain feature F of a specific frequency band after filtering can be obtained by multiplying the DCT frequency domain feature F with the above spectrum filter mask. * :

[0046] F * =F×Mask *

[0047] Where *∈{mini, low, mid, high}. The feature F after spectrum filtering * Performing a two-dimensional inverse DCT transform can obtain the coding characteristics of the specific frequency band of the initial feature code z0, that is, the control signal C:

[0048]

[0049] Among them, F * (n) and C (n) Respectively represent F * and the nth channel of C.

[0050] Step 4: Construct the frequency band control network. Figure 1 As shown, the frequency band control network g receives the control signal of the specific frequency band extracted by the spectrum filter module f and the text encoding features paired with the input image, and outputs a series of control features to control the image generation process of the pre-trained LDM. Figure 3 As shown in Figure 2, the overall architecture of the band control network g is a downsampling encoder structure, which is similar to the denoising U-type network ε in LDM. θ The downsampling part of the block is consistent with the combination of the bottleneck part, which specifically includes 4 groups (3 in each group) of downsampling encoder units and a bottleneck unit, each of which is ε θ A trainable copy of the corresponding unit in . In order to enhance the stability of training, the zero convolution initialization technique is used. Specifically, at the input end of the band control network g, the control signal C is subjected to a zero-initialized convolution operation and then added to the input features of the LDM denoising U-type network at the current moment for subsequent feature propagation; at the output end, the output features of each encoder unit of the band control network g are subjected to a zero-initialized convolution operation and then injected into the symmetrical upsampling decoder unit in the LDM denoising U-type network in an additive manner to control the denoising process. The internal structure of each network unit in the band control network is shown in the figure. Figure 4 As shown in the figure, it consists of a residual block fused with timestamp encoding (temporal information), a self-attention layer and a cross-attention layer fused with text embedding (text information) in series. The implementation details of each component are consistent with the LDM of the Stable Diffusion V2-1-base version. Different from LDM, each unit of the band control network sets multiple parallel copies of the residual block component to construct multi-way control branches, corresponding to small band control, low band control, medium band control and high band control respectively.

[0051] Step 5: Model training. The weights of the pre-trained LDM are fixed. With spectrum reconstruction as the optimization goal, the frequency band control network g is trained to reconstruct the complete spectrum information of the input image hidden code based on the spectrum information of the specific frequency band (partial spectrum) contained in the control signal C and the paired text information. Due to the information loss-free property of the DCT transform, the reconstruction of the feature spectrum is equivalent to the reconstruction of the feature in the spatial domain, which can be achieved with the standard noise prediction loss of the diffusion model. Therefore, the spectrum reconstruction loss is equivalent to the following noise regression loss:

[0052]

[0053] C=g(f(z0),t,τ(y))

[0054] Where y is the text description, τ(·) is the text encoder, and t is the sampled time step. Figure 4 As shown, for each network unit of the band control network, in order to reduce the training overhead, all self-attention layers and cross-attention layers are frozen during training, and only the residual block components are fine-tuned. For multiple residual block copies in each network unit, they are fine-tuned separately under different spectral filtering modes in the spectral filtering module f, thereby training multiple band control branches of LDM to support different image translation application scenarios.

[0055] Step 6: Model inference. In the inference stage, for the encoded feature z0 of the input image in the latent space of the LDM, a specific spectral filtering mode is selected in the spectral filtering module f, and the control signal C of the specific frequency band is extracted, which is input into the band control network g together with the text encoding. For all network units in g, the residual block components of the corresponding frequency band are selected to form the band control branch. After network propagation, the intermediate features are output to control the denoising process of the pre-trained LDM. By selecting and switching the spectral filtering mode in f and the corresponding band control branch in g, a variety of image translations can be flexibly realized, such as style-guided image content creation based on small-pass filtering, image semantic processing based on low-pass filtering, image scene conversion based on mid-pass filtering, and image style conversion based on high-pass filtering.

[0056] Experimental test:

[0057] In the testing phase of the present invention, by selecting different spectral filtering branches in the spectral filtering module, different types of image translation applications can be realized. The style of the image can be controlled by using small pass filtering, and the content of the original image can be edited by text prompts, that is, style-guided image content creation (such as Figure 5 ); low-pass filtering can be used to control the style and spatial structure of the image, and text prompts can be used to edit the semantic features of the image, that is, image semantic processing (such as Figure 6); using mid-pass filtering can control the layout of the image, and the specific scene of the image can be changed by text prompts, that is, image scene conversion (such as Figure 7 As shown in ); High-pass filtering can be used to control the contour structure of the image, and the style of the image can be changed by text prompts, that is, image style conversion (as shown in Figure 8 shown).

[0058] The above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit the same. Those skilled in the art may modify or make equivalent substitutions for the technical solutions of the present invention without departing from the spirit and scope of the present invention. The protection scope of the present invention shall be subject to the claims.

Claims

1. A text-driven image translation method based on spectrum reconstruction, characterized in that: The following steps are involved: 1) Construct a pre-trained latent diffusion model (LDM), a spectrum filtering module, and a frequency band control network; 2) In the training phase, the paired image-text data pairs in the training data set are input into the LDM, and the LDM encodes the input image to generate initial encoding features, and performs a forward diffusion process based on the initial encoding features to obtain mapping features from the original data distribution to the standard Gaussian distribution, and encodes the input text to generate text encoding features; The initial coding features are processed by a spectrum filtering module, and two-dimensional discrete cosine transform, spectrum filtering and two-dimensional inverse discrete cosine transform are performed in sequence to generate a control signal of a specified frequency band of the input image; Input the control signal and text encoding features into the band control network for training, generate control features and calculate the noise regression loss; The mapping features, text encoding features and control features are input into LDM for the reverse diffusion process of step-by-step denoising, and then decoded to obtain the output image; 3) In the inference stage, any input image is processed by LDM encoding and spectral filtering module to generate a control signal of the specified frequency band, and then the target prompt text is encoded by LDM to generate text encoding features. The control signal and text encoding features are input into the trained frequency band control network to generate a control signal, and then the control signal is generated through the reverse diffusion process of LDM step-by-step denoising and decoding processing to generate an image that matches the target prompt text description.

2. The method according to claim 1, characterized in that The training data set uses the data set LAION-Aesthetics6.5+, and the images in the training data set are preprocessed. The preprocessing includes adjusting the image resolution to be consistent with the input and output image sizes of LDM, and standardizing the image to the [-1,1] interval.

3. The method according to claim 1, characterized in that LDM includes an image encoder, a forward diffusion network, a text encoder, a denoising U-type network and a decoder; wherein the image encoder encodes the input image to generate initial coding features, the forward diffusion network performs a forward diffusion process on the initial coding features to generate mapping features from the original data distribution to the standard Gaussian distribution, and the text encoder encodes the input text to generate text coding features; the denoising U-type network performs a step-by-step denoising reverse diffusion process based on the mapping features, text coding features and control features to restore the initial coding features, and the decoder decodes the restored initial coding features to generate an output image.

4. The method according to claim 3, characterized in that The denoising U-network consists of 4 groups of 3 downsampling encoder units, 1 bottleneck unit, and 4 groups of 3 upsampling decoder units.

5. The method according to claim 1, characterized in that The spectrum filtering module uses a two-dimensional discrete cosine transform on a channel-by-channel basis to convert the initial coding features into DCT frequency domain features, and then multiplies the DCT frequency domain features with the preset small-pass, low-pass, mid-pass, and high-pass filter masks to generate the frequency domain features of the specified frequency band after filtering. The frequency domain features of the specified frequency band are subjected to a two-dimensional inverse discrete cosine transform to generate the coding features of the specified frequency band of the initial coding features, i.e., the control signal.

6. The method according to claim 5, characterized in that The preset small pass, low pass, mid pass, and high pass filter masks are as follows: Among them, u and v represent the two-dimensional coordinates of the feature in the two-dimensional discrete cosine transform frequency domain space.

7. The method according to claim 4, characterized in that The band steering network consists of 4 groups of 3 downsampling encoder units and 1 bottleneck unit, each of which is a trainable copy of the corresponding unit in the denoising U-network of LDM.

8. The method according to claim 7, characterized in that Each unit of the frequency band control network consists of a residual block fused with timestamp coding, a self-attention layer and a cross-attention layer fused with text encoding features in series. The residual block has 4 parallel copies corresponding to small frequency band control, low frequency band control, medium frequency band control and high frequency band control.

9. The method according to claim 7, characterized in that The band control network performs a zero-initialized convolution operation on the control signal at the input end, and then adds it to the input features of the LDM denoising U-type network at the current moment, and then performs subsequent feature propagation; at the output end, the output features of each encoder unit of the band control network are zero-initialized and convolved, and then injected into the symmetrical upsampling decoder unit in the LDM denoising U-type network in an additive manner to control the reverse diffusion process of step-by-step denoising.

10. A text-driven image translation system based on spectrum reconstruction, implementing the method according to any one of claims 1 to 9, characterized in that: include: The latent diffusion model of text image is used to encode the input image to generate initial encoding features, and to perform a forward diffusion process based on the initial encoding features to obtain mapping features from the original data distribution to the standard Gaussian distribution, and to encode the input text to generate text encoding features; and performing a reverse diffusion process of step-by-step denoising according to the mapping features, text encoding features and control features, and then decoding to obtain an output image; A spectrum filtering module, used to perform two-dimensional discrete cosine transform, spectrum filtering and two-dimensional inverse discrete cosine transform in sequence according to the initial coding features to generate a control signal of a specified frequency band of the input image; A band control network model is used to generate control features based on control signals and text encoding features.

Citation Information

Cited By

  • Cross-scene hyperspectral image segmentation method based on style conversion

    CN119399218A

  • Multi-modal rumor detection method based on data enhancement and global information fusion

    CN120046120A

  • Multi-condition guide text image generation method based on decoupling and multi-domain guide strategy

    CN120047565A

  • Text-guided spectrum image description method, system and device and storage medium

    CN122265805A

  • A text-guided spectral image description method, system, device and storage medium

    CN122265805B