Acessibilidade / Reportar erro

Fuzzy Divergence for Lung Radiography Image Enhancement

ABSTRACT

Segmentation is one of the inferential applications for detecting patterns in digital images, which has been widely used in the health area. Thresholding, a type of segmentation, consists of separating the gray groups of an image, through one or more thresholds applied to the histogram. Thus, we used the gray tone with the lowest Fuzzy Divergence found to apply the enhancement method, through membership values. This paper presents a method to assist physicians in interpreting lung radiography images, especially in the pandemic caused by COVID-19, when enhancing lung images. In addition, we consulted with a group of medical experts who saw an improvement in image quality, providing the perception of detail in the enhanced image compared to the original image.

Keywords:
image enhancement; fuzzy divergence; covid-19

1 INTRODUCTION

Image segmentation is one of the inferential applications for pattern detection, mainly in the health area, as it becomes important in diagnostic analysis, is widely used for image treatment in tomography 1111 N.A. Memon, A.M. Mirza & S.A.M. Gilani. A Segmentation of Lungs from CT Scan Images for Early Diagnosis of Lung Cancer. International Journal of Medical and Health Sciences, 2(8) (2008), 228-233., microscopy 1919 Y. Zhaozheng et al. Cell Segmentation in Microscopy Imagery Using a Bag of Local Bayesian Classi-fiers. In “2010 IEEE International Symposium on Biomedical Imaging: From Nano to Macro” (2010), p. 125-128., magnetic resonance 1515 M. Prastawa et al. A Brain Tumor Segmentation Framework Based on Outlier Detection. Medical Image Analysis, 8(3) (2004), 275-283. and lung x-ray 1010 S. Hu, E.A. Hoffman & J.M. Reinhardt. Automatic Lung Segmentation for Accurate Quantitation of Volumetric X-Ray CT Images. IEEE Transactions on Medical Imaging, 20(6) (2001), 490-498.. The lung is the organ responsible for gas exchange and blood oxygenation; it has a spongy consistency, is highly vascularized, covered by the pleura 77 R. Drake. “Gray’s Anatomy for Students”. Elsevier Brasil, 2 ed. (2010)..

The pandemic caused by COVID-19 has spread rapidly and the gold standard for diagnosis is the Reverse Transcription-Polymerase Chain Reaction (RT-PCR) test, which does not always detect the disease, opting for tests to identify virus associated damage 11 B. Abraham & M.S. Nair. Computer-Aided Detection of COVID-19 from X-Ray Images Using Multi-CNN and Bayesnet Classifier. Biocybernetics and Biomedical Engineering, 40(4) (2020), 1436-1445..

Internal factors can interfere with digital image acquisition devices (resolution, beam opening, focus, luminance) and external factors (image acquisition process devices). However, there are situations in which it is necessary to have more defined images, such as radiographs that need more details than the images captured by the equipment.

And one form of image segmentation can be performed according to some options related to thresholding. Here, we choose the Fuzzy Theory due to gray level imprecision and ambiguity regarding gray gradient limits.

In this article, we chose the method of Chaira and Ray 44 T. Chaira & A.K. Ray. Segmentation using Fuzzy Divergence. Pattern Recognition Letters, 24(12) (2003), 1837-1844. regarding the minimization of Fuzzy Divergence, used to determine the ideal gray level for the thresholding imposed in the appli- cation of Gamma Probability Distribution to perform the enhancement of x-ray lung images to emphasize the sharpness of the gray gradient of the image for diagnostic.

This paper is organized as follows, besides this introductory section: in Section 2, the con- cepts necessary to understand the method used will be presented; in 3, the results achieved and discussions; and in the Section 4 the conclusions and future perspectives of this work.

2 DIGITAL IMAGE ENHANCEMENT

