Skip to content

Latest commit

 

History

History
117 lines (81 loc) · 11.1 KB

README.md

File metadata and controls

117 lines (81 loc) · 11.1 KB

Reproducible package for "Temporal Stability on Human Activity Recognition based on Wi-Fi CSI"

nbviewer Binder Paper DOI DOI

This repository is the reproducibility package for the paper “Temporal Stability on Human Activity Recognition based on Wi-Fi CSI", submitted to the 13th International Conference on Indoor Positioning and Indoor Navigation (IPIN 2023).

M. Matey-Sanz, J. Torres-Sospedra and A. Moreira, "Temporal Stability on Human Activity Recognition based on Wi-Fi CSI," 2023 13th International Conference on Indoor Positioning and Indoor Navigation (IPIN), Nuremberg, Germany, 2023, pp. 1-6, doi: 10.1109/IPIN57070.2023.10332214.

You can explore the data and code used to obtain the results presented in the paper. To properly view the Jupyter Notebook files with their rendered figures, click on the "nbviewer" badge above.

Reproducibility

Reproduce online

Click the on the "Binder" badge above to open an interactive Jupyter environment with all required software installed.

Reproduce locally

Install Python 3.9, download the repository, open a command line in the root of the directory and install the required software by executing:

pip install -r requirements.txt

Reproduce locally with Docker

Install Docker for building an image based on a Dockerfile with a Jupyter environment and running a container based on the image.

Download the repository, open a command line in the root of the directory and:

  1. Build the image:
docker build . --tag stability-csi-har-rp
  1. Run the image:
docker run -it -p 8888:8888 stability-csi-har-rp
  1. Click on the login link (or copy and paste in the browser) shown in the console to access to a Jupyter environment.

Reproduce the analysis

Open the desired Jupyter Notebook (*.ipynb) file. The notebook contains the code used for the analysis and its outputs. You can execute the code to reproduce the obtained results presented in the paper.

Note

When executing code with a component of randomness (i.e., ML models training), the obtained results could be slightly different than the reported ones. Notwithstanding, the conclusions should be similar as the reported ones.

Repository structure

Common files:

  • Dockerfile: a recipe for the computational environment using Docker.
  • requirements.txt: file with the dependencies and versions used through all the code.

Jupyter Notebooks:

Tip

To reproduce this notebook, please follow the instructions to download and setup the StanWiFi dataset.

Tip

To reproduce this notebook, please follow the instructions to download and setup the multi-environment dataset.

Directories:

  • 01_DATA:
    • 01_STANWIFI: contains a README explaining how to download and setup the dataset.
    • 02_MULTI-ENV: contains a README explaining how to download and setup the dataset.
    • 03_COLLECTED-DATASET:
      • 01_RAW (First unzip the compressed file): contains the collected raw dataset with the Wi-Fi CSI data (01_dataset.csv) and four files containing information for data segmentation.
      • 02_LABELLED: contains the four labelled datasets (D1, D2, D3 and D4) obtained from the raw dataset. Each folder, contains file of the form e{XX}_{rx_tx|tx_rx}-{x|y}.npy where:
        • {XX}: execution id.
        • {rx_tx|tx_rx}: indicates the direction of the execution, i.e., rx_tx, goes from rx to tx.
        • {x|y}: x files contain amplitudes (CSI data) and y files contain their associated labels.
      • 03_WINDOWED: contains the data of each dataset arranged in windows of 50 samples with 50% overlap. Each folder contains files with the same name pattern as the previous ones.
      • amplitudes-heatmap.pdf: plot showing the first and last sequence of activities from D1 and D4, respectively. It corresponds with the Figure 7 of the paper.
  • 02_RESULTS:
  • functions: contains several Python files defining common functions used in the notebooks:
    • filters: includes a DBSCAN based filtering and a discrete wavelet transform (DWT) based filter.
    • json: utils for loading and storing json-based data.
    • ml: includes functions for cross validation, model evaluation, building classification reports, etc.
    • random: includes function for fixing the random seeds.
    • report_metrics: functions for summarizing classification reports in table format.

License

The documents in this repository are licensed under Creative Commons Attribution 4.0 International License.

All contained code is licensed under the Apache License 2.0.

All data used in this repository is licensed under Open Data Commons Attribution License.

Acknowledgements

This work has been funded by the Spanish Ministry of Universities [grants FPU19/05352 and EST23/00320] and by MCIN/AEI/10.13039/501100011033 [grant PID2020-120250RB-I00].