Particle Swarm Optimization-Based Approach for Optic Disc Segmentation

Fundus segmentation is an important step in the diagnosis of ophthalmic diseases, especially glaucoma. A modified particle swarm optimization algorithm for optic disc segmentation is proposed, considering the fact that the current public fundus datasets do not have enough images and are unevenly distributed. The particle swarm optimization algorithm has been proved to be a good tool to deal with various extreme value problems, which requires little data and does not require pre-training. In this paper, the segmentation problem is converted to a set of extreme value problems. The scheme performs data preprocessing based on the features of the fundus map, reduces noise on the picture, and simplifies the search space for particles. The search space is divided into multiple sub-search spaces according to the number of subgroups, and the particles inside the subgroups search for the optimal solution in their respective sub-search spaces. The gradient values are used to calculate the fitness of particles and contours. The entire group is divided into some subgroups. Every particle flies in their exploration for the best solution. During the iteration, particles are not only influenced by local and global optimal solutions but also additionally attracted by particles between adjacent subgroups. By collaboration and information sharing, the particles are capable of obtaining accurate disc segmentation. This method has been tested with the Drishti-GS and RIM-ONE V3 dataset. Compared to several state-of-the-art methods, the proposed method substantially improves the optic disc segmentation results on the tested datasets, which demonstrates the superiority of the proposed work.


Introduction
According to statistics of the World Health Organization (WHO), glaucoma is the second leading cause of blindness in the world [1]. It is estimated that people with glaucoma will increase to 111.8 million in 2040 [2].
An early diagnosis of glaucoma is of great importance. Glaucoma is irreversible after blindness, which leads to structural modifications as the disease progresses [3]. Fortunately, glaucoma has a long lesions cycle, and the patient's vision is slowly weakened. If detected and treated as early as possible, patients still can maximize the preservation of useful vision to maintain a normal life and work life [4]. Therefore, the early diagnosis and treatment of glaucoma are particularly necessary.
In actual medical diagnosis, ophthalmologists usual use cup to disk ratio (CDR [5]) as one of the factors in diagnosing glaucoma. The optic disc (OD) in the digital fundus image is the area where blood vessels and optic nerve fibers enter the retina. In digital fundus images, OD appears as a bright oval area, and the optic cup (OC) is the brighter oval area in the center of OD [1]. When the ratio of optic cup to the optic disc that means the diameter of the cup divided by the diameter of the disc [6,7] is greater than 0.6, which is considered to indicate glaucoma [8]. Glaucoma and normal fundus images are shown in Figure 1. Figure 1a shows a fundus diagram with glaucoma, for which its CDR is much greater than 0.6, while Figure 1b is a fundus of the normal eye, which can be seen when the central bright area; that is the cup area, and it is much smaller than the optic disc area. Therefore, many scholars use computers as an aid for the early diagnosis of glaucoma. The effective division of the optic disc area on the fundus is of extraordinary significance to the diagnosis of glaucoma. In this paper, the segmentation of the OD region is the main research focus.
In recent years, different approach of optic disc segmentation such as machine learning and clustering have been proposed so far. Thus, a deep learning architecture called M-Net is proposed by Fu, H. [9], which uses U-shaped neural networks as the main frame and introduces polar coordinate transformations to solve the problem of OD segmentation in a multi-level label system. Al-Bander and Baidaa et al. [10] found a new method based on deep learning that separates OD in the fundus image by using a combination of a fully convolutional network and DenseNet. Although deep learning-based approaches obtain a satisfactory performances of optic disc segmentation, those approaches require a huge number of data for the time-consuming training required. On the basis of color similarity and image proximity, Achanta et al. [11] segmented the optic disc with the generation of superpixels using clustering. There is no doubt that superpixel methods do not consider color information, which may adversely impact performance.
There are many drawbacks when applying deep learning to the segmentation of optic discs. One of the main reason for this is that the glaucoma datasets are too small to meet the training requirements of deep learning. The datasets originate from hospitals, and to protect the privacy of the patient, the patient's permission must be obtained [12]. Furthermore, the optic disc must hand labeled by experienced ophthalmologists, which undoubtedly increases the difficulty of obtaining datasets.
To overcome the drawback of the lack of glaucoma dataset, a new particle swarm optimization-based approach for optic disc segmentation SePSO is proposed in our work. The proposed algorithm does not require large amounts of data for preprocessing, which is a self-learning approach. In addition, the information of image color and optic disc shape is also taken into our consideration, which reduces the interference of relevant information on experimental results [13]. Furthermore, the subsequent sections are organized as follows: Section 2 describes details on the PSO approach that we modified for the segmentation of optic disc. Section 3 provides some results with datasets, evaluation parameters used for our experimental study, and the discussion. Moreover, the conclusion is highlighted in Section 4.

