1 Introduction

If the quality of medical images which are subjected to CAD system or manual examination by the radiologists is poor then the decision made by the radiologist or CAD system would not be accurate and hence image enhancement becomes an essential step in CAD that is applied over the images to be subjected for analysis and detection of micro-calcifications. Denoising method or enhancement of images is applied over all the medical images before their interpretation or diagnosis. Mammographic images do not have sufficient contrast between normal glandular and malignant tissues because of low attenuation between the tissues in the images; particularly in cases of breast cancer images of younger women that have denser breast tissues [1]. Mammogram enhancement techniques are used to increase radiologist’s detection accuracy and efficiently characterize the breast feature. However, the classification of tissue types remains an unaddressed task; and it becomes more difficult for the radiologist to differentiate between normal and cancerous tissues in case of small size malignancies. The main aim of using image enhancement is to process an image so that the result is more suitable than the original image for a specific application such as detection of abnormality. The enhancement can improve the contrast or brightness of the original image by expanding dynamic range of digital image in terms of brightness values. In some cases, selected features are also enhanced and their values improved using the enhancement methods. The outcome of enhancement is either the improvement of human visual perception or the enhanced understanding from the point of view of computers. In medical image analysis and applications, the classification between the areas initially having a small difference in the density is required and this process becomes more accurate after applying a suitable image enhancement method [2].

Mammographic breast cancer images contain some noise and contrast is also poor due to X-ray quantum absorption. The noise in image acquisition system makes the detection of small and subtle structures more difficult [2]. It has been observed that noise increases with the increase in pixel intensities in images where local contrast and image intensity are interdependent [3]. The contrast enhancement techniques could be classified as per the parameters used such as global, local and adaptive. A quantitative measurement is used to evaluate the performance of the image enhancement and segmentation technique in terms of CII, SNR, RMSE etc. [47]. All of these measurements techniques were commonly used in medical image processing and applications by the radiologists in interpretation of x-ray images [4]. Grey level clustering is the process of categorizing various grey levels into groups whose members are similar in some way. Clusters are produced as collections of grey level values which are very similar among them and dissimilar belonging to other clusters. We have compared the diagnostic ability between original and enhanced images and quantitative measurement between the standard image enhancement techniques has been used in comparison of GLC-CE algorithm with the existing enhancement methods.

2 Related research and problem identification

Various image enhancement techniques are used to enhance the contrast of digital images such as point operations that include contrast stretching, window slicing, and histogram modeling [8]. These techniques are applied over different types of images such as X-ray images, mammograms, computed tomography (CT) images etc. Global transformation method is used to remap a given input gray-level into an output gray-level and image quality is improved. However, images are treated globally and hence the method cannot differentiate between several areas of the image that might require different levels of contrast enhancement on the local basis. Histogram specification (HS) is another method where expected output of image histogram can be controlled through histogram modification and identifying the output histogram is not a smooth task because it differs from image to image [9]. But, local histogram equalization (LHE) requires high computational cost and sometimes causes over-enhancement also. Another difficulty is that noise signal is also enhanced with respect to image features and most of the time; these methods create an unwanted effect on enhanced images [9, 10]. Contrast enhancement is achieved using histogram equalization (HE) which performs comparatively better for almost all types of images. HE executes its process by remapping the gray levels of the image based on the probability distribution of the input gray levels, but in many cases at the cost of loss of local information which leads to insufficient medical details during diagnosis [11]. Local histogram equalization (LHE) can overcome such problem by using a small window that could move through every pixel of the image one after the other and only the block of pixels that fall in this window are considered for HE and then gray level mapping for enhancement is applied only for the center pixel of that window [12].

