Image restoration system integrating bidirectional perception Transformer and frequency analysis strategy

By integrating the bidirectional sensing Transformer and the frequency analysis strategy, the image repair system solves the problem of insufficient semantic understanding in traditional methods in processing large-area damaged images, and achieves high-quality image repair. The generated repaired image contains rich details and structural information. .

CN118429228BActive Publication Date: 2024-09-27TIBET UNIVERSITY FOR NATIONALITIES
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410878178.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-02
Publication Date
2024-09-27
Estimated Expiration
2044-07-02

AI Technical Summary

Technical Problem

Traditional image restoration methods are difficult to generate novel content and coherent semantic information when processing large-area damaged images, especially in the case of complex textures and structures in damaged areas. The lack of semantic understanding makes it difficult to restore high-fidelity images.

Method used

An image restoration system that integrates bidirectional sensing Transformer and frequency analysis strategies is adopted. Through the head convolution module, bidirectional sensing Transformer repair bottleneck block, frequency analysis guidance network and tail convolution module, the forward and backward image context is obtained and the receptive field is expanded. , and maintains the image structure and details through wavelet decomposition and reconstruction, generating self-consistent repair results.

Benefits of technology

The effect of image repair is improved. The generated repaired image contains rich image details and semantic information, which can better restore the structure and texture of large-area damaged images and improve the quality of image repair.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118429228B
    Figure CN118429228B
Patent Text Reader

Abstract

The present invention provides an image restoration system integrating a bidirectional perception transformer and a frequency analysis strategy, and relates to the technical field of image restoration. The system of the present invention includes a generator and a discriminator, wherein the generator includes a head convolution module, a bidirectional perception transformer restoration bottleneck block, a frequency analysis guidance network, and a tail convolution module, and the discriminator includes an overall discriminator and a high-frequency discriminator. The present invention obtains forward and backward image contexts through a bidirectional perception transformer restoration bottleneck block, expands the receptive field range, and provides rich context information, thereby generating self-consistent semantic content, and restores and reconstructs low-frequency components and high-frequency components respectively through a frequency analysis guidance network, while maintaining the overall structure and contour of the image, the restored image contains rich image details, thereby improving the restoration effect of the image to be restored.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image restoration, and in particular to an image restoration system integrating a bidirectional perception Transformer and a frequency analysis strategy. Background Art

[0002] With the rapid development of digital media, image restoration is not just about restoring the original image of the damaged area, but requires both "understanding" the large-scale structure of natural images and image synthesis. It has been widely studied in various image editing tasks, such as filling given holes or removing unwanted objects based on the remaining background pixels. Realistic and high-fidelity image restoration remains a challenging task, especially when the damaged area is large and has complex texture and structural patterns, which requires learning the image structure and generating pixels for the missing area.

[0003] Traditional image restoration methods, such as diffusion-based methods and sample-based methods, mainly match, copy and realign background pixel blocks to the missing area by assuming that known and unknown areas in the damaged image share similar content. Traditional image restoration methods can produce reasonable results when dealing with small missing areas, but they lack semantic understanding and have difficulty in generating novel content and coherent semantic information for large hole damaged images.

[0004] The above information disclosed in this Background section is only for enhancement of understanding of the background of the present disclosure and therefore it may contain information that does not constitute the prior art that is already known to one of ordinary skill in the art. Summary of the invention

[0005] The purpose of the present invention is to provide an image restoration system that integrates a bidirectional perception Transformer and a frequency analysis strategy to solve the problems raised in the above background technology.

[0006] To achieve the above object, the present invention provides the following technical solutions:

[0007] An image restoration system integrating a bidirectional perception transformer and a frequency analysis strategy includes a generator and a discriminator. The generator includes a head convolution module, a bidirectional perception transformer restoration bottleneck block, a frequency analysis guidance network and a tail convolution module. The discriminator includes an overall discriminator and a high-frequency discriminator, wherein:

[0008] A head convolution module, wherein the head convolution module is used to perform multiple convolution downsampling on the input mask image and the mask of the image to be repaired to obtain multiple downsampled encoding features of different resolutions;

[0009] A bidirectional perceptual Transformer bottleneck repair block, which is composed of a plurality of bidirectional perceptual Transformer models of different stages, and the resolution of the input features of the bidirectional perceptual Transformer models of adjacent stages is different. The bidirectional perceptual Transformer bottleneck repair block is used to process the down-sampled encoding features generated by the last convolution down-sampling, expand the receptive field, and provide rich contextual information, so as to generate self-consistent semantic content;

[0010] A frequency analysis guidance network, wherein the frequency analysis guidance network is used to perform wavelet decomposition on the down-sampled coding features obtained by the head convolution module to obtain low-frequency components and high-frequency components, and then repair and reconstruct the low-frequency components and high-frequency components to form low-frequency sub-bands and high-frequency sub-bands, and send the low-frequency sub-bands to the head convolution module through a jump connection for feature addition to maintain the overall structure and contour of the image, and use wavelet inverse transformation to reconstruct the high-frequency sub-bands into original features;

[0011] The tail convolution module is used to perform multiple convolution upsampling on the downsampled encoding features processed by the bidirectional perception Transformer repair bottleneck block to gradually restore the resolution of the image and generate a repaired image that matches the image to be repaired. The original features are sent to the tail convolution module through a skip connection for feature addition, so that the repaired image contains rich image details;

[0012] An overall discriminator, which is used to evaluate the restored image generated by the generator to assist the generator in training optimization. The overall discriminator adopts an adversarial loss function;

[0013] A high-frequency discriminator is used to evaluate the high-frequency sub-band of the restored image generated by the generator to assist the generator in training optimization. The high-frequency discriminator adopts an adversarial loss function.

[0014] Furthermore, the down-sampled encoding feature obtained after the i-th convolution down-sampling is calibrated as , i represents the number of different convolution downsampling, and i=1, 2, 3, ..., I, I represents the total number of convolution downsampling, and , and the downsampled encoding feature obtained after the i-th convolution downsampling The corresponding low-frequency subband is calibrated as , and the downsampled encoding feature obtained after the i-th convolution downsampling The corresponding high frequency subband is calibrated as , will be combined with the high frequency sub-band The corresponding original feature calibration is , the up-sampled encoding feature obtained after the j-th convolution up-sampling is calibrated as , j represents the number of different convolution upsampling, and j=1, 2, 3, ..., J, J represents the total number of convolution upsampling, and .