Materials and Methods
This section described the Particle Swarm Optimization algorithm that we modified in this paper to segment the optic disc in retinal images. As described by Shi and Eberhart [14], PSO is a multi-agent system, and the system is initialized with a population of random solutions. For each potential solution, called particle, all particles fly in the exploration area for the global optimum. Each particle tracks its coordinates in exploration area. The coordinates of each particle tracks are associated with the best solution [15] (fitness) achieved by itself so far, which is called PP, and the entire group's best solution, which is called GP. The particle can be described as Par i,j = (X i,j , V i,j , PP i ), where X i,j is the current position of particle, and V i,j is the current velocity of particle. Each particle moves toward PP and GP at every iteration.
The basic idea of PSO is to find the optimal solution through collaboration and information sharing between individuals in the animal populations. Usually, the PSO algorithm can be used to optimize continuous nonlinear functions and to solve some discrete problems.
In this paper, the optic disc segmentation problem is converted into a series of the extreme value problem. Based on a large number of experiments, we found that it is not sufficient to solve the optic disc segmentation problem by original PSO. To solve this problem, we propose an improved algorithm based on Particle Swarm Optimization, called SePSO. The goal of SePSO is to find a set of best solutions for the particles. Moreover, the closed shape formed by these particles is the boundary of the predicted optic disc. The components of the SePSO algorithm we modified are described in subsequent sections.

Subgroups and Edges
In this paper, the PSO approach has been used in segmenting OD in a fundus image. In order to achieve this goal, the concept of subgroups are drawn into PSO. The entire particle group is divided into a certain number of subgroups pop. There are N subgroups in the original group, where the subgroups consist of the same number of particles n p . Particles in every subgroups are marked with numbers from 1 to n p . For a clear expression, Par i,j represents a particle with a label of No.j in the ith subgroups. Each subgroup pop i , which searches within its respective regions (details in Section 2.2.1), contains some particles Par i,j . The subgroups pop can be described as Equation (1): The parameter i = 1, 2, . . . , N; • n p is the number of particles belonging to every single subgroup; • Par i,j is the particle marked as No.j in subgroup pop i .
The closed curve, which consists of all the No.j particles in each subgroups connected, is called Edge j in this paper. The number of potential boundary is the same as the number of particles in each subgroup, which is n p . In addition, Edge is the potential solution of optic disc boundary. Edge can be defined as Equation (2): where • Edge j is the jth potential OD boundary; • The parameter j = 1, 2, . . . , n p ; • N is the number of subgroups; • X N,j is the position of No.j particle in subgroup pop N .
As the search progresses, most particles in each subgroup converge to the optimal solution and the Edge with best solution (fitness, details in Section 2.3) makes up the final predicted boundary.

Exploration Area
Using the SePSO algorithm for OD segmentation means that each particle searches in the two-dimensional space for a set of Edge. Obviously, the entire two-dimensional space in original image is too broad for all the particles to search. It is advisable to optimize the exploration area first. To simplify the search processing, reduce the computation time and increase the accuracy of OD segmentation; we pre-process the original images in three steps. Figure 2 shows the diagram of exploration area. Firstly, the ROI images prepared for OD segmentation are initially resized to 256 × 256 pixels by using the interpolation of a Lanczos interpolation [16] over an 8 × 8 pixel neighborhood. On one hand, making the size of images homogeneous is helpful for the subsequent calculations and evaluations. On the other hand, the exploration area can be compressed as small as possible on the premise of preserving features.
Secondly, according to prior knowledge and the circle nature of the optic disc, we set the entire exploration area as an annular area. Considering the center of the disc as the center P c of the entire exploration area, the outer E outer and inner E inner exploration contours are, respectively, defined by the circle of center P c and radius R max and R min , which are defined as Equation (3).
In addition, a polar transform [17] is applied to OD segmentation. The entire exploration area consists of a series of radial points, which is defined as a radial points map EA. The radial points map is a two-dimensional polar coordinate system, and the points represent where particles are likely to explore. The radial points of this map are described by distance and angle, where the polar coordinate of P c is (0, 0). Rays that proceed horizontally to the right from P c are called polar axes [18]. The distance between the search points and center point P c is called radius r ∈ [R min , R max ]. The angle is calculated by gradually adding an increment of δ θ . Therefore, the location of pixels on the map is described with a radius and angle by Equation (4): where • P i,j is the particle in the exploration map; • r i,j is the distance between P i,j and P c ; • θ i,j is the angle of P i,j . Therefore, the Cartesian coordinates of pixel P i,j is described with radius and angle by Equation (5).
where • x i,j and y i,j is the horizontal and vertical ordinate of P i,j ; • x c and y c is the horizontal and vertical ordinate of P c .
The entire exploration area EA consists of a set of pixels, which can be described as Equation (6).
Similarly to the relationship between POP and pop, the exploration area of subgroups SE is not only defined as part of the entire exploration area or any two regions that do not intersect. Equations (8) and (9) are the properties and definition of SE i : where SE i is the exploration area of subgroup pop i .

