## 3 Onset Detection
Training the classifiers with random-pitched chords is an important characteristic because, this way, the evolved classifiers will neither be constrained to any type of music, for example, western music nor be constrained to any music rules. We trained each of the ten classifiers using 4 folds and tested it with the remaining fold, and we repeated this process for the five combinations of 4 folds. For each of the training and test processes, we computed 10 runs. The k-fold cross-validation and the configurable parameters of our proposed CGP system used are presented in Table 1. The evolutionary process consisted of 10 runs with 10,000 generations each, using 200 positive and 200 negative cases for each fold combination. For individual encoding, we used one row with 100 nodes. The \"harmonic mask\" value was empirically set to 2: the CGP system was prepared using a harmonic mask from the first harmonic to the fifth harmonic. \"Data augmentation\" was set to 3, which means that, for each initial sound file, we generated 3 different ones with time translations forward and backward. The evolutionary process consisted of 10 runs with 10,000 generations each, using the 5-fold dataset division for training and test. The classifiers were evaluated using the F-measure metric, explained in Equation (16). Figure 11 shows the 5-fold cross-validation results. The mean value (\(\mu\)) for F-measure is 0.93 with 0.91 of precision and 0.93 of recall; these values have standard deviations (\(\sigma\)) of 0.027, 0.025, and 0.025, respectively. These values prove that our CGP-based technique is able to learn. \begin{table}
\begin{tabular}{l c} \hline \hline
**Parameter** & **Value** \\ \hline K-folds & 5 \\ \hline Data Augmentation & 3 \\ \hline Positive Test Cases & 250 \\ \hline Negative Test Cases & 250 \\ \hline Frame Size & 4096 \\ \hline Fitness Initial Threshold & 1.5 \\ \hline Outputs & 1 \\ \hline Rows & 1 \\ \hline Columns & 100 \\ \hline Levels Back & 100 \\ \hline \(\lambda\) (_E.S. 1_ + \(\lambda\)) & 4 \\ \hline Mutation Probability & 5\% \\ \hline Threshold Mutation Probability & 6\% \\ \hline Harmonic Mask & 2 \\ \hline Runs & 10 \\ \hline Generations & 10,000 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: The 5-fold cross-validation parameters trained/tested. ### Classifier Training

After demonstrating the quality of our machine learning-based system in the previous section, using the 5-fold cross-validation for a set of classifiers, we had to train all of the 61 pitched-based classifiers in a way to obtain the best possible results for the testing stage. Thus, we performed complete training for all 61 different piano keys to evolve the 61 classifiers. We used a bigger dataset for the training process, consisting of 600 cases of monophonic and polyphonic sounds extracted from the same database used before. The CGP system parameters are identical to those in Table 1 except the number of runs per classifier, which we increased to 20. Therefore, each classifier uses a set of 600 cases, 300 positive case, and 300 negative to evolve 10,000 generations. Figure 12 shows that the mean F-measure calculated over all the 61 classifiers is 0.95 with \(\sigma=0.024\). These are training results, as usually we obtained high values for all 3 measures computed. This trained classifiers will be tested below on a bigger dataset to obtain the final test results and for comparison with other state-of-the-art algorithms. ### Testing

The cross-validation process results gave us an idea about the quality of the classifiers. However, the important and comparable results are those obtained in the test stage. For the test phase, we used the classifiers evolved during the training stage to identify the presence of their corresponding pitches in monophonic and polyphonic audio files. We measured the quality of the classifiers by testing them with a different dataset: the test set.