[0015] Furthermore, the head convolution module is composed of a first head convolution unit, a second head convolution unit and a third head convolution unit, and the first head convolution unit, the second head convolution unit and the third head convolution unit sequentially perform convolution down-sampling with half the resolution, and the tail convolution module is composed of a first tail convolution unit, a second tail convolution unit and a third tail convolution unit, and the first tail convolution unit, the second tail convolution unit and the third tail convolution unit sequentially perform convolution up-sampling with doubled resolution.

[0016] Furthermore, the frequency analysis guidance network is used to encode the downsampled features obtained by the first convolution downsampling. Perform wavelet decomposition to obtain low-frequency components and high-frequency components, and then repair and reconstruct the low-frequency components and high-frequency components to form the same down-sampling coding features. The corresponding low frequency subband and high frequency subband , the low frequency subband The second head convolution unit of the head convolution module is fed into the skip connection to encode the downsampled features. and low frequency subband Add and use it to downsample the encoding features obtained by the second convolution downsampling Perform wavelet decomposition to obtain low-frequency components and high-frequency components, and then repair and reconstruct the low-frequency components and high-frequency components to form the same down-sampling coding features. The corresponding low frequency subband and high frequency subband , the low frequency subband The data is fed into the third head convolution unit of the head convolution module through a skip connection to encode the downsampled features. and low frequency subband Perform addition;

[0017] The frequency analysis guide network is used to transform the original features It is fed into the second tail convolution unit of the tail convolution module through a skip connection to encode the up-sampled features. and the original features Add and use to convert the original features It is fed into the first tail convolution unit of the tail convolution module through a skip connection to encode the upsampled features. and the original features Add.

[0018] Furthermore, the bidirectional perception Transformer repair bottleneck block includes:

[0019] An input unit, wherein the input unit of the bidirectional perception Transformer model is used to receive input features;

[0020] An N-Gram bidirectional perception algorithm unit, which is used to process input features to generate N-Gram contextual bidirectional information and add it to the partition window of the input features to expand the receptive field and provide rich contextual information;

[0021] A cosine similarity calculation unit, wherein the cosine similarity calculation unit is used to calculate the attention weights between different elements in combination with the above partitioned windows;

[0022] A first layer normalization unit, wherein the first layer normalization unit is used to normalize the data processed by the cosine similarity calculation unit so that the data are in the same scale range;

[0023] A multi-layer perceptron, the multi-layer perceptron consisting of a fully connected layer activation function unit, a fully connected layer unit and a DUA unit connected in sequence, the fully connected layer activation function unit is used to process the data processed by the layer normalization first unit to activate the fully connected layer output encoding unit, and the DUA unit is used to process the encoding unit output by the fully connected layer to provide dense interaction and reduce the burden of self-attention interaction;

[0024] The second layer normalization unit is used to perform normalization processing on the coding units processed by the DUA unit so that the coding units are in the same scale range.

[0025] Furthermore, the N-Gram bidirectional perception algorithm unit uses The channel reduction group convolution technique is used to process the input features of the bidirectional perception Transformer model to map the input features into features with reduced channel number and resolution, and the features contain multiple independent feature pixels. The scaled cosine window self-attention interaction technique is used to process the feature pixels to obtain the forward N-Gram window features, and the backward N-Gram window features are obtained by reversely applying the sequential reflection window filling technique. The forward N-Gram window features and the backward N-Gram window features are spliced, and 1×1 convolution is used to merge to generate N-Gram contextual bidirectional information, and the N-Gram contextual bidirectional information is added to the partitioned window of the input feature window by window, where N represents the considered context length;

[0026] Among them, the input features of the bidirectional perception Transformer model in the nth stage are calibrated as ,and , n represents the number of different stages, and n=1, 2, 3, ..., X, X represents the total number of stages in the bidirectional perceptual Transformer repair bottleneck block, and , Represents the width, height and number of channels of the input features at the nth stage;

[0027] Among them, will correspond to the input features The characteristic calibration is , the feature includes multiple feature pixels, namely uni-Gram, and , represents the number of windows of height, and , The number of windows representing the width, , Represents the convolution kernel size value of the bidirectional perception Transformer model window at the nth stage, by transforming the input feature Mapping to Features , to achieve the effect of reducing the number of channels and resolution;

[0028] Among them, the forward N-Gram window feature, backward N-Gram window feature, and N-Gram context bidirectional information of the bidirectional perception Transformer model of the nth stage are calibrated as ,and ;

[0029] Among them, the formula of scaled cosine window self-attention is as follows:

[0030] ;

[0031] In the above formula, are the query matrix, key matrix, and value matrix respectively, and , is the relative position deviation between each pixel in the local window, and , is a learnable scalar greater than 0.01.

[0032] Furthermore, the method in which the DUA unit processes the coding unit output by the fully connected layer is as follows:

[0033] ;

[0034] Among them, the kth coding unit output by the fully connected layer is marked as , k represents the number of different coding units, and k=1, 2, 3, ..., M, M represents the total number of coding units, and ,pass The average value of M coding units is calculated, and then each coding unit is added to the average value to calculate the setting of the average value, so as to distribute the average value to each coding unit to provide dense interaction and reduce the burden of self-attention interaction.

[0035] Furthermore, the frequency analysis guidance network includes:

[0036] A wavelet transform unit, wherein the wavelet transform unit of the frequency analysis guidance network is used to perform wavelet transform on the down-sampled coding features to obtain low-frequency components and high-frequency components;

[0037] The first frequency component reconstruction residual block is used to repair and reconstruct the low-frequency component to generate a low-frequency sub-band, and the low-frequency sub-band is sent to the head convolution module through a jump connection for feature addition to maintain the overall structure and contour of the image, and the high-frequency sub-band is reconstructed into the original feature by using an inverse wavelet transform. The first frequency component reconstruction residual block consists of four consecutive residual blocks, and the expansion rates of the four consecutive residual blocks are 1, 2, 4, and 8, respectively, so as to increase feature extraction at different scales and expand the receptive field;

[0038] A multi-frequency adaptive alignment unit, the multi-frequency adaptive alignment unit is used to calculate the attention score of the low-frequency component, aggregate the attention score to the high-frequency component to align the high-frequency component with the low-frequency component, and learn the aggregated output of the high-frequency component through a convolutional network to obtain fine-grained modulation parameters, use an adaptive instance normalization technology combined with spatial domain features to align the mean and variance of the spatial domain features and the high-frequency component, so as to guide the alignment of the spatial domain and the frequency domain, learn the spatial domain features through a convolutional layer to obtain coarse modulation parameters, perform weighted summation of the fine-grained modulation parameters and the coarse modulation parameters to obtain pixel-level fine-grained modulation parameters, and finally inject the pixel-level fine-grained modulation parameters into the low-frequency component to fully integrate the internal features and external features of the frequency domain and reduce the difficulty of generating high-frequency bands, the internal features of the frequency domain include high-frequency information and low-frequency information, and the external features are spatial domain features;

