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
- Add a
DatasetSpecinsrc/cpsbench/specs.py. - Add a downloader in
src/cpsbench/download.pyif the files can be fetched automatically. - Register the class in
src/cpsbench/datasets.pyand_CLASSESin__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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc4ec9be28e9d4fbe516ea2bcdabb7bc792d047c5b11f40314b538438b25b69c
|
|
| MD5 |
9aa58681b0684a313cd151f7d1c6f565
|
|
| BLAKE2b-256 |
b1c1975ae294e88a4fd394cb8d1f7e559d0163cfd300acc16e01bd932b044dd2
|
Provenance
The following attestation bundles were made for cpsbench-0.1.0.tar.gz:
Publisher:
publish.yml on shahriar0651/CPSBench
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cpsbench-0.1.0.tar.gz -
Subject digest:
cc4ec9be28e9d4fbe516ea2bcdabb7bc792d047c5b11f40314b538438b25b69c - Sigstore transparency entry: 2810621099
- Sigstore integration time:
-
Permalink:
shahriar0651/CPSBench@db10174a327df613f7f2702c105d342c6844cb14 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/shahriar0651
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@db10174a327df613f7f2702c105d342c6844cb14 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56cd4d98ea235eee48c2355ae58c29043ae7e24ddec5be120571baad0f4eb382
|
|
| MD5 |
8105e2bb99f4f1f6e4eb520639d8dab8
|
|
| BLAKE2b-256 |
f8d0f149154cc1d6564e5f71150e8ff004557dd8ae9e99308548637e2ffd3ae1
|
Provenance
The following attestation bundles were made for cpsbench-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on shahriar0651/CPSBench
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cpsbench-0.1.0-py3-none-any.whl -
Subject digest:
56cd4d98ea235eee48c2355ae58c29043ae7e24ddec5be120571baad0f4eb382 - Sigstore transparency entry: 2810621115
- Sigstore integration time:
-
Permalink:
shahriar0651/CPSBench@db10174a327df613f7f2702c105d342c6844cb14 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/shahriar0651
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@db10174a327df613f7f2702c105d342c6844cb14 -
Trigger Event:
push
-
Statement type: