# Seismic Signal Compression Using Nonparametric Bayesian Dictionary Learning via Clustering
## 2 Seismic Signal Compression Based on Offline Dictionary Learning  
In this section, we will introduce how to compress seismic signals in the offline dictionary learning approach (OffDL) [7]. Compared with a fixed basis set, learning an adaptive basis set to a specific set of signals could result in better performance. Supposing input signals \(\mathbf{Y}=\{\mathbf{y}_{i}\}_{i=1,\ldots,K}\in\mathbb{R}^{M\times K}\), the dictionary \(\mathbf{D}\in\mathbb{R}^{M\times N}\), and the sparse vector \(\mathbf{W}=\{\mathbf{w}_{i}\}_{i=1,\ldots,K}\in\mathbb{R}^{N\times K}\), then \(\mathbf{y}_{i}\) could be represented by a linear combination of the basis from the dictionary \(\mathbf{D}\): \(\mathbf{y}_{i}=\mathbf{D}\mathbf{w}_{i}+\mathbf{e}_{i}\). \(\mathbf{e}_{i}\) could be seen as the noise from the deviation of the linear model. To synchronize the dictionary in the coder and decoder, it is possible to use a pre-learned dictionary by an offline training data. Inspired by this idea, the diagram of the seismic signal compression method based on the offline dictionary learning is shown in Figure 1. It includes two steps: offline training and online testing. In the offline training step,offline training data is used to train the dictionary **D**. In the online testing step, the input testing data is sparsely represented by the trained dictionary **D**, and the result is a sparse matrix **W**. The sparse matrix is quantized and separated into the nonzero coefficients and their positions. The positions could be seen as a binary matrix, where 0 and 1 denote the coefficients of the current position's zero and nonzero value separately. Finally, entropy coding algorithms are used to code them.  
To optimize the dictionary **D** and sparse matrix **W**, sparsity could be used as the regulation term, then the two variables **D** and **W** could be solved by two alternating stages: (1) Sparse representation--for a fixed dictionary **D**, \(\textbf{w}_{i}\) can be solved by some sparse representation algorithms, such as order recursive matching pursuit (ORMP) [12] and partial search (PS) [13]; (2) Dictionary updating--when \(\textbf{w}_{i}\) is fixed, the dictionary can be updated by methods such as the method of optimized directions (MOD) [14] and K-SVD [15]. The tree-structured iteration-tuned and aligned dictionary (TSITD) was proposed in [16]. TSITD can outperform other image compression algorithms in compression images belonging to specific classes. A classification and update step are repeated to train the dictionary in TSITD. Nevertheless, it is difficult to determine the number of classes and dictionary size in each iteration. Utilizing nonparametric Bayesian methods like the beta process [17], we can infer the number of dictionary elements needed to fit the data. This could reduce the size of the binary matrix generated from the quantized sparse matrix, which is beneficial for compression. To yield posterior distributions rather than point estimation for the dictionary and signals, the nonparametric Bayesian dictionary learning model based on Beta Process Factor Analysis (BPFA) [18] demonstrates its efficiency both in inferring a suitable dictionary size and sparse representation.