A tool to explain anomalies identified by an auto-encoder based on pvalues
Project description
AE-pvalues
This is the implementation of AE-pvalues proposed in the paper Towards Understanding Alerts raised by Unsupervised Network Intrusion Detection Systems, RAID2023 (https://doi.org/10.1145/3607199.3607247). The method allows you to obtain explanations of the anomalies identified by an auto-encoder (AE).
Authors
Installation
Pip Installation
You can install it through pip
pip install ae-pvalues
Usage/Examples
from ae_pvalues import ae_pvalues
model = # Any autoencoder
x_train = np.load("./demo/example/x_train.npy") # Normal data
x_test = np.load("./demo/example/x_test.npy") # Data to explain
order, pvalues = ae_pvalues(model, normal_data=x_train, data_to_explain=x_test)
If you installed the module then you can use ae-pvalues directly from the command line :
ae-pvalues -v ./demo/example/x_train.npy ./demo/example/rec_x_train.npy ./demo/example/x_test.npy ./demo/example/rec_x_test.npy -o outputs
-v
: verbose mode
-o
: output folder
This produces two output files namely:
- dimensions_abnormal_order.npy : order of dimension by abnormality
- dimensions_abnormal_pvalues.npy : raw pvalue scores
Demo
A notebook is available in the demo folder to show an example of use. Please note that the notebook requires the following dependencies :
- scikit-learn
- tensorflow
- seaborn
- plotly
which can be installed with pip using the following comand line :
python3 -m pip install scikit-learn tensorflow seaborn plotly
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file ae_pvalues-1.0.tar.gz
.
File metadata
- Download URL: ae_pvalues-1.0.tar.gz
- Upload date:
- Size: 306.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6c640e8109589d7087c9b8deef0dcc99bedbb45ff8a2335a39aa253c8d6adb9 |
|
MD5 | e3ac735266aeb728281f2181561b5c32 |
|
BLAKE2b-256 | d51d9852ea59faa4560abb195e7ed29c35d37599ab375e4ecc6d24ba04743f05 |
File details
Details for the file ae_pvalues-1.0-py3-none-any.whl
.
File metadata
- Download URL: ae_pvalues-1.0-py3-none-any.whl
- Upload date:
- Size: 310.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25b7ceffc4bc89190a6216d9c76149b3f01a704665ca23f1a649c6c5ed0c561a |
|
MD5 | 3c5495109ba4c1b45c12cc4b8586a6a4 |
|
BLAKE2b-256 | e6cde3c1fc3943c3ba57b52b92d201ecc06a46203d5837f8cae4990e169cffac |