# Seismic Signal Compression Using Nonparametric Bayesian Dictionary Learning via Clustering
## 3 Seismic Signal Compression Using Nonparametric Bayesian Dictionary Learning via Clustering
### Online Testing
```
Input:\(\mathbf{X}_{P}=[\mathbf{x}_{1},\ldots,\mathbf{x}_{N}]\), \(I\) (iteration number), \(\mathbf{D}_{c}(c\in[1,N_{m}])\), \(\alpha,\theta\) Initialization: Draw the following values: \(\mathbf{s}_{ci}^{(0)}\), \(\mathbf{e}_{ci}^{(0)}\), \(\boldsymbol{\pi}_{ck}^{(0)}\), \(\boldsymbol{\gamma}_{ce}^{(0)}\), \(\boldsymbol{\gamma}_{ce}^{(0)}\), \(\boldsymbol{\kappa}_{ci}^{(0)}\) as Equation (5) for\(i\gets 1\)to\(N\)do  Compute \(\mathbf{v}_{i}\) from \(\mathbf{x}_{i}\);  Compute \(\boldsymbol{\gamma}_{i}\) and \(\boldsymbol{\phi}_{i}\) using Equation (3);  end for  Generate \(\mathbf{Y}_{c}\) based on Algorithm 1; for\(c\gets 1\)to\(N_{m}\)do  for\(t\gets 1\)to\(I\)do  Compute \(\mathbf{z}_{ci}^{(t)}\) and \(\mathbf{s}_{ci}^{(t)}\) with the given dictionary \(\mathbf{D}_{c}\) based on Equation (5);  Compute \(\mathbf{w}_{ci}^{(t)}=\mathbf{z}_{ci}^{(t)}\odot\mathbf{s}_{ci}^{(t)}\);  end for  end for  Quantize \(\mathbf{w}_{ci}^{(I)}\) and use the probability model (Equation (6)) to code it, generate the code \(\mathcal{A}\). Output:\(\mathcal{A}\)
```  
**Algorithm 3**Online Testing Algorithm Based on MMNB and BPFA  
The online testing algorithm can be summarized as Algorithm 3. ``` Input:\(\mathbf{X}_{P}=[\mathbf{x}_{1},\ldots,\mathbf{x}_{N}]\), \(I\) (iteration number), \(\mathbf{D}_{c}(c\in[1,N_{m}])\), \(\alpha,\theta\) Initialization: Draw the following values: \(\mathbf{s}_{ci}^{(0)}\), \(\mathbf{e}_{ci}^{(0)}\), \(\boldsymbol{\pi}_{ck}^{(0)}\), \(\boldsymbol{\gamma}_{ce}^{(0)}\), \(\boldsymbol{\gamma}_

### Performance Analysis

In our algorithm, the coded information includes the value of nonzero coefficients, their position information, and their cluster information. The position information is a binary sequence where 0 indicates a zero and 1 denotes a nonzero value. This binary sequence can be encoded using an adaptive arithmetic coder. We suppose the input data is \(\mathbf{X}_{P}\in\mathbb{R}^{M\times N}\) from patch \(P\), including \(N_{m}\) clusters. The corresponding dictionary of cluster \(c\) is denoted as \(\mathbf{D}_{c}\). By using BPFA, the dictionary size of different clusters can be distinct, denoted as \(\mathbf{D}_{c}\in\mathbb{R}^{M\times F}\). The number of nonzero elements in cluster \(c\) is expressed as \(E_{c}\). The total rate \(R\) can be approximately computed as:

\[R=\frac{N\times\log_{2}{(N_{m})}+\sum\limits_{c=1}^{N_{m}}{g_{c}+Sum\times \rho}}{M\times N} \tag{7}\]

where \(Sum=\sum\limits_{c=1}^{N_{m}}{E_{c}}\), and \(g_{c}=N\times l^{c}\times f(\frac{E_{c}}{N\times F})\) is the entropy of coefficients' positions. \(\rho\) is the entropy of nonzero coefficients. Multiple segments can be combined together, sharing the same cluster information for the reduction of rate. The reconstruction quality is evaluated by SNR as follows:

\[\text{SNR}=10\log_{10}\frac{\varepsilon_{\text{signal}}^{2}}{\varepsilon_{ \text{noise}}^{2}} \tag{8}\]

where \(\varepsilon_{\text{signal}}\) and \(\varepsilon_{\text{noise}}\) are the variances of the signal and the noise, respectively. ## 4 Experimental Results

The seismic data [22] is adopted to validate the performance of proposed method. The Bison 120-Channels sensor is used for seismic data collection. The length of the test area was around 300 m, and the receiver interval was 1 m. It included 72 sensors, and each sensor included 135 traces. For each trace, 1600 time samples were used in our experiments. The seismic signals were divided into small segments for dictionary learning and sparse representation. The dimension of each segment was \(16\times 1\). Some test samples (50 traces from one sensor) are shown in Figure 4.

Figure 4: Some test samples. ### Clustering Experiment

Firstly, we carried out the experiment of clustering based on MMNB for seismic signals. A clustering algorithm based on the naive Bayes (NB) model [23] was adopted for comparison.