Image editing method, image editing model training method, equipment and device

By obtaining different dimensional encoding features and attribute labels of the target image to generate bidirectional information, combined with the image editing performance, the problem of low image editing performance in the existing technology is solved, and more efficient attribute editing and image quality improvement are achieved.

CN114494526BActive Publication Date: 2024-10-22ZHEJIANG DAHUA TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202111522701.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-13
Publication Date
2024-10-22
Estimated Expiration
2041-12-13

AI Technical Summary

Technical Problem

The attribute editing method of existing image editing technology results in low image editing performance, making it difficult to effectively improve the attribute editing capabilities of images.

Method used

By obtaining multiple coding features of different dimensions of the target image, using coding features and attribute labels to generate bidirectional information, including forward information sequences and reverse information sequences, decoding is performed based on multiple coding features and bidirectional information to generate edited target edits Image, combining detailed information and semantic information of attributes to improve image editing performance.

Benefits of technology

It significantly improves image attribute reshaping and attribute editing capabilities, improves image editing performance, and can more clearly depict character attribute details and eliminate random noise, which is better than other image editing methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114494526B_ABST
    Figure CN114494526B_ABST
Patent Text Reader

Abstract

The present application discloses an image editing method, a training method, a device and an apparatus for an image editing model. The method includes: obtaining multiple coding features of different dimensions of a target image, the target image includes an attribute label; generating bidirectional information using the coding features and the attribute label; wherein the bidirectional information includes a forward information sequence and a reverse information sequence, the forward information sequence is generated using the coding features and the attribute label in the first dimension order, the reverse information sequence is generated using the coding features and the attribute label in the second dimension order, one of the first dimension order and the second dimension order is from high dimension to low dimension, and the other is from low dimension to high dimension; decoding is performed based on multiple coding features and bidirectional information to obtain an edited target editing image. The above scheme can improve image editing performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to an image editing method, an image editing model training method, a computer device, and a storage device. Background Art

[0002] With the development of computer technology, the application scenarios of image editing technology are becoming more and more extensive. For example, many application software of terminal devices have image editing functions. Usually, a large number of image editing functions are integrated on terminal devices. Users can edit different attributes of images through different image editing functions, thereby achieving the effect of attribute editing of images. However, the current attribute editing method of images will reduce the attribute editing capability, resulting in low image editing performance. Summary of the invention

[0003] The main technical problem solved by the present application is to provide an image editing method, a training method, equipment and device for an image editing model, which can improve image editing performance.

[0004] In order to solve the above problems, the first aspect of the present application provides an image editing method, which includes: obtaining multiple coding features of different dimensions of a target image, the target image including attribute labels; generating bidirectional information using the coding features and attribute labels; wherein the bidirectional information includes a forward information sequence and a reverse information sequence, the forward information sequence is generated using the coding features and attribute labels in a first dimensional order, and the reverse information sequence is generated using the coding features and attribute labels in a second dimensional order, one of the first dimensional order and the second dimensional order is from high dimension to low dimension, and the other is from low dimension to high dimension; decoding is performed based on multiple coding features and the bidirectional information to obtain an edited target edited image.

[0005] In order to solve the above-mentioned problem, the second aspect of the present application provides a training method for an image editing model, the method comprising: using a generator to execute the above-mentioned image editing method to process the original image, and obtaining an edited target edited image as a training sample image; inputting the training sample image into a discriminator to obtain a discrimination result, wherein the discrimination result includes true discrimination information and attribute information, the true discrimination information represents the authenticity of the training sample image, and the attribute information represents at least one of the attribute classification and attribute estimation value of the training sample image; using the discrimination result, adjusting the parameters in the generator.

[0006] In order to solve the above problem, the third aspect of the present application provides a computer device, which includes a memory and a processor coupled to each other, the memory stores program data, and the processor is used to execute the program data to implement any step of the above image editing method.

[0007] In order to solve the above-mentioned problem, the fourth aspect of the present application provides a storage device, which stores program data that can be executed by a processor, and the program data is used to implement any step of the above-mentioned image editing method.

[0008] The above scheme obtains multiple coding features of different dimensions of the target image, and generates bidirectional information using the coding features and attribute labels. The bidirectional information includes a forward information sequence and a reverse information sequence. The forward information sequence is generated using the coding features and attribute labels in the order of the first dimension, and the reverse information sequence is generated using the coding features and attribute labels in the order of the second dimension. Decoding is performed based on the coding features and the bidirectional information to obtain an edited target edited image. Since the bidirectional information is generated using coding features from high dimension to low dimension and from low dimension to high dimension and attribute labels respectively, the bidirectional information combines the detailed information of the attributes and the semantic information of the attributes as a whole. Combining the above two can improve the attribute reshaping and attribute editing capabilities of the image, thereby improving the image editing performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] In order to more clearly illustrate the technical solutions in this application, the following briefly introduces the drawings required in the description of the embodiments. Obviously, the drawings described below are only some embodiments of this application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them:

[0010] Figure 1 It is a flowchart of an embodiment of the image editing method of the present application;

[0011] Figure 2 This application Figure 1 A schematic diagram of a flow chart of an embodiment of step S11;

[0012] Figure 3 This application Figure 1 A schematic diagram of another embodiment of step S11;

[0013] Figure 4 This application Figure 1 A schematic diagram of a flow chart of an embodiment of step S12;

[0014] Figure 5 This application Figure 4 A schematic diagram of a flow chart of an embodiment of step S121;

[0015] Figure 6 This application Figure 4 A flow chart of an embodiment of step S122;

[0016] Figure 7 This application Figure 1A schematic diagram of a flow chart of an embodiment of step S13;

[0017] Figure 8 It is a flowchart of an embodiment of a training method for an image editing model of the present application;

[0018] Fig. 9 It is a structural diagram of an embodiment of the image training model of the present application;

[0019] Fig.10 is a schematic diagram of an embodiment of an original image input in the present application;

[0020] Fig.11 is an evaluation comparison table of the image editing method of the present application and another image editing method in one embodiment;

[0021] Fig.12 is a schematic diagram of an embodiment of a face editing image of the STGAN method;

[0022] Fig.13 is a schematic diagram of an embodiment of a face editing image of the image editing method of the present application;

[0023] Fig.14 It is a structural schematic diagram of an embodiment of the image editing device of the present application;

[0024] Fig.15 It is a structural schematic diagram of an embodiment of a computer device of the present application;

