This is the official repository for the paper "A real-time anomaly detection method for robots based on a flexible and sparse latent space", publised in Engineering Applications of Artificial Intelligence.
To download the codes, please clone this repository.
git clone https://github.com/twkang43/Sparse-MAF-AAE.git
cd sparse-maf-aae
The code requires a python>=3.11 environments. Follow the instruction.
We recommend to use conda:
conda create -n <env_name> python=3.11
conda activate <env_name>
pip install -r requirements.txt
We used the voruas-AD dataset from the paper titled "The voraus-AD Dataset for Anomaly Detection in Robot Applications" by Jan Thieß Brockmann, Marco Rudolph, Bodo Rosenhahn, and Bastian Wandt.
To download the dataset, please refer to the instructions provided in the official Github repository of the voraus-AD.
We employed the 100 Hz dataset for our implementation. To reproduce our results, please make sure to use the 100 Hz dataset as well.
The voraus-AD dataset should be placed in the following path:
<your_path_to_the_code>/dataset/voraus-AD/
You can run Sprase MAF-AAE with the following instructions:
python main.py \
--exec <exec> \
--signals <signals> \
--frequency <frequency> \
--subset_size <subset_size>
There are four arguments:
-
exec: This determines the execution mode of the code. The choices aretrain,eval, andall. If you useall, the code will first train the model and then automatically evaluate it after training is completed. The defualt setting isall. -
signals: This specifies the type of signals to use. The choices available aretorques,currents,encoders, andmachine. The default option istorques. -
frequency: The parameter denotes the frequency of the dataset. The available frequencies are 100 Hz, 50 Hz, 25 Hz, and 10 Hz. The default value is 50 Hz. -
subset_size: This indicates the size of the subset used for training (train gain). The available choices for this parameter are 1.0 (948), 0.5 (474), 0.25 (237), and 0.125 (118). The default value is 1.0.
We compared our model with 3 baselines: LSTM-VAE, Anomaly Transformer, and MVT-Flow.
Generally, Sparse MAF-AAE achieves SOTA on various scenarios.
If you use the Sparse MAF-AAE in your research, please cite the following paper:
@article{kang2025real,
title={A real-time anomaly detection method for robots based on a flexible and sparse latent space},
author={Kang, Taewook and You, Bum-Jae and Park, Juyoun and Lee, Yisoo},
journal={Engineering Applications of Artificial Intelligence},
volume={158},
pages={111310},
year={2025},
publisher={Elsevier}
}
This project is licensed under the MIT License.