# Deep Point Cloud Facet Segmentation and Applications in Downsampling and Crop Organ Extraction
## 2 Materials and Methods
### Back-End Clustering Module  
The back-end clustering module converts \(\mathbf{F}_{out}\) into \(\mathbf{K}\) facet labels. During training, a Differentiable SLIC is used. Let the initial seed centers be \(\left\{s_{j}\in\mathbb{R}^{F}|j=1,\ldots,K\right\}\). In each iteration, for seed \(s_{j}\), distances are computed to its \(m\) nearest-neighbor feature indices \(N_{j}\subset\left\{1,\ldots,N\right\}\):  
\[d_{ij}=\left\|\mathbf{F}_{out}[i]-s_{j}\right\|_{2},i\in N_{j} \tag{6}\]  
These distances are then mapped to the preliminary association weights:  
\[\widetilde{a}_{ij}=\begin{cases}\exp(-d_{ij}^{2}/\sigma^{2}),i\in N_{j}\\ 0,\text{otherwise}\end{cases} \tag{7}\]  
where, \(\sigma\) is a smoothing hyperparameter. First, normalize \(\widetilde{a}_{ij}\) column-wise:  
\[\widetilde{a}_{ij}^{(c)}=\frac{\widetilde{a}_{ij}}{\sum_{j=1}^{N}\widetilde{ a}_{ij}} \tag{8}\]  
and then normalize row-wise as follows:  
\[a_{ij}=\frac{\widetilde{a}_{ij}^{(c)}}{\sum_{j=1}^{K}\widetilde{a}_{ij}^{(c)}} \tag{9}\]  
These normalization steps ensure that each column (corresponding to one facet) sums to 1 and each row (corresponding to one point) sums to 1, enforcing consistency between points and facets. Given the soft-association matrix \(A=[a_{ij}]\) and the high-dimensional features \(\mathbf{F}_{out}\), seed centers are updated by a weighted average:  
\[s_{j}=\frac{\sum_{i=1}^{N}a_{ij}\mathbf{F}_{out}[i]}{\sum_{i=1}^{N}a_{ij}},j=1,\ldots,K \tag{10}\]  
This operation is differentiable, and the gradients are back-propagated through the loss function to the front end. After multiple iterations converge, a stable soft-association matrix \(A\) is obtained.  
Because differentiable SLIC may still produce empty facets (i.e., some seeds attract no real points) during training, the corresponding constraints are added to the loss function. During testing, SPSLIC refines Differentiable SLIC to ensure each facet contains at least one real point and that the count remains \(K\). SPSLIC operates as follows:  
1. Soft Association Computation: For each point, \(\mathbf{F}_{out}[i]\) select the \(p\) nearest seed centers among the \(K\) centers, yielding \(P_{i}\subset\left\{1,\ldots,K\right\}\). Compute distances \(d_{ij}\) via (6) and preliminary weights \(\widetilde{a}_{ij}\) via (7) for \(j\subset P_{i}\). Then perform column normalization (8) and row normalization (9) over those \(p\) seeds to obtain final associations \(a_{ij}\). This guarantees that every point is clustered and assigned to at least one facet.  
2. Seed-Point Update Compute the geometric centroid \(a_{ij}\) of facet \(j\) as: \[c_{j}=\frac{\sum_{i=1}^{N}a_{ij}\mathbf{F}_{out}[i]}{\sum_{i=1}^{N}a_{ij}},j=1, \ldots,K\] (11) Then search the original points \(\{\mathbf{X}[i]\}\) for the real point \(\mathbf{X}[k_{j}]\) closest to \(c_{j}\): \[k_{j}=\arg\min_{1\leq i\leq N}\left\|\mathbf{X}[i]-c_{j}\right\|_{2}\] (12)  
Use \(\mathbf{X}[k_{j}]\) as the next-iteration seed \(s_{j}\). If a real point has already been chosen by another facet, pick the next-nearest point, and so on, until all \(K\) facets obtain a unique real point as a seed. Through this strategy, SPSLIC outputs \(K\) facet labels--each containing at least one real point--within a finite number of iterations, thereby avoiding empty facets and matching the training-stage count.