Skip to content

Repository files navigation

GNSS Jamming and Spoofing Detection Using NMEA Data

Code for the paper:

GNSS Jamming and Spoofing Detection Using NMEA Data. Abdelkader Mekrache, Jan Marius Evang, Alojz Gomola, Tarik Cicic · ICL GNSS 2026 · [[DOI / arXiv]]


Setup

Requirements: conda (or Miniconda) installed.

Clone the repository:

git clone https://github.com/simula/icl-gnss26.git
cd icl-gnss26

Create the conda environment:

conda env create -f environment.yml
conda activate icl-gnss26

Workflow

0 - Download raw data

The raw gps.csv / constellation.csv files (144MB / 106MB) are hosted on the Hugging Face.

python download_data.py
# → data/gps.csv
# → data/constellation.csv

1 - Prepare data splits

Aggregates raw CSVs, engineers features, and saves labeled train/test DataFrames:

python preprocess.py
# → data/train.csv
# → data/test.csv

2 - Train and evaluate a single model

python train.py --model bilstm --window-size 10 --output-dir ./runs/bilstm_w10 --verbose
python test.py  --model-dir ./runs/bilstm_w10

Available models: rf · xgb · lgbm · lstm · bilstm · gru

3 - Reproduce the full ablation

Trains all models across window sizes [2, 5, 10, 15, 20, 30, 40, 50, 60] s:

python ablation.py --output results/ablation.csv --models-dir results/models

For a subset of the ablation:

python ablation.py --output results/ablation.csv --models-dir results/models --models rf bilstm --windows 10 20 30

Models

Key Name Architecture
rf Random Forest 100 trees, balanced class weights
xgb XGBoost 500 trees, depth 10, lr 0.1
lgbm LightGBM 500 trees, 64 leaves, lr 0.05
lstm LSTM LSTM(64) → Dropout(0.3) → LSTM(32) → Dense(16, relu) → Dense(3, softmax)
bilstm BiLSTM BiLSTM(64) → Dropout(0.3) → BiLSTM(32) → Dense(16, relu) → Dense(3, softmax)
gru GRU GRU(64) → Dropout(0.3) → GRU(32) → Dense(16, relu) → Dense(3, softmax)

Repository structure

data/
  gps.csv                  raw GPS data (huggingface)
  constellation.csv        raw satellite data (huggingface)
  schedule/                jamming/spoofing test schedule per day
  train.csv                preprocessed training split (generated)
  test.csv                 preprocessed cross-test split (generated)
download_data.py           download raw CSVs from the Hugging Face dataset repo
preprocess.py              build train.csv / test.csv from raw data
utils.py                   utils functions
const.py                   constants and configs
models.py                  model class definitions
train.py                   train a single model
test.py                    evaluate a saved model on the cross-test set
ablation.py                full ablation study
environment.yml

Citation

@inproceedings{icl-gnss26-mekrache,
  title={GNSS Jamming and Spoofing Detection Using NMEA Data},
  author={Mekrache, Abdelkader and Evang, Jan Marius and Gomola, Alojz and Cicic, Tarik},
  booktitle={2026 International Conference on Localization and GNSS (ICL-GNSS 2026)},
  year={2026}
}

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages