Skip to content

oss-inc/mowa-wifi-sensing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mowa-wifi-sensing

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.

README Korean version

🇰🇷 README.md in Korean

Activity Classes

  • Empty (default)
  • Fall
  • Sit
  • Stand
  • Walk

Getting Started

Clone this repository on CSI extractor and server:

git clone https://github.com/oss-inc/mowa-wifi-sensing.git

1. Server

Computing environment

  • Ubuntu 20.04
  • Intel(R) i9-9900KF
  • GeForce RTX 2080 Ti 11GB
  • Python 3.8

Installation


  1. Move to server directory
cd server
  1. Install the required dependencies:
pip install -r requirements.txt
  1. 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
  1. 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 or domain_B data to run it.

Usage


  1. 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'
  1. 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

  1. 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, use extract_activity.py in this repository.)

  2. Model train:

# Supervised learning
python main.py --learning SVL --mode train
# Meta-learning
python main.py --learning FSL --mode train
  1. Model evaluation:
# Supervised learning
python main.py --learning SVL --mode test
# Meta-learning
python main.py --learning FSL --mode test

2. Extractor

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.

Installation

  1. Move to extractor directory
cd extractor
  1. Install the required dependencies:
pip3 install -r requirements.txt

Usage

  1. Modify the HOST and PORT values at the top to match the server information in client.py.

  2. Running socket client for real-time CSI transmission

python3 client.py

Referenced Projects

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.