JuliaWolleb / DeScarGAN

Official Pytorch implementation of the paper DeScarGAN
Apache License 2.0
30 stars 5 forks source link

Regards to Testing mechanism #8

Open seanko29 opened 2 years ago

seanko29 commented 2 years ago

Hello authors! I have question regards to the paper itself. I ain't sure if this is the right place to ask. Figure 1 seems to be the training mechanism. However, I am not sure how the testing mechanism work. If I am not mistaken, is the testing mechanism only work with G_c generator? If a normal healthy image becomes input image instead of an diseased patient image, will it generate a healthy image and find the difference map between healthy normal (target) and generated abnormal?

It would be so thankful if you can explain about the testing process! I cannot catch up or find it in the paper.

Thank you in advanced!

JuliaWolleb commented 2 years ago

Hi For our application of anomaly detection, during testing, we are interested in generating only healthy subjects. So any input image (both healthy and diseased) are passed through the generator G_h, which generates a fake healthy subject. If the input image is diseased, the difference map will show the anomaly. If the input is healthy, the difference map should be close to zero. Does that make sense? Let me know if you need further explanations

seanko29 commented 2 years ago

I think I understood it well! Thanks! Can I ask you something more?

  1. In the training scheme (Fig 1), there is an "if" statement where if c'=h , then a_h = a_c', else: a_h = a_c Then, during training, how does the model choose which artificial image (a_c or a_c') to use for difference map (when comparing it with the input image r_c)?
  2. Also, does this method works only for one specific disease (ex. water in the lungs?) If the dataset is composed of several diseases (ex. damaged lungs, bloated lungs, water in the lungs, etc..) , will it be hard for the model to learn all these anomalies ?
  3. Lastly, if I am not mistaken, is the difference map itself used in training backprop? or is it just the purpose of visualization?

Thank you!

JuliaWolleb commented 2 years ago

Sure!

  1. During training, the difference map is not used. The difference map is only used for evaluation. This "if" statement says that during evaluation, we take the difference between the original image r_c (of whatever class) and the fake healthy image a_h.
  2. If the dataset is composed of several diseases, you will need to build a multi-class classifier instead of a binary classifier. You will also need multiple heads on your generator. Theoretically it would work, but it will get more complex, the more classes you add.
  3. The difference map is only for the purpose of visualization