# An Intelligent Condition Monitoring Approach for
## 3 Condition Monitoring Approach for Shearing Machines
### Training and Recognizing Process of the Hybrid HMM-ANN Model  
#### 3.3.1 Training Process of the Hybrid Model  
As is shown in Figure 4, the training of hybrid HMM-ANN model (HMM-ANN modeling) includes three processes: HMM training, ANN input/target vectors construction and ANN training.  
(1) Selection and Training of HMM.  
Compared with discrete HMM, the continuous HMM has low distortion and better classification effect [30]. Thus, a continuous Gaussian mixture hidden Markov model (CGHMM) was chosen. The probability density of each state is determined jointly by two Gaussian probability density functions. A CGHMM can be expressed as:  
\[\lambda=(\pi,A,\mu_{jk},\sigma_{jk},c_{jk}), \tag{9}\]  
where \(\mu_{jk}\) is the mean vector of the Gaussian function, \(\sigma_{jk}\) the covariance matrix of the Gaussian mixture, \(c_{jk}\) the mixing coefficient matrix, and the index \(j\) denotes the state of HMM, \(k\) the Gaussian mixture. The training procedure is as follows:  
1. Initial guess of parameters. It is generally considered that the initial values of parameters \(\pi\) and \(A\) have little effect while the initial value of parameters \(\mu_{jk}\), \(\sigma_{jk}\) and \(c_{jk}\) have a large influence on the training result of HMMs. The initial values \(\pi\) and \(A\) can be set randomly or evenly. It will be detailed in the empirical part. The initial parameters \(\mu_{jk}^{(0)}\), \(\sigma_{jk}^{(0)}\) and \(c_{jk}^{(0)}\) are estimated by using the segmental k-means algorithm (see literature [40]).
2. Model revaluation. In this study, the Baum-Welch algorithm was used to reevaluate the HMM parameters. For each state of HMM, the constructed model \(\lambda\) is updated based on the following revaluation equations: \[\begin{array}{l}\hat{\pi}_{i}=\gamma_{1}(i),\\ \hat{a}_{ij}=\sum_{t=1}^{T-1}\xi_{t}(i,j)\left/\sum_{t=1}^{T-1}\gamma_{t}(i), \\ \hat{c}_{jk}=\sum_{t=1}^{T}\gamma_{t}(j,k)\left/\sum  
2 Construction of Input/Target Vectors of ANN.  
The feature vectors of the training samples are fed to the HMM layer to calculate the output probabilities of the samples for every HMM. The input vectors of ANN can be constructed with the normalized probabilities of the samples under each of the trained HMMs. The target vectors are constructed according to the state of the samples. The target probability is 1 if the sample belongs to this health state and 0 if not.  
Selection and Training of ANN.  
The selection and training procedure of ANN mainly includes the construction of training samples, the selection of the ANN network model, and the training of ANN:  
1. Establishment of network. An ANN with three layers (input layer, output layer, and hidden layer) is constructed. The number of neurons in the input layer is equal to the dimension of the feature vector, and that of the output layer equals the number of health states. The number of neurons in the hidden layer is mainly determined by tests, while the following empirical equation gives a preliminary range: \[h=\sqrt{(m+n)}+a\] (11) where \(m\) is the number of neurons in the input layer, \(n\) the number of neurons in the output layer, and \(a\) an integer constant between 1 and 10. Besides the network structures, the activation functions are critical points for the performance of ANNs.
2. Setting training parameters, e.g., selections of initial weight, threshold, goal, learning rate, momentum factor, maximum epochs, as well as selections of learning function, training function, and performance function. They are also selected according to their applicabilities, requirements of tasks and through tests.
3. Training of ANN. Use the samples to train ANN iteratively until the accuracy meets the goal value or the accuracy does no longer improve. Thus, the trained ANN model is obtained.