# Azure-Based Smart Monitoring System for Anemia-Like Pallor
## 3 System Architecture Overview
### Back-End Methodology  
Studies till date with patients having iron-deficiency anemia have demonstrated that anemia-like pallor requires manual assessment of the following pallor-sites [25]: the conjunctiva, tongue, nail-bed, palm and skin-color. In our prior work [4], a preliminary assessment of pallor site images for automated severity classification was presented. Each input pallor site image (\(I\)) is in 'jpg' format, with the three color planes, red, green and blue \([I_{red},\ I_{green},\ I_{blue}]\), respectively. For evaluation purposes, a set of 27 eye images and 56 tongue images are collected from public domain sources and manually annotated for subjective pallor indices. These images are representative of variable patient demographics and variable imaging conditions, fields of view. Each pallor site image has dimensions ranging from [155 \(\times\) 240] to [960 \(\times\) 1280] pixels per color plane, and the subjective severity grades are as follows: grade 0: normal patients, grade 1: patients with anemia-like pathologies, grade 2: patients with pathologies/abnormalities that are not manifestations of anemia. The eye and tongue data sets are analyzed separately using 5-fold and 3-fold cross-validation [26], respectively. Since the pallor site images are obtained from uncontrolled imaging conditions, it is imperative to ensure intensity equalization and similar sizes of the ROIs. Each image is resized to [250 \(\times\) 250 \(\times\) 3] RGB color planes followed by histogram equalization of each color plane in range (0, 255), pixel normalization in range [0, 1] and color plane contrast normalization [27]. Next, for model \(M1\), the green plane image is low-pass filtered using an averaging filter, thereby resulting in image \(I_{lp}\), in Equation (1). The size of 2-D averaging filter is empirically determined from training data sets as [3 \(\times\) 3] for eye images and [5 \(\times\) 5] for tongue images, respectively. Then, the high-pass filtered image (\(I_{hp}\)) is thresholded to detect a binary image (\(I_{\tau_{1}}\)) containing significant edge regions with area greater than 20 pixels. A convex hull can then be fitted around the regions in \(I_{\tau_{1}}\), resulting in a mask (\(g\)) for the pallor sites. To ensure similarly sized pallor masks, the fraction of the total number of pixels in the mask '\(g\)' are utilized. If this fraction exceeds a certain threshold, as in Equation (2), it would imply that the pallor region of interest is not well centered, thereby the image would need to be padded around the edges, as in Equation (3). The thresholds \([\tau_{1},\tau_{2}]\) are empirically determined as [0.2, 0.3], respectively, from the training data sets. An example of eye pallor site image that is padded for pre-processing is shown in Figure 7.  
\[ \begin{array}{c}I_{hp}=I_{green}-I_{lp},\ I_{\tau_{1}}=I_{hp}>\tau_{1}.\\ g\leftarrow ConvHull(I_{\tau_{1}}).\\ \text{If, }\frac{\sum_{i}\sum_{j}g(i,j)}{\text{\#pixels in }I_{green}}>\tau_{2},\\ \\ I\gets PaddedImage(1).\end{array}  \tag{1}\]  
Based on the variabilities introduced by the data sets, two data models (\(M1\), \(M2\)) are analyzed for pallor severity index classification tasks. These 3-step data models are shown in Figure 8 and described as follows. The first model (\(M1\)) detects specific spatial ROIs, indicative of patient pallor, followed by extraction of pixel intensity features corresponding to color plane and gradient images within the ROIs. Next, the features extracted from test images are utilized for pallor grade classification. The second model (\(M2\)) is designed to detect the most significant color plane and gradient image for pallor classification purposes. Color plane transformations are applied to each pallor-site image, generating 12 image color planes: red, green, blue, hue, saturation, intensity (from RGB to HSV transformation), lightness, a-plane, b-plane (from RGB to Lab transformation), luminance, 2 chrominance planes (from RGB to Ycbcr transformation).