Preprocessing Techniques for Rectal Cancer Diagnosis using MR Images

The use of magnetic resonance (MR) Image has become more significant when treating rectal cancer. Rectal cancer can be staged more accurately with MRI, which serves as a great tool for choosing the most suitable course of action. Image pre-processing is used to improve the quality of image and making it better for analysis and further processing. The study carried out in this paper is concentrated on pre-processing methods like Gaussian and Sobel filtering. The filtering techniques were implemented on Pelvic MR images obtained from Kasturba Medical College (KMC), Manipal. The findings suggest that Sobel filtering had a superior output image quality, indicating its potential as a preferred preprocessing technique for enhancing Pelvic MR images in rectal cancer diagnosis and treatment planning. The output image efficiency is calculated by Peak to Signal Noise Ratio (PSNR) and Mean Square Error (MSE).


INTRODUCTION
Medical image preprocessing plays an important role in the field of MR images, aimed at addressing challenges like noise, artifacts, and variations in image quality.Though raw images from magnetic resonance imaging are frequently unusable for precise interpretation, they do offer detailed visualizations of soft tissues.Preprocessing involves noise reduction, intensity normalization, and contrast enhancement, ensuring image clarity.Digital image processing techniques are widely used in computer-aided diagnosis (CAD x ) systems for the early detection of different types of cancer in patients.Preprocessing is an essential step in the development of Computer-Aided Diagnosis (CAD x ) systems that ensures both the accuracy and reliability of medical image analysis.Preprocessing techniques, which are specifically applied to modalities such as MRI, improve the quality of input data for CAD x algorithms.Image clarity is improved by noise reduction, while intensity normalization and contrast adjustments ensure consistent feature extraction.Before the images are taken into consideration for diagnosis, pre-processing must be performed on them.TNM (Tumor, Node and Metastasis) Stage diagnosis is essential for effective treatment.However, using MR images to manually identify T-stage in medical professionals is challenging, time-consuming, and laborious [1].The TNM staging system serves as the primary base for the clinical staging of rectal cancer.The letter T (Tumor) denotes the location and size of the tumor.The term "node" refers to the location, size, and degree of the tumor's lymph node spread.Metastasis, represented by the letter M, indicates how and where cancer cells have spread to other body regions.Based on the extent of the tumor's infiltration into the colon wall and whether it has spread to nearby lymph nodes or organs, tumors are categorized in the TNM staging system for rectal cancer [2].The treatment strategy for rectal cancer is largely dependent on the stage of the disease.In the T1 stage, the Submucosa has been invaded by tumors.T2 stage indicates the Invasion of tumors in muscularis propria.T3 stage depicts that the tumors have spread from muscularis propria affecting nearby tissues like non-peritonealized perirectal tissues or subserosa but have affected the surrounding organs or mesorectal fascia and in the T4 stage, tumor has directly infiltrated other organs and has perforated the visceral peritoneum [3].The N stage refers to whether the cancer has affected the lymph nodes.It is classified into three categories, N0 indicates absence of metastasis in local lymph nodes.N1 denotes metastasis has been detected in 1-3 perirectal lymph nodes.N2 indicates metastasis present in 4 or more regional lymph nodes.M stage refers to whether the cancer has spread to distant organs or tissues.It is classified as M0 refers to no distant metastasis, or M1 indicates the cancer has been spreading to different parts of the body.Pelvic MR images are preprocessed using techniques like Gaussian and Sobel filtering to lower noise and boost overall clarity.This makes anatomical structures and abnormalities related to rectal cancer easier to detect.The MR images are prepared for later analytical procedures like segmentation, feature extraction, and classification through preprocessing.These preprocessing methods enhance image quality, which helps to produce more precise and insightful data analysis.Metrics like PSNR and MSE are used to quantitatively assess the efficacy.These metrics offer a quantitative evaluation of how well the preprocessing methods improve image quality and lower errors.Preprocessing pelvic DICOM images is vital for improving diagnostic accuracy and image quality.Common challenges, such as noise and artifacts from patient movement, require specialized techniques for denoising and artifact correction.Contrast enhancement ensures optimal visualization of pelvic structures with subtle differences.Standardization normalizes pixel values and spatial resolutions for consistent comparisons across different imaging systems.Image registration aligns images from various modalities or time points, aiding comprehensive analysis.Preprocessing also facilitates segmentation, crucial for tasks like tumor detection.CAD x system assists radiologists in the decisionmaking process by offering precise diagnosis and thereby serving as a valuable second opinion.Preprocessing sets the foundation for reliable MR image analysis, enhancing data quality and aiding accurate diagnostic interpretation.

