denguir / student-teacher-anomaly-detection

Student–Teacher Anomaly Detection with Discriminative Latent Embeddings
180 stars 43 forks source link

Suspicious square shape in segmentation maps #21

Open lorenzofilizola opened 1 year ago

lorenzofilizola commented 1 year ago

Hello, I am noticing that small anomalies are often imprecisely localized with square shapes, mainly using a patch size of 65.

014 017 020

Does anyone have an idea of what could cause this kind of problem? I suspect it could be a problem with FDFE, since it's pretty much the only part of the code I have not inspected myself.

In addition to the training implemented in the repo, I am doing a pre-training of the teacher network on ImageNet, as explained in the original paper. I also removed the dropout layers from the teacher/student architecture, since I wanted to reproduce the paper results and those are not mentioned in Bergmann's work.

sushovanjena commented 1 year ago

I have been studying the paper all these while. Teacher training on ImageNet and removal of dropout is absolutely right. This I have confirmed from the author. It may be due to fdfe, but u may try with patch size 17,33 or multi-scale also. I will also check the fdfe implementation. What performance did u get ?

lorenzofilizola commented 1 year ago

Bottle

Patch Size AUPRO AUROC
65 0.8203277491069684 0.9873015873015872

Cable

Patch Size AUPRO AUROC
65 0.588493822754899 0.8150299850074961

Capsule

Patch Size AUPRO AUROC
65 0.6944213879887304 0.6445951336258476
33 0.60722074480315 0.6039090546469884
17 0.6617633433551405 0.5967291583566016

These are the results I got up to now. Before pre-training on ImageNet, results were much lower (mainly the AUPRO).

sushovanjena commented 1 year ago

Can we discuss over mail. Give ur mail id or mail me at sushovanjena@gmail.com

lorenzofilizola commented 1 year ago

Sure, I mailed you.