[0039] A second frequency component reconstruction residual block, wherein the second frequency component reconstruction residual block is used to repair and reconstruct the data processed by the multi-frequency adaptive alignment unit to generate a high-frequency sub-band, and the second frequency component reconstruction residual block is composed of four consecutive residual blocks, and the expansion rates of the four consecutive residual blocks are 1, 2, 4, and 8, respectively, so as to increase feature extraction at different scales and expand the receptive field;

[0040] The inverse wavelet transform unit is used to perform inverse wavelet transform on the high-frequency sub-band after the second frequency component reconstruction residual block is processed, so as to inversely transform the high-frequency sub-band into the original features, and send the original features to the tail convolution module through a jump connection for feature addition, so that the restored image contains rich image details.

[0041] Furthermore, the specific method of calculating the attention score of the low-frequency component and aggregating the attention score to the high-frequency component to align the high-frequency component with the low-frequency component is as follows:

[0042] 1) Calibrate the low-frequency component in the input multi-frequency adaptive alignment unit as ,and , is the number of spatial positions, which is the height of the spatial position and width The product of , converts the low-frequency component into two feature spaces, key and query, and then calculates the attention score of the low-frequency component. The calculation formula is as follows:

[0043] ;

[0044] In the above formula, represents the value at the yth position in the key feature space, y represents the number of different positions in the key feature space, and y=1, 2, 3, ..., , represents the value at the zth position in the query feature space, z represents the number of different positions in the query feature space, and z=1, 2, 3, ..., , T is the preset scale parameter, Both are 1×1 convolutions, Represents the attention score corresponding to z, y;

[0045] 2) Calibrate the high-frequency component in the input multi-frequency adaptive alignment unit as ,and , the high frequency components are passed through Mapped to the feature space of the low-frequency component, the high-frequency component The aggregate output at the yth position is calibrated as , The calculation formula is:

[0046] ;

[0047] In the above formula, is the conventional convolution transformation function;

[0048] Furthermore, the convolutional network for learning high-frequency component aggregation output is a four-layer convolutional network, and the fine-grained modulation parameters include a scaling parameter for scaling and the bias parameter for the bias In the middle two layers of the four-layer convolutional network, the adaptive instance normalization technique combined with spatial domain features is used to align the mean and variance of spatial domain features and high-frequency components. The spatial domain features are learned through a convolutional layer with a kernel of 3×3 to obtain coarse modulation parameters. The coarse modulation parameters include the scaling parameters used for scaling. and the bias parameter for the bias , pixel-level fine-grained modulation parameters include scaling parameters for scaling and the bias parameter for the bias , and its calculation formula is as follows:

[0049] ;

[0050] in, are all learnable weight parameters, and , the spatial domain features are input frequency analysis to guide the down-sampled encoding features in the network.

[0051] Compared with the prior art, the present invention has the following beneficial effects:

[0052] The image restoration system of the present invention integrates the bidirectional perception Transformer and the frequency analysis strategy, obtains the forward and backward image contexts through the bidirectional perception Transformer repair bottleneck block, expands the receptive field range, and provides rich contextual information, thereby generating self-consistent semantic content, and guides the network to repair and reconstruct the low-frequency components and the high-frequency components respectively through frequency analysis, while maintaining the overall structure and contour of the image, the restored image contains rich image details, thereby improving the restoration effect of the image to be repaired. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 It is a schematic diagram of the overall architecture of the system in the present invention;

[0054] Figure 2 Schematic diagram of the architecture of the bidirectional perception Transformer model in the present invention;

[0055] Figure 3 Schematic diagram of the forward and backward N-Gram window characteristics in the present invention;

[0056] Figure 4 Schematic diagram of the architecture of the multi-frequency adaptive alignment unit in the present invention;

[0057] Figure 5 It is a module unit diagram of the generator in the present invention;

[0058] Figure 6 This is a schematic diagram of qualitative comparison of the second data set in the present invention;

[0059] Figure 7 This is a schematic diagram of qualitative comparison of the first data set in the present invention. DETAILED DESCRIPTION

[0060] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with specific embodiments.

[0061] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the present invention should be understood by people with ordinary skills in the field to which the present invention belongs. The words "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0062] See also Figure 1-7 , the present invention provides the following embodiments:

[0063] Embodiment 1:

[0064] The present invention provides an image restoration system integrating a bidirectional perception transformer and a frequency analysis strategy, including a generator and a discriminator. The generator includes a head convolution module, a bidirectional perception transformer restoration bottleneck block, a frequency analysis guidance network and a tail convolution module:

[0065] The head convolution module is used to perform multiple convolution downsampling on the input mask image and mask of the image to be repaired to obtain multiple downsampled encoding features of different resolutions;

[0066] Among them, the down-sampled encoding feature obtained after the i-th convolution down-sampling is calibrated as , i represents the number of different convolution downsampling, and i=1, 2, 3, ..., I, I represents the total number of convolution downsampling, and ;

[0067] As an implementation, the head convolution module is composed of a first head convolution unit, a second head convolution unit and a third head convolution unit, and the first head convolution unit, the second head convolution unit and the third head convolution unit sequentially perform convolution downsampling with a resolution of half. Specifically, the first head convolution unit uses a 3×3 convolution kernel to extract features from an input mask image and a mask of an image to be repaired with a resolution of 256×256, and then downsamples to obtain a downsampled encoding feature with a resolution of half. , the second head convolution unit uses 3×3 convolution kernel to downsample the encoding features After feature extraction, downsampling is performed to obtain downsampled encoded features with half the resolution. , the third head convolution unit uses 3×3 convolution kernel to downsample the encoding features After feature extraction, downsampling is performed to obtain downsampled encoded features with half the resolution. ;

[0068] Bidirectional Perceptual Transformer repair bottleneck block. The bidirectional perceptual Transformer repair bottleneck block consists of multiple stages of bidirectional perceptual Transformer models, and the resolution of the input features of the bidirectional perceptual Transformer models in adjacent stages is different. The bidirectional perceptual Transformer repair bottleneck block is used to process the downsampled encoding features generated by the last convolution downsampling, expand the receptive field, and provide rich contextual information to generate self-consistent semantic content. Through the setting of multiple bidirectional perceptual Transformer models, the expression ability of feature information and the ability to obtain global structural information are enhanced;

[0069] As an implementation, the bidirectional-aware Transformer repair bottleneck block consists of a three-stage bidirectional-aware Transformer model, where the resolutions of the input features of the three stages are 32, 16, and 32 respectively;

