DR4MTSAD (Exploring the Influence of Dimensionality Reduction on Anomaly Detection Performance in Multivariate Time Series) 🚀
This repository contains the implementation and analysis of two advanced unsupervised anomaly detection models - MUTANT and Anomaly-Transformer - applied to time series data. The focus of this project is on integrating dimensionality reduction techniques to enhance the performance and efficiency of these models.
Model |
# Dimensions
Remaining |
DR Layer
(Technique) |
MSL | SMAP | SWaT | ||||||
Precision | Recall | F1-score | Precision | Recall | F1-score | Precision | Recall | F1-score | |||
MUTANT | (Original) | None | 0.9464 | 0.9520 | 0.9492 | 0.9658 | 0.9787 | 0.9722 | 0.9805 | 0.9881 | 0.9842 |
To Half Dim.
27 - 12 - 25 |
PCA | 0.9307 | 0.9807 | 0.9551 | 0.9725 | 0.9630 | 0.9678 | 0.9729 | 1.0000 | 0.9863 | |
Rand. Proj. | 0.8619 | 1.0000 | 0.9258 | 0.9703 | 0.9782 | 0.9742 | 0.9782 | 0.9882 | 0.9832 | ||
UMAP | 0.8846 | 0.9762 | 0.9281 | 0.9836 | 0.9453 | 0.9640 | 0.9491 | 0.9838 | 0.9661 | ||
To Lowest Dim.
8 - 8 - 8 |
PCA | 0.9184 | 0.9848 | 0.9505 | 0.9882 | 0.9659 | 0.9769 | 0.9632 | 0.9866 | 0.9748 | |
Rand. Proj. | 0.9331 | 0.9762 | 0.9542 | 0.9550 | 0.9866 | 0.9706 | 0.9728 | 0.9856 | 0.9792 | ||
UMAP | 0.9341 | 0.9914 | 0.9619 | 0.9913 | 0.9399 | 0.9649 | 0.9833 | 0.9788 | 0.9810 | ||
Anomaly-Transformer | (Original) | None | 0.9188 | 0.9473 | 0.9329 | 0.9381 | 0.9939 | 0.9652 | 0.8844 | 1.0000 | 0.9386 |
To Half Dim.
27 - 12 - 25 |
PCA | 0.9146 | 0.9436 | 0.9289 | 0.9111 | 0.9916 | 0.9497 | 0.9223 | 1.0000 | 0.9596 | |
Rand. Proj. | 0.9191 | 0.9773 | 0.9473 | 0.9160 | 0.9950 | 0.9539 | 0.8889 | 1.0000 | 0.9412 | ||
UMAP | 0.9178 | 0.9735 | 0.9448 | 0.9264 | 0.9993 | 0.9615 | 0.8482 | 1.0000 | 0.9179 | ||
3 - 3 - 3 | PCA | 0.9172 | 0.9676 | 0.9417 | 0.9072 | 0.9945 | 0.9489 | 0.9706 | 0.9495 | 0.9600 | |
Rand. Proj. | 0.9180 | 0.9793 | 0.9477 | 0.9335 | 0.9919 | 0.9618 | 0.9891 | 0.8619 | 0.9212 | ||
UMAP | 0.9171 | 0.9560 | 0.9361 | 0.9320 | 0.9915 | 0.9608 | 0.9807 | 0.9229 | 0.9509 | ||
t-SNE | 0.9164 | 0.9490 | 0.9324 | 0.9310 | 0.9962 | 0.9625 | 0.9843 | 0.9082 | 0.9447 | ||
To Lowest Dim.
2 - 2 - 2 |
PCA | 0.9180 | 0.9683 | 0.9425 | 0.9070 | 0.9930 | 0.9481 | 0.9492 | 0.9696 | 0.9593 | |
Rand. Proj. | 0.9210 | 0.9473 | 0.9340 | 0.9429 | 0.9524 | 0.9476 | 0.9876 | 0.8862 | 0.9341 | ||
UMAP | 0.9183 | 0.9677 | 0.9423 | 0.9330 | 0.9945 | 0.9628 | 0.9890 | 0.8871 | 0.9352 | ||
t-SNE | 0.9197 | 0.9749 | 0.9465 | 0.9353 | 0.9977 | 0.9655 | 0.9854 | 0.9237 | 0.9536 |
- MUTANT: Leveraging Graph Convolutional Networks (GCNs) and attention-based Variational Auto-Encoders (VAEs).
- Anomaly-Transformer: Utilizing association discrepancies for anomaly identification.
- PCA (Principal Component Analysis)
- UMAP (Uniform Manifold Approximation and Projection)
- t-SNE (t-Distributed Stochastic Neighbor Embedding)
- Random Projection
Anomaly_Transformer.ipynb
: Training and testing the Anomaly-Transformer model.MUTANT.ipynb
: Training and testing the MUTANT model.ApplyDimensionalityReduction.ipynb
: Application of various dimensionality reduction techniques to the datasets.
The data
directory contains the following datasets used for empirical analysis:
- MSL: Mars Science Laboratory Rover dataset.
- SMAP: Soil Moisture Active Passive Satellite dataset.
- SWaT: Secure Water Treatment dataset.
Results.md
: A detailed markdown file containing the results and findings of the model training and testing.
Each Jupyter Notebook is self-contained and includes the necessary code for model training, testing, and applying dimensionality reduction techniques. Follow the steps in each notebook to replicate the experiments.
While running the Anomaly-Transformer model, please change the file Anomaly-Transformer/data_factory/data_loader.py
.
- Significant enhancement in anomaly detection performance with dimensionality reduction.
- Notable reduction in training times, especially when data is reduced to its lowest dimensions.
- Both MUTANT and Anomaly-Transformer models show adaptability and robustness across various datasets and dimensionality reduction scenarios.
Contributions to this project are welcome! Please refer to the issues tab for pending enhancements and bug fixes.
If you use this work in your research, please cite:
"Exploring the Influence of Dimensionality Reduction on Anomaly Detection Performance in Multivariate Time Series"
https://github.com/mahsunaltin/3DMesh
This project is licensed under the terms of the MIT license.