LITERATURE REVIEW
Z. Sang et.al., [4] The proposed FCTformer presents an innovative approach for accurate segmentation of rectal tumor.By integrating Convolutional operations and Transformer modules, it creates a dual-faceted multiscale feature representation, leveraging both global and local features.This design enhances the model's ability to capture comprehensive semantic features and intricate details, addressing challenges like low-contrast imaging and substantial shape variations in rectal cancer instances.The incorporation of a Dual-Attention (DA) decoder capitalizes on features across different scales, improving segmentation accuracy.Additionally, the Prediction Aggregation Unit (PAU) sharpens tumor boundaries and retains fine details, especially critical during repetitive downsampling stages.Experimental results with 362 instances showed a Dice Similarity Coefficient (DSC) of 0.827, surpassing existing methods.
Li et.al., [5] proposed three-dimensional segmentation model of rectal tumor employs a systematic approach.It begins with image preprocessing to address background and target region imbalances.Designed within the framework is a dual-path fusion network, which incorporates a residual encoder dedicated to spatial detail and a transformer encoder specialized in capturing global contour information.In the decoding phase, information from both paths is seamlessly merged and decoded.Addressing the challenges posed by the complex morphology and diverse sizes of rectal tumors, an innovative multi-scale fusion channel attention mechanism is introduced.This mechanism adeptly captures contextual information across various scales, enhancing the model's ability to handle intricacies in tumor characteristics.The model's effectiveness is demonstrated through the visualization of 3D rectal tumor segmentation results Li et.al., [6] proposed rectal tumor segmentation algorithm combines an asymmetric U-Net with multi-scale dilated convolutional inputs and convolutional conditional random fields (ConvCRFs).The algorithm features a multiscale convolutional input module for preprocessing, enriching global contextual semantic information extraction.The asymmetric U-Net, coupled with ConvCRFs, fine-tunes segmentation results for enhanced accuracy.Experimental results on a medical dataset showed a Dice coefficient of 0.876 on T2WI images and 0.851 on DWI images, indicating significant clinical relevance for rectal tumor segmentation algorithms.
Linsalata et al., [7] investigated the influence of image preprocessing on estimating radiomic features in CT scans of locally advanced rectal cancer (LARC).Evaluated 105 features' reproducibility using images from 20 patients, varying resampling voxel sizes, interpolation algorithms, and bin widths.Findings indicated shape features exhibited excellent reproducibility, first-order features demonstrated good to moderate reproducibility, while textural features showed moderate to poor reproducibility.Some features with good ICC had median CV values over 15%.Notably, textural features, and to a lesser extent, first-order features, exhibited significant correlations with resampling voxel size or bin width.
Gayathri et al., [8] proposed a novel approach, CNN-ResNeXt, for automated tumor segregation and classification.Utilizing MRI images from BRATS datasets, the method involves data smoothing, enhancement with batch normalization, and feature extraction using the AlexNet model.An Adaptive Whale Optimization (AWO) approach optimizes feature selection for segmentation, performed by CNN-ResNeXt.The model achieves an impressive 98% accuracy for the tumor core class, surpassing existing models.
Srivaramangai et al., [9] proposed several kinds of pre-processing methods, which includes methods for image enhancement and noise reduction.Initially, MRI images of rectum and colon cancer are converted into gray scale images.Statistical parameters like Signal to Noise Ratio (SNR), Structural Similarity Index FSIM, PSNR, AMBE, CNR, and MSE and are used to measure the image enhancement.High pass filters are used to sharpen images that have been contrast-enhanced.Several types of noise, represented as Poisson, Gaussian, salt-and-pepper, and speckle noise are taken into consideration.The adaptive median filters, mean and median filters are used to remove noise.MSE and PSNR are used to determine the ideal filter.
Suhas et al., [10] suggested a new method that adds features to the current median filter.The other three image filtering algorithms like Median, Max filter, and Gaussian filter, Min filter, and Arithmetic Mean filter were then used to examine the experimental results of the suggested approach.MRI images of the brain and spinal cord were processed using the filters.Statistical metrics such as SNR, PSNR and root mean square error (RMSE) were employed.Traverso et al., [11] The reproducibility of quantitative imaging features or radiomics, derived from apparent diffusion coefficient (ADC) maps of patients with rectal cancer is examined in this work.The study involved 56 patients from two different clinics, which focused on the impact of noise in ADC images, manual tumor delineation, pixel size resampling, and intensity discretization on various features.Results suggest that intensity distribution histogram-derived features are less sensitive to manual delineation and image perturbations.
Linsalata et al., [12] The study aimed to assess the impact of image preprocessing on the estimation of radiomic features from CT scans in locally advanced rectal cancer (LARC).Using CT images from 20 LARC patients, the study examined 105 radiomic features across seven classes.Various interpolation algorithms, resampling voxel sizes and bin widths were employed.The coefficient of variation (CV) and intraclass correlation coefficient (ICC) and were used to measure reproducibility, revealing nominally excellent reproducibility for shape features, moderate to poor for textural features and good to moderate for first-order features.Notably, textural features, and to a lesser extent, first-order features, were significantly biased by preprocessing.
Xing et al., [13] Proposed a CNN model which is equipped with a multi-layer structure designed to eliminate salt and pepper noise.The structure incorporates batch normalization, padding, and a rectified linear unit.In a transformative step, all pixels with values of 255 are substituted with 0, thereby transforming bipolar salt and pepper noise into unipolar noise.This alteration accelerates the training process and enhances denoising performance.The denoiser proves beneficial for images plagued by a substantial number of interference pixels, mitigating the risk of misjudgment and minimizing errors.
Poornachandra et al., [14] suggested that MR images had undergone preprocessing.The BRATS dataset was subjected to 50 iterations of the N4ITK algorithm with a B-spline order of 3. Additionally, the data within each input volume was normalized by dividing by the standard deviation of the volume and subtracting the mean of the volume.An altered form of N3 (nonparametric nonuniformity normalisation) is called N4ITK.
Grigas et al., [15] suggested the use of a technique known as HR-MRI-GAN, a hybrid transformer generative adversarial network that can improve 2D T1w MRI slice image resolution and reduce noise.Experiments demonstrated that the method can subjectively generalize to unseen data and quantitatively outperforms other SOTA methods in terms of perceptual image quality.
Mnassri et al., [16] proposed a research that compares various contrast enhancement techniques, such as Global Histogram Equalization (GHE), knee function and gamma correction based on Singular Value Decomposition with Discrete Wavelet Transform (SVD-DWT) method (KGC-DWT-SVD) and Adaptive Gamma Correction (AGC).These techniques were used on MR (Magnetic Resonance) images of the brain and spinal cord in multiple sclerosis patients.Entropy (H), PSNR, MSE, feature similarity index measurement (FSIM), structure similarity index measurement (SSIM), and other statistical parameters were assessed.Sheela et al., [17] presented a pre-processing method for brain tumor detection that resamples images after applying translation and geometric correction, which causes pixels to be redistributed according to their spatial displacements.Three sampling algorithms-Bilinear Interpolation approach, Nearest Neighbor technique and the Cubic Convolution technique are used to obtain resampling and Enhancement of Gray Scale Contrast, Markov Random Field is used for noise reduction.D. N. Lohare et al., [18] suggested a method for pre-processing the brain tumor image using techniques for image enhancement and noise reduction, which improves the image quality for edge detection and precise tumor positioning.Gaussian high pass filter is used to improve input image, and filters are used to extract noise from the slice in order to sharpen the image.

