## 5 Materials and Methods
### Contrastive Semantic Alignment
Out of 12 sets of activities, we picked 6 activities performed by subjects 1, 2, and 3 in Environment 1; by subjects 11, 12, and 13 in Environment 2; and by subjects 21, 22, and 23 in Environment 3. Environments 1 and 2 were featured line-of-sight (LOS) contact between Tx and Rx, whereas Environment 3 presented a non-line-of-sight (NLOS) contact with the hurdle of a wooden wall of 8 cm between Tx and Rx. In total, we used 3240 samples of CSI magnitude values. For the Parisafm dataset, we repeated the preprocessing steps presented in [49] to produce 3D CSI images, whereas the preprocessing of the Alsaify dataset started with the normalization of data values between [0-255], applying Hampel filtering followed by principle component analysis (PCA) to extract 80 impactful data features. These PCA

Figure 5: Model proposed architecture with four-stage alignment losses. components were then employed to visualize t-distributed stochastic neighbor embedding (t-SNE) into 3 component dimensions. Finally, we generated CSI spectrograms from t-SNE output embeddings using short-time Fourier transform (STFT) [86] at a sampling rate of 200. For our last and very naturally occurring domain shifting task of varying atmospheric conditions from the training to the testing phase, we employed the dataset we called the Brinke and Meratnia dataset [41]. A mini-PC with an Intel Ultimate Wi-Fi Link 5300 NIC as a monitoring point and an access point (TP-LINK AC1750) were used to communicate over a \(3\times 3\) MIMO antenna pair with 30 useful sub-carriers, leading to 180 effective data features (columns), and a CSI Tool [87] was installed to collect CSI data for 6 daily activities repeated by 9 different participants over 6 multiple days. For our assessment, we extracted the data samples for 9 experiments of 4 activities performed by 2 participants over 3 days, and each activity was recorded for 50 trials of each experiment, generating 5400 samples in total. We only utilized CSI-magnitude for these samples, and we replicated the preprocessing steps explained in the study of [49]. Finally, we got a 3D-CSI image using MATLAB (2024) pseudocolor plots. Figure 6 presents the t-SNE plots of all three datasets with underlined proportions of samples mentioned in Table 1. These plots show the divergence and heterogeneity of samples in different classes coming from a diverse range of users, environments, and varying atmospheric conditions. This also demonstrates the difficulty level of domain adaptation tasks in the case of cross-domain alignments. The densely clustered data highlights the complexity of domain transformation. In our cross-user experiments, we worked with seven activities from the Parisafm dataset [49]. For our cross-user and cross-environment experiments, we used six activities from the Alsaify dataset [84] and four activities from the Brinke and Meratnia dataset [41]. These activities are labeled in Table 1, and each color in Figure 6 corresponds to an activity label in Table 1. \begin{table}
\begin{tabular}{p{56.9 pt} p{56.9 pt} p{56.9 pt} p{56.9 pt} p{56.9 pt} p{56.9 pt} p{56.9 pt} p{56.9 pt}} \hline \hline
**Dataset** & **No. of Features** & **No. of Samples** & **Antenna Pairs** & **No. of Users** & **No. of Environments** & **Atmospheric Impacts** & **Activities** \\ \hline Parisafm & 52 & 420 & 1 & 3 & 1 & Disregarded & (0) bending, (1) falling, (2) lie down, (3) running, (4) sit down, (5) stand up, and (6) walking \\ \hline Alsaify & 90 & 3240 & 3 & 6 & 3 & Disregarded & (0) sit still on a chair, (1) falling down, (2) lie down, (3) stand still, (4) walking from the transmitter to the receiver, and (5) pick a pen from the ground \\ \hline Brinke and Meratnia & 270 & 5400 & 6 & 2 & 1 & Considered & (0) clapping, (1) falling (2) nothing, (3) walking \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Descriptions of datasets. Figure 6: t-SNE plots for the selected datasets. The activity labels are shown in Table 1. (**a**) t-SNE visualization of the Parisafm dataset. (**b**) t-SNE visualization of the Alsaify dataset.