# Detection of Fitting in Gears Using a Deep Sparse Autoencoder
## 2 The Methodology
### Dictionary Learning  
In recent years, the application of dictionary learning has been popularized in various fields, including image and speech recognition [21; 22; 23; 24; 25]. The study of dictionary learning application in vision can be traced back to the end of the last century [26]. The goal of dictionary learning is to learn a basis for representation of the original input data. The expansion of dictionary learning based applications is benefited from the introduction of K-SVD [27; 28]. K-SVD is an algorithm that decomposes the training data in matrix form into a dense basis and sparse coefficients. Given an input signal \(\mathbf{x}=[x_{1},x_{2},\ldots,x_{n}]^{T}\), the basic dictionary learning formula can be expressed as:  
\[\min_{\mathbf{D},\mathbf{S}}\lVert\mathbf{x}-\mathbf{D}\mathbf{S}\rVert_{2}^{2} \tag{1}\]  
where \(\mathbf{D}\in\mathbb{R}^{n\times K}\) represents the dictionary matrix to be learnt with dimension \(n\) as number of data points in the input signal \(\mathbf{x}\) and \(K\) as the number of atoms in the dictionary \(\mathbf{D}\), each column of \(\mathbf{D}\) the basic function \(\mathbf{d}_{k}\) also known as atoms in dictionary learning, \(\mathbf{S}=[s_{1},s_{2},\ldots,s_{k}]^{T}\) the representation coefficients of the input signal \(\mathbf{x}\), and \(\lVert\cdot\rVert_{2}\) the approximation accuracy accessed by the \(l^{2}norm\).  
Figure 1: General procedure of the deep sparse autoencoder-based gear pitting detection.  
The goal of dictionary learning is to learn a basis which can represent the samples in a sparse presentation, meaning that \(S\) is required to be sparse. Thus, fundamental principle of dictionary learning with sparse representations is expressed as:  
\[\min_{S}\|S\|_{0} \tag{2}\]  
Subject to:  
\[\|\mathbf{x}-\mathbf{D}\mathbf{\xi}\|_{2}^{2}\leq\gamma \tag{3}\]  
where function \(\|\cdot\|_{0}\) is referred to as \(l_{0}\)_norm_ that counts the nonzero entries of a vector, as a sparsity measurement, and \(\gamma\) the approximation error tolerance.  
As shown in Equation (2), solution of the \(l_{0}\)_norm_ minimization is a NP hard problem [20]. Thus, the orthogonal matching pursuit (OMP) [29] is commonly used to solve approximation of \(l_{0}\)_norm_ minimization. As mentioned previously, the popular used dictionary learning algorithm K-SVD was developed with employment of OMP as well. The K-SVD is constituted by two main procedures. In the first procedure, the dictionary matrix is firstly learnt and then it is used in the second procedure to represent the data sparsely. In the procedure of dictionary learning, K-SVD estimate the atoms one at a time according to the ranking update with efficient technique. Such strategy leads to the disadvantage of K-SVD as relatively low computing efficiency since the singular value decomposition (SVD) is required in each iteration.  
The basic functions of dictionary matrix \(\mathbf{D}\) can be either manually extracted or automatically learned from the input data. The manually extracted basic functions are simple and will lead to fast algorithms, however with poor performance on matching the structure in the analyzed data. An adaptive dictionary should be learned from input data through machine learning based methods, such that the basic functions can capture a maximal amount of structures of the data.