Contrast Enhancement of Fundus Images by Employing Modified PSO for Improving the Performance of Deep Learning Models

Computer-Aided diagnosis (CAD) is a widely used technique to detect and diagnose diseases like tumors, cancers, edemas, etc. Several critical retinal diseases like diabetic retinopathy (DR), hypertensive retinopathy (HR), Macular degeneration, retinitis pigmentosa (RP) are mainly analyzed based on the observation of fundus images. The raw fundus images are of inferior quality to represent the minor changes directly. To detect and analyze minor changes in retinal vasculature or to apply advanced disease detection algorithms, the fundus image should be enhanced enough to visibly present vessel touristy. The performance of deep learning models for diagnosing these critical diseases is highly dependent on accurate segmentation of images. Specifically, for retinal vessels segmentation, accurate segmentation of fundus images is highly challenging due to low vessel contrast, varying widths, branching, and the crossing of vessels. For contrast enhancement, various retinal-vessel segmentation methods apply image-contrast enhancement as a pre-processing step, which can introduce noise in an image and affect vessel detection. Recently, numerous studies applied Contrast Limited Adaptive Histogram Equalization (CLAHE) for contrast enhancement, but with the default values for the contextual region and clip limit. In this study, our aim is to improve the performance of both supervised and unsupervised machine learning models for retinal-vessel segmentation by applying modified particle swarm optimization (MPSO) for CLAHE parameter tuning, with a specific focus on optimizing the clip limit and contextual regions. We subsequently assessed the capabilities of the optimized version of CLAHE using standard evaluation metrics. We used the contrast enhanced images achieved using MPSO-based CLAHE for demonstrating its real impact on performance of deep learning model for semantic segmentation of retinal images. The achieved results proved positive impact on sensitivity of supervised machine learning models, which is highly important. By applying the proposed approach on the enhanced retinal images of the publicly available databases of {DRIVE and STARE}, we achieved a sensitivity, specificity and accuracy of {0.8315 and 0.8433}, {0.9750 and 0.9760} and {0.9620 and 0.9645}, respectively.


