# Research on Seismic Signal Analysis Based on Machine Learning
## 3 Methodology
### A Lightweight Collaborative Learning Model for Seismic Sensing Signal Classification (LCL-SSS)
For a given dilation and a given kernel, the kernel weight, \(W=[w_{0},w_{1},\cdots,w_{m-1}]\), is fixed so that the convolution operation can be formulated as:  
\[X*W_{d}=\sum_{j=0}^{m-1}x_{i}-\left(\left\lfloor\frac{m}{2}\right\rfloor\cdot d \right)+(j\cdot d)\cdot w_{j},\forall i\in\{0,1\ldots,n-1\} \tag{1}\]  
where \(x_{i}\) is the value of each sampling point of the seismic waveform and m is the max dilations per kernel. d is dilation, and j (j = 0,1,2,...,m-1) is the element number in \(W\) of each given dilation and kernel. We record this formula as C = X * \(W_{d}\). Having C, we can compute multiple features for multiple different bias values. Based on the fixed weights of the kernels, we can calculate the multiplications by precomputing A = \(\alpha\)X and B = \(\beta\)X, and then complete the convolution operation. For example, if \(W=[\alpha,\beta,\alpha,\cdots,\alpha]\), C can be completed by the summation of A = \([\alpha,0,1,\cdots,a_{n-1}]\) and B = \([b_{0},b_{1},\cdots,b_{n-1}]\). This step has the effect that multiple features are computed with the computational cost of a single convolution operation. As MiniRocket uses kernels with six weights of \(\alpha\) and three weights of \(\beta\), we can only calculate 2/3 of the computation for all 84 kernels for a given dilation more precisely. Therefore, we precompute them for each dilation and then combine them under per kernel. For the convenience of calculation, we set \(\gamma=3\), then \(\beta=\alpha+\gamma\). We can precompute C\({}_{\alpha}\) under per dilation and calculate \(C_{\gamma}\) under per kernel and then combine them to get C = C\({}_{\alpha}\)+ C\({}_{\gamma}\). Thus, there are three channels for our input data, so the convolutions of the three channels in each individual kernel are summed to obtain the convolutions of a single division and a single kernel. Given C, bias can be calculated and features, F, based on PPV can be obtained by the following formula:  
\[F=PPV(C)=\frac{1}{n}\sum[C>b] \tag{2}\]  
After finding out the features and merging the corresponding label data, we can obtain the waveform feature dataset so as to enter the next step. **Step2: Cluster head: Learn cluster function \(\Phi_{\eta}\)**  
Cluster head is used here to build a classifier for our seismic sensing signal data. The top priority of the cluster head method is to mine the nearest neighbors of each sample by using the feature similarity of the waveform features of seismic waves mined by MiniRocket and then integrating them. Here, we use Euclidean distance to find k nearest neighbors for each sample. In the classification stage, the main task is to learn a clustering function \(\Phi_{\eta}\) parameterized by a neural network with a weight of \(\eta\), which combines the samples and their nearest neighbors as input data. Clustering function \(\Phi_{\eta}\) also performs soft assignment on the output category C = \(\{1,\ldots,C\}\) through the softmax function, with \(\Phi_{\eta}(X_{i})\in[0,1]^{c}\). The probability that the sample is assigned to cluster C is recorded as \(\Phi^{c}_{\eta}(X_{i})\). The cluster head model minimizes the loss function, SCAN_LOSS, by constantly learning and updating its weights to achieve the purpose of model training. SCAN_LOSS is composed of two terms, i.e., Consistency loss and entropy loss, which is defined as follows:  
\[SCAN\_LOSS=-\frac{1}{|F|}\sum_{x\in F}\sum_{k\in N_{x}}\log[\Phi_{\eta}(X),\Phi _{\eta}(k)]+\lambda\sum_{x\in F}\[PERSON]^{\prime c}_{\eta}\log\Phi^{\prime c}_{\eta} \tag{3}\]  
\[\text{with }\Phi^{\prime c}_{\eta}=\frac{1}{|F|}\sum_{x\in F}\[PERSON]^{\prime c}_{ \eta}(X)\]  
Consistency loss (the first term in Equation (3)) measures consistency and makes consistency prediction for samples and their neighbors by introducing \(\Phi_{\eta}\). When a sample and its nearest neighbors are all accurately predicted to the same category, the dot product is maximized. In this way, consistency loss reaches the minimum.