• Ei tuloksia

4. Cell segmentation

4.4 Denoising

Figure 4.5 Tree showing diversity between image denoising methods. Adapted from Mot-wani et al. (2004).

Segmenting clustered cells is typically a more difficult task. These methods might be too aggressive on dividing the cluster so this can result in over-segmentation.

When this happens with the chosen method, some other method can be applied to merge some of these pieces.

4.4 Denoising

Image denoising is an important preprocessing step in fluorescence image processing which commonly have a low signal to noise ratio (Chowdhury et al. 2013). Denoising is a process which removes noise. Noise can easily cause incorrect areas of an image to be recognized as a cell. Image denoising is large field as demonstrated in Figure 4.5 and covering it fully is not within the scope of this thesis. The focus is on the fundamentals of concept and most recent development.

In practical terms, noise is an unwanted property of an image. To understand what is meant by the noise we need to define noise for our context: Noise is an unwanted property of a signal, caused by something during or after signal capture, which has negative properties on the task at hand. However, something that exists independently of signal capture, shouldn’t be considered noise. Unwanted properties due to range chosen for capture shouldn’t considered as noise either.

Our signal is an image. High-frequency fluctuations and low-frequency background changes are the most common types of noise which is processed out as is done in Chowdhury et al. (2013) and Wählby et al. (2002), respectively. Some unwanted

4.4. Denoising 27 properties aren’t considered as noise e.g., cell properties (e.g., clustering, size), sat-uration, and non-cell cell-like objects. If we consider images as two-dimensional arrays, noise can be also explained as

EN×M =GN×M −FN×M (4.1)

whereE is noise,Gis obtained image andF is the real representation of the image.

N and M represent height and width of the image.

4.4.1 High frequency removal

Several methods have been proposed through years for removing high-frequency noisei.e., reaching closer to F from Equation 4.1. A very simple method is a mean filter. In mean filtering, each pixel is thought as the center of an L-by-L array where L is odd (it is odd for convenience so that there exists a center point for the array).

The mean of that array is calculated and placed into the filtered image. This can be presented with: mean filtering result N-by-N array A. In addition, a decision should be done on how to address borders. Mean filtering removes information from the image and running this several times will remove almost all the information from the image.

High-frequency information is however removed first.

Median filter is a similar method to mean filter, but instead of calculating the mean of array, median is used instead:

if D={d1, d2, d3· · ·d2n−1} and di ≤di+1, then dn =M edian D

4.4. Denoising 28 where B (N-by-M array with point at bi,j) is result of median filtering. Similar to mean filter, a special strategy has to be made for border areas. For example, this can be with extending borders ofAfor length k to each direction and filling it with zeroes, closest value to the location, or another side of A.

Both median filter and mean filter are juvenile in many aspects, but in certain situations A ≈ F and B ≈ F. Let us consider the more mature approach, the two-dimensional adaptive Wiener filter as represented in Lim (1990, pp. 538, 539). It approximates F with filter is adaptive in the sense that it adapts to local areas while also adjusting to the whole image.

Computing power has increased much since the year 1980. Using this new re-source more complex approaches can be developed. Block-matching and 3D filtering (BM3D) algorithm presented in Dabov et al. (2006) is a novel method (in cell seg-mentation) that utilizes increased computational power. It searches similar areas from image and process these similar stacks. BM3D uses a two-phase filtering pro-cess to denoise groups of blocks from the image based on their similarities. A cell segmentation tool developed by Chowdhury et al. (2013) uses this method as its denoising method.

BM3D consist of several parts that can be changed. There are defining features though, which separates it from other methods, or from methods it uses. First, the image is separated to blocks and for each stack of similar blocks are searched.

This stack is collected for each block in image separately, but each block is of same size(e.g., eight-by-eight). For each stack, we perform the three-dimensional trans-form. Three-dimensional transform is three one-dimensional transform done in a row to each dimension. In BM3D, two same one-dimensional transforms are per-formed to image dimensions(i.e.,two-dimensional transform) and third can be dif-ferent transform performed in the dimension of the stack. Transformed 3D-array is then filtered, and then inversely transformed.

4.4. Denoising 29

(a)σ26250 (b) σ2792 (c) σ2294 (d) σ22.33·10−4

