Automatic Segmentation of Periapical Radiograph Using Color Histogram and Machine Learning for Osteoporosis Detection

Osteoporosis leads to the loss of cortical thickness, a decrease in bone mineral density (BMD), deterioration in the size of trabeculae, and an increased risk of fractures. Changes in trabecular bone due to osteoporosis can be observed on periapical radiographs, which are widely used in dental practice. This study proposes an automatic trabecular bone segmentation method for detecting osteoporosis using a color histogram and machine learning (ML), based on 120 regions of interest (ROI) on periapical radiographs, and divided into 60 training and 42 testing datasets. The diagnosis of osteoporosis is based on BMD as evaluated by dual X-ray absorptiometry. The proposed method comprises five stages: the obtaining of ROI images, conversion to grayscale, color histogram segmentation, extraction of pixel distribution, and performance evaluation of the ML classifier. For trabecular bone segmentation, we compare K-means and Fuzzy C-means. The distribution of pixels obtained from the K-means and Fuzzy C-means segmentation was used to detect osteoporosis using three ML methods: decision tree, naive Bayes, and multilayer perceptron. The testing dataset was used to obtain the results in this study. Based on the performance evaluation of the K-means and Fuzzy C-means segmentation methods combined with 3 ML, the osteoporosis detection method with the best diagnostic performance was K-means segmentation combined with a multilayer perceptron classifier, with accuracy, specificity, and sensitivity of 90.48%, 90.90%, and 90.00%, respectively. The high accuracy of this study indicates that the proposed method provides a significant contribution to the detection of osteoporosis in the field of medical and dental image analysis.


Introduction
Nowadays, the use of dental radiographs is no longer limited to assessing dental problems. Another thriving application that utilizes dental radiographic images is osteoporosis detection [1,2]. Osteoporosis is a metabolic bone disorder characterized by the loss of cortical thickness and the reduced number and size of trabeculae [3,4]. Risk factors that can cause osteoporosis include age, gender, and life activities. Osteoporotic fractures have been the most signifcant complication of osteoporosis [5] that subsequently increases medical costs, mortality, and morbidity, especially among the elderly population. It is also known that osteoporosis has a direct efect on the progression of periodontal tissue destruction [6], tooth loss, and erosion of the jaw bones [3]. Terefore, dental radiography can be recommended as a screening tool for osteoporosis [1,3,6].
Te role of the dentist is pivotal in the early detection of osteoporosis on dental radiographs. However, manual detection of osteoporosis on dental radiographs depends on the experience of the dentist and oral radiologist. Conducting training for using dental radiographs for early detection of osteoporosis will take a lot of time. Te automation of radiographic interpretation procedures could assist dentists' decision-making while also saving time and efort [7]. For these reasons, automatic detection of osteoporosis on a periapical radiograph becomes important to assist dentists, particularly in overcoming misinterpretation due to fatigue or lack of experience, as well as in conducting the detection in less time.
With the advancement of machine learning (ML) and pattern recognition methods, dental radiographs are increasingly used for osteoporosis detection. Recent methods have overcome the lack of quality of radiographic images, including low contrast, signifcant noise, and color homogeneity in the regions of interest (ROI). Several image processing methods have been investigated to detect osteoporosis using dental radiographs, including periapical [8,9] and panoramic [2] radiographs, as well as CBCT [10]. Another method, fnite element analysis combined with ML, is used to predict hip fracture in DEXA images [11].
Image segmentation is used to divide digital images into multiple sets of pixels or objects so that image representation becomes more straightforward and easier to analyze. However, in the absence of a conventional solution to image segmentation, researchers have proposed general-purpose techniques and algorithms to implement image segmentation. Tese techniques and algorithms often need to be combined with domain knowledge to efectively solve the image segmentation problem in a specifc domain [12]. Segmentation is a crucial process for medical image analysis, radiological assessment, classifcation, and computer-aided diagnostic systems [13].
Image segmentation methods can be classifed into three categories: edge-based, region-based, and pixel-based methods [14]. Clustering is a pixel-based segmentation method and is usually used for large-sized images [15]. Since it is pixel-based, clustering involves relatively simple algorithms, and its complexity is generally lower than that of region-or edge-based segmentation methods. Te performance of clustering algorithms for image segmentation is susceptible to the features of objects in the image [16]. Furthermore, clustering is suitable for biomedical image segmentation.
Several basic clustering algorithms have been used for medical image segmentation, including Fuzzy clustering for dental radiographs [17] and K-means clustering to detect breast cancer on digital mammograms [18]. Clustering is a method of unsupervised learning used to fnd structures in datasets that are not labeled. A cluster is a collection of similar objects that are diferent from objects belonging to other clusters [19]. K-means is a simple technique for data clustering. In simple terms, Kmeans is an algorithm for grouping objects based on specifc features into K groups, where K is a positive integer. Grouping analysis aims to group objects so that similar objects reside in the same cluster. Each cluster is characterized by its center point, e.g., its centroid. Grouping is carried out by minimizing the distance between each object and its corresponding centroid. Fuzzy Cmeans, on the other hand, is a soft clustering technique in which each pixel can belong to two or more clusters with varying degrees of membership. Te closer the data is to the cluster center, the greater its membership in that cluster center. Despite the fact that it only considers image intensity values and no fltering, it is highly resistant to noise and ofers better segmentation quality [20].
Tis study proposed a pixel-based clustering segmentation method on periapical radiographs using K-means and Fuzzy C-means. Color images are generated by the segmentation models and the separation of trabecular bone and porous was performed using K-means and Fuzzy C-means for grouping objects of the same color. To detect osteoporosis, three supervised ML classifers were used: decision tree, naive Bayes, and multilayer perceptron.
Te decision tree and naive Bayes have been evaluated for automated detection of carious lesions in photographic color tooth images [21]. As an osteoporosis detection model, the performance of the decision tree on panoramic radiographs is excellent [22]. In previous research, naive Bayes was investigated as a ML algorithm for evaluating canine impaction on radiographic images [23]. Naive Bayes is selected because it performs optimally on simple and small training datasets, and because our features are independent of one another. Furthermore, multilayer perceptron is a type of feedforward artifcial neural network with full connectivity that generates a set of outputs from a set of inputs. Tis ML algorithm is characterized by multiple layers of input nodes connected as a directed graph between the input and output layers [24]. Te multilayer perceptron with backpropagation has been used in a wide range of applications, including optical character recognition and medical image analysis. Since periapical radiographs are a useful tool for predicting osteoporosis [9], we are interested in exploring these ML algorithms (decision tree, naive Bayes, and multilayer perceptron) as a classifer in this study. We hypothesize that the proposed method of color histogram of pixel-based clustering segmentation combined with an ML classifer can improve the diagnostic performance of osteoporosis on digital periapical radiographs.

