Teaching GAN (generative adversarial networks) to generate per-pixel annotation
A method and apparatus for joint image and per-pixel annotation synthesis with a generative adversarial network (GAN) are provided. The method includes: by inputting data to a generative adversarial network (GAN), obtaining a first image from the GAN; inputting, to a decoder, a first feature value that is obtained from at least one intermediate layer of the GAN according to the inputting of the data to the GAN; and obtaining a first semantic segmentation mask from the decoder according to the inputting of the first feature value to the decoder.
1. A controlling method of an electronic apparatus, the method comprising:
by inputting data to a generative adversarial network (GAN), obtaining a first image from the GAN;
inputting, to a decoder, a first feature value that is obtained from at least one intermediate layer of the GAN according to the inputting of the data to the GAN; and
obtaining a first semantic segmentation mask from the decoder according to the inputting of the first feature value to the decoder,
wherein the obtaining the first semantic segmentation mask comprises obtaining the first semantic segmentation mask corresponding to the first image from the decoder according to the inputting of the first feature value.
2. The method of claim 1 , further comprising:
based on a second feature value that is obtained from the at least one intermediate layer of the GAN and a second semantic segmentation mask that is added to a second image output from the GAN, training the decoder to output a semantic segmentation mask based on a feature value obtained from the at least one intermediate layer of the GAN being input to the decoder,
wherein the inputting the first feature value comprises inputting the first feature value to the trained decoder.
3. The method of claim 1 , further comprising displaying the first image and the first segmentation mask.
4. The method of claim 1 , wherein the decoder is a light-weight decoder that has a smaller number of parameters than the GAN.
5. A controlling method of an electronic apparatus, the method comprising:
by inputting data to a generative adversarial network (GAN), obtaining a first image from the GAN;
inputting, to a decoder, a first feature value that is obtained from at least one intermediate layer of the GAN according to the inputting of the data to the GAN;
obtaining a first semantic segmentation mask from the decoder according to the inputting of the first feature value to the decoder; and
based on the first image obtained from the GAN and the first semantic segmentation mask obtained from the decoder, training a semantic segmentation network to, based on a third image being input the semantic segmentation network, output at least one semantic segmentation mask corresponding to the third image.
6. An electronic apparatus comprising:
a memory storing a decoder and a generative adversarial network (GAN) trained to generate an image based on input data; and
at least one processor configured to:
obtain a first image from the GAN by inputting data to the GAN,
input, to the decoder, a first feature value that is obtained from at least one intermediate layer of the GAN according to the inputting of the data to the GAN, and
obtain a first semantic segmentation mask from the decoder according to the input of the first feature value to the decoder,
wherein the at least one processor is further configured to obtain the first semantic segmentation mask corresponding to the first image from the decoder according to input of the first feature value.
7. The electronic apparatus of claim 6 , wherein:
the decoder is trained based on a second feature value that is obtained from the at least one intermediate layer of the GAN and a second semantic segmentation mask that is added to a second image output from the GAN; and
the at least one processor is configured to input, to the trained decoder, the first feature value obtained from the at least one intermediate layer of the GAN, to obtain the first semantic segmentation mask.
8. The electronic apparatus of claim 6 , further comprising:
a display,
wherein the at least one processor is further configured to control output, via the display, the first image and the first segmentation mask.
9. The electronic apparatus of claim 6 , wherein the decoder is a light-weight decoder that has a smaller number of parameters than the GAN.
10. An electronic apparatus comprising:
a memory storing a decoder and a generative adversarial network (GAN) trained to generate an image based on input data; and
at least one processor configured to:
obtain a first image from the GAN by inputting data to the GAN,
input, to the decoder, a first feature value that is obtained from at least one intermediate layer of the GAN according to the inputting of the data to the GAN,
obtain a first semantic segmentation mask from the decoder according to the input of the first feature value to the decoder, and
based on the first image obtained from the GAN and the first semantic segmentation mask obtained from the decoder, train a semantic segmentation network to, based on a third image being input to the semantic segmentation network, output at least one semantic segmentation mask corresponding to the third image.
11. A non-transitory computer readable medium having stored therein a computer instruction executable by at least one processor of an electronic apparatus to perform a method comprising:
inputting data to a generative adversarial network (GAN) to obtain a first image from the GAN;
inputting, to a decoder, a first feature value that is obtained from at least one intermediate layer of the GAN according to the inputting of the data to the GAN; and
obtaining a first semantic segmentation mask from the decoder according to the inputting of the first feature value to the decoder,
wherein the obtaining the first semantic segmentation mask comprises obtaining the first semantic segmentation mask corresponding to the first image from the decoder according to the inputting of the first feature value.
12. The non-transitory computer readable medium of claim 11 , wherein the method further comprises:
based on a second feature value that is obtained from the at least one intermediate layer of the GAN and a second semantic segmentation mask that is added to a second image output from the GAN, training the decoder to output a semantic segmentation mask based on a feature value obtained from the at least one intermediate layer of the GAN being input to the decoder,
wherein the inputting the first feature value comprises inputting the first feature value to the trained decoder.
13. The non-transitory computer readable medium of claim 11 , wherein the method further comprises:
based on the first image obtained from the GAN and the first semantic segmentation mask obtained from the decoder, training a semantic segmentation network to, based on a third image being input the semantic segmentation network, output at least one semantic segmentation mask corresponding to the third image.
14. The non-transitory computer readable medium of claim 11 , wherein the decoder is a light-weight decoder that has a smaller number of parameters than the GAN.