I. INTRODUCTION
The high blood pressure and diabetes are primary causes of well-known eye diseases, such as glaucoma and diabetic The associate editor coordinating the review of this manuscript and approving it for publication was Felix Albu . retinopathy (DR), with DR is a leading cause of blindness in young populations. These diseases can develop advanced stages without major symptoms, whereas general symptoms include lesions in the form of microaneurysms (MAs), hard or soft exudates, intraretinal microvascular abnormalities, dot, or blot hemorrhages, and leakages. Individuals are frequently unaware of these symptoms, which can often only be detected by ophthalmologists examining the retinas of the patient and grading the disease by quantifying the lesions and identifying their types and severity. These diseases represent the primary causes of vision impairment in working-age populations [1].
The human eye has several constituent parts, including the macula, iris, vitreous, vessels, optic disk, optic cup, cornea, and pupil. A symptom of DR is MA caused by leakage from retinal vessels, with the MAs shown as red in color and circular in shape. Hemorrhages are formed on the retina when the walls of MAs rupture, and if the leakage from blood vessels contains lipids and proteins, exudates as another type of lesion are formed and can be either hard or soft and lead to vision impairment if occurring near the macula. The hemorrhages are dark in color, whereas the exudates are bright lesions [2]. Among the different constituent parts of the human eye, vessels are particularly important and frequently used for analyses of different eye diseases, including DR [3].
Retinal images are captured using fundoscopy, which is a complex optical-imaging method that uses a system comprising several lenses. The captured images are important for diagnosing different eye diseases, including DR and glaucoma, and provide a telescopic view of the retina [4]. Ophthalmologists examine and grade these images manually, which is a cumbersome and time-consuming task. Furthermore, manual grading can contain significant variations due to subjectivity and differences in interpretation. However, automated methods based on machine learning models are potentially capable of improved accuracy and consistency, as well as their utility for large-scale screening of the general population.
The performance of automated methods for analyzing retinas to diagnose eye diseases has improved due to the uneven progress in the fields of machine learning (ML), deep learning (DL), artificial intelligence (AI), and the use of graphical processing units. Additionally, ML and DL methods can potentially offer increased performance in the automated system for larger scale public screenings [5].
The contrast of retinal fundus images is generally inadequate for direct processing for multiple reasons, including eye movement, media opacity, poor focus, camera misalignment, and small pupil size, with inadequate contrast in captured images potentially resulting in narrow vessels being unidentifiable from background [5]. Therefore, preprocessing of retinal images for contrast enhancement is a compulsory step that includes extraction of a suitable image component for further processing. Splitting the green, red, and blue channels of the RGB image allows discrimination (contrast enhancement) of high degrees of order between blood vessels and background in the green channel [6]. However, the red and blue channels allow significantly lower discrimination (contrast). After selecting the green channel of the RGB image, the next step is the contrast enhancement of the green channel.
The authors in [7] applied the shade-correction algorithm for contrast enhancement of green channel of retinal images. In [8], the authors proposed a hybrid model with a combination of histogram fitting and multi-scale transformation (top-hat) for enhancing the retinal images. They claimed that their developed hybrid model is effective for enhancing the retinal image contrast, and successfully separated the vessels from background. But, they mentioned that their developed model is ineffective if the parameters of histogram fitting are not selected cautiously.
The authors in [9] a simple, effective, iterative and multi-step scheme for image denoising system using Wiener filter. In their developed scheme, the output from one stage is provided as input to next contiguous stage and so on. The ending criterion for stopping the denoising process is based on a certain level of image energy. They tested their developed iterative algorithm based on real clinical images using standard evaluation metrics.
The authors in [10] proposed contrast and luminosity enhancement technique for improving the retinal fundus images. They achieved the luminance gain matrix by applying gamma correction of value channel of HSV color space for enhancing the R, G, and B channels. Then they applied CLAHE for Contrast enhancement. The performance of their proposed method is evaluated on a database of 961 poor-quality retinal fundus images. They achieved better contrast enhancement compared to other image enhancement techniques.
The authors in [11] developed coarse-to-fine (unsupervised) machine learning algorithm for retinal vessel segmentation. Before segmentation of the vessels, they enhanced the retinal images by applying various methods including morphological top-hat filtering, Gaussian smoothing and contrast enhancement.
The authors in [12] adapted Sparse Coding and Multi-dictionary based based approach for contrast Enhancement of retinal vessel images. They used two dictionaries named Representation Dictionary and Enhancement Dictionary which are generated from original retinal image and labelled images respectively. These two dictionaries were used for saving the details of the vascular structures. They evaluated their developed approach for contrast enhancement of two well-known retinal image databases i.e. DRIVE and STARE.
The researchers of all these different studies have applied image contrast enhancement using different techniques. Specifically, for contrast enhancement of retinal fundus images, CLAHE has been used by numerous researchers but they used it with the default parameters values for clip limit and contextual regions, which are not optimized. There is a need for contrast enhancement of retinal fundus images, by exploring/applying an exhaustive way for finding optimal parameter values for clip limit and contextual regions of CLAHE.
The block diagram of the proposed strategy for contrast enhancement of retinal fundus images is shown in Figure 1 In the present study, we improved the contrast of retinal fundus images by obtaining optimized parameters values for clip limit and contextual regions of CLAHE. We proposed to apply the modified particle swarm optimization (MPSO) for finding optimized parameter values for clip limit and contextual regions. We have assessed its efficiency using various state-of-the-art evaluation metrics. Then, a DL model is applied for semantic segmentation of the contrast-enhanced retinal fundus images. The contrast enhancement is a basic pre-processing step in retinal vessel segmentation. In the past, researchers have applied CLAHE with default parameters for contrast enhancement [13], [14]. However, using the default parameters for all the fundus images might result in noisy image for some fundus images which makes it difficult to segment the retinal vessels accurately. In this paper, instead of using default values of contextual region and clip limit for CLAHE, we have applied modified particle swarm optimization (MPSO) to optimize the parameters of CLAHE. For the demonstration purpose, we apply the proposed method on publically available DRIVE and STARE retinal databases. The results demonstrated significant improvement in sensitivity of deep learning model for semantic segmentation by using the combination of MPSO and CLAHE for contrast enhancement of retinal fundus images.
The following are the contribution of this study.
• The PSO was applied to tune CLAHE parameters, which were subsequently used to enhance the contrast of the extracted green channel of retinal fundus images.
• We applied two objective functions to evaluate the CLAHE parameters determined by MPSO, including the structural similarity index (SSIM) and entropy.
• The performance of the proposed method was extensively evaluated using multiple evaluation metrics.
• We demonstrated improved contrast enhancement of retinal fundus image using a combination of the MPSO with CLAHE.
• We demonstrated improvement in sensitivity of deep learning model for semantic segmentation using enhanced retinal fundus image obtained by applying the proposed method of combination of MPSO and CLAHE.
The remaining paper is structured as follows. The review of the existing literature is provided in section 2 while the details of methods are given in section 3. The experimental results are presented in section 4. Performance enhancement (specifically improving the sensitivity) of DL method for retinal vessels segmentation is presented in section 5. Eventually, section 6 concludes the paper.

