1 Introduction

The modification and transformation of images by digital computers is known as digital image processing. Over the past few decades, its use has grown enormously in many diverse areas, like medical imaging, remote sensing, and geological information. The images must be sampled and encoded into a matrix for further digital processing. Image processing includes image enhancement, image restoration, image analysis, compression, etc. Image enhancement is the process of improving the visual appearance and texture information of an image to make it suitable for human analysis. It has remarkable applications in the field of medical image processing, as the images acquired through different processes such as X-ray, ultrasound, and computer tomography, are not clear due to interference and have low intensity and contrast. This makes it difficult for the physicians to identify the exact disease and provide the correct treatment. Enhancement plays a leading role in those images that are affected by different kinds of noises in the acquisition process (Islam and Mondal 2019).

Despite the ongoing advancements in X-ray and MRI acquisition techniques, there remain some uncertainties about how human anatomy is depicted through these acquired images. These uncertainties cannot be tolerated in the area of medical image analysis. Therefore, it is crucial to consider the quality, details, and clarity of the images. Researchers have proposed many image enhancement strategies for different kinds of improvements in these images. Digital images, in contrast to traditional still pictures, feature intricate architecture and a multitude of modalities (Salem et al. 2019). Further, analysing and processing them require special manipulations to prevent data loss and retrieve vitiated details.

There are various enhancement techniques available in the literature, some of which include HE, fuzzy-based methods, morphological transformations, etc. The HE of an image is a non-linear stretch that redistributes the pixel values so as to expand the overall dynamic range of the image, resulting in improved contrast (Gonzalez and Woods 2002; Veluchamy and Subramani 2019). Some other techniques based on the histogram are proposed to overcome the shortcomings induced by HE, such as DHE (Rao 2020), CLAHE (Joseph and Periyasamy 2018), BBHE (Murahira et al. 2010), RHE, etc. The primary objective of an enhancement is to reveal fine features of an image, either by enhancing texture information or by enhancing contrast. As the medical images consist of uncertainties in various forms, such as the presence of noise, blurriness, and low contrast, we can effectively handle these situations using fuzzy approaches. Some authors have suggested using fuzzy-based techniques (Tizhoosh 2000; Veluchamy and Subramani 2020; Bloch 2015; Tizhoosh et al. 1997) like adaptive fuzzy-based DHE, fuzzy-based HE, and many more.

Fuzzy image processing consists generally of three steps: fuzzification (image coding), operations in the membership plane, and finally, defuzzification (decoding of results). Fuzzification implies that we assign the image (its grey levels) one or more membership values based on its properties, such as brightness and edginess. The literature has shown that Type I (Zarandi et al. 2011) fuzzy logic systems have difficulties in modelling and minimising the effect of uncertainties. One reason that limits the ability of Type I fuzzy sets to handle uncertainty is that the membership function for a particular input is a crisp value. Type II fuzzy sets are useful when there is uncertainty about a location, shape, or another parameter, computed in terms of membership function. To show a better representation of uncertainty, the third dimension is introduced in Type II fuzzy sets, representing more degrees of freedom. Type II fuzzy set is obtained by blurring Type-1 fuzzy set, and the points lying in the blurred region consist of membership function values of Type-1 fuzzy sets. This paper presents an approach based on a Type II fuzzy set for enhancing the contrast of an image. The details of the abbreviations that are used in the paper are depicted in Table 1.

Table 1 List of abbreviations

2 Related work

For the contrast enhancement of an image, numerous methods (Gonzalez and Woods 2002; Veluchamy and Subramani 2019; Rao 2020; Joseph and Periyasamy 2018; Murahira et al. 2010; Li and Xie 2016; Xiao et al. 2016; Wadhwa and Bhardwaj 2021) have been discussed in the literature. HE (Gonzalez and Woods 2002; Soundrapandiyan et al. 2022; Khan et al. 2014) is considered the oldest method and a benchmark algorithm for enhancing image contrast. It is based on the presumption that a uniformly distributed grayscale histogram will have the best visual contrast. This method is widely used for comparison with various other techniques as it is simple and effective, but it has certain drawbacks as it induces over-enhancement in an image. Based on the same proposition, BBHE (Tang and Isa 2017) is introduced to preserve the brightness of the output images. In BBHE, images are sub-divided using the mean intensity value, and HE is applied individually to each region. Although it preserves brightness, it causes over-enhancement in some areas. To overcome the problems with BBHE, some other techniques came into existence, such as RHE (Chen and Ramli 2003), BPDHE (Ibrahim and Kong 2007), and CLAHE. In CLAHE, an image is sub-divided into non-overlapping blocks, and the histogram of each region is computed individually using an arbitrary clip limit. The above techniques may result in over-brightness and contrast improvement as they flatten the histogram of an image, which leads to the loss of brightness-sensitive features of an image. To overcome these shortcomings, Gandhamal et al. (2017) et al. developed a gray-level S-curve transformation technique based on the pixel-to-pixel transformation. The S-curve works by increasing the difference between the maximum and minimum intensities of an image, globally and locally, by increasing the gradient magnitude of the image. The increased gap between the intensity values provides more clarity in identifying edges in different regions of an image, which gives better contrast enhancement.

