With the development of microelectronic manufacturing technology, semiconductor manufacturing presents the trend of maximization of scale and miniaturization of process size. Even if the wafer production now has a high automation of the production process, high-precision production equipment and advanced production technology, wafer abnormal situation is still inevitable. Abnormal conditions in semiconductor manufacturing process will reduce the yield of wafer products and increase production costs. The later analysis becomes the necessary means to improve the wafer yield. With the rapid development of modern computing power, the application of machine learning-based automatic detection method in semiconductor production is irresistible. In addition to its spatial pattern, there are many noises that can affect the classification of defects, so it is necessary to preprocess the wafer diagram. The traditional density based spatial clustering of application with noise (DBSCAN) algorithm needs to determine two clustering parameters artificially, and the choice of parameters can affect the clustering effect easily, the parameter list was obtained by K-mean nearest neighbor algorithm and mathematical expectation method, and the integrated parameters of intra-cluster density and inter-cluster density after DBSCAN clustering were selected as evaluation indexes to select the optimal parameters. Finally, a self-adaptive (SA)-DBSCAN map is obtained by retaining the largest cluster, adding feature points and feature clusters, thus improving the yield of wafer.