II. RELATED WORK
Image quality is often reduced during the acquisition process as a result of device flicker, object rotation, and/or uneven background illumination. Consequently, image-quality enhancement is a fundamental step in image analysis and processing. Various image enhancement methods aim to improve images to make them more suitable for target applications.
A histogram is a probability density function having discrete values for the number of pixels representing various gray levels in an image. Histogram equalization (HE) is often applied for contrast enhancement, which homogeneously allocates intensity levels throughout the image. In medical imaging, such as retinal fundus images and mammograms, the local contrast of various image regions is more significant than the global contrast. For such applications, global (G)HE is inadequate because it cannot address the enhancement of local features of various sections in an image. HE manipulates the image histogram by applying a transformation function as the basis for various spatial-domain methods used for image contrast enhancement [15]- [17].
Adaptive (A)HE differs from GHE in that it produces several histograms for different sections of an input image and uses them to redistribute the intensity levels in the output image, with a drawback of this method being noise amplification. CLAHE is a variation of AHE that enables control of the noise level using the clip limit.
The combined use of CLAHE with a discrete wavelet transform for image-contrast enhancement was previously proposed [18], with the authors emphasizing that CLAHE promotes noise amplification and contrast overstretching. To address these issues, they proposed the application of a weighted-averaging operation in both the reconstructed and original images in order to regulate the enhancement levels in the different regions in the original image. However, their method was only evaluated using non-medical images. Another study [19] applied an ML approach to hyper-parameter tuning for CLAHE in order to obtain a trade-off between image enhancement and noise amplification. They used the clip limit and the kernel size as tools to determine this trade-off; however, their evaluation was also limited to only non-medical images. Additionally, [20] formulated and implemented multidimensional CLAHE, which generates a random number of dimensions in the image, with this subsequently applied to spectroscopy and fluorescence microscopy datasets. Furthermore, CLAHE has been used to increase image contrast in a number of applications. [13], [21]- [26] and [27]. In biomedical-image processing, it has been used to enhance mammography images [21], [22], ultrasonography images [23], cell-image segmentation [16], [24], bone-fracture images [25], and retinal-vessel detection [13], [26], [27].
Evolutionary computation is a branch of AI often used to solve optimization problems. Previous studies applied CLAHE in combination with meta-heuristics algorithms for contrast improvement in medical images [28]- [30]. Additionally, [29] presented a PSO-based parameter tuning method for CLAHE for mammogram images, achieving significantly better results as compared with exiting techniques by applying local contrast modification for contrast enhancement of mammogram images. Moreover, they evaluated their proposed method based on different objective functions, including edge information and entropy. Furthermore, [30] applied CLAHE for contrast enhancement of mammograms. Notably, ML and deep learning have recently been investigated for use in image-contrast enhancement with promising outcomes [31]- [34]. [35], [36] applied a genetic algorithm with transformation functions using different parameters to enhance the contrast of a grayscale image, and [37] used PSO with an objective function to evaluate image enhancement by considering the entropy, as well as the number of edges, in the image. The current research is the first to our knowledge that focuses on parameter tuning in CLAHE for contrast enhancement of retinal fundus images.

III. METHODS
This section unfolds the standard PSO, its basic equations, the modified PSO and MPSO-CLAHE.

A. THE STANDARD PARTICLE SWARM OPTIMIZATION
The PSO is an evolutionary method and based on the reproductive behaviors of living things, including schools of fish, flocks of birds, etc. As an optimization algorithm, PSO applies a population based hunting strategy to individuals (i.e., particles), which hover around in a multidimensional search space searching for local, as well as global, optimal positions. All particles have a specific velocity, which affects their movement in the multidimensional space. Contrast enhancement of an image requires a transformation function to transform each pixel intensity from the input image into a different intensity level for the corresponding pixel in the output image. An optimization function is applied for optimizing CLAHE parameters, and an objective function is applied to the input and output images to assess the quality of the enhanced image.
Contrast enhancement is assessed using the entropy and SSIM parameters, with the local-and global-best particles updated accordingly. Following the determination of the global-best particle, it is used for contrast enhancement.
The authors in [29] applied the standard PSO for contrast enhancement of mammogram images. For the initial analysis, we also implemented the standard PSO for contrast enhancement of retinal fundus images. But the main issue with standard PSO is that both the position and velocity vectors (particles) may get stuck in the local best positions. Due to this issue, optimum contrast enhancement cannot be guaranteed. For the readers convenience, the details of the standard PSO algorithm are disclosed below.
In standard PSO algorithms, the position as well as the velocity of the particles changes with time. Each particle has a position vector and velocity vector associated with it. The algorithm begins with a randomly initialized values of the velocity and position vectors for each particle. The velocity vector and position vector of a j th particle in a D-dimensional space is expressed by equations (1) and equation (2) respectively.
For every particle, its current position vector is provided to the objective function, which generates a fitness value. If the current output of the objective function is greater than the previous, the local-best position of the particle is updated accordingly. The globalcbest value of the position vector is then updated by comparing its value with the value of all the particles. The updated value of the velocity vector of each particle is determined using the local-and global-best positions along with other control parameters. Equation (3) describes the update of particle-velocity.
In equation (3), the w is the inertial weight, v i j is the velocity vector of the jth particle in ith iteration, the parameters c1 and c2 are used for the acceleration of the local and global parts, the r1 and r2 are two random numbers which are uniformly distributed. The pbest i−1 j is the particle's local best position while gbest i−1 j is the particle's global best position in the whole swarm. The updated velocity vector of each particle is utilized for updating their respective position vector according to the equation 4.
In equation (4), the term x i j represents the position vector of j th particle in the i th iteration. The parameters in equation (3), such as inertial weight, random numbers, and acceleration constants, all play a role in the particle's convergence to its global best place. The inertial weight governs the effect of a particle's previous velocity vector on its current velocity vector. It acts as a trade-off between the entire swarm's global and local search capabilities. The value of the inertial weight VOLUME 9, 2021 is generally kept constant in regular PSO. The researchers experimented with several different ways to control the inertial weight in order to speed up the convergence of the particle to its global best location. Parameters c2 and c1 assist each particle in the swarm in finding the global and local optimal position. For convergence of the PSO algorithm, the values of these two parameters must obey the rule c1 + c2 <= 4, otherwise, there's a probability the particle will get trapped in a nearby minima. The values of r1 and r2 must be generated uniformly and randomly in the range of [0, 1] to preserve variability in the generated population of particles.
Equation (1) and (2) are the general representation of position vector and velocity vector respectively whereas Equation (3) and equation (4) are the original PSO equations for velocity and position vector update respectively. The local and global best position searching mechanism of standard PSO algorithm from [38] is shown in Figure 2. It shows the influence of particle best (Pbest) and swarm best (Gbest) on the movement (both position and velocity) of particle evolution during iteration 'i'. It indicates that the particle in iteration 'i' is attracted proportionately towards current best and global best position which are Pbest and Gbest respectively. FIGURE 2. Illustration of particle 'j movement in solution space for i and i + 1 iterations. It indicate the influence of best position of particle i.e. Pbest , and best position the whole swarm i.e., Gbest on the movement of particle 'j .

B. THE MODIFIED PARTICLE SWARM OPTIMIZATION
The proposed method aims to identify optimal values for the contextual region and clip limit in order to allow CLAHE to optimally enhance the contrast of a given image. Equation (5) is the particle definition for our proposed method where each particle of the PSO comprises the contextual region (Rx, Ry) and the clip limit (Cl), with the position of a particle represented as a three-dimensional vector.
In equation (5), Rx where M, N are the number of columns and rows of the image respectively. The Cl is the clip limit in the range [0 1]. We modified the standard PSO to penalize the velocity of the particle in order to keep it within the dimensions of the image. We used a technique that adjusts the particle velocity to keep it within the [V min V max ] range. If the combination of the position vector and the velocity vector results in a particle leaving the image's dimensions, the particle velocity is penalized. These alterations ensure that the particle remains within the boundary of the search space represented by the dimension of the image.
The V max and V min parameters are determined using equation (6) and (7).
where the words MaxSS and MinSS refer to the search space limits, and lambda refers to the element used to clamp the velocity of each particle. The value of lambda is 1 by default. The velocity of the i th particle in the D th dimension is con- When the particle velocity is updated based on velocity clamping using equation (6) and equation (7) Where, the term X (i,D) is the position of the i th particle in the D th dimension. If the resultant vector from the addition of the position vector and velocity vector is outside the dimension of the image, then the penalization is performed by setting the velocity to zero and altering the direction of the particle position. After penalization is performed, the updated particle's position is determined using equation (4) of the standard PSO. The various parameters in the proposed MPSO are initialized according to Table 1. The range of clip limit as well as contextual region is set before running the optimization algorithm. For the clip limit, the standard range is [0, 1] whereas for the contextual region [Rx, Ry] the lower bound is 2 and the upper bound is 32. The upper bound for the contextual region is set based on the experimentation so to avoid over-enhancement or noise amplification in fundus images. In addition, the larger value of the upper bound would result in higher computational cost. When the optimization algorithm is applied, in the first iteration, the MPSO will randomly assign values to the contextual region as well as clip limit within the specified range. From the second iterations onward, the MPSO will assign values to the contextual region as well as clip limit based on equation (4).