[0025] Fig.16 It is a structural diagram of an embodiment of a storage device of the present application. DETAILED DESCRIPTION

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

[0027] The terms "first" and "second" in this application are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first" and "second" can explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "multiple" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices.

[0028] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0029] The present application provides the following embodiments, and each embodiment is described in detail below.

[0030] See also Figure 1 , Figure 1 This is a flow chart of an embodiment of the image editing method of the present application. The method may include the following steps:

[0031] S11: Obtain multiple encoding features of different dimensions of a target image, where the target image includes an attribute label.

[0032] Image editing refers to the process of changing an image, which can include digital photos, traditional analog photos, illustrations, etc. During the image editing process, one or more attributes can be edited to achieve the desired image editing effect.

[0033] In some embodiments, an image to be edited may be used as a target image, thereby extracting coding features of at least two different dimensions of the target image, wherein the coding features of different dimensions have different sizes, for example, coding features of a size of 4×4, coding features of a size of 8×8, ..., coding features of a size of 128×128, etc. have different dimensions.

[0034] In some embodiments, the target image may be encoded by an encoder to obtain multiple encoding features of different dimensions of the target image. The multiple encoding features of different dimensions may include encoding features of a size of 4×4, encoding features of a size of 8×8, ..., encoding features of a size of 128×128, etc.

[0035] In some embodiments, the target image may include an attribute tag, which is a tag included in the target image itself and may indicate the attribute of the target image. The attribute tag may be a certain editable attribute of the image, so that the attribute tag is used as an attribute that needs to be edited. For example, when editing a face image, various face attributes may be edited for the face image, and the face attributes may include attributes such as glasses, hair color, hairstyle, dress, stubble, age, etc.

[0036] In some embodiments, the attribute tag can be represented in a manner similar to Label. For example, if the face in the target image wears glasses and has the attribute of "glasses", the flag bit corresponding to the attribute of "glasses" can be marked, and the flag bit of the attribute of "glasses" can be recorded as "1" to indicate that the target image has the attribute of "glasses". If the target image does not have the attribute of "glasses", the flag bit of the attribute of "glasses" can be recorded as "0" to indicate that the target image does not have the attribute of "glasses". Editing the attributes of a face can change various attributes of the face so that different attributes can be presented.

[0037] S12: Generate bidirectional information using multiple coding features and attribute tags, wherein the bidirectional information includes a forward information sequence and a reverse information sequence.

[0038] The forward information sequence is generated using the encoding features and attribute labels of the first dimension order, and the reverse information sequence is generated using the encoding features and attribute labels of the second dimension order. One of the first dimension order and the second dimension order is from high dimension to low dimension, and the other is from low dimension to high dimension.

[0039] In some implementations, multiple encoding features and attribute labels may be used to perform convolution or other processing to generate bidirectional information.

[0040] In some embodiments, the bidirectional information is obtained by processing multiple coding features and attribute labels using a bidirectional model. Specifically, the bidirectional model can be used to process multiple coding features and attribute labels in the first dimension sequence to obtain a forward information sequence, and multiple coding features and attribute labels in the second dimension sequence can be processed to obtain a reverse information sequence.

[0041] In some embodiments, the first dimension order may be from low dimension to high dimension, and the second dimension order may be from high dimension to low dimension. In addition, the first dimension order may also be from high dimension to low dimension, and the second dimension order may be from low dimension to high dimension. Among them, the forward information sequence and the reverse information sequence generated by the coding features of the first dimension order, the coding features of the second dimension and the attribute label are also relative, and this application does not limit this.

[0042] In some embodiments, the first dimension is the lowest dimension, for example, the first dimension, i.e., the lowest dimension, is a coded feature of size 128×128, and the first dimension is ordered from low dimension to high dimension. The second dimension is the highest dimension, for example, the highest dimension coded feature is a coded feature of size 4×4, and the second dimension is ordered from high dimension to low dimension. This application uses this as an example to illustrate the embodiment.

[0043] In some embodiments, the coding features and attribute labels of the first dimension (lowest dimension) can be connected and first input into the bidirectional model to generate a series of hidden states (hidden states in the direction from low dimension to high dimension, each hidden state is the forward information corresponding to the coding features of each dimension), which can be called a forward information sequence. The coding features and attribute labels of the second dimension (highest dimension) are connected and first input into the bidirectional model to generate a series of hidden states (hidden states in the direction from high dimension to low dimension, each hidden state is the reverse information corresponding to the coding features of each dimension), which can be called a reverse information sequence.

[0044] The size of low-dimensional coding features is large and has a small receptive field. The positive information generated from low-dimensional to high-dimensional coding features and attribute labels focuses on the details of the attributes. The size of high-dimensional coding features is small and has a large receptive field. The reverse information generated from high-dimensional to low-dimensional coding features and attribute labels focuses on the overall semantic information of the attributes and has a global guiding role in attribute editing. Combining the two can improve the attribute reshaping and attribute editing capabilities of images.

[0045] S13: Decoding is performed based on multiple coding features and bidirectional information to obtain an edited target edited image.

[0046] Multiple coded features and bidirectional information can be spliced ​​and fused, and the features obtained after splicing and fusion and the bidirectional features can be decoded to obtain an edited target edited image. For example, the face attributes of a face image can be edited so that the face image changes various face attributes and can present different attributes. For example, the "glasses" attribute in the face image can be edited to the "no glasses" attribute, etc., so that various different face attributes can be edited.

[0047] In this embodiment, multiple coding features of different dimensions of the target image are obtained, and bidirectional information is generated using the coding features and attribute labels. The bidirectional information includes a forward information sequence and a reverse information sequence. The forward information sequence is generated using the coding features and attribute labels in the order of the first dimension, and the reverse information sequence is generated using the coding features and attribute labels in the order of the second dimension. Decoding is performed based on multiple coding features and bidirectional information to obtain an edited target edited image. Since the bidirectional information is generated using coding features from high dimension to low dimension and from low dimension to high dimension and attribute labels respectively, the bidirectional information combines the detailed information of the attributes and the semantic information of the attributes as a whole. Combining the two can improve the attribute reshaping and attribute editing capabilities of the image, thereby improving the image editing performance.

[0048] In some embodiments, in the above step S11, when obtaining multiple coding features of different dimensions of the target image, the target image can be encoded using an encoder to obtain multiple coding features of different dimensions; wherein the encoding processing includes at least one of hole convolution processing, fusion processing, and attention calibration processing.

