A Transformer-based twin network image denoising method, system, medium and device

By introducing the Transformer twin network into CNN, extracting salient features and combining it with the enhancement mechanism, the problem of high complexity of image denoising in the existing technology is solved, and efficient denoising in complex scenes is achieved.

CN114359109BActive Publication Date: 2024-09-10NORTHWESTERN POLYTECHNICAL UNIV
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202210032943.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-12
Publication Date
2024-09-10
Estimated Expiration
2042-01-12

AI Technical Summary

Technical Problem

Existing CNN relies on an end-to-end network structure in image denoising, resulting in high training complexity and difficulty in effectively handling noise problems in complex scenes.

Method used

Using a twin network based on Transformer, complementary salient features are extracted through two twin sub-networks, and the enhancement mechanism and residual operation are combined to efficiently denoise images, which is suitable for image denoising in complex scenes.

Benefits of technology

It improves the robustness of the denoiser and the memory capacity of the deep network, enhances the denoising performance, can adapt to feature extraction in different scenarios, and is especially suitable for noise removal in complex backgrounds.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114359109B
    Figure CN114359109B
Patent Text Reader

Abstract

The present invention discloses a twin network image denoising method, system, medium and device based on Transformer, and designs two twin networks to extract complementary features, so that the obtained denoiser is more robust. Transformer is applied to the twin network to extract significant features, separate the foreground and background, remove noise, and predict a clean image; a cross-interaction mechanism is designed to improve the memory capacity of the deep network and improve the denoising performance; batch normalization, layer normalization, instance normalization, Swish function and linear rectifier function activation function components are used in the twin network to improve the learning ability of the denoising network, which is conducive to extracting diversified features, enhancing the denoising effect and improving the denoising efficiency. In addition, denoising is performed only through a 12-layer network, which greatly reduces the computational cost of the network and meets the requirements of mobile devices. It can adaptively extract significant features according to different scenarios, has blind denoising function and strong practical application value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical fields of deep learning, image restoration and computer vision, and specifically relates to a Transformer-based twin network image denoising method, system, medium and device. Background Art

[0002] With the rapid development of today's information age, digital image devices have been widely used in many fields such as drone disaster rescue, face recognition, ocean exploration, etc. However, in the process of capturing images, they are often disturbed by jitter, noise, shooting environment, etc., which makes the collected images noisy. Therefore, image denoising technology has important practical application value.

[0003] Convolutional Neural Network (CNN) has been widely used in image denoising due to its strong learning ability. However, most CNNs only rely on end-to-end network structure to extract effective features and complete image denoising tasks, which increases the complexity of training the network. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a Transformer-based twin network image denoising method and system to address the deficiencies in the above-mentioned prior art, extract complementary information, make the extracted features more expressive, integrate the Transformer into the twin network, extract significant features, extract noise information from complex backgrounds, and efficiently complete the image denoising task, which is suitable for solving image denoising problems in complex scenes.

[0005] The present invention adopts the following technical solutions:

[0006] A Transformer-based twin network image denoising method, characterized in that a Transformer-based twin image denoising network is constructed, and the Transformer-based twin image denoising network includes two twin sub-networks; then the damaged image is input into the Transformer-based twin image denoising network; the saliency information of the damaged image is obtained through the Transformer modules corresponding to the two twin sub-networks; the saliency information of the damaged image and the output of the 10th layer of the two twin sub-networks are subjected to an enhancement mechanism to obtain two saliency features; then the two saliency features are fused through the enhancement mechanism, and then feature purification is performed through two convolutional layers to obtain processed noise features, and the processed noise features are removed from the damaged image using a residual operation to obtain a clean image.

[0007] Specifically, the structure of the twin sub-network is as follows:

[0008] The first layer consists of a convolutional layer, a layer normalization operation LN, and an activation function ReLU; the second layer consists of a convolutional layer and an activation function ReLU; the third layer consists of a convolutional layer, an instance normalization operation IN, and an activation function PReLU; the fourth layer is a single convolutional layer; the fifth, sixth, and seventh layers consist of Transformer modules; the eighth layer consists of a convolutional layer, a batch normalization operation BN, and an activation function Swish; the ninth layer consists of a convolutional layer and an activation function ReLU; the tenth layer consists of a single convolutional layer; the eleventh layer consists of a convolutional layer and an activation function ReLU; the twelfth layer consists of a single convolutional layer, and the two twin sub-networks share the eleventh and twelfth layers.

