# Improving Prostate Image Segmentation Based on Equilibrium Optimizer and Cross-Entropy
## 2 Image Segmentation and Minimum Cross-Entropy  
[PERSON] [45] introduced the concept of entropy in the context of comparing two probability distributions, defined over the same set. The measure of information-theoretic distance between these two distributions is known as cross-entropy or divergence.  
In image thresholding, the primary objective is to identify threshold values that effectively segment regions within an image. The image histogram can be interpreted as a probability distribution representing the occurrence of pixel intensity values. Statistical methods are then applied to distinguish between different regions or classes within the image. One such method is the parametric criterion based on cross-entropy, as proposed by [PERSON] [45]. This criterion compares two distributions, \(\mathbf{J}=\{j_{1},j_{2},\ldots,j_{N}\}\) and \(\mathbf{G}=\{g_{1},g_{2},\ldots,g_{N}\}\), and calculates cross-entropy using the following expression:  
\[D(\mathbf{J},\mathbf{G})=\sum_{i=1}^{N}j_{i}\log\frac{j_{i}}{g_{i}} \tag{1}\]  
In 1993, [PERSON] and [PERSON] [11] introduced the use of cross-entropy, a concept rooted in information theory, for solving binary segmentation problems. Their approach, known as the minimum cross-entropy thresholding (MCET) method, processes the image histogram by dividing it into subsets and computing the cross-entropy for each subset. The goal is to determine the set of threshold values that minimizes the cross-entropy, resulting in optimal segmentation. For a grayscale 8-bit image, pixel intensity values range from 0 to 255, with the maximum value denoted by \(L=255\). A given threshold \(th\) divides the image into two regions as follows:  
\[\mathbf{I}_{t}(x,y)=\left\{\begin{array}{rl}\mu(1,th),&\mathbf{I}(x,y)<th, \\ \mu(th,L+1),&\mathbf{I}(x,y)\geq th,\end{array}\right. \tag{2}\]  
where  
\[\mu(a,b)=\sum_{i=a}^{b-1}ih^{Gr}(i)/\sum_{i=a}^{b-1}h^{Gr}(i) \tag{3}\]  
Following this idea, the expression can be rewritten in the form of an objective function:  
\[f_{Cross}(th)=\sum_{i=1}^{th-1}ih^{Gr}(i)\log\biggl{(}\frac{i}{\mu(1,th)} \biggr{)}+\sum_{i=th}^{L}ih^{Gr}(i)\log\biggl{(}\frac{i}{\mu(th,L+1)}\biggr{)} \tag{4}\]  
Originally, the minimum cross-entropy thresholding (MCET) method was developed to handle a single threshold value, which divides the image histogram into two distinct classes. However, in many cases, segmenting an image into only two regions is insufficient for accurately representing more complex scenes. To overcome this limitation, the MCET problem can be extended into a multilevel formulation, which allows for partitioning the histogram into more than two classes, as shown below:  
\[f_{Cross}(th)=\sum_{i=1}^{L}ih^{Gr}(i)\log(i)-\sum_{i=1}^{th-1}ih^{Gr}(i)\log (\mu(1,th))-\sum_{i=th}^{L}ih^{Gr}(i)\log(\mu(th,L+1)) \tag{5}\]  
The multilevel version of the MCET takes a set of \(k\) thresholds in the form of a vector \(\mathbf{th}=[th_{1},th_{2},\ldots,th_{k}]\):\[f_{Cross}(\mathbf{th})=\sum_{i=1}^{L}ih^{Gr}(i)\log(i)-\sum_{i=1}^{nt}H_{i} \tag{6}\]  
where \(q\) corresponds to the entropies and thresholds to calculate.  
\[H_{1}=\sum_{i=1}^{th_{1}-1}ih^{Gr}(i)\log(\mu(1,th_{1})) \tag{7}\]  
\[H_{q}=\sum_{i=th_{q}-1}^{th_{q}-1}ih^{Gr}(i)\log(\mu(th_{q-1},th_{q})),1<q<k\]  
\[H_{k}=\sum_{i=th_{k}}^{L}ih^{Gr}(i)\log(\mu(th_{q},L+1))\]