# Machine Learning Powered Microalgae Classification by Use of Polarized Light Scattering Data
## 3 Results  
### Algorithm Comparison and Selection  
During the measurement, 10 SOPs of incident light were modulated into 7 differently oriented linear SOPs, i.e., \(120^{\circ}\), \(150^{\circ}\), \(30^{\circ}\), \(60^{\circ}\), \(90^{\circ}\), \(-45^{\circ}\), and \(45^{\circ}\); one elliptical SOP, E; the left-handed circular SOP, L; and the right-handed circular SOP, R. For each SOP, each category of microalgal cells was continuously measured to obtain more than 1000 records. Note that the time durations for different categories of microalgae were quite different according to the concentration of the particles. To obtain 1000 records for 10 polarization states of each sample, the average time duration was about 15 min. Here, each record corresponded to an individual microalgal cell and it had four feature parameters, [\(I\), \(q\), \(u\), \(v\)]. Therefore, for each category of microalgae in Table 1, the measured dataset included 10 SOPs and more than 1000 records for each SOP. Then, the input dataset was fed into the machine learning algorithms to build the models and train different classifiers, and the algorithm comparisons were conducted for different categories of microalgae in a same SOP of the incident light.  
The sampling methodology for the machine learning process is shown in Table 2. For each sample, there were in total 1000 records for one polarization state, where 800 records were used for training process and the remaining 200 were used for validation. Note that there were 10 illuminating polarization states, the sampling number for these 35 categories of samples was equally balanced for OVO and OVR.  
Machine learning algorithms were tested and compared in this work, including LDA, linear SVM, and non-linear SVM. The programing language in this work was Python 3.8, the package of data processing was mostly NumPy, and the package used for algorithm training was sklearn. During the training process, two categories of microalgae were randomly selected out of the dataset, and then the data were separated into training and validating subsets. After the classifier was trained by the training subset, the classifier was tested in the validating subset, and the accuracy was recorded as the accuracy of classifier. In this section, we go through all categories of microalgae, and for each pair of target microalgae, the accuracy is recorded for further comparison.  
To compare the performance of LDA with linear SVM, a binary array \((A_{1},\ A_{2})\) was obtained for each pair of microalgae, where \(A_{1}\) is the accuracy of LDA and \(A_{2}\) is the accuracy of linear SVM. We applied the LDA to project the polarization parameters, \(q\), \(u\), \(v\), into one value. During the training process, the solver of LDA was the singular value decomposition, the threshold for a singular value was 0.5, and the penalty of SVM was the hinge loss. After going through all the categories of microalgae in the dataset by permutation and combination, a series of arrays were recorded and they are shown in Figure 1(a).  
Results show that \(A_{1}\) and \(A_{2}\) were mostly lined up on the diagonal line, while linear SVM was slightly better compared with LDA. Similarly, in the comparison of linear and non-linear SVM, the result shown in Figure 1(b) indicates that the accuracy of the non-linear  
\begin{table}
\begin{tabular}{c c c c} \hline  & **Training Subset** & **Validating Subset** & **Total** \\ \hline Each sample & 800 & 200 & 1000 \\ \hline Sampling ratio & 0.8 & 0.2 & 1 \\ \hline \end{tabular}
\end{table}
Table 2: The sampling methodology for the machine learning.  
Figure 2: Comparison between the performances of different algorithms; (**a**) the comparison results of LDA and linear SVM; (**b**) the comparison results of linear SVM and non-linear SVM.  
SVM, \(A_{3}\), was generally higher than that of the linear SVM, \(A_{2}\). Thereafter, non-linear SVM was applied to train and classify different categories of microalgae.