The mowa-wifi-sensing module performs real-time Wi-Fi CSI-based human activity recognition. CSI collected from the Nexmon extractor is delivered to the server using socket communication, and the server uses window-size-CSI-data as an input value for the trained activity classification model.
※ Notice ※
The current version supports both supervised learning and meta-learning.
- Empty (default)
- Fall
- Sit
- Stand
- Walk
Clone this repository on CSI extractor and server:
git clone https://github.com/oss-inc/mowa-wifi-sensing.git
Computing environment
- Ubuntu 20.04
- Intel(R) i9-9900KF
- GeForce RTX 2080 Ti 11GB
- Python 3.8
- Move to server directory
cd server
- Install the required dependencies:
pip install -r requirements.txt
- Place the downloaded dataset and pre-trained models as follows:
server
|——————csi_dataset
| └——————domain_A
| | └——————empty.csv
| | └——————sit.csv
| | └——————stand.csv
| | └——————walk.csv
| | └——————fall.csv
| └——————domain_B
| └——————realtime
|
|——————checkpoint
| └——————svl_vit
| | └——————svl_best_model.pt
| └——————few_vit
| └——————fsl_best_model.pt
|——————dataloader
|——————model
|——————plot
└——————runner
- In the realtime folder, new data collected from a different domain is stored.
- This data is used for generating prototypes using a model trained through meta-learning.
- Therefore, it only requires few-shot data, and having enough to create a support set for each class is sufficient.
- For demo, you can insert either
domain_A
ordomain_B
data to run it.
- You can customize the server and client configurations by modifying the
config.yaml
file.
Example:
# Server
server_ip: 'xxx.xxx.xxx.xxx'
server_port: xxxx
# Client
client_mac_address: 'xxxxxxxxx'
- Running socket server for real-time activity recognition:
# Use supervised learning based model
python run_SVL.py
# Use meta-learning(few-shot learning) based model
python run_FSL.py
Using customized model
-
After collecting CSI data, prepare a csv file for each activity according to the above directory structure.(If you want to easily extract the
.csv
file by activity class from the.pcap
file, useextract_activity.py
in this repository.) -
Model train:
# Supervised learning
python main.py --learning SVL --mode train
# Meta-learning
python main.py --learning FSL --mode train
- Model evaluation:
# Supervised learning
python main.py --learning SVL --mode test
# Meta-learning
python main.py --learning FSL --mode test
This module is based on CSI extracted with Nexmon CSI Extractor(Raspberry Pi, Wi-Fi chip: bcm43455c0). Therefore, the Nexmon CSI extractor installation must be preceded.
※ Notice ※
Additional WLAN cards must be installed for socket communication.
- Move to extractor directory
cd extractor
- Install the required dependencies:
pip3 install -r requirements.txt
-
Modify the
HOST
andPORT
values at the top to match the server information inclient.py
. -
Running socket client for real-time CSI transmission
python3 client.py
This project takes inspiration from the following open-source project:
- Nexmon: The Nexmon project provides firmware patches for collecting CSI on Broadcom Wi-Fi chips. For more information about this project, please visit the Nexmon GitHub repository.