TYPES OF NOISES
The type of noise in an image cannot be decided by perception.The respective denoising technique and noise model selection are solely determined by the type of image and its application.The characteristics of various noise types are-

Salt and Pepper Noise:
A type of random noise that appear isolated, white and black pixels scattered throughout an image.It is commonly found in images that have been corrupted during transmission or storage.This type of noise is caused by data transfer errors.In salt pepper noise, a and b have different values.The average probability for each is below 0.1.The corrupted pixels exhibit an alternating pattern, set to the minimum and maximum values, resulting in an image with a "salt and pepper" appearance.The Probability Density Function (PDF) is expressed as follows: In the image, intensity "b" appears as light dot.If b>a, and conversely, intensity "a" will appear as a dark dot and Unipolar noise is the term used to describe impulse noise when or is zero.If neither probability is zero or approximately equal then, impulses noise will resemble salt and pepper granules randomly distributed over the image.

Gaussian Noise:
A type of random noise that appears as a smooth, continuous distribution of values.These noise are found in low-light images or images captured with high ISO settings.Gaussian noise is generally considered to be statistical noise whose PDF is equal to normal distribution.The signal's distribution of Gaussian noise is constant.The pixels in a noisy image are composed of the sum of the original pixel values and a randomly generated Gaussian noise value.A Gaussian distribution's PDF has a bell-shaped form.
Where, z represents grey level, indicated mean value, denotes standard deviation.

