cuteboyqq / skip-GANOMALY-Pytorch

GANomaly, Skip-Ganomaly, Skip-CBAM-GANomaly, pytorch, CIFAR10, MNIST
7 stars 0 forks source link

Questions about how to test #2

Open phonver opened 1 year ago

phonver commented 1 year ago

May I ask how to test my image after training and obtaining the weight file? Why do I still need to put normal and abnormal images in the testing program? How to input an image and give me a result to determine whether the image is normal or abnormal?

cuteboyqq commented 1 year ago

image Why do I still need to put normal and abnormal images in the testing program? Answer : It it OK to put normal dataset as abnormal dataset, it means , two kind of datasets are same, so when draw loss valse distribution and histogram of two dataset, the two dataset distribution will overlap

l aim to find to loss threshold to split the normal and abnormal datasets by this GANomaly model , and this is the final goal of the GANomaly model the find the anomaly images by loss threshold For example : loss Threshold = 2.0 if (image inference loss value) <= 2.0, then it is normal images else if (image inference loss value) >2.0, then it is anomaly image

phonver commented 1 year ago

Thank you very much for your reply, it has been very helpful to me! Also, I would like to ask:

  1. It seems that the program has set up a log file and loss image to be generated after testing, but after I finished testing, nothing was generated, only the loss value of each image, no txt document recording loss, and no normal and abnormal loss scatter plots
  2. The results of my testing are shown in the following. If the program is searched from normal to abnormal folders, the distinction between my normal and abnormal losses is not obvious. I trained 1000 epochs, and the images were normal: 600+200, and abnormal: 100. What is the problem? Thank you for your answer, thank you again!
  3. After determining the reliability of the model through testing, where is the threshold set and where is the input image based on the threshold to determine whether the image is normal or abnormal?

(0-20 is normal folder/21-39 is abnormal folder) 0 Start normal AE: loss : 144985.203125 1 Start normal AE: loss : 111534.7890625 2 Start normal AE: loss : 109765.34375 3 Start normal AE: loss : 160862.078125 4 Start normal AE: loss : 134378.09375 5 Start normal AE: loss : 160629.828125 6 Start normal AE: loss : 145692.296875 7 Start normal AE: loss : 128675.0234375 8 Start normal AE: loss : 135770.75 9 Start normal AE: loss : 166877.890625 10 Start normal AE: loss : 104239.015625 11 Start normal AE: loss : 148326.796875 12 Start normal AE: loss : 135176.828125 13 Start normal AE: loss : 120638.796875 14 Start normal AE: loss : 131907.0 15 Start normal AE: loss : 128737.5 16 Start normal AE: loss : 120268.4921875 17 Start normal AE: loss : 107360.578125 18 Start normal AE: loss : 126900.3046875 19 Start normal AE: loss : 125779.484375 20 Start normal AE: loss : 90775.15625 21 Start normal AE: loss : 197498.015625 22 Start normal AE: loss : 121670.6171875 23 Start normal AE: loss : 171636.03125 24 Start normal AE: loss : 237891.578125 25 Start normal AE: loss : 80228.7421875 26 Start normal AE: loss : 124309.984375 27 Start normal AE: loss : 110375.9765625 28 Start normal AE: loss : 193006.921875 29 Start normal AE: loss : 140178.984375 30 Start normal AE: loss : 135623.609375 31 Start normal AE: loss : 123371.5390625 32 Start normal AE: loss : 143374.828125 33 Start normal AE: loss : 254320.671875 34 Start normal AE: loss : 93475.78125 35 Start normal AE: loss : 120973.1953125 36 Start normal AE: loss : 138065.140625 37 Start normal AE: loss : 123974.296875 38 Start normal AE: loss : 120979.8203125 39 Start normal AE: loss : 100628.9765625