## 3 Proposed Method
### Image Segmentation as an Optimization Problem  
The proposal of the present investigation for phase 1 of the method consists of the modification of the meta-heuristic algorithms previously mentioned in Section 2, and its application to the segmentation of mammography images. Performing the characterization of the mammographic image through the use of meta-heuristic algorithms outlines the problem of segmenting the image as an optimization problem. For this purpose, the Dunn index definition is considered as the objective function in all cases. We use the Dunn index [43] as the fitness function for the meta-heuristic algorithms, so that the higher the Dunn index, the better the segmentation. Thus, in the three meta-heuristic algorithms, this index is the objective function to be maximized, and it is defined in Equation (3). We calculate this index as the minimum outer-cluster distance over the maximum inter-cluster distance:  
\[f=\frac{\textit{Minimum distance between pixels of a different group}}{\textit{Maximum distance between pixels of the same group}} \tag{3}\]  
The optimization function allows you to calculate the dispersion between the pixels of different groups and pixels of the same group. It is sought to maximize this function since we prefer for the numerator to be a very large value and the denominator to be a tiny value. The distance calculated in Equation (3) is the Minkowski distance of order \(p=1\). This distance for the order \(p\) is defined Equation (4) with \(p\geq 1\). \[(\sum_{i=1}^{n}\left|x_{i}-y_{i}^{\prime}\right|^{p})^{\frac{1}{p}} \tag{4}\]  
The Minkowski distance for order 1 is reduced to a difference between pixel values between 0 and 255. Three-dimensional vectors for the coding of the solutions are used; the components are defined in the interval [0,255], and represent a grey level. Three components are defined since it is desired to segment the image into three regions: background, breast area, and lesion. An example of this coding is shown in Figure 3. Figure 3 represents an individual with three components, each of them representing a grey level. Figure 3: Example of segmentation using the solution of Individual 1. This coding allows us to consider each solution as a candidate segmentation. Considering the solution of Figure 3, where the components represent a region of the image, we can obtain segmentation, as shown in the same figure, for Individual 1. For each pixel in the image, we calculate the distance to each component value, and we will assign the pixel to the component with the lowest distance. According to [PERSON] et al. [44], the evaluation of the segmentation uses the average squared color error (\(F\), Equation (5)), which penalizes over-segmentations, and its improved version (\(F\), Equation (6)), which penalizes segmentations with a much greater number of small regions. \[F=\sqrt{N}\;\sum_{j=1}^{N}\frac{ej^{2}}{\sqrt{Sj}} \tag{5}\]  
\[F^{\prime}=\frac{1}{1000*SI}\sqrt{\sum_{b=1}^{MaxArea}N(b)^{1+\frac{1}{b}}}\; \sum_{j=1}^{N}\frac{ej^{2}}{\sqrt{Sj}} \tag{6}\]  
\[ej^{2}(Rj)=\sum_{p\in Rj}\left(Cx(p)-\hat{\mathbb{C}}x(Rj)\right)^{2} \tag{7}\]  
\[\hat{\mathbb{C}}x(Rj)=\frac{\sum_{p\in Rj}\mathbb{C}x(p)}{Sj} \tag{8}\]  
where \(N\) represents the number of regions in the image, \(Sj\) is the quantity of pixels in the region \(j\), \(SI\) is the area of the image, \(N(b)\) is the number of regions of the segmented image that have exactly \(b\) units of area, \(ej^{2}\) is the squared colour error of region \(j\) defined in Equation (7). \(Cx(p)\) is the value of component \(x\) for pixel \(p\) and \(\hat{\mathbb{C}}x(Rj)\) is the average value of component \(x\) in the region \(j\) is defined in Equation (8). In Figure 4, you can observe an example of the use of the Dunn index to identify the best segmentation. We observe three individuals with three components, where each component represents a grey level used to generate the segmented image.