# Artificial Intelligence-Based System for Retinal Disease Diagnosis
## 2 Materials and Methods
### SGB-Classification in Decision Making  
The problem of retinal diseases diagnosis using a set of factors can also be considered as a multi-class classification problem on imbalanced data. To solve it, taking into account the given four diagnoses--classes--, it is necessary to classify the patient into four classes. Each class corresponds to one of the four listed diseases. We select methods and determine their comparative efficiency for the classification. The classification model must be robust for input data noise and give highly accurate results. Classification of imbalanced datasets is a relatively new area of research in machine learning that takes into account skewed distributions of sample data. A dataset is imbalanced if one class contains more objects than other classes [36]. Most standard machine learning algorithms show poor performance on such datasets because they favor classes with a large number of objects during classification, which results in poor prediction accuracy compared to classes containing a small number of objects [37]. Therefore, it is difficult to learn rare but important instances of classes. In practice, when estimating classification error, the same loss cost (loss function) is assumed for all objects from any class. We consider the following types of classifiers: metric, linear and boosting. Metric classifiers are easy to use; they use analysis of the objects' similarities in the sample with training methods, but they are not flexible and they are unstable to data noise and outliers in the initial data. Linear classifiers are flexible algorithms, but they are limited in that they assign objects to one of two classes; that is, they are used for binary classification. For the problem being solved, this classifier is not suitable. The third type of classifiers--boosting--allows weak classifiers to be combined into one strong one, and on the basis of this combination, the shortcomings of each algorithm to be eliminated. The use of a metric classifier based on the KNN (\(k\)-nearest neighbor) algorithm and boosting based on the SGB (stochastic gradient boosting) algorithm for the problem of retinal diseases diagnosis showed the following accuracy results. The classification quality assessment is estimated by the number of correct predictions--the diagnosis of the patient in the test sample (75% of patient data is used as a training sample and 25% as a test sample). Thus, in the KNN-based model, 84.7% of correct assignments of two clusters were obtained, and in the SGB-based model, 95.1% of correct predictions were obtained. Boosting is one of the most powerful recognition algorithms. This is for the adaptive technique of composition construction [38; 39]. Taking into account the features of the problem being solved, it is possible to select a set of basic algorithms and a loss function [40; 41], which is to focus on the processed data features. We propose to use SGB; these are algorithms that represent boosting as a gradient descent process. The algorithm is based on a sequential refinement of a function, which is a linear combination of basic classifiers in order to minimize the loss function. The classification model based on the stochastic gradient boosting algorithm was presented and described in detail in the author's previous work [42]. Multi-Class Performance Metrics for Classification Algorithms  
To evaluate the quality of the used classification algorithms--the rule based (RB) classifier and the SGB classifier--, we use an extension of the _AUC_-based metric for multi-class problems, _MAUC_ (multi-class area under curve) [43], which averages the _AUC_ value of all pairs of classes and can be used in studies of multi-class imbalanced data learning. The metric is defined as:  
\[MAUC=\frac{2}{C(C-1)}{\sum_{i<j}AUC(i,j)},\]  
where \(C\) is the number of classes, is the _AUC_ value between class \(i\) and class \(j\).