Image Processing using the Smartscope M5 for Early Diagnosis of Human Skin Damage due to Type 2 Diabetes Mellitus
Thomas Gailliegue, Giorgos Asfis, Channa Nageswaran
TWI Ltd, Granta Park, Great Abington, Cambridge CB21 6AL, UK
TWI Member Publication. July 2013.
Abstract
Diabetes mellitus (DM) is a heterogeneous group of disorders characterized by a high serum glucose level and by disturbances of carbohydrate and lipid metabolism. Diabetics have a greater prevalence of skin manifestations in Type 2 than Type 1, and as the duration of the DM increases, the likelihood of developing skin manifestations also increase [1]. Early referral to the dermatologist may help to detect complications of the skin in diabetes at an early stage and may prevent disability caused by these complications.
This paper presents the work done to develop accurate early-stage detection, diagnosis and monitoring that will reduce the micro-vascular and macro-vascular complications of DM. The system developed using appropriate information and communication technologies would provide for effective communication among physicians, by performing consultations, information and knowledge exchange. Therefore, the time between the right diagnosis and effective treatment will be minimized and the probability of negative consequences to the patient‘s health (limb amputations, or even death) could be avoided.
The novel “smart” diagnostic technique and portable equipment which was developed in the project was intended to be used by offices of general practitioners and local primary care clinics. Also, the low weight and mobility of the equipment will be suitable to be used for patient homecare as well. The capabilities of modern telemedicine technology such as the work described in this paper will give the possibility to use the outcome of the project especially in rural or underserved areas by performing tele-consultations with tertiary level specialists.
1. Introduction
The portable Smartscope M5 camera is being used in the development efforts by a range of organisations in the medical industry [2].
The objective of this paper is to suggest an image processing protocol that may guide in the detection and identification of skin spots. In image processing, segmentation is the partitioning of an image into two or more regions and in this work this technique was used to separate the skin spot from the skin and allow an accurate analysis of the spot color. The segmentation of the spot will be performed using the Level Set method and the color analysis using histograms. The software to process the data was implemented in the MATLAB® environment to give the spot color and size as the output.
This paper first describes the nature and the acquisition of the images used in this study before presenting the different methods implemented in the processing algorithm. The paper concludes by giving a short user guide of the MATLAB program followed by a brief presentation of the results obtained with testing images.
2. Methodologies
2.1 Image acquisition with Smartscope M5
Ink blots in different colors were drawn on white paper as an initial representation of skin discoloration on skin. Images were taken using the Smartscope M5 without any optics module. As the program developed was efficient, some skin pictures with artificial spot (drawn) have also been taken to propose a possible utilization of the program for early stage diabetic’s diagnosis. The Smartscope M5 is a 400g camera with dimensions of 82.30mm (w) 166.50mm (h) 66.50mm (d) and powered by a rechargeable Ni-MH battery. This camera gives JPEG images at the resolution of 2560 1920 pixels. It can be connected to a PC through the USB port and is working on Windows XP®, Windows Vista®and Windows 7® without additional driver installation.
Figure 1 - Smartscope M5 device on left and input image of the study on right
2.2 Segmentation
Segmentation is the partitioning of a digital image into different recognizable regions that share similar properties (such as similar intensity or colour) or that belonging to the same object. Segmentation was used to discriminate and extract the region of interest from the background, such that the color analysis is done only on the ink as in this study (towards processing skin spots for medical application).
In image processing several active contour methods have been developed [3]. The central idea is to represent the evolving contour using a signed function, where its zero level corresponds to the actual contour. After defining the evolving function and the force field, the initial curve will be iteratively deformed to converge with the zero level of the function hence detecting the object’s edge.
Figure 2 - Description of active contour method detection
Contour methods include parametric and geometric types but geometric methods give detections with higher precision, allowing the detection of several objects simultaneously and the initialisation can be done anywhere in the image space. Due to this advantage, geometric active contour methods are often used and one of the more common approaches is the Level Set technique. The program developed on MATLAB for this work uses the geometric active contour method Chan-Vese [4], which uses a Level Set method [5] to condition the contour evolution. Thus a brief example of the Level Set method is described below.
We define some function φ(x, y, t) (the Level-Set function), where (x, y) are coordinates in the image plane and t is an artificial ‘time’. At any given time, the Level Set function simultaneously defines an edge contour and a segmentation of the image. The edge contour is taken to be the zero Level Set {φ(x, y, t)=0}, and the segmentation is given by the two regions {φ > 0} and {φ < 0}. The Level Set function will be evolved according to a partial differential equation (PDE), and will reach a steady state limit leading to a useful segmentation of the image.
Figure 3 - Level set method at time t. On Left the level set curve and on right the result contour at time t
Using the Level Set PDE the following evolution equation is obtained which will guide the curve movement until the curve corresponds to the required segment:
In this equation, g(x,y) is the stopping function which uses the algorithm based on the Mumford–Shah segmentation model [6]. Usually this function depends on the gradient value because it is easier in an image to associate the boundaries of a new encountered object with high gradient. The specificity of the Chan-Vese algorithm is that it does not use the gradient to stop the curve evolution but the different intensity between regions, which are expected to be homogenous. This method allows to place the initial curve anywhere in the image and to detect interior contours as well. The Chan-Vese algorithm implemented on MATLAB was largely inspired by Yue Wu’s approach[7].
2.3 Processing
In MATLAB images are represented in matrices where each value represents a pixel. Once the segmentation is performed the output matrix is a binary image where the region of interest’s pixel values are 1 and the background’s pixel values are 0. Thereby the data images should be converted to RGB to allow operations on the input image. In MATLAB the instruction ‘.*‘ permit to perform an element by element multiplication. Thus, the background of our image is clean (black pixels with 0 value) and the task’s pixels keep the initial value (following division of the result by the white pixel’s value 255).
Figure 4 - Image conditioning to perform colour analysis. On top illustration of MATLAB element by element multiplication and on bottom the effect on the corresponding images
The colour analysis can now be precisely performed. In numerical imaging the histogram is the most common tool, used to display the image intensity. For a grey level image, every intensity value (axis) is associated with its apparition number (ordinate). Usually, RGB histograms are plotted in a colour space in three dimensions (3D). In this development, the three components (R, G and B) were plotted on the 2D histogram. Thus, the histogram reading is similar to that of a grey level image and is easier to realize by the user. Note that for an RGB image every pixel value is a combination of the three plotted components. In this work the histogram’s pixel values start from 1 instead of 0 to avoid excessive and useless black pixels. Figure 4 shows the two kinds of histograms presented as results by the MATLAB program developed in this project.
Figure 5 - Histograms plotted in MATLAB. On left the grey level histogram and on right the RGB histogram
The developed program also outputs the task size in number of pixels contained within it and the percentage of task over the whole image.
3. Results
Tests were performed with two different images, one with a blue ink task and another with a red ink task. Image names were blue.JPG and red.JPG, their sizes were both 1920*2560 pixels and 1000 iterations were performed for the Chan-Veze segmentation. As the results were efficient the use of the program for the medical aims using images taken of the skin was undertaken as the next stage.
3.1 The use of the MATLAB program
The program was designed to be user friendly. User just has to call the function detector and enter few parameters in MATLAB command line:
>> detector (filename, n);
The image must be imported into MATLAB data folder before utilisation in the program. Filename corresponds to the name of the data image and n is the number of iterations to undertake the segmentation routine.
3.2 Results with blue.JPG and red.JPG
For one test, MATLAB gives three results: one figure with the details of segmentation using Chan-Veze, one figure with the two histograms front of the corresponding image and then the processed segmented region (ink task as in this study). All the results for blue.JPG and red.JPG input data are presented in Figures 6 to 11.
Figure 6 - Segmentation for “blue.JPG”
Figure 7 - Colour Analysis for “blue.JPG”
Figure 8 - Size analysis for “blue.JPEG”
Figure 9 - Segmentation for “red.JPG”
Figure 10 - Colour Analysis for “red.JPG"
Figure 11 - Size analysis for “red.JPG”
3.3 Results on skin data
As discussed earlier, the Chan-Veze algorithm requires good homogeneity within distinct regions. Because of the possible inhomogeneity on the skin region and the reflection due to the device, an optimisation of the algorithm is required for data sets that represent more closely the nature of the human skin. Figure 12 illustrates the limitation when the current algorithm is applied on skin.
Figure 12 - Segmentation problems on skin pictures
To solve this problem, the algorithm has to be initialized into the spot (task) and thus it will not be affected by reflexion or skin homogeneity because they become insignificant compared to the spot itself. There are two solutions to realize this initialization with different advantages. The first one is to perform the initialization in the middle of the image. This solution requires the photographer to place the spot in the middle of the camera but with the program still running automatically on the input image for processing. The other solution consists of asking the user to click on the picture where he wants to initialize the algorithm, which should be within the spot. This method allows detecting a spot anywhere in the image but the program becomes semi-automatic and needs one interaction with the user.
Figure 13 - Solutions for segmentation on skin images. On left automatic solution, on right semi-automatic solution
Figure 14 - Good agreements on histogram for the two methods using different images of the same skin spot which validate the colour analysis of the study
The skin spot sizes were different from 13% of image’s size for the first picture to 10% for the other. When the Smartscope M5 device is used for dermatoscopic imaging the objective’s camera touches the skin and can stretch the spot, which accounts for the discrepancy between the two sizes.
4. Conclusions
A MATLAB program was successfully developed to perform object analysis in an image. The program ran quickly and is easy to use which can be helpful to general practitioners and local primary care clinics to evaluate skin spots and perform diagnoses. Moreover, it gives a precise colour analysis and size of the object analysed. The techniques have been successfully demonstrated on ink areas and is being refined for skin spot analysis. The algorithm used can detect several objects in the same image and can also detect details within regions but requires a minimum level of inhomogeneity between objects. As skin images can present inhomogeneity, two solutions have been presented in this paper to apply this algorithm in early-stage diabetic diagnosis.
5. References
[1] Mayo Clinic staff, Jan 2013, Types 2 diabetes, symtoms, Retrieved from: http://www.mayoclinic.com/health/type-2-diabetes/DS00585/DSECTION=symptoms
[2] Optomed, 2013, Smartscope M5, Retrieved from: http://www.optomed.com/smartscope_m5/
[3] Yasmina Chenoune, Modeles deformables de courbe en analyse d’image, January 2012
[4] Tony F. Chan and Luminita A.Vese, “Active Contours Without Edges”, IEE transactions on image processing, VOL10, NO2, February 2001
[5] Stanley Osher and Ronald P.Fedkiw, ‘‘Level Set Method: An Overview and some Recent Results’’, Journal of Computational Physics 169, 2001
[6] David Mumford and Jayant Shah, Optimal Approximations by Piecewise Smooth Functions and Associated Variational Problems, Received July 1988.
[7] Yue wu march 2009, The mathworks, Chan Veze Active contour without edges, Retrieved from: http://www.mathworks.com/matlabcentral/fileexchange/23445