Poisson Noise:
A type of noise that occurs in images with low photon counts, such as medical or scientific imaging.It appears as a random variation in brightness and can be difficult to remove without losing important image information.The nonlinear responses from image detectors and recorders give rise to Poisson noise.This terminology is employed due to the involvement of random electron emission in the detection and recording processes, following a Poisson distribution with a mean response value.Assuming a variance of one, Imagedependent term is characterized as having a standard deviation, as in a Poisson distribution, the mean and variance are equivalent.
Where represents rate of events in a fixed intervals.

Speckle Noise:
Noise that appears as grainy texture or small, bright, and dark spots in an image.This lowers image quality in diagnostic procedures by producing a backscattered wave appearance in images due to numerous microscopic dispersed reflections passing through internal organs.Because of this, it becomes more challenging for the viewer to identify small details in the images.It is commonly found in ultrasound or radar imaging.

Rician noise:
Rician noise typically occurs when the magnitude of the signal is superimposed on a background of Gaussian noise.It frequently occurs in situations where random noise conceals the true signal.In medical imaging, such as in MRI, Rician noise can impact the accuracy of intensity measurements, making it challenging to differentiate between the true signal and noise, especially in low signal-to-noise ratio (SNR) scenarios.When the true signal is superimposed on top of a background of Gaussian noise, the noise is known as Rician noise.The PDF of Rician noise is given by: Where, x is the observed intensity, A is the amplitude of the true signal, is the standard deviation of the background Gaussian noise, 0 is the modified Bessel function of the first kind and order zero

METHODOLOGY
The pre-processing methodology for rectum MRI image involves several sequential steps as shown in Figure 1.Initial phases involve the conversion of MR of rectal cancer images into grayscale representations, followed by a meticulous contrast enhancement process.Advanced filtering techniques, including Gaussian and Sobel filters, are applied to refine the quality of the grayscale images.These filters play a pivotal role in accentuating pertinent features and edges, contributing to a more detailed and precise image representation.
Quantitative assessment of the image enhancement is done through the analysis of statistical parameters such as PSNR and MSE.These metrics serve as objective measures to ensure the attainment of optimal image quality standards.The main aim is to elevate the diagnostic potential of rectum MRI images, establishing a robust foundation for precise and reliable analysis in the realm of rectal cancer detection and characterization.

Dataset Description:
The pelvic DICOM MR Images are obtained from the Radiology Department of Kasturba Medical College, Manipal.With a specific focus on patients meeting certain criteria: MR scans conducted within two weeks before surgical resection or chemo-radiation, each patient having a single lesion, patient's diagnosed with rectal malignancy, and the tumor located within 15 cm above the anal verge.Excluded from the study are images from patients with a history of previous abdominal malignancy/surgery, poor image quality, distant metastases, or those previously treated with radiation therapy or chemotherapy for rectal cancer.

Gaussian Filter
The Gaussian filter is a popular method for image processing that blurs or smooths images.It uses a Gaussian kernel, a twodimensional matrix of weights produced from the Gaussian function, to function as a convolution filter.The main goal of filter is to make images appear visually smoother by suppressing fine details and reducing noise.Users can modify filter size and standard deviation, among other parameters, to regulate the degree of smoothing.Applications for the Gaussian filter include image smoothing, noise reduction, and computer vision pre-processing tasks.The Gaussian is based on the Gaussian distribution, which is a continous probability distribution function.The 1D Gaussian distribution function is given by: 1D is used to generate a 2D Gaussian kernel by taking two outer 1D Gaussian functions (one of each dimension-horizontal and vertical).The 2D Gaussian function is given by Here, i and j are pixel coordinates relative to the center of the kernel, is the standard deviation.The Gaussian filter is applied an image by convolving the image with this Gaussian kernel.Sliding the kernel over each pixel in the image and computing the weighted sum of the pixel values based on Gaussian weights represent the convolution operation.First we define the size of the Gaussian filter kernel.It's usually an odd-sized matrix (e.g., 3x3, 5x5, 7x7) for symmetry and a betterdefined center.Then Place the Gaussian kernel over each pixel in the image and perform a convolution operation by multiplying each kernel value with the corresponding pixel value in the image and summing up the results.The result of this operation is the new value of pixel in the output image.When applying the filter, the kernel might extend beyond the image boundaries.Techniques to handle borders include zero-padding (extending the image with zeros), clamping (replicating the border pixels), or reflecting (mirroring the image at the borders).To maintain image brightness and avoid intensity changes caused by the filter, normalize the output pixel values and then Calculate the normalization factor by summing all the values in the Gaussian kernel.Divide each pixel value in the output image by this normalization factor.The resulting image after the Gaussian filter will have reduced noise and smoother transitions between pixels as shown in Figure 2.