[0009] Furthermore, the layer normalization operation LN is expressed as follows:

[0010]

[0011]

[0012] Among them, μ is the average value, N is the number of nodes, a is the value before the activation function, and σ is the standard deviation;

[0013] The instance normalization operation IN is expressed as follows:

[0014]

[0015] Among them, y i Reconstruct the data, x i is the input value, σ 2 is the variance, ε is a very small positive value;

[0016] The batch normalization operation BN is expressed as follows:

[0017]

[0018] in, is the standardized feature, γ is the scaling parameter, and β is the offset parameter.

[0019] Furthermore, the activation function ReLU is:

[0020] φ(x)=max(0,x)

[0021] The activation function PReLU is:

[0022] f(x)=max(0,x)+amin(0,x)

[0023] The activation function Swish is:

[0024] f(x)=x·Sigmoid(βx)

[0025] Among them, β is a constant or a trainable parameter.

[0026] Specifically, the Transformer module is:

[0027] MultiHeadAttention(Q,K,V)=Concat(head 1 ,...,head h )W o

[0028] where head i =Attention(QW i Q ,KW i K ,VW i V )

[0029] Among them, MultiHeadAttention is a multi-head attention layer, Q, K, V are Query, Key and Value respectively, Concat(head 1 ,...,head h ) is to repeat the attention mechanism h times, and concatenate the results obtained each time after the Concat operation, W is the weight, and Attention is the attention layer.

[0030] Specifically, the encoder of the Transformer module is composed of three superimposed blocks, each of which contains a multi-head attention layer and a feedforward neural network layer. The residual mechanism in the encoder is: a residual operation is performed on the input and output of the multi-head attention layer and the output of the feedforward neural network layer; the decoder of the Transformer module is composed of three superimposed blocks, each of which contains a multi-head attention layer, an occluded multi-head attention layer and a feedforward neural network layer. The residual mechanism in the decoder is: a residual operation is performed on the input and output of the occluded multi-head attention layer, the output of the multi-head attention layer and the output of the feedforward neural network layer.

[0031] Specifically, the salient features of the damaged image are:

[0032] Through the residual learning operation, the features output by the 7th layer of the two twin sub-networks are added to obtain feature F1, and then the feature F1 is fused with the features output by the 10th layer of each twin sub-network through the residual learning operation to obtain features F2 and F3. Then, through residual learning, the features F2 and F3 are fused to obtain the salient features of the damaged image. The salient features of the damaged image are passed through the 11th and 12th layers shared by the two twin sub-networks to obtain the noise features of the damaged image. The clean image is obtained by performing a residual operation on the damaged image and the noise features of the damaged image.

[0033] Another technical solution of the present invention is a Transformer-based twin network image denoising system, comprising:

[0034] Twin image denoising network module, which builds a Transformer-based twin image denoising network. The Transformer-based twin image denoising network includes two twin sub-networks;

[0035] The saliency information extraction module inputs the damaged image into the Transformer-based twin image denoising network, and obtains the saliency information of the damaged image through the Transformer modules corresponding to the two twin sub-networks;

[0036] The enhancement module uses the saliency information of the damaged image and the output of the 10th layer of the two twin sub-networks through an enhancement mechanism to obtain two saliency features;

[0037] In the reconstruction module, the two significant features obtained are fused through an enhancement mechanism, and then the features are purified through two convolutional layers to obtain the processed noise features. The processed noise features are removed from the damaged image using the residual operation to obtain a clean image.

[0038] Another technical solution of the present invention is a computer-readable storage medium storing one or more programs, characterized in that the one or more programs include instructions, which, when executed by a computing device, enable the computing device to execute a Transformer-based twin network image denoising method.

[0039] Another technical solution of the present invention is a computing device, characterized in that it includes:

[0040] One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include instructions for executing a Transformer-based twin network image denoising method.

[0041] Compared with the prior art, the present invention has at least the following beneficial effects:

[0042] The present invention discloses a Transformer-based twin network image denoising method, which extracts complementary features (noise) through two twin networks, can denoise damaged images in complex scenes, and make the obtained denoiser more robust; by applying Transformer to the twin network, it extracts significant features, separates the foreground and background, removes noise, and predicts a clean image, so as to better cope with the masking of noise by complex image background; by designing an enhancement mechanism, it improves the memory capacity of the deep network, improves the denoising performance, and further extracts more robust structural features.