Initiation
The shape of the optic disc varies from circle to ellipse, and usually it is an irregular approximation of the ellipse. If too few points are used for fitting, it is difficult to express the true disc's boundary. The more points are used for fitting, the closer the fitted shape is to the real boundary. However, too many points will slow down the calculation and increase time complexity. We need to find the proper number of points to balance speed and accuracy. In this paper, the number of points on the boundary Edge is equal to the number of subgroups N. The influence of the parameter N will be shown in subsequent experiments.
In PSO, the particle number n p of each subgroup usually is between 20 and 40. The more particles there are, the wider the search space is. It is easy for SePSO to find the global optimal solution with more particles; however, computational consumption will become higher.
In this paper, the particle number n p is set as n p = 30 based on a large number of experiments.
Each particle is assigned a randomized location at the beginning. Considering of the circle nature of OD, the distances from particles on the predicted boundary Edge j to P c should be equal approximately for each j. Therefore, the initial location of each particle is set using the following rules: • For all particles Par i,j belonging to the same Edge j having the same radius r, r is the distance between Par i,j and center P c . • The radius r of particles Par i,j on Edge j is randomly assigned from R min to R max . Based on experiments, R min is set as 30% of the image width, and R min is the 70% of the image width.

Fitness Function
When particles fly in the subgroup's exploration area Ea, an indicator should be introduced to evaluate the locations, and a fitness function is used as the indicator in this paper. In the task of image segmentation, considering the differences between the OD region and the surrounding space, the red channel of the original RGB image is separated to calculated the gradient of every radial points in the exploration area [19]. The differences between the images of blue, green, and red channels are showed in Figure 3. The gradient is regarded as the fitness value of points. Figure 4 shows the different gradient between original exploration and modified exploration. The fitness value of each point is calculated as Equation (10). We have the following equation: value P = grad P , when P ∈ EA 0, when P / ∈ EA where • value P is the fitness value of point P; • grad P is the gradient [20] of point P. In addition, the potential contours of OD, which is described as Edge j , consists of the jth particle in every subgroup pop i . The higher the fitness of a point, the more likely it is that the point is part of the boundary. The higher the fitness value is, the higher the possibility that it is part of Edge. The fitness of Edge j can be calculated with Equation (11): where value i,j is the fitness of the jth particle in subgroup pop i .

Position Update
In the traditional PSO, each particle changes the location toward the particle's best location PP and the global best location GP at each step. There are three control parameters, the inertia weight ω, the cognitive c p , and social c g acceleration, that play an important part in the exploration and exploitation capability of PSO. The velocity of every particle can be calculated as Equation (12): , which is a random number; • c p and c g are named as acceleration coefficients. Usually, c p + c g = 4; • PP i,j is the best location of Par i,j has flied; • GP i is the best location of the entire subgroup pop i .
However, after a series of experiments (see Section 3.3.1), the fitness of the vessel boundary in the fundus image may be greater than the gradient of optic disc boundary, which is possible to interfere with the optimization results of the particles. Therefore, we take the attraction between particles in adjacent subgroups into account in order to solve this problem.
The modified velocity is calculated as Equation (13).
As the system iterates, the individual agents, which are based on the interaction of the subgroup's public search and the particle's search, are drawn toward a global optimum. The position vector of each particle is updated as Equation (14).
PP and GP are also updated as iteration proceeds. The updated rules are described by Equations (15) and (16).