[0049] See also Figures 2 to 3 The above step S11, obtaining multiple coding features of different dimensions of the target image, may include the following steps:

[0050] S111: performing multiple dilated convolution processes on the target image respectively to obtain multiple dilated features; wherein the dilated rates of the multiple dilated convolution processes are different.

[0051] The target image is input into the encoder, and multiple dilated convolution kernels are used to perform multiple dilated convolution processing on the target image respectively. The dilation rates of the multiple dilated convolution kernels are different, that is, the dilation rates of the multiple dilated convolution processing on the target image are different, and multiple dilated features can be obtained respectively.

[0052] In some embodiments, the sizes of multiple dilated convolution kernels may be the same or different. For example, multiple dilated convolution kernels with different dilated ratios (convolution kernel size is 4×4, step size is 1, 2, 4, etc.) may be used for convolution processing, where the dilated ratio may be 1, 2, 4, etc., and the dilated convolution processing with a dilated ratio of 1 may be called ordinary convolution processing, and this application does not limit the dilated ratio of the dilated convolution.

[0053] S112: Perform a first fusion process on some hole features to obtain a first fusion feature.

[0054] Some of the hole features among the multiple hole features may be subjected to a first fusion, that is, the hole features of the parts may be connected (Concat) to obtain a first fusion feature.

[0055] In some implementations, the Inception structure can be used when performing the first fusion processing on some hole features. The Inception structure is a sparse structure that efficiently expresses features. By performing convolution processing with different hole rates, the receptive field of the encoded features can be enriched.

[0056] In some implementations, in addition to the hole feature obtained by the hole convolution process corresponding to a hole rate of 1, the remaining hole features may be subjected to a first fusion process.

[0057] In some implementations, when performing the first fusion process on some hole features, some hole features may be fused into one first fused feature.

[0058] In some embodiments, when performing the first fusion processing on partial hole features, at least two hole features in the partial hole features may be individually subjected to the first fusion processing to fuse the partial hole features into a plurality of first fused features.

[0059] S113: Perform a second fusion process on the first fusion feature and the remaining hole feature to obtain a second fusion feature.

[0060] The first fused feature and the remaining hole feature are subjected to a second fusion process, and the second fusion process may be an addition process (Add) of the first fused feature and the remaining hole feature to obtain a second fused feature.

[0061] In some embodiments, the first fusion feature can be subjected to a second fusion process with the hole feature obtained by the hole rate of the hole convolution process being 1 to obtain a second fusion feature. This process can make up for the information omission caused by the hole gap in the hole convolution process.

[0062] S114: Perform attention calibration processing on the second fused feature to obtain encoding features of multiple different dimensions.

[0063] The SE module (Squeeze-and-Excitation) can be used to perform attention calibration on the second fusion feature. The SE module focuses on channel information, can learn the importance of features in different channels, and calibrate the second fusion feature on the channel to encode the input target image into multiple (a series of) encoding features of different dimensions.

[0064] In some embodiments, after the attention calibration process is performed on the second fused feature, the second fused feature after the calibration process can also be convolved, and the size of the convolution kernel of the convolution process can be 1×1, so that the obtained encoding feature can be used as the input feature of the next layer of the network, that is, the above steps S111 to S114 are executed on the input feature to obtain the encoding feature of the next layer of the network, and the encoding feature of the next layer of the network obtained has a different dimension from the encoding feature obtained in the previous layer.

[0065] In some embodiments, after obtaining the coding features of the previous layer, the coding features are used as the features of the previous layer to execute the above steps S111 to S114. Specifically, multiple hole convolution processes are performed on the features of the previous layer respectively to obtain multiple hole features; wherein the hole rates of the multiple hole convolution processes are different. A first fusion process is performed on some of the hole features to obtain a first fusion feature. A second fusion process is performed on the first fusion feature and the remaining hole features to obtain a second fusion feature. An attention calibration process is performed on the second fusion feature to obtain a coding feature of a different dimension from the features of the previous layer. And so on, after processing through a multi-layer network, multiple coding features of different dimensions are obtained.

[0066] In this embodiment, multiple hole convolution processes are performed on the target image by using multiple hole convolution kernels with different hole rates to obtain multiple hole features; a first fusion process is performed on some of the hole features to obtain a first fusion feature; the first fusion feature is subjected to a second fusion process with the remaining hole features to obtain a second fusion feature; the second fusion feature is subjected to attention calibration processing to obtain coding features of multiple different dimensions. The hole convolution and ordinary convolution are combined to produce coding features with rich receptive fields.

[0067] In some embodiments, see Figure 4 The above step S12, generating bidirectional information using coding features and attribute tags, may include the following steps:

[0068] S121: Using the coding features and attribute labels of the first dimension, obtain the positive information corresponding to the first dimension; and based on the positive information corresponding to the first dimension, iteratively process the coding features of each first other dimension in the order of the first dimension to obtain the positive information corresponding to each first other dimension; based on the positive information corresponding to the first dimension and the positive information corresponding to each first other dimension, form a positive information sequence.

[0069] In some embodiments, the bidirectional information is obtained by processing the coding features and attribute labels using a bidirectional model. The coding features and attribute labels of the first dimension sequence can be input into the bidirectional model to process the coding features and attribute features of the first dimension sequence using the bidirectional model to obtain a forward information sequence.

[0070] In some embodiments, one of the first dimension and the second dimension is the highest dimension among at least two different dimensions, and the other is the lowest dimension. The first other dimension is the dimension other than the first dimension among at least two different dimensions, and the second other dimension is the dimension other than the second dimension among at least two different dimensions. For example, taking the first dimension as the lowest dimension and the second dimension as the highest dimension as an example, the first dimension is in order from low dimension to high dimension, and the second dimension is in order from high dimension to low dimension. Then the first other dimension is the dimension other than the first dimension (i.e., the lowest dimension). The second other dimension is the dimension other than the second dimension (i.e., the highest dimension).

[0071] In some embodiments, the first dimension is the lowest dimension, the second dimension is the highest dimension, the first dimension is in order from low dimension to high dimension, and the second dimension is in order from high dimension to low dimension. Convolution processing is performed using the coding features and attribute labels of the lowest dimension to obtain the positive information corresponding to the lowest dimension; and based on the positive information corresponding to the lowest dimension, the coding features of each other dimension are iteratively processed in order from low dimension to high dimension to obtain the positive information corresponding to each other dimension. Each other dimension corresponds to a positive information, and the positive information corresponding to the lowest dimension and the positive information corresponding to each other dimension can be combined to obtain a positive information sequence.

