Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

whether we need to pay attention to some details during training? #6

Open
AdamZHAOZhou opened this issue Oct 4, 2021 · 12 comments
Open

Comments

@AdamZHAOZhou
Copy link

Hi,
 I downloaded your code and run it, but I can't get your results. Do I need to pay attention to certain details during the training process? And is your model easy to train?
Looking forward to your reply.

@SharifAmit
Copy link
Owner

Hi, could you elaborate the problem you are facing?

As far as the training goes, we don't change any hyperparameters during training.

@AdamZHAOZhou
Copy link
Author

traning_80th_epoch
until now, I have trained 80 epoch, and I did not change any hyperparameters, but the results of F1 score was still less than 0.8.
results

@AdamZHAOZhou
Copy link
Author

I downloaded your weight and test, the results was right, so I did not whether I need to pay attention to some details during training.

@SharifAmit
Copy link
Owner

SharifAmit commented Oct 4, 2021

Hi, you are on the right track. After training, loop over all the models and then print the metics for each to find the best snapshot. As GAN doesn't converge like regular model, the loss values fluctuate a lot, so the last saved model won't be the best one.

You can also try to reload the best snapshot and train again. I believe I did it for some of my similar work, as the discriminator might suffer from mode collapse and only print loss=0.00 . This is a common phenomenon with GAN training.

Also, while testing, try to use a smaller stride ( stride=3) to do the patch-wise prediction on the whole test image. This is slow but will you give you the best auc and F1 score.

Hope this helps!

@AdamZHAOZhou
Copy link
Author

I tested each epoch, but the F1 score was still less than 0.80.
I also tried a smaller stride (stride=3), but not much improvement.
Could you tell me about your training process?

@SharifAmit
Copy link
Owner

SharifAmit commented Oct 5, 2021

I have trained the model for 100 epochs. After training, I loaded the weights of the best performing Coarse and Fine Generator ( For the same epoch) and then trained again for 100 epochs. I did not load the weights of the discriminators while retraining. So the discriminators were trained from scratch. I think I did this procedure 2-3 times. And also looped over all 100 saved weights to find the best performing coarse and fine generator pairs.

Thanks !

@AdamZHAOZhou
Copy link
Author

TABLE1
For table 1 in your paper, I used sensitivity,specificity and accuracy to calculate the F1 score on CHASE-DB1, and I got 0.7858 F1 score, but your result is 0.8957. M-GAN's sensitivity,specificity and accuracy better than your RV-GAN, however, F1 score is 0.08 lower than yours. Could you explain this?

@SharifAmit
Copy link
Owner

ChaseDB doesnt come with training and test splits. Which images are you using for Chase-DB for testing ? Maybe the evaluation technique + test images you are using is giving you the bad results?

Also the table results are correct, as we have experimented and validated the weights extensively with different stride values, and found stride=3 to give us the best results. The only typo is the M-GAN sensitivity result will be in BOLD text rather than ours.

@AdamZHAOZhou
Copy link
Author

I used sensitivity=0.8199, specificity=0.9806 and accuracy= 0.9697 to calculate F1 score, as shown in table 1, however, the value of F1 score I calculated by hand is too far from the value of F1 score in the table 1.

@SharifAmit
Copy link
Owner

F1-scrore is calculated using Precision and Sensitivity. We used pycm library.

import pycm

cm = ConfusionMatrix(actual_vector=y_true, predict_vector=y_pred)

print("Specificity: " + str(cm.TNR[1]))
print("Sensitivity: " + str(cm.TPR[1]))
print("Accuracy : " + str(cm.ACC[0]))
print("F1 Score: " + str((2*cm.PPV[0]*cm.TPR[1])/(cm.PPV[0]+cm.TPR[1])))

@AdamZHAOZhou
Copy link
Author

AdamZHAOZhou commented Oct 5, 2021

I think you should check the calculation again instead of the program. Because I also tested M-GAN by sensitivity=0.8234, specificity=0.9938 and accuracy= 0.9736 to calculate F1 score, which is right.
755260526

@smridhi29
Copy link

I downloaded your weight and test, the results was right, so I did not whether I need to pay attention to some details during training.

Where did you test the weights and biases? Could you please help me with the procedure?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants