# Evaluating Preprocessing Techniques for Unsupervised Mode Detection in Irish Traditional Music
## 3 Methods  
The proposed system for the unsupervised classification of musical modes is organized as shown in Figure 1.  
One of the goals of the present work is to check how the method of data preparation can influence the performance of algorithms in the classification procedure. In relation to these goals, an interesting comparison is to check how embedding approaches can capture such a high-level feature as the mode of a song compared to a more manual approach based on a selected feature that musicologists recommend: the pitch profiles. Both paradigms belong to the preprocessing step. Therefore, there are two different flows in this stage, which merge in the second step of classification, where different unsupervised learning classifiers are applied to finally extract the classification results for both sets of preprocessed data. The workflow started from the initial dataset. This dataset consists of traditional Irish music in ABC notation, a text-based format for encoding musical notes and structure. These scores contain not only the digitalized notes but also metadata information about genre, key and mode. In particular, we used the preprocessed and revised version provided by [PERSON] et al. [36], which focuses primarily on monophonic songs and includes ABC fields that capture musical surface details and formal annotations, including mode. The authors reviewed the dataset fields twice to correct for any misclassified annotations. Additionally, all pieces were transposed to the tonic C. In total, the dataset comprises 23,636 folk songs, distributed among modes as follows: Ionian (15,861, 67.1%), Dorian (2971, 12.6%), Mixolydian (1620, 6.9%), and Aeolian (3184, 13.5%). Once the dataset was prepared, the flow was divided. On the one hand, we extracted the Pitch Class Profiles (PCPs) through the music pitches provided by the ABC scores. PCPs represent the distribution of pitches across a 12-semitone octave. They are especially suitable for capturing harmonic information and have been widely used in tasks requiring mode or key identification [37]. We computed both the weighted and simple PCPs. In the weighted PCP, the pitch counts are adjusted by their temporal prominence within each  
Figure 1: Proposed system workflow. piece, whereas in the simple PCP, all pitches are treated equally regardless of duration or placement in the tune. The simple PCP is computed as follows:  
\[\textit{Simple PCP histogram}[c]=\sum_{i=1}^{N}\delta((p_{i}\mod 12)=c),\quad c \in\{0,1,\ldots,11\} \tag{1}\]  
where \(p_{i}\) represents the MIDI pitch of the \(i\)-th note. In the weighted PCP, durations (\(d_{i}\)) and beat strengths (\(b_{i}\)) adjust the contribution of each note:  
\[\textit{Weighted PCP histogram}[c]=\sum_{i=1}^{N}d_{i}\cdot b_{i}\cdot\delta((p_{i }\mod 12)=c) \tag{2}\]  
where \(d_{i}\) assigns a value of 1 to quarter notes, 0.5 to eighth notes, and so on, while \(b_{i}\) follows a hierarchy where strong beats are weighted more heavily than weak beats. In summary, we applied several preprocessing techniques to the PCPs to enhance the representation and prepare the data for classification. These preprocessing techniques included the following:  
* **Weighted and Simple PCPs. ** As mentioned, both weighted and unweighted (simple) PCPs were computed, providing distinct representations of pitch prominence. * **Dimensionality Reduction. ** To reduce the complexity of PCP vectors, we applied Uniform Manifold Approximation and Projection (UMAP) [38] and Locally Linear Embedding (LLE) [39], two widely used nonlinear dimensionality reduction techniques. Each method was applied to both simple and weighted PCPs to examine their effects on classification accuracy and clustering performance. In particular, we selected the umap-learn implementation for UMAP reduction [40] and scikit-learn for LLE reduction [41]. * **Binary PCPs. ** For further simplification, we generated binary PCPs from the simple PCP representations.