## 2 Materials and Methods
### Operating Phase  
The OP (Figure 6) classifies the boxes obtained by division of the retinal image under investigation and also determines some parameters of the detected RoIs like position and size. The block diagram from Figure 6 shows a multilevel structure of this phase. The first level does the calculation of features established in the learning phase. All features are computed in a parallel manner: contrast on green (\(ConG\)), energy on green (\(EnG\)), homogeneity on green (\(HomG\)), mean intensity on green (\(ImG\)), mean intensity on red (\(ImR\)), differential fractal dimension on green (\(FDG\)) differential fractal dimension on red (\(FDR\)), lacunarity on blue (\(LB\)), lacunarity on green (\(LG\)), lacunarity on red (\(LR\)), and local binary pattern on H (\(LBPH\)). The second layer is the classifiers' layer for \(OD\), \(MA\), \(EX\), and \(HE\). For each feature involved, the corresponding weight (from the learning phase) is assigned. The classifiers, based on a voting scheme, use the representatives of the classes also established in the learning phase. The classifier outputs are equal to \(1\) if the box contains the corresponding RoI and \(0\) if not. The last layer of the structure represents the output layer (module) of ISRI and establishes the type of RoI--\(OD\), \(MA\), \(EX\), \(HE\), or \(NR\) (by RoI detection module)--RoI position, and the evaluation of the size of RoI (as percent from box area). To this end, a binarization procedure is needed. Below, the algorithms for RoI detection and evaluation are presented (Algorithms 1-4). * _OD_ Detection and Localization
* **Inputs:** Images to be analyzed; selected features \(F\) for _OD_ detection: _ImG_, _ConG_, _FDG_, and _LBPH_; the weights for selected features, \(w_{ij}\) and the intervals \(\mathfrak{I}_{i}\), \(i\) = 1,..., 10, for _LBPH_. * Box containing _OD_ (BOD) and BOD position;
* For each image \(I\):
* Image decomposition in G and H components; Image primary processing;
* Image decomposition by the sliding box algorithm (128 x 128 pixels, for STARE database);
* For each box \(B_{k}\):
* Use CNN for blood vessel detection;
* Segmentation of blood vessels and assign value of 1 to pixels of blood vessels;
* Calculate the selected features: _ImG_, _ConG_, _FDG_, and _LBPH_;
* Calculate \(D_{1}(B_{k})\);
* Box classification based on voting scheme;
* Retain the boxes with \(D_{1}\left(B_{k}\right)\geq 0.7\times\sum\limits_{j=-1}^{s}w_{ij}\) which represent BOD;
* For the four highest values of \(D_{1}(B_{k})\) calculate the blood vessel density (BVD) on G component:
* Compute the number of \"1\"s (BVD);
* Retain the box with higher BVD, which represents BOD;
* Calculate the CDR for BOD;
* Calculate BOD position;
* Return BOD, BOD position. Figure 6: Block diagram for the operating phase (OP) and output module (included). ```
Inputs: Images to be analyzed; selected features \(F\) for \(MA\) detection: \(ConG\), \(EnG\), \(LG\), and \(LB\); the weights for selected features, \(w_{j}\). Outputs: Box containing \(MA\) (BMA) and BMA position;
1 For each image \(I\):
2 Image decomposition in G and B components; Image primary processing;
3 Image decomposition by the sliding box algorithm (128 x 128 pixels, for STARE database);
4 For each box \(Bi\):
5 Calculate the selected features: \(ConG\), \(EnG\), \(LG\), and \(LB\);
6 Calculate \(D_{2}(Bi)\);
7 Box classification based on voting scheme;
8 Retain the boxes with \(D_{2}\left(B_{k}\right)\geq 0.7\times\sum\limits_{j=1}^{s}w_{z_{j}}\) which represent BMA;
9 Calculate BMA position;
10 Return BMA, BMA position. ```  
**Algorithm 2**Operational Phase--\(MA\)  
```
Inputs: Images to be analyzed; BOD position; selected features \(F\) for \(EX\) detection: \(ImG\), \(ConG\), \(EnG\), \(HomG\), and \(FDG\); the weights for selected features, \(w_{3}\).