Sobel Filter-
The Sobel filter is a popular edge detection filter used in image processing.It is particularly effective at detecting edge in images.The filter highlights edges in an image by assigning higher intensity values to pixels with significant intensity changes.It is essential in computer vision applications for identifying boundaries and transitions within images.This process effectively enhances edges and highlights significant features within the rectum MRI images, contributing to improved image quality and subsequent analysis.2-D pixel array can be transferred into statistically uncorrelated data set to improve the removal of redundant data, which reduces the amount of data needed to represent a digital image.The Sobel filter consists of two separate 3 x 3 convolution kernels, one for horizontal changes and one for vertical changes.These kernels are used to perform convolution with image to compute approximations of the derivatives with respect to x and y axis.The Sobel kernels are shown below The convolution operation involves sliding these kernels over the image and computing the weighted sum of pixel values at each position.Resulting gradient approximation and are then used to calculate the gradient magnitude G has follows The gradient direction can be calculated as, = The input image is converted into grayscale.This reduces the computation required and simplifies edge detection.The Sobel operator consists of two 3x3 convolution kernels -one for detecting edges in the horizontal direction and the other for the vertical direction.
For each pixel, the horizontal and vertical gradients are computed using the convolutions with the Sobel kernels.The magnitude of the gradient are calculated.Threshold value is defined to classify pixels as edges or non-edges based on the gradient magnitude.Pixels with gradient magnitudes above the threshold are considered part of an edge as shown in Figure 3. Optionally, the detected edges can be further enhanced or highlighted for better visualization or subsequent processing.
The performance and quality of the final output image are assessed using various statistical parameters.PSNR and MSE are used to assess the denoised image's performance and quality of enhancement [7].MSE between two images is the average of the pixel differences across the image.MSE displays the average of the pixels across an image, is computed as follows for two × The PSNR measures the relationship between a signal's maximum potential power and the noise distortion power that degrades the signal's representation quality.A higher PSNR typically denotes a higher quality reconstruction.When PSNR is calculated, it is seen that the MSE term in the denominator.MSE estimates error.If the error is high, (low quality image), then PSNR value will be lower and if the error is less (better quality image), then PSNR will be high.

CONCLUSION AND FUTURE SCOPE
CAD x for rectal cancer involves advanced image processing and machine learning to enhance the accuracy of diagnosis.The process includes image pre-processing, segmentation, feature extraction, and the use of machine learning algorithms to analyze and interpret medical images.It acts as a decision support system, providing additional information to clinicians for improved decision-making.Overall, CAD x holds promise in early detection and personalized Results showed that, the method effectively removed noise from the medical image while preserving its structural details, according to the results.This method will aid in increasing the accuracy of MR images for simple diagnosis.In future, various other filters can be implemented for rectal cancer.Further, segmentation can be performed using the pre-processed images.

Figure 1 :
Figure 1: Block diagram depicts the Image enhancement techniques

Figure 2 :
Figure 2: Workflow diagram of Gaussian Filter

Figure 3 :
Figure 3: Workflow diagram of Sobel Filter This paper analyzes two different techniques for digital image enhancement, sharpening, and denoising in order to investigate the preprocessing of MR images of the rectum.Appropriate techniques that produce optimal results for various image quality metrics are identified.The rectum MRI images from the datasets acquired from KMC, Manipal were used for the experiment.The preprocessing method provides clear image with no artifacts and no information loss.Image pre-processing was performed on 2D slices of DICOM images.Gaussian filter was used to reduce noise and blurriness from images.Based on the Gaussian distribution, the Gaussian smoothing operator determines a weighted average of the surrounding pixels.Using the Gaussian filter the PSNR and MSE obtained was 43.90 and 63768.82respectively as shown in the Figure4.A gradient-based technique called the Sobel filter examines for major changes in an image's first derivative.It uses 3x3 convolution

Figure 4 :
Figure 4: Results of Gaussian Filter

Figure 5 :
Figure 5: Results of Sobel Filter

Table 1 :
comparison between Gaussian Filter and Sobel Filter