File size: 8,395 Bytes
575ad11 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 | ---
license: mit
language:
- en
tags:
- Wi-Fi
- CSI
- RSSI
---
---
WiFi CSI Router Reception Dataset
tags:
- wifi
- csi
- esp32
- signal-processing
- time-series
size_categories:
- 100K<n<1M
---
# WiFi CSI Router Reception Dataset
This repository contains a small, structured dataset of **WiFi Channel State Information (CSI)** captures recorded as text logs (`.data`). The data is organized as repeated trials (`test_XX`) for **4 class labels** (`label_00..label_03`) and **4 subjects/persons** (`id_person_01..id_person_04`), recorded simultaneously by **3 receiver devices** (`dev1..dev3`).
The “Hugging Face–ready” dataset folder is `wifi_data_set/`.
## Dataset summary
- **Modality:** WiFi CSI (I/Q samples) + per-frame metadata
- **Format:** plain text files; 1 CSI frame per line
- **CSI vector:** 128 signed integers per frame (typically interpreted as 64 complex subcarriers as interleaved I/Q pairs)
- **People (subjects):** 4 (`id_person_01..04`)
- **Labels (classes):** 4 (`label_00..03`) *(see “Label meanings” below)*
- **Trials:** 100 per (person, label)
- **Devices per trial:** 3 (`dev1`, `dev2`, `dev3`)
- **Frames per file:** 100 lines *(see “Known issues” for malformed first lines in some files)*
- **Total files:** 4 persons × 4 labels × 100 tests × 3 devices = **4,800** `.data` files
- **Total frames:** 4,800 files × 100 lines = **480,000** logged frames
- **Collection time range:** **2026-04-18 20:17:59.599 +03:00** … **2026-04-18 23:21:01.561 +03:00**
- **Typical sampling:** ~0.039–0.044 s between frames (≈ 23–28 Hz); ~4 s per trial
## Dataset structure
Primary structured dataset:
```
wifi_data_set/
id_person_01/
label_00/
test_01/
test1__dev1_64_E8_33_57_AA_F4.data
test1__dev2_64_E8_33_58_9E_28.data
test1__dev3_64_E8_33_58_9C_CC.data
...
label_01/ ...
label_02/ ...
label_03/ ...
id_person_02/ ...
id_person_03/ ...
id_person_04/ ...
```
Notes:
- Each `test_XX/` folder represents one trial.
- Each trial contains 3 `.data` files (one per receiver device).
- The receiver “device id” and device MAC-like identifier are embedded in the filename.
Raw/original layout (also present in this repo):
```
<label><suffix-of-dashes>/
testN/
testN__devK_<device_id>.data
```
Here, the number of trailing `-` characters encodes the person/subject. The scripts `restructure_dataset.py` / `restructure_dataset.ps1` convert the raw layout into `wifi_data_set/`.
## Label meanings
`label_00..label_03` are the 4 class labels present in the dataset.
This repository does **not** contain a textual mapping from label IDs to human-readable class names. If you publish this dataset, consider filling in the table below:
| Label directory | Class name/description |
|---|---|
| `label_00` | TODO |
| `label_01` | TODO |
| `label_02` | TODO |
| `label_03` | TODO |
## File format
Each `.data` file is a newline-delimited text log. Each line contains:
1) A timestamp prefix (with timezone offset), then
2) A CSV record that starts with the literal tag `CSI_DATA`, then
3) A final field which is a JSON-like list of integers (the CSI vector), usually quoted.
Example line (wrapped for readability):
```
18.04.2026 22:44:41.143 +03:00 CSI_DATA,
328252,50:ff:20:e5:a8:f3,-43,11,1,7,0,1,1,1,1,0,0,-90,0,6,0,669572834,0,83,0,128,0,
"[0,0,-39,16,-37,13,...]"
```
### Parsed schema (standard `CSI_DATA` layout)
After splitting at `" CSI_DATA,"`, the remaining CSV fields are typically:
| Index | Name | Type | Notes |
|---:|---|---|---|
| 0 | `seq` | int | Frame/packet sequence counter (monotonic within a file) |
| 1 | `mac` | str | Transmitter/AP MAC in colon form (observed constant: `50:ff:20:e5:a8:f3`) |
| 2 | `rssi` | int | Received signal strength (dBm), e.g. `-43` |
| 3 | `rate` | int | PHY rate field as logged by the capture tool |
| 4 | `sig_mode` | int | Signal mode (often 0/1 in ESP32 CSI logs) |
| 5 | `mcs` | int | Modulation and Coding Scheme index (0..7 observed) |
| 6 | `bandwidth` | int | Bandwidth flag (0 observed in valid lines) |
| 7 | `smoothing` | int | 0/1 flag |
| 8 | `not_sounding` | int | 0/1 flag |
| 9 | `aggregation` | int | 0/1 flag |
| 10 | `stbc` | int | 0/1 flag |
| 11 | `fec_coding` | int | 0/1 flag (0 observed) |
| 12 | `sgi` | int | Short guard interval flag (0/1 observed) |
| 13 | `noise_floor` | int | Noise floor (dBm), values like `-90..-98` |
| 14 | `ampdu_cnt` | int | AMPDU counter (0 observed in valid lines) |
| 15 | `channel` | int | WiFi channel (6 observed in valid lines) |
| 16 | `secondary_channel` | int | Secondary channel (0 observed) |
| 17 | `local_timestamp` | int | Device local timestamp (may wrap into negative due to 32-bit overflow) |
| 18 | `ant` | int | Antenna index (0 observed) |
| 19 | `sig_len` | int | Signal length (24/83/118 observed) |
| 20 | `rx_state` | int | RX state (0 observed) |
| 21 | `len` | int | CSI vector length (128 observed in valid lines) |
| 22 | `first_word` | int | First word / reserved (0 observed) |
| 23 | `csi` | list[int] | CSI vector as 128 signed integers |
#### CSI vector
- Length: **128 integers**
- Value range (observed): **[-92, 87]**
- Common interpretation: **64 complex values** as interleaved I/Q pairs: `(I0,Q0,I1,Q1,...)`.
## Known issues / data quality
Most lines parse cleanly, but there are a small number of malformed first lines:
- Valid frames (parse to 24 fields + 128-length CSI vector): **479,402 / 480,000** (99.875%)
- Malformed frames: **598 / 480,000** (0.125%)
- Affected files: **598 / 4,800** (12.46%)
- Pattern: **the malformed record is always line 1** of the affected file; the remaining 99 lines are well-formed.
Typical corruption patterns include missing commas/quotes around the CSI vector, truncated first lines, or concatenated `CSI_DATA` tokens.
If you are building a loader, the simplest robust strategy is:
1) Parse every line, and
2) Keep only records where:
- CSV field count is exactly 24, and
- the `csi` field parses as a list of length 128.
## Loading example (Python)
```python
import csv
import json
from dataclasses import dataclass
from datetime import datetime
TS_FMT = "%d.%m.%Y %H:%M:%S.%f %z"
@dataclass(frozen=True)
class CSIFrame:
ts: datetime
meta: dict
csi: list[int] # length 128
def parse_csi_line(line: str) -> CSIFrame | None:
if " CSI_DATA," not in line:
return None
ts_str, rest = line.split(" CSI_DATA,", 1)
ts = datetime.strptime(ts_str, TS_FMT)
row = next(csv.reader([rest], delimiter=",", quotechar='"'))
if len(row) != 24:
return None
try:
csi = json.loads(row[-1])
except json.JSONDecodeError:
return None
if not isinstance(csi, list) or len(csi) != 128:
return None
keys = [
"seq","mac","rssi","rate","sig_mode","mcs","bandwidth","smoothing","not_sounding",
"aggregation","stbc","fec_coding","sgi","noise_floor","ampdu_cnt","channel",
"secondary_channel","local_timestamp","ant","sig_len","rx_state","len","first_word",
]
meta = {k: (int(v) if k != "mac" else v) for k, v in zip(keys, row[:-1])}
return CSIFrame(ts=ts, meta=meta, csi=[int(x) for x in csi])
```
## Suggested evaluation setups
There is no predefined train/validation/test split. Common choices for this type of dataset:
- **Within-subject split:** random trials into train/test per person.
- **Cross-subject split:** hold out `id_person_0X` as test (leave-one-subject-out).
- **Device generalization:** train on `dev1+dev2`, evaluate on `dev3` (or vice versa).
## License
No license file or explicit license statement is included in this repository. If you plan to publish/share the dataset, add a license and update the YAML header at the top of this README.
## How `wifi_data_set/` was produced
The scripts in the repository root reorganize the raw folder structure:
- `restructure_dataset.py` (Python)
- `restructure_dataset.ps1` (PowerShell)
They map source directories named like `0`, `0-`, `0--`, `0---`, `1`, `1-`, ... into:
`wifi_data_set/id_person_XX/label_XX/test_XX/*.data`
## Citation
If you use this dataset in academic work, consider citing it as:
```bibtex
@dataset{wifi_csi_router_reception_2026,
title = {WiFi CSI Router Reception Dataset},
year = {2026},
note = {Version as of 2026-04-18},
}
``` |