[0070] Frequency analysis guidance network: The frequency analysis guidance network is used to perform wavelet decomposition on the down-sampled coding features obtained by the head convolution module to obtain low-frequency components and high-frequency components, and then repair and reconstruct the low-frequency components and high-frequency components to form low-frequency sub-bands and high-frequency sub-bands. The low-frequency sub-bands are sent to the head convolution module through skip connections for feature addition to maintain the overall structure and contour of the image, and the high-frequency sub-bands are reconstructed into original features using inverse wavelet transform;

[0071] Among them, the downsampled encoding feature obtained after the i-th convolution downsampling The corresponding low-frequency subband is calibrated as , and the downsampled encoding feature obtained after the i-th convolution downsampling The corresponding high frequency subband is calibrated as ,and , contains the low-frequency information of the image, contains the high-frequency information of the image in the horizontal direction. Includes the high-frequency information of the image in the vertical direction, The high-frequency information of the image in the diagonal direction is included, which will be combined with the high-frequency sub-band The corresponding original feature calibration is ;

[0072] As an implementation, the frequency analysis guide network is used to downsample the encoding features obtained by the first convolution downsampling Perform wavelet decomposition to obtain low-frequency components and high-frequency components, and then repair and reconstruct the low-frequency components and high-frequency components to form the same down-sampling coding features. The corresponding low frequency subband and high frequency subband , the low frequency subband The second head convolution unit of the head convolution module is fed into the skip connection to encode the downsampled features. and low frequency subband Add and use it to downsample the encoding features obtained by the second convolution downsampling Perform wavelet decomposition to obtain low-frequency components and high-frequency components, and then repair and reconstruct the low-frequency components and high-frequency components to form the same down-sampling coding features. The corresponding low frequency subband and high frequency subband , the low frequency subband The data is fed into the third head convolution unit of the head convolution module through a skip connection to encode the downsampled features. and low frequency subband Perform addition;

[0073] Tail convolution module: Tail convolution is used to perform multiple convolution upsampling on the downsampled encoding features processed by the bidirectional perception Transformer repair bottleneck block to gradually restore the resolution of the image and generate a repaired image that matches the image to be repaired. The original features are sent to the tail convolution module through skip connections for feature addition, so that the repaired image contains rich image details.

[0074] Among them, the up-sampled encoding feature obtained after the j-th convolution up-sampling is calibrated as , j represents the number of different convolution upsampling, and j=1, 2, 3, ..., J, J represents the total number of convolution upsampling, and ;

[0075] As an implementation method, the tail convolution module and the head convolution module have a mirror structure, that is, the tail convolution module is composed of a first tail convolution unit, a second tail convolution unit and a third tail convolution unit, and the first tail convolution unit, the second tail convolution unit and the third tail convolution unit perform convolution upsampling with doubled resolution in sequence. Specifically, the first tail convolution unit uses a 3×3 convolution kernel to extract the downsampled coding features processed by the bidirectional perception Transformer repair bottleneck block, and then upsamples to obtain upsampled coding features with doubled resolution. , the second tail convolution unit uses a 3×3 convolution kernel to upsample the encoded features After feature extraction, upsampling is performed to obtain upsampled encoded features with doubled resolution , the third tail convolution unit uses a 3×3 convolution kernel to upsample the encoded features After feature extraction, upsampling is performed to obtain upsampled encoded features with doubled resolution ;

[0076] As an embodiment, the frequency analysis guide network is used to transform the original features It is fed into the second tail convolution unit of the tail convolution module through a skip connection to encode the up-sampled features. and the original features Add and use to convert the original features It is fed into the first tail convolution unit of the tail convolution module through a skip connection to encode the upsampled features. and the original features Perform addition;

[0077] The discriminator includes an overall discriminator and a high-frequency discriminator, where:

[0078] The overall discriminator is used to evaluate the restored images generated by the generator to assist the generator in training and optimization. The overall discriminator uses an adversarial loss function, which is an existing technology and will not be described in detail here:

[0079] High-frequency discriminator: The high-frequency discriminator is used to evaluate the high-frequency sub-band of the restored image generated by the generator to assist the generator in training optimization. The high-frequency discriminator adopts an adversarial loss function, which is an existing technology and will not be elaborated here.

[0080] Embodiment 2:

[0081] Embodiment 2 uses the N-Gram bidirectional perception algorithm unit and the DUA unit to optimize the bidirectional perception Transformer repair bottleneck block based on Embodiment 1, as follows:

[0082] Input unit: The input unit of the bidirectional perception Transformer model is used to receive input features;

[0083] N-Gram bidirectional perception algorithm unit, the N-Gram bidirectional perception algorithm unit is used to process the input features to generate N-Gram contextual bidirectional information and add it to the partition window of the input features to expand the receptive field and provide rich contextual information, as follows:

[0084] use The channel reduction group convolution technology processes the input features of the bidirectional perception Transformer model to map the input features into features with reduced channel number and resolution, and the features contain multiple independent feature pixels. The scaled cosine window self-attention interaction technology is used to process the feature pixels to obtain the forward N-Gram window features, and the backward N-Gram window features are obtained by reversely applying the sequential reflection window filling technology. The forward N-Gram window features and the backward N-Gram window features are spliced, and 1×1 convolution is used to merge to generate N-Gram context bidirectional information, and the N-Gram context bidirectional information is added to the partition window of the input feature window by window, where N represents the context length considered, which is set by the staff according to the actual situation and is not limited here;

[0085] Among them, the input features of the bidirectional perception Transformer model in the nth stage are calibrated as ,and , n represents the number of different stages, and n=1, 2, 3, ..., X, X represents the total number of stages in the bidirectional perceptual Transformer repair bottleneck block, and , Represents the width, height and number of channels of the input features at the nth stage;

[0086] Among them, will correspond to the input features The characteristic calibration is , the feature includes multiple feature pixels, namely uni-Gram, and , represents the number of windows of height, and , The number of windows representing the width, , Represents the convolution kernel size value of the bidirectional perception Transformer model window at the nth stage, by transforming the input feature Mapping to Features , achieving the effect of reducing the number of channels and resolution, greatly reducing the amount of calculation and improving calculation efficiency;

[0087] Among them, the forward N-Gram window feature, backward N-Gram window feature, and N-Gram context bidirectional information of the bidirectional perception Transformer model of the nth stage are calibrated as ,and ;

[0088] As an implementation method, the widths of the input features of the three-stage bidirectional perception Transformer model are 32, 16, 32, respectively, the heights are 32, 16, 32, respectively, the number of channels is 3, the width and height are both the width and height of the input feature resolution, and the convolution kernel size values ​​of the three-stage bidirectional perception Transformer model window are 8, 4, 8, respectively;