[0043] Furthermore, the twin sub-network can be used to extract complementary features (noise) to make the obtained denoiser more robust; using components such as BN, LN, IN, Swish function and ReLU activation function in the twin network can improve the learning ability of the denoising network, which is conducive to extracting diverse features, enhancing the denoising effect and improving the denoising efficiency to obtain noise of complex distribution types. Complementary features (noise) are extracted through two sub-networks with the same structure, and their respective parameters are obtained after training. After the enhancement mechanism, the weights are shared to make the obtained denoiser more robust.

[0044] Furthermore, BN can pull the distribution of input values ​​of any neuron in each layer of the neural network back to the standard normal distribution with a mean of 0 and a variance of 1, so that the activation input value falls in the area where the nonlinear function is more sensitive to the input, thereby increasing the gradient and avoiding gradient vanishing. At the same time, a larger gradient also means fast learning convergence, which can greatly speed up the convergence speed; IN can retain the original pixel regularity and perform normalization on small batches of images to prevent the loss of unique details of each sample due to BN normalization; LN can pull the data distribution to the non-saturated area of ​​the activation function, has the characteristics of weight scaling invariance, can alleviate the gradient vanishing and explosion problems, and accelerate the training effect.

[0045] Furthermore, the advantages of PReLU are that it will not overfit, the calculation is simple and effective, and the convergence is faster; the Swish activation function has the characteristics of no upper bound but lower bound, smoothness, and non-monotonicity, and can be regarded as a smooth function between the linear function and the ReLU function. The unboundedness helps prevent the gradient from gradually approaching 0 and causing saturation during slow training, and smoothness plays an important role in optimization and generalization.

[0046] Furthermore, the Transformer module is set up. The Transformer has a general modeling capability and can be regarded as a graph modeling method: the relationship between each node on the graph can be learned through a deep network, nodes can be used to represent any concept, and the edges between nodes can be used to represent the relationship between concepts. Due to this general modeling capability, the Transformer can be applied to image processing tasks, and can learn the relationship between pixels, between pixels and objects, and between objects; the Transformer can complement the convolutional neural network because convolution is a local operation that usually only models the relationship between adjacent pixels. The Transformer can perform global operations and model the relationship between all pixels, complementing the convolution layer.

[0047] Furthermore, the encoder mainly parses the object information. The encoder is essentially a series of convolutional networks, which are responsible for obtaining the local features of the image, that is, classifying and analyzing the low-level local pixel values ​​of the image to obtain high-order information.

[0048] Furthermore, the decoder maps the parsed information into the final image form; the decoder collects this high-order information, decodes the high-order information into pixel values ​​corresponding to the image, and fills the empty values ​​with appropriate feature values.

[0049] Furthermore, the operational saliency information is enhanced through the mechanism, and each of the two sub-networks obtains a saliency information, and the two saliency information are complementary. The final feature obtained by the enhancement mechanism of the two saliency information is the processed noise feature; the enhancement mechanism of interactive features can improve the memory capacity of the network, further extract more robust structural features, and improve the denoising performance.

[0050] Furthermore, 256*1*40*40 is the input batch size of 256. Setting it to 256 can speed up the training process. 1 represents the number of channels, 1 is a black and white image, and 3 is a color image. 40*40 is the size of the input image. Because the denoising network only processes the damaged image to obtain a clean image, it does not change the size of the image or the number of channels, so the output size is also 256*1*40*40. The convolution size is set to 3*3. Compared with larger convolutions, the number of network layers is increased, thereby increasing the nonlinear expression ability of the network; in addition, the parameters are reduced, reducing the model size.

[0051] In summary, the method of the present invention can adaptively extract significant features according to different scenarios, has a blind denoising function, and has strong practical application value.

[0052] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 It is a flow chart of the present invention;

[0054] Figure 2 This is the STDN network structure diagram;

[0055] Figure 3 It is the improved Transformer network structure;

[0056] Figure 4 For damaged images;

[0057] Figure 5 is the saliency information extracted by the twin network, where (a) is the saliency information obtained by one of the sub-networks, and (b) is the saliency information obtained by the other sub-network;

[0058] Figure 6 is the noise feature map after fusion;

[0059] Figure 7 Clean image predicted by STDN;

[0060] Figure 8 Schematic diagram of image denoising, where (a) is DnCNN, (b) is FFDNet, and (c) is IRCNN;

[0061] Fig. 9 Schematic diagram of local enlargement of a clean image, where (a) is STDN, (b) is DnCNN, (c) is FFDNet, and (d) is IRCNN. DETAILED DESCRIPTION

