## 3 Proposed Approach
### Segmentation
#### 3.1.5 Hybrid K-Means and PSO (KMPSO) Model  
The combination of the K-means and PSO (KMPSO) models executes the K-means algorithm to seed the initial swarm until a termination condition is reached, and the input vectors are grouped into four clusters [71]. The cluster centroids produced by the K-means algorithm are then used as one of the particles of a swarm, and the rest of the particles are initialised randomly. The PSO algorithm is then utilised to optimise the cluster centroids. This algorithm repeats for a defined number of iterations. The optimal clustering centres \(v_{o}\) can be obtained by the last swarm. To assign the class label, the distances between all pixels \(x\) and \(v_{o}\) are calculated. Figure 4 illustrates the details of the training phase of the KMPSO model.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Parameters** & **Description** \\ \hline Particle & Candidate solution to a problem \\ Velocity & Rate of position change \\ Fitness & The best solution achieved \\ \(p_{best}\) & Best value obtained in previous particle \\ \(g_{best}\) & Best value obtained so far by any particle in the population \\ \hline \hline \end{tabular}
\end{table}
Table 2: PSO parameters.  
Since clustering algorithms will not return the same cluster index value every time, the colour of each cluster should be determined. With respect to the colour of each cluster, its matching plaque components can be determined as NC: red, DC: white, FI: dark green, and FF: light green [45].  
The result of the clustering algorithms will be strongly affected by the presence of outliers that do not belong to any of the clusters [28]. The purpose of outlier detection is to find small groups of pixels that are not similar to the rest of the pixels belonging to the same cluster [72]. Figure 5 illustrates the outliers with dark green, light green, etc., in an NC image. The zoomed area (b) is indicated by the blue box in the original image (a).  
Figure 4: Pseudo-code of the KMPSO model.  
Figure 5: Outliers in an NC image: (**a**) original image, and (**b**) zoomed area.  
To provide more reliable results, outliers should be removed from the generated clusters. NC and DC images play an important role in TCFA detection; therefore, their outliers are removed for modifying the training set. First, the Euclidian distance between pixels belonging to the NC and its centre are calculated. Then, for each pixel in the NC image, if its distance is greater than the defined threshold value (\(T_{NC}\)), then this pixel is an outlier, and its intensity should be replaced with zero. Based on the sub experiments, the value of \(T_{NC}\) is changed, and intra-cluster distance (the distance between pixels and the centroid within a cluster) for the NC image are calculated. The value of \(T_{NC}\) = 200 gave the best result for the minimum distance between pixels of the NC and its centre. In addition, outliers of DC image are removed in the similar way [45].  
Class label of each colour feature should be determined to perform the pixel wise classification [73]. The non-zero pixels in DC, NC, FF, and FI images were saved into \(CF\) matrix. Their corresponding labels were calculated and saved into the vector \(L\)[45].