## 1 The first stage of the study involves preprocessing the data
This ensemble approach reduces the impact of the individual errors of each method and provides a more stable and accurate partitioning of the data (7). \[y_{i}^{\text{ens}}=\text{mode}\Big{(}y_{i}^{\text{kmeans}},\,y_{i}^{\text{agglo}},\,y_{i}^{\text{dbscan}}\Big{)} \tag{7}\]  
where \(y_{i}^{\text{kmeans}}\)--label assigned to an object \(i\) algorithm K-Means, \(y_{i}^{\text{agglo}}\)--label assigned to an object \(i\) agglomerative clustering, \(y_{i}^{\text{dbscan}}\)--label assigned to an object \(i\) algorithm DBSCAN, and \(y_{i}^{\text{ens}}\)--final ensemble label for the object \(i\), \(Y_{\text{ens}}\in R_{u}\). **7. After ensemble clustering, some objects may receive the label \"noise\" (-1), so only objects with valid labels are selected for further training. ** The input of the multi-task model will be the extended features \(x^{\text{enh}}\) (for the selected objects), as well as two target variables: (1) the class \(y^{\text{ens}}\) for classification, and (2) the salinity pseudo-label \(y_{\text{salinity}}\) (in our case, the probability returned by XGBoost for class 1, or other available salinity estimates) (8). \[\left\{\left(x_{i}^{\text{enh}},\,y_{i}^{\text{ens}},\,y_{i}^{salinity}\right) \right\}\,\chi_{\text{UB}}\,y_{i}^{\text{ens}}\
eq-1 \tag{8}\]  
where \(x^{\text{enh}}\)--are extended features, \(y^{\text{ens}}\)--are ensemble labels, and \(y^{\text{salinity}}\)--are pseudo-labels (or accurate labels) of salinity. The choice of K-Means, Agglomerative Clustering, and DBSCAN, followed by supervised methods (XGBoost and multi-task neural network), is motivated by the need to segment soil types under uncertainty robustly and the absence of ground-truth labels. K-Means provides an initial coarse clustering based on centroid distances, ensuring fast and stable pseudo-labeling. However, its spherical bias limits accuracy in irregular-shaped distributions. Therefore, Agglomerative Clustering is added to refine cluster boundaries in such complex regions. DBSCAN complements the pipeline by detecting and excluding outliers and noise points (e.g., scattered \"salt spots\"), forming a denser and more reliable cluster core. Ensemble voting across the three clustering methods reduces the influence of each algorithm's individual bias and stabilizes label assignment. These pseudo-labels are then used to train an XGBoost model, which converts hard labels into probabilistic soft outputs, uncovering nonlinear feature interactions. The extended feature space, enriched with these probabilities, is passed to a multi-task neural network trained to classify soil types and regress salinity levels simultaneously. The final stage is multi-task learning, combining classification and regression. A neural network is used that simultaneously solves two problems: classification by ensemble labels \(y^{\text{ens}}\)nd regression by the pseudo-label of \(y_{\text{salinity}}\). The model contains a standard input layer, several hidden layers (9), and then two \"heads\"--the output for classification (10) and the output for regression (11). The loss functions (12) for both problems are jointly considered during training. Figure 2:0  
where \(x^{\text{enh}}\)--is the extended feature vector for one object, \(W_{1},b_{1}\)--is the weight matrix and bias vector of the first hidden layer, and \(h\)--is the activation of the hidden layer (new feature representation). Figure 2:1  
where \(h\) is the hidden layer output, \(W_{2},b_{2}\)--are the parameters of the classification layer, \(\sigma(z)=\frac{1}{1+e^{-z}}\), and \(\hat{y}_{\text{class}}\in[0,\,1]\)--is the probability of belonging to class 1. Figure 2:2where \(h\)--is the output of the hidden layer, \(W_{3},b_{3}\)--are the parameters of the regression layer, \(\sigma(z)\)--is used here as a limiter that brings the prediction to the range [0, 1], and \(\hat{y}_{salinity}\in[0,\;1]\)--is the predicted salinity value.