[0072] S122: Obtain reverse information corresponding to the second dimension using the coding features and attribute labels of the second dimension; and based on the reverse information corresponding to the second dimension, iteratively process the coding features of each second other dimension in the order of the second dimension to obtain reverse information corresponding to each second other dimension; and form a reverse information sequence based on the reverse information corresponding to the second dimension and the reverse information corresponding to each second other dimension.

[0073] Among them, one of the first dimension and the second dimension is the highest dimension among at least two different dimensions, and the other is the lowest dimension, and the second other dimension is the dimension other than the second dimension among at least two different dimensions.

[0074] In some implementations, the encoding features and attribute labels of the second dimensional sequence may be input into a bidirectional model, so that the encoding features and attribute features of the second dimensional sequence may be processed using the bidirectional model to obtain a reverse information sequence.

[0075] In some implementations, the first dimension is the lowest dimension, the second dimension is the highest dimension, the first dimension is in order from low dimension to high dimension, and the second dimension is in order from high dimension to low dimension. Convolution processing is performed using the coding features and attribute labels of the highest dimension to obtain the reverse information corresponding to the highest dimension; and based on the reverse information corresponding to the highest dimension, the coding features of each other dimension are iteratively processed in order from high dimension to low dimension to obtain the reverse information corresponding to each other dimension, so that the reverse information corresponding to the highest dimension and the reverse information corresponding to each other dimension form a reverse information sequence.

[0076] In some embodiments, see Figure 5 The above step S121 may include the following steps:

[0077] S1211: Perform convolution processing on the encoding features and attribute labels of the first dimension to obtain positive information corresponding to the first dimension.

[0078] The encoding features and attribute labels of the first dimension are convolved to obtain positive information corresponding to the first dimension, wherein the convolution processing includes deconvolution or downsampling processing.

[0079] In some implementations, taking the first dimension as the lowest dimension and the first dimension order from low dimension to high dimension as an example, downsampling is performed on the encoding features and attribute labels of the first dimension to obtain positive information corresponding to the first dimension.

[0080] S1212: taking each first other dimension as the first target dimension in sequence according to the first dimension order.

[0081] After obtaining the positive information corresponding to the first dimension, the first dimension is taken as the lowest dimension and the first dimension order is from low dimension to high dimension. From low dimension to high dimension, each first other dimension is taken as the first target dimension in turn to obtain the positive information corresponding to each first other dimension in turn.

[0082] S1213: Based on the coding features of the first target dimension and the positive information corresponding to the first reference dimension, obtain the positive information corresponding to the first target dimension, wherein the first reference dimension is located before the first target dimension according to the first dimension order.

[0083] The positive information corresponding to the first target dimension is obtained by utilizing the encoding features of the first target dimension and the positive information corresponding to the first reference dimension, wherein the first reference dimension is a dimension that is located before the first target dimension in order from low dimension to high dimension, that is, the dimension of the first reference dimension is lower than the first target dimension.

[0084] In some embodiments, the first reference dimension is a dimension with a step length of n that is located before the first target dimension in order from low dimension to high dimension, that is, the first reference dimension is n dimensions before the first target dimension, where n is an integer and n is less than the dimension of the encoded feature. For example, n is 1, 2, 3, etc. For example, when n is 1, the first reference dimension is a dimension with a step length of 1 that is located before the first target dimension in order from low dimension to high dimension, that is, the first reference dimension is 1 dimension before the first target dimension. The step length can be set according to the specific application scenario, and this application does not impose any restrictions on this.

[0085] In some implementations, the first target dimension is used as the target dimension, the first reference dimension is used as the reference dimension, the encoding feature of the target dimension is used as the target encoding feature, and the positive information of the reference dimension is used as the reference information. Taking a step size of 1 as an example, the positive information corresponding to the order of the first target dimension can be obtained in the following manner.

[0086] The encoding feature of the Kth layer is recorded as The attribute label is recorded as att, where K is an integer including the dimension of the coded feature. The coded feature of the Kth layer can represent the coded feature of the Kth dimension. The coded feature of the Kth layer is convolved, and the forward information of the Kth layer can be expressed as h t If K = 1, then the encoding feature of the Kth layer The attribute label att is downsampled to obtain the state information of the Kth layer, that is, the positive information. The positive information or state information of the Kth layer can be expressed by the following formula:

[0087]

[0088] In the above formula (1), c t represents the state information of the Kth layer obtained at the tth iteration, where t is an integer; h t represents the forward information of the Kth layer obtained at the tth iteration; conv represents the downsampling process.

[0089] Taking the step size of 1 as an example, the coding features of the K+1th layer are used as the target coding features, and the positive information of the Kth layer is used as the reference information. The positive information of the Kth layer and the coding features of the K+1th layer can be used to obtain the positive information of the K+1th layer.

[0090] The target encoding features and reference information are processed using the forget gate function of the forget gate to obtain the forget information. The process can be expressed by the following formula:

[0091]

[0092] In the above formula (2), f t+1represents the forgetting information of the output of the forget gate function of the K+1th layer obtained at the t+1th iteration, · represents the convolution process, σ(·) represents the sigmoid activation, [·,·] represents the connection operation, and W f Represents the convolution kernel (or convolution layer) of the forget gate function.

[0093] The input gate function of the input gate is used to process the target encoding features and reference information to obtain input information. This process can be expressed by the following formula:

[0094]

[0095] In the above formula (3), i t+1 represents the input information obtained by the input gate function of the K+1th layer, W i The convolution kernel (or convolution layer) representing the input gate function.

[0096] The target coding features and reference information are processed using the candidate processing function to obtain candidate information. This process can be expressed by the following formula:

[0097]

[0098] In the above formula (4), represents the input information of the output of the candidate processing function of the K+1th layer, tanh represents tan activation, W c A convolution kernel (or convolution layer) representing a candidate processing function.

[0099] Based on the reference information, forgotten information, input information and candidate information, the state information of the target dimension is obtained. This process can be expressed by the following formula:

[0100]

[0101] In the above formula (5), c t+1 Represents the state information of the K+1th layer; * indicates the multiplication of corresponding elements of the matrix.

[0102] The output gate function is used to process the target encoding features and reference information to obtain output information. The process can be expressed by the following formula:

[0103]

[0104] In the above formula (6), W represents the output information of the candidate processing function of the K+1th layer. o The convolution kernel (or convolution layer) representing the output gate function.