C. BASIC CLAHE
Numerous studies used basic CLAHE for contrast enhancement due to its proven results in biomedical images [21], [23], [25]- [27], [39], [40]. CLAHE offers a controlled selection of a local histogram-transformation function for application to input images after they are split into suitable regions. It adjusts the intensity levels of the image by applying a nonlinear transformation for maximizing the contrast for every pixel in its input image. A drawback of the adaptive histogram equalization (CLAHE) method is noise amplification, which is usually controlled by choosing a suitable clip limit and contextual regions. But, applying CLAHE may lead to creation of boundaries at places of abrupt gray levels changes in input images, which are abundant for the case of retinal fundus images. Additionally, un-optimized selection of clip limit and contextual regions of CLAHE did not guarantee optimum contrast enhancement. As a result, in order to ensure optimal contrast enhancement of retinal images, thorough exploration of finding optimal values for clip limit and contextual regions of CLAHE is needed.

D. THE PROPOSED MPSO-CLAHE METHOD
In the MPSO, the swarm is initialized with a selected number of particles and searches for local-and global-best particles by updating through a selected number of iterations. In each iteration, every particle is updated by comparing it with two optimal values, one of which represents the best particle (solution) obtained among all particles of one iteration (i.e., the local best). The other optimal value represents the best particle (solution) in the swarm (population) (i.e., the global-best). These particles are responsible for forcing other particles to move toward the best position. In the CLAHE part of the algorithm, the input image is divided into several contextual regions, each having dimension Rx and Ry. Each particle (vector) in the swarm comprises Rx, Ry, and a clip limit, the ranges of which dictate how various particles are formed. In each iteration of the PSO algorithm, fifty particles are randomly formed by assigning random values to Rx, Ry, and the clip limit. Every particle is subjected to CLAHE, the enhanced image is assessed using the objective function, and the local best particle is calculated. By comparing the individual best of the fifty particles, the global-best particle is updated after every iteration, with the overall best selected by PSO through a selected number of iterations. The PSO algorithm is executed 100 times (empirically selected), which ensures a reasonable global-best particle and transformation of an input image into an output image with significantly enhanced contrast.
For contrast enhancement, CLAHE divide a given image into many parts and apply histogram equalization to them.
It adjusts the intensity levels of the image by applying a nonlinear transformation for maximizing the contrast for every pixel locally in the divided parts of the image. CLAHE has two main parameters which are contextual regions (Rx, Ry) and clip limit (Cl) and researchers usually use fixed values for their considered databases. The main problem with such an approach is that optimal contrast enhancement cannot be achieved for the different images, as contrast enhancement using CLAHE is mainly dependent on the optimal selection of its parameters. Hence, there is a need for exploring a systematic way for optimal selection of contextual regions and clip limit, which will result in optimal contrast enhancement for the different images in any database. The PSO is an evolutionary optimization method, which is based on the reproduction behaviors of the living being including fish schooling, bird flocking, and swarm theory. For the case of CLAHE, contextual regions and clip limit are the particles. In our proposed MPSO-CLAHE method, we are trying to optimize (find best particles) the contextual regions (Rx, Ry) and clip limit (Cl) for the different images of two well known retinal image databases called DRIVE and STARE. So, the MPSO algorithm is trying to optimize the values for Rx, Ry, and Cl for the different images of these two databases.
In Algorithm 1, we have presented the modified PSO for which the particle definition is the parameters of CLAHE (Rx, Ry, and Cl). Our search space is 3D i.e. each particle consisted of three elements; Rx, Ry, and Cl where Rx, Ry represent the contextual region and Cl represents the clip limit of CLAHE. We consider fifty particles where each particle position and velocity are randomly assigned during the first iteration. The CLAHE is used as a transformation function to generate the enhanced image for each particle. We evaluate the fitness function using equation (8) to update the personal best of each particle. Next, we update the global best particle by comparing the personal best of the fifty particles. From the second iteration onwards, each particle velocity and particle position is updated based on equation (3) and equation (4) respectively. The CLAHE is used as a transformation function and the fitness function is evaluated to find the personal best as well as global best. With the progression of the optimization algorithm towards the stopping criteria, the fitness function is maximized and the particle that corresponds to the maximum value of the fitness function represents the optimal contextual region and clip limit of CLAHE for that particular fundus image.
The MPSO-CLAHE algorithm is presented in Figure 3, which shows how the parameters of the CLAHE are tuned based on the PSO. The interaction among the CLAHE, the PSO, and the particles is presented in Figure 4. The parameters including the randomly assigned values of the contextual regions and the clip limit are used to form a particle (i.e. vector) which is provided to the CLAHE for enhancing the input image. The enhanced picture (CLAHE output) is assessed using an objective function to find the best local and global particles. The algorithm shown above is repeated until a specific number of iterations is passed.