The techniques discussed above do not consider the vagueness present in the intensity of an image. Therefore, to work out the limitations of these techniques, researchers proposed fuzzy-based methods. Initially, fuzzy theory was introduced by Zadeh (1965) in 1965 in his paper that considers the imprecision of the grey levels of the image. One of the important applications of fuzzy theory has been observed in image processing, as medical images consider uncertainties in the form of vague contrast or poorly illuminated images, which make it difficult to segment the affected parts from the normal regions of an image. Imprecision in an image occurs due to certain reasons, such as vague bounds between structures and objects, filtering processes, or during the acquisition process (limited resolution). Fuzzy sets could be used to exploit such imprecisions. A fuzzy approach provides a suitable framework for the development of new algorithms, as discussed by Tizhoosh (1998). Many researchers merged the concept of fuzzy sets with other conventional techniques such as HE to develop improved methods for better contrast enhancement. Raju and Nair (2014) introduced fuzzy logic and a histogram-based method to upgrade the contrast of RGB images by stretching the intensity component of the image that was based mainly on two parameters, i.e., the average intensity \((M)\) for clipping the histogram into two classes and then fuzzifying the pixel values related to each class by applying the contrast intensification \((K)\) parameter.

Subramani and Veluchamy (2018) developed the fuzzy-based AHE technique to avoid the noisy artefacts and over-enhancement of certain regions caused by image histogram equalization. The authors have used the method of brightness-preserving adaptive fuzzy HE (AFHE) without clipping an image's histogram to preserve brightness and improve image naturalness. The fuzzy methods discussed above was based on Type I fuzzy set whose membership function is considered as a crisp value. These membership functions could be fuzzified further to achieve the extended version of the Type I fuzzy set introduced by Zadeh. Type II fuzzy membership function can be obtained by fuzzifying the membership grade for each element as a fuzzy set in the interval \([0, 1]\). In the literature, work has been done using Type II fuzzy sets for medical image enhancement because they provide an additional degree of freedom in fuzzy logic systems and are very useful in medical images because they contain uncertainty in the form of blurred edges between objects and background or poor illumination of the images. Chaira (2014) proposed an interval-based Type II fuzzy theory for the contrast improvement of an image. Type II fuzzy sets consider uncertainty in the membership function and can be obtained using Type I membership functions. The method was applied to medical datasets, resulting in improved image contrast, and it was later used for image segmentation of abnormal regions. Bora and Thakur (2018) applied a Type II fuzzy set with an improved membership function to reduce the level of fuzziness and enhance the contrast of images acquired from medical morphologies.

Regardless of the many factors that lead to the deterioration of medical images, including insufficient contrast, low brightness, noise, and blurred edges, the present work focuses on the elements that are primarily accountable for the inadequate performance of computer-aided medical diagnosis systems. Some of the existing techniques suffer from over-enhancing brightness and contrast, which leads to the loss of sensitive features in the medical images. The techniques mentioned earlier have proven to be effective in enhancing medical images to a certain extent. However, it is important to note that none of these techniques have undergone evaluation on images acquired through different medical imaging modalities. It is worth mentioning that some of these techniques may result in an undesired increase in brightness and an overly enhanced contrast. This can occur due to the stretching of the histogram in an image, as seen in the case of AFHE. Additionally, there is no specific criterion available for choosing the optimal value for parameter (contrast intensification) \(K\). In addition, it is important to highlight that Chaira's method is more effective for specific datasets rather than generalizable to all other medical datasets.

We have used the suggested technique in conjunction with a precisely calibrated value of the parameter \(\alpha \) lying in \([0, 1]\) to overcome these limitations. This enables the regulation of the degree of contrast enhancement in an image, which has been validated and verified across a diverse range of medical datasets. The aim of this paper is to introduce a methodology for enhancing contrast, employing a new membership function using Type II fuzzy sets. Through the modification of the Type I fuzzy membership grade via the application of parameter α, we aim to achieve a better degree of contrast enhancement in medical images. A concise description of some existing techniques is provided in Table 2, along with their corresponding formulas and performance metrics.

Table 2 Existing techniques for image contrast enhancement

2.1 Motivation and contribution

A number of techniques have been suggested in the literature to deal with the problem of conveying important information clearly in images, especially in medical imaging. Medical images are essential for assessing the patient's health and determining the most effective course of therapy. Due to poor illumination, these medical images become more difficult to evaluate and analyse, resulting in low-contrast images. The advancement of image processing methods, including image analysis, identification, and enhancement has sped up the development of medical imaging. The improved images aid in the accurate detection of disorders that occur in the health of a patient.