[0062] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0063] In the description of the present invention, it should be understood that the terms “include” and “comprises” indicate the presence of described features, wholes, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or collections thereof.

[0064] It should also be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0065] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0066] Various structural schematic diagrams of the embodiments disclosed in the present invention are shown in the accompanying drawings. These figures are not drawn to scale, and some details are magnified and some details may be omitted for the purpose of clear expression. The shapes of various regions and layers shown in the figures and the relative sizes and positional relationships therebetween are only exemplary, and may deviate in practice due to manufacturing tolerances or technical limitations, and those skilled in the art may additionally design regions / layers with different shapes, sizes, and relative positions according to actual needs.

[0067] The present invention provides a Transformer-based twin network image denoising method. Unlike deep denoising networks that are only effective for images in specific scenes, the Transformer-based denoising method and system proposed in the present invention can denoise damaged images in complex scenes. The present invention designs two twin networks to extract complementary features (noise) to make the obtained denoiser more robust. In order to better cope with the masking of noise by complex image background, the present invention applies Transformer to the twin network, extracts significant features, separates the foreground and background, removes noise, and predicts a clean image; in order to further extract more robust structural features, the present invention designs a cross-interaction mechanism to improve the memory capacity of the deep network and improve the denoising performance; in order to obtain noise of complex distribution types, the present invention uses components such as batch normalization (BN), layer normalization (LN), instance normalization (IN), Swish function and linear rectified linear unit (ReLU) activation function in the twin network to improve the learning ability of the denoising network, which is conducive to extracting diversified features, enhancing the denoising effect and improving the denoising efficiency. In addition, the present invention only uses a 12-layer twin image denoising network based on Transformer for denoising, which greatly reduces the computational cost of the network and meets the requirements of mobile devices. The method of the present invention can adaptively extract significant features according to different scenarios, so that it has a blind denoising function and has a strong practical application value.

[0068] See also Figure 1 The present invention provides a Transformer-based twin network image denoising method, comprising the following steps:

[0069] S1. The damaged image is used as the input of the Transformer-based Siamese Transformer Denoising Network (STDN).

[0070] See also Figure 2 ,The STDN network consists of two 12-layer twin sub-networks with the same structure, which can extract complementary information of noise. The two twin sub-networks share the 11th and 12th layers.

[0071] The specific structure of the 12-layer STDN network is as follows:

[0072] The first layer consists of a convolutional layer, LN, and activation function ReLU;

[0073] The second layer consists of a convolutional layer and an activation function ReLU;

[0074] The third layer consists of a convolutional layer, IN, and an activation function PReLU;

[0075] The 4th layer is a single convolutional layer;

[0076] Layers 5 to 7 consist of improved Transformer modules;

[0077] The 8th layer consists of a convolutional layer, BN, and activation function Swish;

[0078] The 9th layer consists of a convolutional layer and an activation function ReLU;

[0079] The 10th layer consists of a single convolutional layer;

[0080] The 11th layer consists of a convolutional layer and an activation function ReLU;

[0081] The 12th layer consists of a single convolutional layer.

[0082] The input size of the STDN network is 256×1×40×40, the output size of the STDN network is 256×1×40×40, and the convolution size is 3×3, where 256×1×40×40 represents a batch size of 256, an output channel of 1, and a width and height of 40.

[0083] The specific formula of the Transformer part is as follows:

[0084]

[0085] FFN(x)=Relu(xW 1 +b 1 )W 2 +b 2 (2)

[0086] H(x)=F(x)+x (3)

[0087] Formula (1) is the expression of Multi-Head Attention, where Q represents Query, K represents Key, V represents Value, and W represents weight; Formula (2) is the expression of the Feed Forward layer, and Formula (3) is the expression of the residual connection operation.

[0088] In order to speed up the convergence speed of the twin image denoising network based on the Transformer module during training, the present invention adds LN, IN, BN, Swish, and PReLU components, which are specifically expressed as follows:

[0089] The layer normalization operation LN is expressed as follows:

[0090]

[0091]

[0092] Among them, μ is the mean value, N represents the number of nodes, σ is the standard deviation, and a represents the value before the activation function, that is, a=w×x.

[0093] The instance normalization operation IN is expressed as follows:

[0094]

[0095]

[0096]

[0097] Among them, y i Reconstruct the data, x i is the input value, σ 2 is the variance, l is x i The column where m is x i The row where ε is located is a very small positive value (to avoid invalid calculations caused by a variance of 0), H is the height, and W is the width.

