## 3 Improved DBSCAN Algorithm Based on Sparrow Search Algorithm
### Algorithm Pseudocode and Flowchart
However, in high-dimensional datasets, the use of Euclidean distance to calculate sample distances leads to a decline in stability. Moreover, parameter-tuned DBSCAN cannot adapt the parameters based on the clustering results of real datasets; KANN-DBSCAN exhibits anomalous convergence in the number of clusters on high-dimensional datasets; AF-DBSCAN shows poor clustering performance on synthetic datasets; and RNN-DBSCAN demonstrates strong stability with good clustering results. ### Image Segmentation

To further verify the performance of SSA-DBSCAN, five real images from the Berkeley Segmentation Dataset (BSDS300) were selected for testing. Figure 5 presents the segmentation results of each algorithm, while Table 3 shows the split metrics of these algorithms. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Dataset** & **Algorithms** & **ACC** & **AMI** & **ARI** \\ \hline \multirow{4}{*}{Iris} & SSA-DBSCAN & **0.920** & **0.837** & **0.889** \\  & RNN-DBSCAN & 0.696 & 0.582 & 0.664 \\  & KANN-DBSCAN & 0.614 & 0.401 & 0.388 \\  & AF-DBSCAN & 0.867 & 0.674 & 0.687 \\  & DBSCAN & 0.648 & 0.536 & 0.515 \\ \hline \multirow{4}{*}{Wine} & SSA-DBSCAN & 0.643 & 0.367 & 0.249 \\  & RNN-DBSCAN & **0.741** & **0.495** & 0.359 \\  & KANN-DBSCAN & 0.535 & 0.156 & 0.152 \\  & AF-DBSCAN & 0.609 & 0.301 & 0.396 \\  & DBSCAN & 0.672 & 0.344 & **0.414** \\ \hline \multirow{4}{*}{Sym} & SSA-DBSCAN & **0.929** & **0.854** & **0.913** \\  & RNN-DBSCAN & 0.736 & 0.785 & 0.742 \\  & KANN-DBSCAN & 0.808 & 0.665 & 0.682 \\  & AF-DBSCAN & 0.803 & 0.654 & 0.720 \\  & DBSCAN & 0.755 & 0.427 & 0.414 \\ \hline \multirow{4}{*}{Seeds} & SSA-DBSCAN & **0.574** & 0.426 & 0.326 \\  & RNN-DBSCAN & 0.535 & **0.512** & **0.534** \\  & KANN-DBSCAN & 0.171 & 0.253 & 0.207 \\  & AF-DBSCAN & 0.523 & 0.428 & 0.343 \\  & DBSCAN & 0.519 & 0.332 & 0.235 \\ \hline \multirow{4}{*}{Zoo} & SSA-DBSCAN & 0.819 & **0.814** & **0.706** \\  & RNN-DBSCAN & **0.842** & 0.673 & 0.595 \\  & KANN-DBSCAN & 0.610 & 0.689 & 0.614 \\  & AF-DBSCAN & 0.536 & 0.574 & 0.502 \\  & DBSCAN & 0.614 & 0.741 & 0.651 \\ \hline \multirow{4}{*}{Bank} & SSA-DBSCAN & **0.882** & **0.693** & **0.776** \\  & RNN-DBSCAN & 0.837 & 0.677 & 0.747 \\ \cline{1-1}  & KANN-DBSCAN & 0.796 & 0.581 & 0.673 \\ \cline{1-1}  & AF-DBSCAN & 0.864 & 0.681 & 0.752 \\ \cline{1-1}  & DBSCAN & 0.758 & 0.547 & 0.645 \\ \hline \multirow{4}{*}{Ecoli} & SSA-DBSCAN & **0.592** & **0.748** & **0.684** \\ \cline{1-1}  & RNN-DBSCAN & 0.418 & 0.627 & 0.599 \\ \cline{1-1}  & KANN-DBSCAN & 0.399 & 0.619 & 0.652 \\ \cline{1-1}  & AF-DBSCAN & 0.542 & 0.520 & 0.587 \\ \cline{1-1}  & DBSCAN & 0.426 & 0.565 & 0.515 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Comparison of the ACC, AMI, and ARI values across different algorithms (using DBSCAN algorithm as a baseline). To reduce computational volume, we applied the simple linear iterative clustering algorithm to segment images into a collection of super-pixels information prior to their integration into various algorithms. As we can see from Figure 5 and Table 3, the \(k\)-means and DPC algorithms perform poorly in image segmentation compared to other algorithms. Both the DBSCAN and SSA-DBSCAN algorithms are able to segment the image effectively and accurately capture its overall contours. In the second image, the PRI value of the DPC algorithm reaches its maximum value, which is very close to that of the SSA-DBSCAN algorithm. However, SSA-DBSCAN shows a significantly higher BDE value compared to the DPC algorithm. Figure 5: Image segmentation results of different algorithms.