The motivation to carry out the present study is to design, develop, and implement a Type II fuzzy image processing system to overcome various factors contributing to the degradation of medical images, such as low contrast, vague boundaries, insufficient brightness, etc. Medical images that include a great deal of ambiguity and uncertainty become a challenge to handle using Type-I fuzzy sets. These fuzzy set's crisp membership functions prevent them from directly modelling such uncertainty, whereas Type-II fuzzy sets membership functions are themselves fuzzy and useful to represent this uncertainty. The following are the main contributions of the study:

  • Interval-based Type II fuzzy set membership function along with the Hamacher T-conorm operator have been used for the contrast enhancement of medical images.

  • Experiments have been done to figure out what the best value of the parameter alpha is for finding an image with good contrast.

  • The average values with the standard deviation of all the performance metrics have been computed for each dataset.

  • The average processing time for each dataset supports the efficacy of the proposed technique.

  • For the subjective evaluation, the MOS has been evaluated for six sampled images with the help of medical experts.

This paper is organised as follows: Sect. 2 provides a brief discussion about Type I and Type II fuzzy sets along with the types of aggregation operator. Section 3 discusses the proposed techniques and its implementation. Section 4 contributes to the results and discussions for the performance metrics and consecutive Sect. 5 outlines the conclusion and future study.

3 Fuzzy definitions and related terms

A fuzzy set is characterised by a membership function that assigns to each element a degree of belongingness given by the membership function and is denoted by the set of ordered pairs.

$$ F = \left\{ {x, \mu \left( x \right){|} x \epsilon U} \right\}, \mu :U \to \left[ {0,1} \right]. $$
(1)

The large value of membership degree in the interval \([0, 1]\) indicates more belongingness. Type I FLS has a crisp membership grade, whereas Type II FLS, defined as Eq. (2), has a fuzzy membership grade. A Type II fuzzy set is obtained by blurring a Type I fuzzy set, and the points lying in the blurred region consist of membership values of Type I fuzzy sets.

$$ \tilde{A} = \left\{ {\left( {\left( {x,\mu } \right), \mu_{{\tilde{A}}} \left( {x,\mu } \right)} \right){|}\forall x\epsilon X \,{\text{and}}\, \mu \epsilon \left[ {0,1} \right]} \right\}. $$
(2)

The blurred region is known as the Footprint of Uncertainty (FOU), which is bounded by the upper and lower membership functions of a Type II fuzzy set, which is an interval-based fuzzy set. So, Eq. (2) can be modified as

$$ \tilde{A} = \left\{ {\left( {\left( {x,\mu } \right), \mu_{{\hat{U}}} \left( {x,\mu } \right), \mu_{{\hat{L}}} \left( {x,\mu } \right)} \right){|}\forall x\epsilon X \, {\text{and}} \, \mu \epsilon \left[ {0,1} \right]} \right\}, $$
(3)

where, \({\mu }_{\widehat{U}}\left(x,\mu \right)\) and \({\mu }_{\widehat{L}}\left(x,\mu \right)\) are the upper and lower membership values of interval-based Type II fuzzy sets and are computed using membership values obtained from Type I fuzzy sets.

3.1 Fuzzy operators

A fuzzy set is an extension of ordinary sets, as it defines a grade of membership with respect to each element rather than assigning a crisp value. The mathematical operators available in ordinary set theory, such as union, intersection, and complement, can be dilated in fuzzy set theory. In fuzzy theory, the generalised union and intersection operators are known as triangular conorms and triangular norms, respectively. These are the binary operators defined on the unit interval \(\left[\mathrm{0,1}\right]\) that combine two fuzzy sets to produce another fuzzy set i.e., a function from \(T:\left[\mathrm{0,1}\right]\times \left[\mathrm{0,1}\right]\to [\mathrm{0,1}]\) satisfying certain conditions (Butnariu and Klement 2002; Boixader and Recasens 2022). T-norms and T-conorms are duals of each other, as one can be obtained from the other. In the literature, many T-norms and T-conorms are available, and some of them are introduced by the researchers Hamacher (Tang et al. 2017), Dombi, Einstein, Weber, etc. This section briefly discusses some of the T-norms and T-conorms introduced in the literature.a. Dombi T-norm \((D\left(x,y\right))\) and T-conorm \(({D}^{\prime}\left(x,y\right))\) are given by the expressions below, and \(\lambda >0\) and \(\left(x,y\right) \epsilon [\mathrm{0,1}]\).

$$ D\left( {x,y} \right) = \frac{1}{{1 + \left( {\left( {\frac{1}{x} - 1} \right)^{\lambda } + \left( {\frac{1}{y} - 1} \right)^{\lambda } } \right)^{{\frac{1}{\lambda }}} }}, $$
(4)
$$ D^{\prime}\left( {x,y} \right) = \frac{1}{{1 + \left( {\left( {\frac{1}{x} - 1} \right)^{ - \lambda } + \left( {\frac{1}{y} - 1} \right)^{ - \lambda } } \right)^{{\frac{ - 1}{\lambda }}} }}. $$
(5)

b. Sugeno-Weber defined the T-norm and T-conorm as in Eqs. (6) and (7), respectively.

