A Deep Learning Computer Vision System for Image Based Cytometry
Total Page:16
File Type:pdf, Size:1020Kb
A DEEP LEARNING COMPUTER VISION SYSTEM FOR IMAGE BASED CYTOMETRY by Michal Lisicki Submitted in partial fulfillment of the requirements for the degree of Master of Computer Science at Dalhousie University Halifax, Nova Scotia December 2014 c Copyright by Michal Lisicki, 2014 To my always supportive family, who never let me give up ii Table of Contents List of Tables ................................... vi List of Figures .................................. vii Abstract ...................................... xi List of Abbreviations and Symbols Used .................. xii Acknowledgements ............................... xiv Chapter 1 Introduction .......................... 1 1.1 Objectives and scope of the thesis .................... 1 1.2 Complete Blood Count .......................... 3 1.3Contribution................................ 3 1.4 Outline ................................... 5 Chapter 2 Background analysis ..................... 6 2.1Physiologybackground.......................... 6 2.1.1 Complete Blood Count ...................... 6 2.1.2 DifferentialWBCcount..................... 10 2.2 Standard biological image analysis pipeline ............... 12 2.3Relatedworkincomputervision..................... 13 2.3.1 Problemsrelatedtolowqualityimages............. 13 2.3.2 Examples of image cytometry systems ............. 14 2.4 Related work in machine learning . ................. 16 Chapter 3 Tools and related applications ............... 19 3.1Background................................ 19 3.2ImageJandFiji.............................. 19 3.3OpenCV.................................. 21 3.4 MATLAB image processing and computer vision toolboxes . .... 22 3.5 Pylearn2, Cuda Convnet and GPGPU programming .......... 22 iii 3.6 Popular cell analyzing applications ................... 23 Chapter 4 Algorithms and methods ................... 26 4.1Background................................ 26 4.2 Image pre-processing ........................... 26 4.2.1 Flat-fieldcorrection........................ 26 4.2.2 Contrastenhancement...................... 27 4.2.3 Denoising............................. 29 4.2.4 Resolutionenhancement..................... 31 4.2.5 Artifactremoval.......................... 34 4.2.6 Colorspace............................ 36 4.3 Segmentation and candidates extraction ................ 37 4.3.1 Houghtransform......................... 37 4.3.2 Voronoidiagram......................... 39 4.4 Feature extraction ............................ 40 4.4.1 Sizeandnucleus-cytoplasmratio................ 40 4.4.2 Imagemoments.......................... 44 4.5Classification............................... 46 4.5.1 Rule-basedclassifier....................... 46 4.5.2 Classicalanalysis......................... 48 4.5.3 ConvolutionalNeuralNetwork.................. 50 4.5.4 Pre-training and filter initialization ............... 53 4.5.5 Dropout.............................. 56 Chapter 5 Experiments and Results ................... 57 5.1ImagePreparation............................ 57 5.2Cellanalysisandfinalresults...................... 59 5.2.1 Erythrocyte segmentation and analysis ............. 59 5.2.2 Thrombocytesegmentationandanalysis............ 65 5.2.3 Leukocyteclassification...................... 66 5.3Discussiononresults........................... 76 5.3.1 Erythrocyte ............................ 76 5.3.2 Thrombocyte........................... 78 5.3.3 Leukocyte............................. 79 Chapter 6 General discussion and future prospects ......... 82 Appendices .................................... 85 iv Appendix A Anisotropic diffusion ..................... 85 Appendix B Super-resolution ........................ 88 Appendix C Image moments ........................ 90 Appendix D Backpropagation in Convolutional Neural Network .. 98 Bibliography ................................... 101 v List of Tables 2.1 Analytic goals and state of the art (Buttarello and Plebani, 2008) 11 2.2 Types of leukocytes. Data based on Wikipedia (2013b)..... 12 5.1 RBC R2 summary table. ..................... 65 5.2 Confusion matrix - predictions (top) vs actual class (left) . 73 5.3 Platelet R2 summary table (CNN) ................ 75 5.4 Rule-basedclassification...................... 79 5.5 CNN after training on validation set ............... 79 C.1 Image moments of examples on Fig.C.6 proving invariance of features under specified transformations ............. 94 vi List of Figures 2.1 CBC print-out example (Online resource, 2012a)........ 6 2.2 CBCfishbonediagram...................... 7 2.3 Idealistic model of red blood cell distribution histogram .... 8 2.4 RBC differentiation based on laser illumination of cells - signal correlation plot (Online resource, 2012b) ............ 9 2.5 WBC differentiation based on laser illumination of cells - signal correlation plot (Online resource, 2012b) ............ 9 2.6 Normal WBC differential plot showing volume against light scatter of the cells (McClatchey, 2002) ............. 10 2.7 Volume distribution of WBCs, RBCs and Plts (Bain, 2006). 11 2.8 Common high-level architecture of biological image analysis systems.............................. 13 3.1 WBC analysis with Fiji Weka plugin using low quality image . 20 3.2 GUI developed as part of the thesis for testing variety of seg- mentationmethodsavailableinOpenCVandMATLAB.... 22 3.3 CellCGUI............................. 25 4.1 Flatfieldcorrection........................ 27 4.2 Originalimage........................... 28 4.3 Histogramstretch......................... 28 4.4 Histogramequalization...................... 29 4.5 Histogramwithcustomlookuptable.............. 29 4.6 Anisotropic diffusion example .................. 30 4.7 Lanczos kernel for window size a = 3 .............. 32 4.8 Example application of Lanczos filter application ....... 32 4.9 Super-resolution image with resolution enhancing factor too large 34 4.10 PowerspectrumoftheimageonFig.4.9............. 35 vii 4.11 ImagecorrectedbyFFTfiltering................ 36 4.12 Labcolorspacechannels.................... 36 4.13 Edgedetectionwithdifferentmethods.............. 38 4.14 Example of Hough transform for line detection ......... 39 4.15 Line-fitting to the edge of WBC in log-polar coordinates . 41 4.16 Log-polarimageprofilepeaks.................. 42 4.17 Result of WBC contour tracking in log-polar coordinates . 42 4.18 RegiongrowingresultsforsetofWBCs............. 44 4.19 (a)Originalimage.(b)Humomentinvariantmap....... 45 4.20 Nucleustocytoplasmratiosegmentation............. 48 4.21 Comparison of softplus and rectified linear functions . ..... 52 4.22 Handcraftedfilters........................ 54 5.1 Resultsofsuper-resolution.................... 57 5.2 Comparisonoffilteringoftheoriginalimage.......... 58 5.3 Visuals of the main objects of interest cropped out from images after the last step of pre-processing ............... 59 5.4 RBCthreshold.......................... 60 5.5 RBCdeclustering......................... 61 5.6 Histogram of object sizes ..................... 62 5.7 RBCdeclusteringmethods.................... 62 5.8 RBC segmentation. Violet channel of the image with overlaid borders(red)ofthesegmentedredbloodcells.......... 63 5.9 Squared Pearson correlation of total (a) RBC (b) MCV (c) RDW (d) MCH (e) Hct count with Coulter Counter readings for given patients.............................. 64 5.10 Plateletsegmentation....................... 66 5.11 Squared Pearson correlation of total platelet count with Coulter Counter readings for given patients ............... 66 viii 5.12 Representatives of examples of three classes in the dataset - anomalies, lymphocytes and myeloids .............. 67 5.13 Random WBCs examples displaying their (a) RGB and (b) fourth 405nm violet channel ................... 67 5.14 Ground truth class and localization markers manually positioned byexpert.............................. 68 5.15 Data Augmentation by rotation, flipping, shifting and intensity modification by PCA in RGB space. .............. 69 5.16 SVM grid search in space of regularization parameter C and RBF kernel parameter γ...................... 70 5.17 Convolutional Neural Network architecture used for WBC recog- nition............................... 70 5.18 (a) Lymphocyte generalization curve. (b) Myeloids generaliza- tioncurve.(c)Meannegativeloglikelihood.......... 71 5.19 FilterstrainedwithregularCNN(a)RGB(b)Violet...... 72 5.20 Filters trained by CNN with dropout (a) RGB (b) Violet. 72 5.21 RGBfiltersofconvolutionalRBM................ 73 5.22 Bestaccuracyachievedonthenetwork............. 74 5.23 Classification results comparison showing per-class recall of classical and deep learning approaches. ............. 75 5.24 SquaredPearsoncorrelationofWBCparameters........ 76 5.25 Red blood cells fading due to death or loss of hemoglobin. 77 5.26 (a) Anomaly caused by erroneous data acquisition and mask (b) for removing those and similar areas from further processing. 77 5.27 Typical appearance of platelet (a) and faded platelet commonly occurring within blood samples of patient 6 (b) . ..... 78 5.28 Selectedpositiveexamples.................... 80 5.29 Examples of 0.5 ≤ p(y|x) < 0.75................. 80 5.30 Most similar examples from other class ............. 80 C.1 2D Gaussian distribution with varied moment M10 = μ1 .... 91 C.2 2D Gaussian distribution with varied moment M20 ....... 92 ix C.3 2D Gaussian distribution with varied moment M30. ...... 92 C.4 2D Gaussian distribution with varied moment M11. ...... 93 C.5 2D Gaussian distribution with varied moment M21. ...... 93 C.6 Examples of an image under transformations of scaling,