(e) σ211000 (f) σ21250 (g) σ2228 (h) σ26.63·10−4

Figure 4.6 Different denoising methods results. (a) and (e) are original images and to their right are filtered images: (b) and (f ) median filter, (c) and (g) wiener filter, (d) and (h) BM3D. Original image has artificially added gaussian noise to each pixel, top row has σ= 27and bottom row σ= 28.

Now we have produced a new image, which is not the final result but is instead used as a input for new stacking. We use these stack locations but with pixels from the original image. Then, we again do Three-dimensional transform and again we filter.

Now we get the final result when applying the inverse transformation.

Several methods can be used in BM3D. Transform can be any orthonormal transform (Dabov et al. 2008) e.g., discrete cosine transform (Ahmed et al. 1974) and Haar transform (Haar 1910 cited in Heil & Walnut 2009). Discrete cosine transform was used for two-dimensional transform and Haar transform as one-dimensional transform in Dabov et al. (2006). For filtering, Dabov et al. (2006) used first thresholding with a constant value calculated from properties of the image. In the second time, Wiener filtering and it is used adapted to the first result.

Difference between median, wiener, and BM3D is demonstrated in Figure 4.6.

Results are generated using MATLAB 1 and BM3D MATLAB software 2. The median filter uses a 9-by-9 array as a frame of neighbors and substitutes out of border with zeros. Wiener filter uses a 9-by-9 array as a frame of neighbors and the standard deviation was given. BM3D was given used standard deviation. MATLAB

1R2013b, The MathWorks inc., Natick, MA, U.S.

2http://www.cs.tut.fi/ foi/GCF-BM3D/

4.4. Denoising 30 code used is shown in Program 4.1. The base image is a green color channel on Figure 4.2(d).

1 im = i m w r i t e (" c e l l _ i m a g e "); % Lo a d i m a g e

g =( r g b 2 g r a y ( im ); % C h a n g e c o l o r i m a g e to g r a y s c a l e i m a g e

3 std = 2 ^ 7 % D e f i n e s t a n d a r d d e v i a t i o n ( std )

n o i s e = r a n d n ( s i z e ( g ))* std % G a u s s i a n n o i s e w i t h : m e a n 0 , std 2^7

5 % N o i s e is a d d e d to the g r a y s c a l e i m a g e g r a y I m a g e = u i n t 8 (double( g )+ n o i s e )

7 % M e d i a n filter , n e i g h b o r s 9 - by -9 m e d i a n R e s u l t = m e d f i l t 2 ( g r a y I m a g e , [ 9 ,9 ] ) ;

9 % A d a p t i v e w i e n e r 2 D f i l t e r

w i e n e r R e s u l t = w i e n e r 2 ( g r a y I m a g e ,[9 ,9] , std );

11 % B M 3 D filter , a r g u m e n t d e s c r i p t i o n : 1 st i n f o r m s t h at c o r r e c t i m a g e is

% not p r o v i d e d , 4 th d e s c r i b e s p a r a m e t e r set ( f a s t or n o r m a l profile ,

13 % n o r m a l was c h o s e n . 5 th m e a n s n o t h i n g is p l o t t e d or p r i n t e d by

% f u n c t i o n .

15 B M 3 D R e s u l t = B M 3 D (1 , g r a y I m a g e , std ,’ np ’,0);

Program 4.1MATLAB code and parameters used to produce results of Figure 4.6 top row.

By changing standard deviation to 28 bottom row result of Figure 4.6 could be reproduces

4.4.2 Low frequency noise removal

Noise can take different forms. The background of an image can have large artifacts.

Removing these is important for segmentation as they do not represent the actual cell. If the background is accurately detected, subtracting it from the image removes it. There are several ways to do background detection. One way to do this is to use the methods provided in the previous section but instead, use those to detect larger objects and regard cells as a noise.

These are not only available approaches. One approach specifically developed for background subtraction was presented in Wählby et al. (2002). The method used in it, the background is assumed smooth and slowly changing. With iterations, it is improved until it forms the best match for the background. This method was not tested with a large dataset so it is unclear how well it would perform in different conditions. It is most likely effective only removing this certain type of noise. (Wählby et al. 2002)