Materials.
Te study used 102 digital periapical radiographs from the anterior and posterior regions of the mandible, collected from postmenopausal Javanese women (aged 58-81 years). Te samples were obtained retrospectively from the dental hospital at Universitas Gadjah Mada. Ethical approval was achieved from the local ethics committee (Ref. No. 00681/KKEP/FKG-UGM/EC/2016). Data of patients were kept anonymous.
Te periapical radiographs were taken using an X-ray dental machine Villa System Medical Endos ACP CEI, with an exposure specifcation of 70 kVp, 8 mA, and the exposure time was varying from 0.02 seconds to a maximum of 3.20 seconds. Vista Scan photostimulable phosphor (PSP) plates were used as image receptors. Te periapical images were processed using indirect digital radiography (DBSWin 4.5). All periapical radiographs involved in this study have passed the radiographic quality assurance standards assessed by a dentist based on the quality rating criteria for digital images [25]. In this study, only radiographs that meet the minimum diagnostically acceptable criteria have been taken as samples. Initial images obtained from the digital radiographic system were 1645 pixels in height and 1252 pixels in width with indexed color type and saved as BMP format.
Te diagnosis of osteoporosis was obtained from the medical record. Te osteoporosis diagnosis was assessed using the T-score value obtained from the DEXA scan using the Lunar Prodigy Primo DEXA densitometer, specifcation 76 kV, 1.5 mA, with exposure 14 seconds (femoral) and 1 minute 27 seconds (spine). Te results of the DEXA scan were interpreted by a radiologist based on the defnition of osteoporosis by the World Health Organization T score, which divides the status into three categories, i.e., normal (T ≥ −1.0), osteopenia (−2.5 < T < −1.0) and osteoporosis (T ≤ −2.5). According to prior studies [22], the normal and osteopenia were categorized in nonosteoporosis data in this study. Te data used in this study consist of 52 nonosteoporosis (30 images for training and 22 images for testing) and 50 osteoporosis subjects (30 images for training and 20 images for testing).

