1 Introduction

Detection of dental caries is important for the diagnosis and treatment planning of dental disease, which has been affecting a very large population throughout the globe [33]. Dental X-rays are a valuable imaging exam that can provide dentists with detailed evaluations of teeth and gums for diagnostic and prevention purposes [14]. Early detection of disease is one of the important matters of diagnostic imaging. In dental imaging and diagnosis applications, X-rays are recommended because it shows the size, location and condition of teeth and they are also able to detect the presence of cavities before they appear on the tooth’s surface. Visual inspection or visual-tactile inspection has very low sensitivity rate; that is, human inspection alone misses a high percentage of caries [18]. Therefore, majority of the studies focused on developing an algorithm for detection of caries and measurement of tooth damage [9]. Segmentation process is an important step in almost every medical image analysis applications.

Image segmentation methods have been improved in the past several decades but remain as complex and difficult processes due to differences in the images [17, 22, 25]. Much research has been done on dental radiograph segmentation. Anil K [7] proposed a semi-automatic contour extraction method for tooth segmentation by using integral projection and Bayes rule, in which the integral projection is applied semi-automatically for tooth isolation since an initial valley gap point is required. Jindan Zhou and Mohamed Abdel-Mottaleb [35] presented a segmentation method that consists of three steps; image enhancement, region of interest localization, and tooth segmentation by using morphological operations and Snake method. Omaima Nomir, and Mohamed Abdel-Mottaleb [16] developed a fully automated approach based on iterative thresholding and adaptive thresholding for dental X-ray image segmentation. Keshtkar and Gueaieb [8] introduced a swarm-intelligence based approach and a cellular-automata model approach for segmenting dental radiographs. Said et al. [27] offered a mathematical morphology approach to the problem of teeth segmentation, which used a series of morphology filtering operations to improve the segmentation, and then analyzed the connected components to obtain the desired region of interests (ROIs). Li et al. [11] proposed a semi-automatic lesion detection framework by using two coupled level set functions, in which the initial contour is derived from a trained support vector machine to detect areas of lesions from dental X-ray images.

Recent work on dental image segmentation by [12] has been performed based on local singularity analysis. They used connected component analysis and Otsu’s thresholding to recognize each tooth. Moreover, they utilized snake boundary tracking for tooth delineation and morphological operation. The experimental result on 28 periapical dental X-ray images which consist of 75 useful teeth shows the accuracy of true positive (TP) by 0.8959 and false positive (FP) by 0.0093. Likewise, Gao and Chae [6] focused on the segmentation of individual tooth from CT images by proposing coupled variational level set method.

Analysis of dental images has some difficulty compared to other medical images. The difficulties include artifacts used in the treatment process, impacted teeth, different variations of teeth and space of missing teeth. Due to these problems, finding an accurate and proper method in the segmentation of dental X-ray images remains a challenging process.

In this paper, a new segmentation method and detection technique has been proposed in order to improve the accuracy and reliability of caries detection system. The proposed framework comprises of three main phases; pre-processing, segmentation and analysis. The segmentation phase concludes two main stages; initial contour generation and intelligent level set segmentation. Figure 1 shows the proposed general framework of this study.

Fig. 1
figure 1

General framework

2 Intelligent level set segmentation for dental x-ray images

2.1 Level set method

The Level Set (LS) method was introduced by Osher and Sethian [19] for front propagation and has been developed over the years. The level set image segmentation has two main methods; region-based [2] and edge-based methods [1]. To extract the region of interest (ROI) in the region-based method, prior energies of an object are required, whereas in the edge-based method, in order to specify the pixels in edges, the gradient magnitude of each pixel of image is essential [28]. However, both methods may have some drawbacks. The region-based method is very sensitive to the variation of intensities in an object, whereas the lack of edges in the edge-based method also affects the results. Zhang et al. [34] proposed a method by combining the strength of both methods to remove their respective drawbacks. The segmentation boundary can be defined as a part of the surface where the contour level is 0, i.e., the zero level set. Let ϕ represents the implicit surface such that:

$$ \varphi (x,t) = \pm d $$
(1)

Where x is a position in our domain (the image), t is time, and d is the distance between position x and the zero level set. The sign in front of d is positive if x is outside the zero level set. Otherwise, the sign is negative. The Fig. 2 demonstrates image condition for level set function as inside the object boundaries are negative and outside of object boundaries are considered as positive.

$$ \varphi (x,y,0) = \left\{ {\begin{array}{*{20}{c}} { - d(x,y,\gamma )\,\;if\;(x,y)\;\;inside\;the\;front}\\ {0\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,}\\ {d(x,y,\gamma )\,\;if\;(x,y)\;\;outside\;the\;front} \end{array}} \right. $$
(2)
Fig. 2
figure 2

Level set function sign

The concept of the level set method is to enclose a curve within a surface. By using this ability of level set method, we are able to achieve our specific contour level by morphing the object surface. Then, the initial value for the level set function, ϕ(x,y,t), based on the initial contour will be computed. The value of ϕ will be adjusted over the time and the current contour is defined by ϕ(x(t),y(t)) = 0. Then, the iteration will be repeated until convergence is achieved on the boundary of the curve. The last obtained curve is the segmented area and the final level in the level set calculation. The Fig. 3 demonstrates the progress of segmentation by level set method from initial contour level.

Fig. 3
figure 3

The level set segmentation progress

However, effective level set method cannot be used directly in all types of images due to several reasons: (1) requiring vast computation, (2) complexity of parameter settings, and (3) finding the initial contours that are very sensitive where (a) the speed of the level set method depends highly on the size and position of the initial curves and the complexity of objects, and also (b) in some conditions, coupled level set functions cannot converge some placements of the initial contours. Regardless of all the advantages of the level set method, it still requires some significant parameter values that are selected prior to the process. Examples of the parameters include the initial contour location to start, signed force function and speed function for suitable propagation.

2.2 Intelligent level set segmentation

The proposed method addresses essential issues of level set method, which are the initial contour generation and furthermore improve the level set method in the aspects of accuracy and robustness for dental image segmentation by a new intelligent approach. The Fig. 4 shows the steps of the proposed intelligent level set segmentation method.

Fig. 4
figure 4

The intelligent level set

Initial contour

Zero level is used to represent the initial contour and the start point for expansion or shrinkage in level set function. As mentioned in [21], the same initial contour even in different embedded LS methods will produce the same final result. Therefore, producing the suitable zero level, the result will be more accurate on image segmentation. In implementation of traditional LS methods [1, 2, 5, 13, 21], the upwind techniques are used to provide the numerical stability. The proposed Morphological Region-Based Initial Contour (MRBIC) [24] has shown in Algorithm 1.

figure e

The Figs. 5 and 6 demonstrates the original grayscale tooth image with four divided areas and labeled regions. During the binarization process, some divided areas of image may contain zero pixels and do not belong to any region. To overcome this issue, the pixel values of each part will be verified and if the value of the area is equal to zero, then the thresholding value will be reduced by 0.1. The process will be repeated until the pixel value is greater than zero, which means that there is at least one region to select.

Fig. 5
figure 5

The region selection. a The original gray scale dental x-ray image, b Four divided areas and labeled regions, (c) Enlarged area A3 which shows the labeled regions

Fig. 6
figure 6

Initial counter map

Parameter generation

One of the important functions in level set method is Signed-Force Function (SFF) [32], which is able to control the direction of evaluation to substitute the Edge-Stopping Function (ESF). ESF is able to stop the contour evaluation on the object boundaries [1]. Here, we utilized the statistical information inside and outside the contour to design a region-based signed force function. The proposed SFF has opposite signs around the object boundary, the contour can expand when it is inside the object or shrink when it is outside the object. Furthermore, by avoiding the computation of Signed-Distance Function (SDF) and re-initialization, the normal level set methods will be improved [5]. First, in order to simplify the function, the level set function is set to be binary and then a motion filter is used to regularize it. The motion filter can make the level set function smooth and the valuation becomes more stable. The SFF function explained in [32] has the values range of [-1, 1]. It controls the signs of the forces inside and outside the ROI so that the contour shrinks when it is outside the object or expands when it is inside the object. Based on the analysis, the following SFF function is constructed:

$$ sff(I(x)) = \frac{{I(x) - \frac{{{c_{1}} + {c_{2}}}}{2}}}{{\max (|I(x) - \frac{{{c_{1}} + {c_{2}}}}{2}|)}},\,\,x \in {\Omega} , $$
(3)

Where c1 and c2 are defined in following Eqs.

$$ {c_{1}}(\varphi ) = \frac{{\int\limits_{{\Omega}} {I(x).\,H(\varphi )dx} }}{{\int\limits_{{\Omega}} {\,H(\varphi )dx} }} $$
(4)
$$ {c_{2}}(\varphi ) = \frac{{\int\limits_{{\Omega}} {I(x).\,(1 - H(\varphi ))dx} }}{{\int\limits_{{\Omega}} {\,(1 - H(\varphi ))dx} }} $$
(5)

Where H(φ) is Heaviside function. The proposed level set function can be written in Algorithm 2.

Since we utilize a Gaussian filter to smooth the level set function to keep the interface regular, and model utilizes the statistical information of regions, which has a larger capture range and capacity of anti-edge leakage. The final equation can be written as follow:

$$ \frac{{\partial \varphi }}{{\partial t}} = sff(I(x).a|\nabla \varphi |,\,\,x \in {\Omega} $$
(6)

The proposed algorithm for SFF function is given as follows:

figure f

In step 5 of this algorithm, the standard deviation ρ of the motion filter is an essential parameter that must be chosen correctly according to the images. If ρ is too small, the evaluation step will be sensitive to noise and unstable. Nevertheless, if ρ is too large, the evaluation step cannot detect the boundaries. The Len size of 10 and theta of 45 degree are selected, which produce k × k mask for efficiency and ρ ranges are between 0 and 1, which is suitable for dental images.

The speed function F determines the speed of each point

$$x \in C$$

, which relies upon many internal and external forces. This leads to the level set equation where |∇Φ| marks the normalized gradients of the level set function and F is the speed function. As ϕ changes over time, its zero level set Φ(x,t) = 0 always yields the propagating front, i.e. C(x), at time t. Depending on the application, F is defined by a number of speed terms based on the properties of the object that should be segmented [26].

Recently, many model-based or image-based forces are introduced for different segmentation issues comprising speed terms in the direction of the propagation process, which are based on texture [20], fuzzy decision rules [4] or shape priors [3] and threshold-based speed function [29]. Unlikely, while there are advantages in the segmentation process by these speed terms, the outcome of these speed functions is limited only for specific purpose and can be utilized for applications in which they are developed. This means that those function has better result in its own designed area [10, 30].

In order to generate the speed function parameter, the features of image are required to train the classifier for prediction purpose. Many features are used based on image texture, intensity, gradient direction and corners. The gray level co-occurrence matrix (GLCM) features have 21 features, gradient direction using Histogram of Oriented Gradients (HOG) feature vector, boundary corner using SUSAN corner detection method, and genetic moment features, which have 7 features and intensity features of each image. Overall, 31 features of each image were extracted and stored as feature vectors, which were then used to train the artificial neural network classifier. The extracted features data are in different ranges of independent values. In order to work with the machine learning algorithms, it is necessary to normalize or standardize the feature data ranges. Furthermore, in order to rescale the feature data that are independent of each other, the method is used to produce the data and to scale the range of [0,1]. The following equation is used for the normalization process:

$$ x^{\prime} = \frac{{x - \min (x)}}{{\max (x) - \min (x)}} $$
(7)

Where x is the original feature value, x is the normalized value.

Back-Propagation Neural Network (BPNN) was employed for predicting different levels of success. The advantages of BPNN are automatic learning based on dependency for only measured data and it does not need other information to be included in the prediction process. Various algorithms of BPNN with different conditions were applied using ”traingda” algorithm, which is gradient descent with adaptive learning rate backpropagation. It is selected based on the high accuracy compared to other algorithms Fig. 7. Out of 120 image, 70% of images equal to 84 images trained using most suitable input parameter and 36 images remained for testing purpose.

Fig. 7
figure 7

BPNN traingda algorithm performance

3 Caries detection

Segmented images are ready for analysis and finding the abnormality in images. This step includes teeth isolation for extracting each individual tooth, feature map for extracting the features of selected region, detection process for identifying whether the selected region is caries or non-caries region, and finally validation that is based on the position of the region to detect caries. The steps involved in the detection process are as below:

  1. 1.

    Tooth isolation

  2. 2.

    Tooth feature map

  3. 3.

    Identification

3.1 Teeth isolation

As suggested by Jain and Chen [7] , individual teeth can be isolated by the integrated intensity value as shown in Fig. 8. The integrated intensity values accumulate the intensity values of pixels along the vertical direction. Since teeth usually yield higher intensity values than jaws and other tissues, the gap of teeth will have a very low value on the integrated intensity value profile.

Fig. 8
figure 8

Teeth isolation. Integrated intensity profile of image and identified point in each valley as separating line

To calculate the vertical and horizontal integral projection, let f(x,y) be a binary image function, then the vertical projection was calculated by the accumulation of each column of image values. Likewise, horizontal projection was also calculated by the accumulation of each row of image values. Vertical projection of image can be defined as:

\({P_{v}}(x) = \sum \limits _{y = 0}^{v} {f(x,y)}\)

Where v is each column of the image. Similarly, horizontal projection of image can be defined as:

\({P_{h}}(x) = \sum \limits _{x = 0}^{h} {f(x,y)} \)

Where h as each row of image.

3.2 Feature map

Each isolated tooth was considered as one object for the detection process. Features of the selected region for detection were calculated in order to determine whether the ROI has caries or not. The Fig. 9 demonstrates the tooth image with selected region which contains caries and region without caries. The features extracted from ROI are intensity average, entropy, perimeter and energy features. Furthermore, Table 1 shows the difference between features of caries area and non-caries are on tooth surface.

Fig. 9
figure 9

Selected region on tooth surface No. 1 which contains caries No. 2 region without caries

Table 1 Some extracted features of caries area and non caries area

3.3 Identification

After extracting the features of tooth surface area, the selected region was compared with the nearest region of tooth surface according to feature map. Let the examined region be E and the nearest neighboring region be N on tooth surface. The selection of N is based on the occurrence of E in any of 4 regions. The Fig. 10 demonstrates the selected region of interest for examine (E) and region of feature comparison.

Fig. 10
figure 10

Identification by comparing nearest region

Furthermore, according to similarity of the features in caries area and tooth root, if the selected region is located in the middle of tooth, it will be considered as pulp or root of tooth. Seriousness or type of caries can also be determined according to the region of detected caries in each area, whether it is near to the gum or near to the tooth enamel.

4 Dataset

The dental digital dataset for medical analysis has been constructed to provide the research community with a source of data that can be used to precisely compare different image analysis techniques. This study employed periapical dental X-ray images that were collected from Dental Clinic, Universiti Teknologi Malaysia (UTM) Health Center. Furthermore, the collected images are from university students during their regular checkups by dental clinic and their ages are between 25 to 35 years old. The patients are aware of data collection for this study, hence their personal information have not been released. This study has in compliance with the Helsinki Declaration [31] and approved by UTM medical committee. The images are periapical dental X-rays, which are a common type of dental imaging for dental disease detection and diagnosis in clinics. Figure 11 demonstrates the sample of collected dental radiograph images. Ground truth was provided by a dental expert for each non-normal case. This data was stored as digital dental X-ray images in a computer-readable format [23].

Fig. 11
figure 11

Sample of dental radiograph dataset

5 Results and discussion

5.1 Segmentation

The experiment shows that segmentation by using level set function depends on proper IC selection. Iteration of level set and time of segmentation process will change based on the selection of IC. In addition, the size of images affects segmentation time. The Fig. 12 shows the results of extracted segmentation process using the MRBIC method and predefined method.

Fig. 12
figure 12

MRBIC Segmentation results

The MRBIC method generates the most suitable IC for level set function. Extensive experiments on various images are compared with predefined IC selection method and the results demonstrate superior accuracy and speed of the process using MRBIC method for level set image segmentation. Furthermore, the proposed method is easy to implement and robust, which can be used with any images. Noisy and weak edges images have no limitation on image conditions. The predefined IC increases the time of segmentation process and accuracy as well. The metric-based empirical estimation object counting technique has been proposed by [15] to evaluate the performance of dental X-ray image segmentation. To evaluate the performance of segmentation algorithm, original images are used to record the outcome of the experiment in a tabular form as shown in Fig. 13.

Fig. 13
figure 13

Tabular presentation form by using metric-based empirical estimation object counting technique

The results of each cell Pji in table include the number of occurrences, where the segmentation algorithm for dental images correctly identifies j objects out of i objects that are located in original image, with

$$ {\sum}_{j = 0}^{i} {{P_{ji}} = {F_{i}}} $$
(8)

Where Fi is the number of original images that include precisely i objects and N is the total number of reference images. The results table is used in determining metrics of optimality and failure based on the relative weights of the main diagonal, sub-diagonals and base row respectively, in which the performance metrics are defined as follows:

$$ Optimality = 100*\frac{{{\sum}_{i = 1}^{N} {{P_{ii}}{F_{i}}} }}{{{\sum}_{i = 1}^{N} {{F_{i}}^{2}} }}\% $$
(9)
$$ Failure = 100*\frac{{{\sum}_{i = 1}^{N} {{P_{0i}}{F_{i}}} }}{{{\sum}_{i = 1}^{N} {{F_{i}}^{2}} }}\% $$
(10)

Optimality and failure percentages capture the occurrence of complete performance of a segmentation algorithm. In practical cases, it is difficult to achieve optimal performance with 100% of images, and when comparing segmentation algorithms, one should favor those whose failure rates are the lowest and their optimality and low-order measures predominate the testing results. The failure rate is particularly important when assessing teeth segmentation algorithms, since those images in which no teeth can be properly segmented cannot be used in the identification process. The results of the proposed segmentation algorithm using IC generation technique are shown in Fig. 14 and The results of segmentation using the predefined IC selection are shown in Fig. 15.

Fig. 14
figure 14

Segmentation results using MRBIC

Fig. 15
figure 15

Segmentation results using predefined IC selection

The results of the proposed dental X-ray image segmentation using IC generation technique demonstrate higher accuracy and no failure in the segmentation process. Furthermore, the following results shown in Fig. 16 are for dental image segmentation using [15] method using integral projection technique. The Fig. 17 presents the results of dental X-ray image segmentation using the proposed intelligent level set method.

Fig. 16
figure 16

Segmentation results using integral projection and thresholding method

Fig. 17
figure 17

Segmentation results using intelligent level set method

By exploring the overall results, it can be proven that the dental X-ray image segmentation using the proposed method has more accuracy and no failure during the segmentation process in compared to other methods. Accordingly, the Fig. 18 shows segmentation results in term of correct number of reference object segmentation by each method and Fig. 19 demonstrates a graphical comparison of the proposed method in dental image segmentation with other methods.

Fig. 18
figure 18

Comparison of segmentation results in term of correct number of reference object segmentation by each method

Fig. 19
figure 19

Comparison of segmentation performance accuracy in each method

5.2 Detection

From the segmentation process, 155 individual tooth were extracted, which are suitable for caries detection process. Tooth surface was examined based on ground truth provided by dentist. The correct detected caries were 152 images out of 155 images. Three images which contain the difficulties such as image noise and less quality had failure in the detection process. Figure 20 shows the result of some examined regions with corresponding message in many situations such as region located in the root area and considered as a clean region. The caries detection rate using the proposed technique is shown as follows:

$$ Accuracy = \frac{{Correct\,Detected}}{{All\, Images}} = \frac{{152}}{{155}} = 0.98 $$
(11)
Fig. 20
figure 20

Sample of detection result

The result for caries detection from dental X-ray according to dental expert’s advice demonstrated that the proposed technique has a promising result, which shows 98% accuracy in the detection process.

6 Conclusion

The aim of this paper is to develop a dental caries detection system from dental X-ray images by focusing on the improvement of dental image segmentation method. This paper was met by developing a novel technique of dental image segmentation which not only addressed the issues of the state-of-the-art methods, but also achieved better results than the existing approaches on this problem. The proposed approach in intelligent segmentation is based on the improved level set method which includes two phases. The first phase is the initial contour generation to produce the most suitable IC and the second phase is the intelligent level set method that utilizes artificial neural network and motion filtering to generate proper SF and SFF parameters. Furthermore, this is accompanied by the extraction of feature map on tooth surface and production of region-based feature map to detect region which has caries.

The segmentation results are efficient and accurate in comparison to other work. A new way to isolate each segmented teeth image has been proposed by employing integral projection method and feature map designed for each tooth in order to extract the local information and therefore to detect the caries area. The achieved overall performance of the proposed segmentation algorithm evaluated on 120 periapical dental radiograph (X-ray) images is 90.83%. Moreover, the detection rate on 155 segmented teeth is 98%. For the future work, this method would be interesting to perform on other medical images to detect abnormalities based on the features of image and disease textural features, as well as obtain efficient and accurate results in diagnosis systems.