[0098] The batch normalization operation BN is expressed as follows:

[0099]

[0100]

[0101]

[0102]

[0103] Among them, μ β For x i The average value of is the variance, ζ is a very small positive value (to avoid invalidation of calculation due to variance of 0), is the standardized feature, γ is the scaling parameter, and β is the offset parameter.

[0104] The activation function ReLU is used to convert linear data into nonlinear data. The specific expression is:

[0105] φ(x)=max(0,x)

[0106] The activation function PReLU is:

[0107] f(x)=max(0,x)+amin(0,x)

[0108] The activation function Swish is expressed as:

[0109] f(x)=x·Sigmoid(βx)

[0110] Among them, β is a constant or a trainable parameter; the Swish activation function has the characteristics of no upper bound but lower bound, smoothness, and non-monotonicity, and is regarded as a smooth function between the linear function and the ReLU function.

[0111] S2, input the damaged image into the Transformer-based twin image denoising network, and obtain the saliency information of the damaged image through the Transformer modules corresponding to the two twin sub-networks;

[0112] The Transformer module is an encoder-decoder structure.

[0113] The encoder mainly parses the object information, and the decoder converts the parsed information into the final image form.

[0114] The encoder is essentially a series of convolutional networks, which are responsible for obtaining the local features of the image, that is, classifying and analyzing the low-level local pixel values ​​of the image to obtain high-level information.

[0115] The decoder collects this high-order information, decodes it into pixel values ​​corresponding to the image, and fills the empty values ​​with appropriate feature values.

[0116] Through the encoding-decoding process, feature information is extracted from the input information as saliency information.

[0117] The improved Transformer extracts salient features to cope with the masking of noise by complex image background, separates the foreground and background of the damaged image, removes noise, and obtains a clean image.

[0118] See also Figure 3 The improved Transformer is an encoder-decoder model. The Encoder of the traditional Transformer consists of 6 blocks with the same structure, but they do not share weights. Each Block contains two sub-layers, namely the Multi-Head Attention layer and the Feed Forward neural network layer.

[0119] The Decoder is also composed of 6 superimposed blocks with the same structure and does not share weights. In addition to the two layers mentioned above, each Block also has a Masked Multi-Head Attention layer to help the Decoder focus on the relevant parts of the Encoder input.

[0120] Based on the original Transformer, the present invention changes the original 6 blocks to 3 and improves the residual mechanism, specifically:

[0121] The residual mechanism in the Encoder is to perform a residual operation on the input and output of the Multi-Head Attention layer and the output of the FeedForward layer;

[0122] The residual mechanism in the Decoder is to perform a residual operation on the input and output of the Masked Multi-Head Attention layer, the output of the Multi-Head Attention layer, and the output of the Feed Forward layer; this greatly reduces the computational cost while retaining efficiency to the greatest extent.

[0123] S3, the saliency information of the damaged image and the output of the 10th layer of the two twin sub-networks are enhanced to obtain saliency features;

[0124] See also Figure 2 , extracting significant features includes three stages:

[0125] In the first stage, the saliency information output by the 7th layer of the two twin networks is subjected to residual learning (addition) to obtain feature F1;

[0126] In the second stage, the feature F1 obtained in the first stage is fused with the 10th layer output of each twin network through residual learning (addition) to obtain features F2 and F3;

[0127] In the third stage, the features F2 and F3 obtained in the second stage are fused through residual learning (addition) to obtain the salient features of the damaged image.

[0128] The two twin networks improve the network's memory capacity through the augmented mechanism.

[0129] S4. Input the salient features into the Transformer-based twin image denoising network to obtain the noise features. Finally, perform a residual operation (subtraction) on the damaged image and the obtained noise features to obtain a clean image.

[0130] The obtained salient features are passed through the 11th and 12th layers of the twin image denoising network based on the Transformer module to obtain the noise features, and the damaged image is subtracted from the obtained noise features to obtain a clean image.

[0131] In addition to being able to process blind noise, the present invention can also process fixed Gaussian noise and real noise, and is particularly effective for blind noise.

[0132] In another embodiment of the present invention, a Transformer-based twin network image denoising system is provided, which can be used to implement the above-mentioned Transformer-based twin network image denoising method. Specifically, the Transformer-based twin network image denoising system includes a twin image denoising network module, a saliency information extraction module, an enhancement module and a reconstruction module.

[0133] Among them, the twin image denoising network module builds a Transformer-based twin image denoising network. The Transformer-based twin image denoising network includes two twin sub-networks;

