Giter VIP home page Giter VIP logo

teo-sl / dplan_pytorch Goto Github PK

View Code? Open in Web Editor NEW
10.0 2.0 2.0 410 KB

This repository contains an implementation of an anomaly detection method called DPLAN, which is based on the reinforcement learning framework. The method is described in the paper "Toward Deep Supervised Anomaly Detection: Reinforcement Learning from Partially Labeled Anomaly Data" by Pang et al.

License: MIT License

Python 100.00%
anomaly-detection deep-learning machine-learning pytorch reinforcement-learning semi-supervised-learning unsw-nb15

dplan_pytorch's Introduction

DPLAN

A Pytorch implementation

author: Teodoro Sullazzo

This repository contains an implementation of an anomaly detection method called DPLAN, which is based on the reinforcement learning framework. The method is described in the paper "Toward Deep Supervised Anomaly Detection: Reinforcement Learning from Partially Labeled Anomaly Data" by Pang et al. You can access the paper here.

There are some differences between the work presented here and the original work by Pang et al.:

  • I introduced the set $D_n$, which contains known normal data.
  • I utilized a different kind of normalization for the Isolation Forest score.
  • I changed how the reward is computed for the extrinsic reward.
  • This implementation is based on the Pytorch framework.
  • There are also some other minor changes.

The code in env.py is derived from the code provided by the Github user lflfdxfn.

UPDATE - 13/12/2023

Added preprocessing for UNSW-NB15 dataset according to Pang et al's paper. It can be find in the preprocessing folder.

DRAN

The repository also includes a new method based on DPLAN called DRAN that removes the reinforcement learning component by using a regression layer. The method's workflow is described below.

General architecture

Main network training

dplan_pytorch's People

Contributors

teo-sl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dplan_pytorch's Issues

Change Labels

Why change part of the label to 2? What good does that do?Please,give me an answer.

find a error

can't find loss_sad and distance_from_c functions in util file,please give me some help, thanks

这里计算pred_y是不是有问题?

pred_y只是取【a0,a1】当中的a1,不应该是取max(a0,a1)嘛?如果这样处理,那么新来的一个样本,如何确定它是否有缺陷呢?

def test_model(test_set,policy_net):
policy_net.eval()
test_X, test_y=test_set[:,:-1], test_set[:,-1]
pred_y=policy_net(test_X).detach().cpu().numpy()[:,1]

roc = roc_auc_score(test_y, pred_y)
pr = average_precision_score(test_y, pred_y)
policy_net.train()
return roc,pr

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.