de noise report 1
TRANSCRIPT
Synopsis
The main objective of our project is de-noising of MR brain images.
The MR images have poor quality and low signal to noise ratio, major
concern of our project is to improvise and make it easier for analysis. The
project deals with implementation, testing and evaluation of de-noising
algorithm for MR brain image.
The project focuses on denoising of the MR image using thresholding
and filters. Here an attempt is also done to compare performance of three
filters using matlab. This comparison is done by statistical analysis
considering entropy, mean and contrast value and most effective filter is
found.
CHAPTER: 1
INTRODUCTION
1. INTRODUCTION
Basic idea behind denoising algorithm is to help the medical analysts with
easy detection of unwanted growth in brain like tumours. Our project also
involves performance evaluation of three different filters. Based on the
results of this evaluation we identify the best of the three.
The ultimate challenge of the project is to develop matlab code to
combine imaging technology with a workable diagnostic system that is
capable of detecting tumours in its early stages. The presence of noise in a
digital image increases the complexity in image analysis. An unwanted film
artifact which obstructs the view of the image as well as the noise present is
eliminated by pre processing techniques.
1.1 BRAIN TUMOUR
In the evolution of healthcare services, there is an increasing need for
greater effective use of imaging data in medical diagnosis and individual risk
assessment, treatment selection, and disease prevention. Brain tumour is the
second leading cause of cancer death. The incidence of brain tumour is
increasing rapidly, particularly in older population as compared to younger
ones[1]. A brain tumour is an abnormal growth of cells within the brain or
inside the skull, which can be cancerous or non-cancerous. Tumours can
directly destroy all the healthy brain cells. It can also indirectly damage the
healthy cells by crowding other parts and causing inflammation, brain
swelling and pressure in the skull. Brain tumour cells differ from normal
cells in a number of ways, which helps in its detection.
1.2 Magnetic Resonance Imaging (MRI):
Magnetic resonance is a complex interaction between hydrogen
protons in biologic tissues, a static magnetic field i.e the magnet, and energy
in the form of radiofrequency (RF) waves of a specific frequency introduced
by coils placed next to the body part of interest. Field strength of the magnet
is directly related to signal-to-noise ratio. While 1.5 Telsa magnets have
become the standard high-field MRI units, 3T–8T magnets are now available
and have distinct advantages in the brain and musculoskeletal systems.
Spatial localization is achieved by magnetic gradients surrounding the main
magnet, which impart slight changes in magnetic field throughout the
imaging volume. The energy state of the hydrogen protons is transiently
excited by Rf, which is administered at a frequency specific for the field
strength of the magnet. The subsequent return to equilibrium energy state i.e.
relaxation of the protons results in a release of Rf energy, which is detected
by the coils that delivered the Rf pulses. The echo is transformed by Fourier
analysis into the information used to form an MR image. The MR image thus
consists of a map of the distribution of hydrogen protons, with signal
intensity imparted by both densities of hydrogen protons as well as
differences in the relaxation times of hydrogen protons on different
molecules.
1.3 NEED FOR MRI
MRI is the acronym of MAGENTIC RESONANT IMAGING.MRI
provides non-invasive, high quality images of neuro-anatomy and disease
processes. Through its ability to detect contrast in the density of soft tissues,
MRI is well suited to monitor and evaluate cerebral tumours as they develop
and respond or, as the case may be, fail to respond to therapy. There are
many sequences that can be used on MRI and the different sequences often
provide different contrast between tissues so the most appropriate sequence
should be chosen according to disease and what the clinicians want to detect.
Early detections and corrections based on accurate diagnosis are important
steps to improve the disease outcome.
CHAPTER 2
BLOCK DIAGRAM AND NEED
FOR DENOISING
2.1NOISE IN MR IMAGES
Noise is like interferences which present as a irregular granular
pattern. This random variation in signal intensity degrades image
information. The main source of noise in the image is the patient's body i.e
RF emission due to thermal motion. The whole measurement chain of the
MR scanner such as coils and electronics equipments also contributes to the
noise. This noise corrupts the signal coming from the transverse
magnetization variations of the intentionally excited spins on the selected
slice plane. The signal to noise ratio (SNR) is equal to the ratio of the
average signal intensity over the standard deviation.
Artifacts often corrupt MRI images. These artifacts have many
causes and consequences on image appearance. Salt and pepper noise is most
common type of noise present in MR images. This type of noise can be
caused by dead pixels, analog to digital converters errors, bit errors in
transmission, etc. Salt and pepper noise is a form of noise typically seen on
images. It represents itself as randomly occurring white and black pixels.
Salt and pepper noise creeps into images in situations where quick transients,
such as faulty switching, take place. In salt and pepper noise such as sparse
light and dark disturbances, pixels in the image are very different in color or
intensity from their surrounding pixels; the defining characteristic is that the
value of a noisy pixel bears no relation to the color of surrounding pixels.
Generally this type of noise will only affect a small number of image pixels.
When viewed, the image contains dark and white dots, hence the term salt
and pepper noise.
The original image is as shown below
Fig 2.1:Original image
2.1 NEED FOR DE-NOISING
Noise in images hinders the correct analysis of the images by affecting
the quality of the image. Noise reduction is the process of removing noise
from a signal. When a device captures an image, the device sometimes adds
extraneous noise to the image. This noise must be removed from the image
for other image processing operations to return valuable results . Some noise
can simply be removed by smoothing an image or masking it within the
frequency domain, but most noise requires more involved filtering, such as
windowing or adaptive filters .Noise appears in an image due to a number of
reasons. The formation of an MRI mage is done in steps. In each step, there
may be a fluctuation from the normal working conditions. This fluctuation
adds a random value to the captured signals. When these signals are Fourier
transformed and the image is formed, the fluctuation contributes to the noise.
2.2 BLOCK DIAGRAM
The block diagram represents the different steps involved in our project.
Initially image is acquired from MATLAB. This acquired image is pre
processed in order to remove film artifacts. The unwanted film artifacts are
removed in order to improve the image appearance. This is followed by the
enhancement of the image where we apply non linear filters on the image.
The output obtained by applying each of these filters is studied separately.
Thus the performance evaluation of these filters is done by applying
statistical analysis to the images obtained after filtering. The best
performance filter can hence be concluded from this stage and finally a de-
noised MR brain image is obtained as output.
MR brain image
IMAGE ACQUISITION
Pre processing
Denoised MR Brain Images
Median Filter Adaptive Filter
Performance evaluation
Of the filters
Image Acquisition
Weighted Median
Filter
Removal of film artifacts
CHAPTER 3
THEORETICAL BACKGROUND
3.1 Image Acquisition
Image of a patient obtained by MRI scan is displayed as an array of
pixels and stored in Matlab7.1.In image processing, it’s necessary to
smoothen an image while preserving its edge. The assumption is that noise is
captured by the high frequency coefficients, thus by filtering these
coefficients, the unwanted noise is removed. But the edges are also high
frequency components hence its necessary to preserve these while removal
of noise. A grayscale image can be specified by giving a large matrix whose
entries are between 0 to 255, 0 corresponds to black while white corresponds
to white pixels.
3.2 Pre-processing
Pre-processing is a processes that inputs the data to produce output
that is used as an input to another program. The pre-processing is used for
loading the input MRI images to the MATLAB environment and also it
removes any kind of noise present in the input images. Pre-processing
involves the operations that are required prior to the main data analysis and
extraction of information. This involves removal of film artifacts and
removal of unwanted skull portions from MRI.
3.21 Film artifacts:
Artifacts often corrupt MR images. We need to to prevent their
appearance and recognize the diagnostic pitfalls they can mimic. These
artifacts have many causes and consequences on image appearance. The
better we understand how MR images are built, the better we will be able to
deal with artifacts. The knowledge of film artifacts and noise producing
factors is important for continuing maintenance of high image quality.
Artifacts may be very noticeable or just a few pixels out of balance but can
give confusing artifactual appearances with pathology that may be
misdiagnosed.
3.22 Removal of film artifacts:
The MRI brain image consists of film artifacts or label such as patient
name, age and marks. Film artifacts are removed using tracking algorithm by
thresholding. The film artifacts are higher in intensity than the surrounding
pixels. Thus a threshold value for these film artifacts can be found. Then,
starting from the first row and first column of the image, intensity value of
the pixels are analyzed. The pixels with intensity greater than that of the pre
determined threshold value are removed from MRI. Hence, high intensity
film artifacts are removed from MRI brain image. Usually film artifacts are
found at the four corners of the image and hence it is possible to write a
general code for removing film artifacts from MR brain images.
Fig 3.1:Image without film artifacts
3.3 Image Enhancement:
Image enhancement is the improvement of digital image quality,
without any knowledge about the source of degradation. We have considered
mean filter initially but due to many disadvantages of this filter we have
considered other filters.
Image enhancement improves the virtual appearance of an MRI. The
role of enhancement technique is removal of high frequency components
from the images. Enhancement techniques such as median filter, weighted
median filter and adaptive filter reduces the edge blurring effects. In this
project we use these three filters and denoise the image using them .
3.31 Mean filter or Average filter:
Mean filtering is a simple, intuitive and easy to implement method of
smoothing images, i.e reducing the amount of intensity variation between
one pixel and the next. It is often used to reduce noise in images. The idea of
mean filtering is simply to replace each pixel value in an image with the
mean or average value of its neighbors, including itself. This has the effect
of eliminating pixel values which are unrepresentative of their surroundings.
It is based around a kernel, which represents the shape and size of the
neighborhood to be sampled when calculating the mean. Often a 3×3 square
kernel is used, although larger kernels 5×5 square can be used for more
severe smoothing. When the neighborhood considered is too large, blurring
and other unwanted effects can appear .
Two main problems with mean filtering are:
A single pixel with a very unrepresentative value can significantly
affect the mean value of all the pixels in its neighbourhood.
When the filter neighbourhood straddles an edge, the filter will
interpolate new values for pixels on the edge and so will blur that
edge. This will cause problem as we require sharp edges in the output.
In general the mean filter acts as low pass filter and, therefore, reduces the
spatial intensity derivatives present in the image
3.32 Denoising using Median filter:
The median filter is a nonlinear digital filtering technique, often used
to remove noise by applying a smoothening technique. Such noise reduction
acts as a typical pre-processing step to improve the results of later
processing. Median filtering is very widely used in digital image processing
because, under certain conditions, it preserves edges while removing noise.
Edges are of critical importance to the visual appearance of images, for
example. for small to moderate levels of (Gaussian) noise. An effective noise
reduction method for salt and pepper noise involves the usage of certain
filters like median filter.
Although other types of noise e.g., ., impulse or Poisson noise have also been
studied in the literature of image processing, the term “image de-noising” is
usually devoted to the problem associated with additive white Gaussian
noise. Mathematically, if we use Y=X+W to denote the degradation process
where X represents clean image, and Y represents noisy image, then the
image de-noising algorithm attempts to obtain the best estimate of X from Y.
The optimization criterion can be mean squared error based or perceptual
quality driven though image quality assessment itself is a difficult problem,
especially in the absence of an original reference.
A median filter is an example of a non-linear filter and, if properly designed,
is very good at preserving image detail. A median filter is a rank-selection
(RS) filter, a particularly harsh member of the family of rank-conditioned
rank-selection (RCRS) filter . A median filter is a rank-selection (RS) filter, a
particularly harsh member of the family of rank-conditioned rank-selection
(RCRS) filter .A much milder member of that family, one that selects the
closest of the neighboring values when a pixel's value is external in its
neighborhood, and leaves it unchanged otherwise, is sometimes preferred,
especially in photographic applications. Median and other RCRS filters are
good at removing salt and pepper noise from an image, and also cause
relatively little blurring of edges, and hence are often used in computer
vision applications.
It is used to reduce ‘salt and pepper’ noise. This technique calculates the
median of the surrounding pixels to determine the new value of the pixel. A
window of size 3*3 is taken. The nine elements in this window are stored in
an array and then these elements are sorted in ascending order of their pixel
values. The median is calculated from these sorted pixels and then the centre
element of the 3*3 matrix is replaced by this median value i.e. .the intensity
value of the centre pixel is replaced with the median value. This procedure is
done for all the pixels in the image to smoothen the edges of MRI. The
window size to be selected depends on the amount of smoothening required
for the concerned case.
Calculating the median value of a pixel neighborhood: Here the central pixel
value of 14 is replaced with the median value: 13. This is an example for 3×3
window; larger neighborhoods will produce more severe smoothing.
Algorithm for Median filter:
1. Read MR image and store it in a 2-D matrix.
2. Consider a n*n window. Starting from the first row and first column, store
the elements in an array (n should be an odd number).
3. Sort the elements in an array in ascending order.
4. Select the median value from the (centre most elements) from sorted
array.
5. Replace the centre pixel of the window by the median value.
6. Repeat the above steps by moving the window and hence applying it for
all the pixels in the image.
Fig 3.2a:3*3 median filtered image.
Fig 3.2b:5*5 median filtered image.
NO
YES
READ AN MR IMAGE TO MATLAB
STORE IN A 2D MATRIX
SELECT A r*c WINDOW
r=1 c=1
STORE THE ELEMENTS OF THE WINDOW IN AN
ARRAY a[i] i=1 count=1
j=j+1
IS a[i]>a[j]?
temp=a[i] a[i]=a[j] a[j]=temp
i=i+1 count++
START
YES
NO
IS count<n?
GET THE MEDIAN VALUE
REPLACE CENTRE PIXEL WITH MEDIAN
r=r+1 c=c+1
IS r<p && c<q?
OBSERVE THE OUTPUT
A BC
3.33 Denoising using Weighted Median filter:
Weighted Median (WM) filters have the robustness and edge
preserving capability of the classical median filter and resemble linear FIR
filters in certain properties. Furthermore, WM filters belong to the broad
class of nonlinear filters called stack filters. This enables the use of the tools
developed for the latter class in characterizing and analyzing the behavior
and properties of WM filters, e.g. noise attenuation capability. Pixels
intensity values are examined and depending on the range of intensity,
particular weights are multiplied. Applications of it include: idempotent
weighted median filters for speech processing, adaptive weighted median
and optimal weighted median filters for image and image sequence
restoration, weighted medians as robust predictors in DPCM coding and
Quincunx coding, and weighted median filters in scan rate conversion in
normal TV and HDTV systems.
To calculate the weighted median of a set of numbers you need to find
the median and if this number does not exist in the record set take the
average of the values above and below the median instead.
Algorithm for Weighted Median filters:
1. Read MR image and store in a 2-D matrix.
2. According to the pixel intensities ,multiply them by their corresponding
weights.
3. Consider a n*n window. Starting from the first row and first column,store
the elements in an array (n is an odd number).
4. Sort the elements in an array in ascending order.
5. Select the median value from the (centre most elements) from sorted
array.
6. Replace the centre pixel of the window by the median value.
7. Repeat the above steps by moving the window and hence applying it for
all the pixels in the image.
Fig 3.3a:5*5 weighted median filtered image
Fig 3.3b:3*3 weighted median filtered image.
3.34 Denoising using Adaptive Median filter:
An adaptive filter is a filter that self adjusts its transfer function
according to an optimizing algorithm. Because of the complexity of the
optimizing algorithms, most adaptive filters are digital filters that perform
digital signal processing and adapt their performance based on the input
signal. It is used for impulsive noise reduction of an image without the
degradation of an original image.
The shape of the filter basis is adapted to follow the high contrasted
edges of the image.In this way,the artifacts introduced by a circularly
symmetric filter at the border of high contrasted areas are reduced.
Fig 3.4a:3*3 adaptive filtered image.
Fig 3.4b:5*5 adaptive filtered image.
Algorithm for Adaptive Median filter:
1. Read MR image and store in a 2-D matrix.
2. Select the required maximum and minimum intensity values.
3. The median value is selected by sorting the elements of the matrix.
4. If the pixel intensity values lie outside the pre determined range, then
it is considered as a noise pixel and is replaced by the calculated median
value.
5. If the pixel intensity value lies within the pre determined range, then
no change is made to the pixel values.
YES
NO
STORE IN A 2D MATRIX
READ AN MR
IMAGE TO
MATLAB
SELECT REQUIRED Smin
AND Smax
START
IS Smin< PIXEL <Smax?
REPLACE THE PIXEL BY MEDIAN
OUTPUT IMAGE
CHAPTER 4
PERFORMANCE EVALUATION
AND CONCLUSION
4.1 Performance Evaluation
If the enhanced image can help the observer perceive the region of interest
Better than original image the it can be said that original image has been
improved. Statistical measurement such as variance ,entropy are used to
measure local enhancement.
4.11 MEAN:
For vectors, MEAN(X) is the mean value of the elements in X. For Matrices,
MEAN(X) is a row vector containing the mean value of each column. For
N-D arrays, MEAN(X) is the mean value of the elements along the first non-
singleton dimension of X. MEAN(X,DIM) takes the mean along the
dimension DIM of X.
Example: If X = [0 1 2 3 4 5] then mean(X,1) is [1.5 2.5 3.5] and mean(X,2)
is [1 4].
4.12 Standard Deviation:
The definition for standard deviation of a data vector X is given by:
S=[1/(n-1){ (xi-xbar)^2}]^(1/2)
xbar=(1/n) xi
where i varies from 1 to n and n is the number of elements in the sample. s =
std(X), where X is a vector, returns the standard deviation using the above
equation. The result is the square root of an unbiased estimator of the
variance of the population from which X is drawn, as long as X consists of
independent, identically distributed samples.
If X is a matrix, std(X) returns a row vector containing the standard
deviation of the elements of each column of X. If X is a multidimensional
array, std(X) is the standard deviation of the elements along the first
nonsingleton dimension of X.
s = std(X,flag) for flag = 0, is the same as std(X). For flag = 1,
std(X,1) returns the standard deviation using (2) above, producing the second
moment of the set of values about their mean. s = std(X,flag,dim) computes
the standard deviations along the dimension of X specified by scalar dim. Set
flag to 0 to normalize Y by n-1; set flag to 1 to normalize by n. Standard
deviation also represents the contrast value of an image.
ENTROPY
One of the quantitative measures in digital image processing is Entropy.
Claude Shannon introduced the entropy concept in quantification of information
content of messages. Although he used entropy in communication, it can be used
as a measure and quantify the information content of digital images. A digital
image consists of pixels arranged in rows and columns. Each pixel is defined by its
position and by its gray scale level. For an image consisting of of L gray levels, the
entropy is defined as:
where P(i) is the probability of each gray scale level. As an example a digital
image of type unsigned integer 8 has 256 different levels from 0(black) to
255(white). It must be noticed that in combined images the number of levels is
very large and grey level intensity of each pixel is a decimal, double number. For
images with high information content the entropy is large. The larger alternations
and changes in an image give larger entropy and the sharp and focused images
have more changes than blurred and misfocused images. Hence, the entropy is a
measure to assess the quality of different aligned images from the same scene.