How to know labels of generated images in WGAN using keras The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) The Ask Question Wizard is Live! Data science time! April 2019 and salary with experienceHow can I safely create a nested directory in Python?How to get the current time in PythonHow can I make a time delay in Python?How to know if an object has an attribute in PythonHow do I sort a dictionary by value?How to make a chain of function decorators?How to make a flat list out of list of listsHow do I pass a variable by reference?How do I list all files of a directory?How do I install pip on Windows?

RT6224D-based step down circuit yields 0V - why?

Is a pteranodon too powerful as a beast companion for a beast master?

Why can't devices on different VLANs, but on the same subnet, communicate?

In horse breeding, what is the female equivalent of putting a horse out "to stud"?

How to copy the contents of all files with a certain name into a new file?

Semisimplicity of the category of coherent sheaves?

Take groceries in checked luggage

What information about me do stores get via my credit card?

What's the point in a preamp?

Typeface like Times New Roman but with "tied" percent sign

Windows 10: How to Lock (not sleep) laptop on lid close?

Do warforged have souls?

How can I protect witches in combat who wear limited clothing?

How do I add random spotting to the same face in cycles?

The variadic template constructor of my class cannot modify my class members, why is that so?

Road tyres vs "Street" tyres for charity ride on MTB Tandem

Do working physicists consider Newtonian mechanics to be "falsified"?

How many people can fit inside Mordenkainen's Magnificent Mansion?

The following signatures were invalid: EXPKEYSIG 1397BC53640DB551

What can I do if neighbor is blocking my solar panels intentionally?

Mortgage adviser recommends a longer term than necessary combined with overpayments

Finding degree of a finite field extension

Can undead you have reanimated wait inside a portable hole?

Does the AirPods case need to be around while listening via an iOS Device?



How to know labels of generated images in WGAN using keras



The 2019 Stack Overflow Developer Survey Results Are In
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
The Ask Question Wizard is Live!
Data science time! April 2019 and salary with experienceHow can I safely create a nested directory in Python?How to get the current time in PythonHow can I make a time delay in Python?How to know if an object has an attribute in PythonHow do I sort a dictionary by value?How to make a chain of function decorators?How to make a flat list out of list of listsHow do I pass a variable by reference?How do I list all files of a directory?How do I install pip on Windows?



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I am working on medical image classification problem, and suffering from low data set problem. So want to generate images using WGAN. In given code WGAN code example is taken of MNIST data set. after image generation it's easy to recognize digit which class they belongs too. But in medical image case, after generating images it's hard to decide generated images belongs to which category, because they saved in group from following code given:



def sample_images(self, epoch):
r, c = 5, 5
noise = np.random.normal(0, 1, (r * c, self.latent_dim))
gen_imgs = self.generator.predict(noise)

# Rescale images 0 - 1
gen_imgs = 0.5 * gen_imgs + 0.5

fig, axs = plt.subplots(r, c)
cnt = 0
for i in range(r):
for j in range(c):
axs[i,j].imshow(gen_imgs[cnt, :,:,0], cmap='gray')
axs[i,j].axis('off')
cnt += 1
fig.savefig("images/mnist_%d.png" % epoch)
plt.close()


so what changes i have to perform to get labels of generated images.










