Blog | G5 Cyber Security

WiFi Finger Movement Detection

TL;DR

Yes, it’s possible to detect hand and finger movements using changes in WiFi signal strength, but it’s complex. It relies on measuring tiny variations (signal fluctuations) caused by the body interfering with radio waves. This is called Radio Frequency Sensing (RFS). It requires specific hardware/software setup and isn’t reliable without significant calibration and data processing.

How it Works

WiFi signals aren’t just for data transfer; they bounce off objects. When your hand moves, it alters how these signals reflect, creating subtle changes in signal strength, phase, and arrival time at the receiver. RFS techniques analyse these changes to infer movement.

Steps to Implement WiFi Finger Movement Detection

  1. Hardware Setup: You’ll need a WiFi device capable of receiving raw WiFi data (not just connected network information). Some development boards like ESP32 or specialized RFS modules are suitable. Standard WiFi routers usually don’t provide the necessary access.
    • ESP32 Example: The ESP32 has built-in WiFi and can be programmed to capture raw signal data using its SDK.
  2. Data Collection: This is crucial. You need a controlled environment with minimal interference.
    • Place the WiFi receiver at a fixed distance from where you’ll perform movements.
    • Record signal strength (RSSI – Received Signal Strength Indicator) over time while performing various hand gestures and finger movements. Collect data for each gesture repeatedly.
    • Consider collecting data with no movement as a baseline.
  3. Software Development: You’ll need software to process the raw WiFi data.
    • Programming Language: Python is popular for data analysis and machine learning.
    • Libraries: Use libraries like NumPy, SciPy, and Scikit-learn for signal processing and model building.
    • Data Preprocessing: Clean the data by removing noise and outliers. Smooth the RSSI values using a moving average filter.
      import numpy as np
      
      def smooth_data(data, window_size):
          window = np.ones(int(window_size)) / float(window_size)
          return np.convolve(data, window, 'same')
      
  4. Feature Extraction: Identify relevant features from the preprocessed data.
    • Statistical Features: Mean, standard deviation, variance of RSSI values.
    • Frequency Domain Features: Use Fast Fourier Transform (FFT) to analyse signal frequencies and identify patterns related to movements.
    • Time-Domain Features: Calculate the rate of change in RSSI over time.
  5. Model Training: Train a machine learning model to classify different gestures based on the extracted features.
    • Algorithms: Support Vector Machines (SVM), Random Forests, or Neural Networks are commonly used.
    • Training Data: Use the collected data from Step 2 as training and testing sets. Split your dataset into approximately 80% for training and 20% for testing.
      from sklearn.model_selection import train_test_split
      # Assuming X is features, y is labels
      X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)
      
  6. Model Evaluation: Evaluate the model’s performance using metrics like accuracy, precision, recall, and F1-score.
    • Adjust model parameters or try different algorithms to improve accuracy.
  7. Real-time Implementation: Deploy the trained model on your WiFi device for real-time gesture recognition.
    • Continuously collect RSSI data, extract features, and feed them into the model for prediction.

Challenges

Exit mobile version