[0089] It should be noted that the use of scaled cosine window self-attention interaction to process independent feature pixels to determine the attention weights between the feature pixels, thereby combining the feature pixels to form forward N-Gram window features is a prior art, which will not be described in detail here. Similarly, the reverse application of the sequential reflection window filling technology to obtain the backward N-Gram window features is also a prior art, which will not be described in detail here.

[0090] Among them, the formula of scaled cosine window self-attention is as follows:

[0091] .

[0092] In the above formula, are the query matrix, key matrix, and value matrix respectively, and , is the relative position deviation between each pixel in the local window, and , is a learnable scalar greater than 0.01;

[0093] A cosine similarity calculation unit, which is used to calculate the attention weights between different elements in combination with the above partition window. This is a prior art and will not be described in detail here.

[0094] The first layer normalization unit is used to normalize the data processed by the cosine similarity calculation unit so that the data is in the same scale range to improve the subsequent calculation learning efficiency. This is a prior art and will not be described in detail here.

[0095] Multilayer perceptron, the multilayer perceptron is composed of a fully connected layer activation function unit, a fully connected layer unit and a DUA unit connected in sequence. The fully connected layer activation function unit is used to process the data processed by the first unit of the layer normalization to activate the fully connected layer output encoding unit. The fully connected layer activation function unit and the fully connected layer unit can adopt the existing technology, which will not be repeated here. The DUA unit is used to process the encoding unit output by the fully connected layer to provide dense interaction, reduce the burden of self-attention interaction, make the overall optimization of the bidirectional perception Transformer model easier, and improve its generalization ability. The specific method is as follows:

[0096] ;

[0097] It should be noted that the kth coding unit output by the fully connected layer is denoted as , k represents the number of different coding units, and k=1, 2, 3, ..., M, M represents the total number of coding units, and ,pass The average value of M coding units is calculated, and then each coding unit is added to the average value to calculate the average value. The average value is distributed to each coding unit to provide dense interaction, reduce the burden of self-attention interaction, make the overall optimization of the bidirectional perception Transformer model easier, and improve its generalization ability;

[0098] The second layer normalization unit is used to normalize the coding unit after being processed by the DUA unit so that the coding unit is in the same scale range to improve the subsequent calculation learning efficiency. This is a prior art and will not be described in detail here.

[0099] Embodiment three:

[0100] Embodiment 3 Based on Embodiment 1, the frequency analysis guidance network is optimized as follows:

[0101] Wavelet transform unit: The wavelet transform unit of the frequency analysis guidance network is used to perform wavelet transform on the downsampled coding features to obtain low-frequency components and high-frequency components. Specifically, the wavelet transform method based on Haar wavelet can be used to perform wavelet transform on the downsampled coding features using low-pass filters and high-pass filters to generate low-frequency components and high-frequency components. This is a prior art and will not be described in detail here.

[0102] The first frequency component reconstruction residual block is used to repair and reconstruct the low-frequency component to generate a low-frequency sub-band, and send the low-frequency sub-band to the head convolution module through a jump connection for feature addition to maintain the overall structure and contour of the image, and use the inverse wavelet transform to reconstruct the high-frequency sub-band into the original feature. The first frequency component reconstruction residual block is specifically composed of four consecutive residual blocks, and the expansion rates of the four consecutive residual blocks are 1, 2, 4, and 8, respectively, so as to increase the feature extraction of different scales and expand the receptive field;

[0103] Multi-frequency adaptive alignment unit, which is used to calculate the attention score of the low-frequency component, aggregate the attention score to the high-frequency component to align the high-frequency component with the low-frequency component, and learn the aggregated output of the high-frequency component through a convolutional network to obtain fine-grained modulation parameters. The adaptive instance normalization technology combined with spatial domain features is used to align the mean and variance of the spatial domain features and the high-frequency component to guide the alignment of the spatial domain and the frequency domain. The spatial domain features are learned through a convolutional layer to obtain coarse modulation parameters. The fine-grained modulation parameters and the coarse modulation parameters are weighted and summed to obtain pixel-level fine-grained modulation parameters. Finally, the pixel-level fine-grained modulation parameters are injected into the low-frequency component to fully integrate the internal and external features of the frequency domain and reduce the difficulty of generating high-frequency bands. The internal features of the frequency domain include high-frequency information and low-frequency information, and the external features are spatial domain features.

[0104] The specific method of calculating the attention score of the low-frequency component and aggregating the attention score to the high-frequency component to align the high-frequency component with the low-frequency component is as follows:

[0105] 1) Calibrate the low-frequency component in the input multi-frequency adaptive alignment unit as ,and , is the number of spatial positions, which is the height of the spatial position and width The product of , converts the low-frequency component into two feature spaces, key and query, and then calculates the attention score of the low-frequency component. The calculation formula is as follows:

[0106] ;

[0107] In the above formula, represents the value at the yth position in the key feature space, y represents the number of different positions in the key feature space, and y=1, 2, 3, ..., , represents the value at the zth position in the query feature space, z represents the number of different positions in the query feature space, and z=1, 2, 3, ..., , T is the preset scale parameter, which is set by the staff according to the actual situation. Both are 1×1 convolutions, Represents the attention score corresponding to z, y;

[0108] 2) Calibrate the high-frequency component in the input multi-frequency adaptive alignment unit as ,and , the high frequency components are passed through Mapped to the feature space of the low-frequency component, the high-frequency component The aggregate output at the yth position is calibrated as , The calculation formula is:

[0109] ;

[0110] It should be noted that is a conventional convolution transformation function, which is a prior art and will not be described in detail here;

[0111] Among them, the convolutional network used for high-frequency component aggregation output learning is a four-layer convolutional network, and the fine-grained modulation parameters include scaling parameters for scaling and the bias parameter for the bias In the middle two layers of the four-layer convolutional network, the adaptive instance normalization technique combined with spatial domain features is used to align the mean and variance of spatial domain features and high-frequency components. The spatial domain features are learned through a convolutional layer with a kernel of 3×3 to obtain coarse modulation parameters. The coarse modulation parameters include the scaling parameters used for scaling. and the bias parameter for the bias , pixel-level fine-grained modulation parameters include scaling parameters for scaling and the bias parameter for the bias , and its calculation formula is as follows:

[0112] ;

[0113] It should be noted that are all learnable weight parameters, and ,The spatial domain features are the down-sampled encoding features in the input frequency analysis guidance network;

