# Low-Cost Data-Driven Robot Collision Localization Using a Sparse Modular Point Matrix
## 2 Materials and Methods
### Collision Localization Model
#### 2.3.3 Framework of CE-SVM  
The framework of the proposed CE-SVM is illustrated in Figure 4, consisting primarily of a feature extractor and a classifier. The collision vibration signals employed are 3-axis acceleration and 3-axis angular velocity signals collected by the IMU mounted on the charger. After normalization, these signals serve as inputs to the model. The definition of the input data length follows the concept of the \"effective period\" from our previous work, where a segment with rich information meeting collision localization requirements is extracted from the initial data length, as detailed in ref. [4]. As discussed in ref. [4], an effective period with 290 sampling points already contains sufficient information for collision localization. Therefore, this paper also sets the effective period to 290 sampling points. The input layer of the feature extractor is followed by two CNN layers, each composed of a convolutional layer and a maxpooling layer. In the diagram, Conv2D denotes a 2D convolution layer, and MaxPooling2D denotes a 2D pooling layer. Post Conv2D, batch normalization is applied to ensure the data's generalization ability. Subsequently, a non-linear ReLU activation function is used to process the features, enhancing the model's capacity for effective non-linear information processing. Notably, the Conv2D structure employed in this study differs from that of [3]. While the previous work involved symmetric 3 \(\times\) 3 convolutional kernels, in this study, we adopt asymmetric kernels to maximally preserve temporally reasonable features extracted by the CNN for subsequent processing by the ESN layer. The convolution kernel size in the temporal direction is significantly larger than that in the different axis dimensions. To effectively transmit temporal information to the ESN layer, the time-distributed technique [21] is employed for the flattening layer connecting the CNN layers and the ESN layer. To enable the SVM to effectively utilize the features extracted by the ESN, the features need to undergo flattening processing after the ESN process. Simultaneously, a fully connected layer is employed to reduce the dimensionality of the features to prevent the curse of dimensionality. In the feature extractor training process, Softmax is used as the final classifier. Based on feedback from the Softmax layer's estimation results, the weights of different components in the feature extractor are adjusted. In the training of the classifier SVM for collision localization, the weights of the pre-trained feature extractor are fixed and used solely for feature extraction. The SVM is then constructed based on the features extracted by the pre-trained feature extractor. Detailed hyperparameters for the feature extractor and classifier are provided in Table 2. The hyperparameters of the ESN and SVM are taken from [4], while the hyperparameters of the CNN remain consistent with those outlined in ref. [3], with the exception of the convolutional kernel aspect. Since the padding method is not utilized during the initial convolutional computation, it should ensure that the length of the input can be evenly divisible by the convolutional length along the temporal dimension. Furthermore, to maintain an appropriate convolutional size along the temporal dimension, we specify the kernel size in this direction as 10. Meanwhile, the kernel size remains consistent with ref. [3] in the other direction. Our experiments utilized a Windows-based system with \begin{table}
\begin{tabular}{c c c} \hline \hline
**Parameters** & **Symbolic Representations** & **Values** \\ \hline Weight matrices from the input layer & \(W_{in}\) & [\(-0.5\), \(0.5\)] \\ to the reservoir & \(W_{res}\) & [\(-0.5\), \(0.5\)] \\ \multicolumn{1}{c}{} & \(\varepsilon\) & \(0.5\) \\ Spectral radius & \(\rho\) & \(1\) \\ \multicolumn{1}{c}{} & \(N_{res}\) & \(64\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Key parameters of ESN.