# Automatic Classification of Foot Thermograms Using Machine Learning Techniques
## 2 Materials and Methods
### Classification Algorithms  
Image classification involves the extraction of information from an image and then associating it with a class label. Classifying images in the machine learning domain can be approached as a supervised learning task. In this type of learning, the system must \"learn\" inductively an expression of a model that describes the data, called the target function. This function is used to predict the value of a variable, called a dependent variable or output variable, from a set of variables, called independent variables or input variables, also known with features.  
There are several supervised machine learning algorithms that deal with classification. In this study, Logistic Regression, Support Vector Machines and k-Nearest Neighbors are used.  
In general, the logistic regression classifier uses a linear combination with more than one input variable as an argument for the sigmoid function, obtaining a value between 0 and 1 as the output of the function. In particular, an input that produces a result greater than 0.5 is considered to belong to class 1. On the other hand, if the output is less than 0.5, the corresponding input will be classified as belonging to class 0.  
In the SVM algorithm, the objective is to find a hyperplane in an N-dimensional space (N represents the number of input variables), which classifies the data. In order to separate the classes, there may be several possible hyperplanes; however, the ideal is to find a plane that maximizes the distances between the class data, called the maximum margin. Maximizing the distance from the margin provides some reinforcement so that the points of future data can be classified with more confidence [21]. The classifier has different kernel functions, allowing it to adjust to different types of data. In this study the classifier will be tested with the linear and the quadratic kernel.  
The k-NN algorithm consists of assigning a new example for the most common class among its closest k-neighbors. To classify a point \(x\) as belonging to one of the classes, the  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Features** & & **Non-Diabetic** & **Diabetic** \\ \hline \multirow{3}{*}{**Global**} & **Avg.** & 26.75 & 29.75 \\  & **Max.** & 29.90 & 33.10 \\  & **Min.** & 22.94 & 26.35 \\ \hline \multirow{6}{*}{**Regional**} & **Avg.** & 23.83 & 27.85 \\  & **Max.** & 24.80 & 28.23 \\  & **Min.** & 22.94 & 26.35 \\ \hline \multirow{6}{*}{**Regional**} & **Avg.** & 25.82 & 28.67 \\  & **Max.** & 26.32 & 28.24 \\  & **Min.** & 24.81 & 29.14 \\ \hline \multirow{6}{*}{**Regional**} & **Avg.** & 26.82 & 29.66 \\  & **Max.** & 27.37 & 29.16 \\  & **Min.** & 26.33 & 30.18 \\ \hline \multirow{6}{*}{**Regional**} & **Avg.** & 27.94 & 30.73 \\  & **Max.** & 28.55 & 30.20 \\  & **Min.** & 27.38 & 31.21 \\ \hline \multirow{6}{*}{**Deviation from**} & **Avg.** & 29.13 & 31.76 \\  & **Max.** & 29.90 & 31.23 \\ \cline{1-1}  & **Min.** & 28.55 & 33.10 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Extraction of features in the thermograms of two subjects: Non-diabetic and Diabetic.  
observed data points closest to \(x\) are found. That is, the classification rule is to assign \(x\) to the population that has the most observed data points out of the \(k\)- nearest neighbors [22]. For example, if \(k\) is 1, then \(x\) is simply assigned to your nearest neighbor's class. This classifier allows for changing the number of neighbors (\(k\)), in order to improve the classification. In this work, 3-NN and Weighted k-NN will be applied.