$$ SW\left( {x,y} \right) = \max \left( {0,\;\left( {1 - \lambda } \right)\;xy + \lambda (x + y - 1)} \right)\;, $$
(6)
$$ SW^{\prime}\left( {x,y} \right) = 1 - S.W\left( {1 - x,\;1 - y} \right) $$
(7)

c. Hamacher suggested the following T-norm and T-conorm as

$$ H\left( {x,y} \right) = \frac{xy}{{\lambda + \left( {1 - \lambda } \right) \left( {x + y - xy} \right)}} $$
(8)
$$ H^{\prime}\left( {x,y} \right) = \frac{{x + y - xy - \left( {1 - \lambda } \right)xy}}{{1 - \left( {1 - \lambda } \right)xy}}. $$
(9)

T-norm \((H\left(x,y\right))\) and T-conorm \({(H}^{\prime}\left(x,y\right))\) are also called Hamacher product and Hamacher sum and can be reduced to algebraic T-norm and T-conorm when \(\lambda =1\). In this paper, the proposed method uses Hamacher's T-norm and T-conorm to find the enhanced Type II fuzzy membership function.

4 Proposed methodology

This section describes the details of the proposed technique. Here, the concept of a new membership function using a Type II fuzzy set is presented. The operator used to form the enhanced membership function is Hamacher T-conorm, as given in Eq. (9). The steps for the implementation of the proposed algorithm to obtain the enhanced image from an input image are also depicted in detail.

5 Generation of type II fuzzy membership function

An image \((I)\) of size \(m\times n\) can be fuzzified using the Type I (Classical) fuzzy set using the membership function given as

$$ \mu \left( {I_{uv} } \right) = \frac{{I_{uv} - I_{\min } }}{{\left( {1 - I_{\min } } \right) + I_{\max } }}, u = 1 \ldots m, \;v = 1 \ldots n, $$
(10)

where \({I}_{uv}\) is the intensity of grey level of an image ranging from \((0-255)\) and \({I}_{{\text{max}}}\), \({I}_{{\text{min}}}\) are the maximum and the minimum intensity value of the image \((I)\), respectively. Each \({I}_{uv}\) is associated with a membership value \(\mu \left({I}_{uv}\right)\) which represents the fuzziness of a pixel at a location \((u,v)\). In a fuzzy set, the membership function defines the inclusiveness of the elements in that specific set with some grade value.

As a parameter of fuzziness, the membership function itself cannot be considered a crisp value, as observed by Zadeh (1965), and can be further fuzzified into a Type II fuzzy set. Using an interval-based Type II fuzzy set, the upper (\({\mu }_{u}\)) and lower (\({\mu }_{l}\)) membership function have been evaluated Eqs. (11) and (12)

$$ \mu_{u} \left( {I_{uv} } \right) = \mu \left( {I_{uv} } \right)^{{\left( {1 - \alpha^{2} } \right)}} , $$
(11)
$$ \mu_{l} \left( {I_{uv} } \right) = \mu \left( {I_{uv} } \right)^{{\left( {\frac{1}{{\alpha^{2} }}} \right)}} , $$
(12)

where \(\alpha \) is an arbitrary constant and \(0<\alpha <1\).

The region obtained by fuzzifying the Type I membership function using interval-based Type II fuzzy is the FOU. In this region, each membership value in the Type I fuzzy set has an interval and can be viewed as a three-dimensional plane.

Equation (13) yields the enhanced image corresponding to the input image using the Type II fuzzy membership function and the aggregation operator Hamacher T co-norm as

$$ I_{e} = \mu_{en} \left( {I_{uv} } \right)\left( {1 - I_{\min } + I_{\max } } \right) + I_{\min } , $$
(13)

where \({\mu }_{en}\) represents the enhanced membership function and is computed using Eq. (14) as

$$ \mu_{en} \left( {I_{uv} } \right) = \frac{{\mu_{u} \left( {I_{uv} } \right) + \mu_{l} \left( {I_{uv} } \right) + \left( {\lambda - 2} \right) \mu_{u} \left( {I_{uv} } \right) \mu_{l} \left( {I_{uv} } \right)}}{{1 - \left( {1 - \lambda } \right) \mu_{u} \left( {I_{uv} } \right) \mu_{l} \left( {I_{uv} } \right)}}. $$
(14)

5.1 Algorithm steps

  1. 1.

    Consider a greyscale image \((I)\) of size \(512\times 512\).

  2. 2.

    Find the minimum and maximum values of the greyscale image obtained in step1.

  3. 3.

    Construct the Type I fuzzy membership function for each pixel values using Eq. (10) and the computed values.

  4. 4.

    Further, create upper \(\left({\mu }_{u}\left({I}_{uv}\right)\right)\) and lower membership \(\left({\mu }_{l}\left({I}_{uv}\right)\right)\) function for each pixel using Eqs. (11) and (12) for Type I membership function and parameter \(\alpha \).

  5. 5.

    Compute the average value \((\lambda )\) of the input image \((I)\) and obtain the Type II fuzzy enhanced membership function for each pixel using Hamacher T-conorm given in Eq. (9).

  6. 6.

    Finally, apply Eq. (13) to procure the Type II fuzzy enhanced image \(\left({I}_{e}\right)\) corresponding to the input image.

