SMACC: A System for Microplastics Automatic Counting and Classification

The management of plastic debris is a serious issue due to its durability. Unfortunately, million tons of plastic end up in the sea becoming one of the biggest current environmental problems. One way to monitor the amount of plastic in beaches is to collect samples and visually count and sort the plastic particles present in them. This is a very time-consuming task. In this work, we present a Computer Vision-based system which is able to automatically count and classify microplastic particles (1-5 mm) into five different visual classes. After cleaning a collected sample in the lab, the proposed system makes use of a pair of its images with different characteristics. The procedure includes a segmentation step, which is based on the Sauvola thresholding method, followed by a feature extraction and classification step. Different features and classifiers are evaluated as well as a deep learning approach. The system is tested on 12 different beach samples with a total of 2507 microplastic particles. The particles of each sample were manually counted and sorted by an expert. This data represents the ground truth, which is compared later with the results of the automatic processing proposals to evaluate their accuracy. The difference in the number of particles is 34 (1.4%) and the error in their classification is less than 4% for all types except for the line shapes particles. These results are obtained in less than half of the time needed by the human expert doing the same task manually. This implies that it is possible to process more than twice as many samples using the same time, allowing the biologists to monitor wider areas and more frequently than doing the process manually.


I. INTRODUCTION
Nowadays, the problem of plastic pollution is of great global concern. Specifically, microplastics -plastics smaller than 5 mm in size -pose a risk to marine organisms because they can be ingested and transferred through the marine food chains [1], [2]. This fact has been confirmed by a research conducted by the Polytechnic University of Marche and the Institute of Marine Sciences of the CNR of Genoa that discovered the presence of plastic particles in 25-30% of the Tyrrhenian Sea's catch (Liguria, Tuscany, Lazio and Campania).
These microplastics have associated chemical contaminants and the effects they may have on organisms are not yet The associate editor coordinating the review of this manuscript and approving it for publication was Victor Sanchez . clearly known [1], [3]- [5], receiving growing interest from the scientific community due to the exceptionality of the issue. This problem has also been the object of attention of international institutions such as the European Union that is establishing criteria, methodological standards, and specifications for assessing and monitoring the environmental status of its marine waters. This also includes the effect of marine litter, and particularly of microplastics [6], [7]. In particular, there is a need to establish protocols and common sampling methodologies to facilitate the monitoring of microplastics in marine and freshwater ecosystems as well as in biota [8].
Regarding the monitoring of microplastics, one of the main problems is that there are few long-term studies on its temporal variability to understand the evolution of this type of pollution over the years. This is mainly due to the demand in terms VOLUME 8, 2020 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see http://creativecommons.org/licenses/by/4.0/ of time and resources involved in collecting samples and processing them in the laboratory. In sediment studies, the most common identification technique is the visual counting and sorting under a stereomicroscope, which is based on color, size, brightness, and morphology of the particles [9]- [11]. In the case of samples from beaches where the number of particles is high, identifying polymers by Fourier-transform infrared spectroscopy (FTIR) or Raman spectroscopy is a time-consuming task that may exceed the objectives of the study. At present, there are automatic image analysis-based identification methods that could be very useful when counting, classifying, and measuring some types of particles. In the study of zooplankton several software applications have been used successfully [12], [13], including ZooImage [14], Zooprocess and Plankton Identifier (PkID) [15], and more recently EcoTaxa [16]. Most of them are based on taking images of the sample, either by specific equipment (ZooScan or FlowCam) or by a high-resolution scanner. The image is taken in transparent mode, which allows separating the organisms from the background and obtaining the individual images of each organism (vignettes). From these vignettes, some relevant features are extracted (area, perimeter, width, length, etc.) and finally, based on these characteristics and a related classifier, the software identifies the taxa. These applications have been used for the quantification and measurement of microplastics too [17]- [20]. However, they are not useful for classification. When scanning the sample in transparent mode, important information is lost, such as the color of the particles, making it impossible to differentiate plastic particles from organic matter.
Given these antecedents, the objective of the present work is to start from existing image analysis software for particle identification and to develop a specific program to identify microplastics in beach samples, using other characteristics besides the shape, such as the color and the texture. In more detail, the proposal presented here aims at speeding up the quantification and classification of microplastic particles using computer vision and machine learning techniques. The main contributions of the paper can be summarized as: 1) the automatic segmentation and quantification of microplastic particles in standard RGB images, 2) the automatic classification of the particles into five types of interest, and 3) the evaluation of different machine learning approaches.

