TL;DR
KNN-MMD is a novel few-shot learning framework that tackles the challenge of cross-domain Wi-Fi sensing by aligning data distributions locally within individual categories rather than globally. By combining K-Nearest Neighbors (KNN) pseudo-labeling with Maximum Mean Discrepancy (MMD) and introducing an adaptive early stopping strategy, it delivers highly accurate and stable performance across different environments and users.
What Problem Does This Paper Address?
Wi-Fi sensing utilizes Channel State Information (CSI) from commercial network interface cards to recognize human actions, identify individuals, and detect falls without requiring cameras or wearable devices. However, CSI is notoriously sensitive to environmental changes. A model trained to recognize gestures in one room or for one specific person often fails completely when deployed in a new room or with a new user—a challenge known as domain shift.
To fix this, researchers typically use Domain Alignment Learning (DAL) to map the source (training) and target (testing) domains into a shared feature space. The flaw in traditional DAL is that it focuses on global alignment. As illustrated in the paper, globally aligning two domains can inadvertently cause different categories to overlap, destroying the classification boundaries. Furthermore, few-shot learning methods in this space suffer from extreme training instability, with accuracy fluctuating wildly between epochs. Because target domain data is unlabeled, standard early stopping techniques cannot be used to find the optimal training endpoint.
Methods
The authors propose KNN-MMD, a few-shot cross-domain framework consisting of three main phases:
- Preliminary Classification & Help Set Construction: The target domain data is flattened and reduced to a lower dimension using Uniform Manifold Approximation and Projection (UMAP). A simple KNN algorithm then classifies the target data based on a tiny, labeled target "support set" (e.g., 1 sample per class in a 1-shot scenario). The samples with the highest classification confidence are selected to form a high-fidelity "help set" with pseudo-labels.
- Network Training with Local Alignment: A ResNet18 feature extractor and a multilayer perceptron (MLP) predictor are trained using a joint loss function. This loss combines standard cross-entropy on the source domain, a local MMD loss (which aligns the source and target domains within each specific category using the help set), and a global MMD loss to mitigate any random bias from class imbalances in the help set.
- Adaptive Early Stopping: Crucially, the target domain's support set is entirely excluded from the training loss calculation. Instead, it is repurposed as a validation set. The framework monitors validation loss and accuracy to trigger an early stop at the optimal training epoch, preventing the performance drops common in unstable few-shot models.
Datasets
The framework was validated across three distinct datasets:
- WiGesture: A public dataset containing CSI data from 8 individuals performing 6 distinct gestures. It was used to evaluate cross-person gesture recognition and cross-action person identification.
- WiFall: A new dataset introduced by the authors, featuring 10 volunteers performing 5 activities (walking, jumping, sitting, standing up, and falling—including various fall types like forward, backward, and seated falls).
- WiDar3.0: A large-scale public dataset used for expanded cross-people and cross-room gesture recognition experiments.
Key Insights and Ideas
- Local Alignment is Essential: Global domain alignment often mixes up class distributions across domains. Aligning sub-domains (categories) independently preserves the decision boundaries learned from the source domain.
- KNN is a Robust Pseudo-Labeler: While deep neural networks trained on a source domain generalize poorly to a raw target domain, a simple distance-based KNN operating on UMAP-reduced features provides remarkably reliable pseudo-labels for top-confidence target samples.
- Unlocking Early Stopping for Few-Shot Learning: By resisting the temptation to use the target support set for training, the authors turned it into a vital validation tool. This solves the notorious "when to stop training" dilemma inherent to cross-domain few-shot learning.
Key Results
In a challenging one-shot scenario (only 1 labeled sample per category in the target domain), KNN-MMD achieved outstanding accuracy across four core tasks, significantly outperforming state-of-the-art methods like CrossFi and AutoFi:
- Gesture Recognition: 93.26%
- Person Identification: 81.84%
- Fall Detection: 77.62%
- Action Recognition: 75.30%
The framework also demonstrated exceptional stability. While competing models showed sharp, erratic performance spikes during training, KNN-MMD's testing accuracy increased smoothly and converged reliably thanks to the adaptive early stopping mechanism.
Limitations and Future Work
Currently, the KNN-MMD framework is designed strictly for classification tasks. The authors note that extending this local distribution alignment approach to regression tasks (such as tracking or continuous parameter estimation) remains an open area for exploration. Additionally, future work could investigate pairing zero-shot learning methods with this DAL framework to eliminate the need for a target support set altogether.
Summary updated