E. OBJECTIVE FUNCTION
The authors in [37], proposed an objective function for evaluating three performance metrics (the sum of edge intensities, entropy, and edge number) and is shown in (8). We applied this function to evaluate the quality of the enhanced image output using the proposed method.

F(I e ) = log(log(E(I s ))). n edges
where, the term Ie is the enhanced image obtained by applying CLAHE on the original image, Is is the edge image obtained by applying the Sobel edge operator, n edges represents the number of edges in the obtained edge image,H (Ie) is the entropy of the image having enhanced contrast and the E(I s ) is the sum of the pixel intensities in the obtained edge image. The M and N denote the number of columns and rows of the original image respectively. Our aim in this work has been on maximizing the fitness function.
We also used two additional objective functions to assess the quality of the enhanced image (SSIM and entropy). SSIM is a coefficient used to measure the degree of distortion in an enhanced image and determined block by block. Therefore, for two blocks of the original and enhanced images (represented by Ix and Ey, respectively), SSIM can be determined using equation (9).
where u Ix and u Ey are the intensity variances for the original and enhanced image, respectively. Furthermore, the σ Ix and σ Ey are the covariance between the original and enhanced image respectively. If the denominator becomes zero, the parameters C1 and C2 are used to stabilize the division. Entropy is an objective function for assessing the randomness of the given image. The entropy of a given image can be determined using equation (10).
where the term π is the probability of occurrence of gray levels i in the image. Furthermore, the term L is the maximum level of the grayscale in the given image. This entropy is an interesting metric as it is closely related to the typical brightness of the given image. The entropy metric assists us in assessing the contrast enhancement of the given image. In our recent studies in [41] and [42], we discovered that the contrast of the fundus images has a major effect on the efficiency of both supervised and unsupervised approaches for retinal vessel segmentation. For further improvement of evaluation metrics of these previous studies, in the current study, we aim for contrast enhancement of retinal fundus images.

IV. EXPERIMENTAL RESULTS
The subjective and objective analysis for comparing the performance of the proposed approach with previous methods is unfolded in this section.

