# Seismic Signal Compression Using Nonparametric Bayesian Dictionary Learning via Clustering
## 3 Seismic Signal Compression Using Nonparametric Bayesian Dictionary Learning via Clustering
### Online Training  
The mixed-membership naive Bayes model (MMNB) [19] and BPFA are utilized to learn a set of dictionaries based on clustering, the graphical representation of which is shown in Figure 3.  
Figure 3: Graphical representation of proposed model. Figure 2: Diagram of proposed method. Suppose that the transmitted seismic signals of the previous \(L\) patches are denoted as \(\left[\overrightarrow{\mathbf{X}}_{P-L},\ldots,\overrightarrow{\mathbf{X}}_{P-1} \right]=\left[\overrightarrow{\mathbf{X}}_{1},...,\overrightarrow{\mathbf{x}}_ {i},...,\overrightarrow{\mathbf{x}}_{N\times L}\right]\). The online training algorithm includes the following steps:  
(1) Feature dimension reduction by principal component analysis (PCA)  
To reduce the feature dimension and computation time, PCA is used to generate the feature \(\mathbf{v}_{i}\) from \(\overrightarrow{\mathbf{x}}_{i}\) as follows:  
\[\mathbf{v}_{i}=R^{T}\overrightarrow{\mathbf{x}}_{i} \tag{1}\]  
where the columns of matrix \(R\in\mathbb{R}^{M\times B}\) form an orthogonal basis. It maps \(\overrightarrow{\mathbf{x}}_{i}\) from an original space of \(M\) variables to a new space of \(B\) variables. (2) Clustering via MMNB  
The latent structure from the observed data could be well discovered by probabilistic mixture model--especially the mixture models. Therefore, MMNB is used for clustering with a Gaussian mixture model as  
\[p(\mathbf{v}_{i}|\boldsymbol{\tau},\boldsymbol{\theta})=\sum_{c=1}^{V}p(\rho=c |\boldsymbol{\tau})\prod_{j=1}^{B}p(\mathbf{v}_{i}|\boldsymbol{\theta}_{jc}) \tag{2}\]  
\(\boldsymbol{\tau}\) is a prior of the discrete distribution for clusters, and \(\boldsymbol{\theta}_{jc}\) is the parameters of the Gaussian model for features in cluster \(c\). Firstly, we suppose the number of clusters could be a relatively large value as \(V\). After clustering, small clusters will be merged for the requirement of dictionary learning. The parameters \(\alpha\) (parameter of \(\boldsymbol{\tau}\)) and \(\boldsymbol{\theta}\) are estimated in MMNB by using expectation maximization (EM) algorithms with the following two steps alternating:  
(a) E step:  
For each data point \(\mathbf{v}_{i}\), find the optimal parameters  
\[[\boldsymbol{\gamma}_{i}^{(t)},\boldsymbol{\phi}_{i}^{(t)}]=\arg\max_{ \boldsymbol{\gamma}_{i},\boldsymbol{\phi}_{i}}L(\boldsymbol{\gamma}_{i}, \boldsymbol{\phi}_{i};\theta_{jc}^{(t-1)},\alpha^{(t-1)},\mathbf{v}_{i}) \tag{3}\]  
\(\boldsymbol{\gamma}_{i}\) is a Dirichlet distribution parameter, and \(\boldsymbol{\phi}_{i}\) is a parameter for discrete distributions of the latent components \(\boldsymbol{\rho}\). (b) M step:  
\(\boldsymbol{\theta}_{jc}\) and \(\alpha\) can be updated as follows:  
\[[\boldsymbol{\theta}_{jc}^{(t)},\alpha^{(t)}]=\arg\max_{\boldsymbol{\theta}_{ jc},\alpha}L(\boldsymbol{\theta}_{jc},\alpha;\boldsymbol{\gamma}_{i}^{(t)}, \boldsymbol{\phi}_{i}^{(t)},\mathbf{v}_{i}) \tag{4}\]  
(3) Dictionary learning via BPFA  
Small clusters are merged into other clusters to keep the number of training data large enough for dictionary learning. The following cluster merging algorithm is used (Algorithm 1). \(\mathbf{Y}_{c}=[\mathbf{y}_{c1},\ldots,\mathbf{y}_{cH}]\) represents the segments in cluster \(c\), which are clustered from \(\overrightarrow{\mathbf{X}}\). The number of clusters (denoted as \(N_{m}\)) can be smaller than \(V\). For each cluster, BPFA is an efficient method to learn a dictionary, which naturally infers a suitable dictionary size. It can be described as \[