[0105] Based on the state information and output information of the target dimension, the positive information corresponding to the target dimension is obtained. This process can be expressed by the following formula:

[0106] h t+1 =o t+1 *tanh(c c+1 ) (7)

[0107] In the above formula (7), h t+1 Represents the positive information of the K+1th layer (that is, the K+1th dimension).

[0108] In the above manner, the positive information of each dimension in the first dimensional order can be obtained, that is, the positive information corresponding to each dimension can be combined to obtain a positive information sequence from low dimension to high dimension (first dimensional order).

[0109] In some implementations, if the step size n is 2, the size of the above convolution may be halved. For example, the above downsampling process, forget gate function, input gate function, convolution process of determining candidate value function, etc., the present application is not limited thereto.

[0110] In some embodiments, see Figure 6 The above step S122 may include the following steps:

[0111] S1221: Perform convolution processing on the encoding features and attribute labels of the second dimension to obtain reverse information corresponding to the second dimension.

[0112] The encoding features and attribute labels of the second dimension are convolved to obtain reverse information corresponding to the second dimension, wherein the convolution processing includes deconvolution or downsampling processing.

[0113] In some implementations, taking the second dimension as the highest dimension and the second dimension order from high dimension to low dimension as an example, the encoding features and attribute labels of the second dimension are deconvoluted to obtain the reverse information corresponding to the second dimension.

[0114] S1222: taking each second other dimension as the second target dimension in sequence according to the second dimension order.

[0115] After obtaining the reverse information corresponding to the second dimension, the second dimension is taken as the highest dimension and the second dimension order is from high dimension to low dimension. From high dimension to low dimension, each second other dimension is taken as the second target dimension in turn to obtain the reverse information corresponding to the second other dimension in turn.

[0116] S1223: Based on the coding features of the second target dimension and the reverse information corresponding to the second reference dimension, the reverse information corresponding to the second target dimension is obtained, wherein the second reference dimension is located before the second target dimension according to the second dimension order.

[0117] The reverse information corresponding to the second target dimension is obtained by utilizing the encoding features of the second target dimension and the reverse information corresponding to the second reference dimension, wherein the second reference dimension is a dimension that is located before the second target dimension in order from high dimension to low dimension, that is, the dimension of the second reference dimension is higher than the second target dimension.

[0118] In some embodiments, the second reference dimension is a dimension with a step length of n that is located before the second target dimension in the order from high dimension to low dimension, that is, the second reference dimension is n dimensions that are located before the second target dimension, where n is an integer and n is less than the dimension of the encoded feature. For example, n is 1, 2, 3, etc. For example, when n is 1, the second reference dimension is a dimension with a step length of 1 that is located before the second target dimension in the order from high dimension to low dimension, that is, the second reference dimension is 1 dimension before the second target dimension. The step length can be set according to the specific application scenario, and this application does not limit this.

[0119] In some embodiments, the second target dimension is used as the target dimension, the second reference dimension is used as the reference dimension, the encoding feature of the target dimension is used as the target encoding feature, and the reverse information of the reference dimension is used as the reference information. Taking the step size of 1 as an example, the reverse information corresponding to the sequence of the second target dimension can be obtained in the following manner. This process can refer to the specific implementation process of the above step S121, and this application will not be repeated here.

[0120] The encoding feature of the Kth layer is recorded as The attribute label is recorded as att, where K is an integer including the dimension of the coding feature, and the coding feature of the Kth layer can represent the coding feature of the Kth dimension. The coding feature of the Kth layer is convolved, and the reverse information of the Kth layer can be expressed as h s If K = 1, then the encoding feature of the Kth layer The attribute label att is deconvolved to obtain the state information of the Kth layer, that is, the reverse information. The reverse information or state information of the Kth layer can be expressed by the following formula:

[0121]

[0122] In the above formula (8), c t represents the state information of the Kth layer obtained at the sth iteration, where s is an integer; h s It represents the reverse information of the Kth layer obtained in the sth iteration; dconv represents the deconvolution process.

[0123] Taking the step size of 1 as an example, the coding feature of the K-1th layer is used as the target coding feature, and the reverse information of the Kth layer is used as the reference information. The reverse information of the Kth layer and the coding feature of the K-1th layer can be used to obtain the reverse information of the K-1th layer.

[0124] Specifically, the target coding features and reference information can be processed using the forget gate function to obtain the forget information; the target coding features and reference information can be processed using the input gate function to obtain the input information, and the target coding features and reference information can be processed using the candidate processing function to obtain the candidate information; based on the reference information, the forget information, the input information and the candidate information, the state information of the target dimension can be obtained; the target coding features and reference information can be processed using the output gate function to obtain the output information; based on the state information and output information of the target dimension, the reverse information corresponding to the target dimension can be obtained. The process can be expressed by the following formula:

[0125]

[0126] In the above formula (9), f s+1 represents the forgetting information of the output of the forget gate function of the K-1th layer obtained in the s+1th iteration; i s+1 Represents the input information obtained by the input gate function of the K-1th layer; Represents the input information of the output of the candidate processing function of the K-1th layer; c s+1 Indicates the status information of the K-1th layer; o s+1 represents the output information of the candidate processing function of the K-1th layer; h s+1 represents the reverse information of the K-1th layer (i.e., the K-1th dimension). · represents convolution processing, σ(·) represents sigmoid activation, [·,·] represents concatenation operation, tanh represents tan activation, and * represents the multiplication of corresponding elements of the matrix. W f represents the convolution kernel (or convolution layer) of the forget gate function, W i represents the convolution kernel (or convolution layer) of the input gate function, W c represents the convolution kernel (or convolution layer) of the candidate processing function, W o The convolution kernel (or convolution layer) representing the output gate function.

[0127] By iterating in the above manner, the reverse information of each dimension of the second dimensional order can be obtained in turn. That is, based on the reverse information corresponding to each dimension, a reverse information sequence from high dimension to low dimension (second dimensional order) can be obtained by combining.

[0128] In some embodiments, see Figure 7 The above step S13, decoding based on the coding feature and the bidirectional information to obtain the edited target edited image, may include the following steps:

[0129] S131: Fusing the coding features and the bidirectional information to obtain image editing features.

[0130] The BiLSTM network (Bi-directional Long Short-Term Memory) can be used to fuse the forward information and the reverse information to generate bidirectional information, and the bidirectional information and the encoding features can be connected to obtain the image editing features.

[0131] In some embodiments, h t Indicates positive information, h s represents the reverse information, and the generated bidirectional information h can be expressed as:

