In this study, HSV color space, color histograms and ML algorithms were used to determine the best model for color matching in dental images. The algorithms are implemented in the Python programming language.
The datasetThe tooth shade is usually matched visually using a shade guide. Vita Classical and Vitapan 3D Master are the most known shade guides in dentistry. Vitapan 3D Master is similar to the Munsell value, which represents the three dimensions of color [23]. In this study, Vita 3D Master, which has more colors, was chosen as the image source.
This in vitro study used a smartphone camera to collect images. The images were captured using the iPhone 13 Pro Max in photo mode with 3x zoom. Before capturing each image, the focus was adjusted and fixed on the corresponding tooth to ensure accurate imaging. Each color tab on the Vita was captured against a gray background in four different clinical light conditions, with 5 replicates for each environment. These four different clinical light sources are: natural light source without flash support (natural), flash light under natural light source (flash), light in dental unit without flash support (white), yellow light source in dental units without flash support (yellow). The temperature of these lights was measured to range from 2700 K to 6500 K. A tripod setup equipped with an LED lighting system was used as the light source. The distance between the tripod and the samples was generally set to 20 cm, and the images were captured in a standardized manner. The light source was specified to have a total power of 84 watts, a light output of 11,300 lumens, a CRI value of 96, and 480 LEDs.
Each image was cropped from the equatorial region where the tooth shade is most pronounced, regardless of size. A dataset of cropped images was created. Sample images of each tooth on the Vita and cropped images are shown in Fig. 2. Color histograms were used to images processing and represent the images numerically. These numerical values are the input values for the ML algorithms. The name of each image represents the color value of the images and the folder names represent the clinical light in which it was captured. These labels were included in the dataset after the images were processed.
Fig. 2Vita 3D master and cropped images
ML-based tooth shade assessment using color histogramsColor histograms show the range and frequency in which pixel values of images are observed. In this classification process, bins (64,64,64) were used, which classify the image pixels with boxes of specified size. Accuracy results were obtained for six different classifications:
4 different clinical lighting conditions.
29 colors independent of light sources.
In white light, 29 colors.
In natural light, 29 colors.
In yellow light, 29 colors.
In flash light, 29 colors.
In this approach, HSV color space is used. Cross-validation was performed for classification and a k value was chosen as 5. The training/test split was 70/30. The data was normalised. ML algorithms were used.
Support Vector Machine (Linear SVM) is an algorithm used to classify data in a linear fashion, determining class boundaries with maximum distance. Support Vector Regression (Linear SVR) is a regression algorithm used to find the optimal linear relationship between the target variable and independent variables in linear relationships. NonLinear SVM classifies non-linear data using kernel methods and can learn more complex boundaries. NonLinear Support Vector Classifier (NonLinear SVC) is the classification version of NonLinear SVM and uses kernel functions to classify non-linear data. K-Nearest Neighbor (KNN) classifies data by looking at the nearest neighbors of each data point to predict the class. Random Forest (RF) is a powerful ensemble learning algorithm where multiple decision trees are combined to make a collective prediction. The general framework of this study is shown in Fig. 3.
Fig. 3The general framework of this study
Performance metricsIn this study, we used several performance metrics for evaluate the model. True Positive (TP) refers to correctly classified positive observations, True Negative (TN) refers to correctly classified negative observations. False positive (FP) refers to false classified positive observations and false negative (FN) refers to false classified negative observations. Accuracy is the ratio of correctly classified predictions to all predictions [24] and its formula is given in Eq. 1. Recall, precision, F1-score values are calculated for each class. Since 29 classes were used for color detection in this study, the results of these performance values reduce the readability in the tables. For this reason, the performance analysis of this study was conducted using the accuracy metric.
Other performance metrics used in classification problems are confusion matrix. Confusion matrices are obtained by comparing the predicted value in the test data with the actual value. Correct predictions are collected on the diagonal of the matrix. The size of the matrix is a square matrix with row and column size equal to the number of classes [25]. In cases where data is limited, test data may not include every class. In this case, as many matrices are formed as there are classes in the test data. Therefore, it is important that the dataset contains enough examples for each class.
留言 (0)