# Automated Diatom Classification (Part B): A Deep Learning Approach
## 4 Results and Discussion
### Original Dataset  
The confusion matrices for training with 300, 700 and 1000 samples per class are presented in Figures 5-7 respectively. Figure 5: Confusion matrix heat map for the original dataset with 300 samples per class. Table 4 shows a summary of experiments with the original database, giving precise information about the dataset, the number of samples per class, the mean accuracy of the 10 folds from cross-validation and standard deviation. The accuracy for testing has been calculated as the percentage of labels that match between the ground truth and the classifier. Notice that when the number of samples per species is increased, the accuracy is improved and only some of the confusions remain. In Figure 8, a summary of the most frequent confusions is shown, where, the first row shows a confusion between _Achmanthidium caravelense_ (3) and _Achmanthidium exile_ (7). Further than belonging to the same family, the confusion is most likely to be produced because of the presence of \"valve view\" (the view of the frustule when the valve is uppermost) and \"girdle view\" (the view of the frustule when the girdle is uppermost) samples in the dataset, the latter being much more difficult to be distinguished  
Figure 6: Confusion matrix heat map for the original dataset with 700 samples per class. Figure 7: Confusion matrix heat map for the original dataset with 1000 samples per class. from each other. A similar appearance of the images would be the most common source of confusions throughout the different experiments. The diatom species that show initially a larger error are: _Encyonopsis alpina_ (32), _Encyonopsis minuta_ (33), _Eolimuna minima_ (34) and _Eolimuna rhombellipticica_ (35). Figure 8: Original dataset main confusions. Each row shows an example of the true species, a missclassified sample between two species and a sample of the second one are shown. In Figure 12, a summary of the most frequent confusions is shown. In this dataset, again, the majority of bad classifications are due to species that are quite similar to each other. However, in comparison with the previous dataset, there are more pairs of species that maintain a (relatively) significant error rate. These are:  
- _Cymbella excisa var angusta_ (19) and _Cymbella excisa var excisa_ (20);  
- _Encyonopsis alipina_ (32) and _Encyonopsis minuta_ (33)--same than the original database;  
- _Eolimna minima_ (34) and _Eolimna rhombelliptica_ (35) --same than the original database;  
- _Epithemia aduata_ (37) and _Epithemia turgida_ (39);  
- _Nitzschia amphibia_ (66) and _Nitzschia fossils_ (71). Once again as the number of training samples per species is increased, the accuracy improves, and most of the confusions disappear. Table 5 shows a summary of the experiments with the segmented database. Notice that this database is the same that the one used in the previous article [4]. The handcrafted approach based on bagging tree performs better for lower number of samples, that is for 300 samples per class the overall accuracy was 98.11% versus the current 95.62% with CNN. The result, as compared with classical handcrafted approaches only improves when the database is larger than 700 samples per class. Figure 12: Segmented dataset main confusions. Each row shows an example of the true species, a missclassified sample between two species and a sample of the second one are shown. In this dataset, apart from some pairs of species that are usually confused, there are some of them which are confused with more than 2, 3 or 4 species equally. Moreover, the number of misclassified classes is higher than the previous experiments when the number of samples per species is reduced. However this is quickly reduced when the number of samples per class is increased to 1000, reaching then similar accuracy values. Table 6 shows these results with the normalized database.