# Machine Learning Models for the Classification of Histopathological Images of Colorectal Cancer
## 3 Results
\begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline  & & & & & & & & \\ \hline \multirow{8}{*}{**Predicted**} & **Adipose** & **Complex** & **Debris** & **Empty** & **Lympho** & **Mucosa** & **Stroma** & **Tumor** \\ \cline{2-10}  & **Adipose** & 156 & 7 & 3 & 2 & 0 & 3 & 2 & 1 \\  & **Complex** & 0 & 150 & 3 & 0 & 14 & 1 & 12 & 7 \\  & **Debris** & 3 & 3 & 168 & 0 & 0 & 4 & 20 & 0 \\  & **Empty** & 4 & 0 & 0 & 202 & 0 & 0 & 0 & 0 \\
**classes** & **Lympho** & 0 & 6 & 0 & 0 & 169 & 1 & 0 & 3 \\  & **Mucosa** & 0 & 1 & 3 & 0 & 2 & 168 & 0 & 11 \\  & **Stroma** & 0 & 5 & 10 & 0 & 0 & 0 & 142 & 2 \\  & **Tumor** & 0 & 7 & 0 & 0 & 1 & 8 & 0 & 155 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Confusion matrix of the XGBoost algorithm for the test set. compared to the \"Adipose\" and \"Empty\" classes, for example. The F1-scores generally reflect a balance between precision and recall, with higher values indicating good overall performance. Notably, the F1-scores for the \"Empty\" and \"Debris\" classes are particularly high (98.3% and 84.2%, respectively), indicating effective classification performance for these classes. Compared to the CNN model, the SVM algorithm achieves similar or slightly higher performance across most classes. However, it is important to consider factors such as computational efficiency and ease of implementation when choosing between these two algorithms for a specific task. Overall, the SVM algorithm demonstrates effectiveness in classifying different tissue types in the image dataset, but further analysis may be warranted to identify areas for improvement or optimization, especially in classes with lower precision or sensitivity. \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline  & \multicolumn{8}{c}{**Algorithm**} \\ \hline  & **NB** & **CIT** & **KNN** & **SVM** & **XGBOOST** & **RF** & **CNN** \\ \hline Adipose & 95\% & 97\% & 73\% & 98\% & 97\% & 97\% & 97\% \\ Complex & 79\% & 86\% & 59\% & 91\% & 90\% & 90\% & 70\% \\ Debris & 81\% & 90\% & 63\% & 92\% & 94\% & 94\% & 81\% \\ Empty & 99\% & 97\% & 92\% & 100\% & 99\% & 99\% & 96\% \\ Lympho & 88\% & 92\% & 58\% & 91\% & 95\% & 93\% & 96\% \\ Mucosa & 92\% & 91\% & 70\% & 95\% & 95\% & 94\% & 93\% \\ Stroma & 80\% & 79\% & 50\% & 87\% & 90\% & 91\% & 95\% \\ Tumor & 85\% & 88\% & 85\% & 91\% & 93\% & 91\% & 95\% \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Balanced accuracy for each tissue class and algorithm. Figure 5: Comparison of predictive performance (**(A)** sensitivity, **(B)** specificity, **(C)** precision, **(D)** F1 score) in the test set across the different tissue types and algorithms used. The CNN performed well for all the different classes, especially for \"Adipose\", \"Lympho\", \"Stroma\", \"Empty\" and \"Tumor\", in which it achieved at least 95% accuracy in the test set. On the contrary, it achieved lower accuracy for the \"Debris\" class and for the \"Complex\" tissue in the test set. The model demonstrated excellent performance in detecting the \"Empty\" class, with high sensitivity (98.9%) and specificity (99.7%). This suggests that the model is proficient in accurately identifying images belonging to this class while minimizing false positives and negatives. While the sensitivity for the \"Adipose\" class is high (95.5%), the precision is even higher (97.6%), indicating that the model not only detects a high proportion of actual \"Adipose\" instances but also has a low rate of false positives among the predicted \"Adipose\" instances. The model's performance varies across different classes, with some classes like \"Complex\" and \"Tumor\" exhibiting lower precision and sensitivity compared to others. This indicates potential areas for improvement, such as gathering more data or fine-tuning the model architecture specifically for these classes. Overall, the model achieves competitive F1-scores across most classes, demonstrating its effectiveness in balancing precision and recall for multi-class image classification tasks.