## 4 Feature Extraction Method for Sparse Trajectories
### Deep Feature Extraction: A Comparative Baseline  
[PERSON] et al. proposed a feature extraction method for classifying the transportation modes of trajectories obtained via GPS data [16]. In this method, the target trajectories for classification are converted into images, and fine-tuning is performed on an nueral network (NN) constructed via SDA with annotated labels. The IDNN obtained through this process is then used to extract features from the trajectories. Furthermore, the extracted features are combined with semantic information associated with the trajectories to generate new features. Alternatively, we aim to examine whether user age group classification can be performed using sparse trajectory data without semantic information. Although the entire method proposed by [PERSON] et al. [16] requires semantic information, the IDNN, which is a part of their method, does not rely on such information. Therefore, the IDNN is considered applicable to the nonsemantic and sparse trajectory data targeted in this study. In this  
Figure 3: Procedure for generating feature vectors \(f_{k}^{\text{CMM}}\) from \(L_{k}\) and \(T_{k}\). study, we compare the classification accuracy for sparse trajectories using feature extraction via the IDNN with that via the GMM-based method. The feature extraction method using the IDNN generates features through the following three phases:  
* Trajectory image generation The target area is divided into rectangular regions of a specified size \(W_{m}\times H_{m}\), and each region is represented as a pixel. This allows the target area to be treated as an image, where each element of the trajectory \(T_{k}\) is converted into a pixel value \(v(i,j)\) for the region \((i,j),i\in\{0,1,\dots,W_{m}\},j\in\{0,1,\dots,H_{m}\}\). The pixel value \(v(i,j)\) is incremented by one for every minute the user \(k\) spends in the region. Thus, \(v(i,j)\) represents the total time that user \(k\) spends in region \((i,j)\), satisfying the following equation: \[\sum_{i}^{W_{m}}\sum_{j}^{H_{m}}v(i,j)=\mathcal{T}.\] Finally, the pixel values \(v(i,j)\) are normalized such that they fall within the range \(\vartheta(i,j)\in[0,1]\). This process generates a grayscale image \(I_{k}=(\vartheta(i,j))\in[0,1]^{W_{m}\times H_{m}}\) associated with each ID \(k\). * Pretraining by SDA The autoencoder (AE) is a type of NN designed to compress and reconstruct input vectors, and it is primarily used for feature extraction and dimensionality reduction. For example, when a flattened vector of an image \(I_{k}\) is denoted as \(\mathbf{x}_{k}^{\text{img}}\in[0,1]^{W_{m}H_{m}}\), an AE constructs an NN that minimizes the loss function \(\mathcal{L}(\mathbf{x}_{k}^{\text{img}},\mathbf{z})\) between \(\mathbf{x}_{k}^{\text{img}}\) and the reconstructed vector \(\mathbf{z}\in\mathbb{R}^{W_{m}H_{m}}\). The denoising autoencoder (DAE) is an extension of the AE that enhances robustness by adding noise, sampled from a distribution \(q_{D}\), to the input vector \(\mathbf{x}_{k}^{\text{img}}\) before constructing the AE. SDA is a type of DNN built by stacking multiple DAEs as middle layers, where each layer is trained independently by its respective DAE [15]. Specifically, the \(l\)-th middle layer of an SDA is trained by minimizing the loss function \(\mathcal{L}(\mathbf{x}_{l-1},\mathbf{z}_{l})\) between the features \(\mathbf{x}_{l-1}\) learned by the \((l-1)\)-th layer DAE and the output \(\mathbf{z}_{l}\) of the \(l\)-th layer. The number of middle layers \(\lambda\) in a DNN constructed by an SDA equals the number of stacked DAEs. In the \(l\)-th DAE, the input vector \(\mathbf{x}_{l-1}\) is first passed through the encoding function \(\varphi(\cdot)\) after noise is added according to \(q_{D}\) and then reconstructed as a vector \(\mathbf{z}_{l}\) through the decoding function \(\varphi^{\prime}(\cdot)\). Typically, \(q_{D}\) employs masking noise, which randomly forces selected elements to zero. The conceptual diagram of an SDA is shown in Figure 4a.