[0114] The second frequency component reconstruction residual block is used to repair and reconstruct the data processed by the multi-frequency adaptive alignment unit to generate a high-frequency sub-band. The second frequency component reconstruction residual block is the same as the first frequency component reconstruction residual block, and is also composed of four consecutive residual blocks. The expansion rates of the four consecutive residual blocks are 1, 2, 4, and 8, respectively, so as to increase the feature extraction of different scales and expand the receptive field;

[0115] The inverse wavelet transform unit is used to perform inverse wavelet transform on the high-frequency sub-band after the second frequency component reconstruction residual block is processed, so as to inversely transform the high-frequency sub-band into the original features, and send the original features to the tail convolution module through a jump connection for feature addition, so that the repaired image contains rich image details.

[0116] Embodiment 4:

[0117] Embodiment 4 optimizes the discriminator based on Embodiment 1, as follows:

[0118] The discriminator also includes a low-frequency discriminator, which is used to evaluate the low-frequency sub-band of the repaired image generated by the generator to assist the generator in training optimization. The low-frequency discriminator adopts the L1 loss function, which is a prior art and will not be elaborated here. By coordinating the low-frequency discriminator and the high-frequency discriminator, the inter-frequency conflict can be alleviated while generating the repaired image.

[0119] Application examples:

[0120] Datasets: The first and second datasets were obtained from publicly available datasets. The first dataset consists of more than 1.8 million natural images of 365 different scenes, from which 220,000 training images and 30,000 validation images were randomly selected. The second dataset is a collection of Paris night scene images, from which 14,900 training images and 100 validation images were randomly selected. During the experiment, the irregular masks provided by MAT were used for training. In order to simulate the damage in the actual situation and reflect the generalization of the proposed method, the irregular masks provided by MAT and the 12,000 masks included were used to perform random mask tests on the images. The sizes of all images and irregular masks were adjusted to 256×256 pixels.

[0121] Comparison method: The model in the present invention is compared with the existing EC, ICT, WaveFill, MAT, Coordfill, and ORFNe models;

[0122] Evaluation metrics: The following four widely adopted evaluation metrics are used for evaluation: (1) Peak signal-to-noise ratio (PSNR) is a widely used method to objectively measure image quality; (2) Structural similarity index (SSIM) uses factors such as brightness, contrast, and structure that are consistent with human perception to evaluate the similarity between images; (3) Mean absolute error (MAE) refers to the average absolute error between two values; (4) Learning perceptual image patch similarity (LPIPS) is a method to quantify the differences between images from a perceptual perspective, which can better reflect human perception and understanding of images;

[0123] Experimental details: The model proposed in this paper is implemented using the PyTorch framework and optimized by Adam. The learning rates of the generator and discriminator are set to 1e-4 and 4e-4 respectively. The batch size is set to 8 during training. The experimental hardware configuration of this article is a single Intel(R) Core i7-11700 CPU, NVIDIA GeForceRTX 3090 24GB GPU, the software environment is Windows 11, Pytorch v1.7.0, CUDA v11.0;

[0124] Quantitative evaluation:

[0125] This paper uses irregular masks to conduct extensive quantitative evaluation on the data, and uses EC, ICT, WaveFill, MAT, Coordfill and ORFNet for benchmarking on the validation images of the first and second datasets. The irregular masks in the experiment are classified based on the ratio of the mask area to the image size, and the performance of the comparison model is obtained by running publicly available pre-training methods.

[0126] The irregular mask experiment shows that the model structure of the present invention achieves good restoration effects under different mask ratios. As shown in Table 1, the effectiveness of the model structure of the present invention is largely attributed to the global understanding of the frequency component-based guidance and the bidirectional perception Transformer restoration bottleneck block to generate reasonable structures and textures for the missing area. Specifically, decomposing the frequency information in the wavelet domain helps to effectively alleviate the conflict of generating low-frequency and high-frequency content, and using frequency analysis to guide the network can achieve the alignment of high- and low-frequency information in different frequency bands, improving the image PSNR and SSIM restoration quality indicators. In addition, the bidirectional perception Transformer restoration bottleneck block allows the model to establish long-range dependencies, which helps the damaged image generate more reasonable semantic content with better perceptual quality.

[0127] Table 1 Performance quantitative evaluation table

[0128]

[0129] It should be noted that in Table 1 above, ↓ means the lower the better. ↑ means the higher the better;

[0130] Qualitative evaluation:

[0131] The drawings in the specification Figure 6 , Figure 7 The qualitative experimental results on the second data set and the first data set verification images are analyzed as follows:

[0132] like Figure 6 As shown:

[0133] When EC faces large-scale damage, the windowsills of buildings will appear blurred, and in the manually marked masks, the windows will appear blurred and deformed, such as Figure 6 (b);

[0134] ICT repairs damaged areas at the pixel level, but it cannot capture the global semantic structure well, such as Figure 6 As shown in (c), there are obvious semantically unreasonable parts in the damaged area;

[0135] The visualization results of WaveFill show that the details of its repair results are blurred, avoiding the generation of clear real textures. Figure 6 (d) as shown;

[0136] MAT exploits long-range context to reconstruct structure and texture, but Figure 6 (e) In the third and fourth rows, there are semantically unreasonable repair results, such as Figure 6 (e) as shown;

[0137] The result of Coordfill repair is reasonable, but the edges of the damaged area are still blurred, such as Figure 6 (f) as shown;

[0138] ORFNet can generate more reasonable global semantics from coarse to fine and then to global restoration, but the edges of the generated window sills and door frames are distorted and deformed, such as Figure 6 (g) as shown;

[0139] In contrast, the model structure proposed in this invention effectively generates images with reasonable semantics and realistic detail textures, improving the perceptual quality, such as Figure 6 (h) As shown in the second and fourth rows, the restored doors and windows have reasonable outlines and clear texture details.

[0140] like Figure 7 As shown:

[0141] When faced with damaged images with large-area masks, the restoration results of EC, WaveFill, and Coordfill obviously have unclear semantics, fuzzy grid patterns, and artifacts, resulting in unreasonable overall restoration results. Figure 7 As shown in the first and third rows;

[0142] Due to the lack of constraints on global structural information, ICT has unreasonable semantics when repairing details, such as Figure 7 (c) as shown in the fifth row;

[0143] Although MAT performs better in generating high-resolution inpainting results, it still has difficulty in generating textures that are smoothly integrated with the overall image context, such as Figure 7 (e) as shown;

[0144] ORFNet can generate semantic details of images well, such as Figure 7 (g) As shown in the fifth row, when facing large-area damage, the generated image will have blurred texture, such as Figure 7 (g) shown in the first and fourth rows;