A. SUBJECTIVE COMPARISON OF CLAHE WITH CLAHE-MPSO
We quantitatively and qualitatively evaluated the performance of the proposed method using two standard datasets [Digital Retinal Images for Vessel Extraction (DRIVE) and Structured Analysis of the Retina (STARE)] and according to entropy and SSIM metrics. DRIVE is a collection of retinal fundus images from the Netherlands that covers a wider age range of diabetic patients [43], and STARE is a collection of 40 retinal fundus images from the United States [44]. For each image in the DRIVE dataset, the blood vessel is segmented manually. Additionally, a binary mask is provided with every retinal image that delineates the field of view. Table 2 lists the descriptions of these two retinal fundus image databases.  Figure 5 shows the subjective analysis where we fixed the clip limit to 0.01 and progressively increased the contextual region (Rx, Ry) by a step size of 4. This figure clearly shows the significant impact of contextual region on the contrast of fundus image. When the contextual region is smaller, the enhanced image achieved local contrast. However, for the larger contextual region the global contrast is achieved with a larger dynamic range and overall increase contrast. Instead of empirically choosing the parameters of CLAHE, the heuristic optimization approach is used to optimally select the CLAHE parameters for each fundus image for avoiding over-enhancement and noise amplification.
In the images of Figure 5, we can observe that the slight variations in the contextual regions resulted in minor differences in contrast enhancements of images which were not observable by the human eye. However, a comparison of the first and last image from each database revealed observable differences in contrast enhancement. The results indicated that contrast was improved by increasing the size of the contextual regions, although over-enhancement (noise amplification) was eventually observed, resulting in decreased performance of the vessel detection algorithm. These findings suggested that careful selection of parameters for the contextual region is necessary to avoid over-enhancement or noise amplification. The performance of CLAHE is sensitive to the variations in the values of its parameters. For an explorative analysis of the sensitivity of CLAHE's parameters, we have performed several simulations where the values of Rx and Ry are varied from 4 to 48 with a step size of 4, and the results are presented in Figure 5. Figure 6 shows a visual comparison between CLAHE with a default parameters and optimized parameters of CLAHE shown in third column and fourth column of Figure 6 respectively. The first column of Figure 6 is the green channel image of test Image from the DRIVE and STARE databases. In fourth column of Figure 6, we are able to visualize the enhancement of retinal blood vessels (especially the thin vessels and those near the optic disk) relative to the background.
For illustration purpose, we randomly select three images from the DRIVE and STARE database and compare the MPSO -CLAHE with the default parameters CLAHE enhancement of the original image. As shown in the Figure, the optimal parameters of CLAHE using MPSO enhanced the retinal vessels much better than the default parameters of CLAHE. This enhancement is more visible in the optic disc region where it is very challenging to extract the retinal vessels.
Based on the analysis of the subjective evaluations in Figure 5 and Figure 6, we concluded that optimum values for the parameters of the contextual regions are needed to be determined for each of the different images in each of the standard datasets. For such analysis, we performed more simulation using the proposed method of the modified PSO. In the modified PSO, the penalization is performed for finding the local as well as global best positions of the particles. The results based on objective analysis of the images from both the DRIVE and STARE databases are evaluated and presented in the next subsection. Figure 7 shows the comparisons of entropy metrics for DRIVE images enhanced using CLAHE and CLAHE-MPSO. CLAHE uses the MATLAB function ''adapthisteq'' and default parameters for the contextual regions (Rx = 8, Ry = 8) [13], [14]. We found that the entropy of the enhanced images obtained using CLAHE-MPSO was better than those from CLAHE, suggesting that the optimized parameters resulted in improved contrast enhancement that allowed visualization of the optic cup, optic disc, and vessel segmentation in the retinal-vessel images.    Figure 8, we can perceive that the SSIM of the enhanced images obtained through the proposed algorithm is significantly lower compared to those obtained through SCLAHE. The lower SSIM values signify that the contextual regions obtained through MPSO for the different images of each dataset, which is desired. The entropy and SSIM of the 20 images of the STARE database are presented in Figure 9 and Figure 10 respectively. We can observe that the evaluation metrics for each of the images of the STARE database too, VOLUME 9, 2021   are significantly better for MPSO than that of the SCLAHE. Based on the results obtained based on the analysis of both the DRIVE and STARE databases, we can conclude that the contextual regions for the different images of the two databases are optimum. The best result in terms of entropy gain and loss of SSIM for MPSO-CLAHE was taken for every test image in DRIVE and STARE database, and results are listed in Table 3 and Table 4 respectively. As shown in these tables, the entropy of the enhanced image using default -CLAHE is lower than that of the MPSO -CLAHE for all the fundus images in DRIVE and STARE databases respectively. The subjective analysis from Figure 6 and quantitative analysis from Table 3 and Table 4 prove the PSO optimization over default CLAHE parameters.

B. OBJECTIVE COMPARISONS OF THE METHODS BASED ON EVALUATION METRICS
For all the images of two considered databases, the values of optimized parameters obtained using the proposed MPSO based method are presented in Table 3 and Table 4 of the manuscript. It is worthy to mention here that for different medical imaging applications, The MPSO algorithm should be firstly used for determining the optimized parameter values, which in turn will lead to significantly better contrast enhancement using CLAHE.

V. PERFORMANCE ENHANCEMENT OF DEEP LEARNING MODEL FOR SEMANTIC SEGMENTATION
For the validation of the proposed method, we have used our previously developed deep learning model in [41]. In this section, we present the detailed performance analysis by applying the deep learning model on the enhanced retinal images obtained using MPSO based CLAHE.

