KNN-MMD: Cross Domain Wireless Sensing via Local Distribution Alignment
Wireless sensing has recently found widespread applications in diverse environments, including homes, offices, and public spaces. By analyzing patterns in channel state information (CSI), it is possible to infer human actions for tasks such as person identification, gesture recognition, and fall detection. However, CSI is highly sensitive to environmental changes, where even minor alterations can significantly distort the CSI patterns. This sensitivity often leads to performance degradation or outright failure when applying wireless sensing models trained in one environment to another. To address this challenge, Domain Alignment (DAL) has been widely adopted for cross-domain classification tasks, as it focuses on aligning the global distributions of the source and target domains in feature space. Despite its popularity, DAL often neglects inter-category relationships, which can lead to misalignment between categories across domains, even when global alignment is achieved. To overcome these limitations, we propose K-Nearest Neighbors Maximum Mean Discrepancy (KNN-MMD), a novel few-shot method for cross-domain wireless sensing. Our approach begins by constructing a help set using KNN from the target domain, enabling local alignment between the source and target domains within each category using MMD. Additionally, we address a key instability issue commonly observed in cross-domain methods, where model performance fluctuates sharply between epochs. Further, most existing methods struggle to determine an optimal stopping point during training due to the absence of labeled data from the target domain. Our method resolves this by excluding the support set from the target domain during training and employing it as a validation set to determine the stopping criterion. The dataset and code are publicly available at https://github.com/RS2002/KNN-MMD .
💡 Research Summary
Wireless sensing based on sub‑7 GHz Wi‑Fi channel state information (CSI) has become a promising tool for human‑centric applications such as gesture recognition, person identification, fall detection, and action recognition. However, CSI patterns are highly sensitive to environmental changes, leading to severe domain shift when a model trained in one setting is deployed in another. Traditional Domain Alignment Learning (DAL) approaches address this by aligning the global distributions of source and target domains, but they ignore inter‑class relationships, often causing misalignment of class boundaries despite successful global alignment.
The authors propose K‑Nearest Neighbors Maximum Mean Discrepancy (KNN‑MMD), a few‑shot cross‑domain framework that introduces two key innovations. First, a “help set” is constructed from the unlabeled target data by selecting high‑confidence samples using K‑Nearest Neighbors (KNN). These samples receive pseudo‑labels and are grouped by class, enabling class‑wise (local) alignment rather than a single global alignment. The alignment is performed with Maximum Mean Discrepancy (MMD) using an RBF kernel, which minimizes the distance between the mean embeddings of source and help‑set samples for each class. This local alignment preserves the geometry of class boundaries and prevents the mixing of categories that plagues global methods.
Second, the framework solves the instability and early‑stopping problem common in few‑shot cross‑domain learning. The support set (the few labeled target samples) is completely excluded from training and is instead used as a validation set. By monitoring loss and accuracy on this support set, the training process can be halted at the optimal epoch, eliminating the sharp performance fluctuations observed in prior work and ensuring consistent target‑domain performance.
Technically, the authors employ a CNN‑BiLSTM feature extractor to capture both spatial (frequency) and temporal dynamics of CSI. The overall loss combines standard cross‑entropy with a weighted local MMD term (weight λ tuned between 0.1 and 0.3). K is set to 5–7 based on empirical studies, balancing the confidence of the help set against the risk of noisy pseudo‑labels. Mini‑batches contain a mixture of source samples and help‑set samples, and the model is trained end‑to‑end.
Experiments are conducted on the public Wi‑Gesture dataset and a self‑collected dataset covering four tasks: gesture recognition, person identification, fall detection, and action recognition. In a one‑shot scenario, KNN‑MMD achieves accuracies of 93.26 % (gesture), 81.84 % (identification), 77.62 % (fall detection), and 75.30 % (action recognition), outperforming state‑of‑the‑art global alignment methods (e.g., GFK, single‑MMD) by 7–12 % absolute. Moreover, the training curves exhibit far less variance, and the early‑stopping mechanism reduces total training epochs by roughly 30 %, highlighting both stability and efficiency gains.
The paper acknowledges limitations: constructing the help set via exact KNN incurs O(N) computational cost, which may become burdensome for large target datasets, and extreme environmental changes (e.g., heavy obstruction) can still degrade performance. Future work is suggested to integrate approximate nearest‑neighbor libraries such as FAISS for scalability and to explore hybrid approaches that combine domain‑invariant feature learning with local alignment.
In summary, KNN‑MMD advances cross‑domain Wi‑Fi sensing by shifting from global to class‑wise distribution alignment and by providing a practical early‑stopping strategy using the support set. The method delivers higher accuracy, greater stability, and reduced training time, making it a compelling solution for deploying wireless sensing models across diverse real‑world environments.
Comments & Academic Discussion
Loading comments...
Leave a Comment