# Color Classification of Wooden Boards Based on Machine Vision and the Clustering Algorithm +
## 6 Experiments
### Effect of Abnormal Wooden Boards' Processing  
In this section, we evaluate the performance of the color classification mechanism with abnormal wooden boards' processing. The number of bins \(N_{b}\) is set as 16, and the number of cluster is fixed at \(k=40\).  
The clustering result with \(N_{b}=16\) and \(k=40\) is firstly used to complete centroids' improvement and to find a distance threshold used for image filtering. For each cluster, we calculate the confidence intervals at a 95% confidence level for the values in each dimension of the feature vectors. For each dimension, the values that are not in the intervals would be removed. The mean of the remaining values in each dimension is calculated to derive the improved centroid. After getting the new centroids, we calculate the distances between feature vectors and their centroids according to the clustering result. Then, the confidence interval at a 95% confidence level for these distances is calculated, which is \([-0.0012,0.0062]\). The upper bound 0.0062 is considered as the distance threshold.  
Then, we use the improved centroids to classify 1000 images of wooden boards. Compared with the basic mechanism, there are 32 wood images transferred to other clusters. The mean squared distance, the global mean silhouette score, and the Calinski-Harabasz score are calculated for comparison. As reported in Table 5, the mean squared distance, the global mean silhouette score, and the Calinski-Harabasz score are 0.002557, 0.1265, and 84.43, respectively, in the basic mechanism. With the improved centroids used for classification, they are 0.002556, 0.1273, and 84.67. The mean squared distance decreases, and the global mean silhouette score and the Calinski-Harabasz score become greater. This verifies the effectiveness of the centroid improvement.  
Then, we study the effect of the improved centroids and image filtering on the classification accuracy. Using the improved centroids and the distance threshold 0.0062 in the classification, there are 54 wood images filtered out from 1000 images. Five volunteers are asked to process 1000 images, which have been classified by the improved centroids. The classification accuracies with different classification methods are given in Table 6.  
With the basic mechanism for color classification, the average classification accuracy is 94.3%. For comparison, the average classification accuracy with improved centroids is 96.0%. When 54 abnormal wood images are filtered by the image filtering algorithm, the classification accuracy  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Volunteer\(N_{b}\)** & **8** & **16** & **32** \\ \hline A & 85.0\% & 86.3\% & 89.5\% \\ B & 84.7\% & 92.7\% & 81.7\% \\ C & 80.7\% & 91.2\% & 81.4\% \\ D & 96.6\% & 93.2\% & 96.3\% \\ E & 95.6\% & 95.4\% & 94.8\% \\ Average & 88.5\% & 91.8\% & 88.7\% \\ \hline \hline \end{tabular}
\end{table}
Table 4: Classification accuracies with different numbers of bins.  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Metric** & **Basic Mechanism** & **Improved Centroids** \\ \hline Mean squared distance & 0.002557 & 0.002556 \\ Global mean silhouette score & 0.1265 & 0.1273 \\ Calinski–Harabasz score & 84.43 & 84.67 \\ \hline \hline \end{tabular}
\end{table}
Table 5: Comparison of the classification results with different classification mechanisms.  
reaches up to 96.9% on average. These results prove the effectiveness of centroid improvement and image filtering.  
Finally, we study the number of images that are filtered by volunteers and the image filtering algorithm simultaneously. The results are given in Figure 10. It is clear to see that the number of images increases with the reduction of the distance threshold. This result proves the effectiveness of the image filtering algorithm. Nevertheless, some images with short distances to their centroids are filtered by volunteers. We will study this problem in future works.