## 2 Materials and Methods
### Data Analysis
#### 2.2.3 Unsupervised Clustering Method  
An unsupervised ML technique was implemented using the well-known k-means clustering algorithm for image segmentation [58]. The k-means clustering technique is based on partitioning a dataset into a certain number of disjoint clusters (groups of data). This technique requires the initialization of the number of clusters (k) and the center of each cluster (centroid). In this study, the number of clusters was selected to be two (inside or outside the glottal area) and the initial centroids were chosen based on the k-means++ algorithm, which uses a heuristic in order to initialize centroid seeds for k-means clustering (see [59] for the full details of the algorithm). The clustering algorithm then computedthe distance between the centroids and each pixel in the kymogram. The distance was calculated using the Euclidean distance as follows:  
\[\mathrm{d}=\ \parallel\mathrm{I(x,y)-c_{k}}\parallel, \tag{1}\]  
where \(\mathrm{d}\) is the Euclidean distance, \(\mathrm{I(x,y)}\) corresponds to the intensity of the kymogram, \(\mathrm{x}\) and \(\mathrm{y}\) refer to the pixel coordinates, \(\mathrm{c_{k}}\) is the cluster centroid, and \(\mathrm{k}\) is the cluster number. Each pixel in the image was assigned to the nearest centroid based on the calculated distance leading to the formation of the initial clusters. Once the grouping was done, the algorithm recomputed the updated centroid of each cluster (\(\mathrm{c_{k}}\)) as follows:  
\[\mathrm{c_{k}}=\ \frac{1}{\mathrm{k}}\sum_{\mathrm{x}\in\mathrm{c_{k}}}\sum_{ \mathrm{y}\in\mathrm{c_{k}}}\mathrm{I(x,y)}, \tag{2}\]  
where this new centroid was the data point to which the summation of the distances from all the pixels located in that cluster was minimal. This process was repeated iteratively--reshaping the clusters in the image at each iteration--until converging, when the distance between the new and original centroids did not change. Since the k-means clustering technique used the Euclidean distance measure, normalizing the features was necessary. Hence, the three extracted features were normalized between 0 and 1 before applying the clustering method. Instead of applying the clustering algorithm to the entire kymogram for a vocalization, each kymogram was divided into smaller kymograms with a maximum of 50 frames to mitigate any possible impact of the image noise on the clustering accuracy. For example, when part of the kymogram had extremely bright pixels (saturated or near-saturated pixels), the clustering technique may be misguided, particularly with a large number of frames. This might occur due to the movements of the epiglottis and large reflections from its surface. After applying the clustering algorithm to each kymogram, each pixel in the kymogram was assigned to either cluster one or two. All the pixels in the same cluster had similar labels. Accordingly, a new binary labeled image of the kymogram was constructed, where each pixel had the binary value of the cluster number. To identify the label associated with the glottal area cluster in the labeled image, a procedure was developed based on computing the first moment of inertia of the original kymogram image. The first moment of inertia, denoted by \(\mathrm{M_{1}(y,n_{i})}\) for each kymogram \(\mathrm{n_{i}}\), was calculated as follows [20; 60]:  
\[\mathrm{M_{1}(y,n_{i})}=\frac{\sum_{\mathrm{x}=1}^{\mathrm{K_{w}}}\sum_{ \mathrm{y}=1}^{\mathrm{K_{h}}}\mathrm{I(x,y,n_{i})y}}{\sum_{\mathrm{x}=1}^{ \mathrm{K_{w}}}\sum_{\mathrm{y}=1}^{\mathrm{K_{h}}}\mathrm{I(x,y,n_{i})}}, \tag{3}\]  
where \(\mathrm{K_{w}}\) is the image width (number of frames), and \(\mathrm{K_{h}}\) is the kymogram image height. The first moment of inertia was computed for the green channel, which was less noisy compared to the other channels due to the Bayer filter decomposition. The moment of inertia was applied on an inverted kymogram to approximate a horizontal line passing through the center of the glottis (center of darkness).