1 Introduction

The X-Ray image is the most commonly used imaging modality for doctors to diagnose and treat bone diseases. The Fracture diagnosis, Evaluation of skeletal, Bone densitometry and Hip replacement are done based on the results of X-Ray images. The segmentation plays a vital role in computer-aided diagnosis, surgery and treatment.

The automatic detection of crack improves the timeliness and accuracy of diagnosis. The detection of cracks in x-ray images is a difficult and challenging. There are various methods [12] to detect fractures which leads to computer aided fracture detection. The crack detection in bone X-Ray images can be done by Fuzzy index measure [9]. The hairline mandibular fracture is detected using MRF-based approach [1]. The well displaced mandibular fractures are identified by Bayesian inference [6]. The hip fractures are clearly marked by the use of texture [17]. The femur bone fractures can be located using combined classifier approach [5], divide-conquer approach in SVM’s kernel-space [10], neckshaft angle calculation [30] and combined detection methods [18]. The arm fractures are detected by the contour modeling coupled with shape constraints [13], the midshaft long bone fractures are clearly marked by the use of hough transform and gradient analysis [14], the bone fractures are detected by Artificial Neural Network Techniques [7] and fusion-based classification system [19] is used to detect the presence / absence of Tibia bone fracture(s) in medical images. The thresholding [27], edge-based [4, 29], region-based [8], graph-based [3] classification-based [31], and deformable model [22] are the most commonly used image segmentation techniques [24, 26] in different medical applications. Though there are lots of methods applied for detecting fractures on bone images, these are not sufficient to give accurate result. So it is necessary to introduce a new method to improve the accuracy to detect the fractures.

The proposed scheme is modeled as a two-step approach: preprocessing, hairline fracture identification using segmentation and intensity variation calculation. In the Preprocessing step, the 2D Anisotropic Diffusion filter [20, 23] along with Discrete Wavelet Transform [28] is used to remove the noises and to get the finite details. In the segmentation step the preprocessed image is segmented using Expectation Maximization algorithm [2, 16] to separate the bone region. Finally an intensity variation calculation technique is carried out to detect cracks. The performance is compared with some standard techniques such as “Automatic Crack Detection in Eggshell based on SUSAN Edge Detector Using Fuzzy Thresholding (FSUSAN)” [21] and “Crack detection in X-ray images using fuzzy index measure (FIM)” [9]. The experimental result shows that the proposed work identifies the crack well when compared to the standard techniques.

The remaining of this paper is organized as follows; Section 2 introduces the methodology involved in this paper. Section 3 describes the experiment results with analysis charts. A brief conclusion is given in Section 4.

2 Proposed method

The complete block diagram of the proposed method is shown in Fig. 1. After inputting an X-Ray image, we remove the noises and preserve the minute pixels using Anisotropic Diffusion filter and DWT. As a second step EM algorithm is used to separate the bone region and intensity variation calculation technique is used to detect the cracks. At section 2.1 we illustrate the preprocessing step involved to reduce noises and to preserve the minute details. After this step, section 2.2 describes the steps involved in Expectation Maximization algorithm. The section 2.3 describes how to separate the bone structure from the input image and section 2.4 describes the intensity variation calculation technique to detect the cracks.

Fig. 1
figure 1

Block diagram of the proposed work

2.1 Preprocessing

The preprocessing step is one of the essential steps in Medical images because noises are occurred in these images during acquisition. The denoising method is used in order to enhance the performance. In the proposed work, the 2D anisotropic Diffusion filter along with DWT is used for doing the preprocessing step. The detailed explanation of Anisotropic Filter is given in section 2.1.1. The section 2.1.2 tells the concept of wavelets. The main goal of this preprocessing step is to reduce noises, to enhance the edges and to retain the minute details.

2.1.1 Anisotropic diffusion

Any medical image is subjected to noises; these noises are removed by anisotropic diffusion filter. The purpose of the anisotropic diffusion filter is to improve the medical image quality by removing the noise and enhance the edges. Anisotropic Diffusion filter [20, 23] is able to retain the edges in the image by diminishing the noise in the non-homogenous region of image. Generally, the process can be represented in any dimension using the Eq. (1).

$$ \frac{\partial }{\partial s}I\left(x,y,s\right)=\mathit{\operatorname{div}}\left(f\left(x,y,s\right)\cdot \nabla I\left(x,y,s\right)\right) $$
(1)

