# Automatic Classification of Web Images as UML Static Diagrams Using Machine Learning Techniques
## 3 Related Work
However, their tool does not currently solve all the problems they have identified (in particular, OCR recognition of text, recognition of relationships and lack of XMI standardization in tools). Moreover, they use a small number of images to validate the tool (respectively 10 and 200 images in [21] and [22]), reaching 89% accuracy. A machine learning approach is introduced in the work of [PERSON] and [PERSON] [24], who use 23 image features to train an automatic classifier of class diagrams (CD) using the Support Vector Machine (SVM) algorithm, in this case based on computer vision techniques implemented with aid of the open source image-processing libraries OpenCV and Magick++. They use a training set of 1,300 images downloaded from various online sources, equally divided in CD and non-CD, with an average time of 10 s to process each image and extract the graphical features used by the classification algorithm, reaching a 91.2% accuracy of correct classifications. The previous two works were continued in [PERSON] et al. [25], who further investigated image features that can be effectively used to classify images as class diagrams and to train an automatic classifier. They were able to reduce the number of image features from 23 to 19, and the processing time from 10 to 5.84 s, using six different learning algorithms with the same training set of 1,300 images. Each algorithm reaches slightly different results, ranging from 90.7% to 93.2% in accuracy. However, the authors consider specificity followed by sensitivity as the most important measures of effectiveness, thus they point to Logistic Regression and Random Forest as their best candidates. Finally, [PERSON] et al. [26] use the same automatic tool developed by [25] with a new set of 19,506 images collected from GitHub and manually classified as CD and non-CD. They do not train the tool again, but they use it as-is to automatically classify the new set of images and compare the accuracy obtained with previous results. Among the six learning algorithms developed by [25] they choose Random Forest because of its best performance. The authors report 98.6% precision and 86.6% recall in positive detections, but from these data alone accuracy cannot be computed (they do not explicitly give the count of true and false positives/negatives). Moreover, these two values are too unbalanced to be considered a good result. They also report 26.5 h of automatic processing time for the 19,506 images, which equates 4.89 s per image. All of these aspects essentially confirm the results obtained by [25]. Table 1 summarizes the results of the examined related works, and Table 2 gives more details about the different algorithms experimented in [25]. As we will show in Section 7, our approach improves these results: we reach a better accuracy (average 94.4%), using less graphical features to automatically classify images (8 features), and with a much lower processing time (less than 1 s per image). \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Research** & **Number of Attributes** & **Number of Images** & **Processing Time/Img.** & **Accuracy** \\ \hline [PERSON] and & & & & \\ [PERSON] [22] & N/A & 200 & N/A & 89.0\% \\ (not a machine learning approach) & & & & \\ \hline [PERSON] and [PERSON] [24] & 23 & 1,300 & 10 s & 91.2\% \\ \hline [PERSON] & & & & \\ et al. [25] & 19 & 1,300 & 5.84 s & 90.7\%–93.2\% \\ \hline [PERSON] et al., 2016 [26] & & & & \\ (same classifier as [25]) & 19 & 19,506 & 4.89 s & N/A \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Comparison of the examined methods to classify images as Unified Modeling Language (UML) static diagrams: number of image attributes used in the classification, number of images used to train/validate the classifier, average time required to process each image, and accuracy (percentage of agreement with the manual classification).