[0132]

[0133] In the above formula (10), They represent the forward information and reverse information corresponding to the highest dimension, for example, they can represent the forward information and reverse information corresponding to the highest dimensional encoding feature (size 4×4). By deconvolving the highest dimensional forward information, reverse information and attribute label, the initial bidirectional information (initial information) h of the bidirectional information is obtained. init .

[0134] In some implementations, the forward information and the reverse information may be fused and processed using a reset gate function and a complementary gate function to generate bidirectional information. The process may be expressed as:

[0135]

[0136] In the above formula (11), Represents the reset information output by the reset gate function. represents the complementary information output by the complementary gate, h k Indicates the generated bidirectional information, Respectively represent the forward information and reverse information of the Kth dimension. If the target dimension is the K+1 layer (or the K layer), then it represents the forward information and reverse information of the K+1 layer (or the K layer). W r represents the convolution kernel (or convolution layer) that resets the gate function, W c It is the convolution kernel (or convolution layer) of the complementary gate function.

[0137] In some implementations, the update gate function and the memory gate function may be used to process the bidirectional information and the encoding features to obtain the image editing features. The process may be expressed as:

[0138]

[0139] In the above formula (12), Represents the update information output by the K-th layer update gate function, represents the memory information retained by the Kth layer, represents the image editing feature; W u represents the convolution kernel (or convolution layer) of the update gate function, W h represents the convolution kernel (or convolution layer) of the memory gate function, and tanh represents the tan activation.

[0140] S132: Using a decoder to decode the image editing features and the decoding features to obtain an edited target editing image.

[0141] The decoded features are obtained by deconvolving the highest-dimensional encoded features using the decoder. The image editing features are input into the decoder and connected with the decoded features, and the image editing features and the decoded features are decoded to obtain the edited target edited image.

[0142] In some embodiments, the above-mentioned image editing method can be obtained by executing a generator, wherein the generator may include an encoder, a bidirectional module, and a decoder. The generator may be trained using a discriminator, and the specific training process may refer to the following embodiment.

[0143] See also Figure 8 , Figure 8 1 is a flow chart of an embodiment of a training method for an image editing model of the present application. The method may include the following steps:

[0144] S21: Utilize the generator to execute the image editing method to process the original image, and obtain an edited target edited image as a training sample image.

[0145] In some embodiments, the image editing model may be a generator, and the generator may be trained. The image training model may include a generator and a discriminator, and the discriminator may be used to assist in training the generator. The generator includes an encoder, a bidirectional module, and a decoder; wherein the bidirectional module is located between the encoder and the decoder. The generator may be used to execute an image editing method to process the original image, and obtain an edited target edited image as a training sample image.

[0146] In some embodiments, the encoder may be used to extract coding features of the expression, and step S11 of the above-mentioned image editing method may be executed to obtain coding features of at least two different dimensions of the original image, wherein the target image includes attribute labels.

[0147] The bidirectional module can be used to perform step S12 of the above-mentioned image editing method. Bidirectional information is generated using the coding features and attribute labels; wherein the bidirectional information includes forward information generated using the coding features and attribute labels in a first dimensional order and reverse information generated using the coding features and attribute labels in a second dimensional order, and one of the first dimensional order and the second dimensional order is from high dimension to low dimension, and the other is from low dimension to high dimension.

[0148] The decoder is used to generate an image and can execute step S13 of the above-mentioned image editing method. Decoding is performed based on the coding features and the bidirectional information to obtain an edited target edited image, which can be used as a training sample image.

[0149] S22: Input the training sample image into the discriminator to obtain a discrimination result, wherein the discrimination result includes true discrimination information and attribute information, the true discrimination information represents the authenticity of the training sample image, and the attribute information represents at least one of the attribute classification and attribute estimation value of the training sample image.

[0150] The obtained training sample image is input into the discriminator to obtain a discrimination result, wherein the discrimination result includes true discrimination information and attribute information. The true discrimination information indicates the authenticity of the training sample image. The authenticity can indicate the authenticity of the generated target edited image and the original image to express whether the training sample image is an image generated by the generator. The attribute information indicates at least one of the attribute classification and attribute estimation value of the training sample image. For example, the attribute estimation value can indicate the probability value of the attribute classification. The attribute information can indicate whether the classified training sample image has a certain attribute, such as whether the classification is wearing glasses.

[0151] In some embodiments, as an example, see Fig. 9 , the image training model can sequentially include the encoder G enc , a bidirectional module (not shown) and a decoder G dec and the discriminator D adv , classifier D els Among them, the encoder G enc , a bidirectional module (not shown) and a decoder G dec The training sample images are input into the discriminator and the classifier at the same time. The discriminator outputs the real discrimination information, and the classifier outputs the attribute information.

[0152] In some embodiments, the encoder G enc The 3 IFB modules and 2 convolutional layers may be included in sequence. The 3 IFB modules may be IFB(64, 4, 2), IFB(128, 4, 2) and IFB(256, 4, 2). The 2 convolutional layers may be Conv(512, 4, 2) and Conv(1024, 4, 2).

[0153] Decoder G dec Five deconvolution layers may be included, namely DeConv(1024, 4, 2), DeConv(512, 4, 2), DeConv(256, 4, 2), DeConv(128, 4, 2) and DeConv(3, 4, 2).

[0154] Discriminator D adv It consists of 5 convolutional layers and 2 fully connected layers. The 5 convolutional layers are Conv(64, 4, 2), Conv(128, 4, 2), Conv(256, 4, 2), Conv(512, 4, 2) and Conv(1024, 4, 2). The 2 fully connected layers are FC(1024) and FC(1).

[0155] Classifier D els It can consist of 5 convolutional layers and 2 fully connected layers. Among them, the discriminator D adv and classifier D els They share 5 convolutional layers and each has 2 fully connected layers. els The two fully connected layers included are FC(1024) and FC(1).

[0156] S23: Use the discrimination results to adjust the parameters in the generator.

[0157] The true discriminant information and attribute information can be used to adjust the parameters in the generator to achieve a target edited image with preset desired attributes.

[0158] In some implementations, taking a face image as an example, the following loss function may be used to train the generator. The adversarial loss function expression for training the generator and the discriminator is as follows:

[0159]

[0160]

[0161] In the above formula (13), represents the adversarial loss function of the discriminator, Denotes the adversarial loss function of the generator, D adv Represents the output value of the discriminator. x represents the original image, Y represents the face image after attribute editing, att represents the attribute label, and λ represents the parameter.

