ganomaly icon indicating copy to clipboard operation
ganomaly copied to clipboard

how can i balance the model

Open dgl547437235 opened this issue 5 years ago • 7 comments

hi,samet-akcay, thanks for your code, i train my custom data,then i write my test code,the effect of detecting NG samples is great,but often recognize OK samples as NG,how can i solve the problem

dgl547437235 avatar Jul 13 '20 02:07 dgl547437235

can you share your test code?Thank you! @dgl547437235

Johncheng1 avatar Jul 27 '20 07:07 Johncheng1

@Johncheng1 ,由于是业务代码,所以不能共享,下面是我的逻辑,我训练的正样本集是A,测试的正样本集是B,测试的负样本集是C,我每训练一定的批次,就去计算在A上的最大编码距离,然后用该距离去测试B和C,超过最大编码距离则判定为NG

dgl547437235 avatar Jul 29 '20 04:07 dgl547437235

好的,请问这个方法做出来的实际效果怎么样呢?

| | 王诚 | | 邮箱:[email protected] |

签名由 网易邮箱大师 定制

On 07/29/2020 12:24, NashString wrote:

@Johncheng1 ,由于是业务代码,所以不能共享,下面是我的逻辑,我训练的正样本集是A,测试的正样本集是B,测试的负样本集是C,我每训练一定的批次,就去计算在A上的最大编码距离,然后用该距离去测试B和C,超过最大编码距离则判定为NG

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

Johncheng1 avatar Jul 30 '20 14:07 Johncheng1

@ Johncheng1,效果不错,真阳率和真阴率可以同时达到100%

dgl547437235 avatar Jul 31 '20 03:07 dgl547437235

@ Johncheng1,效果不错,真阳率和真阴率可以同时达到100%

请问自己建立的模型出现这种情况该如何处理:G模型的损失值在逐步下降,而D模型的损失值基本不怎么变换,且不能区分出正样本和负样本(正样本和负样本的距离值的分布基本吻合)

Baitom avatar Aug 04 '20 07:08 Baitom

@dgl547437235 你好,我想请教以下您这里用的最大编码距离是什么距离? 因为代码的test里写的是用欧式距离,但是论文里分数用的L1范数。。。我将0设置为alnomaly,在mnist上训练了15轮之后,测试的时候发现NetG对0的重建效果也很好= =|||,分数无论用L1范数还是L2范数似乎都不能很好的找个阈值来区分正常和异常样本。

captainfffsama avatar Aug 13 '20 09:08 captainfffsama

@hqabcxyxz ,你好,我的最大编码距离是GNet在所有训练过的normal数据集上得出的,你可以试着把编码损失的权重增大,这么做可以有效提高异常样本的编码距离

dgl547437235 avatar Aug 14 '20 13:08 dgl547437235