使用GAN进行异常检测——可以进行网络流量的自学习哇,哥哥,人家是半监督,无监督的话,还是要VAE,SAE。

摘要:
实验结果表明,以下主要是图像异常检测。

实验了效果,下面的还是图像的异常检测居多。

https://github.com/LeeDoYup/AnoGAN

https://github.com/tkwoo/anogan-keras

看了下,本质上是半监督学习,一开始是有分类模型的。代码如下,生产模型和判别模型:

### generator model define
def generator_model():
    inputs = Input((10,))
    fc1 = Dense(input_dim=10, units=128*7*7)(inputs)
    fc1 = BatchNormalization()(fc1)
    fc1 = LeakyReLU(0.2)(fc1)
    fc2 = Reshape((7, 7, 128), input_shape=(128*7*7,))(fc1)
    up1 = Conv2DTranspose(64, (2, 2), strides=(2, 2), padding='same')(fc2)
    conv1 = Conv2D(64, (3, 3), padding='same')(up1)
    conv1 = BatchNormalization()(conv1)
    conv1 = Activation('relu')(conv1)
    up2 = Conv2DTranspose(64, (2, 2), strides=(2, 2), padding='same')(conv1)
    conv2 = Conv2D(1, (5, 5), padding='same')(up2)
    outputs = Activation('tanh')(conv2)
    
    model = Model(inputs=[inputs], outputs=[outputs])
    return model

### discriminator model define
def discriminator_model():
    inputs = Input((28, 28, 1))
    conv1 = Conv2D(64, (5, 5), padding='same')(inputs)
    conv1 = LeakyReLU(0.2)(conv1)
    pool1 = MaxPooling2D(pool_size=(2, 2))(conv1)
    conv2 = Conv2D(128, (5, 5), padding='same')(pool1)
    conv2 = LeakyReLU(0.2)(conv2)
    pool2 = MaxPooling2D(pool_size=(2, 2))(conv2)
    fc1 = Flatten()(pool2)
    fc1 = Dense(1)(fc1)
    outputs = Activation('sigmoid')(fc1)
    
    model = Model(inputs=[inputs], outputs=[outputs])
    return model

 对于无监督GAN就搞不定了!

https://zhuanlan.zhihu.com/p/32505627

https://arxiv.org/pdf/1805.06725.pdf

https://www.ctolib.com/tkwoo-anogan-keras.html

https://github.com/trigrass2/wgan-gp-anomaly/tree/master/models

免责声明:文章转载自《使用GAN进行异常检测——可以进行网络流量的自学习哇,哥哥,人家是半监督,无监督的话,还是要VAE,SAE。》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇Redis的高可用Python内置进制转换函数(实现16进制和ASCII转换)下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

.NET应用程序7种最常见的性能问题及其解决方案

译者注:这篇文章依然是介绍.NET Framework框架下的性能问题排查,可能并不直接适用于.NET Core,但有时也能提供一些参考。   .NET应用程序7种最常见的性能问题及其解决方案 原文地址:https://www.eginnovations.com/blog/top-7-net-application-performance-problems...

HTTP接口抓包工具之Fiddler

Fiddler的基本功能介绍: Fiddler是最强大最好用的Web调试工具之一,它能记录所有客户端和服务器的http和https请求,允许你监视,设置断点,甚至修改输入输出数据,Fiddler包含了一个强大的基于时间脚本的子系统,并且能使用.NET语言进行扩展。对HTTP协议越了解,就能越掌握Fiddler的使用方法。越使用Fiddler,就越能帮助了解...

ubuntu14.04安装 Apache2 并配置https

一、安装 Apache2   sudo apt-get update   sudo apt-get install apache2   安装完apache2,默认根目录在/var/www/html 下,点击其下的html 文件,可打开 Apache2的默认页面。 输入 http://localhost/index.html, 也可以通过http://...

IDEA分析JAVA内存溢出和内存泄漏

参考资料: 1、JProfiler分析dump文件   https://blog.csdn.net/axin1240101543/article/details/105142141 2、JProfiler使用教程 https://www.cnblogs.com/jpfss/p/11057440.html https://segmentfault.com/a...

Windows 下apache https配置(phpstudy)

1.首先获取证书,https://www.pianyissl.com/ 免费三个月的 或者 自己生成私钥、证书,然后应用到apache中。 http://blog.sina.com.cn/s/blog_58f71ef00102wvlx.html 讲解了如何在windows PHPStudy Apache 配置支持HTTPS http://www.cnbl...

免费搜索引擎提交网址大全

首先我们建站网站之后就是让搜索引擎知道我们的网站,最直接的办法就是去搜索引擎入口去提交网址,本文整理出多个入口提供给大家: 1. 中文网站提交网址大全 360搜索引擎登录入口:http://info.so.360.cn/site_submit.html 即刻搜索网站提交入口:http://zz.jike.com/submit/genUrlForm 盘古数据...