## 3 Use Case: (Com)2 INet for Levee Piping Hazard Inspection via Remote Sensing
Since FCM requires global consistency, it cannot be split and can only be executed as a whole function on a separate computing device. The main pseudo-code is shown as Algorithm 3. ```
0: Dataset \(D=\{x_{1},x_{2},\ldots,x_{m}\}\); Number of clusters \(k\). Process:
1. Randomly select \(k\) samples from \(D\) as the initial centroids \(\{\mu_{1},\mu_{2},\ldots,\mu_{k}\}\). 2. Repeat: 3. Initialize \(C_{i}=\emptyset\) for \(1\leq i\leq k\). 4. For \(j=1,2,\ldots,m\):
3. Compute the distance between sample \(x_{j}\) and each centroid \(\mu_{i}(1\leq i\leq k):d_{ji}=||x_{j}-\mu_{i}||_{2}\). 4. Assign \(x_{j}\) to the cluster with the nearest centroid: \(\lambda_{j}=argmin_{i\in\{1,2,\ldots,k\}}d_{ji}\). 5. Update the cluster: \(U_{\lambda_{j}}=U_{\lambda_{j}}\cup\{x_{j}\}\). 6. Find For
7. For\(i=1,2,\ldots,k\):
8. Compute the new centroid for each cluster:\(\mu^{{}^{\prime}}_{i}=\frac{1}{U_{i}}\sum_{x\in U_{i}}x\). 9. Update the centroid:\(\mu_{i}=\mu^{{}^{\prime}}_{i}\). Else:
10. Keep the current centroid unchanged. 11. End For
12. Until centroids remain unchanged or maximum iterations are reached. Output: Cluster assignments \(U=\{u_{1},u_{2},\ldots,u_{k}\}\). ```  
**Algorithm 2** KM-based levee piping hazard inspection. ```
0: Dataset \(D=\{x_{1},x_{2},\ldots,x_{m}\}\); Number of clusters \(k\); Fuzziness parameter \(m>1\); convergence threshold \(\epsilon>0\); Maximum iterations \(T\). Process:
1. Initialization:
2. Randomly initialize the membership matrix \(H=[h_{ij}]\), where \(h_{ij}\in[0,1]\) and \(\sum_{i=1}^{k}h_{ij}=1\) for all \(j\). 3. Repeat: 3. Update Cluster Centers:
4. Compute the cluster center \(c_{i}\) for \(i=1,2,\ldots,k:c_{i}=\frac{\sum_{j=1}^{m}h_{ij}x_{j}}{\sum_{j=1}^{m}h_{ij}}\). 5. iv.Update Membership Degrees:
6. For each data point \(x_{j}\) and cluster \(i\), update the membership degree \(h_{ij}\):
7. \(h_{ij}=\frac{1}{\sum_{j=1}^{k}\frac{(||x_{j}-c_{i}||)}{(||x_{j}-c_{i}||)}\frac {2}{m-1}}\). 8. v.Check Convergence:
9. Compute the change in membership matrix \(\delta H\). If \(\triangle H<\epsilon\) or the maximum number of iterations reached, stop the iteration. 10. End Repeat:
11. Assign each data point \(x_{j}\) to the cluster with the highest membership degree. Output: Cluster centers \(U=\{u_{1},u_{2},\ldots,u_{k}\}\); Membership matrix \(H=[h_{ij}]\). ```  
**Algorithm 3** FCM-based levee piping hazard inspection. (3) _Gaussian mixture model_ (GMM) is a probabilistic model widely used for clustering tasks. It assumes that data points are generated from a mixture of several Gaussian distributions with unknown parameters. Each Gaussian component represents a cluster, and the GMM algorithm aims to model the entire dataset as a weighted sum of these Gaussian distributions. GMM is particularly effective for datasets with overlapping clusters and can model more complex cluster shapes compared to simpler algorithms like k-Means. Unlike hard clustering methods, such as k-Means, which assign each data point to a single cluster, GMM performs soft clustering by assigning each data point a probability of belonging to each cluster. This probabilistic approach makes GMM more flexible in capturing underlying structure of the data. For the soft clustering process of GMM, the posterior probability calculation and parameter update must be based on global data to ensure model convergence and accuracy. Therefore, the GMM model cannot be split and can only be executed as a whole function on a separate computing device. The main pseudo-code is shown as Algorithm 4. ```
0: Dataset \(D=\{x_{1},x_{2},\ldots,x_{m}\}\); Number of clusters \(k\); convergence threshold \(\epsilon>0\). Process:
1. Initialization:
2. Randomly initialize the parameters of the Gaussian components. Means \(\chi_{i}(i=1,\ldots,k)\). Covariance matrices \(\sum_{i}(i=1,\ldots,k)\). Mixing coefficients \(\pi\) such that \(\sum_{i=1}^{k}\pi=1\). 3. Expectation-Maximization (EM) Algorithm:
4. Repeat:
5. E-step (Expectation):
6.