[0134] The saliency information extraction module inputs the damaged image into the Transformer-based twin image denoising network, and obtains the saliency information of the damaged image through the Transformer modules corresponding to the two twin sub-networks;

[0135] The enhancement module uses the saliency information of the damaged image and the output of the 10th layer of the two twin sub-networks through an enhancement mechanism to obtain two saliency features;

[0136] The reconstruction module fuses the two obtained significant features through an enhancement mechanism to obtain the processed noise features, and uses the residual operation to remove the processed noise features from the damaged image to obtain a clean image.

[0137] In another embodiment of the present invention, a terminal device is provided, which includes a processor and a memory, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is used to execute the program instructions stored in the computer storage medium. The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, which is suitable for implementing one or more instructions, and is specifically suitable for loading and executing one or more instructions to implement the corresponding method flow or corresponding function; the processor described in the embodiment of the present invention can be used for the operation of the twin network image denoising method based on Transformer, including:

[0138] A Transformer-based twin image denoising network is constructed, which includes two twin sub-networks. The damaged image is then input into the Transformer-based twin image denoising network. The saliency information of the damaged image is obtained through the Transformer modules corresponding to the two twin sub-networks. The obtained saliency information and the output of the 10th layer of the two twin sub-networks are subjected to an enhancement mechanism to obtain two saliency features. Subsequently, the two saliency features are fused through the enhancement mechanism and then subjected to feature purification through two convolutional layers to obtain the processed noise features. The processed noise features are removed from the damaged image using the residual operation to obtain a clean image.

[0139] In another embodiment of the present invention, the present invention further provides a storage medium, specifically a computer-readable storage medium (Memory), which is a memory device in a terminal device for storing programs and data. It can be understood that the computer-readable storage medium here can include both the built-in storage medium in the terminal device and the extended storage medium supported by the terminal device. The computer-readable storage medium provides a storage space, which stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by the processor are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk storage.

[0140] One or more instructions stored in a computer-readable storage medium may be loaded and executed by a processor to implement the corresponding steps of the Transformer-based twin network image denoising method in the above embodiment; one or more instructions in the computer-readable storage medium are loaded and executed by the processor as follows:

[0141] A Transformer-based twin image denoising network is constructed, which includes two twin sub-networks. The damaged image is then input into the Transformer-based twin image denoising network. The saliency information of the damaged image is obtained through the Transformer modules corresponding to the two twin sub-networks. The saliency information of the damaged image and the output of the 10th layer of the two twin sub-networks are subjected to an enhancement mechanism to obtain two saliency features. The two saliency features obtained are fused through the enhancement mechanism and then subjected to feature purification through two convolutional layers to obtain the processed noise features. The processed noise features are removed from the damaged image using the residual operation to obtain a clean image.

[0142] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. The components of the embodiments of the present invention described and shown in the drawings here can usually be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0143] The present invention proposes a twin image denoising network method based on Transformer, which can denoise damaged images in complex scenes. Considering that the images captured in complex scenes are highly damaged, the present invention proposes a twin image denoising network to extract complementary information and make the extracted features more expressive. The present invention integrates Transformer into CNN to extract significant features, separates the foreground and background of the image, curbs noise, and speeds up network training efficiency. The present invention also designs an enhancement mechanism to extract more robust structural features. In addition, considering the uneven distribution of data during training, the present invention integrates multiple normalization methods into CNN to unify the distribution of data and improve denoising performance. The present invention achieves good performance in denoising real noise images and blind noise images.

[0144] The present invention takes the damaged image with Gaussian noise level 25 as an example. Figure 4 The damaged image needs to be processed.

[0145] First, the damaged image is used as the input of the STDN network. The input image will be extracted through two twin networks to extract complementary information. The two twin networks extract salient information through two Transformers and visualize it, as shown in the figure below. Figure 5 (a) Figure 5 (b) shows the saliency information obtained by the two twin networks. It can be seen that although the structures of the two twin networks are the same, two different saliency information are obtained. This shows that the two twin networks pay attention to different feature information in the image. Therefore, by fusing these two saliency information, complementary information can be obtained, which is more robust.

[0146] Then, through the augmented mechanism, the features obtained by the two sub-networks are fused, and the visual features are as follows: Figure 6As shown in the figure, it can be seen that the noise features are finally obtained through the neural network. Finally, it is only necessary to subtract the noise features from the initial damaged image to obtain the predicted clean image. Figure 7 As shown in the figure, the clean image finally obtained by the present invention is partially enlarged with the clean images obtained by other methods as shown below, and it can be seen that the clean image obtained by the present invention is Figure 7 Better performance.