Methods.
Tis work proposed a method for automatic segmentation of the trabecular bone area in periapical radiographs for osteoporosis detection. Te proposed method consists of fve main stages, i.e., obtaining ROI images, conversion to grayscale, color histogram segmentation, extraction of pixel distribution, and evaluation of the ML classifer's performance. Tese steps are shown in Figure 1, and the details of each stage are explained in the following.

Obtaining ROI Images.
Te initial stage of the study involves the acquisition of ROI images from periapical radiographs. In this work, ROI is obtained by our software that has been developed using MATLAB, as described in a prior study [26]. Te process of determining ROI begins with selecting a starting point in the trabecular area visible on periapical radiographs, which is taken a minimum 2 mm from the apical of the teeth and determined by avoiding tooth roots, periapical or intraosseous lesions, or variations that afect normal trabecular conditions. A square ROI can be formed from this point, measuring 300 pixels in height and 400 pixels in width ( Figure 2). Te ROI selection was made under the supervision of a dentist.

Converting to Grayscale.
In medical image analysis, it is common to convert the images to grayscale. ROI images were then transformed into grayscale so that each pixel in the image has a value in the range of 0-255. Grayscale images are then used as inputs for segmentation analysis.

Segmentation. ROI consists of trabecular (cancellous)
bone and pores. Te cancellous bone consists of a structural mesh of trabeculae form. Porous is the presence of small holes in the trabecular bone. By combining the color histogram and K-means algorithm for segmentation, the same color is assigned to pixels with the same centroid to obtain segmented images at the end of the segmentation stage [20].
We also compared the results of K-means with those using the Fuzzy C-means segmentation method. Fuzzy Cmeans is an unsupervised extension of K-means, applied to various problems related to the analysis of features and the design of the classifer. In this study, the Fuzzy C-means segmentation method refers to the modifed Fuzzy C-means method developed in the previous study [27].

Extracting Pixel Distribution.
At this stage, the features are derived from the segmented images by calculating the distribution of the same-colored pixels. For each color, the number of pixels is counted and represented in a histogram. Te histogram is a summary bar graph showing the frequency of data points falling in various ranges. All features are stored in a DAT format fle.  To obtain the optimal results, we conducted three ML methods: decision tree (J48 algorithm), naive Bayes, and multilayer perceptron. Te parameters of the multilayer perceptron applied in this study were the number of hidden layers is 2, the activation function is sigmoid, the learning rate is 0.3, and the momentum is 0.2.

Assessing
Te performance of the proposed method in this study was assessed based on accuracy, specifcity, and sensitivity. Evaluation of the classifer's performance was conducted in two stages, on training and testing datasets, to determine the most appropriate algorithm for predicting osteoporosis using periapical radiograph features in this study. Due to the fact that each of the two segmentations (K-means and Fuzzy C-means) is evaluated using three ML classifers, a total of six algorithms are evaluated using the training dataset. Te algorithm with the highest performance evaluation on the training dataset was then reevaluated using the testing dataset. Te fnal result of this study was determined by the performance evaluation on the testing dataset.

