## 6 Discussion
### Threats to Validity
#### 6.1.3 Threats to External Validity  
External validity limits the ability to generalize the results beyond the experiment setting. There is not much variety in the non-UML class diagrams, many of the images are very similar to other images. Hence, the generalization could not be made properly. The images which are fed to the algorithm for the training and testing have a huge difference among the UML class diagrams and non-UML class diagrams. If you want good accuracy on a test set and to get the difference between train set accuracy and test set accuracy  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline  & **Image Size** & **Layers** & **Optimizer** & **Kernel** & **Regularization** & **Accuracy** \\ \hline Experiment 5 & 128 \(\times\) 128 & 11 & [PERSON] & 3 \(\times\) 3 & L2(1 \(\times\) 10\({}^{-4}\)) & \begin{tabular}{c} Train: 93.11 \\ Test: 84.80 \\ \end{tabular} \\ \hline Experiment 6 & 150 \(\times\) 150 & 15 & [PERSON] & 2 \(\times\) 2 & L2(1 \(\times\) 10\({}^{-6}\)) & \begin{tabular}{c} Train: 93.28 \\ Test: 85.41 \\ \end{tabular} \\ \hline Experiment 7 & 128 \(\times\) 128 & 13 & [PERSON] & 2 \(\times\) 2 & L2(1 \(\times\) 10\({}^{-7}\)) & \
\begin{tabular}{c} Train: 93.25 \\ Test: 86.32 \\ \end{tabular} \\ \hline Experiment 8 & 128 \(\times\) 128 & 11 & [PERSON] & 2 \(\times\) 2 & L2(1 \(\times\) 10\({}^{-6}\)) &
\begin{tabular}{c} Train: 96.06 \\ Test: 86.63 \\ \end{tabular} \\ \hline \hline \end{tabular}
\end{table}
Table 2: Effect of various parameters of CNN with regularization.  
as low as possible there should be very little difference between the positive UML class diagrams and negative UML class diagrams. This will help the model to generalize rather than memorize.  
[PERSON] et al. [16] have used a dataset of 200 images and got an accuracy of 89%, [PERSON] et al. [3] got an accuracy of 91.2% on the dataset of 1300 images and they used the SVM algorithm. [PERSON] et al. [3] got up to 93.2% accuracy on 1300 images in their dataset, [PERSON] et al. [10] developed a model called image-to-model (i2m) using a dataset of 18,899 images and got an accuracy of 94.4%. [PERSON] et al. [30] have used the technique of low-short learning which is very useful when the dataset is very small and combined with the Convolutional Neural Network technique on the dataset compressing of 11,319 images to classify UML class diagrams from sequence diagram, and they claimed accuracy of more than 92%. In our work, we used the dataset of 3282 images and got an accuracy of 94.51 on the train set and 85.41 on the test set with the first model, which was CNN without regularization, an accuracy of 96.06% on the train set and 86.63 on the test set for second model, which was CNN with regularization.  
Table 3, given below, shows the previous studies and results and the approach they have followed, and also shows the comparison of their accuracies with the accuracy of our research. The reason for differences in accuracies are mainly because of size of the dataset, images used in the datasets, and algorithm(s) used by different approaches.  
The results that we obtained can still be improved but due to the size of the dataset we just have to contend with the results. The findings that we obtained will certainly encourage the other researchers who want to work in this area and who want to use Deep Learning techniques.