## 2 Methods
### \"K-Means + Gaussian Mixture Model\" Clustering  
In PAI, the sound speed field is one of the important parameters that directly affect the accuracy and quality of imaging. It is necessary to accurately estimate the inhomogeneous sound speed field of biological tissues. Since identical tissues in biological tissues have similar properties, data clustering can be carried out according to the similarity between the photoacoustic pressure data to extract the regional location information about various tissues. The application of clustering regards the same tissue region of homogeneous sound speed as a whole. This reduces the number of sound speeds to be estimated in the inhomogeneous sound speed field and provides convenience for the further accurate estimation of sound speed distribution. The internal structure of biological tissue is reflected through the photoacoustic pressure value of each pixel in a photoacoustic image. The photoacoustic pressure data are matrix data of \(m\times n\). The sequence form is expressed as \(P\ =\{p_{1},\ p_{2},\cdots,p_{N}\}\), \(N\ =m\ \times n\). The proposed method combining K-means and GMM is used to cluster the data. Compared with K-means or GMM, this hybrid clustering displays a significant improvement in clustering performance [20]. It can obtain more accurate regional location information. K-means is one of the most common clustering analysis algorithms, and its convergence speed is fast. The application of K-means to pre-process photoacoustic pressure data can provide relatively accurate initial parameters for GMM and improve computational efficiency. K-means belongs to hard clustering. It takes distance as the similarity index and calculates the distance between each data and the center of each cluster. Each datum is divided into the closest cluster. K-means needs to pre-specify the number of clusters, \(K\), namely, the number of categories of the tissue. The elbow method is usually used to select the appropriate \(K\) value by comparing the sum of squared errors (SSE) of the clustering results corresponding to different clustering values. Four groups of randomly generated data in Figure 2a are taken as examples to explain the method as follows:  
\[SSE=\sum_{k=1}^{K}\sum_{i=1}^{M}\bigl{|}p_{i,k}-\mu_{k}\bigr{|}^{2}. \tag{8}\]where \(K\) is the number of clusters, \(M\) represents the number of data contained in the kth cluster, \(p_{i,k}\) represents the \(i\)th data point in the kth cluster and \(\mu_{k}\) is the mean of all data in the \(k\)th cluster. The SSE value is used to evaluate the clustering result, which gradually decreases with the increase in clustering degree. As shown in Figure 2b, the SSE will decrease sharply when \(K\) reaches the most suitable clustering value and then plateau with increasing \(K\) values. The fitting map of SSE and \(K\) is the shape of an elbow, and the corresponding \(K\) value of the elbow is the best cluster number of the sample data. In addition, the elbow method can also provide the initial center point of each cluster for K-means to improve the accuracy of the clustering result. The photoacoustic pressure data are trained several times by the elbow method. The most suitable clustering value \(K\) and the corresponding initial center are selected. They are brought into the K-means to obtain preliminary clustering results. Because K-means can only fit the data by spherical clusters, for biological tissues with complex distribution, the clustering result obtained by this algorithm can only roughly describe the regional distribution of various tissues. To obtain a more accurate tissue distribution, the GMM is selected to further iteratively optimize the rough clustering result. The GMM belongs to soft clustering. It makes clustering by calculating the posterior probability that the data belong to each Gaussian distribution [21]. Compared with hard clustering, this algorithm can divide the category of tissue boundary region more flexibly.