Global histogram equalization (GHE) uses the histogram information of the whole input image for its transformation operator but it fails to adjust with the local brightness features of the input image. In case of high gray levels in the image, GHE again maps the gray levels in such a way that the contrast stretching becomes limited in some dominating gray levels having larger image histogram components and causes significant contrast loss for other small ones [13]. Adaptive histogram equalization (AHE) computes several histograms for different segment of the image and uses them to redistribute the lightness values of the image. Therefore, it is suitable for improving the local contrast of an image and bringing out noise detail, and the wash out effect introduces artifacts and losing out the image details [14]. Another method called dynamic histogram specification (DHS) produces specified histograms from input image and preserve the histogram characteristic of image. However, the degree of enhancement is not that much significant [15]. Contrast limited adaptive histogram equalization (CLAHE) divides the image into contextual regions and applies histogram equalization to each one of them. It modifies the intensity values of the image by utilizing a nonlinear methodology. But the difficulty is due to the problem of high contrast in both foreground and background. The visibility of the mass, suffer from misleading intensity in homogeneities in the background [16]. In diagnosis of medical images, local details may be more important than global contrast or features.

In view of the above challenges, we have proposed a gray level clustering and contrast enhancement (GLC–CE) method for mammographic breast cancer images in the present work. Unlike LHE and HE where superior histogram components take over the inferior parts of histogram, the proposed GLC–CE technique performs grouping operation of gray level value on the basis of input histogram and produce clusters for similar intensity. Subsequently, contrast enhancement procedure is applied preserving the details of the original image.

3 Preprocessing methods

This section discusses a brief review of existing histogram based enhancement methods and their mathematical background.

3.1 Histogram equalization (HE)

Histogram equalization helps in achieving the uniform distribution of intensity values. Suppose input image \(f(x,y)\) collection of discrete gray levels with range of \([0,L - 1]\). The histogram of the image with gray levels in this range is a discrete function \(H(r_{k} ) = n(k)\) where \(r_{k}\) is the kth gray level and \(n(k)\) is the number of pixels in the image with gray level \(r_{k}\). The probability density function (PDF) of the image is approximately by the following relative frequency:

$$P\left( k \right) = \frac{n\left( k \right)}{N}$$
(1)

for \(k = 0,1,2, \ldots ,L - 1\).

The cumulative distribution function (CDF) of the image is:

$$T\left( {r_{k} } \right) = \mathop \sum \limits_{i = 0}^{k} P\left( {r_{k} } \right) ,$$
(2)

where \(k = 0,1,2, \ldots ,L - 1\).

