# Automatic Classification of Foot Thermograms Using Machine Learning Techniques
## 2 Materials and Methods
### Feature Extraction  
The extraction of features is one of the most important steps in computer-aided diagnostic systems. It intends to extract the most significant and non-redundant information from the images to facilitate the learning process. Previous studies showed that an increase in temperature in the plantar region of diabetic patients is related with foot ulcer appearance [19]. Based on this fact, we calculate the global temperature features average, maximum and minimum from the entire plantar region to retain the general foot condition. However, these parameters are not enough to characterize the status of the foot, because it does not have a uniform temperature. Regional features should also be extracted to describe the pattern of temperatures in the different sections of plantar region. Following a previous work of the same authors, the K-means  
Figure 1: Methodology overview. algorithm is applied to divide the foot into five different clusters with different values of temperature [20]. The clustering algorithm allows the distribution of image pixels between the different thermal clusters, as shown in Figure 2.  
For each cluster, the average, maximum and minimum temperatures are calculated, obtaining this way a total of 15 regional features of plantar temperatures. The clustering algorithm allows for the detection of small hot spots revealing plantar regions that are prone to the appearance of ulcers. In addition to the features already presented, the _Cluster Thermal Index_ (CTI) is also included in the list of features to provide a quantitative estimation of the thermal changes of the foot caused by DM. The CTI provides a measure of temperature deviation between a subject and the control group, taking into account not only the temperature difference between the clusters but also the range of temperature in the control group. The index is based on the average temperature of each cluster in relation to reference temperatures obtained from the healthy individuals (control group). To establish the reference temperatures in the control group, firstly the clusters are sorted in ascending order according with the centroid value. After, the average temperature of each cluster (\(\overline{CG_{i}}\)) is calculated. Table 1 shows the reference temperatures obtained in the control group, with 45 subjects. The CTI is calculated as the average of the positive differences between the average temperature in each cluster of a subject and the correspondent reference temperatures, obtained in the control group, as is (1). \[\text{CTI}=\frac{\sum\limits_{i=1}^{k}|CG_{i}-IND_{i}|}{k}, \tag{1}\]  
where \(k\) represents the number of clusters, (\(CG_{i}\)) is the reference temperature of cluster \(i\) and \(IND_{i}\) is the average temperature in cluster \(i\) for the subject. Table 2 illustrates the result of feature extraction in thermograms of a non-diabetic and a diabetic subject. A total of 19 features are extracted from each thermogram, which are used to feed the classifiers algorithms of the next stage. It is observed that the global temperature values in the diabetic subject and their respective cluster temperatures are \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Cluster** & **1** & **2** & **3** & **4** & **5** \\ \hline \(\overline{Tc}\) & 23.93 & 25.52 & 26.59 & 27.61 & 28.88 \\ \(\mathit{Std.\ dev.}\) & 1.76 & 1.54 & 1.57 & 1.51 & 0.92 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Average and standard deviation of the temperature (\({}^{\circ}\)C) for the Control Group, per cluster. Figure 2: Thermogram division in clusters. **First row:** RGB representation of thermal image and the clusters image representation, in non-diabetic (**left**) and diabetic (**right**); **Second row:** the 5 individual clusters. further away from the reference values, as shown in Table 1. This results in a CTI value of 3.23. In the case of the non-diabetic subject, we observe smaller deviations between the features values and the references temperatures, resulting in an CTI value close to 0 (0.24).