sjtuplayer / anomalydiffusion

[AAAI 2024] AnomalyDiffusion: Few-Shot Anomaly Image Generation with Diffusion Model
MIT License
138 stars 19 forks source link

Imbalance in Images During Training #8

Open CVKim opened 6 months ago

CVKim commented 6 months ago

image

Using the sample config hyperparameters as they are, and only the hazelnut dataset, the above phenomenon occurs.

What could be the reason?

sjtuplayer commented 6 months ago

To avoid the overfitting problem of the position encoder, it is encouraged to train all the anomaly types at the same time. And for this figure, columns 2 and 4 have good results. And I'm not sure which "phenomenon" you're referring to (column 1 or column 3)?

CVKim commented 6 months ago

Is it okay that columns 2, 3, and 4 are saved with a rotation applied to the images? Additionally, it seems that column 1 has been saved with a zoomed-in effect. Is there any issue with this, and what can be done to address it for columns 1 to 4?

Additionally, I would appreciate it if you could explain how to save each image individually.

sjtuplayer commented 6 months ago

During training, to avoid the overfitting of the spatial encoder, we apply data augmentation (random rotation, translation, and zoom-in) to the training data. Therefore, the saved images are rotated and zoomed-in. To save images individually, you can modify the saving operation in the function 'log_img' in main.py.

CVKim commented 6 months ago

Thank you for your help.

I respect you!