METHOD FOR TRAINING AN ARTIFICIAL NEURAL NETWORK GENERATING IMAGES
The training method for artificial neural networks addresses the challenge of modifying specific image elements while preserving others by using a detection module and segmentation algorithms to ensure precise and controlled image editing.
Patent Information
- Application Number
- FR2023001406
- Authority / Receiving Office
- FR · FR
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2023-02-15
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2043-02-15
AI Technical Summary
Existing artificial neural networks struggle to modify only specific elements in an image while maintaining the original color and geometry of other elements, often resulting in unwanted changes to unrelated image features.
A computer-implemented method for training an image-generating artificial neural network involves implementing a detection module to identify and isolate modifications outside the target element, updating the neural network's parameters based on these detections, and using a segmentation algorithm to generate masks for precise element modification.
The method enables the generation of modified images where only the specified element is modified, preserving the original colors and geometries of other elements, thus improving the accuracy and control of image editing tasks.
Smart Images

Figure 00000017_0000 
Figure 00000017_0001 
Figure 00000017_0002
Abstract
Description
Title of the invention: METHOD FOR TRAINING AN ARTIFICIAL NEURAL NETWORK GENERATOR OF IMAGES
[0001] Embodiments and implementations relate to artificial neural networks.
[0002] Artificial neural networks are used to perform given functions when executed.
[0003] Artificial neural networks generally comprise a succession of layers of neurons.
[0004] Each layer takes as input data to which weights are applied and outputs output data after processing by activation functions of the neurons of said layer. This output data is transmitted to the next layer in the neural network. The weights are configurable parameters to obtain good output data.
[0005] Neural networks can for example be implemented by final hardware platforms, such as microcontrollers or specific dedicated circuits.
[0006] Neural networks are generally trained during a training phase ("learning") before being integrated into the final hardware platform. The training phase can be supervised or unsupervised. The training phase allows the weights of the neural network to be adjusted to obtain good output data from the neural network. The weights are adapted according to the data obtained at the output of the neural network compared to expected data.
[0007] Artificial neural networks are known in particular, configured to receive an initial image and to generate a modified image corresponding to the initial image in which an element of the initial image has been modified.
[0008] In particular, a generator neural network can be trained to apply a color chosen by a user to an element of the initial image.
[0009] Such a neural network can thus allow the user to virtually visualize the modification of the color of the element of the initial image.
[0010] However, training such a neural network may be insufficient to achieve good results in the modified image.
[0011] The neural network, once trained, can sometimes modify the color of certain elements of the image distinct from said element to be modified, in particular when the neural network has associated these elements during its training. In particular, the neural network can associate a hair color with an eye color. For example, For example, the neural network may associate blonde hair with blue eyes. Thus, changing the hair color may result in an unwanted change in eye color in the edited image.
[0012] There is therefore a need to propose a training method making it possible to obtain an artificial neural network generating an image configured to modify only one or more elements defined by the user.
[0013] According to one aspect, there is provided a computer-implemented method of training an image-generating artificial neural network, the image-generating artificial neural network being configured to receive a color to be applied and an initial image comprising an element to be modified, the generating neural network being trained to generate a modified image corresponding to a variant of the initial image in which said element to be modified of the initial image is colored according to said color to be applied, the method comprising: - at least one implementation of the generator neural network so as to generate a modified image from an initial image, then - an implementation of a detection module comprising: • generation of a comparison image corresponding to a difference between the modified image and the initial image, • an implementation of a segmentation algorithm configured to generate a mask of said element to be modified from the initial image, then • an application of the mask to the comparison image so as to identify whether the modified image contains modifications outside of the said element to be modified, then - an update of the parameters, in particular the weights, of the generating neural network based on the modifications detected outside of the said element to be modified.
[0014] Such a training method makes it possible to obtain a generator neural network configured to, from an image comprising an element having a color to be modified, generate a modified image in which only the element to be modified is modified.
[0015] In an advantageous embodiment, the segmentation algorithm is an artificial neural network trained to generate a mask of an element to be modified from an image that it receives as input.
[0016] Advantageously, the mask corresponds to a probability matrix of the size of the image received as input, the probability matrix defining for each pixel of the image received as input a probability that the pixel belongs to the element to be modified.
[0017] Preferably, the method further comprises an implementation of a reconstruction module comprising: - an implementation of a color estimation module configured to extract a color from the element to be modified from the initial image, - an implementation of the generating neural network from the modified image generated by this generating neural network and the color of the element to be modified from the initial image extracted from said implementation of the color estimation module, so as to generate a reconstructed initial image, - a comparison between the initial image and the reconstructed initial image, - an update of the parameters of the generating neural network based on the results of this comparison.
[0018] The implementation of the reconstruction module makes it possible to identify whether the geometry of the elements of the modified image has not been modified compared to the initial image. In this way, the generator neural network is trained to generate, from initial images, modified images in which the geometry of the elements is respected compared to the initial images.
[0019] In an advantageous embodiment, the method further comprises an implementation of a color estimation module configured to extract a color from the modified element of the modified image corresponding to the element to be modified from the initial image and an update of the parameters of the generating neural network as a function of the extracted color relative to the color to be applied.
[0020] The implementation of the color estimation module makes it possible to ensure that the color applied to the modified element of the modified image corresponds to the color to be applied provided as input to the generator neural network. In this way, the generator neural network is trained to generate modified images in which the modified elements have a color that corresponds to the color to be applied provided as input to the generator neural network.
[0021] Preferably, the implementation of the color estimation module from an image comprising an element having a color to be estimated comprises: - an implementation of the segmentation algorithm on said image to generate a mask of said element to be modified in said image, then - an application of the mask to said image so as to obtain a segmented image comprising only the element having the color to be estimated, then - an estimation of the color of the element from the segmented image.
[0022] Advantageously, the method further comprises an implementation and training of a discriminator neural network configured to take as input the image modified by the generator neural network, and an update of the parameters of the generator neural network according to the results of the implementation of the discriminator neural network.
[0023] In this way, the generator neural network is trained using an adversarial neural network (the discriminator neural network). In particular, the adversarial neural network is configured to determine whether the modified image generated by The generator neural network is realistic or not. Thus, the generator neural network is trained to generate realistic modified images.
[0024] According to another aspect, there is provided a computer program product comprising instructions which, when the program is executed by a computer, cause the latter to implement the training method as described above.
[0025] According to another aspect, there is provided a computer program product comprising instructions which, when the program is executed by a computer, cause the latter to implement an image-generating artificial neural network trained by the implementation of a training method as described above.
[0026] According to another aspect, there is provided a computer-readable recording medium, on which is recorded the computer program product comprising instructions which, when the program is executed by a computer, cause the latter to implement an image-generating artificial neural network trained by the implementation of a training method as described above.
[0027] According to another aspect, there is provided a microcontroller comprising: - a recording medium as described above, and - a processing unit configured to execute the computer program product recorded on said recording medium.
[0028] Other advantages and characteristics of the invention will appear on examining the detailed description of embodiments, which are in no way limiting, and the appended drawings in which:
[0029] [Fig.l]
[0030] [Fig.2]
[0031] [Fig.3]
[0032] [Fig.4]
[0033] [Fig.5]
[0034] [Fig.6]
[0035] [Fig.7]
[0036] [Fig.8] illustrate embodiments and implementations of the invention.
[0037] [Fig.l] illustrates a functional diagram of a method for training a generator artificial neural network G. Such a training method can be implemented by computer. In particular, a computer program can comprise instructions which, when the program is executed by a computer, cause the latter to implement this training method.
[0038] The generator neural network G comprises a succession of layers of neurons. Each layer is configured to take as input data to which weights are applied so as to output data of output after processing by activation functions of the neurons of said layer. This output data is transmitted to the next layer in the neural network.
[0039] Weights are configurable parameters to obtain good output data. The neural network is trained to adjust the weights of the neural network so as to obtain good output data from the neural network.
[0040] In particular, the generator neural network G can comprise convolution layers, using in particular as activation functions functions of the Leaky Rectified Linear Activation (LReLU) type and a hyperbolic tangent function (tanh).
[0041] Table [Table 1] and [Fig.2] illustrate a ResBlock_G(Y) block that can be used in one embodiment of the generator neural network.
[0042] [Tables 1] ResBiock_G(Y) - Generator Neural Network Layer Type Activation Function Input Dimensions Output Dimensions Name Connected to Input - AxAxY i Conv 3x3 -stride - 1 LReLU AxAxY AxAxY A 1 Conv 3x3 - stride = 1 LReLU AxAxY AxAxY BA ADD - (AxAxY, AxAxY) AxAxY O(1, B)
[0043] Table [Table 2] illustrates one embodiment of the generator neural network.
[0044] [Tables2] Generator Neural Network Layer Type Activation Function Input Dimensions Output Dimensions Input Image - - 256x256x3 Convolution (“Conu”) 7x7 -stride = 1 LReLU 256x256x3 256x256x64 Conv 3x3 - stride - 2 LReLU 256x256x64 128x128x64 Conv 3x3 - stride = 2 LReLU 128x128x64 64x64x128 Conv 3x3 - stride = 2 LReLU 64x64x128 32x32x256 ResBlock_G (256) LReLU 32x32x256 32x32x256 ResBlock_G (256) LReLU 32x32x256 32x32x256 Res8lock_G (256) LReLU 32x32x256 32x32x256 ResBlock_G (256) LReLU 32x32x256 32x32x256 Conditional Concatenation LReLU 32x32x256 32x32x259 ResBlock_G (256) LReLU 32x32x256 32x32x256 Conditional Concatenation LReLU 32x32x256 32x32x259 ResBlock_G (256) LReLU 32x32x256 32x32x256 Conditional Concatenation LReLU 32x32x256 32x32x259 Deconvolution ("ConvTranspose") 3x3 -step = 2 LReLU 32x32x259 64x64x128 Conditional Concatenation LReLU 64x64x128 64x64x131 ConvTranspose 3x3 - step = 2 LReLU 64x64x131 128x128x64 Conditional Concatenation LReLU 128x128x64 128x128x67ConvTranspose 3x3 - stride = 2 LReLU 128x128x67 256x256x64 Conditional Concatenation LReLU 256x256x64 256x256x67 Conv 7x7- stride= 1 tanh 256x256x67 256x256x3 Addition with input - 256x256x3 256x256x3
[0045] The method aims to train a generator artificial neural network G so that the latter is capable of generating, from an initial image 0_IMG and a specified color D_COL, a modified image corresponding to the initial image 0_IMG in which an element OBJ to be modified is colored according to the specified color D_COL.
[0046] The OBJ element to be modified can be of any kind. The OBJ element can for example be an element associated with an individual such as lips, hair, clothing, etc.
[0047] Training the generator artificial neural network G allows adapting the parameters (i.e., the weights) of the generator artificial neural network G so that the generator artificial neural network G is capable of generating desired modified images G_IMG.
[0048] The generator neural network G is configured to receive an initial image 0_IMG and a color D_COL to be applied to an element to be modified of the initial image 0_IMG.
[0049] The generator neural network G is configured to generate as output a difference to be applied to the original image 0_IMG to obtain a modified image G_IMG depending on the initial image O_IMG and the color to be applied D_COL. In particular, a sum is calculated between the difference at the output of the generator neural network G and the original image O_IMG so as to obtain the modified image G_IMG. Alternatively, it is possible to provide a generator neural network G allowing to directly generate the modified image G_IMG from the original image O_IMG and the color D_COL. However, it is preferable to use a generator neural network G allowing to generate a difference to be applied to the original image O_IMG because such a generator neural network G is generally simpler to train.
[0050] The method also comprises a step of evaluating the modified image G_IMG.
[0051] The evaluation of the modified image G_IMG comprises an implementation of a color estimation module C. [Fig.3] illustrates a functional diagram of a method implemented by the color estimation module C.
[0052] This color estimation module C is used to check whether the color of the modified element OBJ in the modified image G_IMG matches the color to be applied D_COL.
[0053] The implementation of the color estimation module C comprises an implementation of a segmentation algorithm S. The segmentation algorithm S may for example be an artificial neural network already trained to detect said element to be modified in an image. In particular, the segmentation algorithm is implemented by taking as input the modified image so as to generate a mask SEG_MAP of said modified element in the modified image.
[0054] The segmentation algorithm may for example be an artificial neural network already trained to detect said element to be modified in an image. In particular, the segmentation algorithm makes it possible to generate a mask of said element to be modified.
[0055] Table [Table 4] and [Fig.4] illustrate a ResBlock_S(Y) block that can be used in one embodiment of the segmentation neural network.
[0056] [Tables4] ResBlock_S(¥) Layer Type Activation Function Input Dimensions Output Dimensions Name Connected to Input - - AxAxZ 1 Convolution (Conv) 1x1 -(stride) stride=2 LReLU AxAxY AxAxY A 1 Conv 3x3 - stride=1 LReLU AxAxY AxAxY BA Conv 1x1 - stride=1 LReLU AxAxY AxAx4Y c B Conv lxl - stride=2 LReLU AxAxY AxAx4Y D 1 ADD - (AxAx4Y. AxAx4Y) AxAx4Y O (C, D)
[0057] Table [Table 5] and [Fig.5] illustrate a DS_ResBlock_S(Y) block that can be used in one embodiment of the segmentation neural network.
[0058] [Tables5] DS_ResBlock_S(Y) Layer Type Activation Function Input Dimensions Output Dimensions Name Connected to Input - - 2Ax2AxZ 1 Conv 1x1 -(stride) stride = 2 LReLU 2Ax2AxY AxAxY A 1 Conv 3x3 - stride = 1 LReLU AxAxY AxAxY BA Conv 1x1 - stride = 1 LReLU AxAx4Y AxAx4Y CB Conv 1x1 - stride = 2 LReLU 2Ax2AxY AxAx4Y D 1 ADD - (AxAx4Y, AxAx4Y) AxAx4Y 0 (c, D)
[0059] Table [Table 6] illustrates one embodiment of a segmentation neural network. Réseau de neurones de segmentation Type de couche Fonction d'Activation Dimensions entrée Dimensions sortie Image d'entrée - - 256x256x3 Convolution (« Conv ») 7x7 -pas (« stride ») = 1 LReLU 256x256x3 256x256x64 « Max Pooling » - 256x256x64 128x128x64 DS_ResBlock_S(64) LReLU 128x128x64 64x64x256 ResBlock_S(64) LReLU 64x64x256 64x64x256 ResBlock_S(64) LReLU 64x64x256 64x64x256 DS_ResBlock_S(128) LReLU 64x64x256 32x32x512 ResBlock_S(128) LReLU 64x64x256 32x32x512 ResBlock_S(128) LReLU 32x32x256 32x32x512 ResBlock_S(128) LReLU 32x32x256 32x32x512 ResBlock_S(128) LReLU 32x32x256 32x32x512 DS_ResBlock_S(256) LReLU 32x32x256 16x16x1024 ResBlock_S(256) LReLU 16x16x1024 16x16x1024 ResBlock_S(256) LReLU 16x16x1024 16x16x1024 ResBlock_S(256) LReLU 16x16x1024 16x16x1024 ResBlock_S(256) LReLU 16x16x1024 16x16x1024 ResBlock_S(256) LReLU 16x16x1024 16x16x1024 CA - DS_ResBlock_S(512) LReLU 16x16x1024 8x8x2048 ResBlock_S(512) LReLU 8x8x2048 8x8x2048 ResBlock_S(512) LReLU 8x8x2048 8x8x2048 Convolutiontwo dimensions ("Conv2D") 1x1 - step = 1 LReLU 8x8x2048 8x8x2048 Conv2D 1x1 - step = 1 LReLU 8x8x2048 8x8x2048 Conv2D 1x1 - step = 1 LReLU 8x8x2048 8x8x2048 CB-Deconvolution ("Conv2DTranspose") 1x1 - step = 2 LReLU 8x8x2048 16x16x1024 Concatenation (CA, CB) - 16x16x1024 16x16x2048 Conv2D 1x1 - step = 1 LReLU 16x16x2048 16x16x1024 Conv2DTranspose 16x16 - step = 16 LReLU 16x16x1024 256x256xnum_classes
[0061] The generated SEG_MAP mask can be a matrix S(X) whose elements S(X). . correspond to the probability that a pixel (i,j) of the IMG image taken as input to the segmentation algorithm belongs to the element to be detected in the image.
[0062] The value S(X). . of the elements of the matrix can therefore be expressed by the following formula:
[0063] S(X)jj = P (th element^X)
[0064] The SEG_MAP mask is then applied to the IMG image so as to obtain a segmented SEG_IMG image comprising only the OBJ element having the color to be estimated.
[0065] The color G_COL of said modified element (corresponds to the color COL in [Fig.3]) is then estimated from the segmented image SEG_IMG.
[0066] The estimated COL color of an element corresponds to a weighted average of the colorimetric values of the pixels representing this element. The weighted average corresponds to the sum of the values of the segmented image SEG_IMG divided by the sum of the values of the mask SEG_MAP.
[0067] The estimated COL color can therefore be expressed by the following formula: 100681 c(x)=Eqx]=.^A
[0069] where XiJ corresponds to a color vector of the pixel (i,j) of the image.
[0070] The estimated COL color of the modified object can then be compared to the color to be applied provided by the user to train the generating neural network. In particular, a cost function (in English "loss function") relating to the color of the modified element is calculated using the following formula:
[0071] _ U il <-lELab16
[0072] where C !EL.crb^(t corresponds to the L*a*b* CIE 1976 chromatic space, corresponds to the estimated color of the modified element in the modified image and c corresponds to the color to be applied as entered by the user.
[0073] The evaluation of the modified image G_IMG also includes an implementation of a discriminator artificial neural network D. This discriminator artificial neural network D identifies whether the modified image is realistic or not. Thus, the generator neural network G is trained to generate realistic modified images. The discriminator neural network D is trained simultaneously with the training of the Generator neural network G. The generator neural network G and the discriminator neural network D are generative adversarial networks.
[0074] Table [Table 3] illustrates one embodiment of a discriminator neural network.
[0075] [Tables3] | Layer Type Activation Function Input Dimensions Output Dimensions Parameters | Input Image - - 256x256x3 - Convolution (Conv) 3x3 -stride = 2 LReLU 256x256x3 128x128x64 3k Conv 3x3 -stride = 2 LReLU 128x128x64 64x64x128 131k Conv 3x3 -stride = 2 LReLU 64x64x128 32x32x256 524k Conv 3x3 -stride = 2 LReLU 32x32x256 16x16x512 2.097k Fully connected Linear 16x16x512 1 131k
[0076] The cost function used corresponds to that of a Wasserstein generative adversarial network 100771 L^=D(Î) -d(x) + VJVXX)
[0078] where X is an image obtained by interpolation between an initial image X and a modified image X-
[0079] The evaluation of the modified image G_IMG also comprises an implementation of a detection module Mf configured to detect whether elements distinct from the element OBJ to be modified have also been modified in the modified image G_IMG.
[0080] [Fig.6] illustrates a functional diagram of a method implemented by the detection module Mf.
[0081] This method comprises generating a comparison image M0D_MAP by performing a subtraction between the modified image G_IMG and the initial image 0_IMG. The comparison image M0D_MAP makes it possible to identify the modifications made in the modified image G_IMG compared to the initial image 0_IMG.
[0082] This method also comprises an implementation of the segmentation algorithm S previously described so as to obtain a mask SEG_MAP of the element to be modified of the initial image 0_IMG.
[0083] This method further comprises an application of the mask SEG_MAP on the comparison image M0D_MAP so as to identify whether the modified image G_IMG comprises modifications outside of said element. In [Fig.6], the modifications outside of said element are illustrated by the image SMOD_MAP. This makes it possible to train the generator neural network G so that it does not modify the pixels of the image outside of those of said element OBJ to be modified.
[0084] The implementation of the detection module Mf makes it possible to calculate a cost function (“loss function”) expressed according to the following formula: [00851 1^ = Il (XX) Q (1^(X)) Il 2
[0086] where X is the initial image, x is the modified image, S(X) corresponds to the mask generated by the segmentation algorithm, and O corresponds to the XNOR function (“Exclusive NOR”), that is to say the complement of the exclusive OR function.
[0087] The evaluation of the modified image G_IMG also includes an implementation of the reconstruction module R. The implementation of the reconstruction module R makes it possible to identify whether the geometry of the elements of the modified image G_IMG has not been modified compared to the initial image 0_IMG.
[0088] [Fig.7] illustrates a functional diagram of the method implemented by the reconstruction module R. The reconstruction module R makes it possible to train the generator neural network G so that it is capable of generating a modified image G_IMG from which it is possible to recreate the initial image 0_IMG. This makes it possible to obtain a generator neural network G capable of preserving the geometry of the elements of the initial image 0_IMG.
[0089] This method comprises an implementation of the color estimation module C from the initial image. The color estimation module C makes it possible to extract the color of the element to be modified from the initial image 0_IMG.
[0090] This method also comprises an implementation of the generator neural network G from the modified image G_IMG and the color extracted by the color estimation module C. The generator neural network G then makes it possible to generate a difference to be applied to the modified image G_IMG to obtain a reconstructed image R_IMG. In particular, a sum is calculated between the difference obtained at the output of the generator neural network G and the modified image G_IMG so as to obtain the reconstructed image R_IMG.
[0091] The reconstructed image R_IMG is then compared to the initial image 0_IMG so as to calculate a reconstruction error. 100921 L„ = Il X - GG ( X. c ), C ( X ) ) Il 2
[0093] where G(X, c) is the generated image and C(X) is the color vector extracted from the element to edit from the initial image X.
[0094] The cost function used to train the generator neural network G can be expressed by the following formula:
[0095] LG ^adv *F "F ^mask^mask "F ^rec^rec
[0096] where ^color, ^mask, ^rec are parameters for weighting the different cost functions LColor, ^mask, Lrec. The values of these parameters can be defined by the user through experimentation.
[0097] The generator neural network G can be trained by gradient backpropagation.
[0098] The cost function used to train the discriminator neural network D can be expressed by the following formula:
[0099] Lo=-L^v
[0100] The discriminator neural network D can also be trained by gradient backpropagation.
[0101] Once trained, the generator neural network G can be integrated into a computer program. In particular, the computer program comprises instructions which, when this program is executed by a computer, cause the latter to implement the trained generator artificial neural network G.
[0102] [Fig.8] illustrates an embodiment of a microcontroller MCU comprising a recording medium MEM, in particular a non-volatile memory, in which the computer program PRG comprising the instructions for implementing the generator neural network is recorded. The microcontroller MCU comprises a processing unit UT configured to execute this generator neural network.
[0103] Of course, the present invention is susceptible to various variants and modifications which will appear to those skilled in the art. For example, the generating neural network can be configured to modify the color of several elements of the initial image. The segmentation algorithm is then configured to delimit the different elements of this initial image.
Claims
Claims
1. A computer-implemented method for training an image-generating artificial neural network (G), the image-generating artificial neural network (G) being configured to receive a color (D_COL) to be applied and an initial image (O_IMG) comprising an element to be modified, the generating neural network (G) being trained to generate a modified image (G_IMG) corresponding to a variant of the initial image (O_IMG) in which said element to be modified of the initial image (O_IMG) is colored according to said color (D_COL) to be applied, the method comprising: - at least one implementation of the generating neural network (G) so as to generate a modified image (G_IMG) from an initial image (O_IMG), then - an implementation of a detection module (Mf) comprising: • a generation of a comparison image (MOD_MAP) corresponding to a difference between the modified image (G_IMG) and the initial image (O_IMG),• an implementation of a segmentation algorithm (S) configured to generate a mask (SEG_MAP) of said element to be modified of the initial image (O_IMG), then • an application of the mask (SEG_MAP) to the comparison image (MOD_MAP) so as to identify whether the modified image (G_IMG) includes modifications outside of said element to be modified, then - an update of the parameters of the generating neural network according to the modifications detected outside of said element to be modified.,
2. Method according to claim 1, the segmentation algorithm (S) is an artificial neural network trained to generate a mask (SEG_MAP) of an element to be modified from an image that it receives as input.
3. Method according to any one of claims 1 or 2, in which the mask (SEG_MAP) corresponds to a probability matrix of the size of the image received as input, the probability matrix defining for each pixel of the image received as input a probability that the pixel belongs to the element to be modified.
4. Method according to one of claims 1 to 3, further comprising an implementation of a reconstruction module (R) comprising: - an implementation of a color estimation module (C) configured to extract a color (O_COL) of the element to be modified from the initial image (O_IMG), - an implementation of the generator neural network (G) from the modified image (G_IMG) generated by this generator neural network (G) and the color (O_COL) of the element to be modified from the initial image (O_IMG) extracted from said implementation of the color estimation module (C), so as to generate a reconstructed initial image (R_IMG), - a comparison between the initial image (O_IMG) and the reconstructed initial image (R_IMG), - an update of the parameters of the generator neural network according to the results (Lre,c) of this comparison.
5. Method according to one of claims 1 to 4, further comprising an implementation of a color estimation module (C) configured to extract a color (G_COL) from the modified element of the modified image (G_IMG) corresponding to the element to be modified of the initial image (O_IMG) and an update of the parameters of the generating neural network as a function (Lco / or) of the color (G_IMG) extracted with respect to the color (D_COL) to be applied.
6. Method according to any one of claims 4 or 5, wherein the implementation of the color estimation module (C) from an image (IMG) comprising an element having a color to be estimated comprises: - an implementation of the segmentation algorithm (S) on said image to generate a mask (SEG_MAP) of said element to be modified of said image, then - an application of the mask (SEG_MAP) on said image (IMG) so as to obtain a segmented image (SEG_IMG) comprising only the element having the color to be estimated, then - an estimation of the color (COL) of the element from the segmented image (SEG_IMG).
7. Method according to one of claims 1 to 6, further comprising an implementation and a training of a discriminator neural network (D) configured to take as input the modified image (G_IMG) by the generator neural network (G), and an update of the parameters of the generator neural network (G) according to the results of the implementation of the discriminator neural network miner (D).
8. Computer program product comprising instructions which, when the program is executed by a computer, cause the latter to implement the training method according to one of claims 1 to 7.
9. Computer program product comprising instructions which, when the program is executed by a computer, cause the latter to implement an artificial neural network generating (G) an image trained by the implementation of a method according to one of claims 1 to 7.
10. A computer-readable recording medium on which the computer program product according to claim 9 is recorded.
11. Microcontroller comprising: - a recording medium according to claim 10, and - a processing unit configured to execute the computer program product recorded on said recording medium.