A digital image can be represented as a M ×N matrix, where each cell represents a pixel. With 8- bit gray scale images, the value of each pixel can vary from 0 to 255 at one frequency occurrence. The Figure 1 presents an image in matrix form, with the highlighted pixel being accessed by the indices 22 K.S. Augusto. Identificação Automática do Grau de Maturação de Pelotas de Minério de Ferro (2012). Masters Dissertation (Master Degree in Materials and Chemical and Metallurgical Process Engineering). Pontifícia Universidade Católica do Rio de Janeiro, PUC-RJ.), (44 T. Chaira & A.K. Ray. Segmentation using Fuzzy Divergence. Pattern Recognition Letters, 24(12) (2003), 1837-1844..

Figure 1:
Image representation as a matrix of 8 × 9 dimensions.

Thus, it is possible to obtain the frequency of each pixel, consequently, the histogram can be gen- erated, which consists of the visualization of a frequency distribution, which can be characterized as unimodal or multimodal with a better balance between brightness and contrast, improving the visualization.

Gonzalez, Woods and Eddins 99 Gonzalez, R.E.Woods & S.L. Eddins. “Digital Image Processing using MATLAB”. Pearson Education India (2004). create the histogram of a digital image that allows getting the probability function of gray levels as a function of relative frequency:

p ( k ) = n k n (2.1)

where: k is the intensity which, for a grayscale image of 8 bits, can vary between 0 and 255; n k , number of pixels in the image with the gray level k; n, total amount of intensity tones; P(k), the sum of the probabilities of all elementary events, ∑k p k will be equal to 1 (one) 22 K.S. Augusto. Identificação Automática do Grau de Maturação de Pelotas de Minério de Ferro (2012). Masters Dissertation (Master Degree in Materials and Chemical and Metallurgical Process Engineering). Pontifícia Universidade Católica do Rio de Janeiro, PUC-RJ..

Image equalization consists of verifying adherence to a probability distribution referring to the histogram feature to obtain membership values according to the Extension Principle in the fuzzification step, in order to enable the use of divergence methods.

2.1 Fuzzy Logic and The Fuzzy Extension Principle

In 1965, Zadeh 1818 L.A. Zadeh. Fuzzy Sets. Journal Information and Control, (1965), 338-363. began his studies in Fuzzy Logic, whose idea came from the observation that the technological resources of the time, that were not only incapable of automating activities related to problems of an industrial, biological or chemical nature, but also could not understand ambiguous situations that could not be processed 1717 P. Simons. Łukasiewicz and The Several Senses of Possibility. European Review, 23(1) (2015), 114- 124..

Zadeh used the multivalued logic of the Polish Jan Lukasiewicz 1717 P. Simons. Łukasiewicz and The Several Senses of Possibility. European Review, 23(1) (2015), 114- 124. for the adoption of mem- bership functions 1212 R.F. Merli & L.M.W. Almeida. Nem Tudo é Tão Certo como Parece Ser: A Matemática Fuzzy como Linguagem. Encontro Paranaense de Educação Matemática, XI, (2011)., in which a variable can have values in a scalar interval [0, 1] that identifies the degree of null and complete membership, respectively, where the range values represent the intermediate degrees of membership of the object in relation to the set, and zero and one show exclusion and full association, respectively 33 L.C. Barros & R.C. Bassenezi. “Tópicos de Lógica Fuzzy e Biomatemática”. Grupo de Biomatemática, Instituto de Matemática, Estatística e Computação (2010)..

In this paper the usual Histogram Equalization technique will not be addressed, nor the proposal of the Otsu method, the fuzzy proposal becomes innovative when using the Extension Principle according to the continuous gamma probability distribution, which allows to calculate the image of a object inferring the degree of relevance of the Fuzzy Theory 2020 H.J. Zimmermann. “Fuzzy Set Theory and Its Applications”. Springer Science & Business Media (2001)..

2.2 Gamma distribution as a Membership Function

The Gamma is one of the continuous distributions in the probability area, and is also an extension of the exponential density function, often used in models that use positive values greater than zero 1313 P.A. Morettin & W.O. Bussab. “Estatística Básica”. Saraiva, 6 ed. (2014).. It’s general density function f (x) is:

f ( x ) = ( x - v ) β α - 1 e x p - ( x - v ) β Γ ( α ) , x v ; α , β > 0 (2.2)

Where:

  • α, shape parameter;

  • v, location parameter;

  • β , scale parameter; and

  • Γ, formula of the gamma function: 0uα-1e-udu

When v = 0, β = 1, the Gamma Distribution assumes the formula below, also known as the Standard Gamma Distribution:

f ( x ) = ( x ) β α - 1 e x p - ( x ) β Γ ( α ) , x 0 ; α , β > 0 (2.3)

When v ≠ 0, β = 1, and α = 1, the gamma distribution described in Equation (2.2) will assume the following formula, also known as the Exponential Distribution:

f ( x ) = e x p ( - ( x - v ) ) , Γ ( α ) = 1 (2.4)

2.3 Image Enhancement from the Perspective of Fuzzy Segmentation

The membership function, described in the Subsection 2.2, must be treated according to the concept of Thresholding, a method used to separate the background region from the region (µ 0) of the object (µ 1) of an image, Equations (2.5) and (2.6), respectively:

μ 0 = f = 0 t f · c o u n t ( f ) f = 0 t c o u n t ( f ) (2.5)

and

μ 1 = f = t + 1 L - 1 f · c o u n t ( f ) f = t + 1 L - 1 c o u n t ( f ) (2.6)

which:

  • f: pixel gray level;

  • t: threshold, according to the amount of gray levels;

  • count( f ): number of pixels of a certain level f ; and

  • L: total gray levels of the image.

For threshold purposes, each pixel in an image has a relationship with the background object or regions. If the pixel belongs to the object, it has a close relationship with the region, that is, what corresponds to the distance between the gray level and the average of the pixel levels in the region (5).

Through a threshold, given an image A with dimensions M × N with L levels of gray. Let f ij be the gray level of the pair (i, j) referring to the pixel of the image A and µ(f ij ) the membership value of this pair, varying between 0 and 1, where µ(f ij ) = 1 denotes maximum membership and µ(f ij ) = 0 denotes non-membership.

Based on the region (2.7) and object (2.8) equations, we have:

μ ( f i j ) = e x p ( - c · | f i j | - μ 0 ) , i f f i j t (2.7)

and

μ ( f i j ) = e x p ( - c · | f i j | - μ 1 ) , i f f i j > t (2.8)

The normalization constant c is used to guarantee that the gray level belongs in the range [0, 1] and assumes the inverse of the difference between the maximum and minimum values of the set of gray levels referring to the image (Equation (2.9))

c = 1 ( f m a x - f m i n ) (2.9)

which: f min and f max are the minimum and maximum gray levels in the image, respectively. This constant is used to obtain memberships according to the threshold t.

Although thresholding is easy to apply, it may be difficult to detect the probability distribution adhering to the histogram configuration, causing undesirable highlights in the sense of preserving brightness and limiting contrast.

To illustrate, as presented in 99 Gonzalez, R.E.Woods & S.L. Eddins. “Digital Image Processing using MATLAB”. Pearson Education India (2004)., Figure 2 shows two images ((a) and (c)) with different hue concentrations (light and dark) and their respective histograms ((b) and (d)). It is observed that the tonality of the images influences their histograms, due to the occurrence of the gray levels of the pixels (6). We can see that the graphic of the images a and c have asymmetries to the right and to the left, respectively, that is, it exhibits a tendency to concentrate the gray levels of the pixels in smaller values (lower brightness) and larger values (higher values luminosity).

Figure 2:
Bright and dark images and yours respective histograms.

Figure 3 presents the low contrast image (a), showing a histogram (b) with a trend towards symmetry, although a valley is visualized on the left. In the high-contrast image (c), the histogram (d) shows a uniform distribution, with the higher and lower gray levels showing expressiveness of occurrence.

Figure 3:
Low and high contrast images and yours respectives histograms.

There are some ways to find the threshold. For this paper, we use the threshold through the Fuzzy Extension Principle, which is based on minimizing the Fuzzy Divergence by the membership function through the Gamma Density Distribution (4), whose explanation we can see in the Subsection 2.4.

2.4 Fuzzy Divergence

Pal and Pal (14) used Shannon’s Classic Informational Theory (16) to segment an image us- ing Fuzzy Exponential Entropy, while Fan and Xie 88 J. Fan & W. Xie. Distance Measure and Induced Fuzzy Entropy. Fuzzy Sets and Systems, 104(2) (1999), 305-314. opted for Fuzzy Divergence of Fuzzy Exponential Entropy using an uni-dimensional array. This option was extended to an image rep- resented by a matrix M ×M with L distinct levels of gray with probabilities (p 0 , p 1 , p 2 , ..., p L−1 ), where the Exponential Entropy was defined as:

H = i = 0 L - 1 p i e ( 1 - p i ) (2.10)

The Fuzzy Entropy for an image A of size M ×M is defined as:

H ( A ) = 1 n e - 1 i = 0 M - 1 j = 0 M - 1 [ ( μ A ( f i , j ) ) . e 1 - μ A ( f i , j ) + ( 1 - μ A ( f i , j ) ) . e μ A ( f i , j ) - 1 ] (2.11)

which:

  • n = M 2;

  • i, j = {0, 1, 2, ..., M − 1};

  • µA , the membership value of the image’s pixels; and

  • fi, j , the (i, j) −th pixel of the image A.

In (4), for two images A (region) and B (object) in the (i, j) − th pixel of the image, the discrimination information µ A (f i, j ) and µ B (f i, j ) is given by:

e μ A ( f i , j ) e μ B ( f i , j ) = e μ A ( f i , j ) - μ B ( f i , j ) (2.12)

which: µ A (f i, j ) and µ B (f i, j ) are membership values of the (i, j)-th pixel of the images A and B. Thus, the discrimination between image A and image B can be given as:

D 1 ( A , B ) = i = 0 M - 1 j = 0 M - 1 [ 1 - ( 1 - μ A ( f i , j ) ) . e μ A ( f i , j ) - μ B ( f i , j ) - μ A ( f i , j ) . e μ B ( f i , j ) - μ A ( f i , j ) ] (2.13)

Similarly, the discrimination between the image B and the image A can be given as:

D 2 ( B , A ) = i = 0 M - 1 j = 0 M - 1 [ 1 - ( 1 - μ B ( f i , j ) ) . e μ B ( f i , j ) - μ A ( f i , j ) - μ B ( f i , j ) . e μ A ( f i , j ) - μ B ( f i , j ) ] (2.14)

So, the total fuzzy divergence between A and B is given by:

D ( A , B ) = D 1 ( A , B ) + D 2 ( B , A ) (2.15)

3 RESULTS AND DISCUSSIONS

We implemented the method proposed by this paper using the Python programming language under the Google Colab platform , being chosen because of the practicality of the coding organization that provides, besides the ease of installing the libraries.

We ran tests on CPU Intel Core i7 1.8GHz, 16GB RAM, Nvidia GeForce 940MX GPU, Linux Ubuntu 18.04 LTS OS. In the experiments, we select 37 images of lung radiographs, taken from the dataset of the Kaggle , comprising 11 images of a lung with viral infection caused by COVID-19, 8 images of lung with bacterial pneumonia, 12 images of lung with fungal pneu- monia, and 6 images of healthy lungs. We selected these images according to the following criteria:

  • it should show the lung entirely since the diagnosis is conceived as a function of the scope and location of the onset of the disease;

  • at least 128 shades of gray. This criterion is necessary because there is a need for bet- ter details for diagnosis. Images with the frequency of gray levels below this value were discarded;

  • the selection of images favored the diversity of places that suffered from pulmonary diseases.

From these images, both one healthy lung and one affected lung were shown, although not from the same individual. The goal was to assess the improvement in image visualization, which fa- cilitates the diagnostic assessment. We detail the information of the selected files in Table 2, which presents the file record of each radiograph used, the year of examination and the country of origin.

Table 1:
Information about images used in the experiments. We chose images that represents countries around the world.

Table 2:
Fuzzy divergence and threshold of each enhanced image.

After selecting the images, we proceeded with the execution of the enhancement method, being performed for each image threshold in order to verify the gray level that presents the smallest associated divergence. It is important to clarify that no type of pre-processing or manipulation was performed on the selected images.

In Table 2 you can find the discrimination by: Image identification (ID), the smallest fuzzy di- vergence value found and the gray tone (threshold) that best associates the image details, results that were got by the Fuzzy Extension Principle using the Gamma Density Distribution.

At the same time, the results were compared according to the threshold calculated using the Otsu Method, and the results converged to the 37 images, although, in this text, only four images with different characteristics were presented, shown in the Figures 4, 5, 6 and 7 with their respective histograms.

It is important to emphasize that the relationship between the fuzzy divergence and the lowest threshold was not characterized for all images, since the divergence of all pixels in the processed image was taken into account.

Figure 4:
Pulmonary radiography according to COVID-19-associated viral involvement and re- spective enhanced image.

Figure 5:
Pulmonary radiography according to bacterial involvement and respective enhanced image.

Figure 6:
Pulmonary radiography according to fungal involvement and respective enhanced im- age.

Figure 7:
Healthy lung radiography and respective enhanced image.

It is noteworthy that the figures have different dimensions, which can change the degree of di- vergence, as observed in Figure 8, scatter plot referring to the 37 images that associate fuzzy divergence with a threshold (gray tone). We observed that most images showed divergence equal to or less than 20000 and in the other divergence ranges, the number of images was smaller, corresponding to approximately 24% of the test set, which emphasizes the quality of the method.

Figure 8:
Scatter plot between fuzzy divergence and gray level (threshold) that had the smallest divergence value of each image.

There are some issues with the images of radiographs acquired from internet banks. The images provided do not have the same resolutions, in addition to the parameters and capture equipment used and conversion and/or processing techniques not being the same. One way to deal with this is to define a protocol for capturing these images, using similar equipment and parameters in order to attest to the quality of the method.

We carried out a consultation with a group of medical specialists who assessed, according to their expertise, an improvement considered significant in the image’s quality to aid in the diagnosis, providing the perception of greater details in the highlighted image compared to the original image. Some images were captured while the patients were hospitalized and intubated, which may alter the radiography image. In these cases, there is inconsistent enhancement due to the contrast established by the electrodes connected to it.

4 CONCLUSION

The feasibility of the method refers to the use of a computer with internet access, as the Google Colab platform works in the cloud. For an image with a resolution close to 800 × 600 pixels, 200KB, the method took approximately four minutes to get the pixel divergences and find the lowest associated threshold, a runtime considered reasonable in using it for lung image en- hancement. We believe that in local execution we can optimize this time through parallel and distributed algorithms.

This work presented a method that can assist medical diagnoses in interpreting lung radiography images, especially in the pandemic caused by COVID-19, when performing lung image enhancement, one of the principal method used for diagnosis.

As future projections, we intend to carry out the method execution using images from the most recent period. Furthermore, it is intended to adapt the method that generate multimodal histograms. The aim is to develop, based on what we have discussed, neurofuzzy algorithms that automate diagnosing lung diseases. The proposed method, when developed on a collaborative platform, aims to democratize knowledge and is available to the academic community.

Acknowledgments

The authors thankfully acknowledge the financial support from the Brazilian research agencies. This work was funded by the Coordination for the Improvement of Higher Education Personnel (CAPES) - Finance Code 001 and under grant 88881.506840/2020-01.

REFERENCES

  • 1
    B. Abraham & M.S. Nair. Computer-Aided Detection of COVID-19 from X-Ray Images Using Multi-CNN and Bayesnet Classifier. Biocybernetics and Biomedical Engineering, 40(4) (2020), 1436-1445.
  • 2
    K.S. Augusto. Identificação Automática do Grau de Maturação de Pelotas de Minério de Ferro (2012). Masters Dissertation (Master Degree in Materials and Chemical and Metallurgical Process Engineering). Pontifícia Universidade Católica do Rio de Janeiro, PUC-RJ.
  • 3
    L.C. Barros & R.C. Bassenezi. “Tópicos de Lógica Fuzzy e Biomatemática”. Grupo de Biomatemática, Instituto de Matemática, Estatística e Computação (2010).
  • 4
    T. Chaira & A.K. Ray. Segmentation using Fuzzy Divergence. Pattern Recognition Letters, 24(12) (2003), 1837-1844.
  • 5
    T. Chiara & A.K. Ray. “Fuzzy Image Processing and Applications with MATLAB”. Taylor & Francis Group, LLC (2009).
  • 6
    A. Conci. Aula 2: Importância do Histograma em Análise de Imagens (2015). Análise de Imagens. Notas de Aula. Universidade Federal Fluminense.
  • 7
    R. Drake. “Gray’s Anatomy for Students”. Elsevier Brasil, 2 ed. (2010).
  • 8
    J. Fan & W. Xie. Distance Measure and Induced Fuzzy Entropy. Fuzzy Sets and Systems, 104(2) (1999), 305-314.
  • 9
    Gonzalez, R.E.Woods & S.L. Eddins. “Digital Image Processing using MATLAB”. Pearson Education India (2004).
  • 10
    S. Hu, E.A. Hoffman & J.M. Reinhardt. Automatic Lung Segmentation for Accurate Quantitation of Volumetric X-Ray CT Images. IEEE Transactions on Medical Imaging, 20(6) (2001), 490-498.
  • 11
    N.A. Memon, A.M. Mirza & S.A.M. Gilani. A Segmentation of Lungs from CT Scan Images for Early Diagnosis of Lung Cancer. International Journal of Medical and Health Sciences, 2(8) (2008), 228-233.
  • 12
    R.F. Merli & L.M.W. Almeida. Nem Tudo é Tão Certo como Parece Ser: A Matemática Fuzzy como Linguagem. Encontro Paranaense de Educação Matemática, XI, (2011).
  • 13
    P.A. Morettin & W.O. Bussab. “Estatística Básica”. Saraiva, 6 ed. (2014).
  • 14
    N.R. Pal & S.K. Pal. Entropy: A New Definition and Its Applications. IEEE Transactions on Systems, Man, and Cybernetics, 21(5) (1991), 1260-1270.
  • 15
    M. Prastawa et al. A Brain Tumor Segmentation Framework Based on Outlier Detection. Medical Image Analysis, 8(3) (2004), 275-283.
  • 16
    C.E. Shannon. A Mathematical Theory of Communication. The Bell System Technical Journal, 27 (1948), 379-423.
  • 17
    P. Simons. Łukasiewicz and The Several Senses of Possibility. European Review, 23(1) (2015), 114- 124.
  • 18
    L.A. Zadeh. Fuzzy Sets. Journal Information and Control, (1965), 338-363.
  • 19
    Y. Zhaozheng et al. Cell Segmentation in Microscopy Imagery Using a Bag of Local Bayesian Classi-fiers. In “2010 IEEE International Symposium on Biomedical Imaging: From Nano to Macro” (2010), p. 125-128.
  • 20
    H.J. Zimmermann. “Fuzzy Set Theory and Its Applications”. Springer Science & Business Media (2001).

Publication Dates

  • Publication in this collection
    15 Dec 2023
  • Date of issue
    Oct-Dec 2023

History

  • Received
    19 Feb 2022
  • Accepted
    14 July 2023
Sociedade Brasileira de Matemática Aplicada e Computacional - SBMAC Rua Maestro João Seppe, nº. 900, 16º. andar - Sala 163, Cep: 13561-120 - SP / São Carlos - Brasil, +55 (16) 3412-9752 - São Carlos - SP - Brazil
E-mail: sbmac@sbmac.org.br