TR-IIS-09-008
Adaptive Local Thresholding for Fluorescence Cell Micrographs
Jyh-Ying Peng and Chun-Nan Hsu
November 11,
2009 || Technical Report No. TR-IIS-09-008
http://www.iis.sinica.edu.tw/page/library/LIB/TechReport/tr2009/tr09.html
Adaptive Local Thresholding for Fluorescence Cell Micrographs Jyh-Ying Peng and Chun-Nan Hsu Institute of Information Science, Academia Sinica Email: {jypeng, chunnan}@iis.sinica.edu.tw Abstract An adaptive local thresholding method for microscope based high content analysis (HCA) is proposed. Cell micrographs of HCA contain detailed objects both in and out of focus, which cannot be correctly segmented by global thresholding methods. The proposed method utilizes adaptive local neighborhood size and double thresholding, and is able to produce segmentations that conform closely to perceptually relevant structures in the original image, robust to background noise and variation. The proposed method is applied to the segmentation of mitochondria in fluorescence cell micrographs. Comparison with both hand segmentation and other global and local thresholding methods shows that the proposed method produces results of comparable quality to hand segmentation and discovers much more detailed structure than any previous thresholding methods. Keywords: local adaptive thresholding, image segmentation, fluorescence cell micrographs, microscope images.
1
Introduction
In digital image processing, a standard method to detect objects in a grayscale image is to threshold the intensity values, from which a binarization of image pixels into object and background is achieved [Sezgin and Sankur, 2004]. Early thresholding methods use a single global threshold value for the whole image, which can be obtained by detecting peaks and valleys in the intensity histogram for the whole image, minimizing the intra-class variance of object and background pixels [Otsu, 1979], or iteratively updating the threshold to the average of the object and background mean intensity [Ridler and Calvard, 1978], among many other methods. These global formulations can also be adapted to calculate local thresholds, where a different threshold value is used for each locality in the image. For example, pixel thresholds can be obtained by examining the local histogram, or by the mean and variance of its local neighborhood [Niblack, 1986].
1
(a) Input image.
(b) Segmentation result.
Figure 1: A cell micrograph showing four cells with different mitochondria structure, and the segmentation result produced by the proposed method. In this work a novel image thresholding/binarization method is proposed and applied to cell micrographs of fluorescence protein (FP)-tagged mitochondria. These images have changing background brightness and contrast, and contains detailed and differentiated mitochondria structures. The proposed method automatically produces segmentations of these images that preserves the mitochondria structures as perceived by human experts. In other words, the proposed method is designed to adaptively threshold the cell micrographs and produce results that correspond closely to human intuition of detailed subcellular structures. In Figure 1 a cell micrograph containing four cells with different mitochondria structure and the corresponding segmentation produced by the proposed method is shown. It can be seen that the result faithfully captures the different mitochondria structures within the four cells, from web-like and elongated to fragmented dots to larger dots, in the presence of changing background brightness within each cell and changing contrast levels between cells. In the next section the proposed method is described in detail. In Section 3 the proposed method is first compared to manual segmentation, then to some classical and recent thresholding methods.
2
2
Adaptive Local Thresholding
In this section, a novel thresholding method, Adaptive Local Thresholding (ALT), is proposed for the binarization of grayscale images. The method consists of the following steps: 1. Adaptive local normalization (a) Define local region variance threshold value; (b) Automatically determine the locality size for each individual pixel; (c) Calculate mean and standard deviation for each locality; (d) Normalize the image pixel-by-pixel with respect to each locality. 2. Double thresholding (a) Define high and low threshold values; (b) Threshold the normalized image with the low threshold value; (c) Remove objects that are not connected to any pixels above the high threshold in the normalized image. 3. Postprocessing (a) Define grayscale threshold value; (b) Remove objects that are not connected to any pixels above the grayscale threshold in the original image; (c) Remove objects on the boundary of the image or region of interest. In the following the algorithm is described and illustrated on the cell micrograph in Figure 2.
2.1
Adaptive Local Normalization
2D fluorescence cell micrographs contain out-of-focus objects that result in heterogeneous background, and are often incorrectly classified as objects by global thresholding methods. In order to deal with the changing background brightness and contrast level caused by out-of-focus objects, proper thresholding needs to take into account the statistical properties associated with each locality in the image. Traditional local thresholding methods determine the threshold at each pixel by examining the region centered on the pixel, using a fixed window shape and size, and effectively derives a threshold surface for the image. It would be more appropriate to let the window size change dynamically according to the characteristics of each pixel region, such that regions for background pixels contain a portion of nearby objects, and regions for pixels within an object contain some background, as shown in Figure 3 (see also [Yan et al., 2005]). In other words, the local region of a pixel should be large enough to contain sufficient amount of edges or other relevant local structures, but not too large as to also 3
Figure 2: A sample cell micrograph.
Figure 3: Ideal local region sizes for different localities. contain irrelevant structures from faraway objects. An appropriate region size for each individual pixel ensures correct classification of the pixel into object or background. The method proposed here uses the variance of pixel brightness in the local region as a criterion to adaptively determine the local region size. A uniform disk is used as the shape of each region, and the radius of the disk is set to the minimum radius required for the region to have a brightness variance above a certain threshold: r(x, y) = min{r > 0 | StD[Rr (x, y)] ≥ TStD }, r
(1)
where r(x, y) is the radius at pixel (x, y), Rr (x, y) is the circular region of radius r centered at pixel (x, y), and TStD is the standard deviation threshold, which can be set to about 0.3 to 0.4 of the global standard deviation of the image. Thus it is assumed that if a region has standard deviation of at least TStD , then it contains enough structural information to distinguish the pixel between background and object. In this way, the parameter TStD would be more robust 4
Figure 4: Adaptive local normalized image of Figure 2. Red, blue and green regions indicate pixels above, below and equal the local mean, respectively. than a single window size parameter for all pixels in the image, which necessarily ignores local structural differences. After the region size for each pixel is determined, an adaptive local normalization of the original image IN can be obtained by calculating the mean IE and variance IStD of each local region: IE (x, y)
=
E[Rr(x,y) (x, y)],
(2)
IStD (x, y)
=
StD[Rr(x,y) (x, y)],
(3)
IN (x, y)
=
I(x, y) − IE (x, y) . IStD (x, y)
(4)
The local normalized pixel value would then serve as an adaptive and objective criterion for object/background binarization.1 The adaptive local normalized image for the cell micrograph in Figure 2 is shown in Figure 4. As a simple empirical justification for using adaptive neighborhood size, Figure 5 shows normalized images obtained using adaptive radius and radius fixed at 4 and 8 pixels. It can be seen that for both fixed radius normalization, some spurious objects would appear in the background. This is especially true for the R = 4 image. The fact that even the R = 8 image contains such spurious objects indicates that the proper radius in the background should in fact be larger than R = 8. In addition, the R = 8 image contains many regions where distinct objects are incorrectly merged together, which shows that a smaller radius is more appropriate for those regions. 1 Since this is essentially a binary classification formulation, if there are two brightness values for objects, such as in multithresholding applications, additional processing will be required.
5
(a) Original
(b) Adaptive Radius T = 0.35StD(I)
(c) R = 4 pixels
(d) R = 8 pixels
Figure 5: Normalized images for adaptive and fixed region sizes. Normalized values below zero are truncated to better illustrate correspondence with the original image.
6
In the actual computer implementation, the local radius is not allowed to exceed a certain maximum Rmax for computational efficiency. To prevent such a device from causing spurious “objects” within very low variance regions to be picked out, a minimum region standard deviation equal to the threshold TStD is also set for regions exceeding the maximum radius, with the local mean calculated normally. Thus for the local region at pixel (x, y), the computational equations to obtain the local radius r(x, y) and standard deviation IStD (x, y) are n o r(x, y) = min Rmax , min{r > 0 | StD[Rr (x, y)] ≥ TStD } , (5) r IStD (x, y) = max TStD , StD[Rr(x,y) (x, y)] . (6) Adapting a lower bound for the standard deviation image effectively attenuates normalized values within regions with a very low standard deviation, and additionally acts as a safe guard against singularities.2 These observations are also justified by empirical results, as can be seen in Section 3 where the proposed method is compared with Niblack’s method.
2.2
Double Thresholding
For a more robust segmentation result, double thresholding is used to obtain the final segmentation from the adaptive local normalized image. In double thresholding, two thresholds are defined, and the image is first segmented with the low threshold, then objects that contains no pixels above the high threshold are removed. Either 4 or 8-connectedness can be used for defining distinct objects, and 4-connectedness is used here. A property of double thresholding is that it creates segmentations that appeal to intuition in that sufficiently bright objects would appear to be segmented in whole, and spurious regions of pixels that only just pass the low threshold would not be detected at all. A thresholded image showing the application of high and low thresholds to the normalized image in Figure 4 is shown in Figure 6, and the final segmentation (with postprocessing) is shown in Figure 7. Using two thresholds also results in more flexibility, in that the number of objects detected and their extent can be controlled separately, by individually changing the high and low thresholds. For example, this allows minimizing the appearance of ”ghost” objects in the background without eroding the size of legitimate objects. Because double thresholding is applied to the normalized image, there is no need to adjust the threshold values for images of different brightness or contrast. In fact, assuming normalized images correctly represent the structures of the original, the threshold values then represent a global, objective threshold on object saliency. 2 Local
regions with 0 variance.
7
Figure 6: Application of high and low thresholds to Figure 4. White pixels pass the high threshold, and gray pixels pass the low threshold.
Figure 7: Final segmentation of Figure 1.
8
3 3.1
Experimental Results Comparison with Manual Segmentation
Figure 8 shows the results of comparison with hand segmentation. It can be seen that the proposed algorithm shows good agreement with manual segmentation, and sometimes even produce results that better correspond to intuition. The proposed method is also more robust and stable across images of different brightness and contrast, and can be used as an objective and much more efficient alternative to manual segmentation, which is often affected by differences in computer monitor brightness and subjective evaluation standards. For this comparison TStD is set to 0.35 times the global image standard deviation, and the high and low thresholds for the double thresholding are set to 0.6 and 0.3, respectively.
3.2
Comparison with Other Thresholding Methods
In this section the proposed method is compared with two global thresholding methods and two locally adaptive methods. The global methods are the classical Otsu’s global thresholding [Otsu, 1979] and an iterative thresholding method [Ridler and Calvard, 1978]. The local methods are the classical Niblack’s method [Niblack, 1986] and a recent adaptive thresholding method based on a variational minimax algorithm [Saha and Ray, 2009]. Only Niblack’s method requires setting parameters, for this comparison a disk shaped local neighborhood of radius 6 pixels is used, and the threshold is set to the local mean plus 0.4 times the local standard deviation. For the proposed method TStD is set to 0.35 times the global image standard deviation, and the high and low thresholds for the double thresholding are set to 1 and 0.35, respectively. The comparison on select cell micrographs are shown in Figures 9-11. It can be seen that global thresholding methods cannot adequately deal with changing background brightness, and cannot reveal detailed structure in the original image. The local methods fare better, with results closer to the intuitive ideal segmentation, but both still contain incorrect segmentations. Niblack’s method, due to the use of a fixed size local region, generates many “ghost” objects in the background. The variational minimax algorithm is able to segment detailed structures without generating “ghost” objects, but on closer inspection, and comparing with the results from the proposed method, detected objects are excessively merged, and many areas also contain incorrect clumps that corresponds to visually separated objects in the original image. Only the proposed method is able to successfully pick out perceptually relevant objects even in areas of low contrast where the “background” is bright and misty, without generating any “ghost” objects in the background, and the segmentation result is also much cleaner with respect to separating distinct objects. It can be seen from the results of other methods that there is an implicit scale parameter at work, which is not directly adjustable for the global methods and the variational minimax algorithm, this prevents detailed structures from being
9
(a) Original images.
(b) Hand segmentation.
(c) Proposed method.
Figure 8: Comparison of the proposed method with hand segmentation.
10
(a) Original image.
(b) Otsu’s method.
(c) Iterative thresholding.
(d) Niblack’s method.
(e) Variational minimax algorithm.
(f) Proposed method.
Figure 9: Comparison with other thresholding methods on a representative cell micrograph.
11
(a) Original image.
(b) Otsu’s method.
(c) Iterative thresholding.
(d) Niblack’s method.
(e) Variational minimax algorithm.
(f) Proposed method.
Figure 10: Comparison with other thresholding methods on a representative cell micrograph.
12
(a) Original image.
(b) Otsu’s method.
(c) Iterative thresholding.
(d) Niblack’s method.
(e) Variational minimax algorithm.
(f) Proposed method.
Figure 11: Comparison with other thresholding methods on a representative cell micrograph.
13
distinguished in these methods. The proposed method, as well as Niblack’s method, features a scale parameter in terms of local variance threshold or local region size, which can then be adapted to the perceptual scale of objects in images. Using the local variance as a criterion to determine local region size is more robust than directly specifying the region size, this approach is also validated by the comparison results, which shows that the proposed method can effectively prevent spurious “ghost” objects from being detected while also cleanly separating objects with touching boundaries.
4
Conclusion
In conclusion, an adaptive local thresholding method is proposed that utilizes adaptive local region size and double thresholding. The proposed method is able to pick out perceptually relevant structures from fluorescence cell micrographs robustly, performs better than previous segmentation methods and is comparable to hand segmentation.
Acknowledgement The authors would like to thank Prof. Chung-Chih Lin for providing the fluorescence cell micrographs used in this work.
References Mehmet Sezgin and Bulent Sankur. Survey over image thresholding techniques and quantitative performance evaluation. Journal of Electronic Imaging, 13 (1):146–168, 2004. doi: 10.1117/1.1631315. Nobuyuki Otsu. A threshold selection method from gray-level histograms. IEEE Transactions on Systems, Man and Cybernetics, 9(1):62–66, Jan 1979. doi: 10.1109/TSMC.1979.4310076. T. W. Ridler and S. Calvard. Picture thresholding using an iterative selection method. IEEE Transactions on Systems, Man and Cybernetics, 8(8):630–632, Aug 1978. doi: 10.1109/TSMC.1978.4310039. Wayne Niblack. An Introduction to Digital Image Processing, pages 115–116. Prentice Hall, 1986. Feixiang Yan, Hong Zhang, and C. Ronald Kube. A multistage adaptive thresholding method. Pattern Recognition Letters, 26(8):1183–1191, Jun 2005. ISSN 0167-8655. doi: 10.1016/j.patrec.2004.11.003. Baidya Nath Saha and Nilanjan Ray. Image thresholding by variational minimax optimization. Pattern Recognition, 42(5):843–856, May 2009. ISSN 0031-3203. doi: 10.1016/j.patcog.2008.09.033. 14