The dataset viewer is not available for this split.
Error code: JobManagerCrashedError
Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
- What This Repository Does
- Current Dataset Layout
- Attack Classes
- Observed Dataset Sizes
- Environment
- System Architecture
- Latest Configuration
- Installation / Setup
- Verification
- End-to-End Operational Process
- Observed Results
- GPU Usage
- Notes on Flower Warnings
- Reproducibility
- File Map
- Practical Guidance
- Suggested Next Step
VANET-IDS26 Flower Federated Learning Pipeline
This repository contains a reproducible Flower-based federated learning pipeline for the VANET-IDS26 intrusion-detection dataset. The pipeline uses a structured-message transformer, deterministic non-IID client partitioning, robust aggregation, and GPU execution support.
What This Repository Does
- Verifies and manages the VANET-IDS26 master dataset and derived manifests.
- Builds reproducible federated client shards.
- Creates an OMNeT++ / Veins bridge manifest for simulation-to-client mapping.
- Runs a Flower server with robust aggregation.
- Runs multiple Flower clients, including optional malicious clients for robustness testing.
- Uses a Temporal FL-BERT style transformer model on CUDA when available.
Current Dataset Layout
The active canonical dataset files in data/ are:
data/vanet_ids26_master.csvdata/vanet_ids26_train.csvdata/vanet_ids26_validation.csvdata/vanet_ids26_test.csv
This is the current local source-of-truth that replaces the older Hugging Face snapshot. The Hugging Face dataset repo should mirror these files plus the matching manifests and dataset card text.
The current experiment also keeps manifests under data/manifests/, including:
data/manifests/vanet_ids26_master_manifest.jsondata/manifests/client_partitions_manifest.jsondata/manifests/sim_bridge_manifest.csvdata/manifests/big_balanced_dataset_manifest.jsondata/manifests/big_balanced_splits_manifest.jsondata/manifests/big_balanced_fullsize_splits_manifest.json
Additional preserved manifests:
data/manifests/clean_balanced_dataset_manifest.jsondata/manifests/vanet_ids26_master_manifest.jsondata/manifests/vanet_ids26_splits_manifest.jsondata/manifests/vanet_ids26_master_codebook.jsondata/manifests/temporal_flbert_vocab.json
Attack Classes
The dataset is balanced across 27 labels: one benign class and 26 attack classes. The descriptions below are short operational summaries derived from the manifest/codebook naming, so they are meant to help readers interpret the classes rather than replace the original simulation definitions.
| Label | Class name | Short description |
|---|---|---|
0 |
benign |
Normal, unmodified VANET safety message. |
1 |
constant_position |
Claimed position remains fixed across time instead of changing naturally. |
2 |
position_offset |
Claimed position is shifted away from the true location by a systematic offset. |
3 |
random_position |
Claimed position is randomized rather than consistent with the real vehicle state. |
4 |
speed_manipulation |
Claimed speed is altered to misrepresent the real velocity. |
5 |
acceleration_manipulation |
Claimed acceleration is altered to misrepresent the real motion dynamics. |
6 |
heading_manipulation |
Claimed heading or orientation is falsified. |
7 |
lane_spoofing |
Claimed lane identifier is falsified to place the sender in the wrong lane. |
8 |
impossible_kinematics |
Reported state violates physical consistency constraints. |
9 |
eventual_stop |
The message sequence indicates an abnormal or forced stop condition. |
10 |
false_brake_event |
A braking event is injected or exaggerated to look like an emergency stop. |
11 |
false_emergency_vehicle |
A vehicle is falsely presented as an emergency vehicle. |
12 |
false_hazard_event |
A road hazard warning is fabricated or exaggerated. |
13 |
replay |
A previously captured valid message is resent. |
14 |
delayed_message |
A legitimate message is delivered late enough to reduce freshness. |
15 |
timestamp_shift |
The timestamp is manipulated to make the message appear older or newer. |
16 |
stale_message_replay |
An outdated message is replayed after it should no longer be trusted. |
17 |
sybil |
One attacker creates multiple apparent identities. |
18 |
impersonation |
A sender forges or steals another identity. |
19 |
pseudonym_abuse |
Pseudonyms are abused to evade tracking or accountability. |
20 |
flooding_ddos |
The channel or receiver is overloaded with excessive traffic. |
21 |
beacon_rate_abuse |
Beacon messages are sent too frequently to create abnormal load. |
22 |
gnss_spoofing |
GNSS-derived location information is falsified or spoofed. |
23 |
map_location_spoofing |
Map or location context is manipulated to show the wrong position. |
24 |
ghost_vehicle |
A non-existent vehicle is fabricated in the message stream. |
25 |
false_object_injection |
A fake road object is injected into the scene description. |
26 |
object_position_shift |
The position of a reported object is shifted away from its true location. |
Observed Dataset Sizes
Latest canonical file sizes:
data/vanet_ids26_master.csv- about76Gdata/vanet_ids26_train.csv- about61Gdata/vanet_ids26_validation.csv- about7.6Gdata/vanet_ids26_test.csv- about7.6G
These large split files are the active experiment files now.
Environment
Tested on:
- Linux host:
natogpu - CUDA GPU:
NVIDIA L40S - GPU selection used in commands:
CUDA_VISIBLE_DEVICES=1 - Python: system
python3 - Training framework: Flower
- ML backend: PyTorch
System Architecture
High-Level Flow
flowchart LR
A[Master VANET-IDS26 CSV] --> B[prepare]
B --> C[Deterministic client shards]
B --> D[Shared vocabulary]
C --> E[client_partitions_manifest.json]
E --> F[bridge]
F --> G[sim_bridge_manifest.csv]
E --> H[Flower clients]
H --> I[Flower server]
I --> J[Robust aggregation]
J --> K[Metrics + classification report]
Pipeline Components
1. Dataset Layer
- The master dataset is the authoritative input.
- Full-size canonical splits exist for archival and experiment tracking.
- Reproducible manifests capture the provenance of each step.
2. Federated Partition Layer
preparecreates deterministic non-IID shards using a Dirichlet partition.- The shards are stored under
data/client_shards/. - A partition manifest records:
- client IDs
- shard paths
- row counts
- label distributions
- vocabulary path
- max sequence length
3. Bridge Layer
bridgecreatessim_bridge_manifest.csv.- This maps client IDs to OMNeT++ / Veins-style run metadata.
4. Model Layer
- The model is a Temporal FL-BERT style transformer:
- token embeddings
- positional embeddings
- learned
[CLS]token - stacked transformer encoder blocks
- classification head
5. Federated Learning Layer
- The Flower server coordinates rounds.
- Robust aggregation options:
fedmedianfedtrimmedavg
- Clients can be marked malicious for robustness experiments:
nonesign_flipnoise
Latest Configuration
Data Preparation
- Source:
data/vanet_ids26_master.csv - Clients:
4 - Label column:
multiclass_label - Number of labels:
27 - Dirichlet alpha:
1.0 - Vocabulary size:
8000 - Max sequence length:
64 - Seed:
42
Model
d_model=128nhead=8num_layers=4dropout=0.15
Federated Server
- Address:
127.0.0.1:8080 - Rounds:
10 - Robust aggregation:
fedtrimmedavg - Trimmed beta:
0.1 - Minimum fit clients:
4 - Minimum evaluate clients:
4 - Minimum available clients:
4 - Local epochs:
2
Client Runtime
- Batch size:
16 - Local epochs:
2 - CUDA device:
CUDA_VISIBLE_DEVICES=1 - Malicious client testing: optional
Installation / Setup
If dependencies are already installed, you can skip this section. Otherwise:
cd /opt/sahsan03/VANET-IDS26
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
If the repository does not contain a requirements.txt, install the needed runtime packages manually:
pip install flwr torch pandas numpy scikit-learn
Verification
Run the dataset and manifest check:
cd /opt/sahsan03/VANET-IDS26
python3 scripts/flower_vanet_pipeline.py verify
Expected checks include:
- master CSV exists
- master manifest exists
- client partition manifest exists
- bridge manifest exists
- full-size split files exist
- full-size split manifest exists
End-to-End Operational Process
1. Prepare the federated shards
This step builds the shared vocabulary and deterministic non-IID client shards from the master corpus.
cd /opt/sahsan03/VANET-IDS26
CUDA_VISIBLE_DEVICES=1 python3 scripts/flower_vanet_pipeline.py prepare \
--source master \
--clients 4 \
--label-column multiclass_label \
--num-labels 27 \
--seed 42 \
--dirichlet-alpha 1.0 \
--vocab-size 8000 \
--max-seq-len 64
Output:
data/client_shards/client_000_multiclass_label.csvdata/client_shards/client_001_multiclass_label.csvdata/client_shards/client_002_multiclass_label.csvdata/client_shards/client_003_multiclass_label.csvdata/manifests/client_partitions_manifest.jsondata/manifests/temporal_flbert_vocab.json
2. Create the bridge manifest
cd /opt/sahsan03/VANET-IDS26
python3 scripts/flower_vanet_pipeline.py bridge
Output:
data/manifests/sim_bridge_manifest.csv
3. Start the Flower server
cd /opt/sahsan03/VANET-IDS26
CUDA_VISIBLE_DEVICES=1 python3 scripts/flower_vanet_pipeline.py server \
--address 127.0.0.1:8080 \
--rounds 10 \
--robust-aggregation fedtrimmedavg \
--trimmed-beta 0.1 \
--min-fit-clients 4 \
--min-evaluate-clients 4 \
--min-available-clients 4 \
--num-labels 27 \
--label-column multiclass_label \
--local-epochs 2 \
--d-model 128 \
--nhead 8 \
--num-layers 4 \
--dropout 0.15 \
--seed 42
4. Start the Flower clients
Run one client per shard. Use separate terminals for each command.
Client 0:
cd /opt/sahsan03/VANET-IDS26
CUDA_VISIBLE_DEVICES=1 python3 scripts/flower_vanet_pipeline.py client \
--client-id 0 \
--server-address 127.0.0.1:8080 \
--label-column multiclass_label \
--num-labels 27 \
--batch-size 16 \
--local-epochs 2 \
--d-model 128 \
--nhead 8 \
--num-layers 4 \
--dropout 0.15 \
--seed 42 \
--malicious none
Client 1:
cd /opt/sahsan03/VANET-IDS26
CUDA_VISIBLE_DEVICES=1 python3 scripts/flower_vanet_pipeline.py client \
--client-id 1 \
--server-address 127.0.0.1:8080 \
--label-column multiclass_label \
--num-labels 27 \
--batch-size 16 \
--local-epochs 2 \
--d-model 128 \
--nhead 8 \
--num-layers 4 \
--dropout 0.15 \
--seed 42 \
--malicious none
Client 2:
cd /opt/sahsan03/VANET-IDS26
CUDA_VISIBLE_DEVICES=1 python3 scripts/flower_vanet_pipeline.py client \
--client-id 2 \
--server-address 127.0.0.1:8080 \
--label-column multiclass_label \
--num-labels 27 \
--batch-size 16 \
--local-epochs 2 \
--d-model 128 \
--nhead 8 \
--num-layers 4 \
--dropout 0.15 \
--seed 42 \
--malicious none
Client 3:
cd /opt/sahsan03/VANET-IDS26
CUDA_VISIBLE_DEVICES=1 python3 scripts/flower_vanet_pipeline.py client \
--client-id 3 \
--server-address 127.0.0.1:8080 \
--label-column multiclass_label \
--num-labels 27 \
--batch-size 16 \
--local-epochs 2 \
--d-model 128 \
--nhead 8 \
--num-layers 4 \
--dropout 0.15 \
--seed 42 \
--malicious none
5. Monitor the run
tail -n 80 logs/server.log
Observed Results
The reported IDS metrics are multiclass results over 27 VANET-IDS26 labels:
benign plus 26 attack classes. The --malicious client option refers to
federated-learning client behavior, not to whether IDS attack samples are
present in the dataset.
All-Honest FL Baseline
Latest all-honest run summary from logs/server.log, with all clients using
--malicious none:
- Final training loss:
0.1646 - Final validation loss:
0.5825 - Validation accuracy: about
0.77 - Macro F1: about
0.77 - Weighted F1: about
0.77
Per-attack accuracy improved substantially under the stronger Temporal FL-BERT configuration. Examples:
benign:0.9950false_emergency_vehicle:1.0000flooding_ddos:1.0000impossible_kinematics:1.0000sybil:1.0000timestamp_shift:0.9897impersonation:0.9531pseudonym_abuse:0.9316
One-Malicious-Client Robustness Scenario
This scenario tests robustness when the IDS dataset still contains all
multiclass VANET attack labels, but one federated client behaves maliciously.
The run used fedtrimmedavg for 10 rounds with three honest clients and one
noisy malicious client:
- Client 0:
--malicious none - Client 1:
--malicious none - Client 2:
--malicious none - Client 3:
--malicious noise
The server run started with:
[server] starting on 127.0.0.1:8080 with strategy=fedtrimmedavg rounds=10 num_labels=27 device=cuda
Run summary:
- Final distributed/server evaluation loss:
0.5848 - Final local training loss reported after simulation:
0.2125 - Final validation loss:
0.5848 - Validation accuracy: about
0.77 - Macro precision:
0.79 - Macro recall:
0.78 - Macro F1:
0.77 - Weighted precision:
0.79 - Weighted recall:
0.77 - Weighted F1:
0.77 - Evaluation support:
5400
Per-attack accuracy for the one-malicious-client run:
acceleration_manipulation:0.5879beacon_rate_abuse:0.5350benign:0.9896constant_position:0.7833delayed_message:0.6543eventual_stop:0.5294false_brake_event:0.7093false_emergency_vehicle:1.0000false_hazard_event:0.7184false_object_injection:0.6957flooding_ddos:1.0000ghost_vehicle:0.8402gnss_spoofing:0.7711heading_manipulation:0.3960impersonation:0.9752impossible_kinematics:1.0000lane_spoofing:0.8785map_location_spoofing:0.7678object_position_shift:0.5911position_offset:0.4412pseudonym_abuse:0.9904random_position:0.7488replay:0.7689speed_manipulation:0.7198stale_message_replay:0.8923sybil:1.0000timestamp_shift:0.9433
Publication note: compared with the all-honest baseline, the one-noisy-client
scenario preserved similar overall accuracy and macro F1 (0.77) under robust
aggregation. This is a useful robustness result for the journal paper because it
separates IDS attack detection from adversarial federated-client behavior.
GPU Usage
The run was executed with:
CUDA_VISIBLE_DEVICES=1
The client logs confirmed CUDA usage on the exposed GPU:
using CUDA device 0 NVIDIA L40S
This means the process used the GPU made visible through CUDA masking.
Notes on Flower Warnings
The current Flower version emits deprecation warnings for:
flwr.server.start_server()flwr.client.start_client()- returning
NumPyClientinstead ofClient
These warnings did not stop the pipeline from working. The run completed successfully, but the Flower API migration should be cleaned up later.
Reproducibility
The pipeline is reproducible because it uses:
- fixed random seed
42 - deterministic client partitioning
- manifest files for shard and bridge traceability
- canonical dataset paths
- a documented command sequence
File Map
scripts/flower_vanet_pipeline.py- end-to-end pipeline implementationdata/vanet_ids26_master.csv- master datasetdata/vanet_ids26_train.csv- canonical large train splitdata/vanet_ids26_validation.csv- canonical large validation splitdata/vanet_ids26_test.csv- canonical large test splitdata/client_shards/- prepared federated client shardsdata/manifests/- manifests and vocabularylogs/- run logs
Practical Guidance
- Use
--source masterinprepareso the pipeline does not fall back to the older sample corpus. - Start the server before the clients.
- Use separate terminals or
tmuxpanes for each client. - For accuracy-focused experiments, keep all clients honest with
--malicious none. - For robustness-focused experiments, keep a majority of clients honest and set one client to
--malicious sign_flipor--malicious noise. - Treat scenarios where every FL client is malicious as stress/failure tests, not as the main IDS detection benchmark.
Suggested Next Step
If you want to push accuracy further, the most useful next experiment is:
- keep the same data
- keep the stronger Temporal FL-BERT defaults
- increase rounds to
20 - compare
fedtrimmedavgvsfedmedian - optionally test
d_model=256if GPU memory allows
- Downloads last month
- 198