## 2 Materials and Methods
### Mathematical Formulations for Detecting Gaussian Noise in CT and MRI Images  
Preliminary: In conventional image denoising and tumor detection models, the training processes for these two tasks are typically separate. We aim to integrate the denoising and detection tasks into a unified model. To detect Gaussian noise in CT and MRI images, we first need a mathematical noise model, followed by a model for estimating the parameters of Gaussian noise, typically the mean \((\mu)\) and variance (\(\sigma^{2}\)). Here is a structured approach:  
1. Gaussian Noise Model  
In imaging, Gaussian noise \(n\) can be mathematically represented as:  
\[\sim\mathcal{N}\Big{(}\mu,\sigma^{2}\Big{)} \tag{12}\]  
where \(\mathcal{N}\) represents a normal Gaussian distribution with the mean \(\mu\) and variance \(\sigma^{2}\).  
* \(\mu\): The mean of the distribution, indicating the central value around which noise values are distributed.
* \(\sigma^{2}\): The variance of the distribution, indicating the spread of noise values around the mean. A higher variance corresponds to greater deviations from the mean.  
Gaussian noise is a bell-shaped curve where most noise values are concentrated near the mean, \((\mu)\), with fewer extreme deviations. For a noisy image \(y\), the observed image \(y\) is modeled as the sum of the true image \(x\) and Gaussian noise \(n\):  
\[y=x+n\]  
Here, \(y\) is the noisy image (CT or MRI), \(x\) is the underlying clean image that we aim to recover, and \(n\) is the Gaussian noise that affects the image.  
1. Estimating Gaussian Noise Parameters (Mean and Variance)  
Gaussian noise estimation involves assessing the noise in regions assumed to be homogeneous (i.e., areas with little to no variation due to tissue uniformity). Here are the steps for estimating \(\mu\) and \(\sigma^{2}\):  
Mean (\(\mu\)) Estimation  
Since Gaussian noise is often assumed to have a zero mean in medical images, an initial assumption is  
\[\mu\approx 0\]  
However, in cases where there might be a slight bias, we can estimate the mean. \(\mu\) of the noise using a region in the image where the intensity is relatively constant:  
\[\mu=\frac{1}{N}\sum_{i=1}^{N}y_{i} \tag{13}\]  
where \(N\) is the number of pixels in the selected homogeneous region, and \(y_{i}\) is the pixel values.  
Variance (\(\sigma^{2}\)) EstimationTo estimate \(\sigma^{2}\), we calculate the variance of pixel values in the homogeneous region. Given a sample of \(N\) pixel values \(\{y_{i}\}\) in this region, the variance \(\sigma^{2}\) can be estimated as:  
\[\sigma^{2}=\frac{1}{N-1}{\sum_{i=1}^{N}{(y_{i}-\mu)}^{2}} \tag{14}\]  
An alternative approach, particularly in larger images, is to use a sliding window over the image to calculate local variance. The average of these local variances provides an estimate of \(\sigma^{2}\).  
* Overall Noise Detection Formula  
Bringing it all together, the formula for Gaussian noise detection in a given CT or MRI image region is:  
\[\mu=\frac{1}{N}{\sum_{i=1}^{N}{y_{i}}},\ \sigma^{2}=\frac{1}{N-1}{\sum_{i=1}^{N}{(y_{i}- \mu)}^{2}} \tag{15}\]  
where  
* \(y\) represents the pixel intensities in a homogeneous image region;
* \(N\) is the number of pixels in this region;
* \(\mu\) and \(\sigma^{2}\) represent the mean and variance of Gaussian noise in that region, providing essential parameters for further denoising.