[![GitHub](https://img.shields.io/badge/GitHub-View_on_GitHub-blue?logo=GitHub)](https://github.com/DApIA-Project/Anomaly-Detection)
This library is a tool to detect anomalies in ADS-B messages. It is based on an artificial intelligence model that has been trained to detect spoofing, flooding and replay attacks.
All the used models are pre-trained and weight are stored in the library. On first use, the library will download the hashtable needed for the detection of replay attacks. Do not stop the program during the download
process.
<!-- make an image link to github -->
If you meet any problem with the library, feel free to open an issue our GitHub repository.
## Installation
```bash
pip install AdsbAnomalyDetector
```
## Usage
The library provides a function `predict` that should be connected to an ADS-B stream.
The function takes as input a list of ADS-B messages in a JSON format.
Every call should correspond to a unique timestamp, and so every messages should have the same timestamp.
If you want to process a whole timeseries, you should call the function multiple times.
The function stores the messages in caches, hence do not go backwards in time. Or the cache will automatically be cleared.
Here is an example of how to use the library, and show the format of the messages :
```python
from AdsbAnomalyDetector import predict, AnomalyType
messages = [ # list of flights messages at t = 1609459200
{
"icao24": "3C4A4D",
"callsign": "AFR123",
"timestamp": "1609459200",
"latitude": "48.8583",
"longitude": "2.2945",
"altitude": "10000",
"geoaltitude": "10000",
"velocity": "250",
"vertical_rate": "0",
"track": "90",
"alert": "False",
"spi": "False"
},
{
"icao24": "39AC45",
"callsign": "SAMU31",
"timestamp": "1609459200",
...
}, ...
]
messages = predict(messages)
```
By default the function will return for each message a json object with the following fields :
- anomaly : equals AnomalyType.VALID if the message is valid, else it will be equal to the type of anomaly detected (AnomalyType.SPOOFING, AnomalyType.REPLAY, AnomalyType.FLOODING)
- tag : a string useful under saturation to separate messages of simultaneous flights with identical ICAO24
You can set the parameter `compress` to False if you want the function to return the full message + the anomaly field.
You can also activate the debug mode by setting the parameter `debug` to True. In this case, the function will return some additional information about the predictions of each models.
Raw data
{
"_id": null,
"home_page": null,
"name": "AdsbAnomalyDetector",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "python, deep learning, tensorflow, aircraft, classification, ADS-B",
"author": "Pirolley Melvyn",
"author_email": null,
"download_url": null,
"platform": null,
"description": "[![GitHub](https://img.shields.io/badge/GitHub-View_on_GitHub-blue?logo=GitHub)](https://github.com/DApIA-Project/Anomaly-Detection)\n\nThis library is a tool to detect anomalies in ADS-B messages. It is based on an artificial intelligence model that has been trained to detect spoofing, flooding and replay attacks.\n\nAll the used models are pre-trained and weight are stored in the library. On first use, the library will download the hashtable needed for the detection of replay attacks. Do not stop the program during the download\nprocess.\n\n<!-- make an image link to github -->\nIf you meet any problem with the library, feel free to open an issue our GitHub repository.\n\n## Installation\n\n```bash\npip install AdsbAnomalyDetector\n```\n\n## Usage\n\nThe library provides a function `predict` that should be connected to an ADS-B stream.\nThe function takes as input a list of ADS-B messages in a JSON format.\n\nEvery call should correspond to a unique timestamp, and so every messages should have the same timestamp.\nIf you want to process a whole timeseries, you should call the function multiple times.\n\nThe function stores the messages in caches, hence do not go backwards in time. Or the cache will automatically be cleared.\n\nHere is an example of how to use the library, and show the format of the messages :\n\n```python\nfrom AdsbAnomalyDetector import predict, AnomalyType\n\nmessages = [ # list of flights messages at t = 1609459200\n {\n \"icao24\": \"3C4A4D\",\n \"callsign\": \"AFR123\",\n \"timestamp\": \"1609459200\",\n \"latitude\": \"48.8583\",\n \"longitude\": \"2.2945\",\n \"altitude\": \"10000\",\n \"geoaltitude\": \"10000\",\n \"velocity\": \"250\",\n \"vertical_rate\": \"0\",\n \"track\": \"90\",\n \"alert\": \"False\",\n \"spi\": \"False\"\n },\n {\n \"icao24\": \"39AC45\",\n \"callsign\": \"SAMU31\",\n \"timestamp\": \"1609459200\",\n ...\n }, ...\n]\n\nmessages = predict(messages)\n```\n\nBy default the function will return for each message a json object with the following fields :\n- anomaly : equals AnomalyType.VALID if the message is valid, else it will be equal to the type of anomaly detected (AnomalyType.SPOOFING, AnomalyType.REPLAY, AnomalyType.FLOODING)\n- tag : a string useful under saturation to separate messages of simultaneous flights with identical ICAO24\n\nYou can set the parameter `compress` to False if you want the function to return the full message + the anomaly field.\n\nYou can also activate the debug mode by setting the parameter `debug` to True. In this case, the function will return some additional information about the predictions of each models.\n\n",
"bugtrack_url": null,
"license": null,
"summary": "Low altitude aircraft anomaly detector",
"version": "0.6.4",
"project_urls": null,
"split_keywords": [
"python",
" deep learning",
" tensorflow",
" aircraft",
" classification",
" ads-b"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "33481447c14da684491500ddfc85ebef5cbccc458e698e0a2bfec02c1b738328",
"md5": "a4e8807830cdeae9afd54e3d45d8499e",
"sha256": "aa06f2b618321ebbffca2a37f7c0905c03e026d5dfeb0a327d85c5cf8e207ead"
},
"downloads": -1,
"filename": "AdsbAnomalyDetector-0.6.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a4e8807830cdeae9afd54e3d45d8499e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 87087830,
"upload_time": "2024-11-19T23:18:18",
"upload_time_iso_8601": "2024-11-19T23:18:18.688585Z",
"url": "https://files.pythonhosted.org/packages/33/48/1447c14da684491500ddfc85ebef5cbccc458e698e0a2bfec02c1b738328/AdsbAnomalyDetector-0.6.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-19 23:18:18",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "adsbanomalydetector"
}