# WiGR: A Practical Wi-Fi-Based Gesture Recognition System with a Lightweight Few-Shot Network
## 3 Methods
### Overview of WiGR
#### 3.2.1 CSI Data Collection  
In this section, we introduce the collection method of the CSI data. The CSI data used in this paper came from two Wi-Fi data sets, i.e., our own CSIDA data set and the public SignFi data set [10], which were created via different data collection methods. The collection of the CSIDA data set. We used two Atheros AR9580 Wi-Fi chipsets supporting the IEEE 802.11n standard as a transmitter (Tx) and a receiver (Rx) [39], respectively. Each Wi-Fi chipset was equipped with three antennas with an interval of 0.1 m (m). It should be noted that, considering the performance of the computer, only one transmitting antenna and three receiving antennas were used in our experiment. Therefore, there were 3 (1 \(\times\) 3) Tx-Rx pairs in total. The bandwidth was 40 MHz, and the Wi-Fi frequency was  
Figure 1: The framework of the Wi-Fi-based gesture recognition (WiGR) system contains four steps: (1) input the channel state information (CSI) data collected from the Wi-Fi environment; (2) process the CSI data; (3) feed the processed CSI data into the lightweight few-shot network; (4) train the network via an episode-based training strategy and output the predicted results. 5 GHz. Since orthogonal frequency division multiplexing (OFDM) was used in protocol 802.11n [40], many subcarriers could be obtained. Therefore, one CSI datum included 114 subcarriers for each Tx-Rx pair. In addition, each CSI datum was collected in 1.8 s (s) with a sampling rate of 1000 data frames/s. Denote the number of antennas at the Tx as \(\mathrm{N_{Tx}}\), the number of antennas at the Rx as \(\mathrm{N_{Rx}}\), the number of subcarriers as \(\mathrm{N_{c}}\), and the sampling data frames as T. The CSI data can be represented as a complex matrix of \(\mathrm{T}\times\mathrm{N_{Tx}}\times\mathrm{N_{Rx}}\) (i.e., 1800 \(\times\) 114 \(\times\) 3), which indicates the size of the input data of our proposed network. We collected CSI data in two different indoor environments (Room 1 and Room 2). The layout of the indoor environment is shown in Figure 2. From Figure 2, we can see that the distance between Tx and Rx is 2.6 m [41]. In Room 1, we marked three locations on which the users stood and performed predesigned gestures. In Room 2, we marked two locations. The distance between the user and the transmitter/receiver refers to [17,41]. The user stood on the premarked locations and saw the instructions on the screen of a computer. The computer was used to automatically label the CSI data generated during the execution of the gestures. Five users performed predesigned gestures. As shown in Figure 3, the predesigned gestures were of six types: upward, downward, leftward, rightward, circle, and zigzag, which are commonly used in the field of human-computer interaction. When collecting the data, the user stood on the premarked location and faced the computer screen. Before data collection, the screen showed the type of gesture and reminded the user to raise their hand to prepare for the action. After 3 s of preparation time, the user started performing the gesture, and the duration time of each gesture was 1.8 s. At the same time, the computer started collecting CSI data frames with a sampling rate of 1000 data frames/s, and each CSI datum had four labels: the identity of the users, the room number, the location number, and the gesture category. Afterward, the screen showed instructions to stop for 2 s, and the user took a short break. Thus, the CSI data collection of one gesture was completed. We kept repeating the above process until the data collection was completed. Table 1 shows a summary of the CSIDA data collection. The five users with different figures stood on five different locations (three locations in Room 1 and two locations in Room 2) to perform six predesigned gestures. Each gesture was repeated 20 times. Therefore, there were 1800 (5 \(\times\) 3 \(\times\) 6 \(\times\) 20) samples of gestures in Room 1 and 1200 (5 \(\times\) 2 \(\times\) 6 \(\times\) 20) samples of gestures in Room 2.