# Voice Pathology Detection and Classification Using Convolutional Neural Network Model
## 3 Proposed Methodology
### Training and Validation Stage  
To train and validate the deep learning model, the dataset have been split into different sets as mentioned before. Subsequently, 10-fold cross-validation indices were generated for each set in the training and validation phases so that for each experiment we can use the same data sets. For the final evaluation of the models, the test set was left. Next, the testing and validation sets are stratified to the age and gender classes, by medical status (Healthy--H, Pathology--P). The long recordings were divided into several chunks which were necessary to prevent leakages into the test or validation set. These chunks have been carefully removed from the set. The other chunks were included in the training set. In each point of the validation confusion matrix, we used specific number samples that were taken from 150 healthy--H, pathological--P samples. To detect a pathology using the CNN model, we used 874 pathological and 200 healthy samples for testing the confusion matrix. We separated all the dataset into training, validation, and testing sets and made sure that the number of healthy and pathological samples was equivalent in each of the training and validation sets. The remainder has been added to the test set. In sum, 960 (480 healthy, 480 pathological) samples have been used for the training, 300 (150 healthy, 150 pathologic) samples have been applied for validation, and 874 (200 healthy and 674 pathological) samples have been used for testing. In the training phase, the distribution of the samples is unequal. We responded to this by adjusting the weights of samples, which are used for the minority groups during training to compensate. A 3-part weight product is the weight of the final sample. The number of subgroups in the group chosen (e.g., ratio of normal as well as pathological) is quantified by increasing partial weight. To this end, we presented a class weight \(\alpha\), gender weight \(\beta\), as well as a group of gender-age weight \(\gamma\) that led to a final sample weight \(\omega\) that is calculated as \(\omega=\alpha\cdot\beta\cdot\gamma\). Furthermore, weights can be determined for a given sample in subgroup \(\alpha\) in group \(\alpha\), \(\beta\)i in group \(\beta\), and \(\gamma\)i in group \(\gamma\). We have chosen the best hyperparameters for the cross-validation configuration as an output measurement. After tuning the hyperparameters, we have retrofitted and then evaluated the deep learning algorithms with the unsurpassed hyper- parameters over the whole set of training. In terms of a classification report (CR) and a confusion matrix (CM), the final results are presented. Formulation 1, 2 and 3 define how the CR tables calculate the recall, precision, and F1 score (weighting the average accuracy and recall). These three measurements are determined as follows:  
* The _Precision_ metric is used for measuring the proportion of the subjects that are of great importance. With this metric, the classifier's ability to reject unimportant subjects is measured. The following is an expression of the metric: \[\text{Precision}=\frac{(\text{TP})}{(\text{TP}+\text{FP})}\] (1)
* The _F1 score_ is described as the weighted average of the precision and recall, the best value of F1 score is reached at 1, while the worst score is at 0. The precision and recall make an equal relative contribution to the F1 score. The F1 formula is given as follows: \[\text{F1 Score}=2*\frac{(\text{Precision}*\text{ Recall})}{(\text{Precision}+ \text{ Recall})}\] (2) \begin{table}
\begin{tabular}{l c} \hline \hline
**Hyper-Parameters** & **Values** \\ \hline Optimization Method & Adam \\ Momentum & 0.93 \\ Weight-Decay & 0.0006 \\ Dropout & 0.3 \\ Batch Size & 90 \\ Learning Rate & 0.02 \\ Total No. of Epochs & 10 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: The best-trained model parameters utilized in Voice Pathology Detection DeepNet System. * The _Recall_ metric is used for the evaluation of the proportion of important subjects that are identified.