Recurrent ConFormer for WiFi Activity Recognition
Miao Shang, Xiaopeng Hong. IEEE/CAA Journal of Automatica Sinica. (JAS 23).
[[Paper]] (DOI:10.1109/JAS.2023.123291)
Recurrent ConFormer consists of three main components: recurrent CNN, recurrent Transformer, and classifier head. We implement the three components on two public CSI-based HAR datasets, i.e. ARIL and UT-HAR. Extensive experimental results demonstrate the effectiveness of our Recurrent ConFormer framework.
Fig. The overall architecture of recurrent CNN and recurrent Transformer.
-
python 3.9 (We recommend to use Anaconda, since many python libs like numpy and sklearn are needed in our code.)
-
PyTorch 1.12.0 (we run the code under version 1.12.0 with gpu)
-
More requirements can be seen in requirements.txt, use the following command to install.
pip install -r requirements.txt
-
The virtual environment for Recurrent ConFormer is also provided for convenience. (optional)
Create the virtual environment for Recurrent ConFormer.
conda env create -f environment.yaml
After this, you will get a new environment that can conduct Recurrent ConFormer experiments.
Runconda activate
to activate.Note that only NVIDIA GPUs are supported for the code, and we use NVIDIA GeForce RTX 3060.
Please refer to the following links to download two standard WiFi human activity recognition datasets and put them in the folder "./data".
-
ARIL
The authors of ARIL provided the processed data as well as the original data, you can train the Recurrent ConFormer by them.
Meanwhile, we download the original dataset and perform the linear interpolation and split the dataset by ourselves. The processed data is available at ARIL_ReConFormer.
-
UT-HAT
The original dataset is available at UT-HAR.
We follow the preprocessing procedure in THAT. For your convenience, we provide the processed data followed by THAT at UT-HAR_ReConFormer.
The folder of the datasets is as follows:
data
├── ARIL
│ ├── linear_train_data.mat
│ └── linear_test_data.mat
├── UT_HAT
│ └── Data.pt
├── samples
... ...
Please change the data_path
in the config files to the locations of the datasets。
Currently, there are two options for dataset_type
in the config files: ARIL
and UT-HAR
.
Feel free to change the parameters in the config files, and run main.py
to reproduce the main results in our paper:
# for ARIL dataset
python main.py --config configs/ARIL.json
# for UT-HAR dataset
python main.py --config configs/UT-HAR.json
Please refer to [Evaluation Code].
Please check the MIT license that is listed in this repository.
We thank the following repos providing helpful components/functions in our work.
[1] F. Wang, J. Feng, Y. Zhao, X. Zhang, S. Zhang, and J. Han, “Joint activity recognition and indoor localization with wifi fingerprints,” IEEE Access, vol. 7, pp. 80 058–80 068, 2019.
[2] S. Yousefi, H. Narui, S. Dayal, S. Ermon, and S. Valaee, “A survey on behavior recognition using wifi channel state information,” IEEE Commun. Mag., vol. 55, no. 10, pp. 98–104, 2017.
[3] B. Li, W. Cui, W. Wang, L. Zhang, Z. Chen, and M. Wu, “Two-stream convolution augmented transformer for human activity recognition,” in Proc. AAAI Conf. Artificial Intelligence (AAAI), vol. 35, no. 1, 2021, pp. 286–293.
If you use any content of this repo for your work, please cite the following bib entry:
@article{shang2023ReConFormer,
title={Recurrent ConFormer for WiFi Activity Recognition},
author={Shang, Miao and Hong, Xiaopeng},
booktitle={IEEE/CAA Journal of Automatica Sinica. (JAS)},
year={2023},
volume={10},
number={6},
pages={1491-1493},
doi={10.1109/JAS.2023.123291}
}