NAILFOLD CAPILLAROSCOPY USING USB DIGITAL MICROSCOPE IN THE ASSESSMENT OF MICROCIRCULATION IN DIABETES MELLITUS PROJECT REFERENCE NO. : 37S0841 COLLEGE BRANCH GUIDE : DR.AMBEDKAR INSTITUTE OF TECHNOLOGY, BANGALORE : MEDICAL ELECTRONICS : A.P.MANJUNATHA STUDENTS : NITHISHI.M MEGHANA.S PRATHIBHA.N Keywords: Diabetes Mellitus, Nailfold Capillaroscopy, Otsu s Method, Segmentation, Template matching, Correlation Introduction: Nailfold capillaroscopy is a simple, non-invasive technique used to assess microcirculation in various diseases such as Systemic Sclerosis, Dermatomyositis, Diabetes Mellitus, and Hypertension etc. Microcirculation is the part of the circulation where oxygen, nutrients, hormones, and waste products are exchanged between circulating blood and parenchyma cells through the blood vessels with a diameter less than 100 μm such as capillaries. In a healthy person, capillaries are hair-pin shaped placed parallel to each other in a fairly uniform distribution. Capillaries exhibit various morphological as well as hemodynamic parameters which vary with the health condition of a person. Important morphological parameters are capillary density, distance between capillaries and capillary dimensions namely length, width and height while Red blood Cell velocity is an important Hemodynamic parameter. Diabetes Mellitus is characterized by the capillary architectures such as tortuosity, avasculature, enlargement and elongation as well as reduction in capillary density. Diabetes is a metabolic disease associated with multiple complications has been a 1
major contributor to morbidity and hence has been considered for the study. Most of the studies have employed a high resolution videocapillaroscope to capture the video of microcirculation in capillaries. Panoramic mosaic of video frames is employed for image stabilization. Skeleton extraction is employed to extract the edges of the capillary and later utilized for parameterization of capillary. In Indian context, NC is yet to gain popularity, the probable reasons being the high cost of Video capillaroscope, lack of operational knowledge etc. We have used a USB digital microscope for imaging as suggested by Vivek Vasdev et al which has a convenient image as well as video capture facility. But the image suffers from lowcontrast which needs to be corrected. USB Digital microscope having electronic magnification of 00x, optical magnification of 4.5, and resolution of 104x968, adjustable light intensity generated by eight LEDs embedded in the device and powered by the USB port is used. This study involves image enhancement, segmentation and classification of capillaries for Diabetes in Indian population. A capillary is a microvessel where the actual exchange of nutrients, gases and waste products happen in a circulatory system. Arteries and veins branch out into arterioles and venules which further branch into capillaries. Capillaries have three limbs namely arteriolar, venular and apical limb, each of them having different dimensions as shown in Fig 1(a). In a healthy person as in Fig 1(b), the capillaries are hair-pin shaped appearing parallel to each other with uniform space between them and typically of similar length. But, in a diabetic patient, some capillaries could be extra-ordinarily enlarged as much as five times that of a normal capillary. They are referred to as giant capillaries or sometimes as mega capillaries. In some cases few capillaries can be much longer than others. As the severity of the disease increases some of the capillaries could be missing. This condition is referred to as avasculature. Presence of avascular regions results in capillary density reduction. Another infrequent capillary shape is a twisted or bent capillary called as tortuous capillary which is shown in Fig 1(c). We propose a methodology of classifying the above four capillary structures in a given nailfold capillary image using Template matching.
(a) (b) (c) Fig 1: Images from USB digital microscope (a) Single capillary image, (b) Parallel capillary loops as observed in capillary images from a healthy control (c) Tortuous capillaries as observed in capillary images from a diabetic patient Objectives: Nailfold capillaroscopy (NC) has been used popularly for study of microcirculation in various diseases including diabetes mellitus. Capillary images of diabetic patients show a wide range of architecture namely tortuosity, avasculature, enlargement and elongation apart from other characteristics such as reduced capillary density and haemorrhages. A computer assisted classification of various capillary architectures is an important step towards automated diabetes detection. The capillary images are obtained from a USB digital microscope. Gaussian filter followed by Otsu s method of thresholding is used for removal of noise, background and image enhancement. Edge detection on enhanced image is done using the Laplacian filter followed by Template matching using correlation between reference and test samples. The performance is discussed using mean correlation values, confusion matrix and the recognition rate for each of the capillary structure. Methodology: IMAGE IMAGE IMAGE CLASSIFICATION ACQUISITION & ENHANCEMENT SEGMENTATION PROCESSING Fig : Methodology of the proposed framework Methodology of the proposed framework seen in Fig is as explained below; 3
Image Acquisition & Processing: The person is placed in sitting position with hands at heart level, immersion oil is applied to the base of the 4th finger of non-dominant hand and the beam of light is focused vertically so that the capillaries could be seen. The room temperature was maintained at 5 degree Celsius, while collecting the images. Fig 3 shows how an image is being acquired from a person. The image acquired from the digital microscope has low contrast with low differentiation between the capillaries and the background. Hence these images have to be processed before classification. Fig 3: Image acquisition from a person with hands placed at heart level. Image Enhancement: The RGB color image of the capillaries obtained from microscope is converted to gray images. This does not alter the quality of the morphological features of interest namely the capillary density, avascular region, enlarged capillary and disorganized capillaries. The nailfold capillary images are low on contrast as well as lighting, with poor demarcation between background and foreground. The histogram of the images showed the pixels of both background and foreground crowded in a narrow region near pixel value of 140. Gaussian filter with the following impulse response given by equation1 is employed a g( x) = e π ax (1) Equation 1. can also be expressed with the standard deviation as parameter and is given by Equation. g ( x) 1 x σ e = () π. σ 4
In Equation, x is the distance from the origin in the horizontal axis, and σ is the standard deviation of the Gaussian distribution. We used a rotationally symmetric Gaussian filter of size 5x5 and standard deviations of 0.5.Gaussian filter has the advantages of removing Gaussian noise, rotationally symmetric and also reduce edge blurring. Image Segmentation: Capillary image thresholding is performed using Otsu s method which converts a gray level image to binary image. The algorithm assumes that the image to be segmented contains two classes of pixels and calculates the optimum threshold separating those two classes so that their combined spread (intra-class variance) is minimal. The intra-class variance (the variance within the class), is defined as a weighted sum of variances of the two classes as in Equation 3: σ ω = ω ( t) σ ( t) + ω ( t) σ ( ) (3) ( t) 1 1 t In Equation 3, weights ω i are the probabilities of the two classes separated by a threshold t and σ i, the variances of these classes. The class probability is computed from the histogram as in Equation 4. t ω 1 ( t) = p( i) (4) 0 While the class mean μi (t) is given by Equation 5. µ t [ p( i) x( i) ] 0 1( t ) = (5) ω1 In Equation 5, x(i) is the value at the center of the i th histogram bin of the image. A second derivative filter is used for edge detection on the thresholded NC images. The Laplacian of a segmented image ƒ is defined by Equation 6, f = f =. f (6) = x,..., 1 Equivalently, the Laplacian of ƒ is the sum of all the unmixed second partial derivatives in the Cartesian coordinates x i as defined by Equation 7. x n 5
f = n x i= 1 i (7) Fig 4(a) shows original cropped image and Gaussian filtered image is shown in Fig 4(b). Segmented and edge detected image using Otsu s and Laplacian filter is shown in Fig 4(c) and (d) Fig 4 (a) Cropped image (b) Filtered image (c) Segmented image (d) Edge detected image Classification by Template Matching using Correlation: A major task after segmentation is to classify a test sample as healthy or diabetic using Template matching. Template matching is a classical approach of classifying a pattern using Cross Correlation. Template matching involves determining similarities between a given template and windows of the same size in an image and identifying the window that produces the highest similarity measure. For classification, the test sample is compared with each template and exact match is obtained using the correlation function. Correlation is a measure of degree to which the two variables agree, not necessary in actual values but in general behaviour. The two variables are the corresponding pixel values in two images test and reference. The correlation coefficient between a test image A and reference image B is calculated using Equation 8. r( A, B) = ( m n ( A ( A mn A)( B A ) ( mn mn m n m n B) ( B mn B ) (8) Where A is the mean of the test pattern A and B _ is the mean of the reference pattern B. Templates are normalized to 100X65 pixels for single capillary and 100X150 for double capillary and then stored in the database. The database consists of six reference templates of Normal (single capillary), Enlarged, Tortuous, Normal (double capillary), and Avascular and elongated as shown in Table 1. There are 0 samples in each category with a 6
total of 100 test samples. Correlation values between the different reference template and test samples are calculated and the mean correlation values are tabulated in Table. Performance of the classifier is analysed using the classification rate as defined in Equation 9. Number of samples correctly classified Classificat ion Rate = (9) Total number of Test samples Normal Enlarged Tortuous Normal Avascular Elongated (a) (b) Table 1. Reference templates for (a) single capillary and (b) double capillary Normal Enlarged Tortuous Normal 0.85 0.45 0.3 Enlarged 0.4 0.8 0.5 Tortuous 0. 0.5 0.79 (a) Normal Elongated Avascular Normal 0.91 0.38 0.56 Elongated 0.43 0.84 0.33 Avascular 0.49 0.8 0.78 (b) Table. Mean Correlation values between reference templates and test samples (a) Single capillary (b) Double capillary 7
Experimental Results: Test sample from the database is cropped and processed using Gaussian filter of 5x5 with a standard deviation of 0.5. Segmentation is performed using Otsu s method with a threshold of 0.5997. Edges are detected using Laplacian filter. The segmented image is then classified as Normal, Enlarged, Tortuous, Avascular, and Elongated using Template matching by correlation. The confusion matrix for each category are tabulated in Table 3. The classification rate for each category is calculated using Equation 9 and tabulated in Table 4. From Table 3 few normal test samples closely resemble enlarged and tortuous samples and hence the classification rate for normal sample is 80%. Few of enlarged and tortuous sample resemble each other and also resemble to a small extent with normal and hence the classification rate for Enlarged sample and tortuous sample is 65% and 70% respectively. Similarly, Avascular and Elongated sample resemble each other and also resemble with normal and hence classification rate for Avascular and Elongated sample is 70 % and 80%. Conclusion & Future Work: Nailfold capillary image having low contrast requires intensity adjustments and this is done using Gaussian filter which remove the noise but retain the edges with great contrast. Thresholding applied on Gaussian filtered images using Otsu s method followed by edge detection gives a proper segmentation of capillary tubular structure standing out against the white background. This segmented image is classified using reference template by correlation. Test samples with the capillary may have slightly different dimensions and slight variation in shape. Hence template matching may not give accurate classification. In future work we will try to extract features from segmented image and then classify using neural network. This, together with measurement of capillary dimension could result in automated nailfold capillaroscopy using digital microscope. 8
Normal Enlarged Tortuous Avascular Elongated Normal 16 Enlarged 3 13 4 Tortuous 4 14 Avascular 14 4 Elongated 16 Table 3.Confusion Matrix Test sample Normal Enlarged Tortuous Avascular Elongated Classification Rate(%) 80 65 70 70 80 Table 4. Classification results 9