[0145] In contrast, the model structure proposed in this invention combines the N-Gram bidirectional perception algorithm, which effectively expands the receptive field and can better learn global structural information. In addition, the frequency analysis network is used to provide rich details and perceptible information to obtain high-quality restoration results, such as Figure 7 (h) shown.

[0146] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters in the formula are set by technicians in this field according to actual conditions.

[0147] The above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination thereof. When implemented by software, the above embodiments may be implemented in whole or in part in the form of a computer program product. Those skilled in the art may appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein may be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed by hardware or software methods depends on the specific application and design constraints of the technical solution.

[0148] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, and may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0149] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.

Claims

1. An image restoration system integrating bidirectional perception Transformer and frequency analysis strategy, characterized by: The invention comprises a generator and a discriminator, wherein the generator comprises a head convolution module, a bidirectional perceptual Transformer repair bottleneck block, a frequency analysis guidance network and a tail convolution module, and the discriminator comprises an overall discriminator and a high-frequency discriminator, wherein: A head convolution module, wherein the head convolution module is used to perform multiple convolution downsampling on the input mask image and the mask of the image to be repaired to obtain multiple downsampled encoding features of different resolutions; A bidirectional perceptual Transformer bottleneck repair block, which is composed of a plurality of bidirectional perceptual Transformer models of different stages, and the resolution of the input features of the bidirectional perceptual Transformer models of adjacent stages is different. The bidirectional perceptual Transformer bottleneck repair block is used to process the down-sampled encoding features generated by the last convolution down-sampling, expand the receptive field, and provide rich contextual information, so as to generate self-consistent semantic content; A frequency analysis guidance network, wherein the frequency analysis guidance network is used to perform wavelet decomposition on the down-sampled coding features obtained by the head convolution module to obtain low-frequency components and high-frequency components, and then repair and reconstruct the low-frequency components and high-frequency components to form low-frequency sub-bands and high-frequency sub-bands, and send the low-frequency sub-bands to the head convolution module through a jump connection for feature addition to maintain the overall structure and contour of the image, and use wavelet inverse transformation to reconstruct the high-frequency sub-bands into original features; The tail convolution module is used to perform multiple convolution upsampling on the downsampled encoding features processed by the bidirectional perception Transformer repair bottleneck block to gradually restore the resolution of the image and generate a repaired image that matches the image to be repaired. The original features are sent to the tail convolution module through a skip connection for feature addition, so that the repaired image contains rich image details; An overall discriminator, which is used to evaluate the restored image generated by the generator to assist the generator in training optimization. The overall discriminator adopts an adversarial loss function; A high-frequency discriminator, which is used to evaluate the high-frequency subband of the restored image generated by the generator to assist the generator in training optimization, and the high-frequency discriminator adopts an adversarial loss function; The down-sampled encoding feature obtained after the i-th convolution down-sampling is calibrated as , i represents the number of different convolution downsampling, and i=1, 2, 3, ..., I, I represents the total number of convolution downsampling, and , and the downsampled encoding feature obtained after the i-th convolution downsampling The corresponding low-frequency subband is calibrated as , and the downsampled encoding feature obtained after the i-th convolution downsampling The corresponding high frequency subband is calibrated as , will be combined with the high frequency sub-band The corresponding original feature calibration is , the up-sampled encoding feature obtained after the j-th convolution up-sampling is calibrated as , j represents the number of different convolution upsampling, and j=1, 2, 3, ..., J, J represents the total number of convolution upsampling, and ; The head convolution module is composed of a first head convolution unit, a second head convolution unit and a third head convolution unit, and the first head convolution unit, the second head convolution unit and the third head convolution unit sequentially perform convolution down-sampling with a half resolution, and the tail convolution module is composed of a first tail convolution unit, a second tail convolution unit and a third tail convolution unit, and the first tail convolution unit, the second tail convolution unit and the third tail convolution unit sequentially perform convolution up-sampling with a doubled resolution; The frequency analysis guide network is used to downsample the encoding features obtained by the first convolution downsampling Perform wavelet decomposition to obtain low-frequency components and high-frequency components, and then repair and reconstruct the low-frequency components and high-frequency components to form the same down-sampling coding features. The corresponding low frequency subband and high frequency subband , the low frequency subband The second head convolution unit of the head convolution module is fed into the skip connection to encode the downsampled features. and low frequency subband Add and use it to downsample the encoding features obtained by the second convolution downsampling Perform wavelet decomposition to obtain low-frequency components and high-frequency components, and then repair and reconstruct the low-frequency components and high-frequency components to form the same down-sampling coding features. The corresponding low frequency subband and high frequency subband , the low frequency subband The data is fed into the third head convolution unit of the head convolution module through a skip connection to encode the downsampled features. and low frequency subband Perform addition; The frequency analysis guide network is used to transform the original features It is fed into the second tail convolution unit of the tail convolution module through a skip connection to encode the up-sampled features. and the original features Add and use to convert the original features It is fed into the first tail convolution unit of the tail convolution module through a skip connection to encode the upsampled features. and the original features Add.

2. The image restoration system integrating bidirectional perception Transformer and frequency analysis strategy according to claim 1 is characterized in that: The bidirectional perceptual Transformer repair bottleneck block includes: An input unit, wherein the input unit of the bidirectional perception Transformer model is used to receive input features; An N-Gram bidirectional perception algorithm unit, which is used to process input features to generate N-Gram contextual bidirectional information and add it to the partition window of the input features to expand the receptive field and provide rich contextual information; A cosine similarity calculation unit, wherein the cosine similarity calculation unit is used to calculate the attention weights between different elements in combination with the above partitioned windows; A first layer normalization unit, wherein the first layer normalization unit is used to normalize the data processed by the cosine similarity calculation unit so that the data are in the same scale range; A multi-layer perceptron, the multi-layer perceptron consisting of a fully connected layer activation function unit, a fully connected layer unit and a DUA unit connected in sequence, the fully connected layer activation function unit is used to process the data processed by the layer normalization first unit to activate the fully connected layer output encoding unit, and the DUA unit is used to process the encoding unit output by the fully connected layer to provide dense interaction and reduce the burden of self-attention interaction; The second layer normalization unit is used to perform normalization processing on the coding units processed by the DUA unit so that the coding units are in the same scale range.

