# A Novel Guided Box Filter Based on Hybrid Optimization for Medical Image Denoising
## 3 Proposed Methodology
Therefore, these guided filters are used as digital image filters to denoise the image, \(\hat{I}_{(x,y)}\), but these filters are linear filters [28], which are represented as  
\[\hat{I}_{(x,y)}=\sum w_{t(x,y)}*G*I_{c(x,y)} \tag{16}\]  
Here, \(w_{t(x,y)}\) represents the kernel weight value for the decimation box used, and \(G\) is represented as guidance image \(G\). In terms of coefficients, the denoised images are represented as  
\[\hat{I}_{(x,y)}=i_{k}*G_{x}*j_{k} \tag{17}\]  
Here, \(i_{k}\) and \(j_{k}\) are linear coefficients at pixel \(k\) concerning guidance image \(G_{x}\). Filter aims to minimize the cost function (i.e., the difference between the original image and the denoised image) by regularizing parameters. The cost function, \(\varphi_{(i_{k},i_{k})}\), is represented as  
\[\varphi_{(i_{k},i_{k})}=\sum_{x\in w_{k}}i_{k}*G_{x}+j_{k}-{I}_{(x,y)}^{2}+{e }i_{k}{}^{2} \tag{18}\]  
Here,  
\[i_{k}=\frac{\frac{1}{\pi}\sum_{x\in w_{k}}(G_{x}*{I}_{(x,y)}-{\mu}_{k}\hat{I}_ {(x,y)})}{\varphi^{2}+\epsilon} \tag{19}\]  
Here, the cost function is assumed as constant linear coefficients in the decimation box. The smoothness degree is represented as \(\epsilon\) and \(w\) represents the decimation box. \(\sigma\) and \(\mu_{k}\) represent the variance and mean value of the decimation box, respectively. In each decimation box, the denoised image is different for different pixels. Therefore, the average of these is taken. Like edge preservation, guided filtering is a feature. Additionally, it acts as a filter to make things more even. It labels as \"flat\" or \"high variance\" the areas of an image contaminated by noise. Pixels found to be in the exact center of flat patches have their values averaged out and replaced with new ones that have those average values. A pixel's value does not change if it is found to be in the middle of a region with a lot of variation. The degree of smoothing, also called the regularisation parameter, is used to categorize areas into low-variance \"flat patch\" regions and high-variance \"high variance\" regions. If the variance of a given patch is larger than the regularization parameter's value, then the patch is smoothed; otherwise, the variance is retained. Pixels on the far side of an image's edge are given no importance by the guided filter kernel. The gradient filter is effective in eliminating the gradient reversal artifacts. Complexity increases as the kernel size grows. The output of a box filter can be obtained using the integral image method, and each summing operation is identical to a box filter. To filter the noise-corrupted image most effectively, the appropriate smoothing degree is picked in the specified neighborhood. The degree of smoothing indicates a somewhat lenient limit on the neighborhood's standard deviation. As depicted in Figure 3, some pixels are filtered as output. Let us assume an image of size \(P\times Q\). The input image is divided into \(n\times n\) kernels, and the mean value of each kernel is the output of the decimation box. In this paper, the hybrid bio-inspired optimization approach is used to determine the filter coefficients for the image based on the amount of noise contained in the image. The guided filter is sized \(n\times n\) based on decimation boxes with \(n\) downsampling ratio, which could be further optimized using HCPSO, as illustrated in Figure 3. When calculating the size of a decimation box filter, the time complexity is \(O(m*N)\), where \(m\) is the size of the filter, and \(N\) is the total number of pixels. For filters with big kernels, this can lead to a significant increase in the amount of time required to calculate the filter's output. If we utilize an integral image, we can compute box filters in \(O(N)\) time. In this paper, the HCPSO algorithm is applied to optimize the coefficients of the decimation filter. The HCPSO algorithm is designed by combining the cuckoo search algorithm and particle swarm optimization algorithm that are capable of solving the nonlinear problems related to denoising constraints.