# Computer-Aided Detection of Hypertensive Retinopathy Using Depth-Wise Separable CNN
## 3 Materials and Methods
### Preprocessing and Data Augmentation  
The goal for the initial image processing stage is to lessen the impression of disparities in lighting between photos, such as the fundus camera's brightness and angle of incidence. Using a Gaussian filter, we normalized the color balance and local illumination of each fundus picture. This was achieved in two phases: (1) color space conversion, (2) lightening and contrast correction. Consider fundus images in RGB space with a white point chromaticity of a certain value (e.g., D65). To remove gamma or camera response nonlinearities first, RGB coordinates were linearized. Then the linearized RGB components were converted to correct colorimetric CIE-XYZ coordinates. After that, the \(XYZ\) axes were translated to linear \(LMS\) space. Equations (1) and (2) represent the transformation matrices:  
\[ \begin{bmatrix}X\\ Y\\ Z\end{bmatrix} = \begin{bmatrix}0.5141&0.3239&0.1604\\ 0.2651&0.6702&0.0641\\ 0.0241&0.1228&0.8444\\ \end{bmatrix}\begin{bmatrix}R\\ G\\ B\end{bmatrix}  \tag{1}\]  
\[ \begin{bmatrix}L\\ M\\ S\end{bmatrix} = \begin{bmatrix}0.3811&0.5783&0.0402\\ 0.1967&0.7244&0.0782\\ 0.0241&0.1288&0.8444\\ \end{bmatrix}\begin{bmatrix}R\\ G\\ B\end{bmatrix}  \tag{2}\]  
The data in \(LMS\) color space has a lot of skews, which can be reduced significantly by converting it to logarithmic space (\(L\), \(M\), \(S\)) = log (\(L\), \(M\), \(S\)) [44, 48]. The \(\mathsf{l}\alpha\)\(\mathsf{S}\) color space, a visual color space based on LMS cone reactions in the human retina, is used in this paper. The logarithmic \(LMS\) space is then converted into \(\mathsf{l}\alpha\mathsf{S}\) using Equation (3) [44]:  
\[ \begin{bmatrix}l\\ \alpha\\ \beta\end{bmatrix} = \begin{bmatrix}\frac{1}{\sqrt{3}}&0&0\\ 0&\frac{1}{\sqrt{6}}&0\\ 0&0&\frac{1}{\sqrt{2}}\end{bmatrix}\begin{bmatrix}1&1&1\\ 1&1&-2\\ 1&-1&0\end{bmatrix}\begin{bmatrix}L\\ M\\ S\end{bmatrix}  \tag{3}\]  
l: \(\alpha\) (\(\mathsf{r}+\mathsf{g}+\mathsf{b}\)), \(\alpha\): Yellow-blue \(\alpha\) (\(\mathsf{r}+\mathsf{g}-\mathsf{b}\)), \(\beta\): Red-green \(\alpha\) (\(\mathsf{r}-\mathsf{g}\)). This \(\mathsf{l}\alpha\beta\) color space is used in the next section for fundus images color enhancement because the decorrelation process allows for disjointedly handling the three-color channels, streamlining the color enhancement process. After completing the color enhancement process, all the retina photos were transformed to RGB color space. Most of the retina fundus images suffered from poor luminance, which significantly affected the detection of retina lesions or features and consequently affected the classifi  
Figure 2: Example of HR fundus photo used to train the CAD-HR-diagnosis system. cation accuracy. As a result, the luminance enhancement procedure must be completed correctly to ensure that the upgraded photos preserve the correct color information. This can be done by producing the following luminance gain matrix LG ():  
\[LG(\alpha,\beta)=\frac{r^{\prime}(\alpha,\beta)}{r(\alpha,\beta)}=\frac{g^{ \prime}(\alpha,\beta)}{g(\alpha,\beta)}=\frac{b^{\prime}(\alpha,\beta)}{b( \alpha,\beta)} \tag{4}\]  
where \(r^{\prime}\), \(g^{\prime}\) and \(b^{\prime}(\alpha,\beta)\) represent the RGB values of any image-pixel, within the enhanced retinal image. As indicated, the illumination matrix is defined in Equation (5) for color invariant improvement of an RGB image. \[LG(\alpha,\beta)=\frac{\partial^{\prime}(\alpha,\beta)}{\partial(\alpha,\beta )}=\frac{\partial^{\prime}(\alpha,\beta)}{\sqrt{\sum_{c\in\{r,\beta\}}c^{2}( \alpha,\beta)}} \tag{5}\]  
where \(\partial(\alpha,\beta)\) is the illumination strength of a pixel at (\(\alpha,\beta\)) space and \(\partial^{\prime}(\alpha,\beta)\) is the boosted illumination image. The Adaptive Gamma Correction (AGC) technique is employed at this moment to increase the brightness of a given image. A quantile-based histogram equalization approach [49] was used for such cases. The q-quantiles are a set of 'q' different values that divide the intensity distribution into q equal proportions.