# An End-to-End Classifier Based on CNN for In-Air Handwritten-Chinese-Character Recognition
## 3 Proposed Method
### Designing End-to-End CNN Architecture  
For the proposed architecture, a brief overview is first given. As shown in Figure 4, the preprocessed sequence of coordinates is used as input to the recognizer. A larger receptive field can be obtained by stacking convolutional layers (Conv1 and Conv2) with small convolution kernels and reducing the sequence length by downsampling, so that more discriminative features can be learned. The fully connected layer (FC) requires a fixed-size feature vector input, but the length of the coordinate sequence is variable. Therefore, it is necessary to average over the coordinate sequence to obtain a fixed-size feature vector. For the output of the convolutional layer, the sequence mean \(m_{i}\) of each feature map \(Z_{i}=[z_{i1},\ldots,z_{iL},\ldots,z_{iT}]\) is estimated by  
\[m_{i}=\frac{1}{T}\sum_{t=1}^{T}z_{iL} \tag{7}\]  
Since the number of output feature maps is fixed, we can combine these means into a fixed-size feature vector \(f=[m_{1},\ldots,m_{c},\ldots,m_{C}]\), where \(C\) is the number of feature maps. Finally the softmax function is used to estimate the probability distribution of all classes. Next, we will introduce the specific configuration of end-to-end CNN in detail. The configuration of the end-to-end classifier can be seen in Figure 5a. In Figure 5a, \"Conv k:2 \(\times\) 3, s:1, 64\" denotes that the kernel size a convolutional layer is 2 \(\times\) 3, the stride is 1 and the number of feature maps is 64, respectively. PReLU stands for the parametric rectified linear unit [31]. \"Max-pool k:1 \(\times\) 2 s:2\" denotes that the size of max pooling is 1 \(\times\) 2, and the stride is 2. \"Dropout 0.2\" denotes that the dropout rate is 0.2 [32]. \"FC 160\" denotes a fully connected layer, and the number of channels is 160. \"Block \(N\)\" represents a residual block, which is illustrated in Figure 5b, \(N=64,128,256\). In more detail, the preprocessed in-air handwritten character \(P=[p_{1},\ldots,p_{t},\ldots,p_{T}]\in R^{2\times T}\) are directly used as the input of the classifier, \(T\) varies according to each different character. In order to identify the coordinate sequence, the network needs to stack multiple convolutional layers to expand the receptive field, so that the model can extract as much spatial and temporal information of the sequence as possible. \(P\) is first processed using a convolutional layer in the time dimension to obtain a series of feature maps of 1 \(\times\) \(T_{1}\), \(T_{1}\) changes with \(T\), the kernel size is 2 \(\times\) 3 and the stride is 1. After that, dropout is employed to avoid overfitting, and the max pooling is used to reduce the sequence feature length, which can further increase the receptive field range and reduce the impact of zero padding  
Figure 4: Overview of end-to-end convolutional neural network architecture. The stride of the convolutional layer shown in the figure is 1, and the convolution kernel size is 3. Figure 3: Example of normalization. The character **(left)** before the normalization and that **(right)** after the normalization are given, respectively. on sequence recognition. Since the constructed network is very deep, the residual link [33] can efficiently train the network. As shown in Figure 5b, we construct a residual block which contains a total of three convolutional layers. In Figure 5b, \"\(\oplus\)\" denotes the elementwise sum, three convolutional layers are denoted by \"Conv1\", \"Conv2\", and \"Conv3\", respectively. Conv1 and Conv2 are used to directly extract sequence features with kernel size \(1\times 3\) and stride 1. Conv3 is designed to make the feature size of the input and output the same during the connection operation, the size of the convolution kernel is \(1\times 1\), and the stride is 1. The residual block is repeated until the number of feature maps is increased from 64 to 256. Then, global average pooling (GAP) [34] is employed to obtain a fixed-size feature vector \(f\).