[0162] In some embodiments, the present invention uses a reshaping loss function to restore the face and retain the details of the face. The reshaping loss function L rec The expression is as follows:

[0163] L rec =||xG(x, att=0)||1 (14)

[0164] In some implementations, the present application uses an attribute classification loss function to implement the editing of face attributes. The attribute classification loss function expression is as follows:

[0165]

[0166]

[0167] In the above formula (15), represents the i-th source attribute, represents the i-th target attribute, Represents the predicted value of the i-th attribute. denote the attribute classification loss functions of the discriminator and the generator respectively.

[0168] In summary, the expressions of the entire generator loss function and the entire discriminator loss function are as follows:

[0169]

[0170]

[0171] In the above formula (16), represents the entire loss function of the generator, Represents the entire loss function of the discriminator. The above loss function is balanced with λ1=100, λ2=10, and λ3=1 as hyperparameters.

[0172] As an example, the generator can be trained and evaluated using face images from the CelebA dataset. For example, 13 representative attributes can be selected for editing: bald, bangs, black hair, red hair, brown hair, thick eyebrows, eyes, male, slightly open mouth, beard, mustache, light skin, and young. The generator is used to edit the face image to obtain the edited face image.

[0173] Among them, PSNR (Peak Signal to Noise Ratio) and SSIM (Structural Similarity) are important indicators for measuring the image quality of images (face edited images) generated by GAN networks (Generative Adversarial Networks). PSNR is the most objective indicator for evaluating image quality, which evaluates image quality by the error between pixels. SSIM measures the similarity between two images in terms of brightness, contrast, and structure. PSNR and SSIM can be used to judge the quality of generated images. At the same time, the edited images are classified and the average classification accuracy is calculated to evaluate the performance of attribute editing.

[0174] At present, other image editing methods have low image editing capabilities, such as AttGAN method, StarGAN method or STGAN method. Among them, the AttGAN method uses the structure of encoder and decoder to combine the encoding features with the decoding features in a jump connection. However, its use of jump connections will reduce the attribute editing ability of the image and cause the attribute details to be blurred. The STGAN method uses a selective transfer unit STU to fuse the attribute label with the encoding feature. However, information is lost when sampling on the STU, generating random noise.

[0175] See also Figures 10 to 13 As an example, 10 face images including face attributes are taken as input original images, and the image editing method of the present application and the AttGAN method, the StarGAN method, and the STGAN method are used to edit the face attributes of the original images, respectively, to obtain 10 face edited images, and the PSNR and SSIM indicators are used to judge the quality of the generated images. The image editing methods can be compared by PSNR, SSIM, and attribute classification accuracy. The attribute classification accuracy, PSNR, and SSIM of the method of the present application are significantly better than other image editing methods. The image editing method of the present application can improve the attribute editing performance and image quality. For example, compared with the face edited images of the STGAN method, it can be seen that the image editing method of the present application can eliminate the random noise generated during attribute editing, and the details of the character attributes are more clearly depicted.

[0176] The specific implementation of this embodiment can refer to the implementation process of the above embodiment, which will not be repeated here.

[0177] For the above embodiment, the present application provides an image editing device. Fig.14 , Fig.143 is a schematic diagram of the structure of an embodiment of the image editing device of the present application. The image editing device 30 comprises an encoding module 31, a bidirectional module 32 and a decoding module 33, wherein the encoding module 31, the bidirectional module 32 and the decoding module 33.

[0178] The encoding module 31 is used to obtain multiple encoding features of different dimensions of a target image, where the target image includes an attribute label.

[0179] The bidirectional module 32 is used to generate bidirectional information using multiple coding features and attribute labels; wherein the bidirectional information includes a forward information sequence and a reverse information sequence, the forward information sequence is generated using the coding features and attribute labels in the first dimensional order, and the reverse information sequence is generated using the coding features and attribute labels in the second dimensional order, and one of the first dimensional order and the second dimensional order is from high dimension to low dimension, and the other is from low dimension to high dimension.

[0180] The decoding module 33 is used for decoding based on multiple coding features and bidirectional information to obtain an edited target edited image.

[0181] The specific implementation of this embodiment can refer to the implementation process of the above embodiment, which will not be repeated here.

[0182] For the above embodiment, the present application provides a computer device, see Fig.15 , Fig.15 4 is a schematic diagram of a computer device of the present application. The computer device 40 includes a memory 41 and a processor 42, wherein the memory 41 and the processor 42 are coupled to each other, the memory 41 stores program data, and the processor 42 is used to execute the program data to implement the steps in any of the above-mentioned image editing methods.

[0183] In this embodiment, the processor 42 may also be referred to as a CPU (Central Processing Unit). The processor 42 may be an integrated circuit chip having signal processing capabilities. The processor 42 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. A general-purpose processor may be a microprocessor or the processor 42 may also be any conventional processor, etc.

[0184] The specific implementation of this embodiment can refer to the implementation process of the above embodiment, which will not be repeated here.

[0185] The method of the above embodiment can be implemented in the form of a computer program, so the present application proposes a storage device, see Fig.16 , Fig.16 The storage device 50 stores program data 51 that can be run by a processor, and the program data 51 can be executed by the processor to implement the steps of any embodiment of the above-mentioned image editing method.

[0186] The specific implementation of this embodiment can refer to the implementation process of the above embodiment, which will not be repeated here.

[0187] The storage device 50 of this embodiment can be a medium that can store program data 51, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or it can also be a server that stores the program data 51. The server can send the stored program data 51 to other devices for execution, or it can also execute the stored program data 51 by itself.

[0188] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0189] 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, that is, they 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 present embodiment.

[0190] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0191] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage device, which is a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for an electronic device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the various implementation methods of the present application.

[0192] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. In this way, the present application is not limited to any specific combination of hardware and software.