Results
By applying the K-means method to ROI images, this study has produced segmentation images in grayscale and color formats as well as their histograms. Te method's performance has been validated for accuracy, specifcity, and sensitivity based on the features of the number of clustering pixels in the histogram. Table 1 shows the examples of grayscale and color segmentation results using the K-means method applied to a similar ROI image. Meanwhile, Table 2 displays the results of image segmentation using Fuzzy Cmeans.
Since the grayscale segmentation images had almost similar colors, the cluster areas were still difcult to recognize. Terefore, they are converted into color segmentation images. A grayscale segmentation image corresponds precisely to a specifc color in the corresponding color segmentation image.
Tables 1 and 2 also show the histograms of the segmentation images. Te histogram's x-axis represents the number of cluster sequences formed in the segmentation with k � 8, 10, 12, and 15, while the y-axis represents the number of pixels in each cluster. We compare the results of the K-means segmentation algorithm (Table 1) with Fuzzy C-means segmentation ( Table 2).
Te grayscale images segmented by Fuzzy C-means in Table 2 have less contrast than the K-means segmented images in Table 1. Terefore, the color segmentation images produced by K-means (Table 1) also difer from those produced by Fuzzy C-means (Table 2). To determine whether the diferences in Kmeans segmentation (Table 1) and Fuzzy C-means segmentation ( Table 2) infuence osteoporosis detection, the performance of the training using the two segmentation methods is then evaluated, with a summary of testing results presented in Table 3.
Te performance of the training was evaluated by comparing the actual osteoporosis diagnosis results from the DEXA examination and the predicted results using the Kmeans and Fuzzy C-means segmentation methods, with the pixel distribution in each cluster serving as the feature. For K � 8, 10, 12, and 15, the sizes of the features produced were 102 × 8, 102 × 10, 102 × 12, and 102 × 15, respectively. Tese features are then tested using three classifers: decision tree, naive Bayes, and multilayer perceptron.
Using a confusion matrix, the performance of classifers in the training process is assessed based on three characteristics: accuracy, specifcity, and sensitivity. Accuracy, specifcity, and sensitivity are presented in percentages. Terefore, if the segmentation results of the proposed method is perfect; its accuracy must be close to 100%. Te performance of training using the K-means classifcation in comparison to Fuzzy C-means classifcation is presented in Table 3.
According to Table 3, the global performance of Kmeans segmentation (81.67%) is higher compared to that of Fuzzy C-means segmentation (75.28%). Among the three ML classifer methods used to evaluate K-means and Fuzzy C-means segmentation, the multilayer perceptron produces the highest average performance, followed by the decision tree for K-means segmentation and naive Bayes for Fuzzy C-means segmentation. For Kmeans segmentation, the diagnostic performance of naive Bayes for osteoporosis was the lowest. Meanwhile, decision tree provides the lowest performance for osteoporosis detection using the Fuzzy C-means segmentation (Table 3). Based on the training performance in Table 3, Te Kmeans combined with the multilayer perceptron model successfully detects osteoporosis and nonosteoporosis conditions with the highest accuracy, specifcity, and sensitivity of 91.67%, 90.00%, and 93.33%, respectively. It was obtained from the K-means segmentation with K � 10 combined with a multilayer perceptron classifer, using only a feature in the form of the number of constituent pixels of each cluster. In addition, the algorithm proposed in this study can rapidly detect osteoporosis. It takes less than a minute to obtain the detection result, counting from taking the ROI in the periapical radiograph.
Since this study aims to propose an automatic detection of osteoporosis using periapical radiographic images, the model with the best training performance was then being tested using 42 ROI images. Te performance of testing is presented in Table 4 as a confusion matrix. Te testing results shown in Table 4 indicates that the segmentation method using the K-means (K � 10) combined with multilayer perceptron classifer is the most appropriate method for the proposed method, which achieves accuracy, specifcity, and sensitivity of 90.48%, 90.90%, and 90.00%, respectively.