6 Pseudo-code of the proposed algorithm

figure a

7 Results and discussion

The dataset consists of medical images taken from different sources (Gandhamal et al. 2017; Minaee et al. 2020; https://www.kaggle.com/datasets/navoneel/brain-mri-images-for-brain-tumor-detection?resource=download) and has been employed to measure the performance and effectiveness of the newly developed approach. For experimental work, the medical image dataset includes 150 images, comprising ultrasound, X-ray, and MRI brain scan of size\(512\times 512\).

The proposed contrast enhancement technique is applied and tested on various medical images called as test images consisting of brain MRI scans, chest X-ray and ultrasound to examine its performance. The present technique is implemented on 50 MRI scans, 50 X-ray images and 50 ultrasound images of size \(512\times 512\). The proposed technique is compared to some benchmark techniques such as HE and CLAHE, as well as some cutting-edge techniques such as Gandhamal et al. (2017) and Chaira (2014). For brevity, the results are shown for 15 (test) images taken from each of the datasets from different medical modalities.

In this experiment, the values of the performance metrics such as AMBE, PSNR, REC, SSIM, PL measure, and entropy for the range of values of \(\alpha \) from \(0.1\) to \(0.7\) are shown in Tables 3, 4, 5, 6, 7 and 8. Here, it has been observed that with the increment in the value of the parameter \(\alpha \), the results are not satisfactory except in the case of the PL measure for X-ray images. Tables 3, 4, 5, 6, 7 and 8 also depict that the value of the parameter \(\alpha \ge 0.2\) does not provide satisfactory results. Due to these experimental results, we confine the values of the parameter \(\alpha \) to the interval \([0.1, 0.18]\) with a step size of \(0.02\) and study the variation in the values of the performance metrics for quantitative analysis. It has been observed that the numerical values obtained for \(\alpha \epsilon [0.1, 0.18]\)  are better for all the quantitative metrics AMBE, PSNR, REC, SSIM, PL measure, and entropy as shown in Tables 9, 10, 11, 12, 13 and 14. So, we use this range of \(\alpha \) and compare the results of the benchmark and state-of-the-art techniques in terms of these performance metrics. The best results are shown with boldface letters in Tables 3 to 18.

Table 3 Experimental results of AMBE for \(\alpha \epsilon [0.1, 0.7]\) corresponding to test images
Table 4 Experimental results of PSNR for \(\alpha \epsilon [0.1, 0.7]\) corresponding to test images
Table 5 Experimental results of REC for \(\alpha \epsilon [0.1, 0.7]\) corresponding to test images
Table 6 Experimental results of SSIM for \(\alpha \epsilon [0.1, 0.7]\) corresponding to test images
Table 7 Experimental results of PL measure for \(\alpha \epsilon [0.1, 0.7]\) corresponding to test images
Table 8 Experimental results of entropy for \(\alpha \epsilon [0.1, 0.7]\) corresponding to test images
Table 9 Experimental results of AMBE for \(\alpha \epsilon [0.1, 0.18]\) corresponding to test images
Table 10 Experimental results of PSNR for \(\alpha \epsilon [0.1, 0.18]\) corresponding to test images
Table 11 Experimental results of REC for \(\alpha \epsilon [0.1, 0.18]\) corresponding to test images.
Table 12 Experimental results of SSIM for \(\alpha \epsilon [0.1, 0.18]\) corresponding to test images
Table 13 Experimental results of PL measure for \(\alpha \epsilon [0.1, 0.18]\) corresponding to test images
Table 14 Experimental results of entropy for \(\alpha \epsilon [0.1, 0.18]\) corresponding to test images

7.1 Quantitative analysis

The evaluation of the performance of the proposed Type II fuzzy set technique is measured in terms of six statistical metrics such as AMBE, PSNR, REC, SSIM, entropy, and PL measure to quantify the amount of fuzziness present in an image. These measures are used to assess the quality of the enhanced image and have been computed using the input (original) image and the output (enhanced) image.

AMBE It is defined as the mean brightness difference between the original image and the enhanced image. This metric measures the degree of luminance distortion caused by the enhancement. Lower AMBE values indicate better preservation of the brightness in an image.

$$ {\text{AMBE}} = \left| {\mu_{O} - \mu_{E} } \right|, $$
(15)

where \({\mu }_{O}\), \({\mu }_{E}\) are the expected value of the original \((O)\) and the enhanced image \((E)\).

The AMBE values of test images for the proposed method are represented in Tables 3 and 9 corresponding to different ranges of parameter \(\alpha \). From Table 3, it is noted that the AMBE value increases with an increase in the value of \(\alpha \) resulting in over brightness of the output image, whereas in Table 9, the AMBE values are better as the value of the parameter decreases and the best value is reached for \(\alpha =0.1.\) The comparative results of AMBE with other techniques are depicted in Fig. 1. As illustrated in this figure, the values obtained by the intended technique are better for the enhanced image than the other techniques; the low value of AMBE indicates that the output image retains the naturalness of the original image.

Fig. 1
figure 1

Comparison of proposed method in terms of AMBE with state-of-the-art methods

PSNR It measures the reduction in the noise level of an image and is used to examine the quality difference between the input and the output image. The higher value of PSNR indicates less distortion in the quality of the input image.

$${\text{PSNR}}=10{{\text{log}}}_{10} \left[\frac{{255}^{2}}{\sum_{u}\sum_{v}{\left|O\left(u,v\right)-E\left(u,v\right)\right|}^{2} }\right]$$
(16)

where \(O\) and \(E\) are the input and the output images, respectively, and \(u=1 ,..., 255, v=1 ,...,255\).

The PSNR values obtained for \(\alpha \epsilon [0.1, 0.7]\) is shown in Table 4 and it is observed that for \(\alpha \ge 0.5\), the values decrease as the noise in the image increases. The value of PSNR for the enhanced image corresponding to the given dataset for required values of \(\alpha \) is given in Table 10, which is significantly good as compared with other techniques such as HE, CLAHE, Gandhamal et al. (2017), and Chaira (2014). The comparison of PSNR with these techniques is demonstrated in Fig. 2. The increased value of PSNR illustrates better clarity in the enhanced image by reducing the noise content.

Fig. 2
figure 2

Comparison of proposed method in terms of PSNR with state-of-the-art methods

REC It is used to quantify the improvement in the contrast of an image by adjusting the relative brightness and darkness of objects in the image to provide better visibility. It is computed using Eq. (17), which is the ratio of contrast between the input image and the output image.

$$ {\text{REC}} = \frac{{C_{O} }}{{C_{E} }}, $$
(17)

where

$$ C_{O} = 20\log 10 \left[ {\frac{1}{mn}\mathop \sum \limits_{u = 1}^{m} \mathop \sum \limits_{v = 1}^{n} \left( {O\left( {u,v} \right)^{2} - \left( {\frac{1}{mn}\mathop \sum \limits_{u = 1}^{m} \mathop \sum \limits_{v = 1}^{n} O\left( {u,v} \right)} \right)^{2} } \right)} \right], $$
(18)

and \({C}_{E}\) is the contrast of the enhanced image computed using Eq. (18).

The values recorded in Table 5 signifies that the REC values for ultrasound and MRI images tends to decrease for \(\alpha \ge 0.6\) due to loss of detailed features in an image. As observed from the numerical values of REC given in Table 11, it is clear that the proposed technique has good contrast as the obtained values are closer to 1. The proposed technique has been compared with other techniques using this metric, which is represented in Fig. 3. It has been observed that REC values for the proposed technique are better in comparison with HE, CLAHE, Chaira (2014), and Gandhamal et al. (2017).

Fig. 3
figure 3

Comparison of proposed method in terms of REC with state-of-the-art methods

SSIM It is used to measure the similarity between the original and the output image. It measures the change in structural information based on luminance, structure, and contrast.

$${\text{SSIM}}= \frac{\left(2 {\mu }_{O} {\mu }_{E}+ {k}_{1}\right)\left(2 {\sigma }_{OE}+ {k}_{2}\right)}{\left({{\mu }_{O}}^{2}+{{\mu }_{E}}^{2}+ {k}_{1}\right) ({{\sigma }_{O}}^{2}+ {{\sigma }_{E}}^{2}+ {k}_{2})},$$
(19)

where \({\mu }_{O}\) and \({\mu }_{E}\) are the average values of the pixels of original and enhanced image, respectively, and \({\sigma }_{OE}\) represents the correlation coefficient of \(O\) and \(E\); \({k}_{1}\) and \({k}_{2}\) are the constants to stabilize the equation. The SSIM value lies in the range of 0 to 1, and values closer to 1 represent less distortion between the objects in an image, thus preserving the original features in an enhanced image.

It is observed from Table 6 that the value of SSIM decreases as the value of \(\alpha \) increases from \(0.1\) to \(0.7\), resulting in loss of features in the image due to over brightness. For \(\alpha \epsilon [0.1, 0.18]\), the values of SSIM corresponding to 15 images consisting of X-ray, ultrasound, and MRI are observed to be approximately equal to 1, as shown in Table 12. This depicts that the proposed technique performs better in the chosen interval for the parameter \(\alpha \). Also, the proposed technique outperforms other techniques, as seen in Fig. 4, resulting in better preservation of image features in the enhanced image.

Fig. 4
figure 4

Comparison of proposed method in terms of SSIM with state-of-the-art methods

PL measure It is defined as the ratio of PSNR to the linear fuzziness index, as shown below.

$$ {\text{PL}} = \frac{{{\text{PSNR}}}}{\gamma }, $$
(20)

where \(\gamma \) is the linear index of fuzziness used to measure the amount of fuzziness present in an enhanced image and is computed as

$$ \gamma = \frac{2}{mn} \mathop \sum \limits_{u = 1}^{m} \mathop \sum \limits_{v = 1}^{n} \min \left\{ {\mu_{en} \left( {I_{uv} } \right), 1 - \mu_{en} \left( {I_{uv} } \right)} \right\} , $$
(21)

where \({\mu }_{uv}\) is the membership function of the output image and is calculated using Eq. (14). The higher value of the PL measure signifies better clarity in the enhanced image. The computed results corresponding to test images are presented in Table 7. It has been observed that for \(\alpha \le 0.5\), the value of PL decreases, whereas for \(\alpha >0.5\), the value of PL increases but the visual quality of the enhanced image has been compromised. Figure 5 shows the comparison of the suggested technique with Chaira (2014), Gandhamal et al. (2017), HE, and CLAHE using this metric. The values obtained for the proposed technique are better as compared with other techniques, except for the values computed for X-ray images using Chaira.

Fig. 5
figure 5

Comparison of proposed method in terms of PL measure with state-of-the-art methods

Entropy This metric determines the average information content present in an image and was introduced by Shannon. A higher value of entropy signifies more information contained in an image and is given as

$${\text{Entropy}}=-\sum_{k}p\left(k\right){{\text{log}}}_{2}\left(p\left(k\right)\right),$$
(22)

where \(p\left(k\right)\) is the probability of occurrence of intensity levels from 0 to 255 and is defined as \(p\left(k\right)=n(k)/N\), \(k\in \left[0, 255\right]\) and \(N\) is the total number of pixels. This evaluation parameter signifies the improvement in details of the enhanced images when compared with the original images. The entropy of the image is gradually decreasing due to the decrease in the value of \(\alpha \), as given in Table 8, which signifies that the image is liable to forfeit its naturalness. So, a suitable range of \(\alpha \in \left[0.1, 0.18\right]\) is considered, and from Table 14, it has been observed that entropy values are better for this range. In contrast to the HE, Chaira (2014), and Gandhamal et al. (2017) the proposed enhancement technique retains and intensifies the information content in an image, as shown in Fig. 6. The best value for entropy has been observed in CLAHE but the visual quality of the image has been compromised due to over enhancement.

Fig. 6
figure 6

Comparison of proposed method in terms of Entropy with state-of-the-art methods

The intended enhancement technique is compared with other cutting-edge techniques to evaluate its performance using performance metrics. The experimental results for the evaluation of the proposed scheme have been carried out using MATLAB (2016) software. From three different datasets of 50 medical images each, the average values with standard deviation of all the performance metrics for the proposed and the state-of-the-art techniques are depicted in Tables 15, 16 and 17. From this table, it is concluded that the results obtained using the proposed technique are better than the state-of-the-art methods for almost all the metrics, except for some cases where the results are satisfactory (such as REC value obtained for M2 and M3). This signifies that the suggested approach offers a higher level of contrast enhancement and feature retention than HE, Gandhamal et al. (2017), Chaira (2014) and CLAHE. The suggested technique has obtained lower average AMBE values and higher SSIM values than the aforementioned techniques. This implies that the proposed enhancement technique outperforms the techniques available in the literature in terms of quantitative analysis. The proposed technique can be used to improve the contrast of medical images, which will help doctors give patients the right treatment based on a correct diagnosis.

Table 15 The mean and standard deviation of the performance metrics obtained for ultrasound images using various techniques
Table 16 The mean and standard deviation of the performance metrics obtained for MRI images using various techniques
Table 17 The mean and standard deviation of the performance metrics obtained for X-ray images using various techniques

7.2 Qualitative assessment

The proposed technique is applied to 150 medical images, comprising 50 images from each of the medical modalities such as MRI scans, X-ray, and ultrasound images. For brevity, the results are presented for 15 medical images to examine the visual quality and appearance of the enhanced images using the proposed technique. The effectiveness of the proposed approach in terms of qualitative analysis has been determined on the basis of visual appearance of the enhanced images. The proposed technique is compared with Chaira (2014), Gandhamal et al. (2017), HE, and CLAHE and is represented in Figs. 11, 12 and 13. The results of medical images acquired using the suggested approach are better in terms of visual appearance, preserve the original image features, and reduce the brightness level due to over-contrast enhancement as observed in techniques such as HE and CLAHE.

Figures 7, 8 and 9 present the results of the enhanced images for different values of \(\alpha \epsilon [0.1, 0.7]\) corresponding to the values given in Tables 3, 4, 5, 6, 7 and 8, using proposed technique. These figures represent that with the increment in the value of \(\alpha \), there is over brightness induced resulting in the loss of image features thus providing reduce information content in an image. Therefore, to overcome these issues, the value of the parameter has been confined to the interval \([0.1, 0.18]\) to preserve the naturalness of the enhanced image.

Fig. 7
figure 7

a Original X-ray image (X_I1), enhanced images (b–h) for \({\alpha }=0.1\), 0.2, 0.3, 0.4, 0.5, 0.6, 0.7

Fig. 8
figure 8

a Original MRI image (M_I1), enhanced images (b–h) for \({\alpha }=0.1\), 0.2, 0.3, 0.4, 0.5, 0.6, 0.7

Fig. 9
figure 9

a Original ultrasound image (U_I1), enhanced images (b–h) for \({\alpha }=0.1\), 0.2, 0.3, 0.4, 0.5, 0.6, 0.7

Figure 10 depicts the original test images corresponding to each dataset used for experimental purposes. For sake of brevity, only four test images are considered from each medical modality.

Fig. 10
figure 10

Original images, X-ray (a–d), ultrasound (e–h), MRI (i–l)

Figures 11, 12 and 13 represent the visual comparison of the enhanced images among the proposed and state-of-the-art techniques for test images considered from various medical modalities. Figure 11 presents the qualitative experimental results for X-ray images. It is clearly evident here in Fig. 11a–d that the proposed technique provides better quality to the enhanced image and retains original image features as compared with HE shown in Fig. 11m–p. As we go from Fig. 11m–p, the problem of over enhancement exists near the chest region, which results in the loss of image features. Enhancement results obtained using Chaira (2014), Gandhamal et al. (2017), and CLAHE are presented in Fig. 11e–h, i–l, and q–t, respectively. Chaira (2014) produces a washed-out effect on the images, making them unclear (the spinal cord is not visible properly), and Gandhamal et al. (2017) induces darkness in the image, due to which some areas are poorly visible, resulting in the loss of image-sensitive features. Although CLAHE performs better than HE, some features are compromised due to over-enhancement in certain areas of the image when compared with the proposed technique. The proposed technique offers better visual appearance and clarity. Figure 13 shows the evaluated results that are obtained for ultrasound test images using proposed as well as state-of-the-art techniques. Here, it is again visible, as in the cases of Figs. 11 and 12, that the proposed technique retains the features of the original image, while Chaira (2014) produces blurred and distorted images as in Fig. 13e–h. The results obtained using Gandhamal et al. (2017) have darker regions, resulting in a loss of originality, as depicted in Fig. 13i–l. The results obtained using HE (Fig. 13m–p) and CLAHE (Fig. 13q–t) are also the same as earlier and are found to be not very satisfactory in comparison to the proposed technique (Fig. 13a–d). CLAHE induces over-enhancement in certain images. It is also clear that the results of the proposed method reduce blurriness while keeping the original image's details and brightness.

Fig. 11
figure 11

Enhanced X-ray images obtained using state-of-the-art techniques

Fig. 12
figure 12

Enhanced MRI images obtained using state-of-the-art techniques

Fig. 13
figure 13

Enhanced ultrasound images obtained using state-of-the-art techniques

The MOS, which is the result of the six members' ratings on a five-point scale and includes senior technicians and medical experts, has supported the qualitative evaluation of the enhanced images. The results of MOS for the proposed technique and other state-of-the-art techniques have been presented in Fig. 14. This figure clearly depicts that the proposed technique performs better in almost all cases.

Fig. 14
figure 14

MOS values for various techniques corresponding to enhanced images from each dataset

Table 18 represents the average processing time (seconds) recorded for the proposed technique and state-of-the-art techniques for each data set. The values obtained indicate that the proposed technique performs better as compared to Gandhamal (Gandhamal et al. 2017), HE, and CLAHE, while it underperforms Chaira (Chaira 2014).

Table 18 Average computation time recorded for various techniques

8 Conclusions and future scope

The enhancement of an image is considered an integral part of the field of medical imaging. Medical images are acquired from various sources and consist of noise, low visibility, and reduced brightness, resulting in poor detection of significant information that may lead to improper treatment of the disease. The proposed technique enhances the contrast of an image using a Type II fuzzy membership function that considers the uncertainty present in medical images. Fuzzing Type I membership functions yields Type II fuzzy membership functions. The proposed technique's performance and efficiency are compared to the existing techniques Chaira (2014), Gandhamal et al. (2017), HE, and CLAHE in terms of six statistical parameters: AMBE, PSNR, REC, SSIM, PL measure, and Entropy. The results evaluated for average values with standard deviation for all the datasets bear witness to the performance of the proposed technique as given in Tables 15, 16 and 17. The proposed technique performs better as compared with other methods, as observed from the subjective and quantitative assessments. The proposed approach preserves the image features, provides better clarity, and reduces noise and blurriness, as supported by the numerical values of the performance metrics. The results obtained in terms of MOS and processing time are also evident of the efficient performance of the proposed technique. Figure 14 shows very clearly that the subjective evaluation using MOS is better in almost all cases. It is clear from Table 18 that the values obtained indicate that the proposed technique performs better as compared to Gandhamal et al. (2017), HE, and CLAHE, while it underperforms Chaira (2014). The developed method is useful for medical professionals and experts in the determination of correct treatment and diagnosis of the disease, as the method provides better visual appearance and improved contrast. The proposed method has a limitation, which is the occurrence of over-enhancing when the value of \(\alpha \) is higher. To address this, we have restricted the alpha values to a range of \([0.1, 0.18].\) In future work, the proposed technique can be merged with other enhancement techniques to improve the contrast of these medical images. The proposed enhancement algorithm can be used as a pre-processing tool for segmentation of medical images.