# LIMUNet: A Lightweight Neural Network for Human Activity Recognition Using Smartwatches
## 3 Materials and Methods
### LIMUNet Algorithm Design
#### 3.2.1 Lightweight Convolution Structure  
This paper employs convolutional neural networks for feature extraction from sensor data, a network architecture that has achieved great success in visual domain applications and has driven the development of multiple research areas in artificial intelligence in recent years.  
Convolutional neural networks possess strong capabilities in feature extraction, allowing them to capture spatial dependencies in data and alter the dimensions of the data. To reduce computational complexity and better deploy deep neural networks on edge devices, this paper adopts depthwise separable convolution [34] to replace traditional convolutional neural networks.  
In some neural networks with time series as input, such as in the research on multi-user sound direction localization using the time-frequency map of microphone signals [30], the authors choose to use only one-dimensional convolution kernels to convolve the time dimension, while keeping the frequency dimension data unchanged in the position on the feature map. The IMU contains multiple sensors that can collect multi-channel data. At the same sampling point, the data collected by different sensors are independent of each other, and the information from each sensor may contain more behavior-related feature information at a certain moment. If two-dimensional convolution is used to perform feature extraction simultaneously in the time dimension and data channel dimension, it will cause the channel data with high information content to be overwhelmed by data from other channels. Therefore, in this study, a one-dimensional convolution kernel is also used to convolve the time dimension.  
In the field of human activity recognition, current cutting-edge research based on lightweight models has achieved good results. [PERSON] et al. [31] designed a grouped convolutional neural network, which divides the channels of the feature map into two groups, reducing the model's parameter count and computational complexity. Although this method can effectively lighten the model, its degree of lightweighting is relatively low and does not achieve an order-of-magnitude reduction in parameter count and computational complexity. This paper adopts depthwise separable convolution as the basic module of LIMUNet and further lightweighting the model.  
In grouped convolution, the input and output channels are divided into groups, with each group responsible for a set of input and output channels. To compare the computational complexity of grouped convolution and depthwise separable convolution,  
Figure 2: LIMUNet network architecture.  
Equation (3) shows the ratio of computational complexity between depthwise convolution and grouped convolution.  
\[R_{c}=\frac{h_{i}\times w_{i}\times d_{i}\times k_{m}\times k_{n}}{\frac{h_{i} \times w_{i}\times d_{i}\times k_{m}\times k_{n}}{G}}=\frac{G}{d_{j}} \tag{3}\]  
where \(h_{i}\), \(w_{i}\), \(d_{i}\), \(d_{j}\), \(k_{m}\), \(k_{n}\), and \(G\) denote the number of rows in the input tensor, the number of columns in the input tensor, the depth of the input tensor, the depth of the output tensor, the length of the convolution kernel, the width of the convolution kernel, and the number of groups, respectively.  
In general, the number of groups in grouped convolution does not exceed the number of output channels; thus, depthwise separable convolution is more lightweight. Moreover, due to the independence of channels among different groups in grouped convolution, it is not conducive to the extraction of behavioral features.