Title: | An Implementation of Process-Aware Stealthy Attack Detection(PASAD) |
---|---|
Description: | Anomaly detection method based on the paper "Truth will out: Departure-based process-level detection of stealthy attacks on control systems" from Wissam Aoudi, Mikel Iturbe, and Magnus Almgren (2018) <DOI:10.1145/3243734.3243781>. Also referred to the following implementation: <https://github.com/rahulrajpl/PyPASAD>. |
Authors: | Donghwan Kim |
Maintainer: | Donghwan Kim <[email protected]> |
License: | GPL-3 |
Version: | 1.0 |
Built: | 2025-02-16 03:15:23 UTC |
Source: | https://github.com/ainsuotain/pasadr |
Singular value decomposition of log covariance matrix (Trajectory matrix). This is a test phase of pasad
pasad_test(obj, test_idx, newdata, r = 3, calib = 1, thres = NULL, movn = 10, plot = TRUE)
pasad_test(obj, test_idx, newdata, r = 3, calib = 1, thres = NULL, movn = 10, plot = TRUE)
obj |
A pasad model object result from |
test_idx |
A test index for pasad. For example, |
newdata |
A test data for pasad. |
r |
A cardinal number of eigen value. Generally, r is same by the training phase. |
calib |
A threshold multiplier. since the threshold calculated during the training phase is a rather small, so the calib can be multiplied to the threshold. (default is 1, should be biggner than 0). |
thres |
If user already know the threshold, user can input the threshold. |
movn |
A moving average window value to see the trend of the score. |
plot |
Whether to draw a anomaly score or not. (default : TRUE). |
An object of class pasad_test
.
total_scores |
Anomaly score results from the pasad. |
tr_score |
A pasad score of the training index. |
te_score |
A pasad score of the test index. |
extraced |
A noise-reduced signal. |
threshold |
A (calculated) threshold. |
outidx |
An index of a anomaly score greater than the threshold. |
Donghwan Kim
[email protected]
[email protected]
Wissam Aoudi, Mikel Iturbe, and Magnus Almgren (2018) <DOI:10.1145/3243734.3243781>. In Proceedings of the 2018 ACM SIGSAC Conference on Computer and Communications Security, pp. 817-831.
https://github.com/mikeliturbe/pasad
https://github.com/rahulrajpl/PyPASAD
# data input fpath = system.file("extdata", "sa.csv", package="pasadr") sa = read.csv(fpath) # check data sig = sa$V5 plot(sig) # training using pasad and check the scree plot train_idx = c(1:500) obj = pasad_train(x = sig, train_idx = train_idx, r = 1, ws = length(train_idx)/2, scree_plot = TRUE) # test whole data and check the anomaly score of test data pred = pasad_test(obj = obj, test_idx = 1:4801, newdata = sig, r = 1, calib = 1, plot = TRUE) # check the structure of test results str(pred)
# data input fpath = system.file("extdata", "sa.csv", package="pasadr") sa = read.csv(fpath) # check data sig = sa$V5 plot(sig) # training using pasad and check the scree plot train_idx = c(1:500) obj = pasad_train(x = sig, train_idx = train_idx, r = 1, ws = length(train_idx)/2, scree_plot = TRUE) # test whole data and check the anomaly score of test data pred = pasad_test(obj = obj, test_idx = 1:4801, newdata = sig, r = 1, calib = 1, plot = TRUE) # check the structure of test results str(pred)
Singular value decomposition of log covariance matrix (Trajectory matrix). This is a training phase of pasad
pasad_train(x, train_idx, r = 3, ws, scree_plot = FALSE)
pasad_train(x, train_idx, r = 3, ws, scree_plot = FALSE)
x |
A signal data for inspectation. |
train_idx |
A training index fot pasad. For example, |
r |
A cardinal number of eigen value. Generally r is smaller than 3. (default : 3). |
ws |
A length of lag for creating covariance matrix. (default is a half of training length). |
scree_plot |
Whether to draw a scree_plot or not. (default : TRUE). |
An object of class pasad_train
.
N |
A length of signal data. |
L |
A length of lag for creating covariance matrix. |
U |
The r leading eigenvectors. |
X |
A trajectory matrix. |
x |
An original signal. |
ws |
A length of lag for creating covariance matrix. |
train_idx |
A training index fot pasad. |
x_train |
A data used for training. |
singulars |
A transpose of singular matrix |
Donghwan Kim
[email protected]
[email protected]
Wissam Aoudi, Mikel Iturbe, and Magnus Almgren (2018) <DOI:10.1145/3243734.3243781>. In Proceedings of the 2018 ACM SIGSAC Conference on Computer and Communications Security, pp. 817-831.
https://github.com/mikeliturbe/pasad
https://github.com/rahulrajpl/PyPASAD
# data input fpath = system.file("extdata", "sa.csv", package="pasadr") sa = read.csv(fpath) ## NOT RUN: ## data(package = "pasadr") # check data sig = sa$V5 plot(sig) # training using pasad and check the scree plot train_idx = c(1:500) obj = pasad_train(x = sig, train_idx = train_idx, r = 1, ws = length(train_idx)/2, scree_plot = TRUE) # check the pasad model objects str(obj)
# data input fpath = system.file("extdata", "sa.csv", package="pasadr") sa = read.csv(fpath) ## NOT RUN: ## data(package = "pasadr") # check data sig = sa$V5 plot(sig) # training using pasad and check the scree plot train_idx = c(1:500) obj = pasad_train(x = sig, train_idx = train_idx, r = 1, ws = length(train_idx)/2, scree_plot = TRUE) # check the pasad model objects str(obj)