PX4AI is a transformer-based autoencoder designed to efficiently annotate anomalies in PX4 log files.
Autoencoders learn to compress regular data from log files into a compact latent space. This process reduces the data to its essential features, helping to filter out unnecessary details and noise. When an autoencoder encounters new data that includes anomalies or unusual patterns, it struggles to reconstruct these accurately because they don't match the typical patterns it has learned. As a result, the error between the input and its reconstruction---often measured by how much the output differs from the input---increases significantly. This higher error signals the presence of an anomaly, as the model fails to replicate the input accurately when it differs from the norm.
PX4AI was trained on mission mode flight data from approximately 500 log files of hexacopters and quadcopters. Only a selected subset of attributes from the Ulog files was used for training.
git clone https://github.com/AkashKarnatak/PX4AI.git
cd PX4AI
conda env create -f environment.yml
then activate the environment using,
conda activate px4ai
Preprocess ulog files in csv format as described here.
Store the csv files in the ./data/csv_files
directory. You can also download the dataset that
was used for training the model, here.
Once you have prepared your data in the ./data/csv_files
directory, you can proceed towards
model training or testing.
You can start training the model by running the following command,
python3 train.py
You can also view training metrics and graphs on tensorboard,
tensorboard --logdir=runs
Model checkpoints are available in the ./checkpoints
directory. You can test your model on the
test dataset by running the following command,
python3 inference.py
Contributions are welcome! If you find a bug, have an idea for an enhancement, or want to contribute in any way, feel free to open an issue or submit a pull request.
This project is licensed under the AGPL3 License. For details, see the LICENSE file.