WiFi-aware method based on continuous learning
Patent Information
- Application Number
- CN202611482509.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-22
- Publication Date
- 2026-10-30
AI Technical Summary
对于包含人体活动信息的原始CSI数据,长期保存和反复调用还会增加数据存储和信息暴露风险
[0028]采用上述技术方案具有以下优点:
Smart Images

Figure CN123012682A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of wireless signal sensing and machine learning technology, specifically to a WiFi sensing method based on continuous learning. Background Technology
[0002] WiFi sensing utilizes the reflection, scattering, and multipath changes caused by human activity during wireless signal propagation to achieve non-contact detection of human activity or environmental conditions. In WiFi systems employing orthogonal frequency division multiplexing (OFDM), channel state information reflects the channel frequency response on different subcarriers. Human activity alters the multipath propagation state of wireless signals, causing changes in the amplitude and phase of the channel state information over time. By extracting these changing features, walking, sitting, lying down, and other human activities can be identified.
[0003] Existing WiFi human activity recognition methods typically denoise, segment, reduce dimensionality, or perform time-frequency transformation on the collected channel state information before using convolutional neural networks, residual networks, support vector machines, or probabilistic models for classification. These methods can achieve recognition results when the distributions of training and test data are similar, but they usually employ a one-time training approach. Once the model is trained and deployed, its feature extraction and classification parameters remain fixed.
[0004] Among relevant target recognition technologies, Chinese invention patent application CN118823597A (publication date October 22, 2024), entitled "Radar Target Recognition Method, Apparatus, and Device Based on Scale-Invariant Feature Transform," constructs a recognition model for long-tailed synthetic aperture radar images, consisting of a scale-invariant feature transform module, an encoder, a projector, and a classifier. This scheme extracts scattering and texture features from the radar image separately, concatenates the two types of features, and trains the encoder and projector through supervised contrastive learning, then trains the classifier to complete target recognition. This scheme can improve feature representation under imbalanced sample conditions, but its training object is a fixed radar image dataset, and it does not form a data incremental update process for continuous tasks.
[0005] Chinese invention patent application CN118658181A (publication date: September 17, 2024), entitled "A Continuously Self-Evolving Target Re-identification Modeling Method Based on Parameter Correction," freezes the model trained on the old task as the original model and replicates it to form a dynamic model for learning new data domains. This scheme constrains the parameter updates of the dynamic model by calculating the KL divergence between the frozen and dynamic convolution parameters, and linearly fuses the classifiers of the frozen and dynamic models to mitigate the model's forgetting of knowledge from the old data domain when learning new data domains. This scheme still requires continuous training of the dynamic neural network and relies on parameter constraints between the old and new models and the fusion of classifier parameters.
[0006] During long-term operation, the locations of transmitting and receiving devices, indoor layout, door and window status, human movement speed, and device operating status of a WiFi sensing system may all change. These changes alter the multipath propagation pattern of wireless signals, causing distributional differences between subsequently collected channel state information and the initial training data. A fixed model struggles to continuously adapt to these changes. If the model is trained using only new task data, the model parameters will shift towards the new data distribution, potentially reducing its ability to recognize historical tasks. Re-collecting all historical data for training would increase the overhead of original data storage, data transmission, and model training.
[0007] Some continuous learning methods mitigate forgetting through regularization, knowledge distillation, historical sample replay, or network structure expansion. Regularization and knowledge distillation typically require continuous updates to neural network parameters. Historical sample replay requires preserving the original historical data. Network structure expansion increases the model size with the number of tasks. For raw CSI data containing human activity information, long-term storage and repeated retrieval also increase the risks of data storage and information exposure.
[0008] Therefore, how to enable WiFi sensing models to perform incremental adaptation using new task data under continuously changing environmental and data distribution conditions, while reducing the forgetting of historical tasks and reducing the overhead of storing historical raw data and repeated training, has become an urgent technical problem to be solved. Summary of the Invention
[0009] The main objective of this invention is to provide a WiFi sensing method based on continuous learning, which aims to enable the WiFi sensing model to perform incremental adaptation using new task data under conditions of continuous changes in environment and data distribution, while reducing the forgetting of historical tasks and reducing the overhead of storing historical raw data and repeated training.
[0010] To achieve the above objectives, this invention proposes a WiFi sensing method based on continuous learning, comprising: sequentially acquiring WiFi channel state information (CSI) for each task with an activity category label according to the task order, preprocessing the CSI, and obtaining CSI time-series samples; The CSI time series samples of the first task are input into the pre-trained time series base model with frozen parameters to obtain the original time series features. The projection head includes a backbone network and a projection layer. The backbone network and projection layer are trained using the activity category labels of the first task and supervised contrastive loss. After training, the projection head is frozen, and the output of the backbone network is used as the low-dimensional features of each task. For each activity category, a binary classifier is constructed pairwise. For each binary classifier, the number of samples, empirical mean vector, empirical covariance matrix, and sample proportion of low-dimensional features corresponding to the two activity categories in each known task are calculated. The number of samples, empirical mean vector, empirical covariance matrix, and sample proportion are stored as historical task statistics for use in subsequent task updates, without retaining the original CSI data of historical tasks. Based on the historical task statistics of all seen tasks, the classification error of each binary classifier on each seen task is analyzed. The combined label vector covering all seen tasks is used as the optimization variable and the cross-task weighted classification error is used as the optimization objective to optimize the label. The linear projection decision function of each binary classifier is established based on the optimized combined label vector. When acquiring CSI time series samples for a new task, the parameters of the pre-trained time series base model and the projector are kept frozen. The historical task statistics of the new task are calculated and appended to the stored historical task statistics. After expanding the combined label vector, the label optimization is performed again to update each binary classifier. The time series samples of CSI to be identified are sequentially input into the pre-trained time series basic model, the backbone network of the projection head, and the updated binary classifiers. The human activity category is determined by majority voting based on the classification results of each binary classifier.
[0011] Preferably, the CSI is preprocessed, including: extracting the complex channel response of 52 valid traditional long training field L-LTF subcarriers from the CSI; and truncating the response at each time step to a length of... A sliding window of 1 time step is used to obtain a window sample containing 52 subcarriers, where, The sum is a positive integer; the amplitude of the complex channel response in the window sample is taken to obtain a result with 52 variables and Real CSI time series samples at each time step.
[0012] Preferably, when training the projection head using the first task, data augmentation is randomly performed on the CSI time-series samples of the first task. The data augmentation includes Gaussian noise injection, time reversal, random amplitude scaling, random subcarrier dropping, and time shifting.
[0013] Preferably, the pre-trained timing model is a univariate timing model. Inputting the CSI timing samples into the univariate timing model includes: dividing each subcarrier into multiple groups according to physical frequency adjacency, each group containing... There are subcarriers, among which... It is a positive integer, and the total number of subcarriers cannot be increased by 1 / 2. During integer division, copy the data of the last valid subcarrier until the total number of subcarriers after padding can be divided. Divisible division; averaging the subcarrier sequences within each group along the channel dimension to obtain multiple group-level time series; concatenating the first and last parts of the multiple group-level time series into a single input sequence, and inputting the single input sequence into the univariate time series basic model; from the last part of the univariate time series basic model... Each layer extracts a hidden state vector, and the hidden state vectors are concatenated along the feature dimension to obtain the original temporal features, wherein, It is a positive integer not greater than the number of layers in the univariate time series basic model.
[0014] When the output of the feature processing layer contains multiple time positions or multiple tokens, the hidden state vector is selected according to the fixed-length sample representation position defined publicly by the pre-trained model; if a dedicated convergence token is available, the convergence token is selected; if no dedicated convergence token is available but an autoregressive token sequence is used, the last valid token is selected. For all tasks within the same continuous learning system, the selection position and convergence rule of the hidden state vector remain unchanged.
[0015] Preferably, the univariate time series basic model is a Time-MoE-50M time series hybrid expert model. The 52 subcarriers were copied and padded to 55 subcarriers and then divided into 11 groups. The last token hidden state of each of the last 4 layers of the Time-MoE-50M time-series hybrid expert model was extracted and spliced to obtain the original time-series features of 3072 dimensions.
[0016] Preferably, the pre-trained timing model is a multivariate timing model. The 52 subcarriers of the CSI timing sample are directly input into the multivariate timing model as 52 variables, and the convergence token hidden state in the preset encoder layer of the multivariate timing model is extracted. The convergence token hidden state is used as the original timing feature.
[0017] The multivariate temporal model used has a preset encoder layer that can jointly encode all input variables and a convergence token that can output fixed-length sample representations; the positions of the preset encoder layer and the convergence token are determined before the first task and remain unchanged in all subsequent tasks.
[0018] Preferably, the multivariate time series basic model is a Chronos 2 multivariate time series basic model, the convergence token is a regression token, and the regression token hidden state in the 11th layer encoder of the Chronos 2 multivariate time series basic model is extracted to obtain 768-dimensional original time series features.
[0019] Preferably, the backbone network sequentially includes a first linear layer that maps the original temporal features to 512 dimensions, a first batch of normalization layers, a first ReLU activation layer, a second linear layer that maps the 512-dimensional features to 256 dimensions, a second batch of normalization layers, and a second ReLU activation layer; the projection layer includes a third linear layer that maps the 256-dimensional features output by the backbone network to 128 dimensions and an L2 normalization layer; when training the projection head, the backbone network and the projection layer are used sequentially, and in the feature extraction stage after training, only the 256-dimensional low-dimensional features output by the backbone network are used.
[0020] Preferably, the supervised comparison loss Calculate according to the corresponding formula:
[0021] in, For batch size, For the sample The normalized embedding obtained through the projection layer, For the sample Activity category tags, To be consistent with the sample A set of positive sample indexes with the same activity category label. This refers to temperature hyperparameters.
[0022] Preferably, analyzing the classification error of each binary classifier on each seen task based on the historical task statistics of all seen tasks includes: determining the task based on the sample size, empirical mean vector, empirical covariance matrix, and sample proportion. Medium category The Gaussian approximate distribution of the linear projection decision score ,in, ; calculate the task according to the corresponding formula. Classification error:
[0023] in, The standard normal cumulative distribution function is... For the corresponding task The decision threshold between the Gaussian approximate distributions of the two activity categories. and Tasks Medium category The theoretical mean and standard deviation of the linear projection decision score.
[0024] Preferably, label optimization is performed using the combined label vector covering all seen tasks as the optimization variable and the cross-task weighted classification error as the optimization objective, including solving for the optimal combined label vector according to the corresponding calculation formula:
[0025] in, This represents the total number of tasks already seen. To cover the combined label vectors of all seen tasks, For tasks using the combined label vector Classification error, For the task The corresponding task weight.
[0026] Preferably, the L-BFGS-B algorithm is used to solve for the optimal combination of label vectors.
[0027] Preferably, after expanding the combined label vector, the label optimization is performed again, including: in the already learned... When completing the first task and obtaining the corresponding old optimal combination label vector, add a label vector to the end of the old optimal combination label vector. For each task, two combined label parameters corresponding to two activity categories are initialized to zero to form an extended combined label vector. This extended combined label vector is then used as a feasible solution in the extended parameter space, and the solution covering the previous solution is re-solved in the extended parameter space. The optimal combined label vector for each task is obtained; the linear projection decision function is updated based on the re-solved optimal combined label vector.
[0028] The above technical solution has the following advantages: This application employs a pre-trained temporal base model with parameter freezing to extract CSI temporal features. After supervised contrastive training for the first task is completed, the projection head is frozen, ensuring that samples from different tasks enter the same low-dimensional feature space according to a consistent mapping relationship. This maintains the comparability between historical and new task statistics. Supervised contrastive training causes features of the same activity category to cluster, while features of different activity categories tend to separate, which is beneficial for the linear projection classifier to form category boundaries. For each known task and activity category, the sample count, empirical mean vector, empirical covariance matrix, and sample proportion are stored, eliminating the need to retain or retrieve the original CSI data from historical tasks in subsequent updates, thereby reducing the overhead of historical data storage and the risk of exposing original activity data. When a new task arrives, by appending the new task statistics, expanding the combined label vector, and re-optimizing the cross-task weighted classification error, the binary classifier can be updated without continuously training the temporal base model and projection head. This reduces the computational overhead of repeated backpropagation training and mitigates the impact of learning new tasks on the recognition ability of historical tasks. Multiple binary classifiers output human activity categories through majority voting, enabling the continuous learning mechanism to be used for multi-category human activity recognition.
[0029] The recognition accuracy, forgetting rate, and storage space values recorded in the specific embodiments only correspond to the corresponding dataset, task division, model weights, and training configuration, and are used to illustrate the feasible effects, and are not intended to be numerical limitations that all implementation methods must achieve. Attached Figure Description
[0030] The present invention will now be described in detail with reference to specific embodiments and accompanying drawings, wherein: Figure 1 This is a flowchart illustrating an embodiment of the present application. Detailed Implementation
[0031] The following embodiments are used to illustrate the technical solutions of this application, enabling those skilled in the art to understand and implement this application. The specific models, data scales, and training parameters described in the embodiments are used to illustrate a feasible implementation method and are not intended to limit the scope of protection of this application.
[0032] CSI stands for Channel State Information; OFDM stands for Orthogonal Frequency Division Multiplexing; L-LTF stands for Legacy Long Training Field; SupCon stands for Supervised Contrastive Learning; SPCA stands for Supervised Principal Component Analysis; OSCL stands for Optimizing SPCA-based Continual Learning; and L-BFGS-B stands for Finite-Memory Quasi-Newton Algorithm with Boundary Constraints.
[0033] Example 1: Refer to Appendix Figure 1 Human activity recognition based on CSI amplitude features and Chronos 2 across days through continuous learning This embodiment provides a WiFi sensing method based on continuous learning for non-contact identification of three human activities: walking, sitting, and lying down. The method sequentially performs CSI acquisition, CSI preprocessing, frozen temporal model feature extraction, supervised contrastive projection head training, OSCL continuous learning classification, and human activity category output.
[0034] This embodiment can be executed by a computing device with data processing capabilities. The computing device receives CSI data collected by the WiFi device, calls a pre-stored program to complete data preprocessing, feature extraction, statistical calculation, label optimization, and classification output. The CSI acquisition device and the computing device can exchange CSI data through conventional data transmission methods.
[0035] This embodiment uses publicly available 3DO (Through-the-Wall WiFi Sensing) data collected over three consecutive days. This data was published in 2024 by Strohmaya et al. of TU Wien, with the public identifier DOI: 10.5281 / zenodo.10925351. The transmitter and receiver were located on opposite sides of the wall, and a total of 42 active sessions were collected over three consecutive days, containing approximately 1.25 million WiFi data packets and providing 52 effective L-LTF subcarriers. Each day's data constitutes a continuous learning task. Day 1 data constitutes Task 1, Day 2 data constitutes Task 2, and Day 3 data constitutes Task 3. Between different days, there are minor adjustments to the location of the transmitting and receiving devices, changes in environmental layout, changes in human movement trajectories, and changes in device operating status, thus forming a continuous learning scenario where the CSI data distribution changes over time.
[0036] Each task includes three activity categories: walking, sitting, and lying down. The training sets for Days 1 and 2 each use walking sessions w1 and w2, sitting sessions s1 and s2, and lying down sessions l1 and l2. The validation sets for Days 1 and 2 each use walking sessions w3, w4, and w5, sitting sessions s3, s4, and s5, and lying down sessions l3, l4, and l5. The training set for Day 3 uses walking sessions w1 and w2, sitting sessions s1 and s2, and lying down sessions l1 and l2. The validation set for Day 3 uses walking sessions w3, w4, and w5, sitting sessions s3, s4, and s5, and lying down sessions l3, l4, and l5. The training and validation sets use non-overlapping original sessions and sliding window indices; no sliding window can simultaneously enter both the training and validation sets. Session numbers are used to distinguish data sessions collected within the same day for the same activity category.
[0037] Step 1: Collect CSI data and build a continuous learning task.
[0038] In a WiFi communication environment employing orthogonal frequency division multiplexing, CSI is collected from a traditional long training field L-LTF using commercial WiFi equipment. For the first... The complex channel response of each subcarrier is expressed by the corresponding formula:
[0039] in, For the first The amplitude of each subcarrier, For the first The phase of each subcarrier, It is the imaginary unit.
[0040] Fifty-two valid L-LTF subcarriers were selected from the data output by the acquisition device. For data containing... A segment of CSI data at each time step is parsed to obtain a complex CSI matrix:
[0041] In this matrix, one row corresponds to one time step, and one column corresponds to one effective subcarrier.
[0042] During the data acquisition process, each CSI data segment is recorded with a corresponding human activity category label and task identifier. Activity category labels include walking, sitting, and lying down. The task identifier indicates the acquisition date to which the data belongs. The system receives data from each task in the order of Task 1, Task 2, and Task 3.
[0043] Step 2: Preprocess the CSI data.
[0044] For each segment of complex CSI data, the time step is set to satisfy the window boundary conditions. Cut off the center with a length of A sliding window for each time step. This embodiment takes... When using a time step index starting from 1, the window center satisfies... The left and right endpoints of the window are included. The corresponding window sample is represented by the corresponding formula:
[0045] in, This embodiment is in From time to time .
[0046] By taking the amplitude of each element of the complex channel response in the window sample, we obtain the real CSI amplitude sample:
[0047] Each CSI amplitude sample contains 52 subcarrier amplitude sequences, and each subcarrier amplitude sequence contains 351 time steps. This processing preserves the timing perturbations caused by human activity to different subcarrier amplitudes, while converting complex CSIs into real-valued inputs suitable for processing by the timing-based model.
[0048] The above preprocessing is performed on the training and validation sessions for each task. In this embodiment, 800 samples are randomly selected as training samples for each activity category of each task, and 800 samples are randomly selected as validation samples. The training samples are used for projector training or continuous learning of classifier updates, and the validation samples are used to evaluate the learned tasks. Random sampling uses a fixed random seed 42; a deterministic evaluation is performed under the fixed data partition and fixed random seed. The percentages listed in this document are rounded to two decimal places and only reflect the calculation results under this fixed configuration.
[0049] Data augmentation is performed randomly on the training samples for Task 1 only during the training of the projector head for the first task. Data augmentation includes Gaussian noise injection, time reversal, random amplitude scaling, random subcarrier dropping, and time shifting. Gaussian noise injection adds random perturbations to the CSI amplitude sequence. Time reversal changes the temporal orientation of the samples. Random amplitude scaling alters the overall scale of the CSI amplitude. Random subcarrier dropping excludes some subcarrier sequences from feature calculation during training. Time shifting changes the temporal position of the active signal within the sliding window. Augmented samples retain their original activity category labels. Each augmentation operation is independent and triggered with a probability of 0.5: the standard deviation of the Gaussian noise is 0.01 times the standard deviation of each subcarrier amplitude of the corresponding sample; the amplitude scaling factor is uniformly sampled from the interval [0.9, 1.1]; random subcarrier dropping sets the corresponding subcarrier sequence to zero with a probability of 0.1; the time shift amount is uniformly sampled from the integer range [-10, 10], with zeros used to fill the portion shifted out of the window.
[0050] Step 3: Extract the original temporal features using the frozen Chronos 2.
[0051] This embodiment uses a pre-trained Chronos 2 multivariate temporal model as the feature extractor. Before processing the task data, the pre-trained parameters of Chronos 2 are loaded, and all parameters of Chronos 2 are frozen. During feature extraction in Tasks 1, 2, and 3, the Chronos 2 parameters are not updated. The model structure configuration and pre-trained weight file are fixed before processing Task 1, and are recorded using the model name, hidden dimensions, extraction layers, and SHA-256 checksum of the weight file; subsequent tasks and reproduction experiments must load the same read-only weight file and will not automatically update to other versions.
[0052] For each CSI amplitude sample The 52 subcarriers are directly input into Chronos2 as 52 timing variables. Each variable contains 351 time steps. This input method does not group the subcarriers, nor does it flatten the beginning and end of each subcarrier sequence.
[0053] Chronos 2 jointly encodes 52 variables. This embodiment extracts the regression token hidden state from the 11th layer encoder of Chronos 2 and uses it as the original temporal feature of the corresponding CSI sample. The original temporal feature is expressed by the corresponding formula:
[0054] Therefore, each shape is The CSI amplitude samples were converted into a 768-dimensional original temporal feature vector. The training and validation samples for Tasks 1, 2, and 3 were all extracted using the same frozen Chronos 2 algorithm.
[0055] Since all tasks use the same frozen model parameters, the original time series features of different tasks have consistent feature definitions, avoiding changes in the coordinate meaning of historical task features due to continuous updates to the time series base model.
[0056] Step 4: Use Task 1 to train the supervised contrast projector.
[0057] The projection head includes a backbone network and projection layers. The backbone network consists of, in sequence, a first linear layer, a first batch normalized layer, a first ReLU activation layer, a second linear layer, a second batch normalized layer, and a second ReLU activation layer.
[0058] The first linear layer maps the 768-dimensional original temporal features to 512-dimensional intermediate features. The second linear layer maps the 512-dimensional intermediate features to 256-dimensional low-dimensional features. The projection layer consists of a third linear layer and an L2 normalization layer. The third linear layer maps the 256-dimensional low-dimensional features to a 128-dimensional embedding, and the L2 normalization layer normalizes the 128-dimensional embedding.
[0059] During projection head training, the 768-dimensional original temporal features from Task 1 are sequentially passed through the backbone network and the projection layer to obtain a 128-dimensional normalized embedding. Let a training batch contain... The nth sample, the th The normalized embeddings obtained from the projection layer for each sample are as follows: The corresponding activity category tag is . and the The set of positive sample indices belonging to the same activity category is:
[0060] The loss from the supervised comparison is calculated according to the corresponding formula:
[0061] in, For temperature hyperparameters, This represents the inner product between normalized embeddings.
[0062] By minimizing the supervised contrastive loss, samples with the same activity category label are brought closer together in the embedding space, while samples with different activity category labels are separated. Thus, the 256-dimensional features output by the backbone network have a distribution structure suitable for classifying data using a linear classifier.
[0063] This embodiment uses the AdamW optimizer to train the projection head, with an initial learning rate of: The training run consists of 100 epochs, with the learning rate adjusted using a cosine annealing strategy. Training batch size... Temperature overparameter Stratified batch sampling is used to ensure that each batch contains at least two samples for each active category, thereby guaranteeing... AdamW's weight decay coefficient is taken as... During projector training, Chronos 2 remains frozen, updating only the projector parameters.
[0064] After the projection head is trained, all parameters of the backbone network and projection layers are frozen. The projection head is not updated for subsequent tasks 2 and 3. Therefore, all tasks perform feature mapping using the same frozen Chronos 2 and the same frozen projection head backbone network.
[0065] Step 5: Generate low-dimensional features for continuous learning and classification.
[0066] For each CSI sample in Tasks 1, 2, and 3, 768-dimensional raw temporal features are first obtained using the frozen Chronos 2, and then these raw temporal features are input into the backbone network of the frozen projection head. In this stage, the 256-dimensional features output by the backbone network are directly used as the input to the OSCL continuous learning classifier, without going through the 128-dimensional projection layer.
[0067] Let the sample The 256-dimensional low-dimensional features are:
[0068] Since both the Chronos 2 and the projection head backbone network remain frozen after training for Task 1, the low-dimensional features of Tasks 1, 2, and 3 reside in the same 256-dimensional feature space. The class statistics generated in Task 1 can then be used for classifier updates after Tasks 2 and 3 are completed.
[0069] Step 6: Construct a one-to-one binary classifier.
[0070] For the three activity categories of walking, sitting, and lying down, three binary classifiers are constructed using a one-to-one approach. The first binary classifier is used to distinguish between walking and sitting, the second binary classifier is used to distinguish between walking and lying down, and the third binary classifier is used to distinguish between sitting and lying down.
[0071] Each binary classifier independently performs statistical calculations, combined label optimization, and linear projection decision function updates in the order of Task 1, Task 2, and Task 3. For any binary classifier, the two activity categories it is responsible for distinguishing are denoted as Category 1 and Category 2, respectively.
[0072] For the task Medium category To ensure the computational validity of the empirical covariance matrix, each activity category participating in any binary classifier in each task must contain at least two low-dimensional training samples. Let the number of samples be... , No. The low-dimensional training features are Calculate the empirical mean vector for this category:
[0073] Calculate the empirical covariance matrix for this category:
[0074] Calculate the sample proportion of this category in the corresponding binary task:
[0075] For each known task and each binary classifier, the number of samples, empirical mean vector, empirical covariance matrix, and sample proportion are written to the continuous learning statistics storage area. After the task is completed, subsequent classifier updates no longer need to access the original CSI data of that historical task.
[0076] Step 7: Establish the linear projection decision function and analyze the classification error.
[0077] For those who have already learned For each task, a binary classifier is assigned two combined label parameters, corresponding to the two activity categories it is responsible for. The combined label vector covering all known tasks is represented by the corresponding formula:
[0078] In order to make Each combined label parameter corresponds to all sample-by-sample features, constructing a sample-level label vector. Regarding the task Category , parameters repeat The sample-level label vector is only expanded according to the aforementioned repetition relationship during calculation; there is no need to save the historical features for each sample.
[0079] The total number of samples used in the training of the current binary classifier across all known tasks is:
[0080] The linear projection direction can be directly calculated equivalently from the number of stored samples and the empirical mean vector:
[0081] For the 256-dimensional low-dimensional features to be classified The linear projection decision score is:
[0082] Therefore, both the linear projection direction and the decision score can be calculated based solely on the stored statistics, without needing to reread the original sample-by-sample CSI data from historical tasks.
[0083] For the task Medium category For the sample, the linear projection decision score is approximated using a Gaussian distribution:
[0084] The theoretical mean and standard deviation are calculated from historical task statistics according to the following analytical relationship:
[0085]
[0086] in, To prevent zero variance from causing positive stable terms that divide by zero, this embodiment takes... Therefore, .
[0087] Task The optimal decision threshold is determined by one-dimensional minimization:
[0088] Let the decision threshold between the two activity categories corresponding to the Gaussian approximate distributions be . Then the task The classification error is calculated according to the corresponding formula:
[0089] in, The function is a standard normal cumulative distribution. When the linear projection decision score is less than the decision threshold corresponding to the task, output category 1. When the linear projection decision score is not less than the decision threshold corresponding to the task, output category 2.
[0090] The classification error is obtained by parsing historical task statistics, eliminating the need to reload historical task CSI samples and perform a full classification evaluation every time a new task arrives.
[0091] Step 8: Optimize the combined label vector.
[0092] The total number of tasks already seen is In this situation, set up tasks The corresponding task weight is The task weights are satisfied. and This embodiment uses an equal weighting setting for each known task. Using the sum of weighted classification errors from all known tasks as the optimization objective, the optimal combined label vector is solved according to the corresponding optimization formula:
[0093] in, The task obtained by parsing under the current combined label vector Classification error.
[0094] This embodiment uses the L-BFGS-B algorithm to solve the optimization problem. The boundary of each combined label parameter is set as... The initial combined label vector for the first task is set to... The two parameters added in subsequent new tasks are initialized to 0; the maximum number of iterations is set to 500, when the infinity norm of the projected gradient is not greater than 0. Or the relative change in the objective function value between two consecutive times is no greater than Stop when the time is right. After optimization, construct the linear projection decision function and decision threshold of the current binary classifier based on the optimal combined label vector. Perform the above optimization process on each of the three binary classifiers.
[0095] Step nine: Perform continuous learning in the order of tasks.
[0096] When Task 1 arrives, the training samples for Task 1 are sequentially input into the frozen Chronos 2 and frozen projection head backbone networks to obtain 256-dimensional low-dimensional training features. For the three binary classifiers, the number of samples, empirical mean vector, empirical covariance matrix, and sample proportion of the two activity categories involved in Task 1 are calculated respectively, and stored as initial historical task statistics.
[0097] At this point, the combined label vector for each binary classifier contains two optimization variables. The L-BFGS-B algorithm is used to solve for the optimal combined label vector for Task 1, establishing an initial linear projection decision function. Subsequently, the validation samples from Task 1 are input into the current classifier for recognition.
[0098] When Task 2 arrives, keep all parameters of Chronos 2 and the projection head frozen. Perform preprocessing and low-dimensional feature extraction only on the CSI samples of Task 2, and calculate the sample size, empirical mean vector, empirical covariance matrix, and sample proportion for each activity category in Task 2. Append the Task 2 statistics to the Task 1 statistics.
[0099] For each binary classifier, two combined label parameters corresponding to the two activity categories in Task 2 are added to the end of the old optimal combined label vector corresponding to Task 1, and these two newly added combined label parameters are initialized to 0. This forms an expanded combined label vector containing four optimization variables. This expanded combined label vector is used as a feasible initial solution in the expanded parameter space, and label optimization is re-executed based on the statistics of Task 1 and Task 2 to obtain a new optimal combined label vector covering the first two tasks.
[0100] During the update process of Task 2, the original CSI data from Task 1 is not read. After the update is completed, the updated classifier is evaluated using the validation samples from both Task 1 and Task 2.
[0101] When Task 3 arrives, keep all parameters of Chronos 2 and the projection head frozen. Only calculate the sample size, empirical mean vector, empirical covariance matrix, and sample proportion corresponding to Task 3, and add the Task 3 statistics to the historical task statistics list.
[0102] For each binary classifier, two combined label parameters corresponding to task 3 are added to the end of the old optimal combined label vector covering tasks 1 and 2, and the newly added parameters are initialized to 0, forming an expanded combined label vector containing 6 optimization variables. Label optimization is re-executed based on all statistics of tasks 1, 2, and 3 to obtain a new optimal combined label vector covering the three tasks, and the linear projection decision function of the three binary classifiers is updated accordingly.
[0103] During the update process of Task 3, the original CSI data from Task 1 and Task 2 are not read. After the update is completed, evaluations are performed on the validation samples of Task 1, Task 2, and Task 3, respectively.
[0104] As new tasks continue to arrive, each binary classifier adds two combined label parameters in the same manner, calculates and appends the new task statistics, and re-solves for the optimal combined label vector in the expanded parameter space. The frozen feature extraction front-end keeps the statistics of different tasks in the same feature coordinate system. The statistical appending and label re-optimization allow the classifier to be updated using new task information without needing to save and replay the original CSI data of historical tasks.
[0105] Step 10: Output the categories of human activities.
[0106] In actual identification, 52 effective L-LTF subcarriers are extracted from the CSI data to be identified, a sliding window of 351 time steps is extracted, and CSI amplitude samples are obtained. The CSI amplitude samples are input into the frozen Chronos 2 to extract the regression token hidden state of the 11th layer encoder, resulting in 768-dimensional original temporal features.
[0107] The original 768-dimensional temporal features are input into the backbone network of the frozen projection head to obtain 256-dimensional low-dimensional features. These low-dimensional features are then input into binary classifiers for walking and sitting, walking and lying down, and sitting and lying down, respectively. Each binary classifier outputs an activity category based on its linear projection decision score and decision threshold, and assigns one vote to each output category. The outputs of the three binary classifiers are then subjected to a majority vote, and the activity category with the most votes is determined as the final human activity recognition result.
[0108] When two or more activity categories have the same highest number of votes in the majority vote, the normalized decision margin of all binary classifiers involved in that category is accumulated for each tied category. The category with the largest cumulative margin is selected; if the cumulative margins are still the same, the category with the smallest pre-fixed category index is selected. This winning rule remains consistent across all tasks and all test samples.
[0109] After completing the three cross-day tasks in this embodiment, the average final recognition accuracy obtained using Chronos 2, a frozen projection head, and an OSCL classifier was 76.69%, and the average forgetting rate was 1.60%. Under the same Chronos 2 and projection head conditions, when the OSCL classifier was replaced with a sequentially trained multilayer perceptron, the average final recognition accuracy was 73.36%, and the average forgetting rate was 12.44%.
[0110] set up This indicates that the system has completed the task. Later in the mission Recognition accuracy on the validation set. The average final recognition accuracy and average forgetting rate are calculated using the following evaluation formulas:
[0111]
[0112] The accuracy matrices (in %) for Chronos 2 and OSCL are as follows: Task 1: [91.71, 91.00, 90.71], Task 2: [—, 82.83, 80.63], Task 3: [—, —, 58.75]. The accuracy matrices for the MLP sequential training control group are as follows: Task 1: [92.42, 89.62, 77.58], Task 2: [—, 91.21, 81.17], Task 3: [—, —, 61.33]. The control group network structure is 256-256-128-3, with a Dropout rate of 0.3, trained for 50 epochs, and using the AdamW optimizer. Early Stopping with a learning rate and patience value of 10; except for the classifier, the data partitioning, feature extractor, and projection head are the same as in this embodiment.
[0113] In this embodiment, each binary classifier stores two sample count scalars, two 256-dimensional empirical mean vectors, and two [other data points] for each task. The empirical covariance matrix and two sample proportions are used. When using 32-bit floating-point storage, the statistical storage space required for the three tasks and three binary classifiers is approximately 4.6MB, where the space occupied by the number of samples and sample proportions is negligible compared to the covariance matrix. The continuous learning and updating process mainly includes statistical calculation, matrix and vector operations, and low-dimensional combined label optimization, without requiring continuous backpropagation training on Chronos 2 or the projection head.
[0114] Through the above processing, the temporal base model and the projector remain frozen after the first task, ensuring the stability of the feature mapping relationships for each task. Each historical task participates in subsequent updates only with class statistics, and incremental learning is completed when a new task arrives by expanding and combining the label vectors and re-optimizing the linear projection decision function.
[0115] Example 2: Continuous Learning Human Activity Recognition Based on Time-MoE-50M and Subcarrier Packet Feed This embodiment uses the Time-MoE-50M hybrid expert model as the pre-trained time series foundation model. Time-MoE-50M is a univariate time series foundation model; its input interface is used to receive a single time series and cannot directly receive multivariate CSI amplitude samples composed of 52 subcarrier sequences. Therefore, this embodiment performs subcarrier grouping, intra-group averaging, and flattening and splicing on the CSI amplitude samples without modifying the Time-MoE-50M model structure, enabling multi-subcarrier CSI data to adapt to the univariate input interface.
[0116] This embodiment uses the same 3DO data, activity categories, task division, training sessions, validation sessions, and sample selection methods as Embodiment 1. Tasks 1, 2, and 3 correspond to data collected over three consecutive days. Each task includes three activity categories: walking, sitting, and lying down. For each activity category within each task, 800 training samples and 800 validation samples are selected.
[0117] The CSI acquisition and preprocessing process in this embodiment is the same as in Embodiment 1. For each segment of CSI data, the complex channel response of 52 valid traditional long training field L-LTF subcarriers is extracted. A sliding window with a length of 351 time steps is truncated with each valid time step as the center, and the amplitude of each element of the complex CSI in the window is taken to obtain the CSI amplitude sample:
[0118] During the projector training phase, Gaussian noise injection, time reversal, random amplitude scaling, random subcarrier dropping, and time shifting are randomly applied to the CSI amplitude samples of Task 1. The enhanced samples retain the original activity category labels.
[0119] Step 1: Load and freeze Time-MoE-50M.
[0120] Before feature extraction begins, the parameters of the pre-trained Time-MoE-50M model are loaded, and all parameters of the model are frozen. The same frozen parameters are used for feature extraction in Tasks 1, 2, and 3. The Time-MoE-50M parameters are not updated during projector training. The Time-MoE-50M model structure configuration and pre-trained weight file are fixed before Task 1 processing, using the model name, 50M parameter size, 768 hidden dimensions, extraction layers, and SHA-256 checksum of the weight file; the same read-only weight file must be loaded for subsequent tasks and reproduction experiments.
[0121] The hidden dimension of Time-MoE-50M is 768. Since this model infers based on univariate time series, the CSI amplitude samples with 52 variables must first be converted into a single long sequence.
[0122] Step two: Group and pad the subcarriers.
[0123] Adjacent subcarriers are grouped into the same group according to their physical frequency arrangement. In this embodiment, each group contains 5 subcarriers, namely:
[0124] Since 52 is not divisible by 5, the amplitude sequence of the 52nd valid subcarrier is copied to pad the number of subcarriers to 55. The padded CSI amplitude sample is represented by the corresponding formula:
[0125] During the padding process, only the data of the last valid subcarrier is copied, without changing the original order of the 52 valid subcarriers. The padded 55 subcarriers are then divided into 11 groups according to their physical frequency order, with each group containing 5 subcarrier amplitude sequences.
[0126] The number of groups is:
[0127] Step 3: Calculate the group-level time series.
[0128] The mean of the amplitude sequences of the five subcarriers within each group is calculated along the channel dimension. Let the first group be... Each group at time step The group-level amplitude value ,but:
[0129] in, , .
[0130] This yields 11 group-level time series:
[0131] The group average aggregates the amplitude variations of adjacent subcarriers at physical frequencies, reducing the number of channels while preserving the common variations of adjacent subcarriers for the same human activity.
[0132] Step 4: Flatten the group-level time series into a single input series.
[0133] Following the grouping order, the 11 group-level time series are concatenated end-to-end. The resulting single input sequence is represented by the corresponding formula:
[0134] The length of the input sequence is:
[0135] Therefore, the original shape is The multivariate CSI amplitude samples were converted into univariate time series of length 3861. The order of the group-level sequences is consistent with the physical frequency order of the corresponding subcarrier groups.
[0136] Step 5: Extract multilayer original time series features using Time-MoE-50M.
[0137] A single input sequence of length 3861 is input into a frozen Time-MoE-50M. After the model completes forward inference, the hidden state of the last token in each of the last four layers is extracted.
[0138] Let the total number of layers in Time-MoE-50M be... , No. The hidden state of the last token in the layer is:
[0139] The four extracted hidden states are as follows:
[0140] By concatenating the four hidden states along the feature dimension, we obtain the original temporal features:
[0141] The last four hidden states each contain temporal pattern information at different depths. By concatenating these hidden states, both the local temporal variations of the shallower layers and the overall temporal representation of the deeper layers can be preserved simultaneously.
[0142] All training and validation samples in Tasks 1, 2, and 3 were subjected to feature extraction using the same subcarrier grouping method, the same flattening order, and the same freeze-time (Time-MoE-50M).
[0143] Step 6: Training and freezing the supervised comparison projection head.
[0144] The projection head structure in this embodiment is the same as in Embodiment 1, but the input dimension of the first linear layer is adjusted from 768 to 3072.
[0145] The backbone network of the projection head consists of a first linear layer, a first batch of normalized layers, a first ReLU activation layer, a second linear layer, a second batch of normalized layers, and a second ReLU activation layer. The first linear layer maps the 3072-dimensional original temporal features to 512-dimensional intermediate features. The second linear layer maps the 512-dimensional intermediate features to 256-dimensional low-dimensional features.
[0146] The third linear layer in the projection layer maps the 256-dimensional low-dimensional features to a 128-dimensional embedding. The L2 normalization layer normalizes the 128-dimensional embedding. The projection head is trained using the same supervised contrastive loss as in Example 1, so that the features of samples of the same activity category are close to each other, and the features of samples of different activity categories are separated from each other.
[0147] This embodiment uses only the training samples from Task 1 to train the projection head. The training epochs are 100, using the AdamW optimizer, with an initial learning rate of... The learning rate is adjusted using cosine annealing. During projection head training, Time-MoE-50M is kept frozen. This embodiment also uses batch size... Temperature over-parameter Stratified batch sampling and AdamW weight decay coefficient.
[0148] After the projection head training is complete, all parameters of the backbone network and projection layers are frozen. The projection head will not be updated again when Task 2 and Task 3 arrive.
[0149] Step 7: Generate low-dimensional features for use by the OSCL classifier.
[0150] For CSI samples in each task, subcarrier grouping, intra-group averaging, and flattening stitching are performed first. Then, the frozen Time-MoE-50M is used to obtain 3072-dimensional original temporal features. These original temporal features are input into the backbone network of the frozen projection head to obtain 256-dimensional low-dimensional features.
[0151] The 128-dimensional projection layer output is not used at this stage. The 128-dimensional normalized embedding is only used for supervised contrastive training, and the OSCL continuously learns the classifier using the 256-dimensional low-dimensional features output by the backbone network.
[0152] Since the subcarrier grouping rules, Time-MoE-50M parameters, and projection head parameters remain unchanged in subsequent tasks, the 256-dimensional low-dimensional features of Task 1, Task 2, and Task 3 are located in the same feature space.
[0153] Step 8: Perform OSCL continuous learning classification.
[0154] For the three activity categories of walking, sitting, and lying down, three one-to-one binary classifiers are constructed: walking and sitting, walking and lying down, and sitting and lying down.
[0155] For each binary classifier, the number of samples, empirical mean vector, empirical covariance matrix, and sample proportion for each corresponding activity category in each task are calculated as described in Example 1. After each task is completed, only the above statistics are retained for subsequent task updates; the original CSI data for that task is not retained.
[0156] Based on the statistics of all known tasks, a Gaussian approximate distribution of the linear projection decision scores for the two activity categories in each task is determined. The classification error of each task is analyzed using the standard normal cumulative distribution function, and the combined label vector is optimized with the cross-task weighted classification error as the objective.
[0157] This embodiment uses the L-BFGS-B algorithm to solve for the optimal combined label vector. For each new task, each binary classifier adds two combined label parameters corresponding to the two activity categories in the new task to the end of the original combined label vector, and initializes these new parameters to 0. In the expanded parameter space, the optimal combined label vector is resolved using statistics from all seen tasks, and the linear projection decision function is updated based on the optimization results.
[0158] When Task 2 arrives, the number of combined label variables for each binary classifier increases from 2 to 4. When Task 3 arrives, the number of combined label variables for each binary classifier increases from 4 to 6. The above update process does not require reading the original CSI data from Task 1 or Task 2, nor does it require updating the Time-MoE-50M and projector parameters.
[0159] Step 9: Output the activity recognition results.
[0160] For the CSI data to be identified, 52 effective L-LTF subcarriers are extracted, a sliding window with a length of 351 time steps is truncated, and CSI amplitude samples are obtained.
[0161] The 52 subcarriers were duplicated and padded to 55, and then divided into 11 groups of 5 subcarriers each. The mean of the subcarrier sequences within each group was calculated, and the 11 group-level time series were concatenated end to end to form a single input sequence of length 3861.
[0162] The single input sequence is fed into the frozen Time-MoE-50M network, and the hidden state of the last token in the last four layers is extracted and concatenated to form a 3072-dimensional original temporal feature. The original temporal feature is then fed into the backbone network of the frozen projection head to obtain a 256-dimensional low-dimensional feature.
[0163] The 256-dimensional low-dimensional features are input into three updated binary classifiers. Each binary classifier outputs an activity category based on its linear projection decision score and corresponding decision threshold. A majority vote is then performed on the categories output by the three binary classifiers, and the category with the most votes is determined as the final activity identification result. In the event of a tie in the majority vote, the normalized decision margin accumulation rule described in Example 1 is used to determine the final category.
[0164] After completing three cross-day tasks in this embodiment, the average final recognition accuracy was 87.53%, and the average forgetting rate was 0.52%. Under the same Time-MoE-50M and projection head conditions, when the OSCL classifier was replaced with a sequentially trained multilayer perceptron, the average final recognition accuracy was 82.47%, and the average forgetting rate was 11.17%.
[0165] The accuracy matrices (in %) for Time-MoE-50M and OSCL are as follows: Task 1: [96.92, 95.21, 96.67], Task 2: [—, 92.42, 91.63], Task 3: [—, —, 74.29]. The accuracy matrices for the MLP sequential training control group are as follows: Task 1: [96.58, 87.42, 94.50], Task 2: [—, 95.63, 75.38], Task 3: [—, —, 77.54]. The average final recognition accuracy and average forgetting rate were calculated according to the evaluation formula described in Example 1. The MLP network structure and training configuration were the same as those of the control group in Example 1.
[0166] This embodiment uses the same 256-dimensional OSCL input features as Embodiment 1. Therefore, the number of samples, empirical mean vector, empirical covariance matrix, and sample proportions stored for each task and each binary classifier have the same size. The statistical storage space for the three tasks and three binary classifiers is approximately 4.6MB.
[0167] By using subcarrier grouping, intra-group averaging, and flattening, the univariate Time-MoE-50M can process multivariate CSI samples that originally consisted of 52 subcarriers. The multi-layer hidden state concatenation forms a 3072-dimensional original time-series feature, which is then further mapped by the projection head to a 256-dimensional feature space suitable for processing by the OSCL linear classifier.
[0168] Example 3: General Subcarrier Adaptation Method for Univariate Timing Basic Model This embodiment illustrates a general implementation method for adapting a univariate time series basic model to multi-subcarrier CSI input. The univariate time series basic model used is a time series basic model that has been pre-trained on general time series data and is capable of receiving single time series inputs.
[0169] After preprocessing the CSI, a result containing 52 subcarriers and CSI amplitude samples at each time step:
[0170] Preset the number of subcarriers in each group ,in, The integer is positive. The number of groups is determined according to the corresponding formula:
[0171] When 52 cannot be During integer division, the amplitude sequence of the last valid subcarrier is copied so that the number of subcarriers after padding is equal to the original value. Copying and padding does not change the original order of valid subcarriers.
[0172] Formed sequentially according to the adjacent relationship of physical frequencies There are 1 group, each group contains 1 group. Subcarrier amplitude sequences. The mean of the subcarrier sequences within each group is calculated along the channel dimension to obtain... The length of the strip is Group-level time series.
[0173] No. Each group-level time series is represented by the corresponding formula:
[0174] in, , .
[0175] According to the group order By concatenating the first and last segments of a time series, a length of [length missing] is obtained. A single input sequence:
[0176] A univariate time-series basic model with the input parameters of the single input sequence frozen. Assume this model has... There are 1 feature processing layer with a hidden dimension of . From the end of the model Each layer extracts the hidden state vector, where, Not greater than A positive integer. If each layer's output contains multiple tokens or time positions, the hidden state is extracted according to the fixed-length sample representation positions defined in the model. If a dedicated convergence token is available, that token is used; otherwise, the last valid token is used for autoregressive models that do not have a dedicated convergence token.
[0177] The last The hidden state vectors of the layer are concatenated along the feature dimension to obtain the original temporal features:
[0178] The first linear layer input dimension of the projection head is set to The projection head backbone network outputs 256-dimensional low-dimensional features. The projection head is trained only on the first task and frozen after training. Subsequent tasks all use the same method. The same subcarrier completion rules, the same group-level sequence arrangement order, the same frozen timing basic model, and the same frozen projection head.
[0179] For each subsequent task, the number of samples, empirical mean vector, empirical covariance matrix, and sample proportion for the corresponding activity category in the 256-dimensional feature space are calculated, and these statistics are appended to the historical task statistics. Based on all the appended statistics, the combined label vector is expanded, and the labels are re-optimized. This process does not require saving the original CSI data from historical tasks.
[0180] This embodiment and The input capabilities and hidden layer structure are pre-determined based on the univariate temporal model used. This is maintained for different tasks within the same continuous learning system. and This remains unchanged to maintain consistency in the feature mapping rules for different tasks.
[0181] Example 4: General Direct Feed Method for Multivariable Time Series Basic Models This example illustrates the adaptation method for pre-trained temporal base models that natively support multivariate inputs.
[0182] After preprocessing CSI, the shape obtained is The CSI amplitude samples were used. Fifty-two subcarrier amplitude sequences were used as 52 time-series variables, maintaining the physical frequency arrangement of each subcarrier and the temporal arrangement of each time step, and directly input into the parameter-frozen multivariate time-series basic model.
[0183] In this implementation, no subcarrier grouping, duplication padding, intra-group averaging, or end-to-end flattening is performed. The multivariate timing basis model receives all 52 variables in a single forward processing iteration.
[0184] The convergent token hidden state is extracted from the pre-defined encoder layer of the model and used as the original temporal feature of the CSI sample. The input dimension of the first linear layer of the projection head is the same as the dimension of the convergent token hidden state.
[0185] The projector head is trained using activity category labels and supervised contrastive loss from the first task. After the projector head is trained, the multivariate temporal base model and the projector head are frozen. Subsequent tasks use the same pre-set encoder layer and the same pool token location to extract features.
[0186] The 256-dimensional features output by the frozen projection head backbone network are used to calculate the sample size, empirical mean vector, empirical covariance matrix, and sample proportion for each task and activity category. The subsequent binary classifier construction, combined label optimization, addition of new task statistics, label vector expansion, and majority voting processes are the same as in Example 1.
[0187] The Chronos 2 in Example 1 is a specific implementation of the multivariate time-series basic model described in this example. The Time-MoE-50M in Example 2 is a specific implementation of the univariate time-series basic model described in Example 3. After corresponding input adaptation, both models provide fixed-dimensional features to the projection head and OSCL classifier. Therefore, the continuous learning classification process does not depend on a specific time-series basic model input interface.
[0188] The above embodiments are only used to illustrate the technical solutions of this application and are not intended to limit the scope of protection of this application. The specific settings of the number of activity categories, the number of continuous learning tasks, the sliding window length, the number of samples, the feature dimension, the projection head network structure, the number of training rounds, the optimizer, and the learning rate in the embodiments are all used to illustrate one implementable form of the corresponding technical solution.
[0189] Without altering the technical concept of this application, those skilled in the art can adjust the data acquisition method, sample organization method, and model input format according to the actual WiFi device, CSI data format, number of activity categories, and number of continuous learning tasks. When making such adjustments, the parameters of the pre-trained temporal base model should be kept frozen during continuous learning, the projection head parameters after the first task training should be kept frozen, and the data from different tasks should form low-dimensional features according to a consistent feature mapping rule.
[0190] When the number of activity categories is greater than 3, multiple binary classifiers can be constructed by combining activity categories pairwise. Let the number of activity categories be... The number of binary classifiers is:
[0191] Each binary classifier stores the sample count, empirical mean vector, empirical covariance matrix, and sample proportion for its two corresponding activity categories in each known task, and independently performs combined label optimization. During the recognition phase, the activity categories output by each binary classifier are aggregated, and the final activity category is determined by majority voting. In the event of a tie for the highest majority vote, the aforementioned normalized decision margin accumulation rule is used to determine the final category.
[0192] Continuous learning tasks are not limited to being divided by calendar days. Different tasks can be divided based on changes in environment, device location, collection batches, or data distribution. Regardless of the task division method used, each task is processed in the order of arrival. The first task is used to train the projector. When subsequent tasks arrive, the temporal base model and projector are frozen, and only the statistics for the new task, the appended statistics, the expanded combined label vectors, and the label optimization are re-executed.
[0193] For univariate time-series models, subcarriers can be grouped according to their physical frequency adjacency, and a single input sequence can be formed by averaging within each group and concatenating the first and last subcarriers. For time-series models that support multivariate input, each subcarrier can be directly input into the model as a time-series variable. Both input adaptation methods maintain consistency in processing rules across different tasks, ensuring that historical task statistics and new task statistics reside in the same feature space.
[0194] This application extracts original temporal features through a frozen pre-trained temporal base model and forms a stable low-dimensional feature space using a supervised contrastive projector trained and frozen on the first task. Historical tasks participate in subsequent updates in the form of sample size, empirical mean vector, empirical covariance matrix, and sample proportion. When a new task arrives, there is no need to reread the original CSI data from historical tasks, nor is it necessary to continuously update the temporal base model and projector parameters. By expanding the combined label vector and re-optimizing the linear projection decision function based on all seen task statistics, the degradation of historical task recognition ability can be reduced while adapting to the data distribution of new tasks.
[0195] Those skilled in the art can make equivalent adjustments to the data organization and model interface in the above embodiments without departing from the technical concept of this application, and can also replace technical means with the same function and processing relationship. Adjustments to the order of method steps must maintain the input-output dependency relationship of each step; CSI preprocessing should precede feature extraction, feature extraction should precede statistical calculation, statistical calculation should precede label optimization, and label optimization should precede classification output. The above adjustments or substitutions should still fall within the protection scope defined by the claims of this application.
Claims
1. A WiFi sensing method based on continuous learning, characterized in that, include: The WiFi Channel Status Information (CSI) of each task with an activity category label is obtained sequentially according to the task order. The CSI is then preprocessed to obtain CSI time-series samples. The CSI time series samples of the first task are input into the pre-trained time series base model with frozen parameters to obtain the original time series features. A projection head including a backbone network and a projection layer is constructed. The backbone network and projection layer are trained using the activity category labels of the first task and the supervised contrastive loss. The projection head is then frozen after training. The CSI time series samples of each task are sequentially input into the frozen pre-trained time series base model and the frozen backbone network to obtain the low-dimensional features of each task. For each activity category, a binary classifier is constructed pairwise. For each binary classifier, the number of samples, empirical mean vector, and empirical covariance matrix of the low-dimensional features corresponding to the two activity categories in each known task are calculated. The sample ratio is determined based on the number of samples. The number of samples, empirical mean vector, empirical covariance matrix, and sample ratio are stored as historical task statistics, but the original CSI data of historical tasks are not stored. For each binary classifier, based on the historical task statistics of all seen tasks, a linear projection decision function represented by a combined label vector covering all seen tasks is determined, along with a Gaussian approximate distribution of the linear projection decision scores of the two activity categories in each seen task. The classification error of each seen task is calculated based on the Gaussian approximate distribution. The combined label vector is optimized with cross-task weighted classification error as the optimization objective, and the linear projection decision function is updated based on the optimized combined label vector. When acquiring CSI time series samples for a new task, the parameters of the pre-trained time series base model and the projector are kept frozen. The low-dimensional features of the new task are obtained and the historical task statistics corresponding to the new task are calculated. The historical task statistics corresponding to the new task are appended to the stored historical task statistics, the combined label vector is expanded, and the expanded combined label vector is re-optimized based on the historical task statistics of all seen tasks to update each binary classifier. The time series samples of CSI to be identified are sequentially input into the frozen pre-trained time series basic model, the frozen backbone network, and the updated binary classifiers. The human activity category is determined by majority voting based on the classification results of each binary classifier.
2. The WiFi sensing method based on continuous learning according to claim 1, characterized in that, The CSI is preprocessed, including: extracting the complex channel response of 52 valid traditional long training field L-LTF subcarriers from the CSI; and truncating the CSI at each time step with a length of [missing information] centered on satisfying the window boundary conditions. A sliding window of 1 time step is used to obtain a window sample containing 52 subcarriers, where, The sum is a positive integer; the amplitude of the complex channel response in the window sample is taken to obtain a result with 52 variables and Real CSI time series samples at each time step.
3. The WiFi sensing method based on continuous learning according to claim 2, characterized in that, When training the projection head using the first task, data augmentation is randomly performed on the CSI time-series samples of the first task. The data augmentation includes Gaussian noise injection, time reversal, random amplitude scaling, random subcarrier dropping, and time shifting.
4. The WiFi sensing method based on continuous learning according to claim 1, characterized in that, The pre-trained timing model is a univariate timing model. Inputting the CSI timing samples into the univariate timing model includes: dividing each subcarrier into multiple groups according to physical frequency adjacency, with each group containing... There are subcarriers, among which... It is a positive integer, and the total number of subcarriers cannot be increased by 1 / 2. During integer division, copy the data of the last valid subcarrier until the total number of subcarriers after padding can be divided. Divide by integer; calculate the mean of the subcarrier sequences within each group along the channel dimension to obtain multiple group-level time series; concatenate the multiple group-level time series end-to-end according to the physical frequency order of the subcarrier groups to form a single input sequence, and input the single input sequence into the univariate time series basic model; from the end of the univariate time series basic model... Each feature processing layer extracts a hidden state vector to characterize the single input sequence, and concatenates the hidden state vectors along the feature dimension to obtain the original temporal features, wherein, It is a positive integer not greater than the number of layers in the univariate time series basic model.
5. The WiFi sensing method based on continuous learning according to claim 4, characterized in that, The CSI time series sample contains 52 subcarriers. The univariate time series basic model is the Time-MoE-50M time series hybrid expert model. Each group contains 5 subcarriers. The 52 subcarriers are copied and padded to 55 subcarriers and then divided into 11 groups. The last token hidden state of each of the last 4 layers of the Time-MoE-50M time series hybrid expert model is extracted and concatenated to obtain the original time series features of 3072 dimensions.
6. The WiFi sensing method based on continuous learning according to claim 1, characterized in that, The CSI timing sample contains 52 subcarriers. The pre-trained timing model is a multivariate timing model. The 52 subcarriers are directly input into the multivariate timing model as 52 variables. The convergence token hidden state in the preset encoder layer of the multivariate timing model is extracted, and the convergence token hidden state is used as the original timing feature.
7. The WiFi sensing method based on continuous learning according to claim 6, characterized in that, The multivariate time series basic model is the Chronos 2 multivariate time series basic model, and the convergence token is the regression token. The regression token hidden state in the 11th layer encoder of the Chronos 2 multivariate time series basic model is extracted to obtain the original time series features of 768 dimensions.
8. The WiFi sensing method based on continuous learning according to claim 1, characterized in that, The backbone network sequentially includes a first linear layer that maps the original temporal features to 512 dimensions, a first batch normalization layer, a first ReLU activation layer, a second linear layer that maps the 512-dimensional features to 256 dimensions, a second batch normalization layer, and a second ReLU activation layer; the projection layer includes a third linear layer that maps the 256-dimensional features output by the backbone network to 128 dimensions and an L2 normalization layer; When training the projection head, the backbone network and the projection layer are used sequentially. After training, the low-dimensional feature extraction stage only uses the 256-dimensional low-dimensional features output by the backbone network.
9. The WiFi sensing method based on continuous learning according to claim 8, characterized in that, Each sample in the training batch has at least one positive sample of the same activity class, and the supervised contrastive loss... Calculate according to the following formula: in, For batch size, For the sample The normalized embedding obtained through the projection layer, For the sample Activity category tags, To be consistent with the sample A set of positive sample indexes with the same activity category label. , This refers to temperature hyperparameters.
10. The WiFi sensing method based on continuous learning according to claim 1, characterized in that, Based on the historical task statistics of all seen tasks, determine the Gaussian approximate distribution of the linear projected decision scores for the two activity categories in each seen task, including: determining the task. Medium category The linear projection decision score follows a Gaussian approximate distribution. ,in, Calculate the task according to the following formula. Classification error: in, The standard normal cumulative distribution function is... To make the task The decision threshold that minimizes the sum of classification errors for the two activity categories. and Tasks Medium category The theoretical mean and standard deviation of the linear projection decision score.
Citation Information
Patent Citations
Continuous self-evolution target re-identification modeling method based on parameter correction
CN118658181A
Radar target identification method, device and equipment based on scale invariant feature transformation
CN118823597A