[0193] The above descriptions are merely embodiments of the present application and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. An image editing method, characterized in that: The method comprises: Acquire multiple encoding features of different dimensions of a target image, wherein the target image includes an attribute label; Generate bidirectional information using the multiple coding features and the attribute labels; wherein the bidirectional information includes a forward information sequence and a reverse information sequence; the forward information sequence is generated using the coding features and the attribute labels in a first dimensional order, and the reverse information sequence is generated using the coding features and the attribute labels in a second dimensional order, wherein one of the first dimensional order and the second dimensional order is from high dimension to low dimension, and the other is from low dimension to high dimension; Decoding is performed based on the multiple coding features and the bidirectional information to obtain an edited target edited image; Wherein, the generating bidirectional information by using the multiple coding features and the attribute tags includes: Using the coding features of the first dimension and the attribute label, positive information corresponding to the first dimension is obtained; and based on the positive information corresponding to the first dimension, the coding features of each of the first other dimensions are iteratively processed in the order of the first dimension to obtain positive information corresponding to each of the first other dimensions; based on the positive information corresponding to the first dimension and the positive information corresponding to each of the first other dimensions, the positive information sequence is formed; and Using the coding features of the second dimension and the attribute label, the reverse information corresponding to the second dimension is obtained; and based on the reverse information corresponding to the second dimension, the coding features of each second other dimension are iteratively processed in the order of the second dimension to obtain the reverse information corresponding to each second other dimension; based on the reverse information corresponding to the second dimension and the reverse information corresponding to each second other dimension, the reverse information sequence is formed; Among them, one of the first dimension and the second dimension is the highest dimension among the at least two different dimensions, and the other is the lowest dimension, the first other dimension is the dimension among the at least two different dimensions except the first dimension, and the second other dimension is the dimension among the at least two different dimensions except the second dimension.

2. The method according to claim 1, characterized in that: The obtaining positive information corresponding to the first dimension by using the encoding feature of the first dimension and the attribute label includes: Performing convolution processing on the encoding features of the first dimension and the attribute label to obtain positive information corresponding to the first dimension; The obtaining the reverse information corresponding to the second dimension by using the encoding feature of the second dimension and the attribute label includes: Convolution processing is performed on the encoding features of the second dimension and the attribute label to obtain reverse information corresponding to the second dimension.

3. The method according to claim 1, characterized in that The iterative processing of the coding features of each of the first other dimensions in the order of the first dimensions based on the positive information corresponding to the first dimension to obtain the positive information corresponding to each of the first other dimensions includes: According to the order of the first dimensions, each of the first other dimensions is sequentially used as the first target dimension; Based on the encoding feature of the first target dimension and the positive information corresponding to the first reference dimension, the positive information corresponding to the first target dimension is obtained, wherein the first reference dimension is located before the first target dimension according to the order of the first dimensions; The iterative processing of the coding features of each second other dimension in the order of the second dimension based on the reverse information corresponding to the second dimension to obtain the reverse information corresponding to each second other dimension includes: According to the second dimension order, each of the second other dimensions is sequentially used as the second target dimension; Based on the coding features of the second target dimension and the reverse information corresponding to the second reference dimension, the reverse information corresponding to the second target dimension is obtained, wherein the second reference dimension is located before the second target dimension according to the order of the second dimension.

4. The method according to claim 3, characterized in that The obtaining of the positive information corresponding to the first target dimension based on the coding feature of the first target dimension and the positive information corresponding to the first reference dimension, or the obtaining of the reverse information corresponding to the second target dimension based on the coding feature of the second target dimension and the reverse information corresponding to the second reference dimension, includes: The first target dimension or the second target dimension is used as the target dimension, the first reference dimension or the second reference dimension is used as the reference dimension, the coding feature of the target dimension is used as the target coding feature, and the forward information or the reverse information of the reference dimension is used as the reference information; Using a forget gate function to process the target encoding feature and the reference information to obtain forget information; Using an input gate function to process the target coding feature and the reference information to obtain input information, and using a candidate processing function to process the target coding feature and the reference information to obtain candidate information; Based on the reference information, the forgotten information, the input information and the candidate information, obtaining the state information of the target dimension; Processing the target coding feature and the reference information using an output gate function to obtain output information; Based on the state information of the target dimension and the output information, the positive information or the reverse information corresponding to the target dimension is obtained.

5. The method according to claim 1, characterized in that The first dimension is the lowest dimension, and the order of the first dimensions is from low dimension to high dimension; the second dimension is the highest dimension, and the order of the second dimension is from high dimension to low dimension; And / or, the bidirectional information is obtained by processing the encoding feature and the attribute label using a bidirectional model.

6. The method according to claim 1, characterized in that The step of obtaining multiple encoding features of different dimensions of the target image includes: The target image is encoded using an encoder to obtain the encoding features of multiple different dimensions; wherein the encoding process includes at least one of a dilated convolution process, a fusion process, and an attention calibration process.

7. The method according to claim 6, characterized in that The encoding process of the target image by using an encoder to obtain the encoding features of multiple different dimensions includes: Performing multiple dilated convolution processes on the target image respectively to obtain multiple dilated features; wherein the dilated rates of the multiple dilated convolution processes are different; Performing a first fusion process on part of the hole features to obtain a first fusion feature; Performing a second fusion process on the first fused feature and the remaining hole feature to obtain a second fused feature; Attention calibration is performed on the second fused features to obtain the encoding features of multiple different dimensions.

8. The method according to claim 1, characterized in that The decoding based on the multiple coding features and the bidirectional information to obtain an edited target edited image includes: fusing the coding feature and the bidirectional information to obtain an image editing feature; The image editing features and the decoding features are decoded by using a decoder to obtain the edited target editing image.

9. The method according to claim 8, characterized in that The decoded features are obtained by deconvolving the highest-dimensional encoded features using the decoder.

10. A method for training an image editing model, characterized in that: The method comprises: Using a generator to execute any one of the methods described in claims 1 to 9 to process the original image, so as to obtain an edited target edited image as a training sample image; Input the training sample image into a discriminator to obtain a discrimination result, wherein the discrimination result includes true discrimination information and attribute information, the true discrimination information indicates the authenticity of the training sample image, and the attribute information indicates at least one of an attribute classification and an attribute estimation value of the training sample image; The parameters in the generator are adjusted using the discrimination result.

11. The method according to claim 10, characterized in that The generator includes an encoder, a bidirectional module and a decoder; wherein the bidirectional module is located between the encoder and the decoder.

12. A computer device, characterized in that: The invention comprises a memory and a processor coupled to each other, wherein the memory stores program data, and the processor is used to execute the program data to implement the steps of the method according to any one of claims 1 to 11.

13. A storage device, characterized in that: Program data that can be executed by a processor are stored, and the program data is used to implement the steps of the method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Road extraction method based on residual neural network

    CN110781773A

  • Image visual semantic segmentation method based on two-way region attention coding and decoding

    CN113065578A

  • High-resolution remote sensing image change detection method

    CN113706482A

  • Method for encoding / decoding image and device therefor

    IN201927038419A