Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Reason given by maintainers: no needed

CPSBench

Installable loader for cyber-physical security datasets. It downloads the raw traces, builds the windowed tensors, and returns a PyTorch dataset with the same contract as MNIST: (window, label).

from cpsbench import SynCAN
from torch.utils.data import DataLoader

train = SynCAN(root="./data", split="train", download=True)
test = SynCAN(root="./data", split="test", download=True)

window, label = train[0]          # window: (1, time, signals), label: 0 benign / 1 attack
loader = DataLoader(train, batch_size=64, shuffle=True)

Or load by name:

import cpsbench

dataset = cpsbench.load("road", root="./data", split="test", download=True)
print(dataset.input_shape)   # (channels, window, signals)

Install

pip install cpsbench

That works after the package is published on PyPI. Until then, install this repository directly:

pip install "git+https://github.com/shahriar0651/CPSBench.git"

From a local clone, for development:

pip install -e .

Python 3.10+. SynCAN also needs git on PATH. ROAD is fetched from Zenodo with the standard library, so wget is not required.

Datasets

Name Status What you get
syncan ready, auto-download Synthetic CAN intrusion traces
road ready, auto-download ROAD dynamometer CAN traces
misbehaviorx loader ready, manual files V2X misbehavior (also accepted as vasp)
x-canids registered, not implemented Raises a clear error until a loader is added
python -m cpsbench list
python -m cpsbench info syncan
python -m cpsbench download syncan --root ./data --split train

Downloaded files land in <root>/<name>/{ambient,attacks} plus a fitted min/max scaler under <root>/<name>/scaler. Later calls reuse those files.

Overrides

Windowing defaults live in the library so a new project does not need the old Hydra YAML. Override them per call:

from cpsbench import ROAD

dataset = ROAD(root="./data", split="train", download=True, window_size=50, step_size=5)

Pass return_meta=True if you also need the source file and row index: (window, label, {"file", "idx"}).

Layout

Each sample is a min-max scaled window with a channel axis, so the same convolutional IDS can run on every dataset. Shape is always (channels, window_size, num_signals). Label 0 is benign and 1 is attack (any attack flag inside the window).

Adding a dataset

  1. Add a DatasetSpec in src/cpsbench/specs.py.
  2. Add a downloader in src/cpsbench/download.py if the files can be fetched automatically.
  3. Register the class in src/cpsbench/datasets.py and _CLASSES in __init__.py.

The IDS experiments that consume this package live in the sibling RobIDS repo.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cpsbench-0.1.0.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cpsbench-0.1.0-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

Details for the file cpsbench-0.1.0.tar.gz.

File metadata

  • Download URL: cpsbench-0.1.0.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for cpsbench-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cc4ec9be28e9d4fbe516ea2bcdabb7bc792d047c5b11f40314b538438b25b69c
MD5 9aa58681b0684a313cd151f7d1c6f565
BLAKE2b-256 b1c1975ae294e88a4fd394cb8d1f7e559d0163cfd300acc16e01bd932b044dd2

See more details on using hashes here.

Provenance

The following attestation bundles were made for cpsbench-0.1.0.tar.gz:

Publisher: publish.yml on shahriar0651/CPSBench

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cpsbench-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: cpsbench-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for cpsbench-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 56cd4d98ea235eee48c2355ae58c29043ae7e24ddec5be120571baad0f4eb382
MD5 8105e2bb99f4f1f6e4eb520639d8dab8
BLAKE2b-256 f8d0f149154cc1d6564e5f71150e8ff004557dd8ae9e99308548637e2ffd3ae1

See more details on using hashes here.

Provenance

The following attestation bundles were made for cpsbench-0.1.0-py3-none-any.whl:

Publisher: publish.yml on shahriar0651/CPSBench

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page