Algorithm
SePSO evaluates the quality of particle positions by using the radial gradient value as the fitness value. On fundus diagrams, the location with high radial gradient values include the optic disc boundary, the optic cup boundary, and the vascular region. In order to segment the clear boundary of the optic disc and reduce the interference of blood vessels and optic cup located in the central area of the optic disc, the exploration area of the entire population is confined to a relatively narrow circular area. This exploration area can not only meet the exploration needs of particles but also avoid particles falling into local optimization as much as possible. In addition, the application of active shape models transforms image segmentation tasks into a set of extreme value problems that are easy to solve by PSO. To implement this mechanism, we divide the entire particle swarm into multiple subgroups pop, and at the same time, we divide the exploration space into multiple subspaces accordingly; each subgroup solves an extreme value problem, each particle on the subgroup corresponds to a feature point on the shape model, and all subgroups form a multi-group solution of the shape model. The quality of the shape model Edge j is determined by the fitness of all particles that make up the model at their current positions.
In the search for an optimal solution, each particle is represented by a triplet (X i,j , V i,j , and PP i,j ), and shape model Edge j is defined by the position of a set of particles. The boundary of the disc is an approximate ellipse, and the position of adjacent particles on the shape model has some guiding significance for the particle. To take full advantage of this property, particles are attracted to the local optimal solution and the global optimal solution. Moreover, the movements of the particles are also affected by the attractions between adjacent particles. Shape model Edge j deforms as the iterative process progresses, ultimately finding the optimal solution.
The main flow of the proposed Algorithm 1 is shown in the pseudo-code. Set GP i = max PP i,j 7 for each subgroup i do 8 for each particlej ∈ i do 9 Update the velocity and position of particle i 10 Calculate the fitness value of particle i

Results and Discussion
This section describes the hardware facilities, software, and dataset used in the experiment and, furthermore, includes the evaluation and performance metrics of the proposed approach.

Software and Datasets
All experimental results are tested on PyCharm 2021 free community version with Python 3.8.7, AMD "Zen 3" Core Architecture with 5600X CPU and 64-bit Operating System. In addition, the fundus images used for our experimentation belongs to public datasets provided below.
The Drishti-GS is public access and available for free [21]. The dataset consists of 101 images, which is divided into 50 testing and 51 training images. The dataset is generated from Aravind eye hospital. There are four experts to segment the OD region manually, and all OD regions are fused together to generate the soft map. In this paper, we regard the region with 75% support rate as the true ground of OD.
Up to date, there are three releases of Rim-ONE datasets. The first one is segmented by five experts manually, which consists of 169 images. The second one consisting of 455 images segmented by one expert is classified into glaucoma (including the glaucoma suspicious images) and normal. The most recent one, which is used for our experimentation, consists of 159 images [22], which is collected at the Hospital Universitario de Canarias and divided into 85 images of healthy subjects, 39 confirmed glaucoma individuals, and 35 that are suspicious subjects.

Performance Metrics
The performance of the proposed method for segmenting OD when compared with the ground truth is evaluated using many evaluation metrics that can be defined according to four parameters: T N , F N ,T P , and F P .
True Negative T N is the region segmented as OD that proved to be not OD and is defined as Equation (17): where • SA is the optic disc region that is segmented; • OA is the region that belongs to ground truth; • SA is the region that belongs to the background.
False Negative F N , which is the region segmented as not OD that proved to be OD, is defined in Equation (18).
True positive T P , which is the region segmented as OD that proved to be OD, is defined in Equation (19).
False Positive F P , which is the region segmented as OD that proved to be not OD, is defined in Equation (20).
In this paper, the evaluation metrics such as Dice similarly, overlapping error, and accuracy are used to identify the level of accuracy of OD segmentation, which can be defined as Equations (21)- (23).
Accuracy: It is the measure of correctness or preciseness with respect to some standard [23]. It is calculated as provided in Equation (21).
Dice similarity: It is a metric that is used to calculate the similarity between two samples that may be images or any other data. It is calculated as provided in Equation (22).
Overlapping error: Overlapping error E is the one of the important indicators of image segmentation. In this paper, it is calculated using the detected boundary and the ground truth by Equation (23).

