A Cyberattack Warning System for Enhancing Connected Vehicle Safety Under Spoofing Cyberattacks: A Generative-Based Human-in-the-Loop Trajectory Prediction Approach
This repository contains the research code used for experiments on traffic/vehicle trajectory analysis and forecasting. The project has been lightly refactored to make core utilities reusable and easier to run while keeping the original experiment scripts for reference.
Contents
src/caca/— refactored library code (preprocessing, GAN, training helpers).scripts/— small CLI wrappers for common tasks (preprocessing, legacy runners).tests/— unit tests and lightweight smoke tests suitable for CI.- legacy top-level scripts — original experiment notebooks and scripts (left for reproducibility).
Requirements
- Python 3.8+ (use a virtual environment)
- See
requirements.txtfor the Python dependencies used for tests and examples.
Quick start
- Create and activate a virtual environment, then install dependencies:
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt- Run the preprocessing example (adjust input/output paths):
python scripts/run_preprocessing.py --input path/to/your.csv --output preprocessed.csvTesting
- Run the unit tests with
pytest:
pip install -r requirements.txt
pytest -qBest practices
- Do not commit large datasets, trained model weights, or logs to the repository — store them externally or use Git LFS.
- Prefer importing functions from
src/caca/rather than executing legacy scripts directly. - Add focused unit tests when refactoring legacy scripts to preserve behavior.
Related paper (recommended reading)
-
For background and motivation, please consult the published paper available on IEEE Xplore:
https://ieeexplore.ieee.org/abstract/document/11034672
Please use IEEE Xplore's "Cite This" tool to copy the authoritative citation (BibTeX/IEEE/APA) for that paper.
How to cite this repository
- If you use the code in this repository, please cite the repository. Example BibTeX entry:
@misc{A-Cyberattack-Warning-System-2026,
title = {A-Cyberattack-Warning-System},
author = {YingfanGu},
year = {2026},
howpublished = {GitHub repository},
url = {https://github.com/YingfanGu/A-Cyberattack-Warning-System}
}License
- This project is licensed under the MIT License — see the
LICENSEfile for details.
Contributing
- Contributions are welcome. Please open an issue or a pull request with a concise description of the change.
Contact
- For questions about the code or the experiments, open an issue or contact the maintainer via the repository.