A. EVALUATION METRICS
The developed deep learning model is applied for vessel segmentation to extract vessels from retinal images in the two considered well-known databases. We have used the ''ground truth'' images provided with these standards for assessing the performance of our developed deep learning model. Usually, the researchers apply the four evaluation metrics described below for assessing the performance of their developed deep learning model (DLM): 1) True Positive (TP): The vessel pixels which are correctly identified by the DLM   The background pixels incorrectly identified as vessels pixels by the DLM The parameters elaborated above are generally applied for assessing the various evaluation metrics [45]: The Acc, Se, and Sp, in the above equations are accuracy (correctly identified pixels), sensitivity, and specificity, respectively.   specificity and accuracy is derived for each image and the results are listed in Table 5 and Table 6 for DRIVE and STARE database respectively. It can be observed in Table 5 that for the test images of the DRIVE database, we attained 0.8315, 0.9750, and 0.9620 for three standard evaluation metrics including sensitivity, specificity, and accuracy respectively. This table indicates that the sensitivity of the developed deep learning model is better compared to existing literature. In both Table 5 and Table 6, the SS represent semantic segmentation.
It can be observed in Table 6 that for the test images of the STARE database, we attained 0.8433, 0.9760, and 0.9645 for the standard evaluation metrics including sensitivity, specificity, and accuracy respectively. These results indicate that the sensitivity of the developed model is much better compared to the representative model from the literature. Furthermore, the accuracy is also reasonably better (third best) than the models of previous explorations.
Based on the observations in Table 6 and Table 5, we can conclude that image contrast enhancement based on MPSO and CLAHE enabled the developed deep learning model for attaining significantly better evaluation metrics compared to the representative models from the existing literature.

VI. CONCLUSION
The use of ML methods to accurately analyze retinal blood vessels has become essential to the prognosis and diagnosis of various eye diseases. In this study, we described a method for enhancing the contrast of retinal images using CLAHE by applying the proposed modified PSO algorithm to optimize the parameters i.e. contextual regions and clip limit. Two additional evaluation metrics i.e. entropy and SSIM have been used to quantitatively evaluate the enhanced images using the proposed method. The optimal parameters using MPSO-CLAHE resulted in minimum distortion and maximum contrast enhancement in the retinal fundus images from two publicly available databases (DRIVE and STARE). The MPSO specifically penalizes swarm-particle velocity and position (representing the contextual regions and clip limit) for leaving image boundaries, thereby promoting more efficient identification of both a local-and global-best particle, which aided in determining the optimal combination of parameters necessary to enhance the images. The contrast enhancement by applying MPSO based CLAHE will be helpful for the researchers in boosting the sensitivity of the retinal vessel segmentation approaches with minimal impact on the accuracy and specificity. This method will be useful to researchers interested in the segmentation of medical images especially the retinal-vessel images and assist the acquisition of optimal contrast enhancement to promote diagnoses using retinal images. Furthermore, significant improvement in the performance of the deep learning model is observed for semantic segmentation of enhanced retinal images. He has more than ten years of excellent experience as an Instructor and a Researcher in data analytics, machine/deep learning, signal processing, electronic circuits/systems, and embedded systems. He has been involved in many research projects as a Principal Investigator and a Co-Principal Investigator. He has authored and coauthored more than 68 publications, including IEEE/ACM/Springer/Hindawi/MDPI journals and flagship conference papers. His research interests include embedded systems, computer architecture, VLSI, signal processing, wireless sensor networks, camera based sensor networks, and smart grids, with an emphasis on big data, precision agriculture, machine/deep learning, embedded and pervasive computing, mobile cloud computing, and healthcare. Dr. Nadeem Javaid during his M.S. period with CUI. He has authored around 40 research publications in ISI-indexed international journals and conferences. His research interests include data analytics, generative adversarial networks, network security, wireless networks, smart grid, cloud computing, berth scheduling at maritime container terminal, and intelligent shipping. He also served as a TPC member and an invited reviewers for international journals and conferences MUSAED ALHUSSEIN received the B.S. degree in computer engineering from King Saud University (KSU), Riyadh, Saudi Arabia, in 1988, and the M.S. and Ph.D. degrees in computer science and engineering from the University of South Florida, Tampa, FL, USA, in 1992 and 1997, respectively. Since 1997, he has been on the Faculty of the Computer Engineering Department, College of Computer and Information Science, KSU. He is currently a Professor with the Department of Computer Engineering, College of Computer and Information Sciences, KSU. He is also the Founder and the Director of the Embedded Computing and Signal Processing Research (ECASP) Laboratory. He has been successful in winning a research project in the area of AI for healthcare, which is funded by the Ministry of Education, Saudi Arabia. His research interests include typical topics of computer architecture and signal processing with an emphasis on big data, machine/deep learning, VLSI testing and verification, embedded and pervasive computing, cyber-physical systems, mobile cloud computing, big data, eHealthcare, and body area networks. He is currently a Researcher with the Embedded Computing and Signal Processing Laboratory (ECASP), King Saud University. His research interests include signal processing, mixed signal design, and image processing. VOLUME 9, 2021