# A Hybrid CNN and RNN Variant Model for Music Classification
## 5 Results and Discussion  
We developed and compared the accuracies of four different combinations, including CNN+LSTM, CNN+Bi-LSTM, CNN+GRU, and CNN+Bi-GRU, using Mel-spectrograms and MFCC features, which are mentioned in Table 2 and Figure 10, to evaluate the performance of the proposed hybridization.  
\begin{table}
\begin{tabular}{l c c} \hline \hline
**Parameters** & **Candidate Set** & **Optimized** \\ \hline Window Length & - & 2048 \\ Hop Length & - & 512 \\ Convolutional Block & \(\{3,5,7\}\) & 5 \\ Kernel Dimensions & \(\{3,5,7,\,9,\,11\}\) & 5 \\ Number of Kernels & \(\{32,64,\,128,\,256,\,512\}\) & 128 \\ Number of LSTM/B-LSTM/GRU/Bi-GRU & - & 3 \\ Number of hidden units in RNN Variants & \(\{64,\,96,\,128,\,256,\,512\}\) & \(128,\,64\) \\ Number of Epochs & \(\{30,\,40,\,50,\,60\}\) & 50 \\ Dropout & - & 0.25 \\ Window Length & \(\{0.1,\,0.01,\,0.001,\,0.0001\}\) & 0.001 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Parameter configuration used to build the proposed architecture.  
Figure 8: Proposed CNN and variants of RNN (LSTM/GRU).  
Figure 9: Proposed CNN and variants of RNN (Bi-LSTM/Bi-GRU) architecture.  
Using Mel-spectrograms and MFCC features from the GTZAN dataset, we compared various combinations. With an accuracy of 89.30%, the combination of CNN+Bi-GRU performed the best for Mel-spectrograms. The CNN+LSTM combination model achieves an accuracy of 87.20%. On the other hand, we evaluated the proposed models' performance in terms of MFCC features. The combination of CNN+LSTM achieved the highest accuracy of 76.40%, while CNN+RNN achieved the lowest accuracy of 71.50%. Table 3 and Figure 11 compare the proposed models to the state-of-the-art models.  
\begin{table}
\begin{tabular}{l c c} \hline \hline
**Features** & **Model** & **Accuracy** \\ \hline Mel-Spectrogram & CNN+LSTM & 87.20\% \\ Mel-Spectrogram & CNN+Bi-LSTM & 88.00\% \\ Mel-Spectrogram & CNN+GRU & 87.78\% \\ Mel-Spectrogram & CNN+Bi-GRU & 89.30\% \\ MFCC & CNN+LSTM & 76.40\% \\ MFCC & CNN+Bi-LSTM & 73.69\% \\ MFCC & CNN+GRU & 71.50\% \\ MFCC & CNN+Bi-GRU & 76.30\% \\ \hline \hline \end{tabular}
\end{table}
Table 2: Results of extracted features with proposed hybrid architecture.  
Figure 10: Results of extracted features with the proposed hybrid architecture.  
The findings indicate that the classification effectiveness of the CNN-BiGRU and CNN-BiLSTM networks using a bidirectional framework is preferred to that of CNN-GRU and CNN-LSTM networks without bidirectionality. Furthermore, acknowledging the pattern of information enables the model to more intelligently recognize the value of the features retrieved by the convolutional neural networks at a specific time. There is initially a convolutional block in the hybridization in terms of CNN and RNN variants. Also, the gradient during backpropagation is not sufficient, restricting the network layers from being proficiently updated, which probably contributed to lower accuracy. The training performance of the model depends upon the hardware used for the experiments. We used a Core i5 Intel 3.2 GHz processor with 10 th generation and 32 GB RAM to execute the program on Microsoft Windows. Figure 12 elaborates the comparison between the training and validation accuracy. It can be seen that after 20 epochs, the validation accuracy becomes stable up to 50 epochs. Similarly, Figure 13 shows the validation loss statistics of the model.  
We also calculated the precision, recall, and F1 score to assess how well the model works, as shown in Table 4.  
Figure 11: Comparison between the proposed hybrid and the other state-of-the-art models.  
Figure 12: Training and validation accuracy.  
Figure 13: Training and validation loss.  
Furthermore, results are also based on input image size, number of layers, number of kernels, and the size of the network kernels. It can be seen the proposed model obtains the precision, recall, and F1-scores of 0.85, 0.91, and 0.88, respectively, as shown in Table 4. These results confirm the significance of the model when compared with the other models.