share|improve this question




























    0















    I am working on medical image classification problem, and suffering from low data set problem. So want to generate images using WGAN. In given code WGAN code example is taken of MNIST data set. after image generation it's easy to recognize digit which class they belongs too. But in medical image case, after generating images it's hard to decide generated images belongs to which category, because they saved in group from following code given:



    def sample_images(self, epoch):
    r, c = 5, 5
    noise = np.random.normal(0, 1, (r * c, self.latent_dim))
    gen_imgs = self.generator.predict(noise)

    # Rescale images 0 - 1
    gen_imgs = 0.5 * gen_imgs + 0.5

    fig, axs = plt.subplots(r, c)
    cnt = 0
    for i in range(r):
    for j in range(c):
    axs[i,j].imshow(gen_imgs[cnt, :,:,0], cmap='gray')
    axs[i,j].axis('off')
    cnt += 1
    fig.savefig("images/mnist_%d.png" % epoch)
    plt.close()


    so what changes i have to perform to get labels of generated images.










    share|improve this question
























      0












      0








      0








      I am working on medical image classification problem, and suffering from low data set problem. So want to generate images using WGAN. In given code WGAN code example is taken of MNIST data set. after image generation it's easy to recognize digit which class they belongs too. But in medical image case, after generating images it's hard to decide generated images belongs to which category, because they saved in group from following code given:



      def sample_images(self, epoch):
      r, c = 5, 5
      noise = np.random.normal(0, 1, (r * c, self.latent_dim))
      gen_imgs = self.generator.predict(noise)

      # Rescale images 0 - 1
      gen_imgs = 0.5 * gen_imgs + 0.5

      fig, axs = plt.subplots(r, c)
      cnt = 0
      for i in range(r):
      for j in range(c):
      axs[i,j].imshow(gen_imgs[cnt, :,:,0], cmap='gray')
      axs[i,j].axis('off')
      cnt += 1
      fig.savefig("images/mnist_%d.png" % epoch)
      plt.close()


      so what changes i have to perform to get labels of generated images.










      share|improve this question














      I am working on medical image classification problem, and suffering from low data set problem. So want to generate images using WGAN. In given code WGAN code example is taken of MNIST data set. after image generation it's easy to recognize digit which class they belongs too. But in medical image case, after generating images it's hard to decide generated images belongs to which category, because they saved in group from following code given:



      def sample_images(self, epoch):
      r, c = 5, 5
      noise = np.random.normal(0, 1, (r * c, self.latent_dim))
      gen_imgs = self.generator.predict(noise)

      # Rescale images 0 - 1
      gen_imgs = 0.5 * gen_imgs + 0.5

      fig, axs = plt.subplots(r, c)
      cnt = 0
      for i in range(r):
      for j in range(c):
      axs[i,j].imshow(gen_imgs[cnt, :,:,0], cmap='gray')
      axs[i,j].axis('off')
      cnt += 1
      fig.savefig("images/mnist_%d.png" % epoch)
      plt.close()


      so what changes i have to perform to get labels of generated images.







      python tensorflow keras






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 22 at 6:17









      HiteshHitesh

      391721




      391721






















          1 Answer
          1






          active

          oldest

          votes


















          1














          WGAN in the vanilla version cannot generate images conditionally. Therefore, the WGAN you have trained can only generate images without any knowledge of which class they belong to.



          To be able to generate images of a particular label, check out conditonal gans. Here's a medium article to get you started.



          The alternate option is to train a discriminator from the original training data and use that discriminator to help you manually classify the images.






          share|improve this answer























          • yup , i thought the same. What i did is, i run my WGAN code 2 times. each time i only give single class. Is this correct approach?

            – Hitesh
            Mar 25 at 7:29






          • 1





            That's an option as well. But given that you have very less training data. It would be better to maximise the gan's potential by training on the entire set.

            – Haran Rajkumar
            Mar 25 at 8:44











          • Yup i have very less data. and i am doing training on entire set.

            – Hitesh
            Mar 26 at 4:24











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55293914%2fhow-to-know-labels-of-generated-images-in-wgan-using-keras%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          WGAN in the vanilla version cannot generate images conditionally. Therefore, the WGAN you have trained can only generate images without any knowledge of which class they belong to.



          To be able to generate images of a particular label, check out conditonal gans. Here's a medium article to get you started.



          The alternate option is to train a discriminator from the original training data and use that discriminator to help you manually classify the images.






          share|improve this answer























          • yup , i thought the same. What i did is, i run my WGAN code 2 times. each time i only give single class. Is this correct approach?

            – Hitesh
            Mar 25 at 7:29






          • 1





            That's an option as well. But given that you have very less training data. It would be better to maximise the gan's potential by training on the entire set.

            – Haran Rajkumar
            Mar 25 at 8:44











          • Yup i have very less data. and i am doing training on entire set.

            – Hitesh
            Mar 26 at 4:24















          1














          WGAN in the vanilla version cannot generate images conditionally. Therefore, the WGAN you have trained can only generate images without any knowledge of which class they belong to.



          To be able to generate images of a particular label, check out conditonal gans. Here's a medium article to get you started.



          The alternate option is to train a discriminator from the original training data and use that discriminator to help you manually classify the images.






          share|improve this answer























          • yup , i thought the same. What i did is, i run my WGAN code 2 times. each time i only give single class. Is this correct approach?

            – Hitesh
            Mar 25 at 7:29






          • 1





            That's an option as well. But given that you have very less training data. It would be better to maximise the gan's potential by training on the entire set.

            – Haran Rajkumar
            Mar 25 at 8:44











          • Yup i have very less data. and i am doing training on entire set.

            – Hitesh
            Mar 26 at 4:24













          1












          1








          1







          WGAN in the vanilla version cannot generate images conditionally. Therefore, the WGAN you have trained can only generate images without any knowledge of which class they belong to.



          To be able to generate images of a particular label, check out conditonal gans. Here's a medium article to get you started.



          The alternate option is to train a discriminator from the original training data and use that discriminator to help you manually classify the images.






          share|improve this answer













          WGAN in the vanilla version cannot generate images conditionally. Therefore, the WGAN you have trained can only generate images without any knowledge of which class they belong to.



          To be able to generate images of a particular label, check out conditonal gans. Here's a medium article to get you started.



          The alternate option is to train a discriminator from the original training data and use that discriminator to help you manually classify the images.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 22 at 9:41









          Haran RajkumarHaran Rajkumar

          538316




          538316












          • yup , i thought the same. What i did is, i run my WGAN code 2 times. each time i only give single class. Is this correct approach?

            – Hitesh
            Mar 25 at 7:29






          • 1





            That's an option as well. But given that you have very less training data. It would be better to maximise the gan's potential by training on the entire set.

            – Haran Rajkumar
            Mar 25 at 8:44











          • Yup i have very less data. and i am doing training on entire set.

            – Hitesh
            Mar 26 at 4:24

















          • yup , i thought the same. What i did is, i run my WGAN code 2 times. each time i only give single class. Is this correct approach?

            – Hitesh
            Mar 25 at 7:29






          • 1





            That's an option as well. But given that you have very less training data. It would be better to maximise the gan's potential by training on the entire set.

            – Haran Rajkumar
            Mar 25 at 8:44











          • Yup i have very less data. and i am doing training on entire set.

            – Hitesh
            Mar 26 at 4:24
















          yup , i thought the same. What i did is, i run my WGAN code 2 times. each time i only give single class. Is this correct approach?

          – Hitesh
          Mar 25 at 7:29





          yup , i thought the same. What i did is, i run my WGAN code 2 times. each time i only give single class. Is this correct approach?

          – Hitesh
          Mar 25 at 7:29




          1




          1





          That's an option as well. But given that you have very less training data. It would be better to maximise the gan's potential by training on the entire set.

          – Haran Rajkumar
          Mar 25 at 8:44





          That's an option as well. But given that you have very less training data. It would be better to maximise the gan's potential by training on the entire set.

          – Haran Rajkumar
          Mar 25 at 8:44













          Yup i have very less data. and i am doing training on entire set.

          – Hitesh
          Mar 26 at 4:24





          Yup i have very less data. and i am doing training on entire set.

          – Hitesh
          Mar 26 at 4:24



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55293914%2fhow-to-know-labels-of-generated-images-in-wgan-using-keras%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

          용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

          155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해