# An Acoustic Feature-Based Deep Learning Model for Automatic Thai Vowel Pronunciation Recognition
## 4 Materials and Methods
### The Classification by Convolutional Neural Networks Model
#### 4.3.2 The Optimized CNN Model  
To improve the model, the baseline model was updated by adding convolutional layers, max pooling, padding, and dropout strategies. Padding strategies [39] preserve the size of the feature maps and make more improvements. Pooling is a significant concept in CNN architectures that reduces spectral variability in input features [38]. Dropout strategies [58] reduce the overfitting problem. Hyperparameter configuration was applied to the models. The Adam optimizer increased the converging rate and provided a performance increase. The initial learning rate was 0.001. The batch size was 32, and the epoch was 500. The dataset was divided into training and testing sets by K-fold cross-validation (k-fold = 5). Each convolutional layer applied convolution filters to the acoustic features input followed by a nonlinear activation function. A kernel of size 2 was defined for each convolutional layer. The number of filters was set to 32, 64, or 128 in different convolutional layers. The numbers of batch sizes were 32, 64, and 128, and the different dropout values were 20%, 25%, 30%, 35%, 40%, 45%, and 50%. In the optimal convolutional neural networks model for Thai vowel recognition, increasing the convolutional layer and the filter size; adding max pooling; and using padding, dropout strategies, and appropriate activation functions could improve accuracy. The CNN model was trained to learn in a trial-and-error way and maintained by increasing the testing accuracy in small steps, which allowed testing accuracy to improve to 90.0%. This research proposed an optimal CNN model for Thai vowels consisting of three convolutional layers, two max pooling layers, one flatten layer, and two fully connected layers. This architecture is shown in Figure 5. The details of the model are as follows:  
* The first convolutional layer consists of 128 filters (2 \(\times\) 2), an ELU activation function, max pooling (2 \(\times\) 2), and dropout (0.35). * The second convolutional layer consists of 64 filters (2 \(\times\) 2), the ELU activation function, max pooling (2 \(\times\) 2), and dropout (0.35). * The third convolutional layer consists of 128 filters (2 \(\times\) 2), a ReLU activation function, and dropout (0.35) but no pooling layer. * Finally, the fully connected layer consists of 64 hidden units with dropout (0.35), and Softmax activation function is used for the classification in the last layer. Figure 5: The architecture of the optimized CNN model for Thai vowels. The MS or MFCC acoustic feature inputs were formatted as images and consisted of rows, columns, and one channel (#frequencies, #times, 1) for feeding into this model. The acoustic features vector was determined to have different input nodes in the 2-dimensional (2D) convolutional layers. The 2D convolution layer is a layer that extracts significant patterns from the input. The purpose was to create a feature map with convolution filters, and it used nonlinear activation functions. The input of the 2D convolution layer in Equation (8) is \(x(i,j)\), and the result \(y(i,j)\) can be obtained by convolving the input \(x(i,j)\) with the convolution filter or kernel \(w(i,j)\)[50], defined as follows:  
\[y(i,j)=x(i,j)*w(i,j) \tag{8}\]  
When features into nonlinear activation functions, the output of the convolution layer is defined as follows:  
\[y_{i}^{l}=(\sum_{j}^{j}y_{j}^{l-1}*w_{ij}^{l}+b_{i}^{l}) \tag{9}\]  
In Equation (9), where \(y_{i}^{l}\) denotes the _i-th_ output feature at the _l-th_ layer. \(y_{j}^{l-1}\) denotes the _j-th_ input feature at the (_l-1_)-th_ layer. \(w_{ij}^{l}\) denotes convolution filter between the _i-th_ and _j-th_ feature. \(b_{i}^{l}\) denotes the _i-th_ bias at the _l-th_ layer. \((\cdot)\) denotes activation functions. Currently, ReLUs are well-known activation functions [59]. Relatively, ReLUs are implemented in deep learning.