3. The image restoration system integrating bidirectional perception Transformer and frequency analysis strategy according to claim 2 is characterized in that: The N-Gram bidirectional perception algorithm unit uses The channel reduction group convolution technique is used to process the input features of the bidirectional perception Transformer model to map the input features into features with reduced channel number and resolution, and the features contain multiple independent feature pixels. The scaled cosine window self-attention interaction technique is used to process the feature pixels to obtain the forward N-Gram window features, and the backward N-Gram window features are obtained by reversely applying the sequential reflection window filling technique. The forward N-Gram window features and the backward N-Gram window features are spliced, and 1×1 convolution is used to merge to generate N-Gram contextual bidirectional information, and the N-Gram contextual bidirectional information is added to the partitioned window of the input feature window by window, where N represents the considered context length; Among them, the input features of the bidirectional perception Transformer model in the nth stage are calibrated as ,and , n represents the number of different stages, and n=1, 2, 3, ..., X, X represents the total number of stages in the bidirectional perceptual Transformer repair bottleneck block, and , Represents the width, height and number of channels of the input features at the nth stage; Among them, will correspond to the input features The characteristic calibration is , the feature includes multiple feature pixels, namely uni-Gram, and , represents the number of windows of height, and , The number of windows representing the width, , Represents the convolution kernel size value of the bidirectional perception Transformer model window at the nth stage, by transforming the input feature Mapping to Features , to achieve the effect of reducing the number of channels and resolution; Among them, the forward N-Gram window feature, backward N-Gram window feature, and N-Gram context bidirectional information of the bidirectional perception Transformer model of the nth stage are calibrated as ,and ; Among them, the formula of scaled cosine window self-attention is as follows: In the above formula, are the query matrix, key matrix, and value matrix respectively, and , is the relative position deviation between each pixel in the local window, and , is a learnable scalar greater than 0.

01.

4. The image restoration system integrating bidirectional perception Transformer and frequency analysis strategy according to claim 2 is characterized in that: The method in which the DUA unit processes the coding unit output by the fully connected layer is as follows: Among them, the kth coding unit output by the fully connected layer is marked as , k represents the number of different coding units, and k=1, 2, 3, ..., M, M represents the total number of coding units, and ,pass The average value of M coding units is calculated, and then each coding unit is added to the average value to calculate the setting of the average value, so as to distribute the average value to each coding unit to provide dense interaction and reduce the burden of self-attention interaction.

5. The image restoration system integrating bidirectional perception Transformer and frequency analysis strategy according to claim 1 is characterized in that: The frequency analysis guidance network includes: A wavelet transform unit, wherein the wavelet transform unit of the frequency analysis guidance network is used to perform wavelet transform on the down-sampled coding features to obtain low-frequency components and high-frequency components; The first frequency component reconstruction residual block is used to repair and reconstruct the low-frequency component to generate a low-frequency sub-band, and the low-frequency sub-band is sent to the head convolution module through a jump connection for feature addition to maintain the overall structure and contour of the image, and the high-frequency sub-band is reconstructed into the original feature by using an inverse wavelet transform. The first frequency component reconstruction residual block consists of four consecutive residual blocks, and the expansion rates of the four consecutive residual blocks are 1, 2, 4, and 8, respectively, so as to increase feature extraction at different scales and expand the receptive field; A multi-frequency adaptive alignment unit, the multi-frequency adaptive alignment unit is used to calculate the attention score of the low-frequency component, aggregate the attention score to the high-frequency component to align the high-frequency component with the low-frequency component, and learn the aggregated output of the high-frequency component through a convolutional network to obtain fine-grained modulation parameters, use an adaptive instance normalization technology combined with spatial domain features to align the mean and variance of the spatial domain features and the high-frequency component, so as to guide the alignment of the spatial domain and the frequency domain, learn the spatial domain features through a convolutional layer to obtain coarse modulation parameters, perform weighted summation of the fine-grained modulation parameters and the coarse modulation parameters to obtain pixel-level fine-grained modulation parameters, and finally inject the pixel-level fine-grained modulation parameters into the low-frequency component to fully integrate the internal features and external features of the frequency domain and reduce the difficulty of generating high-frequency bands, the internal features of the frequency domain include high-frequency information and low-frequency information, and the external features are spatial domain features; A second frequency component reconstruction residual block, wherein the second frequency component reconstruction residual block is used to repair and reconstruct the data processed by the multi-frequency adaptive alignment unit to generate a high-frequency sub-band, and the second frequency component reconstruction residual block is composed of four consecutive residual blocks, and the expansion rates of the four consecutive residual blocks are 1, 2, 4, and 8, respectively, so as to increase feature extraction at different scales and expand the receptive field; The inverse wavelet transform unit is used to perform inverse wavelet transform on the high-frequency sub-band after the second frequency component reconstruction residual block is processed, so as to inversely transform the high-frequency sub-band into the original features, and send the original features to the tail convolution module through a jump connection for feature addition, so that the restored image contains rich image details.

6. The image restoration system integrating bidirectional perception Transformer and frequency analysis strategy according to claim 5 is characterized in that: The specific method of calculating the attention score of the low-frequency component and aggregating the attention score to the high-frequency component to align the high-frequency component with the low-frequency component is as follows: 1) Calibrate the low-frequency component in the input multi-frequency adaptive alignment unit as ,and , is the number of spatial positions, which is the height of the spatial position and width The product of , converts the low-frequency component into two feature spaces, key and query, and then calculates the attention score of the low-frequency component. The calculation formula is as follows: In the above formula, represents the value at the yth position in the key feature space, y represents the number of different positions in the key feature space, and y=1, 2, 3, ..., , represents the value at the zth position in the query feature space, z represents the number of different positions in the query feature space, and z=1, 2, 3, ..., , T is the preset scale parameter, Both are 1×1 convolutions, Represents the attention score corresponding to z, y; 2) Calibrate the high-frequency component in the input multi-frequency adaptive alignment unit as ,and , the high frequency components are passed through Mapped to the feature space of the low-frequency component, the high-frequency component The aggregate output at the yth position is calibrated as , The calculation formula is: In the above formula, is the conventional convolution transformation function.

7. The image restoration system integrating bidirectional perception Transformer and frequency analysis strategy according to claim 5 is characterized in that: The convolutional network for high-frequency component aggregation output learning is a four-layer convolutional network, and the fine-grained modulation parameters include a scaling parameter for scaling and the bias parameter for the bias In the middle two layers of the four-layer convolutional network, the adaptive instance normalization technique combined with spatial domain features is used to align the mean and variance of spatial domain features and high-frequency components. The spatial domain features are learned through a convolutional layer with a kernel of 3×3 to obtain coarse modulation parameters. The coarse modulation parameters include the scaling parameters used for scaling. and the bias parameter for the bias , pixel-level fine-grained modulation parameters include scaling parameters for scaling and the bias parameter for the bias , and its calculation formula is as follows: in, are all learnable weight parameters, and , the spatial domain features are input frequency analysis to guide the down-sampled encoding features in the network.