[0147] At the same time, several other classic image denoising methods (DnCNN, FFDNet, IRCNN) were used to obtain the following Figure 8 (a) Figure 8 (b) Figure 8 (c) shows the clean image for comparison. After zooming in, it can be clearly seen that the clean image predicted by STDN is as follows: Fig. 9 As shown in (a), it has relatively good performance. Fig. 9 (b) Fig. 9 (c) Fig. 9 (d) Local enlargement of the clean image predicted by other classic methods.

[0148] The present invention first designs two complementary twin networks, thereby obtaining a highly robust denoiser with good feature extraction capabilities in different scenarios; secondly, by applying Transformer to the twin network, significant features are extracted to separate the foreground and background in images in complex scenes, which can effectively reduce the masking effect of the image background on the noise, and noise can be extracted efficiently in different scenarios; finally, the present invention improves the learning ability of the denoising network through multiple components, and can extract diversified structural features, so as to achieve the purpose of adaptively extracting features in different scenarios.

[0149] In summary, the Transformer-based twin network image denoising method, system, medium and device of the present invention can better denoise damaged images in complex scenes, achieve advanced denoising levels, and are particularly effective for blind denoising, and therefore have strong practical application value.

[0150] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0151] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0152] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0153] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0154] The above contents are only for explaining the technical idea of ​​the present invention and cannot be used to limit the protection scope of the present invention. Any changes made on the basis of the technical solution in accordance with the technical idea proposed by the present invention shall fall within the protection scope of the claims of the present invention.

Claims

1. A Siamese network image denoising method based on Transformer, It is characterized in that A Transformer-based twin image denoising network is constructed. The Transformer-based twin image denoising network includes two twin sub-networks. Then the damaged image is input into the Transformer-based twin image denoising network. The saliency information of the damaged image is obtained through the Transformer modules corresponding to the two twin sub-networks. The saliency information of the damaged image and the output of the 10th layer of the two twin sub-networks are enhanced to obtain two saliency features. The two significant features are then fused through an enhancement mechanism, and then purified through two convolutional layers to obtain the processed noise features. The processed noise features are removed from the damaged image using a residual operation to obtain a clean image. The twin sub-network structure is as follows: The first layer consists of a convolutional layer, a layer normalization operation LN, and an activation function ReLU; the second layer consists of a convolutional layer and an activation function ReLU; the third layer consists of a convolutional layer, an instance normalization operation IN, and an activation function PReLU; the fourth layer is a single convolutional layer; the fifth, sixth, and seventh layers consist of Transformer modules; the eighth layer consists of a convolutional layer, a batch normalization operation BN, and an activation function Swish; the ninth layer consists of a convolutional layer and an activation function ReLU; the tenth layer consists of a single convolutional layer; the eleventh layer consists of a convolutional layer and an activation function ReLU; the twelfth layer consists of a single convolutional layer, and the two twin sub-networks share the eleventh and twelfth layers; The encoder of the Transformer module is composed of three superimposed blocks. Each block contains a multi-head attention layer and a feedforward neural network layer. The residual mechanism in the encoder is to perform a residual operation on the input and output of the multi-head attention layer and the output of the feedforward neural network layer. The decoder of the Transformer module is composed of three superimposed blocks. Each block contains a multi-head attention layer, an occluded multi-head attention layer, and a feedforward neural network layer. The residual mechanism in the decoder is to perform a residual operation on the input and output of the occluded multi-head attention layer, the output of the multi-head attention layer, and the output of the feedforward neural network layer. The salient features of the damaged image are: Through the residual learning operation, the features output by the 7th layer of the two twin sub-networks are added to obtain feature F1, and then the feature F1 is fused with the features output by the 10th layer of each twin sub-network through the residual learning operation to obtain features F2 and F3. Then, through residual learning, the features F2 and F3 are fused to obtain the salient features of the damaged image. The salient features of the damaged image are passed through the 11th and 12th layers shared by the two twin sub-networks to obtain the noise features of the damaged image. The clean image is obtained by performing a residual operation on the damaged image and the noise features of the damaged image.