Histogram equalization maps an input gray level k into an output gray level \(T^{'} (k)\) using the transformation or mapping function, as under:

$$T^{'} \left( k \right) = T(r_{k} )\cdot \left( {L - 1} \right)$$
(3)

A mapping function of HE uses histogram which is as close to a uniform distribution as possible [12]. Figure 1b shows the effect of HE applied to Fig. 1a. HE suffers with washed-out appearance and other artifacts.

Fig. 1
figure 1

Results of different enhancement methods. a Original image b result of HE c result of GHE d result of LHE e result of HS f result of CLAHE

3.2 Global histogram equalization (GHE)

By (2), CDF is defined by \(T\left( {r_{k} } \right)\) over PDF and the method is called global histogram equalization (GHE).

$$s_{k} = T\left( {r_{k} } \right)$$
(4)

Here \(S_{k}\) can easily be mapped to the range of [0, L−1]. Figure 1c shows that improvement in image contrast along with some artifacts and washed out appearance due to selection of larger gray level [13].

3.3 Local histogram equalization (LHE)

Local histogram equalization (LHE) executes block-overlapped histogram equalization [13] [16]. LHE works as a sub-block method and repossess its histogram information; and is applied for the center pixel using the CDF of that sub-block. Then the sub-block is shift by one pixel and sub-block HE is repeated until the end of the input image is reached. This function is finally used to map the gray level of the pixel centered in the neighborhood. The center of the neighborhood region is then moved to an adjacent pixel location and the procedure is repeated. This approach has benefits over repeatedly computing the histogram over all pixels in the neighborhood region each time the region is moved one pixel location. LHE cannot make use of sufficient local information and over-enhances the input image due to its mask size [17]. In Fig. 1d, the background noises are much enhanced depending on the block size.

3.4 Histogram specification (HS)

In this method a specified histogram is acquired between the ranges of highlighted gray level. The specified histogram is calculated by value \(z_{k}\) that satisfy the following equation.

$$v_{k} = T^{ - 1} \left( {s_{k} } \right) \left\{ { k = 0,1,2, \ldots ,L - 1} \right\} ,$$
(5)

where \(s_{k}\) and \(v_{k}\) represent the CDFs of histograms of the input image \(f(x,y)\) and the transformation function for \(s_{k}\) in (4).

HS can be expressed as GHE where it performed on the input histogram of gray level and then remapped to the existing gray levels in the specified histogram but to determine the most suitable specified histogram no universal rule is available [17]. Figure 1e shows the result of HS where anatomical features become easily visible in the enhanced image.

3.5 Contrast limited adaptive histogram equalization (CLAHE)

CLAHE is a special type of adaptive histogram equalization which limits the maximum contrast adjustment and the resulting image does not become too noisy. However, it also produces over enhancement resulting in loss of some local information. Image is divided into several non overlapping regions of almost equal sizes then the histogram of each region is calculated. Based on a desired limit for contrast expansion, a clip limit for clipping histograms is obtained. Now, each histogram is redistributed in such a way that its height does not go beyond the clip limit [18] [19]. Figure 1f shows the effect CLAHE. The overall contrast does not increase significantly.

4 Gray level clustering and contrast enhancement (GLC–CE) method

Image enhancement can be performed by clustering of grey level of each pixels present in mammography images. Grey level Cluster analysis allows the partitioning of grey level into meaningful subgroups which can be applied for image enhancement purposes. Clustering begins with dividing a set of grey level into non-overlapping groups, or clusters where grey level in a cluster are similar to one another than to grey level in other clusters. When a grey level histogram is clustered, every level is assigned to some cluster, and every cluster can be characterized by a single reference point, usually an average of the level in the cluster. The proposed method is developed using uniform histograms that are redistributed uniformly over the grayscale images in efficient manner. The basic principle of this new technique involves grouping the histogram components into a proper number of gray-level bins and empty gray levels can be created on the grayscale which allows the redistribution of the histogram components. The groups of histogram components are redistributed uniformly over the grayscale, so that each group occupies a grayscale segment of the same size as the other groups, and the concentrated histogram components spread out and image contrast is increased. The basic algorithm of GLC-CE technique is described as follows.

Let \(H_{n} (k)\) be the histogram of the original image \(f(x,y)\) with \(k\) representing the gray levels [0, M−1] on the grayscale image \(f(i,j)\). To perform gray-level clustering, gray-level bins \(GLB_{n} (l)\) are assigned to nonzero histogram [20].

$$GLB_{n} \left( l \right) = H_{n} \left( k \right)$$
(6)

for \(H_{n} (k) \ne 0\), \(k = 0,1,2, \ldots ,M - 1;\,\,l = 1,2, \ldots ,n\).

Left and right limits are set as \(L_{n} (l)\) and \(R_{n} (l)\) of the gray-level interval represented by \(GLB_{n} (l)\).

The intervals consist of single values, which are the gray-level value s\(k\) of the original histogram components, \(H_{n} (k)\). We choose minimum value of \(GLB_{n} (l)\) i.e. \(min [GLB_{n} (l)]\) and supposing \(l_{e}\) as cluster element corresponding to \(min [GLB_{n} (l)]\). The clustering is performed by grouping \(GLB_{n} ( l_{e} )\) and combined with the smaller of its two adjacent neighbor and the grey level bins \(GLB_{n} (l)\) are adjusted to create a new set of bins \(GLB_{n - 1} (l)\) as follows:

$$GLB_{n - 1} \left( l \right) = \left\{ \begin{array}{ll} GLBn\left( l \right), &\quad {\rm for} \,l = 1,2, \ldots ,l^{\prime} \\ e + e^{\prime} &\quad {\rm for} \,l = l^{\prime} \\ GLBn\left( {l - 1} \right) &\quad {\rm for} \;\; l = l^{\prime} + 1,l^{\prime} + 2, \ldots ,n - 1 \\ \end{array} \right.$$
(7)

where e = min [\(GLB_{n} (l)]\), e′\(= \hbox{min} [GLB_{n} ( l_{e} ), GLB_{n} ( l_{e} - 1 )]\), and

$$l^{\prime} = \left\{ \begin{array}{ll} l_{e} - 1 &\quad {\rm for}\; GLB_{n} \left( {l_{e} } \right)\, \le \,GLB_{n} \left( { l_{e} - 1 } \right) \\ i_{e} &\quad {\rm otherwise} \\ \end{array} \right.$$
(8)

The left and right limits of the gray-level intervals represented by \(GLB_{n - 1} \left( l \right)\) need to be adjusted accordingly:

$$L_{n - 1} \left( l \right) = \left\{ \begin{array}{ll} L_{n} \left( l \right), &\quad {\rm for}\; l = 1,2, \ldots , l^{\prime} \\ L_{n} \left( {l - 1} \right) &\quad {\rm for}\; l = l^{\prime} + 1,l^{\prime} + 2, \ldots ,n - 1 \\ \end{array} \right.$$
(9)
$$\begin{aligned} R_{n - 1} \left( l \right) = \left\{ {\begin{array}{ll} {R_{n} \left( l \right), \, \quad\quad {\rm for} \,\,l = 1,2, \ldots , l^{\prime}} \\ {R_{n} \left( {l - 1} \right)\quad {\rm for}\,\, l = l^{\prime} + 1,\,l^{\prime} + 2, \ldots ,n - 1} \\ \end{array} } \right. \end{aligned}$$
(10)

Here \(L_{n - 1} \left( l \right) = R_{n - 1} \left( l \right)\); which means that the leftmost gray-level bin \(GLB_{n - 1} \left( l \right)\) contains only one gray level that usually corresponds to the background, and it matches to gray level 0 in the result. If gray-level k falls inside \(GLB_{n - 1} \left( l \right)\), and \(L_{n - 1} \left( l \right) \ne R_{n - 1} \left( l \right)\), then the gray level is first mapped onto the right boundary of the gray-level interval assigned to bin \(GLB_{n - 1} \left( l \right)\). Then, this is separated from the group by linear rescaling within the assigned gray-level interval.

Mapping and ungrouping are performed and the total number of gray-level bins has been reduced by one. The transformation function \(T_{n} \left( k \right)\) is constructed which maps the gray-level values of pixels in the input image to the desired values in the output image. All gray-level bins are redistributed uniformly over the entire grayscale and the gray levels are mapped to new values. Image enhancement in spatial domain uses a transform function which generates a new intensity value for each pixel of the \(\left( {M - 1} \right) \times (N - 1)\) original image to generate the enhanced image. The enhancement process is denoted by:

$$g\left( {i,j} \right) = T_{n} \left( k \right)\left[ {f\left( {i,j} \right)} \right]$$
(11)

where \(f\left( {i,j} \right)\) is the gray value of the \(\left( {i,j} \right){\text{th}}\) pixel of the input image; \(g\left( {i,j} \right)\) is the gray value of the \(\left( {i,j} \right){\text{th}}\) pixel of the enhanced image and \(T_{n} (k)\) is the transformation function.

Local enhancement method applies transformation over a pixel considering intensity distribution among its neighboring pixels. Local information is extracted from an image. The \(T_{n} (k)\) transformation is defined as:

$$g\left( {i,j} \right) = K\left( {i,j} \right)\left[ {f\left( {i,j} \right) - \alpha \times Lmean\left( {i,j} \right)} \right]$$
(12)

In (12), \(\alpha\) is enhancement parameter so that \(\alpha \ne 0\), \(Lmean\left( {i,j} \right)\) is the local mean of the \(\left( {i,j} \right){\text{th}}\) pixel of the input image and is enhancement function which takes both local and global information into account. The local mean and enhancement function is:

$$mean\left( {i,j} \right) = \frac{1}{{\left( {M - 1} \right) \times (N - 1)}}\mathop \sum \limits_{x = 0}^{M - 1} \mathop \sum \limits_{y = 0}^{N - 1} f(x,y)$$
(13)

The enhancement function \(K\left( {i,j} \right)\) can also be expressed as

$$K\left( {i,j} \right) = \frac{kD}{{\sigma \left( {i,j} \right) + \beta }}$$
(14)

where \(k\) and β are two parameters; and \(\sigma \left( {i,j} \right)\) is the local standard deviation of \(\left( {i,j} \right){\text{th}}\) pixel of the input image over \(\left( {i,j} \right){\text{th}} \left( {M - 1} \right) \times (N - 1)\) image; \(Gmean\) is the global mean which is defined as

$$Gmean = \frac{1}{{\left( {M - 1} \right) \times (N - 1)}}\mathop \sum \limits_{i = 0}^{M - 1} \mathop \sum \limits_{j = 0}^{N - 1} f\left( {i,j} \right)$$
(15)

and

$$\sigma \left( {i,j} \right) = \sqrt {\frac{1}{{\left( {M - 1} \right) \times \left( {N - 1} \right)}}\mathop \sum \limits_{i = 0}^{M - 1} \mathop \sum \limits_{j = 0}^{N - 1} f\left( {x,y} \right) - m\left( {i,j} \right)^{2} }$$
(16)

So, the transformation function appears as:

$$g\left( {i,j} \right) = \frac{kGmean}{{\sigma \left( {i,j} \right) + b}}\left[ {f\left( {i,j} \right) - a \times Lmean\left( {i,j} \right)} \right]$$
(17)

The brightness level is maintained and preserved and mean and standard deviation are considered as statistical measures. Mean is a measure of average gray level in neighborhood and the standard deviation is a measure of contrast in that neighborhood. Using (16), contrast of the image is considered as local mean as the center of stretch. The GLC–CE process tends to spread the histogram components uniformly over the grayscale, preventing the histogram components from concentrating in particular locations on the grayscale.

Chen et al. proposed a gray-level grouping (GLG) method for an automatic method for optimizing an image by contrast enhancement [20]. The area of the background was considered which could be calculated automatically by summing the amplitudes of the histogram components of the background. The method separates the input image histogram into two parts based on input mean. After separation, each part is equalized independently. The low contrast image only was considered. The global methods have both over-enhancement and under-enhancement problems. Another problem is that it also enhances the noise in the input image along with the image features. Sometimes, the methods produce an undesirable checkerboard effects on enhanced mages. To overcome the above drawbacks, proposed GLC–CE method provides optimum contrast enhancement while preserving the local and global information of the input mammogram image. The most important property is that it can produce better results with proper tuning of α and \(\beta\) parameter in the following manner.

  1. (1)

    if α = 0 then local information has no contribution to texture enhancement.

  2. (2)

    if α ≤ 1 then order of the gray levels of the original image will be preserved. When \(\beta\) = 1, image texture can be enhanced to the utmost extent without change the original order.

  3. (3)

    If α > 1, greater the value α is, the stronger the enhancement. However, if \(\beta\) is too big, the order of gray levels of the original image could be changed considerably.

4.1 Comparison parameters

Statistical parameters used in present work for comparison are contrast improvement index (CII), signal to noise ratio (SNR) and root mean square error (RMSE). The CII is calculated as [2123];

$${\text{CII}} = \frac{{\text{C}}_{\rm enhanced}}{{\text{C}}_{\rm original}} ,$$
(18)

where both (numerator and denominator) are the contrast values for the enhanced and original images respectively. C is calculated as:

$$C = \frac{(f - b)}{(f + b)} ,$$
(19)

where f is the mean gray-level value of the image; b is the mean gray-level value of the background [7]. SNR is the statistical value to measure signal noise in an image by the ratio of the signal standard deviation to the noise standard deviation [24]. The expression of SNR is;

$${\text{SNR}} = 10log_{10} \left[ {\frac{{\mathop \sum \nolimits_{0}^{M - 1} \mathop \sum \nolimits_{0}^{N - 1} [r\left( {x,y} \right)]^{2} }}{{\mathop \sum \nolimits_{0}^{M - 1} \mathop \sum \nolimits_{0}^{N - 1} [r\left( {x,y} \right) - t(x,y)]^{2} }}} \right]$$
(20)

RMSE is used to measure the average magnitude of error in the enhanced image based on the original image. Lower the RMSE value indicates better enhancement [22].

$${\text{RMSE}} = \sqrt {\frac{1}{{\left( {M - 1} \right)(N - 1)}}\mathop \sum \limits_{0}^{M - 1} \mathop \sum \limits_{0}^{N - 1} [r\left( {x,y} \right) - t(x,y)]^{2} }$$
(21)

Performance of denoising algorithms is evaluated using the above parameters.

5 Experimental results

We have used an image database of mammograms developed by our research group in consultation with a senior radiologist. The name of image database is GRSDB (named after research group) which is a collection of medical images of different modalities collected from local hospitals where biopsy has been done on the patients.

Figure 2a shows the under exposed original image; we can see that the foreground subjects are dark and unclear due to the existence of the bright light in the mammographic breast cancer image. Chen et al. proposed a GLB method which is compared to our GLC–CE method shown in Fig. 2, where we can easily visualize their appearance. Figure 2(a) has low contrast and less structured view of breast images than Fig. 2b. We can preserve local and global enhancement with fine structure with enhancement parameter α and β which can be easily seen in Fig. 3. Enhanced images obtained using different enhancement parameter shown in Fig. 3c and d. Figure 3b shows an enhanced image without using enhancement parameter but Fig. 3c and e are enhanced images obtained with α = 0.4 and β = 0.3 respectively. These images are of high-contrast values and the average brightness has increased.

Fig. 2
figure 2

Comparison of GLC–CE with Chen et al. a Original image b GLB method c GLC–CE

Fig. 3
figure 3

Results of GLC–CE methods. a Original image. b Resulting image without using enhancement parameter. c Enhanced image with α = 0.4. d Enhanced image with α = 0.8. e Enhanced image with β = 0.3. f Enhanced image with β = 0.7

The different features are more visible and wider in enhanced images as compared with the original images. Figure 3d and f show the enhanced image with α = 0.8 and β = 0.7 respectively with better quality of the images. The interior detail of the mass is much more apparent and the bright and irregular details are probably clearer to visualize. For changing the enhancement parameter α, β and k in contrast enhancement function the results for breast cancer images contain smoother margins, enhanced, bright, irregularly shaped features are more apparent so that classification of masses as benign or malignant becomes easier. This helps in diagnosis process as the results are more accurate. Detection of abnormalities is effective using GLC–CE image enhancement technique in comparison with other enhancement techniques such as HE, GHE, LHE, AHE and CLAHE.

The assessment is made on the basis of subjective evaluation as well as statistical measurement using CII, SNR and RMSE as comparison parameters. Table 1 shows a comparison in which GLC–CE produces higher CII, SNR and RMSE values than the given methods.

Table 1 Comparison of different enhancement methods

The results of LHE and AHE have similar patterns with higher RMSE values. Based on CII values, GLC–CE is considered as better since contrast plays most important role in medical image analysis and diagnosis. Table 2 shows comparison for GLB with proposed GLC–CE method, where we can see better CII and SNR values, but we can get more contrast by tuning their enhancement parameter which is shown in Table 3. In Table 3 shows a comparison for different enhancement parameters α and β. GLC–CE has produced better enhancement results. CLAHE produces increased average brightness of the image and it creates some artifacts in the black regions. GLC–CE performs much better with different values of α and β. The user can change the value depending on requirement and therefore the implementation is more adaptive. With the increase of α and β, brightness increases which makes the edges sharper without introducing any artifacts. The algorithm gives enhanced CII which is used as index for radiologist to check the visibility of lesion in the mammography. Experiment results show that the proposed method has improved the contrast in the image of a breast tumor in breast images.

Table 2 Comparison for chen et al. with proposed GLC–CE method
Table 3 Comparison for varying values of α and β

6 Conclusions

We have proposed a gray level clustering and contrast enhancement (GLC–CE) techniques for preprocessing and enhancement of medical images. The breast mammograms were enhanced without any loss of image details. The method is simple and computationally effective. The proposed methods maintained the mean brightness while preserving the details of the image and do not produce any unwanted artifacts that occurred in conventional methods. Future work may aim at establishing the utility of the techniques by using receiver operating characteristic (ROC) that could be implemented in computer-aided diagnosis (CAD) system.