Discussion
Periapical and other dental radiograph images can be noisy, blurred, and dark. Due to these issues, conventional segmentation methods for osteoporosis detection are inefective. Several studies on osteoporosis detection using image segmentation reported higher accuracy [10,28] than studies without segmentation [4,5].
Several studies have been conducted to obtain important features for detecting osteoporosis using image segmentation on dental radiographs combined with ML. Using Table 1: Te results of segmentation using K-means.  International Journal of Dentistry support vector machine (SVM) multiclass, a previous study [4] classifed data into normal bone, osteopenia, and osteoporosis. Categorization was established through an examination of alterations in the trabecular pattern of the mandible bone. Te image was enhanced using adaptive histogram equalization and the gray level co-occurrence matrix (GLCM) was used to extract features. Texture analysis was also used to detect osteoporosis on panoramic radiographs, followed by logistic regression, which served as a classifer and was quantifed using the receiver operating characteristic of the receiver [5]. A previous study also used a combination of morphology analysis, fractal dimensions, GLCM, and SVM to detect osteoporosis using periapical radiographs. On 454 panoramic radiographs, the fractal dimension was segmented using Gaussian blur, density correction, binarization, and skeletonization [22]. Otsu segmentation and canny edge detection are also known for extracting seven features: trabecular termini, trabecular separation, trabecular spacing, trabecular number, and trabecular thickness. Te classifer was implemented using the backpropagation of an artifcial neural network [10]. In several studies [10,22,29], segmentation was also performed using morphological analysis. However, objects' shapes may change, rendering the extracted features inefective.
In this work, an osteoporosis classifcation method for dental periapical radiographic images has been developed using a pixel distribution based on a segmentation approach using the K-means followed by a decision tree, naive Bayes, and multilayer perceptron classifer. Te result was obtained after we compared the K-means segmentation method's performance on periapical radiographs with other existing segmentation methods, e.g., Fuzzy C-means. Fuzzy C-means have been widely used in medical diagnosis, image analysis, shape analysis, and target recognition [27]. Our experimental results using the K-means revealed that the method is more accurate than Fuzzy C-means (Table 3) for osteoporosis detection on periapical radiograph.
Image segmentation is the process of breaking down or partitioning an image into separate homogeneous regions in order to make the image easier to analyze and identify objects. During this activity, the object and the background are separated [12]. In addition to edge-based and regionbased segmentation, the results of this study indicate that  International Journal of Dentistry pixel-based segmentation in the form of K-means and Fuzzy C-means is more suitable for the analysis of osteoporosisrelated trabecular changes on periapical radiographs. Considering that image segmentation is one of the most fundamental steps in image processing, selecting the appropriate segmentation method will undoubtedly impact the diagnostic performance of the detection model. Naive Bayes is known as the osteoporosis classifer for textural features extracted from panoramic radiographs utilizing fractal dimension (FD) and GLCM [30]. In addition to naive Bayes, decision trees, and SVM have been found to be ML classifers with superior performance when applied to detect osteoporosis using strut analysis, FD, and GLCM extracted from mandibular cortical bone on panoramic radiographs [22]. For the detection of osteoporosis using periapical radiographs, neither the naive Bayes nor decision tree methods have been extensively studied.
Despite naive Bayes' optimal performance for a simple and small training datasets, its performance in this study is inferior to that of prior studies [30]. Additionally, the diagnostic performance of the decision tree for osteoporosis detection using periapical radiographs in the study does not outperform earlier research using panoramic radiographs [22]. Te segmentation methods used in this study difer from those used in previous studies [22,30], in addition to using distinct ROI obtained from diferent radiograph types. On panoramic radiographs, osteoporosis is generally detected by observing the thickness of the mandibular cortex, whereas osteoporosis is detected on periapical radiographs by observing the changes of bone trabeculation in the mandible and maxilla.
In general, the segmentation technique is followed by classifcation, in which the separated objects are assigned to specifc classes, and this process is regarded as the fundamental part of computer vision [12]. At the end of the segmentation in this study, a histogram of the clustering was produced. Te histogram represents the feature, which is the number of pixels in a cluster. For validation, the study evaluated the segmentation performance of K-means based on three measurements: accuracy, specifcity, and sensitivity. We observed various k values (k � 1 up to 15) and reported only the accuracy for each classifer method resulting more than 60% (Table 3).
To further evaluate the proposed method's performance, we also compared the proposed method's results with other methods based on previous studies. In this study, histogram extraction was used to produce relatively simpler features than in other studies. Besides, the number of classes used in this research study is also more than in other studies. In addition, the method we proposed reached a testing accuracy of 90.48% for osteoporosis and nonosteoporosis classes. Tis performance is better than the previous studies [4,5,29,31] but slightly worse than previous works [10,22].
Based on the results of the study (Tables 3 and 4), the multilayer perceptron provides the best performance as a classifer for image features generated by the color histogram of pixel-based clustering segmentation. Tis ML classifer performs best when combined with Kmeans segmentation for predicting osteoporosis on periapical radiographs. Tese fndings support our previous studies [31] while also demonstrating that multilayer perceptron classifcation of osteoporosis on  International Journal of Dentistry 7 periapical radiographs performs better when combined with K-means segmentation than segmentation using a texture feature with a statistical approach. We presume that factors related to the number of samples and the method of feature extraction may afect the accuracy of the results. Despite the fact that this method has never been applied to periapical radiographs to detect osteoporosis, the results of this study indicate that it has a high diagnostic performance.

Conclusion
K-means outperforms Fuzzy C-means for segmenting trabecular bone observed on periapical radiographs, especially when combined with multilayer perceptron as a ML classifer for osteoporosis detection. However, this study has drawbacks due to the limited number of samples. It is challenging to obtain periapical radiographs from patients who have undergone a DEXA examination. Future work with larger samples can be conducted so that the fndings can be generalized to large populations. Te result of this study indicates that the proposed method promotes a valuable contribution to the medical image analysis for osteoporosis detection that can be further developed for dental practice application.

Data Availability
Te data supporting the fndings of the study are included in the manuscript.

Conflicts of Interest
Te authors declare that there are no conficts of interest.