## 3 Improved DBSCAN Algorithm Based on Sparrow Search Algorithm
### Algorithm Pseudocode and Flowchart
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multirow{2}{*}{**Image**} & \multicolumn{2}{c}{**Clustering Algorithms**} & \multirow{2}{*}{**BDE**} & \multirow{2}{*}{**PRI**} & \multicolumn{2}{c}{**Running**} & \multicolumn{1}{c}{**Memory**} \\  & & & & & **Time (s)** & **Size (MB)** \\ \hline \multirow{4}{*}{Image one} & SSA-DBSCAN & 4.9377 & 0.8827 & 50.93 & 158.49 \\  & DBSCAN & 5.0937 & 0.8875 & 7.59 & 34.81 \\  & \(k\)-means & 15.7662 & 0.6063 & 1.41 & 16.47 \\  & DPC & 15.4732 & 0.6402 & 36.18 & 132.14 \\ \hline \multirow{4}{*}{Image two} & SSA-DBSCAN & 6.4651 & 0.8981 & 56.14 & 173.82 \\  & DBSCAN & 6.5748 & 0.8974 & 8.09 & 56.73 \\  & \(k\)-means & 11.6513 & 0.8319 & 1.48 & 17.69 \\  & DPC & 10.0235 & 0.8436 & 39.76 & 139.56 \\ \hline \multirow{4}{*}{Image three} & SSA-DBSCAN & 7.4530 & 0.8996 & 78.18 & 219.51 \\  & DBSCAN & 7.5634 & 0.8934 & 10.74 & 60.27 \\  & \(k\)-means & 11.3806 & 0.8439 & 1.65 & 21.09 \\  & DPC & 10.0519 & 0.8398 & 48.97 & 153.48 \\ \hline \multirow{4}{*}{Image four} & SSA-DBSCAN & 9.7218 & 0.8390 & 86.31 & 231.67 \\  & DBSCAN & 10.5754 & 0.8387 & 12.73 & 69.58 \\  & \(k\)-means & 17.4136 & 0.7379 & 1.69 & 22.89 \\  & DPC & 15.8168 & 0.7630 & 51.94 & 175.23 \\ \hline \multirow{4}{*}{Image five} & SSA-DBSCAN & 7.5544 & 0.8837 & 69.72 & 195.48 \\  & DBSCAN & 7.6185 & 0.8523 & 8.79 & 58.31 \\ \cline{1-1}  & \(k\)-means & 11.5680 & 0.7436 & 1.56 & 19.32 \\ \cline{1-1}  & DPC & 9.9451 & 0.7615 & 41.85 & 147.96 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Comparison of BDE, PRI, running time, and memory size indicators of each algorithm. This suggests that the SSA-DBSCAN algorithm performs better than DPC in segmenting the second image. This can be seen from the data in Table 3 where SSA-DBSCAN's BDE and PRI values surpass those of DBSCAN, indicating it outperforms in segmenting images with greater precision. Therefore, compared to the other three algorithms, the SSA-DBSCAN algorithm achieves higher segmentation accuracy and produces the best results. Although the SSA-DBSCAN algorithm provides the best segmentation accuracy, its computational cost is also the highest among the four algorithms. Due to the addition of Sparrow Optimization Algorithm, the SSA-DBSCAN algorithm requires multiple rounds of running DBSCAN, evaluating multiple parameter combinations in each round, resulting in much higher running time and memory usage than other methods. The DPC algorithm relies on a complete point-to-point distance matrix, which requires the calculation of the entire image distance matrix, resulting in high memory consumption and a long running time. The DBSCAN algorithm requires neighborhood search for each point, which involves a lot of distance calculation. The running time and memory increase significantly with the increase in data volume; the \(k\)-means algorithm, on the other hand, uses iterative updating of centroids, which results in a linear relationship between computational complexity and data volume. Therefore, it runs the fastest and occupies the least amount of memory. To sum up, the SSA-DBSCAN algorithm indicates higher accuracy in adaptive parameter search and image segmentation, offering better practicality than the other comparison algorithms. ## 5 Overview of Experimental Findings and Sensitivity Assessment

### Overview of Experimental Findings

Every object within the datasets yields a definite classification result, which facilitates assessment of cluster efficacy via ACC, AMI, and ARI values. Our proposed SSA-DBSCAN algorithm uses Sparrow Search Algorithm to find the optimal Eps and MinPts values. This approach ensures both rapid convergence and high-quality solutions, leading to strong clustering results on 2D synthetic datasets and several real-world ones. The experimental results of real images indicate that SSA-DBSCAN consistently achieves superior boundary accuracy and clustering consistency when compared with traditional clustering algorithms such as DBSCAN, \(k\)-means, and DPC.