II. RELATED WORK
Although some solutions have been proposed for macroplastics quantification [21]- [24], none of them are adequate for microplastics, due to the evident difference in size. As pointed out by the survey in [25], the quantification of microplastics in sediments requires their preliminary extraction and manual processing. Once the microplastics sample has been collected, microplastics material must be separated from all the other material before proceeding to the identification of particles [26]. This is a completely different sce-nario, compared to macroplastics quantification. The latter requires direct manual intervention for a precise debris categorization. In particular, the quantification and classification of microplastics debris are required to later integrate the resultant quantification and classification data. This allows estimating and modeling their distribution, and finally evidencing their effects [27]- [29].
It is clear that the identification/screening step requires a time-consuming effort of highly qualified researchers, whose time could be better applied to other tasks. The integration of automatic or semi-automatic tools aims at reducing the required sample processing time, as already pointed out by [30]. Most studies accomplishing this task have focused on small microplastics (20µm − 1 mm), i.e., with a much smaller size than those that are the object of the proposal of this paper. Recently, these microplastic particles have been automatically detected and quantified using Nile Red (NR), Raman and Fourier Transform Infrared Spectroscopy (FTIR) [29]- [31]. The emphasis is to register particles that are not easily visible to the human eye. The work by [32] points out the errors present when eye counting particles below 1 mm. Additionally, the mentioned studies identify the precise composition of the plastic material present in samples. For instance, FTIR spectroscopy is used by [29] to identify the composition of microplastic particles. Focal Plane Array detectors (FPA) and FTIR microscopy, combined with a commercial image analysis software, are used by [31]. The presence of microplastics in an abiotic product, namely table sea salt, is studied by [33]. The authors developed an approach that reproduces eye counting results capturing micro-FT-NIR images and identifying Polyethylene Terephthalate (PET) microplastics using spectral similarity methods. The main drawbacks of IR-microscopy procedure are its low speed, high cost, and poor spectral resolution. As an alternative, fluorescence properties have been considered to highlight specific objects. The work by [30] proposes suspending the sediment in 5 ml of water, counting down to a few µm particles by detecting fluorescent emission. The method uses simple photography through an orange filter with automatic image analysis. The authors compare different dyes reporting the adoption of NR. The latter additionally provides the possibility of plastic categorization, as the NR fluorescence emission spectrum shifts depending on the polarity of its environment. Their results are competitive compared to IRmicroscopy. Also [32] makes use of NR to quantify small particles of polyethylene, polypropylene, polystyrene, and nylon-6 particle.
Microplastic particles larger than 1 mm have attracted less attention in the literature. Certainly, their analysis may be carried out by visual inspection, but again its automation would lead to faster sample processing. In our previous work [34], we analyzed samples extracted with a 1 mm mesh bag, i.e. visible to the human eye, using standard RGB images to extract their geometric features. These are used to classify microplastic particles into four debris categories. Given an experimental setup including 844 particles, the evaluation reports an accuracy of over 96.46% with Random Forest classifier.
A recent innovative approach addresses the characterization of microplastic litter from oceans by hyperspectral imaging [35]. Floating microplastic particles are collected by surface trawling nets for plankton, and then identified in three classes, namely polyethylene (PE), polypropylene (PP), and polystyrene (PS), using morphological and morphometric features. As reported by [36], not all authors confirm the composition of the particles using spectroscopic techniques (only 57% in sediments) and, in general, use only a subset of particles. Given the need to find alternatives to the initial visual inspection with the naked eye, we propose the SMACC software to count and classify particles. This is not intended to confirm plastic polymers, for this task would require the use of spectroscopy techniques.
As anticipated in the introduction, some researchers have already tried to adapt some image processing techniques used for other tasks, such as zooplankton analysis, to the microplastic classification. The traditional execution of this task entails the same sample properties, and the timeconsuming need to count and classify the different species that appear in a sample. In zooplankton analysis, the ZooImage tool [14] is employed to automatically classify zooplankton species [37]- [39]. ZooImage is an open-source solution that extracts different statistics from the zooplankton samples, such as abundances, total and partial size spectra or biomasses, etc. According to [12], an accuracy over 70% can be reached, but it depends on the species and their sizes. ZooScan with ZooProcess and Plankton Identifier (PkID) software [15] is another system designed for the same purpose reporting a similar accuracy around 75%. Zooplankton analysis is certainly a quite similar task to the one addressed here, but not necessarily the same features will be easily transferred to the problem at hand. For example, color can be a very important cue for microplastics classification, and different kinds of particles can be characterized by a peculiar texture. Therefore, this paper presents a more tailored proposal.
Recently, image analysis has started receiving attention in microplastics characterization tasks. In [10], Mukhanov et al. compute three shape descriptors (Feret's diameter, circularity, and area) with the ImageJ software to semi-automatically classify the microplastics particles into four classes: rounded, irregular, elongated and fiber. Gauci et al. [11] analyze the microplastics particles extracted from four beaches in Malta using Matlab software. For each particle, three descriptors are obtained: size, roughness, and color. The size is computed using an ellipse fitting technique and then using the major and minor axis. The authors define the roughness as the ratio between the difference of the particle and fitted ellipse areas and the ellipse area. The color descriptor is obtained as the closest color in the RGB space to a set of 10 predefined colors. In both works, the authors acquire the images using a flatbed scanner.

A. METHODOLOGY FOR SAMPLE EXTRACTION AND PREPARATION
There is no unique standardized lab protocol for the quantification and identification of microplastic particles, and none of the followed ones exhibits a better performance than the other [40]. Nonetheless, all of them share the need for manually counting and identifying the microplastics in a sample. This is certainly a time-consuming process requiring the attention of specialized personnel. Therefore, the development of automatic approaches achieving similar to manual, i.e. human, performance would suggest their validity.
Regarding the sample collection, when a net is used, the net mesh size determines the minimum size of the microplastics collected, and the information that may be extracted. Even though there is a need to define a common protocol for sampling, extraction, and quantification of the microplastics particles [25], [41], our aim is rather to devise a methodology that integrates an automatic computer vision-based approach in the process, which is suited for different protocols. The investigated system does not only count the number of microplastics particles but also classifies them into different categories, reducing the time needed in the process.
Before describing the proposed computer vision-based processing of samples, it is worth preliminarily and briefly outlining the specific collection methodology adopted for this work. In the Canary Islands Archipelago, the standardized methodology in use follows the manual Guidance on Monitoring of Marine Litter in European Seas [7], slightly modified in [42]. The overall procedure for the sample preparation entails a number of steps to analyze the larger fraction of microplastic particles (1 − 5 mm). It starts from the selection of regions (quadrants) of interest on a beach, as shown in Figure 1, and achieves the final result of separating the particles of interest (see Figure 3). The procedure steps are summarized in the following.
The samples are collected in a 50cm × 50cm quadrant at a high tide line ( Figure 1). The first centimeter of sand is gathered and placed in a net with a 1 mm mesh opening. The nets are rinsed with water to remove the sand, and in this way, only microplastics and remains of organic matter (leaves, algae, etc.) greater than 1mm are collected [42]. Samples may contain different types of organic remains such as shells, therefore it may be necessary to add a density separation step before processing them. Several authors propose the  separation with a high-density salt solution: sodium chloride (NaCl), sodium iodide (NaI) and zinc chloride (ZnCl2) [43]; furthermore, if many organic plant residues are present, a preliminary separation with 96% ethanol can be carried out [42]. The sample is dried and sieved to separate the fractions of 1-5 mm (microplastics) (see Figure 2) and 5-25 mm (mesoplastics). Finally, the microplastics are weighted and scanned (see Section III-B).
According to the studies performed in our geographical context, namely Canary Islands, five types of relevant particles are present in coastal areas [44], which are briefly described: • Pellet. They correspond to small beads of primary microplastics ( Figure 3a).
• Fragment. They correspond to small fragments derived from the breakdown of larger plastic debris ( Figure 3b).
• Line. They correspond to small segments of fish lines or nets ( Figure 3c).
• Tar. Although this type does not correspond to a plastic polymer, it represents an important fraction of marine debris in the Canary Islands. This is likely due to ships that discharge bunker oil in the sea, or to old oil spills deposited on rocks and fragmented by the action of sea waves. The result is represented by small solid tar fragments ( Figure 3d).
• Organic. This is not a plastic material either, but it is often present in collected samples though not being sand. Normally it corresponds to small fragments of wood, bones or shells ( Figure 3e).

B. IMAGE ACQUISITION AND SEGMENTATION
Automatic image analysis is carried out on a per-sample basis. Once the sample has been processed as described above, to isolate particles in the range 1-5 mm, a scanner is used to capture the particles after distributing them over the scan plate so as to avoid occlusions. Images are captured with an Epson Perfection V800, using VueScan as scanning software. The resulting image resolution ranges from  approximately 4800 × 6900 pixels to 9700 × 13800 pixels, depending on the scanner configuration (at least 600 dpi is recommended). This resolution avoids the loss of details in the particles, but, at the same time, may highlight imperfections in the scanner background. This may introduce some level of noise or appearing artifacts, that could be confused with some types of microplastics, in particular with the lines. Figure 4 shows an example of this kind of problem. For each sample, two images are acquired: one in transparency mode (backlight illumination) and the second one in reflective mode (RGB color). Figure 5 shows the pair of images from an example sample. The need for two images of the same sample is due to the translucent nature of some type of polymer that hinders the segmentation of the particles using exclusively the reflective mode.
The observation of the transparency image in Figure 5a suggests that, given the clear scanner background, particles are in most cases darker. This circumstance may be opportunistically exploited for a thresholding operation [45] to locate the connected components (blobs) belonging to microplastic particle candidates. However, the result of the thresholding operation can be influenced by the characteristics of different kinds of particles. Existing thresholding techniques may use a single fixed threshold over the whole image (global methods), or an adaptive threshold if its value is computed for each pixel based on local statistics (adaptive methods). Among the global methods, the one by Otsu [46] has been extensively used, providing good performance when regions are not linear. In our scenario, one particular type of microplastic particles come from the breakdown of fishing lines or nets and their shape is very linear. Therefore, the method by Otsu is prone to dividing the processed linear blobs into several parts, therefore achieving bad results. For that reason, the adaptive method by Sauvola and Pietikäinen [47] is adopted. The results from the two approaches are compared in Figure 6, where the particle labeled as 93-LINE in Figure 6b (obtained by Sauvola and Pietikäinen's method), appears divided into two segments in Figure 6a (obtained by Otsu's method): 71-LINE and 74-LINE. As a consequence of such preliminary tests, the method by Sauvola and Pietikäinen was chosen for the prototype application because its performance is less affected by the particular shape of the objects to segment.
Once the segmentation of a transparency image is completed, a set of geometrical features can be extracted from the resulting blobs. However, the color information fades in grey levels in the transparency image, therefore cannot be fully exploited. Thus, the additional color information of the particles is obtained from the corresponding color image acquired in reflective mode (Figure 5b). In principle, the segmentation of the transparency image could be mapped onto the corresponding color image and identify the same blobs. However, the area of the image occupied by the sample is interactively cropped by the researcher during each scanning. For this reason, there is a usually small misalignment between the corresponding transparency and color images. The alignment of two images has been extensively studied in the Computer Vision community as image registration. Briefly, this task comprises four steps: feature detection, feature matching, transform model estimation, and image resampling. To correct the misalignment, a planar homography transformation is carried out. This operation implies finding the corresponding pixels in both images to compute the 3 × 3 transformation matrix. In our scenario, the feature detection has been carried out using the SURF descriptor (Speeded Up Robust Feature - [48]), which has a similar performance to SIFT descriptor (Scale-invariant feature transform). Due to the high number of features detected, many matches can be found, thus the RANSAC algorithm is used [49] to reduce the mismatches among the initial candidates. Figure 7 and Figure 8 help appreciating the effect of the alignment operation. The first one shows the transparency image segmentation mapped onto  the color image without alignment, while the second one provides the same detail after applying the described alignment process. In the latter case, the results of the transparency image segmentation correspond with the same particles in the color image.

C. FEATURE EXTRACTION AND CLASSIFICATION
The features extracted after the segmentation process can be grouped into three categories: geometric, color and texture features. Geometric features are extracted from the transparency image while the rest come from the RGB color image. The geometric features that are used in this proposal are related to the blob/particle size and shape and include the following ones.
• Area of the blob in pixels. • Perimeter of the blob in pixels. • Compactness of the blob, computed as the ratio between the square of the perimeter and the area.
• Ratio between the area of the blob and its bounding box.
• Ratio between the width and the height of the blob bounding box.
• Ratio between the major and minor axis of the fitted ellipse.
• Ratio between the major and minor radius defined, respectively, as the distance from the furthest and closest pixel of the contour to the centroid of the blob. The color features include the following ones.
• Mean and variance of the RGB (Red, Green, Blue) components of the blob pixels.
• Mean and variance of the HSV (Hue, Saturation, Value) components of the blob pixels. VOLUME 8, 2020 Local Binary Pattern (LBP) [50] has been chosen to extract features related to texture, given its proven robustness and discriminant capability in several computer vision tasks. Though there are a wide number of variants described in the literature, for this problem the original LBP(8, 1) definition has been used. It computes a value between 0 and 255 for each pixel of the microplastic particle blob. This value is the decimal number corresponding to the 8-bits binary string that codes the relations between the grey level of the pixel and that of each of its 8 ordered neighbors in a 3 × 3 window (a 0 if the value of the pixel is higher than its neighbor, a 1 otherwise). The histogram of the 256 codes is used as the texture feature. In summary, the whole set of features in the blob/particle vector, combining geometric, color and texture features, contains 275 elements.
After extracting the particle features, the next step is to classify each particle in the sample into one of the five classes previously defined: pellet, fragment, line, tar or organic. Different classifiers have been tested before finding the final solution. The considered baseline classifiers are the following: • K Nearest-Neighbor (KNN). This method belongs to the case-based classifiers [51] which first store all the training instances. Later, the classification of a new instance is performed considering the K nearest training instances to it. The class assigned to the test instance is given by a voting strategy among the K nearest training instances. Different values of K, distance measures to get the nearest neighbors, and voting strategies have been proposed in the literature.
• C4.5. This classifier is a decision tree [52] which is built in a top-down manner. Training instances are divided in each node according to the best discriminating attribute of the subset of training instances that correspond to the node. The stopping criterion is when all instances that correspond to a node belong to the same class or the best split of the node does not surpass a fixed Chi-square significant threshold. After the growing stage, a pruning phase is implemented to avoid overfitting.
• Random Forest (RF). This classifier is made up of several decision trees that are built using subsets of the training instances randomly selected with replacement [53].
In the growing stage of each tree, in each node a set of randomly selected attributes is considered, therefore obtaining uncorrelated trees. To classify a new instance, after feeding it into all the trees, a majority strategy is used to assign the instance to a class.
• Support Vector Machine (SVM). This classifier obtains the hyperplanes that separate the training instances of different classes minimizing the expected error [54]. The support vectors are those instances that define the hyperplanes. For non linearly separable classes, the original space is transformed using kernels, where the most frequently used are polynomial and radial based functions (RBF). A visual analysis of the particle shapes reveals that they can roughly form three different groups. The first group includes lines, given their linear shape which is remarkably different from all the other particles, as can be seen in Figure 3c. The second group comprises pellets, which can be discriminated quite well due to their rounded shape. Finally, tar, organics, and fragments present irregular shapes but different color/texture appearance, so that they are grouped and require to be processed by a higher number of features. According to this, the proposed solution implements an ensemble classifier, specifically a three-level cascade classifier with the structure shown in Figure 9. In the first level, making use of only geometrical features, particles are classified into lines and others. In the second level, again using only geometrical features, the classifier divides the particles into pellets and the rest. Finally, a classifier that distinguishes all the features (geometric, color and texture) groups the particles into the remaining classes: fragments, organic and tar. The aim of a first set of experiments, that will be presented in the next section, has been to determine the best classifier for each level, in order to maximize the final accuracy.
The recent success of Deep Learning (DL) approaches, especially Convolutional Neural Networks (CNN), in several challenging object classification problems [55]- [58], suggests the evaluation of its application in microplastics classification. However, due to the entailed computational requirements, this approach has not yet been integrated into the current release of the implemented software. In addition, the lack of thousands of labeled particle instances hinders a complete training process, restricting the application of DL to transfer learning techniques. In this context, the VGG-16 network [56] has been used as the base net for a second set of experiments. It is a CNN whose configuration comprises two blocks of two convolutional layers followed by a maxpool layer, three blocks of three convolutional layers followed by a max-pool layer, and three fully-connected layers. All the convolutional layers have a Rectified Linear Unit (ReLU) activation function.
The VGG-16 has been modified to be used in our microplastics classification task. First, input images have a dimension of 132 × 132 pixels in RGB color instead of the original 224×224 pixels. The dimension of the two first fullyconnected layers has been reduced to 128 and 64 respectively, and a batch normalization layer [59] has been introduced after each layer. The last layer has five outputs, corresponding to the microplastic classes under consideration, with softmax activation function. The previous fully-connected layers are the only to be trained because the rest of the network will use weights that had been pre-trained on ImageNet.

IV. RESULTS
To assess the validity of the proposed system, the first experiments used five samples, each one containing only particles of a single class previously classified by an expert. The particles of each sample were divided into two groups, one for training and the other for testing (Table 1). Thus the experimental setup contains 10 samples, two for each particle type.
For each sample, microplastic particles are segmented, making use of the segmentation method introduced in section III-B. After segmentation, the corresponding feature vector of 275 elements is computed for each particle, describing the particle geometry, color, and texture as defined in section III-C. The distribution of particles for each class in the respective training and test sets is shown in Table 1.
In a first evaluation experiment, each single classifier described in section III-C exploited all 275 features in a single classification step, i.e., each input particle was assigned to one of the five classes. The achieved results are summarized in Table 2. No fusion of results was attempted. The best average accuracy (over all the classes) of 88.3% was obtained for the SVM classifier with RBF kernel setting up C = 15 and gamma = 0.05. C and gamma hyperparameter values were obtained using a cross-validation tuning process. In general, it can be observed that both precision and recall values are very similar, indicating a balanced behavior of the classifiers for all the classes. Compared with the other classifiers, KNN exhibits the worst performance due to the high dimensionality of the problem with respect to the available training data. A cross-validation tuning process was also used to set up the number of neighbors (K = 5) for the KNN classifier. The C4.5 decision tree is not so affected by the dimensionality, because the method implicitly introduces a feature selection phase in the building process. Random Forest, in spite of being based on decision trees, is more affected by irrelevant features than a single decision tree such as C4.5.
Finally, the very last row of Table 2 presents the results obtained using the opportunistic design of the three-level cascade classifier. According to the observations reported above, this design divides the five-class classification problem into two initial binary problems (line/others first and pellet/others afterward), and a final three-class problem. As evidenced by the results, this classifier yields the best performance with an accuracy of 91.1%. The configuration of the cascade was determined experimentally, by preliminary tests to identify the best classifier at each level. The first classifier employs an SVM linear to classify lines, and the second level relies on a Random Forest with Relief feature selection [60] for pellets. In these two first levels, only geometrical features are used, as color and texture features are not relevant for the corresponding tasks. As a matter of fact, both lines and pellets are fully characterized by their shape features, that discriminate them from all the others to a satisfying extent. The remaining group includes three classes (fragments, tar and organic) and is therefore much more variated. For this reason, several factors have to be taken into account at the same time. Therefore, the last level makes use of the whole set of features, in order to consider shape but to take also advantage of both the particle color and of the texture information that LBP descriptor captures. To avoid that the LBP descriptors, due to their high dimensionality, can overwhelm the outcome from color and geometrical features, a dimensionality reduction of the LBP descriptor is carried out by Principal Component Analysis (PCA), and the resulting principal components along with the other features are the inputs to the Random Forest making up the last stage of the cascade classifier. After projecting the LBP descriptor using PCA, the resulting space has a dimension corresponding to 7 principal components, which explain more than 95% of the LBP descriptor total variance.
The influence of dimensionality is further explored testing the use of geometric and color features only. Table 3 summarizes the results in this case, i.e., leaving out texture features. The behavior of the SVM and C4.5 classifiers are very similar to the scenario with the full set of features. On the other hand, KNN and Random Forest increase their accuracy, with the latter obtaining the best accuracy with 89.4%. This improvement is due to the dimensionality reduction, which decreases the influence of non-informative or redundant features. As in the previous scenario, the respective method hyperparameters, C = 15 and gamma = 0.05 for SVM and K = 3 for KNN, were obtained with a cross-validation tuning. However, the results are still below those obtained by the cascade, thus testifying the suitability of the designed solution.
It is also interesting to consider the confusion matrices obtained over the test set by the single best "monolithic" classifier, i.e., SVM as discussed above, and the designed cascade. Figure 10 presents the normalized confusion matrix for the SVM classifier with RBF kernel using all   the features. Figure 11 shows the normalized confusion matrix of the three-level cascade classifier: except for pellet, the rest of the particles are very well classified (over 90% of correct classification in all cases). The values on the diagonal, i.e., the correct recognition of particles, increase for all classes, demonstrating that the proposed method is well balanced and does not privilege any class. On the contrary, being SVM the second-best in performance according to results in Table 2, the matrix in Figure 10 points out a decrease in accuracy more remarkable for line, pellet, and fragment particles. As expected, fragments (and organic at a lower extent) are those that create more confusion, due to very different possible characteristics. However, such confusion is reduced satisfyingly by the cascade. Lines are correctly recognized by the cascade, so eliminating some confusion by SVM, and also tar creates little problem, possibly due to very specific color and texture characteristics. Strangely enough, the worst results, though quite good, are obtained by the pellet class. Not only does it achieve the lowest correct recognition rate, but particles are often misclassified as fragments. On the one hand, no other kind of confusion is made.  This demonstrates that the way lines, tar and organic classes have been characterized makes them sufficiently different from pellet. On the other hand, further investigation is required to explain the confusion with fragments. Notwithstanding the intuitive understanding, it seems that the circular shape does not sufficiently characterize this kind of particles, as well as for the other classes. However, pellets can be of different colors and with a uniform texture, so that these features would not be of much help. As a consequence, it is necessary to better explore this issue.
Even though the CNN-based classifier is not integrated into the current recognition pipeline, we designed an experimental setup to roughly assess the possible improvement of classification performance. A CNN requires an image as input. For this reason, instead of computing features from each segmented particle, the resulting segmentation bounding boxes were used to crop the different particles from each class image pair and use them as input. Unlike the other classifiers, the CNN needs a larger number of instances to be trained, even though only the fully-connected layers are going to be trained (see sec. III-C). To solve this issue, a data augmentation process was carried out, entailing the rotation of each particle cropped image by π/4, π/2 and 3π/4 clockwise, and using both the original and its mirrored cropped image, obtaining a total of 5960 particle images that were scaled to 132 × 132 pixels. We use SGD with a learning rate of 10 −6 , momentum of 0.9 and the batch size of 32. After that, a 10-CV was carried out to get an estimation of the CNN performance. The accuracy reaches 97.4% (precision = 97.5% and recall = 97.4%) which improves the results of the previous classifiers. Even if the experimental setup is not completely equivalent, this approach suggests a research line to be followed in the near future.
The experiments presented up to now were carried out with samples of only one class particle per sample. A further experiment in real conditions was conducted using 12 mixed  samples of microplastics collected on a beach. To test the performance of the proposed system the results obtained by an expert (manual) and by SMACC (automatic) are compared. In Table 4 the total number of particles detected is shown and it can be observed that SMACC has an error of 1.4% in the number of detected particles. This difference falls within the acceptable margin for monitoring studies that try to establish the evolution over time rather than obtaining a snapshot in a moment. Table 5 presents the number of particles of each type in the 12 samples detected by the expert (manual classification) and by SMACC (automatic classification). It can be observed that the difference is very low except for the line type; even with the organic particles the manual and automatic classifications yield the same results. The nature of the line particles as very thin regions of clear material makes its segmentation more difficult dividing the same particles into several ones. The disaggregated results for each sample and class are shown in Table 6.
With respect to the time to process each sample, Table 7 and 8 show the time devoted to each stage of the counting and classification process. The values shown in the table correspond to actual times measured with a chronometer by the expert who carried out the process. Overall, the automatic process is done in less than half of the time consumed by the expert. As pointed out in the introduction, the counting and classifying process is a very time-consuming one and this is confirmed in the tables: the manual process takes 20:24 minutes on average against the 00:35 minutes of the automatic process.

V. DISCUSSION
According to the achieved results, the use of a single classifier to discriminate among the five classes provides accuracy close to 90% for all classes. However, it is evident that there is a negative influence of the feature vector length, as texture features seem to negatively affect some classifiers. Taking advantage of the different particle nature, it proves more suitable to apply a multilayer cascade classifier. This simplifies the problem iteratively before reaching the last layer classifier, that deals with only three classes. This goal is achieved by taking into account the peculiar characteristics of the different particle classes. Given the experimental setup, the use of a cascade strategy has proven to provide a more robust classifier. This approach makes use of fewer features in the first two levels, i.e., the geometrical ones only, to classify the easy particles: lines and pellets. The remaining three classes are analyzed in the last level with the whole set of features, which includes color and texture information. This design has the additional advantages to make use of simpler classifiers for easier differentiated particles, making also the process quicker, and to employ a more complex classifier only for harder classes.
The experimental evaluation has also included a preliminary evaluation of a deep learning approach. Even if the number of annotated instances is reduced, and a data augmentation step was required, the achieved accuracy reflects a remarkable improvement. The integration of deep learning imposes higher computational requirements, needing a larger experimental setup to fairly compare the different alternatives. In any case, this option offers also further possibilities, as it may be adopted as a feature extractor, to combine the additional learned features with those already considered, i.e., geometrical, color and texture. In this sense, in the near future we plan to consider the combination of extracted features and hand-crafted ones, which have already provided us excellent results in other application fields, as in the case related to soft biometrics [61], [62].
Compared with a human expert, SMACC has achieved very similar results, which can be obtained in half the time consumed by the expert for the same task. Most of the errors are related to line particles because, despite using the Sauvola thresholding method, some of the line particles are divided into multiple blobs, resulting in an overestimation of this type of particles. With respect to the automatic processing time, it can be observed that the bottleneck is in the transparency scanning that on average consumes 4:59 minutes out of total process duration (9:52 minutes), so any improvement in this aspect will have a positive impact in the total reduction of the processing time.

VI. CONCLUSION
In this work, we have focused on the design of a software utility to automatically classify microplastic particles (< 5 mm). The aim is to provide researchers with a tool to speed up microplastics quantification and classification procedures. The use of Java as a programming language allows using the prototype application on different platforms like Windows, Linux, or MacOS.
We have collected an evaluation dataset taking into account the five classes of particles present in the Canary Islands. This dataset served to explore different features and classification alternatives. The reported best accuracy, 91%, is achieved using a cascade classifier which integrates geometrical, color, and texture features. The study also includes preliminary results adapting a deep learning-based approach, with very promising results. However, further efforts are needed to create a larger dataset, which is certainly an expensive task. In any case, as our intention is to make the software available to the research community, a collateral effect may be the creation of a collaborative larger annotated dataset.
In a real scenario, the proposed system has proved to yield similar results to a human expert and it is able to carry out the task in less than half of the expert time. A further advantage is that the system does not suffer from errors due to fatigue. One element to improve in SMACC is the image acquisition stage because the transparency scanning takes almost 50% of the overall processing time.
In summary, computer vision techniques serve to speed up the quantification, characterization, and classification of microplastic particles and can provide a good contribution to this increasingly important field. SMACC software can be found at http://mozart.dis.ulpgc.es/smacc for downloading. His main research activities focus particularly on the automatic facial analysis, covering also different topics related to image processing, perceptual interaction, human-machine interaction, biometrics, and computer graphics. He is a member of the AEPIA and AERFAI-IAPR, having coauthored over one hundred articles, including peer-reviewed international journals, book chapters, and conference proceedings. He has acted as an external expert for the Chilean Researchh Agency and the Spanish Acceditation Agency. He serves to the community in different conference programme and technical committees. He is currently an Associate Editor of Pattern Recognition Letters and the IEEE Biometrics Newsletter.
ENRICO SANTESARTI received the B.Sc. and M.Sc. degrees from the Sapienza University of Rome. The work for his M.Sc. dissertation was carried out during a collaboration with the Department of Systems and Informatics, University of Las Palmas de Gran Canaria.
MARIA DE MARSICO (Senior Member, IEEE) received the degree in computer science from the University of Salerno, in 1988, with a thesis on ''Structures and Visual Languages''. She is currently an Associate Professor with the Department of Computer Science, Sapienza University of Rome, Italy. Her research interests are in computer vision, pattern recognition, with a special focus on biometrics, and in human-computer interaction, with a special focus on multimodal communication. She has authored or coauthored over 180 scientific articles in these areas that were published in high rank journals and international conferences. She is a member of the ACM and ACM SIGCHI (Special Interest Group in Computer-Human Interaction), and of the IAPR and IAPR Italian Chapter (CVPL). She has served/serves as the Program Chair/Workshop Chair/Special Session Chair/Area Chair for international conferences. She has served as an Associate Editor for Pattern Recognition Letters, from 2015 to 2018, and as an Area Editor, since 2018, before being appointed as the Co-Editor-in-Chief with responsibility for special issues and special sections. She has also coedited several special issues in high rank journal, including Pattern Recognition Letters. She participates in the IEEE technical Committees, and is the EiC of the IEEE BIOMETRICS NEWSLETTER and an Area Editor of the IEEE BIOMETRICS COMPENDIUM.
ICO MARTÍNEZ has worked as a research support staff in different projects about different topics (metabolism and physiology/microplastics). This has allowed her to reach experience in analytical and experimental techniques about enzyme metabolism, physiological studies of zooplankton, microplastic pollution and its effect in the food web, and jellyfish metabolism, with the management of the corresponding instrumentation. MAY GÓMEZ graduated in marine biology from the University of La Laguna, in 1986, the Ph.D. degree in oceanography from ULPGC, in 1991, and the Master of University Teaching Expert from the ULPGC, in June 2014. She has been the Vice Dean of the Faculty of Marine Sciences, and also the Director of Doctoral Programs and Master's Degree Programs in oceanography. Since 2008, she has been the Research Coordinator for the Ecophysiology of Marine Organisms (EOMAR) Group, ULPGC. She is currently a Professor with the University Institute for Sustainable Aquaculture and Aquatic Ecosystems (IU-ECOAQUA), ULPGC. Her research areas include ecology, physiology, and biochemistry of zooplankton, metabolism in zooplankton communities, microplastics transfer through the marine food chain, biological oceanography, and ocean biogeochemistry. This has made her a member of the International Research Programs of ICES, GLOBEC, and SCOR. She has extensive experience in researching enzymatic indices (ETS, IDH, and GDH) of physiological processes. She has carried out research stays at the University of Hamburg; Institute für Meereskunde, Rostock; Institut for fiskeriog marin biologi, Bergen; University of Washington; and University of Stirling. She has authored 98 research articles and several academic books, has participated in 49 national and European research projects, of which she has been a Principal Investigator in 12 of them. She has supervised several doctoral and master's theses. She has participated in 20 oceanographic campaigns, three of them as cruise leader and has presented 200 communications to congresses, and 20 invited talks at national and international scientific meetings. She has been on the organizing committee of several international congresses.
ALICIA HERRERA is currently a Postdoctoral Researcher with the ULPGC, and a Lead Researcher of the MICROTROFIC Project (ULPGC2015-04) and IMPLAMAC project (MAC Interreg) which studies microplastic pollution and its transfer through trophic webs and possible effects on marine organisms in the Macaronesian region. Her main line of research aims to contribute to understanding the risk of the accumulation of microplastics in the oceans and to carry out an awareness campaign. Her research has been published in international journals such as the Journal of Experimental Marine Biology and Ecology, the Journal of Marine Systems, Continental Shelf Research, Marine Pollution Bulletin, and the Science of The Total Environment. VOLUME 8, 2020