2. According to claim 1, the Transformer-based twin network image denoising method, It is characterized in that The layer normalization operation LN is expressed as follows: Among them, μ is the average value, N is the number of nodes, a is the value before the activation function, and σ is the standard deviation; The instance normalization operation IN is expressed as follows: Among them, y i Reconstruct the data, x i is the input value, σ 2 is the variance, ε is a very small positive value; The batch normalization operation BN is expressed as follows: in, is the standardized feature, γ is the scaling parameter, and β is the offset parameter.

3. The Transformer-based twin network image denoising method according to claim 1, It is characterized in that The activation function ReLU is: φ(x)=max(0,x) The activation function PReLU is: f(x)=max(0,x)+amin(0,x) The activation function Swish is: f(x)=x·Sigmoid(βx) Among them, β is a constant or a trainable parameter.

4. The Transformer-based twin network image denoising method according to claim 1, It is characterized in that The Transformer module is as follows: MultiHeadAttention(Q,K,V)=Concat(head 1 ,...,head h )W o where head i =Attention(QW i Q ,KW i K ,VW i V ) Among them, MultiHeadAttention is a multi-head attention layer, Q, K, V are Query, Key and Value respectively, Concat(head 1 ,...,head h ) is to repeat the attention mechanism h times, and concatenate the results obtained each time after the Concat operation, W is the weight, and Attention is the attention layer.

5. A Transformer-based twin network image denoising system, It is characterized in that include: The twin image denoising network module builds a Transformer-based twin image denoising network. The Transformer-based twin image denoising network includes two twin sub-networks; the twin sub-network structure is as follows: The first layer consists of a convolutional layer, a layer normalization operation LN, and an activation function ReLU; the second layer consists of a convolutional layer and an activation function ReLU; the third layer consists of a convolutional layer, an instance normalization operation IN, and an activation function PReLU; the fourth layer is a single convolutional layer; the fifth, sixth, and seventh layers consist of Transformer modules; the eighth layer consists of a convolutional layer, a batch normalization operation BN, and an activation function Swish; the ninth layer consists of a convolutional layer and an activation function ReLU; the tenth layer consists of a single convolutional layer; the eleventh layer consists of a convolutional layer and an activation function ReLU; the twelfth layer consists of a single convolutional layer, and the two twin sub-networks share the eleventh and twelfth layers; The saliency information extraction module inputs the damaged image into the Transformer-based twin image denoising network, and obtains the saliency information of the damaged image through the Transformer modules corresponding to the two twin sub-networks; The encoder of the Transformer module is composed of three superimposed blocks. Each block contains a multi-head attention layer and a feedforward neural network layer. The residual mechanism in the encoder is to perform a residual operation on the input and output of the multi-head attention layer and the output of the feedforward neural network layer. The decoder of the Transformer module is composed of three superimposed blocks. Each block contains a multi-head attention layer, an occluded multi-head attention layer, and a feedforward neural network layer. The residual mechanism in the decoder is to perform a residual operation on the input and output of the occluded multi-head attention layer, the output of the multi-head attention layer, and the output of the feedforward neural network layer. The enhancement module uses the saliency information of the damaged image and the output of the 10th layer of the two twin sub-networks through an enhancement mechanism to obtain two saliency features; The salient features of the damaged image are: The features outputted by the 7th layer of the two twin networks are added together through the residual learning operation to obtain the feature F1, and then the feature F1 is fused with the features outputted by the 10th layer of each twin network through the residual learning operation to obtain the features F2 and F3, and then the features F2 and F3 are fused through the residual learning to obtain the salient features of the damaged image, and the noise features of the damaged image are obtained after the salient features of the damaged image pass through the 11th and 12th layers shared by the two twin networks, and the clean image is obtained by performing the residual operation on the damaged image and the noise features of the damaged image; In the reconstruction module, the two significant features obtained are fused through an enhancement mechanism, and then the features are purified through two convolutional layers to obtain the processed noise features. The processed noise features are removed from the damaged image using the residual operation to obtain a clean image.

6. A computer-readable storage medium storing one or more programs, It is characterized in that The one or more programs include instructions which, when executed by a computing device, cause the computing device to perform any one of the methods according to claims 1 to 4.

7. A computing device, It is characterized in that include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include instructions for executing any one of the methods according to claims 1 to 4.

Citation Information

Patent Citations

  • Video blind denoising method and device based on deep learning

    CN111539879A

  • Two-view twin Transformer ultrasonic or CT image cross-modal three-dimensional reconstruction method

    CN113689546A

  • SAR image denoising method based on wavelet transform and generative adversarial network

    CN113808042A

  • System for processing images

    US20180158177A1