where I(x, y, s) denotes the image intensity, (x, y) be the spatial coordinate, s be the discrete implementation step and f(x, y, s) denotes the diffusion function. Also ∇ is the gradient operator.

The diffusion function for the high contrast edges over low contrast one is expressed by the Eq. (2).

$$ f\left(x,y,s\right)={e}^{-{\left[\frac{\nabla I}{E_{dif}}\right]}^2} $$
(2)

where E dif is the diffusion constant, which defines the value that triggers the smoothing process.

The diffusion function for wide regions over smaller ones is generally expressed as the Eq. (3).

$$ f\left(x,y,s\right)=\frac{1}{1+{\left[\frac{\nabla I}{E_{dif}}\right]}^2} $$
(3)

The 2D discrete information of anisotropic diffusion method forms the Eq. (4)

$$ \frac{\partial }{\partial s}I\left(x,y,s\right)=\sum_{i=1}^8{D}_i $$
(4)

where D i represents the various eight neighborhood pixels, east, west, north, south, east-north, west-south, west-north and east-south. This D i can be expressed in the form of the Eq. (5)

$$ {D}_i=\left\{\begin{array}{c}\hfill \frac{k_i}{t_i}\left[{p}_i-I\left(x,y,s\right)\right]\kern0.5em if\kern0.5em 1\le i\le 4\hfill \\ {}\hfill \begin{array}{cc}\hfill \frac{r_i}{{\left(\varDelta d\right)}^2}\left[{q}_i-I\left(x,y,s\right)\right]\hfill & \hfill otherwise\hfill \end{array}\hfill \end{array}\right. $$
(5)

where the values of k i defines as

$$ {k}_i=\left\{\begin{array}{c}\hfill \begin{array}{ccc}\hfill g\left(x+\frac{\varDelta x}{2},y,s\right)\hfill & \hfill if\hfill & \hfill i=1\hfill \end{array}\hfill \\ {}\hfill \begin{array}{ccc}\hfill g\left(x-\frac{\varDelta x}{2},y,s\right)\hfill & \hfill if\hfill & \hfill i=2\hfill \end{array}\hfill \\ {}\hfill \begin{array}{ccc}\hfill g\left(x,y+\frac{\varDelta y}{2},s\right)\hfill & \hfill if\hfill & \hfill i=3\hfill \end{array}\hfill \\ {}\hfill \begin{array}{cc}\hfill g\left(x,y-\frac{\varDelta y}{2},s\right)\hfill & \hfill otherwise\hfill \end{array}\hfill \end{array}\begin{array}{cc}\hfill \begin{array}{cccc}\hfill \hfill & \hfill \hfill & \hfill \hfill & \hfill \hfill \end{array}\hfill & \hfill \hfill \end{array}\right.\kern0.5em 1\le i\le 4 $$

the values of t i can be defined as

$$ {t}_i=\left\{\begin{array}{c}\hfill \begin{array}{ccc}\hfill {\left(\varDelta x\right)}^2\hfill & \hfill if\hfill & \hfill i=1,2\hfill \end{array}\kern0.5em \hfill \\ {}\hfill \begin{array}{ccc}\hfill {\left(\varDelta y\right)}^2\hfill & \hfill \hfill & \hfill otherwise\hfill \end{array}\hfill \end{array}\begin{array}{cccc}\hfill \hfill & \hfill \begin{array}{cc}\hfill \hfill & \hfill \hfill \end{array}\hfill & \hfill \hfill & \hfill \hfill \end{array}1\le i\le 4\right. $$

the r i values are calculated from the equation

$$ {r}_i=\left\{\begin{array}{c}\hfill \begin{array}{ccc}\hfill g\left(x+\frac{\varDelta x}{2},y+\frac{\varDelta y}{2},s\right)\hfill & \hfill if\hfill & \hfill i=5\hfill \end{array}\hfill \\ {}\hfill \begin{array}{ccc}\hfill g\left(x-\frac{\varDelta x}{2},y-\frac{\varDelta y}{2},s\right)\hfill & \hfill if\hfill & \hfill i=6\hfill \end{array}\hfill \\ {}\hfill \begin{array}{ccc}\hfill g\left(x+\frac{\varDelta x}{2},y-\frac{\varDelta y}{2},s\right)\hfill & \hfill if\hfill & \hfill i=7\hfill \end{array}\hfill \\ {}\hfill \begin{array}{cc}\hfill g\left(x-\frac{\varDelta x}{2},y+\frac{\varDelta y}{2},s\right)\hfill & \hfill otherwise\hfill \end{array}\hfill \end{array}\begin{array}{cccc}\hfill \hfill & \hfill \hfill & \hfill \hfill & \hfill \hfill \end{array}\right.\kern0.5em 5\le i\le 8 $$

the values for thep i are defined as

$$ {p}_i=\left\{\begin{array}{c}\hfill I\left(x+\varDelta x,y,s\right)\kern0.5em if\kern0.5em i=1\hfill \\ {}\hfill \begin{array}{ccc}\hfill I\left(x-\varDelta x,y,s\right)\hfill & \hfill if\hfill & \hfill i=2\hfill \end{array}\hfill \\ {}\hfill \begin{array}{ccc}\hfill I\left(x,y+\varDelta y,s\right)\hfill & \hfill if\hfill & \hfill i=3\hfill \end{array}\hfill \\ {}\hfill \begin{array}{cc}\hfill I\left(x,y-\varDelta y,s\right)\hfill & \hfill otherwise\hfill \end{array}\hfill \end{array}\right.{\displaystyle \begin{array}{cccc}\hfill \hfill & \hfill \hfill & \hfill \hfill & \hfill \hfill \end{array}}{\displaystyle \begin{array}{cc}\hfill \hfill & \hfill 1\le i\le 4\hfill \end{array}} $$

and the q i values defined as

$$ {q}_i=\left\{\begin{array}{c}\hfill I\left(x+\varDelta x,y+\varDelta y,s\right)\kern0.5em if\kern0.5em i=5\hfill \\ {}\hfill \begin{array}{ccc}\hfill I\left(x-\varDelta x,y-\varDelta y,s\right)\hfill & \hfill if\hfill & \hfill i=6\hfill \end{array}\hfill \\ {}\hfill \begin{array}{ccc}\hfill I\left(x+\varDelta x,y-\varDelta y,s\right)\hfill & \hfill if\hfill & \hfill i=7\hfill \end{array}\hfill \\ {}\hfill \begin{array}{cc}\hfill I\left(x-\varDelta x,y+\varDelta y,s\right)\hfill & \hfill otherwise\hfill \end{array}\hfill \end{array}\right.{\displaystyle \begin{array}{cc}\hfill \begin{array}{cccc}\hfill \hfill & \hfill \hfill & \hfill \hfill & \hfill \hfill \end{array}\hfill & \hfill 5\le i\le 8\hfill \end{array}} $$

Here, Δx, Δyand Δdare the relative distances, and these are considered as Δx = 1, Δy = 1 and \( \varDelta d=\sqrt{2} \) .

The flow intensity contributed by its eight neighborhoods for each pixel in the image is given by the Eq. (6).

$$ \frac{\partial }{\partial s}I\left(x,y,s+\varDelta s\right)\approx I\left(x,y,s\right)+\varDelta s\left[\sum_{i=1}^4{D}_i+\frac{1}{2}\sum_{j=5}^8{D}_j\right]\kern0.5em 0<\varDelta s<1/7 $$
(6)

2.1.2 Wavelets

The wavelet transform [28] is significant to provide a solid description of images that are limited in spatial extent. It is very helpful in description of edge and line that are highly localized. In the DWT, the image is logically decomposed into different hierarchical sub-band system. The original image is decomposed into four sub-bands LL, LH, HL and HH. These four sub-bands are formed from the separate applications of vertical and horizontal filters. These four sub-bands are called finest scale wavelet coefficients. The LL sub-band produces the detailed image which has more minute details. Since the crack is a hairline breakage, the minute details are very important. So the LL sub-band is selected for further processing.

2.2 Region splitting

The x-ray image has background, skin and bone region, the region splitting plays a vital role to separate these regions for diagnosis. In the proposed work Expectation Maximization (EM) algorithm is used for segmentation. The EM algorithm [2, 16] is a procedure to calculate the maximum likelihood estimate by the iterative approach in the presence of hidden and missing data. The Block diagram of the Expectation-Maximization Method is shown in Fig. 2. The EM algorithm consists of two major steps: an Expectation step (E-step), followed by a Maximization step (M-step). In the Expectation step, the missing data are estimated from the observed data and current estimate of the model parameters. In the Maximization step, the likelihood function is maximized under the assumption that the missing data are known. These E-step and M-step are iterated until convergence.

Fig. 2
figure 2

Expectation maximization algorithm

Consider the data set S of size n, S = {s 1, s 2, …, s n }. The probability density function for the independent and identically distributed data vectors inp(S| α), and is defined by the Eq. (7).

$$ p\left(S|\alpha \right)=\prod_{k=1}^np\left({s}_k|\alpha \right) $$
(7)

Where α be the set of parameters.

The Likelihood function with the parameter α and the data set S isL(α| S). The relationship between the probability density function p(S| α)andL(α| S)are expressed as the Eq. (8).

$$ p\left(S|\alpha \right)=L\left(\alpha |S\right) $$
(8)

Our goal is to find the value of α that maximizesL. The maximum likelihood problem is defined as the Eq. (9).

$$ {\alpha}^{\ast }=\arg {\mathrm{max}}_{\alpha }L\left(\alpha |S\right) $$
(9)

Expectation step is necessary to find the expected value of the complete data log likelihood with respect to the unknown data T with the data set Sand the present parameter estimates. This can be expressed by the Eq. (10).

$$ Q\left(\alpha, {\alpha}^{k-1}\right)=E\left[\log p\left(S,T|\alpha \right)|S,{\alpha}^{k-1}\right] $$
(10)

where α be the new parameter and α k − 1 be the present parameter estimates.

Maximization step is to maximize the expectation computed in the E-step by the Eq. (11).

$$ {\alpha}^k=\arg {\mathrm{max}}_{\alpha }Q\left(\alpha, {\alpha}^{k-1}\right) $$
(11)

The log likelihood is increased on each step and also the algorithm guaranteed to converge to a local maximum of the likelihood function.

The expectation and maximization steps are repeated until the difference between the estimated parameters of two consecutive steps are equal or inferior to a fixed threshold value ε.

2.3 Bone region extraction

The X-Ray image consists of three regions namely, Background, Skin and Bone. The EM algorithm segment the given X-ray image into three regions if k = 3, this technique is called region splitting. The EM algorithm is carried out in two steps: expectation step and maximization step using the Eqs. (711) to segment the given x-ray image. The result of EM algorithms contains three regions background, skin and bone from this only bone region is to detect the crack. Remove the background and skin region from the segmented image using the mask. Extract the bone region alone because the region of interest is only the bone region.

2.4 Crack identification using intensity variation technique

The hairline breakage on the bone region is considered here. Let Pand Q be any two consecutive points in the X-ray image with coordinates (x i , y i )and (x j , y j ) respectively. Let I P and I Q be the intensities of two pixels P and Q and let d PQ be the Euclidean distance between them. The capacity function cPQ is used to determine the variation among the neighboring pixels, which can be defined by the Eq. (12).

$$ {\mathrm{c}}_{\mathrm{PQ}}=\frac{I_P{I}_Q}{d_{PQ}} $$
(12)

Here, the intensity at a crack site has a different intensity than the surrounding bone because a typical crack is marked by loss of bone. If the intensity variation is very much, that is larger than ε when compared with the surrounding pixels then the area is considered as crack. This is represented by the Eq. (13).

$$ {C}_{PQ}\ge \varepsilon $$
(13)

where ε is the threshold limit.

3 Experimental procedure

The method has been tested on various grey level X-Ray images. All programs applied in simulating the algorithms are designed by MATLAB. A sample X-Ray image is shown in Fig. 3a. The given Bone X-ray image is filtered using the anisotropic diffusion technique with eight neighborhood pixel using the Eq. (1)–(6). The value of the integration constant Δsis assigned as 0.5. The diffusion constant, E dif determines the value that triggers the smoothing process and it is assigned as 30. The diffusion function for wide regions over smaller ones is used here since a crack is a hairline breakage. The noise free image obtained by anisotropic diffusion is shown in Fig. 3b. Since the wavelets are used in description of edges as well as it retains minute pixels one level DWT is performed and LL component is used for further processing. The result after one level DWT is shown in Fig. 4. The X-Ray image consists of three regions namely: Background, skin and bone. Our area of interest is bone so EM algorithm is used to separate the regions and k = 3 is used to separate the given image into three regions such as bone, skin and Background region using the Eqs. (7)–(11). The segmented results are shown in Fig. 5. Using the masks of the EM algorithm from the input image the bone region is extracted, that output is shown in Fig. 6. The bone extracted image is then subjected to intensity variation calculation. The capacity value is calculated using Eq. (12), the intensity of each pixel is compared with its eight neighborhoods. If the pixels has a large intensity variation when compared to its neighbors that pixels are considered as hairline breakage displayed in Fig. 7. The inverse DWT is applied to get the actual position of the crack and it is shown in Fig. 8a. From the Fig. 8a the crack region is alone isolated and it is shown in Fig. 8b. Finally the crack area is highlighted in Fig. 8c. The proposed work is tested for many sample X-Ray images. Some outputs for the sample X-Ray images are shown in Table 1.

Fig. 3
figure 3

a Original X-ray image (b) Noise free image obtained by anisotropic diffusion filter

Fig. 4
figure 4

One level decomposition using DWT

Fig. 5
figure 5

Segmentation results of EM algorithm with k = 3

Fig. 6
figure 6

Bone area extraction

Fig. 7
figure 7

Crack identification using intensity variation calculation

Fig. 8
figure 8

a After invrse DWT, (b) crack region isolation and (c) crack highlighted in original image

Table 1 Sample experemental result

3.1 Performance analysis

The proposed work is compared with “Automatic Crack Detection in Eggshell based on SUSAN Edge Detector Using Fuzzy Thresholding (FSUSAN)” [21] and “Crack detection in x-ray images using fuzzy index measure (FIM)” [9]. In order to perform the performance with the above said techniques the sensitivity and specificity [11, 25] calculation is performed using the Eqs. (14) and (15). Sensitivity or True Positive Rate is the ability of a test those with the Crack, whereas test Specificity or True Negative Rate is the ability of the test to correctly identity those without the crack.

$$ sensitivity=\frac{TP}{\left( TP+ FN\right)} $$
(14)
$$ specificity=\frac{TN}{\left( FP+ TN\right)} $$
(15)
$$ Accuracy=\frac{\left( TP+ TN\right)}{\left( TP+ TN+ FP+ FN\right)} $$
(16)

where

TP :

True Positive (correctly identified)

FP :

False Positive (incorrectly identified)

TN :

True Negative (correctly rejected)

FN :

False Negative (incorrectly rejected)

The comparative results of sensitivity and specificity for the ten Patient’s sample image are given in Table 2. The Overall True Positive Rate (Sensitivity) is 0.8519 and the overall True Negative Rate (Specificity) is 0.9782. On seeing the results, the proposed method detects crack well than the previous work. The Accuracy of detection is also calculated using Eq. (16) and it is given in Table 2. Figure 9 shows the graphical chart of the Overall Accuracy rate of the three techniques. The overall accuracy rate of the proposed work is very high (98%) when compared with the other techniques. On seeing the sensitivity, specificity and accuracy the proposed work works than the other methods.

Table 2 comparison of the proposed method with other two methods et al. [21] and Linda et al. [9]
Fig. 9
figure 9

Accuracy of detection

3.2 ROC analysis

Receiver Operating Characteristic (ROC) Curve Analysis [15] is important for medical diagnosis. In this the segmentation results of the proposed work are compared with other standard techniques by calculating the True Positives (TP), True Negatives (TN), False Positives (FP) and False Negatives (FN). The True Positive Rate (TPR) or the Sensitivity, and the False Positive Rate (FPR) or 1-specificity is calculated for the sample images. Figure 10 shows an ROC curve with Sensitivity vs 1-Specificity for all patients. The results also demonstrate that our new proposed technique has the ability to detect crack well when compared with the other techniques.

Fig. 10
figure 10

ROC analysis

4 Conclusion

In this paper, a procedure for crack detection in Bone X-ray image based on the fusion of anisotropic diffusion and EM algorithm is proposed. The proposed algorithm produces segmentations with high sensitivity and specificity. The overall sensitivity of the proposed method of all patients is 0.8519 and the overall true Negative Rate (Specificity) is 0.9782. The ROC analysis says that the proposed method provides better detections than two standard methods. We can improve the accuracy of crack detection by decreasing the error rates, this work can be extended on 3D images and the depth of the crack can also calculated.