# Device-Free Indoor Activity Recognition System
## 2 Methodology
### Activity Classification  
We adopt Sparse Representation Classification (SRC) to discriminate the proposed human activity. Sparse representation classification (SRC) has been adopted in various signal and image processing tasks such as image classification and face recognition [24]. Moreover, recently, SRC is used in device-free activity recognition [25]. [PERSON] et al. [25] relied on the superiority of SRC which is featureless, since SRC training can be built from CSI measurements without extracting features. However, this may lead to false detection specifically in the case of radio interferences or environmental changes. Unlike previous work, we build our classifier with several feature vectors extracted from training data. As shown in Figure 1, the proposed system first preprocessed the training samples, and then computed the features mentioned above by a sliding window with a length of 5 s. Each piece of activity information is contained inside each sliding window. The extracted features over CSI streams within each window, forming feature vectors. Thereafter, such feature vectors are concatenated together to build the overcomplete dictionary. In the activity classification, the unknown CSI samples are preprocessed as the training samples, and then modeled as feature vectors. Lastly, SRC classifies the unknown activity based on the overcomplete dictionary that is constructed from training. We model the dictionary as a concatenation of extracted and computed features for each activity class from training. Suppose that we have \(c\) activity classes and \(n_{i}\) training samples from class \(i\), where \(i\in[1,2,...,c]\). Then, \(n_{i}\) training samples are arranged as columns of the data matrix \(M_{i}=\left[x_{i,1},x_{i,2},...,x_{i,n_{i}}\right]\in\ R^{d\times n_{i}}\), and \(d\) is the dimensions of feature vector. Any new test sample \(y\in\ R^{d}\) for the same activity class, and can be represented as a linear combination of the learning samples in \(M_{i}\) as:  
\[y=a_{i,1}x_{i,1}+a_{i,2},x_{i,2},...,+a_{i,n_{i}}x_{i,n_{i}}, \tag{13}\]  
where coefficients \(a_{i,j}\in R\), \(j=1,2,...,n_{i}\). Then, the concatenations of the training samples of all activity classes can be defined as \(A\) matrix as the following expression:  
\[A=\left[M_{1}+M_{2}+....,+M_{A}\right]\in R^{d\times n}=\left[x_{1,1},...,x_{1, n_{i}}x_{2,1},...,x_{2,n_{i}},...,x_{c,1},...,x_{c,n_{i}}\right]. \tag{14}\]  
The test \(y\) can be defined as:  
\[y=Aa, \tag{15}\]  
where \(a\) is the sparse coefficient vector, and the entries of \(a\) sparse coefficient vector are zero except for the entries that are associated with class \(i\) as explained in Equation (16):  
\[a=\left[0,...0,a_{i,1},a_{i,2},...,a_{i,n_{i}},0,...,0\right]^{T}. \tag{16}\]  
Thereafter, we solve \(\ell^{1}\) minimization problem as:  
\[\overset{\wedge}{a}=\arg\min_{a}\ \left\|a\right\|_{1}\ \ \ \ \,\ \In the LOS scenario, access point (AP), detection point (DP), and the target user are placed in the living room. The AP and DP are fixed at two desks with 1 m height, separated by 4 m distance. The target user implemented the proposed activities in a fixed position between AP and DP. In the NLOS scenario, AP is fixed in the living room, where DP is fixed in the bedroom, separated by a six-inch hollow wall with a 4 m distance. The target user implemented the proposed activities in a fixed position in the bedroom in front of DP. Figure 5 shows the floor plan of the experiments' environments. We collect activity samples from each user individually. Table 1 shows the details of collected samples from three volunteer users during the experiments. The volunteer users are asked to implement the proposed activity in an apartment that has different electronic appliances and is full of furniture. We collect samples in two different scenarios as described in Table 1. In each scenario, we collect 450 samples of each activity from three users during nine sessions. In each session, 50 samples of each activity are collected from each user.