SunnyHaze / IML-ViT

Official repository of paper “IML-ViT: Benchmarking Image manipulation localization by Vision Transformer”
MIT License
184 stars 23 forks source link

About low F1 score issue after 5 epoch training. #26

Closed fangfangbuaibiancheng closed 1 month ago

fangfangbuaibiancheng commented 1 month ago

作者您好,复现您代码的过程中,遇到了一些问题,我设置epoch为5,跑一个epoch大概需要1个小时,第一轮跑出来的F1分数很低,跑完5轮之后更低,不知道是什么原因,图片附上,谢谢。 QQ图片20240806201211 QQ图片20240806201217

SunnyHaze commented 1 month ago

感谢您对我们工作的关注,至少需要20个Epoch才能初步收敛,前期的F1确实会先低下去(尤其是第四个epoch),然后上升,我给你一个200Epoch CASIAv2训练过程中,在CASIAv1测试集的F1曲线作为参考。

image

SunnyHaze commented 1 month ago

关于计算开销的参考请参考下文:

Training IML-ViT with a batch size of 2 per GPU consumed 22GB of GPU memory per card. Using four NVIDIA 3090 GPUs, the model was trained on a dataset of 12,000 images over 200 epochs, taking approximately 12 hours. For inference, a batch size of 6 per GPU required 20GB of GPU memory, with an average prediction time of 0.094 seconds per image. Reducing the batch size to 1 decreased the GPU memory requirement to 5.4GB. Table 8 compares the complexity, measured in FLOPs and parameters, of IML-ViT with SoTA models. Overall, IML-ViT demonstrates competitive training and testing costs compared to other SoTA models.

SunnyHaze commented 1 month ago

如果还有更多问题,请feel free来讨论!

fangfangbuaibiancheng commented 1 month ago

感谢您对我们工作的关注,至少需要20个Epoch才能初步收敛,前期的F1确实会先低下去(尤其是第四个epoch),然后上升,我给你一个200Epoch CASIAv2训练过程中,在CASIAv1测试集的F1曲线作为参考。

image

太感谢您的回复了,接下来我将把epoch设置高些,再继续跑,还有一个问题,就是有没有测试AUC的代码可以提供,我目前跑的这几轮,没有看见AUC的结果,谢谢您,祝您学术长青。

SunnyHaze commented 1 month ago

麻烦参考这里手动实现一下吧,因为AUC确实算的很慢,所以没有在每一个训练过程中都实现。

https://github.com/SunnyHaze/IML-ViT/issues/8#issuecomment-1920706955

SunnyHaze commented 1 month ago

诚然我的那位同仁还是有点忙,最近确实没时间把这个实现进去,但是确实就按照issue 8 的实现就没啥问题。如果要进阶的实现可以参考我们最新的工作IMDLBenCo,但现在文档还在施工,暂时可能不是特别好上手,见谅。

fangfangbuaibiancheng commented 1 month ago

诚然我的那位同仁还是有点忙,最近确实没时间把这个实现进去,但是确实就按照issue 8 的实现就没啥问题。如果要进阶的实现可以参考我们最新的工作IMDLBenCo,但现在文档还在施工,暂时可能不是特别好上手,见谅。

没关系没关系,我参考上面的手动实现就行,目前没有问题啦,谢谢您啦,祝您学术长青!