# Improving Prostate Image Segmentation Based on Equilibrium Optimizer and Cross-Entropy
## 3 Equilibrium Optimizer  
The EO is a nature-inspired optimization algorithm that models the process of reaching equilibrium in a control volume, akin to the balancing of mass in a physical system [25]. In this article, each particle within the search space represents a potential segmentation of the prostate region in an MRI scan. EO iteratively updates these segmentation solutions using three key mechanisms: the equilibrium concentration, which corresponds to the best segmentation found so far; the deviation of a particle (segmentation) from this equilibrium; and a refinement process that further improves the accuracy of the segmentation. These components work in tandem to balance exploration (trying new segmentation possibilities) and exploitation (refining existing segmentations), ensuring efficient convergence on an optimal prostate segmentation. The mathematical model guarantees that the EO efficiently narrows down the best segmentation, making it suitable for complex medical image analysis tasks such as MRI prostate segmentation. Diving deeper, the whole model could be described as a first-order differential equation in which the rate of change of mass is equal to the mass entering plus the amount of mass already in the system minus the mass leaving the system. This is defined in the following equation:  
\[V\frac{dC}{dt}=QC_{eq}-QC+G \tag{8}\]  
When an equilibrium is reached, the rate of change is equal to 0. The equation can then be rearranged to obtain the concentration in the control volume (C), as in Equation (9):  
\[C=C_{eq}+\left(C_{0}-C_{eq}\right)F+\frac{G}{\lambda V}(1-\mathrm{F}) \tag{9}\]  
where \(\lambda=\sqrt[Q]{}\) is the turnover rate, and \(F\) is computed as:  
\[F=\exp[-\lambda(\mathrm{t}-t_{0})] \tag{10}\]  
The concentration of particles in the EO is updated using the three terms described in Equation (9). The first term is called the equilibrium concentration, which is of the best-so-far solutions randomly selected from the equilibrium pool, the second is the difference between the concentration and the equilibrium state of a particle, and lastly, the third term acts as a exploiter, or solution refiner. The initial concentration is based on the number of particles and dimensions with random initialization in the search space. This process is modelled as:  
\[C_{i}^{initial}=C_{min}+rand_{i}(C_{max}-C_{min})\qquad i=1,2,\ldots,n \tag{11}\]  
The equilibrium state is the final convergence state of the algorithm. At the beginning of the process, there is no knowledge of the equilibrium, and the candidates are based on trial and error. Based on different kinds of experimentation, one might use a different number of candidates (in this case, there were four candidates plus an average). The next key component in the concentration update rule is the exponential term \(F\). Defining this term precisely will help the EO maintain an effective balance between exploration and exploitation. Given that the turnover rate in a real control volume can fluctuate over time, lambda is modeled as a random vector within the range [0, 1]. \[\vec{F}=e^{-\overline{\lambda}(t-t_{0})} \tag{12}\]  
From Equation (10), time \(t\) is defined as a function of the current iteration \(Iter\) where the maximum budget of iterations to find the best solution is \(Max\_iter\). \[t=\left(1-\frac{Iter}{Max\_iter}\right)^{\left(a_{2}\frac{Iter}{Max\_iter} \right)} \tag{13}\]  
where \(a_{2}\) is a constant value used to represent exploitation ability. The EO also considers:  
\[\vec{t}_{0}=\frac{1}{\overline{\lambda}}\,\ln\left(-a_{1}sign(\vec{r}-0.5) \left[1-e^{-\overline{\lambda}t}\right]\right)+t \tag{14}\]  
for slowing down the search speed. \(a_{1}\) and \(a_{2}\) are 2 and 1, respectively, and \(r\) is a random vector between 1 and 0. The generation rate (\(G\)) function is used to provide the exact solution by improving the exploitation phase.