scieee AI-readable full text Open interactive document viewer

Automated Diatom Classification (Part A): Handcrafted Feature Approaches

Bueno, Gloria,Déniz, Óscar,Pedraza, Aníbal,Ruiz-Santaquiteria, Jesús,Salido, Jesús,Cristóbal, Gabriel,Borrego-Ramos, María,Blanco, Saúl

Abstract

The authors acknowledge financial support of the Spanish Government under the Aqualitas-retos project (Ref. CTM2014-51907-C2-2-R-MINECO)

Full text

applied sciences Article Automated Diatom Classification (Part A): Handcrafted Feature Approaches Gloria Bueno 1,*, Oscar Deniz 1, Anibal Pedraza 1, Jesús Ruiz-Santaquiteria 1, Jesús Salido 1, Gabriel Cristóbal 2, María Borrego-Ramos 3and Saúl Blanco 3 1VISILAB-University of Castilla-La Mancha, Av. Camilo José Cela s/n, 13071 Ciudad Real, Spain; Oscar[email protected] (O.D.); [email protected] (A.P.); [email protected] (J.R.-S.); [email protected] (J.S.) 2Institute of Optics, Spanish National Research Council (CSIC), Serrano 121, 28006 Madrid, Spain; [email protected] 3The Institute of the Environment, University of Leon, E-24071 León, Spain; [email protected] (M.B.-R.); [email protected] (S.B.) *Correspondence: [email protected] Received: 31 May 2017; Accepted: 18 July 2017; Published: 25 July 2017 Abstract: This paper deals with automatic taxa identification based on machine learning methods. The aim is therefore to automatically classify diatoms, in terms of pattern recognition terminology. Diatoms are a kind of algae microorganism with high biodiversity at the species level, which are useful for water quality assessment. The most relevant features for diatom description and classification have been selected using an extensive dataset of 80 taxa with a minimum of 100 samples/taxon augmented to 300 samples/taxon. In addition to published morphological, statistical and textural descriptors, a new textural descriptor, Local Binary Patterns (LBP), to characterize the diatom’s valves, and a log Gabor implementation not tested before for this purpose are introduced in this paper. Results show an overall accuracy of 98.11% using bagging decision trees and combinations of descriptors. Finally, some phycological features of diatoms that are still difficult to integrate in computer systems are discussed for future work. Keywords: feature analysis; textural features; morphological features; automatic classification; handcrafted approaches; diatoms 1. Introduction Diatoms are a major group of algae and are among the most common microorganisms in marine and freshwater habitats. They are important contributors to the primary production in aquatic ecosystems, placed at the bottom of the food chain. The diatoms have been shown to be increasingly important worldwide in studies related to climate change, as well as in the development of functions that allow the modeling of such change. Moreover, they are good indicators of environmental conditions and are commonly used in water quality assessment [1,2]. Diatom indices are known to correlate more significantly with water chemical variables, within continental waters, while macroinvertebrate- or plant-based methods are more sensitive to changes affecting structural parameters [3]. Diatoms have several advantages over other indicators that make them ideal as indicators of water quality. These features are: (a) their ability to spread over a variety of habitats; (b) they are relatively easy to sample, and such sampling has no impact on the ecosystem during collection; (c) they have a quick response to variation in environmental conditions; and (d) they are sensitive to changes in environmental conditions that may not be observed in other communities. Appl. Sci. 2017,7, 753; doi:10.3390/app7080753 www.mdpi.com/journal/applsci Appl. Sci. 2017,7, 753 2 of 22 Diatom cells are enclosed within a unique silica cell wall known as a frustule made up of two valves, which fit into each other like a pill box. The frustules show a wide diversity of shapes and sizes, though mainly, they can be divided into centric diatoms (radial symmetry, rounded) and pennate diatoms (bilateral symmetry, elongated). The main taxonomic features used in diatom identification are related to the morphology and ornamentation of the frustule. The presence of raphe and the ornamentation of the frustule, stigmata and other features are important in identifying these organisms [4]. The diatom size, in the range of 2–2000 µ m, is suitable for observation of most species using an optical microscope. However, diatoms require specialized skills for their classification, that is trained diatomists (phycologists specializing in diatom taxonomy). As stated in [ 5 ], more than 200,000 diatom species are estimated to exist, although just half of them have been described. Several intercalibration tests have shown that the results of biological indices based on diatoms are highly sensitive to the level of accuracy in taxonomic classification [ 6 ]. The identification task is very difficult due to the huge number of species estimated to exist [7]. Classical taxonomic diagnosis is performed using key features or by visual comparison with type samples or reference iconographies [ 8 ]. The conventional approach is to analyze these microalgae using light microscopy (brightfield, DIC, RIC, etc.). Diatom-based metrics are calculated based on the relative abundance of different taxa in an assemblage and the autecological parameters characterizing each species. However, the current manual analysis of images is tedious, requiring highly qualified staff, and it is time consuming. This is the case when diatoms are used in the context of water quality, as in this study. According to a European directive, in order to compute an index score, the identification of a minimum of 400 valves per sample is required [9]. In the case of transparent specimens such as diatoms, brightfield microscopy presents some difficulties. Some details are barely distinguishable from the background, and some other alternative modalities such as phase contrast, DIC or dark field need to be considered. There are few species of the Nitzschia, which are good examples of that (see Nitzschia costei,Nitzschia frustulum var frustulum and Nitzschia inconspicua in Figure 2, Images 68, 72 and 73). This is probably due to a not well-developed silicification process. Phase contrast microscopy is a suitable technique for visualizing transparent specimens. However, it produces some artifacts (halos and shading-off) that limit its usefulness in some applications. Halos are unresolved images with reverse contrast, and shading-off is a contrast-decreasing effect from the edge of the specimen towards the center of it [ 10 ]. DIC microscopy is also a popular method for improving the contrast of unstained specimens. DIC is absent of the halo effect found in phase contrast microscopy producing pseudo-relief images that can be understood as the derivative of the optical path length defined as product of the index of refraction times the specimen thickness. In dark field microscopy, the specimen is illuminated with a hollow cone of light, which is too wide to enter the objective lens. Dark field is a suitable modality for diatom visualization that can be a substitute of phase contrast or DIC in many cases, although both are out of the scope of this work. Scanning electron microscopy is another suitable modality, especially in taxonomy for revealing structural details [ 11 ], which is also out of the scope of this paper. On the other hand, most of the diatom databases that are publicly available use brightfield microscopy. Other difficulties attached to microscopy are: images partially focused and multiple orientations (views). Both are related to the projection of 3D objects into 2D images. The main challenges faced by automatic identification and classification methods are due not only to the high number of species to recognize, but to the great similarities between them and even the presence of polymorphisms within species. In some cases, analysis is simply unfeasible due to the huge amount of information and images involved. Advances in digital microscopy and image analysis systems offer a potentially advantageous solution compared to manual methods of counting and classification. Before going further, it is worth pointing out the difference between classification and identification in terms of biology and pattern recognition terminology. In biology, it may be said that Appl. Sci. 2017,7, 753 3 of 22 the term identification answers the question: ‘What is the name of the taxon in front of me?’. However, classification answers questions of the sort: How is this taxon related to other taxa? According to the pattern recognition terminology, a class is a set of objects that within a given context is recognized as similar. Such a class has usually a unique name, the class name. The individual objects within a class have a label that refers to this name. Additionally, classification is the assignment of a class name to an object by evaluating a trained classifier for that object. Therefore, in this study, our objects or classes are the diatoms, and we will classify them to give them a label with their taxon name. Henceforth, a diatom taxa will be referred to as a class. A good review of morphometric methods for shape analysis and landmark-based analysis used in diatom research is presented in Pappas et al. [ 12 ]. Another attempt to describe the morphology and geometry of diatoms is the work of Kloster et al. [ 13 ], who developed a system that allows the segmentation and feature extraction from diatom contours, although it does not provide textural information about the frustule. As mentioned by Pappas et al. [ 12 ], two areas of study may be identified with regard to the methods used in diatom research, namely shape analysis and pattern recognition. We will focus on pattern recognition or machine learning methods, but notice that the traditional machine learning methods are based on a previous definition of a set of features describing the objects to be classified that may or may not have a biologically-meaningful interpretation. Methods for diatom detection and identification have been studied in Cairns et al., 1979 [ 14 ], Culverhouse et al., 1996 [ 15 ], Pech-Pacheco and Alvarez-Borrego, 1998 [ 16 ], Pech-Pacheco 2001 [ 17 ]. Cairns et al. [ 15 ] have proposed some diatom identification methods based on coherent optics and holography. However, such work did not have any impact on diatom research mainly due to the fact that the identification system was too specialized and probably too expensive to be used by a diatomist community [ 18 ]. Culverhouse et al. [ 15 ] derived some methods for phytoplankton identification based on neural networks, but again, they do not provide a fully-automatic method. Pech-Pacheco et al. [ 16 ] have proposed a hybrid optical-digital method for the identification of five different species of phytoplankton through the use of operators invariant to translation rotation and scale. Pappas and Stoermer 2003 [ 19 ], used form descriptors by Legendre polynomials and principal component analysis in the identification of the Cymbella cistula species. An important attempt to automate diatom classification was conducted for the ADIAC project (Automatic Diatom Identification And Classification) [ 18 , 20 ]. Several accuracy results were reported with a database composed of different numbers of diatom taxa ranging from 37–55 classes. In ADIAC, 171 features were used for diatom classification. These features are intended to describe the diatom symmetry, shape, geometry and texture by means of different descriptors, such as: rectangularity, circularity, compactness, shape of poles, length, width, length-width ratio, size, stria density orientation, horizontal frequency, Gray-Level Co-occurrence Matrix (GLCM), moment invariants, Gabor wavelets, Fourier and Scale-invariant Feature Transform (SIFT) descriptors. The classifiers that perform better are bagging of decision trees and random forest of predictive clustering trees, all of them evaluated with 10-fold cross-validation (10 fcv). The best results, up to 97.97% accuracy, were obtained with 38 classes using Fourier and SIFT descriptors with random forest. Performance decreased down to 96.17% when classifying 55 classes with the same descriptors and classifier [21]. New techniques based on Convolutional Neural Networks (CNN) have also been explored to classify sea plankton (Kuang 2015 [ 22 ], and Dai et al., 2016 [ 23 ]). Note, however, that these images are different than those studied in this paper since this type of plankton varies from phytoplankton (diatoms). In [ 22 ], a database of 30,000 images belonging to 121 classes was used. The results were poor with a maximum performance of 73.90%. In [ 23 ], a database of 30,000 images belonging to 33 classes was used. They obtained an accuracy up to 96.3%. The other work related to CNN applied to diatoms is the one published by the authors (see the next paper companion [ 24 ]). The work presented here and the methodology have been compared to the CNN approach [24]. Thus, most of the efforts are still carried out with handcrafted approaches or “hand-designed” methods where a set of fixed features is used. That is, the methods rely on expert knowledge to Appl. Sci. 2017,7, 753 4 of 22 extract the most relevant features versus CNN approaches that learn features from data. However, still, the handcrafted methods present limited results as in [ 25 ], where 14 classes were classified with Support Vector Machine (SVM) 10 fcv, using 44 GLCM features that describe only geometric and morphological properties. They obtained an accuracy of 94.7%. Therefore, the automated classification of diatoms (in terms of pattern recognition) or taxon identification remains a challenge. At present, there is no system capable of taking into account variations in both the contour and the texture in a relatively large number of species. One of the reasons is the difficulty in acquiring a big dataset of tagged data with a sufficient number of samples per species. The classification of diatoms is tedious and laborious, even for an expert diatomist. In this paper, we present a complete study of relevant features to describe and classify diatoms. The main purpose is to define the most discriminant features and to make a comparison of classifiers based on these features versus the CNN approach. For that, we collected an important database of 80 diatom taxa with 300 samples per taxon described in Section 2. The database was composed of an average of 100 distinct diatoms per class and augmented by means of computational simulations up to 300 samples per class. In order to extract the main diatom features, we propose in Section 3 a segmentation to apply descriptors to the contour and inner diatom regions. In Section 4, a complete list of descriptors is provided. Those are handcrafted features that describe, in terms of computer vision, the discriminant properties of diatoms. Sections 5and 6describe classification strategies and some classifiers. Experimental results are presented in Section 7where an overall accuracy of 98.11% is presented, which improves previous related works. Finally, Section 8concludes the paper addressing unresolved challenging problems. 2. Materials: Dataset Preparation Once having collected the diatom samples from the rivers, the chemical treatment of the sample is carried out in the laboratory with hydrogen peroxide (120 vol.), which causes the digestion of the organic matter and allows one to obtain suspensions of frustules and valves free of organic remains. The process is done at a temperature of 70–90 ◦ C, to accelerate the reaction. A few drops of the sample are taken and deposited in a round coverslip. After evaporation of the water, the diatom frustules remain in the cover-objects. Then, using a synthetic resin (Naphrax) with an optical refractive index of 1.7, diatoms are attached to the glass slide for later classification under brightfield microscopy following standard protocols [9]. The 80 diatom species studied here were collected during the years 2003 and 2015 from the Duero Basin water in Spain [ 26 ]. Those are the 80 dominant taxa in terms of relative abundance and occurrence. A Westbury SP/40 Brunel microscope and a Brunel AMA 050 camera were employed to capture the images at 60 × magnification, with a numeric aperture of 0.85 and a physical resolution of 7.91 pixels/ µ m. An average of 100 distinct diatom valves per each diatom class were then manually cropped and labeled by an expert diatomist. The exact number of the cropped diatom valves is shown in Table 1. To complete the dataset with up to 300 image samples per taxon, a data augmentation was performed by means of applying rotations of 90 ◦ , 180 ◦ , 270 ◦ and up-down and right-left flips to the cropped images. These 6 transformations were performed on the original images and only if needed, to obtain up to 300 image samples per class. Thus, we end up with 24,000 images to classify into 80 diatom taxa. Data augmentation aims at increasing the number of images in the dataset by representing image data in different orientations. That is, different copies of the same image are made, but from different perspectives or visual angles. Rotating and mirroring the data in different orientations may eventually help with identifying a similar object in different orientations. A more robust classifier will be obtained if the data are randomly rotated in multiple orientations. In Figure 1, a capture with a manually-selected diatom is shown. The elements that form the ornamentation of the frustule in a diatom are illustrated in the cropped diatom. Features of the stria are key in diatom taxonomy, such as: areola and lineolae. Areola is a perforation (or pore) in the diatom Appl. Sci. 2017,7, 753 5 of 22 valve, and lineolae are areola elongated in the apical direction. The lineolae density is calculated in ppm (pixels per micron). Every sample was manually cropped to ensure the best diatom samples avoiding as much as possible nearby samples or debris. The list of the 80 species with the number of original selected images is indicated in Table 1, and some examples are depicted in Figure 2. The number of the taxon corresponding to the one listed in Table 1is shown in the upper left corner of each picture. The database can be obtained by request (see the contact at http://aqualitas-retos.es/en/), and it will be publicly available at the end of the project. Figure 3shows the same diatom species at different views (“valvar view” and “girdle view”) and sizes. Due to the deposition process of the sample, in most situations, the diatoms appear in valvar view, although sometimes appear in lateral view (less than 10% of cases). Figure 1. Diatoms observed by a microscope at 60 × magnification and their main elements. The original image size is 903 ×614 pixels, and the selected diatom sample is 138 ×85 pixels. Table 1. List of the 80 diatom species analyzed in the current study, showing the number of valves per class. 1. Achnanthes subhudsonis 123 28. Encyonema minutum 120 55. Gomphonema rhombicum 64 2. Achnanthidium atomoides 129 29. Encyonema reichardtii 152 56. Humidophila contenta 105 3. Achnanthidium caravelense 59 30. Encyonema silesiacum 108 57. Karayevia clevei varclevei 84 4. Achnanthidium catenatum 187 31. Encyonema ventricosum 101 58. Luticola goeppertiana 136 5. Achnanthidium druartii 93 32. Encyonopsis alpina 106 59. Mayamaea permitis 40 6. Achnanthidium eutrophilum 97 33. Encyonopsis minuta 89 60. Melosira varians 146 7. Achnanthidium exile 98 34. Eolimna minima 174 61. Navicula cryptotenella 136 8. Achnanthidium jackii 125 35. Eolimna rhombelliptica 132 62. Navicula cryptotenelloides 107 9. Achnanthidium rivulare 305 36. Eolimna subminuscula 94 63. Navicula gregaria 50 10. Amphora pediculus 117 37. Epithemia adnata 72 64. Navicula lanceolata 77 11. Aulacoseira subarctica 113 38. Epithemia sorex 85 65. Navicula tripunctata 99 12. Cocconeis lineata 81 39. Epithemia turgida 93 66. Nitzschia amphibia 124 13. Cocconeis pediculus 49 40. Fragilaria arcus 93 67. Nitzschia capitellata 123 14. Cocconeis placentula var euglypta 117 41. Fragilaria gracilis 54 68. Nitzschia costei 72 15. Craticula accomoda 86 42. Fragilaria pararumpens 74 69. Nitzschia desertorum 71 16. Cyclostephanos dubius 85 43. Fragilaria perminuta 89 70. Nitzschia dissipata var media 81 17. Cyclotella atomus 99 44. Fragilaria rumpens 49 71. Nitzschia fossilis 76 18. Cyclotella meneghiniana 103 45. Fragilaria vaucheriae 82 72. Nitzschia frustulum var frustulum 226 19. Cymbella excisa var angusta 79 46. Gomphonema angustatum 86 73. Nitzschia inconspicua 255 20. Cymbella excisa var excisa 241 47. Gomphonema angustivalva 55 74. Nitzschia tropica 65 21. Cymbella excisiformis var excisiformis 142 48. Gomphonema insigniforme 90 75. Nitzschia umbonata 91 22. Cymbella parva 177 49. Gomphonema micropumilum 89 76. Rhoicosphenia abbreviata 94 23. Denticula tenuis 181 50. Gomphonema micropus 117 77. Skeletonema potamos 155 24. Diatoma mesodon 115 51. Gomphonema minusculum 158 78. Staurosira binodis 94 25. Diatoma moniliformis 134 52. Gomphonema minutum 93 79. Staurosira venter 87 26. Diatoma vulgaris 88 53. Gomphonema parvulum saprophilum 52 80. Thalassiosira pseudonana 70 27. Discostella pseudostelligera 82 54. Gomphonema pumilum var elegans 128 Appl. Sci. 2017,7, 753 6 of 22 Figure 2. Examples of the 80 diatom taxa classified in this study. Sample images are stretched for visualization purposes. Appl. Sci. 2017,7, 753 7 of 22 (a) (b) (c) Figure 3. Different views and sizes of the same species: ( a )Gomphonema insigniforme; ( b )Nitzschia fossilis; and (c)Rhoicosphenia abbreviata. 3. Valve Segmentation: Binary Thresholding There are several works about diatom detection mainly related to the above-mentioned ADIAC project. It is out of the scope of this paper to present all of the segmentation methods; for further details, the reader is referred to the reviews mentioned in Section 1[ 12 , 13 , 18 ]. In this work, we present an automatic method used to do an initial quick segmentation, which required visual supervision afterward to include only the correct segmented diatoms. Some of the images have been acquired with low contrast and background noise, which produces a poor segmentation in terms of valve overlapping with other structures. That means visual supervision is needed for discarding segmentation errors. The valve is the most significant region of the diatoms where structural differences can be distinguished. Therefore, the segmentation process should accurately extract such a region for extracting relevant features. A proper segmentation of the valve is expected to affect textural, frequential and statistical descriptors. This segmentation is done here by means of a binary thresholding where the segmented region is the binary masks where descriptors must be computed. The process to obtain the binary masks consists of four steps: 1. Binary thresholding: automatic segmentation based on Otsu’s thresholding. 2. Maximum area: calculation of the largest region (area). 3. Hole filling: interior holes are filled if present, using mathematical morphology operators. 4. Segmentation: the ROI is cropped with the coordinates of the bounding-box of the largest area (Step 2). Due to the presence of debris and overlapping with different diatom taxa (or debris), the segmentation was afterward manually checked to discard bad segmented diatoms or finish correction; see some examples of the segmented diatoms and their masks in Figure 4. Appl. Sci. 2017,7, 753 8 of 22 (a) (b) Figure 4. Segmented diatoms and their binary mask: (a)Epithemia sorex; (b)Gomphonema minutum. 4. Diatom Handcrafted Feature Descriptors An effort must be made in translating the knowledge of the diatomists to distinguish the different diatom species and describe the most relevant features in terms of computer vision and pattern classification. The goal is to mimic human perception and the ability to recognize a 3D object from a 2D image, in this case diatoms. Even if it is sometimes unclear what features are used by the expert to distinguish among very similar diatom species, we proposed and described diatom features in terms of automatic pattern classification. Along the next subsections, the handcrafted features are presented in groups according to their formulation with a brief explanation. The different groups of descriptors are indicated in Table 2. A total of 1460 descriptors is computed, and all of them are calculated uniquely in those pixels belonging to the segmented binary masks. Table 2. List of handcrafted feature descriptors divided into categories. LBP, Local Binary Pattern. CATEGORY HANDCRAFTED FEATURE TOTAL Morphological Area, eccentricity (3 eccentricities) 7 features Perimeter, shape, fullness Statistical 1st order (histogram) 13 features 2nd order (co-occurrence matrix) 19 features distance =1, 3, 5 pixels direction =0◦, 45◦, 90◦, 135◦ Texture space LBP Stat.241 features Moments Hu 7 moments Space-frequency Log Gabor 4 scales (6 orientations) 241 ×4 = 964 features 4.1. Morphological Descriptors Morphological features related to frustule’s contour and area are computed from the binary masks. 4.1.1. Area This descriptor is calculated as the sum of pixels in the binary mask (B∈(0, 1)) of size MxN: Area = N ∑ n=1 M ∑ m=1 B(m,n)(1) 4.1.2. Eccentricity These descriptors reflect elongation in relation with the binary mask’s center of mass, also called the centroid and defined as: (mc,nc) =   1 Area ∑ (m,n)∈Area m·B(m,n),1 Area ∑ (m,n)∈Area n·B(m,n) (2) Appl. Sci. 2017,7, 753 9 of 22 The first Eccentricity 1 is defined as a quotient of the maximum and minimum distance between the centroid and binary mask’s border (i.e., frustule’s contour), also called outer and inner circumference radius. Eccentricity1=Outer −radius Inner −radius (3) Similarly, Eccentricity 2 is calculated as the quotient of the semi-axes of the best fitting ellipse for the mask, and Eccentricity 3 is the ratio of the inertia moments of the two semi-axes of the best fitting ellipse. The moments are defined in Section 4.4. 4.1.3. Perimeter This descriptor is the number of pixels that belong to the diatom’s outline (i.e., a pixel belongs to the perimeter if it is nonzero and is connected with at least one pixel equal to zero). Perimeter = N ∑ n=1 M ∑ m=1 P(n,m)(4) where: P(m,n) = 1i f ∃B(m±1, n±1) = 1 and P(m,n) = 0 otherwise. 4.1.4. Shape This descriptor is a measure of the elongation of an object. It is given by: Shape =4·π·Area Perimeter2(5) 4.1.5. Fullness This descriptor is the ratio of the mask area to the bounding box area. 4.2. Statistical Descriptors 4.2.1. First Order Statistical: Histogram These descriptors, listed in Table 3, calculate common statistics in the image histogram h(i) calculated on a 255-bin H . This group of descriptors is sensible to variations of gray pixel levels, but they ignore their local correlation. Table 3. First-order statistical descriptors. Mean µ=∑H−1 i=0i·h(i) Mode i =argmax(h(i)) Minimum min(h(i)) Maximum max(h(i)) Variance σ=∑H−1 n=0(i−µ)2·h(i) Range max(h(i)) −min(h(i)) Entropy ∑H−1 i=0h(i)·log(h(i)) 1st Quartile µq1=∑H i=3dH/4ei·h(i) 2nd Quartile µq2=∑3dH/4e i=2dH/4ei·h(i) 3rd Quartile µq3=∑2dH/4e i=dH/4ei·h(i) Interquartile Range µq3−µq1 Asymmetry 1 σ3∑H−1 n=0(i−µ)3·h(i) Kurtosis 1 σ4∑H−1 n=0(i−µ)4·h(i) Histogram h(i), bins number H, floor operator d e. Appl. Sci. 2017,7, 753 16 of 22 94 94.5 95 95.5 96 96.5 97 97.5 98 98.5 99 All Log Gabor + Stat. LBP + Stat. LBP + Log Gabor Morphological + Stat. Classification (Acc.) [94%-99%] Bagging DT Figure 8. Accuracy performance combining descriptor types and using 300 samples per class. 7.3. Experiment 3: Dataset Dimension Some questions arise at this point about the database dimensionality. How does this affect the performance? Is the classifier able to learn more with a higher number of samples? Is the classifier able to get the same performance with a lower number of data, that is without the use of augmented data? Thus, we tested with several subsets of 20 diatom types and 40 diatom types with 300 samples per diatom; a subset with the 35 classes that had a minimum of 100 samples per diatom; as well as with 80 diatom types with 2000 samples per diatom versus the previous dataset with 300 samples per diatom. To extend the dataset, a data augmentation with rotations every 2◦was performed. Figure 9shows the results when classifying with the bagging DT and 10 fcv. It represents the minimum and maximum Acc. value obtained in the different trials. The decrease in the number of classes with 300 samples per class increased its accuracy, though not significantly. Additionally, the increase in the number of samples lowered the error. The use of 100 samples per class classifying 35 classes with no data augmentation decreased accuracy to 96.25% versus 98.11% with 300 samples per class. A similar decrease happens when classifying 20 classes, where an accuracy of 97.56% (100 samples/class without data augmentation) is obtained versus 98.82% (300 samples/class with data augmentation). Results are usually illustrated with confusion matrices. Each column of a confusion matrix represents the instances in a predicted class while each row represents the instances in an actual class. Since there are many classes in this study, heat maps have been used to display the % of correct and incorrect classifications. A heat map displays the confusion matrix as an image whose color intensities reflect the magnitude of its values. In this case, green values indicate the % of correct classifications and pink-red values indicate the % of instances incorrectly classified. These percentages, as well as the true positive rate (green column) and false negative rate (pink-red column) for each class are shown when no more than 20 classes are classified, as well as the true positive rate (green column) and false negative rate (pink-red column). The confusion matrix heat map for the classification of the 80 diatom classes with the bagging tree is shown in Figure 10. Figure 11 shows the confusion matrix heat map for the classification of the diatom classes without data augmentation. Figure 11 shows 20 classes chosen randomly for visualization purpose. The confusion matrix heat map of several trials done with the 20 classes is shown in Figure 12. The main diagonal of Figure 12 shows how some classes obtained 100% correct classification. Figure 13 shows those diatoms species that produce the major misclassification errors, i.e., Nitzschia costei,Gomphonema angustatum,Gomphonema micropumilum,Gomphonema minusculum and Gomphonema minutum. Automation methods may be a tool to help both the expert and the non-expert, but in difficult cases, it should always be the expert who makes the final decision. We believe that it is the diatomist who must consider if an automatic classification system is acceptable, assuming a certain Appl. Sci. 2017,7, 753 17 of 22 level of accuracy to classify different taxa. A reject option is also possible, so that only difficult cases are presented to the diatomist, while the easy ones are classified automatically. Notice that this methodology may be applied to other taxa not included in this study. Moreover, it is currently being applied to another 20 different taxa not shown in this study, and similar results are being obtained. 94.5 95 95.5 96 96.5 97 97.5 98 98.5 99 20 Classes (100 samples) 20 Classes (300 samples) 20 Classes (2000 samples) 35 Classes (100 samples) 35 Classes (300 samples) 80 Classes (300 samples) 80 Classes (2000 samples) Classification (Acc.) [94.5%-99%] Max. Min. Figure 9. Accuracy performance with different numbers of classes using the bagging DT classifier. No data augmentation is applied when using 100 samples per class. Figure 10. Confusion matrix classifying 80 classes with the bagging tree classifier 10-fold cross-validation (10 fcv). Appl. Sci. 2017,7, 753 18 of 22 Figure 11. Confusion matrix classifying 20 classes out of the 35 classes with 100 samples per class with no data augmentation and using the bagging tree classifier 10 fcv. Figure 12. Cont. Appl. Sci. 2017,7, 753 19 of 22 Figure 12. Confusion matrix map classifying 20 classes with the bagging tree classifier 10 fcv. (a) (b) (c) (d) (e) Figure 13. Diatoms species that produce the major misclassification errors: ( a )Gomphonema angustatum; ( b )Gomphonema micropumilum; ( c )Gomphonema minusculum; ( d )Gomphonema minutum; and ( e )Nitzschia costei. Appl. Sci. 2017,7, 753 20 of 22 8. Conclusions The main contributions of this work are: (a) big database collection: a big database of diatoms composed of 80 diatom types with an average of 100 distinct diatom valves per type manually cropped has been collected; this database is being extended to 100 types; and (b) the study of the main handcrafted features to classify diatoms, proposing an efficient method for classification. Thus, the state of the art in morphological, statistical and texture descriptors has been exhaustively tested for classifying 80 diatom types. Some of them, like texture based on LBP and log Gabor descriptors, had not been evaluated before in this field. The combination of these features provided an improvement up to 98.11% accuracy compared to previous related works. We concluded that the combination of different descriptors categories, such as morphological and statistical descriptors, together with space-frequency representations, specifically log Gabor and texture by means of LBP, provided the best classification accuracy rates. Along this research, we also come across several other challenging issues, such as the classification of the same diatom type during its life cycle and from different views. A diatom type may present different appearances according to its view with respect to the z-view, and consequently, its morphological and also statistical descriptors can drastically vary. This causes the morphological descriptors to not always analyze the most discriminating features. This could be solved by having more data representing all possible cases or alternatively by using a hierarchical tree classification. Thus, it could be recommended to simplify the classification using morphological refinement in two classes: centric diatoms and pennate diatoms. Afterwards, depending on the taxon, the search would focus on some other details, like texture, striae density (number of stria per micron), lineolae density (pixels per micron), etc. It should be noted that some diatom taxa are almost the same, even for experts, which proves the difficulty of this task. Precise segmentation is a critical point for the whole classification process. This is a limitation for handcrafted feature approaches. Effectively, segmentation should be done accurately, although our purpose in the current study focuses on comparing descriptor’s discriminant capacity. Therefore, we do not pursue perfect binary masks, but suitable enough to be equally shared by all descriptors. In order to handle the above-mentioned difficulties, the authors suggest to explore new classification techniques based on deep learning (Convolutional Neural Networks (CNN)) able to learn further from larger datasets and without segmentation. In this study, it has been proven that the accuracy in traditional methods does not always improve with augmented data (it is also counterproductive due to orientation-invariant features and possible overfitting). An accuracy up to 97.56% was obtained classifying 20 classes with no data augmentation (100 samples/class) versus 98.82% with data augmentation (300 samples/class). Acknowledgments: The authors acknowledge financial support of the Spanish Government under the Aqualitas-retos project (Ref. CTM2014-51907-C2-2-R-MINECO), http://aqualitas-retos.es/en/. Author Contributions: Gloria Bueno designed and performed the experiments. She wrote the paper, and she is the corresponding author. Oscar Deniz designed and conceived of the experiments. He also revised the manuscript and supervised the research. Anibal Pedraza prepared the original and augmented the database. Jesús Ruiz-Santaquitaria performed part of the data acquisition and some graphics of the figures. Jesús Salido prepared the database to be available for dissemination. Gabriel Cristóbal supervised the research. María Borrego-Ramos performed part of the data acquisition. Saúl Blanco performed part of the data acquisition, and he made the annotations of the entire original database. Conflicts of Interest: There is no conflict of interest. References 1. Ector, L.; Rimet, F. Using bioindicators to assess rivers in Europe: An overview. In Modelling Community Structure Infreshwater Ecosystems; Lek, S., Scardi, M., Verdonschot, P.F.M., Descy, J.-P., Park, Y.-S., Eds.; Springer: Berlin, Germany, 2005; Chapter 1, pp. 7–19. 2. Wua, N.; Dong, X.; Liu, Y.; Wang, C.; Baattrup-Pedersen, A.; Riis, T. Using river microalgae as indicators for freshwater biomonitoring: Review of published research and future directions. Ecol. Indic. 2017 ,81, 124–131. Appl. Sci. 2017,7, 753 21 of 22 3. Blanco, S.; Becares, E.; Cauchie, H.; Hoffmann, L.; Ector, L. Comparison of biotic indices for water quality diagnosis in the Duero Basin (Spain). Arch. Hydrobiol. Suppl. Large Rivers 2007,17, 267–286. 4. Round, F.E.; Crawford, R.M.; Mann, D.G. Diatoms: Biology and Morphology of the Genera; Cambridge University Press: Cambridge, UK, 1990. 5. Mann, D. The species concept in diatoms. Phycologia 1999,38, 437–495. 6. John, D. Use of Algae for Monitoring Rivers III. J. Appl. Phycol. 1999,11, 596–597. 7. Hicks, Y.A.; Marshall, D.; Rosin, P.; Martin, R.R.; Mann, D.; Droop, S. A model of diatom shape and texture for analysis, synthesis and identification. Mach. Vis. Appl. 2006,17, 297–307. 8. Smol, J.; Stoermer, E. The Diatoms: Applications for the Environmental and Earth Sciences; Cambridge University Press: Cambridge, UK, 2010. 9. European Standard, EN 14407: 2004. Water Quality—Guidance Standard for the Identification, Enumeration and Interpretation of Benthic Diatom Samples from Running Waters; Technical Report; European Commission: Brussels, Belgium, 2004. 10. Wayne, R. Light and Video Microscopy, 2nd ed.; Elsevier: Amsterdam, The Netherlands, 2014. 11. Desikachary, T. Electron microscope studies on diatoms. J. Microsc. 1956,76, 9–36. 12. Pappas, J.; Kociolek, P.; Stoermer, E. Quantitative morphometric methods in diatom research. Nova Hedwig. Beih. 2014,143, 281–306. 13. Kloster, M.; Kauer, G.; Beszteri, B. SHERPA: An image segmentation and outline feature extraction tool for diatoms and other objects. BMC Bioinform. 2014,15, 1. 14. Cairns, J.; Dickson, K.; Pryfogle, P.; Almeida, S.; Case, S.; Fournier, J.; Fuji, H. Determining the accuracy of coherent optical identification of diatoms. J. Am. Water Resour. Assoc. 1979,15, 1770–1775. 15. Culverhouse, P.; Simpson, R.G.; Ellis, R.; Lindley, J.; Williams, R.; Parisini, T.; Reguera, B.; Bravo, I.; Zoppoli, R.; Earnshaw, G.; et al. Automatic classification of field-collected dinoflagellates by artificial neural network. Mar. Ecol. Prog. Ser. 1996,139, 281–287. 16. Pech-Pacheco, J.; Alvarez-Borrego, J. Optical-digital system applied to the identification of five phytoplankton species. Mar. Biol. 1998,132, 357–365. 17. Pech-Pacheco, J.; Cristobal, G.; Alvarez-Borrego, J.; Cohen, L. Automatic system for phytoplanktonic algae identification. Limnetica 2001,20, 143–158. 18. Du Buf, H.; Bayer, M. Series in Machine Perception and Artificial Intelligence. In Automatic Diatom Identification; World Scientific Publishing Co.: Singapore, 2002. 19. Pappas, J.; Stoermer, E. Legendre shape descriptors and shape group determination of specimens in the Cymbella cistula species complex. Phycologia 2003,42, 90–97. 20. Du Buf, H.; Bayer, M.; Droop, S.; Head, R.; Juggins, S.; Fischer, S.; Bunke, H.; Wilkinson, M.; Roerdink, J.; Pech-Pacheco, J.; et al. Diatom identification: A double challenge called ADIAC. In Proceedings of the International Conference on Image Analysis and Processing, Venice, Italy, 27–29 September 1999; pp. 734–739. 21. Dimitrovski, I.; Kocev, D.; Loskovska, S.; Dzeroski, S. Hierarchical classification of diatom images using ensembles of predictive clustering trees. Ecol. Inform. 2012,7, 19–29. 22. Kuang, Y. Deep Neural Network for Deep Sea Plankton Classification; Technical Report; Stanford University: Stanford, CA, USA, 2015. 23. Dai, J.; Yu, Z.; Zheng, H.; Zheng, B.; Wang, N. A Hybrid Convolutional Neural Network for Plankton Classification. In Lecture Notes in Computer Science—Computer Vision, ACCV 2016 Workshops; Chen, C.-S., Lu, J., Ma, K.-K., Eds.; Springer International Publisher: Amsterdam, The Netherlands, 2017; Volume 10118, pp. 102–114. 24. Pedraza, A.; Deniz, O.; Bueno, G.; Cristobal, G.; Borrego-Ramos, M.; Blanco, S. Automated Diatom Classification (Part B): A deep learning approach. Appl. Sci. 2017,7, 1–25. 25. Lai, Q.T.; Lee, K.C.; Tang, A.H.; Wong, K.K.; So, H.K.; Tsia, K.K. High-throughput time-stretch imaging flow cytometry for multi-class classification of phytoplankton. Opt. Express 2016,24, 28170–28184. 26. Blanco, S.; Bécares, E.; Hernández, N.; Ector, L. Evaluación de la calidad del agua en los ríos de la cuenca del Duero mediante índices diatomológicos. Publ. Téc. CEDEX Ing. Civ. 2008,148, 139–143. 27. Haralick, R.; Shanmugam, K.; Dinstein, I. Textural features for image classification. IEEE Trans. Syst. Man Cybern. 1973,SMC-3, 610–621. 28. Wang, L.; He, D. Texture classification using texture spectrum. Pattern Recognit. 1990,23, 905–910. Appl. Sci. 2017,7, 753 22 of 22 29. Ojala, T.; Pietikainen, M.; Harwood, D. Performance evaluation of texture measures with classification based on Kullback discrimination of distributions. In Proceedings of the 12th International Conference on Pattern Recognition-Conference A: Computer Vision Image Processing (IAPR), Jerusalem, Israel, 9–13 October 1994; Volume 1, pp. 582–585. 30. Nava, R.; Cristobal, G.; Escalante-Ramirez, B. A comprehensive study of texture analysis based on local binary patterns. Proc. SPIE 2012,8436, 84360E–84372E. 31. Sahu, H.; Bhanodia, P.An Analysis of Texture Classification: Local Binary Patterns. J. Glob. Res. Comput. Sci. 2013,4, 17–20. 32. Ojala, T.; Pietikäinen, M.; Maenpaa, T. Multiresolution gray-scale and rotation invariant texture classification with local binary patterns. IEEE Trans. Pattern Anal. Mach. Intell. 2002,24, 971–987. 33. Nava, R.; Escalante-Ramírez, B.; Cristóbal, G. Texture Image Retrieval Based on Log-Gabor Features. In Progress in Pattern Recognition, Image Analysis, Computer Vision, and Applications; Alvarez, L., Mejail, M., Gomez, L., Jacobo, J., Eds.; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 2012; Volume 7441, pp. 414–421. 34. Hu, M.K. Visual Pattern Recognition by Moment Invariants. IRE Trans. Inf. Theory 1962,IT-8, 179–187. 35. Fischer, S.; Sroubek, F.; Perrinet, L.; Redondo, R.; Cristóbal, G. Self Invertible Gabor Wavelets. Int. J. Comput. Vis. 2007,75, 231–246. 36. Guyon, I.; Elisseeff, A. An introduction to variable and feature selection. J. Mach. Learn. Res. 2003 , 3, 1157–1182. 37. Duda, R.O.; Hart, P.E.; Stork, D.G. Pattern Classification, 2nd ed.; Wiley: New York, NY, USA, 2001. 38. Mitra, P.; Murthy, C.; Pal, S.K. Unsupervised feature selection using feature similarity. IEEE Trans. Pattern Anal. Mach. Intell. 2002,24, 301–312. 39. Pudil, P.; Novovicova, J.; Kittler, J. Floating search methods in feature selection. Pattern Recognit. Lett. 1994 , 15, 1119–1125. 40. Alpaydin, E. Introduction to Machine Learning, 2nd ed.; The MIT Press: Cambridge, MA, USA, 2010. 41. Breiman, L. Bagging predictors. Mach. Learn. 1996,24, 123–140. c 2017 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).