Full text
Computational Phrase Segmentation of Iberian Folk Traditions: An Optimized LBDM Model Amir Abbas Orouji, Nadia Carvalho[0000→0001→6882→5138],AntónioSá Pinto[0000→0003→1629→8385],andGilbertoBernardes [0000→0003→3884→2687] INESC TEC, Faculty of Engineering, University of Porto, Porto, Portugal [email protected], [email protected], [email protected], [email protected] Abstract. Phrase segmentation is a fundamental preprocessing step for computational folk music similarity, specifically in identifying tune families within digital corpora. Furthermore, recent literature increasingly recognizes the need for tradition-specific frameworks that accommodate the structural idiosyncrasies of each tradition. In this context, this study presents a culturally informed adaptation of the established rule-based Local Boundary Detection Model (LBDM) algorithm to underrepresented Iberian folk repertoires. Our methodological enhancement expands the LBDM baseline, which traditionally analyzes rests, pitch intervals, and inter-onset duration functions to identify potential segmentation boundaries, by integrating a sub-structure surface repetition function coupled with an optimized peak-selection algorithm. Furthermore, we implement a genetic algorithm to maximize segmentation accuracy by weighting coe!cients for each function while calibrating the metaparameters of the peak-selection process. Empirical evaluation on the I-Folk digital corpus, comprising 802 symbolically encoded folk melodies from Portuguese and Spanish traditions, demonstrates improvements in segmentation F-measure of six and sixteen percentage points (p.p.) relative to established baseline methodologies for Portuguese and Spanish repertoires, respectively. Keywords: Music phrase segmentation ·Iberian folk music ·LBDM model ·Optimization 1Introduction The preservation and analysis of folk music traditions are pivotal in safeguarding cultural heritage and advancing musicological scholarship. Iberian folk music, encompassing the rich traditions of Spain and Portugal, represents a vibrant tapestry of cultural identity, historical narratives, and regional distinctiveness [4]. Although finding a common definition for a segment in music can be a challenging task [17] but we can vaguely accept that a segment is a temporally contiguous section of music that exhibits internal coherence and is perceived as a distinct structural unit, typically bounded by points of significant musical change or discontinuity. Consequently, Computational segmentation of musical Proc. of the 17th International Symposium on CMMR, London, UK, Nov. 3-7, 2025 557
A.Orouji et al. phrases in such repertoires enables musicologists to uncover structural patterns, identify stylistic characteristics, and explore intercultural exchanges on a large scale. Music phrase segmentation, i.e., identifying meaningful structural units within a musical piece, is a fundamental preprocessing stage for many computational musicology tasks. With its diverse regional variations and historical cross-pollination for Iberian folk music, accurate phrase segmentation is particularly crucial for understanding both local distinctiveness and broader cultural connections across the Iberian Peninsula [23]. Within the current computational musicology landscape, two main approaches to phrase segmentation have emerged, each with distinctive methodological implications: – Rule-based approaches implement musicological principles through explicit computational rules [14]. While these methods o!er high interpretability and direct connection to music theory and cognition, they often require extensive adaptation when applied across diverse musical traditions, as they typically encode Western art music assumptions that may not transfer to folk idioms [7,25]. – Machine learning approaches employ supervized and unsupervized learning on annotated corpora to identify segmentation boundaries. While powerful when adequately trained, supervized methods require substantial labeled data—a resource often unavailable for underrepresented musical traditions—and may struggle to generalize beyond their training repertoire. On the other hand, statistical modeling (unsupervized) approaches identify patterns through mathematical analysis of musical features without requiring labeled data. Though flexible in data-scarce contexts, these methods frequently lack sensitivity to tradition-specific musical gestures and structural conventions that define phrase boundaries in culturally distinct ways. Existing work on computational analysis of Iberian folk traditions, namely adopting the I-Folk dataset [3], comprising 59 Portuguese and 743 Spanish folk melodies, showed stylistic di!erences between these neighboring traditions, thus requiring tradition-specific computational approaches. To address this, we developed a hybrid methodology that combines the Local Boundary Detection Model (LBDM) [2] with sub-structure surface repetition based on Variational Markov Oracle (VMO) [27] to capture both local boundary cues and repetitive structures. This study’s primary musicological contribution lies in its traditionsensitive computational framework, optimized through a genetic algorithm that determines ideal weighting parameters for each tradition. By making these structural patterns computationally accessible, our work enables deeper musicological analysis of Iberian folk traditions, facilitating crosscultural comparative studies while preserving the distinctive voice of each tradition. The methodologies presented o!er a model for developing culturallyinformed computational tools that serve both preservation and scholarly objectives within musicology and digital music libraries. The remainder of this paper is organized as follows. Section 2 reviews key methodologies for computational phrase segmentation, their relevance to musiProc. of the 17th International Symposium on CMMR, London, UK, Nov. 3-7, 2025 558
Computational Phrase Segmentation of I-Folk cology, and their limitations, particularly in the context of Iberian folk music traditions. Section 3 introduces the I-folk dataset. Section 4 discusses the details of our model, namely pattern-enhanced LBDM and optimization of the traditionspecific weights, whose evaluation is detailed in Section 5. Section 6 discusses the performance of our model. Finally, Section 7 summarizes the findings and directions for future work. 2RelatedWorks Computational music segmentation approaches can be categorized into rulebased and machine-learning methods. Rule-based approaches draw upon musictheoretical principles to identify phrase boundaries systematically. The foundational work is Lerdahl and Jackendo!’s Generative Theory of Tonal Music (GTTM) [14], which segments music through grouping structure, metrical structure, and hierarchical reductions using preference rules evaluating attack points, rests, register changes, and harmonic rhythm. However, GTTM’s reliance on tonal hierarchies and regular metrics poses challenges for orally transmitted traditions with irregular patterns and non-Western systems. Temperley [25] developed the Grouper Program using temporal information (inter-onset intervals and meter) with three criteria: normalized interval sums, phrase length penalties, and metrical hierarchy preferences, achieving F-measures of 0.62–0.66 [10,20]. Alternative approaches include Narmour’s Implication-Realization theory [16], emphasizing dynamic expectation processes, and Pearce’s information-theoretic model [19] using entropy measures. Central to our work is Cambouropoulos’s LBDM [2], which identifies boundaries by measuring changes in pitch, interonset intervals (IOI), and rest durations between adjacent events. Cenkerová [5] compared rule-based methods and proposed using IOI di!erences rather than absolute values. Despite theoretical sophistication, rule-based approaches face implementation challenges including ambiguous definitions, rule conflicts, and limited cross-cultural applicability [15]. Machine learning approaches o!er alternatives but have limitations for folk music. Supervised methods like Random Forest [11] and Bi-LSTM-CRF [28,9] achieve high accuracy but require large annotated datasets, notably scarce in folk traditions [24]. Unsupervised methods, including clustering [18], n-gram models [20], and neural networks [12,13], avoid annotation requirements but produce less precise boundaries in stylistically diverse repertoires. Most relevant to our approach, Cenkerová [5,6] used evolutionary computation to optimize LBDM weights for the Essen folk dataset, achieving 65% F-measure and highlighting the potential for adapting segmentation parameters to specific musical traditions—directly informing our traditionsensitive methodology for Spanish and Portuguese folk music. 3IberianFolkMusicCollection:I-Folk The dataset comprises 802 folk songs (743 Spanish, 59 Portuguese) encoded in symbolic format with note-level information including pitch, duration, and rests. Proc. of the 17th International Symposium on CMMR, London, UK, Nov. 3-7, 2025 559
A.Orouji et al. Songs were preprocessed to extract musical features for phrase segmentation: pitch intervals, IOI, and rest durations. Ground-truth phrase boundaries, manually annotated by musicologists, served as evaluation benchmarks. Our approach integrates substructure surface repetition with LBDM to address LBDM’s limitation in modeling repetition and event context. This combination of local feature detection and repetition modeling is tailored to Iberian folk music’s repetitive structures. Genetic algorithms were explored for segmentation optimization. We conducted an exploratory analysis of annotated songs to examine segment boundary distribution and contextual patterns. For each piece, we computed the rest ratio (proportion of segments followed by rests, normalized by total segments) and analyzed IOIs at segmentation points versus non-segmenting notes. The normalized IOI di!erence was calculated as the mean IOI at segment boundaries compared to all other notes, normalized by the latter. Parallel analysis was applied to pitch intervals (semitones), producing normalized pitch interval ratios. Results were averaged by folk tradition to compare Portuguese and Spanish boundary articulation patterns, establishing baselines for algorithmic segmentation (please refer to Figure 1). Fig. 1. Segmentation boundary characteristics in Portuguese and Spanish musical traditions. The bars show the percentage of boundaries aligned with three musical features relative to all other surface events: Inter-Onset Interval (IOI) changes, presence of rests, and melodic interval changes. 4Method Our computational approach implements an enhanced LBDM augmented with sub-structure repetition analysis for phrase segmentation in Iberian folk music. The system utilizes music21 [8] for symbolic music representation, SciPy [26] for signal processing, and DEAP [21] for evolutionary optimization (Figure 2). 4.1 Enhanced Local Boundary Detection Model The LBDM [2] identifies phrase boundaries by quantifying discontinuities in musical parameters between adjacent notes. While classical implementation assigns fixed weights to pitch interval (0.25), IOI (0.25), and rest duration (0.5), our implementation introduces refinements for Iberian folk characteristics. Proc. of the 17th International Symposium on CMMR, London, UK, Nov. 3-7, 2025 560
Computational Phrase Segmentation of I-Folk Fig. 2. Block diagram of our model. For each note i,boundarystrengthS(i)is calculated as: si=Wxi(ri→1.i +ri,i+1)(1) where W is the feature weight, xiis the feature (pitch, IOI, rest), and rrepresents the normalized change between adjacent values. Higher boundary strength values indicate potential phrase demarcations in the musical structure. Unlike the classical model, which adopts a fixed threshold approach (typically 0.2) to select all local maxima above this value—a strategy designed to avoid spurious peaks that might arise from noise or minor fluctuations—our extension employs a more sophisticated optimized approach. Our method employs SciPy peak-picking with optimized kernel size and o!set parameters rather than fixed thresholds. Kernel size determines neighborhood scope for local maximum detection, while o!set establishes dynamic baseline adjustment. This enhances sensitivity to Iberian phraseological structures while maintaining robustness against false positives. Additionally, given that derivatives cannot be computed at the endpoints, we incorporated the initial and final notes of each musical piece as independent segments in our calculation of boundary strength. 4.2 Sub-structure Surface Repetition Analysis To address repetitive structures in the folk melodic organization, we augmented the LBDM with Variable Markov Oracle (VMO)-derived features [27]. The VMO constructs probabilistic su"x tree representations, facilitating the identification of recurrent patterns. Two complementary features were incorporated: 1. Forward repetition feature:Quantifiestheinitiationpointsofrepeated melodic sequences, capturing the anticipatory nature of phrase structure 2. Backward repetition feature:Markstheconclusionpointsofrepeated segments, identifying potential cadential functions To compute these features, we create a su"x-link oracle from the musical sequence to identify repeated patterns and their structural depth. Each state in Proc. of the 17th International Symposium on CMMR, London, UK, Nov. 3-7, 2025 561
A.Orouji et al. the oracle has a su"x link that points to a previous state where repetition is the longest, along with the respective longest repeated sequence (LRS) value representing the repetition length. By calculating the derivative of the LRS sequence and then propagating this information backward along the su"x chain, we can track how repetition depth changes over time and connect current structural shifts with earlier motifs(Figure 3). The rationale behind feature selection that marks the initiation and conclusion points of each segment is based on the fact that rest in the LBDM model makes the most significant contribution to the overall segmentation, and it is more likely to occur at the beginning or end of each phrase. Fig. 3. Structural dynamics via forward and backward su!x-link oracles. From top to bottom: musical score; longest repeated su!x (LRS); derivative of the LRS; normalized propagation for forward (blue solid) and backward (orange dashed) oracles. These values received weights Wforward and Wbackward and were integrated into the expanded boundary strength function, enabling recognition of both local discontinuities and broader structural patterns. Proc. of the 17th International Symposium on CMMR, London, UK, Nov. 3-7, 2025 562
Computational Phrase Segmentation of I-Folk 4.3 Adaptive Peak-picking Strategy Classical LBDM designates all local maxima as potential boundaries without filtering, proving insu"cient for Iberian folk traditions. Our preliminary analysis revealed significant variation between Spanish and Portuguese boundary patterns, necessitating tradition-specific calibration. We implemented two-phase peak detection: establishing a reference model with SciPy’s algorithm using kernel size 5 and o!set 0.25, then incorporating these parameters into genetic optimization. Optimization parameters include kernel size (range constraint between 3–9), which controls analytical window width for local maxima identification, and O!set threshold (in range of 0.2–7) that determines required prominence for boundary recognition. This adaptive approach yielded optimal tradition-specific parameters, confirming that e!ective segmentation requires methodological calibration for each regional tradition. 4.4 Tradition-Specific Parameter Optimization We implemented genetic algorithms to optimize parameters for Spanish and Portuguese traditions: feature weights (pitch, IOI, rest), peak-picking parameters (kernel size, o!set), and VMO-based features (forward/backward repetition) for OPT-LBDM and OPT-PE-LBDM, respectively. The genetic algorithm optimized the F-measure and R-value (see Section 5) within these bounds: feature weights 0–1, kernel size 3–9, and o!set threshold 0.2–7. Across 50 generations, using a crossover rate of 0.5 and a mutation rate of 0.2, it converged on parameter sets tuned to each tradition’s boundary patterns. 5Evaluation We evaluated our tradition-specific segmentation framework using multiple complementary metrics against expert-annotated phrase boundaries from the I-Folk dataset [3]. Annotations were produced by musicologists specializing in Iberian folk traditions, ensuring culturally informed ground truth. The F-measure served as our primary metric, providing a balanced assessment through precision and recall. We complemented this with R-value [22] which has a di!erent nature and applies penalties to both false positives and false negatives, which incorporates boundary proximity for more nuanced assessment. We implemented 4-fold cross-validation, maintaining a proportional representation of regional styles, accounting for the dataset’s imbalance between Portuguese (59) and Spanish (743) samples. Independent optimization and evaluation were performed for each tradition, recognizing that tradition-specific parameterization is essential for e!ective segmentation. We systematically evaluated three segmentation models for each tradition: 1. Classical LBDM (Baseline): Original LBDM using unweighted local maxima without peak-picking refinement Proc. of the 17th International Symposium on CMMR, London, UK, Nov. 3-7, 2025 563
A.Orouji et al. 2. Optimized LBDM (OPT-LBDM): Enhanced baseline with traditionspecific weighting and optimized peak-picking parameters 3. Optimized Pattern-Enhanced LBDM (OPT-PE-LBDM): Most sophisticated model augmenting OPT-LBDM with VMO-derived repetition features Independent optimization was performed for Portuguese and Spanish traditions within each cross-validation fold, preventing information leakage between training and testing partitions. 6Results Four-fold cross-validation shows that tradition-specific optimization improves phrase segmentation performance in Iberian folk music. Tables 1 and 2 report the evaluation metrics for three model variants under F-measure and R-value optimization objectives. For the Spanish repertoire, tradition-specific optimization improved the Fmeasure from 0.50 to 0.66 (a 16 p.p. increase), primarily due to gains in precision (from 0.38 to 0.71). The OPT-PE-LBDM variant, which integrates repetition features, resulted in lower performance (F-measure = 0.62; R-value = 0.26) than OPT-LBDM, indicating that local discontinuities contribute more reliably to phrase boundary detection in this repertoire than surface-level repetitions. Under R-value optimization, performance gains were similar (F-measure = 0.66), but with an increased R-value of 0.52 and maximum precision of 0.78. These results suggest that precision was prioritized in the R-value objective function. The baseline LBDM model yielded a high recall (0.89) but low precision (0.38), producing an F-measure of 0.50. This imbalance indicates a tendency toward over-segmentation. The associated R-value was negative (-0.75), revealing poor alignment Spanish phraseological structures. Table 1. Evaluation results on the Spanish repertoire. Metrics are shown for the baseline LBDM and two optimized models under F-measure and R-value objectives. Precision Recall F-measure R-value LBDM 0.38 0.89 0.50 -0.75 F-measure Optimization OPT-LBDM 0.71 0.72 0.66 0.45 OPT-PE-LBDM 0.59 0.77 0.62 0.26 R-value Optimization OPT-LBDM 0.78 0.69 0.66 0.52 OPT-PE-LBDM 0.62 0.75 0.63 0.31 On the Portuguese repertoire, the baseline LBDM achieved a higher Fmeasure (0.58) than on the Spanish set, with slightly more balanced precision Proc. of the 17th International Symposium on CMMR, London, UK, Nov. 3-7, 2025 564
Computational Phrase Segmentation of I-Folk and recall (0.50 / 0.81). The smaller gap between baseline and optimized models suggests closer alignment with the default LBDM features. F-measure optimization improved performance to 0.64 with a 19 p.p. gain in precision. Similar to Spanish results, repetition features negatively a!ected performance. OPT-PELBDM yielded an F-measure of 0.59 and R-value of 0.36. R-value optimization increased precision further (to 0.72) and achieved the highest R-value (0.53), though recall dropped and F-measure decreased to 0.61. This trade-o!indicates that the R-value metric prioritized precise but sparser boundary detection. Although the results for Portuguese songs are less variable, the smaller sample size compared to the Spanish corpus (59 vs. 743) should be considered when interpreting these findings. Table 2. Evaluation results on the Portuguese repertoire. As in Table 1, results are shown for the baseline and two optimized models. Precision Recall F-measure R-value LBDM 0.50 0.81 0.58 -0.03 F-measure Optimization OPT-LBDM 0.69 0.68 0.64 0.45 OPT-PE-LBDM 0.57 0.67 0.59 0.36 R-value Optimization OPT-LBDM 0.72 0.60 0.61 0.53 OPT-PE-LBDM 0.60 0.66 0.60 0.46 6.1 Feature Weight Analysis The average feature weights learned by the genetic algorithm across the four cross-validation folds are reported in Tables 3 and 4. In both F-measure and R-value optimization scenarios, the rest feature dominated segmentation for the Spanish repertoire (up to 0.49), consistent with previous descriptions of "silencio"(Silence) as a salient structural cue [1]. In Portuguese songs, rest and IOI received more balanced weights, particularly under R-value optimization, where IOI reached 0.34±0.02. This may point to more varied rhythmic segmentation cues in the Portuguese repertoire, which includes rhythmically complex genres such as fado. However, the current dataset size limits deeper generalization. Pitch was consistently the lowest-weighted feature across both traditions and objectives (range: 0.21–0.23), suggesting that local melodic intervals played a secondary role in determining segment boundaries. Interestingly, while Spanish weights for pitch were initially higher, the R-value optimization with repetition features (Table 4) resulted in slightly higher pitch weights for Portuguese music. Repetition features (forward and backward) accounted for a combined weight between 0.23(0.10+0.13) and 0.28(0.13+0.15) in OPT-PE-LBDM but did not yield Proc. of the 17th International Symposium on CMMR, London, UK, Nov. 3-7, 2025 565