Parameter Influence
In order to obtain the best results with proposed method, there are some important parameters that should be adjusted. These parameters are as follows: the number of subgroups N, which affect the Edge in Section 2.1; ω, c p , c g , and c a , which affect the position update as described in Section 2.4; and the number of iterations.
Based on a large number of experiments on dataset, the proposed method produces the best solutions with the following parameter settings: N = 50, ω = 0.8, c p = c g = 1.7, c a = 0.3, and number of iteration = 100 (see Table 1). The values of T P , F P , T N , F N , Acc, Dice, and E produced by the proposed approach for optic disc segmentation are observed to be 84.88%, 0.73%, 99.27%, 15.12%, 92.28%, 90.35%, and 17.49% in the Drishti-GS dataset.
We have varied each parameter individually to observe its influence. Some of these parameters mainly affect the quality of the solutions, while some have more impact on the computation time needed to obtain the solutions. The number of subgroups N: This parameter affects the number of points that make up the boundary. The higher the value N, the closer the fitted shape is to the true boundary. However, too many subgroups increase the calculation time's complexity. There are some experiments that show the impact of this parameter on accuracy and calculation time. Table 2 provides E, Acc and the calculation time for a different number of subgroups in Drishti-GS. Figure 5 shows the optic disc segmentation in Drishti-GS with different numbers of subgroups. It can be seen clearly from Table 2 and Figure 5 that, when the number of subgroups equals to 50, good results can be achieved. In fact, if the number of subgroups is set to a higher value, better solutions can be obtained.  c p , c g , and c a : These parameters affect the velocity of particles. c p and c g are used to ensure that particles move toward the best global location. Usually, c p = c g = 2 in the traditional PSO algorithm. Therefore, the experiments start by setting these two parameters c p and c g to 2. The predict boundaries are not sufficient to fit ground truth boundary. The reason is that it is difficult to converge to optimal solutions of all the subgroups. Therefore, we introduce the attraction between adjacent particles by c a . Table 3 provides the E, Acc and Dice for different parameter settings in Drishti-GS. It can be seen that the algorithm can performs optimally when c p = c g = 1.7 and c a = 0.3. Table 3. E, Acc, and Dice for different combinations of c p , c g , and c a . The inertia weight ω: To obtain a better accuracy of OD segmentation with proposed method, an inertia weight strategy is applied to our experiments. Inertia weight ω is an important parameter in PSO, which significantly affects the convergence and exploration in PSO processes. Since the inception of inertia weight in PSO, a large number of variations of inertia weight strategy have been proposed [24]. In this paper, we compared the constant inertia weight, linear descending inertia weight, random inertia weight, and chaotic random inertia weight based on Drishti-GS dataset. Table 4 shows the different strategies of inertia weight. The parameter settings of all those experiments are N = 50, c p = c g = 1.7, c a = 0.3, and numbero f iteration = 100.  Table 5 provides E, Acc, and Dice for inertia weights with different strategies. It can be observed that the algorithm can perform optimally with the chaotic random inertia weight, which is 0.75% higher in Acc than the linear descending inertia weight, 0.17% higher in Dice, and 0.28% lower in E than the constant inertia weight.

Comparison with Other Methods
A recent comparison of optic disc segmentation methods was presented in [29] using Rim-ONE and Drishti-GS datasets. Those datasets contain disc segmentations of 169 and 101 images, and they are publicly available and are free. Table 6 shows the evaluation results for disc segmentation using different methods in Rim-ONE and Drishti-GS datasets. Moreover, the information in Table 6 is quoted from the article of N. Thakur et al. [29] in 2019.
As we can see, the proposed SePSO algorithm performs better in the Drishit-GS dataset than the best method (region growing) in the performance parameter Acc. The algorithm performs better on the Rim-ONE dataset and 2.59% higher than the region-based growth algorithm that is optimal among the four algorithms and 1.81% higher on Drishti-GS dataset. To further show performance and increase the comparability of the proposed method, additional evaluation indicators are used, as shown in Table 7.

Conclusions
In this paper, we propose an improved method based on particle swarm optimization, called SePSO, for optic disc segmentation in retinal fundus images. In the disc segmentation task, the deformation of the segmented contour is completed by changing the position of the particles, and the optimal contour is solved by iterative update. In addition, the constraint equations for particle position and velocity are optimized. The particles are additionally attracted by adjacent subgroups in addition to the attraction of local optimal solutions and global optimal solutions during flight. Based on Drishti-GS, we test the influence of different parameter of the proposed method on the segmentation effect.
Particles in subgroups can learn optimal solution information between adjacent populations in the process of optimization, which greatly enhances the anti-interference ability of particles. The proposed method has been tested using Rim-ONE and Drishti-GS datasets and compared to other state-of-the-art methods, such as methods based on superpixels, contours, thresholds, and region growth method. Experimental results show that the algorithm performs better on both datasets than the other four algorithms, which confirms its effectiveness and superiority.
In future studies, we aim to conduct the proposed SePSO approach for solving optic cup segmentation. The simultaneous division of OC and OD has great clinical medical value, and the segmentation of the OC will become the next research content of our work.
Author Contributions: J.Y. conceived the research theme and method of this article and wrote and modified the paper. Y.R. conceived the method and conducted the experiment, verified the results, and modified the paper. G.Y. conceived the research theme of this article, modified the paper, and guided the research study. All authors have read and agreed to the published version of the manuscript.

Conflicts of Interest:
The authors declare no conflicts of interest.