## 3 Results and Discussion
### Performance Evaluation of Binary Classification  
The binary aflatoxin B1 classification accuracy and F1-score are tabulated in Tables 1-3 for the selected sets of 4 and 10 spectra using different feature selection methods for datasets 1, 2, and 3, respectively. The confusion matrix illustrating the binary classification accuracy of the support vector machine (SVM) using raw data from dataset 1 is shown in Figure 1. In this analysis, 4 spectra were selected for in-line detection of aflatoxin B1, while 10 spectra were utilized for quality control, where precise measurements are essential. The developed MLPW-SR algorithm selected 4 and 10 spectral bands for both raw and SNV-processed data. For raw data, the selected 4 spectra were 73, 132, 137, and 214, while the 10 spectra set included 44, 68, 97, 100, 115, 137, 158, 171, 181, and 214. For SNV-processed data, the 4 selected spectra were 98, 115, 133, and 167, and the 10 spectra set consisted of 15, 33, 44, 49, 50, 64, 98, 115, 133, and 206. \begin{table}
\begin{tabular}{c c c c c c c c c c} \hline \hline
**Data** & **Band** & **Full** & & & & & **Classification Accuracy (\%)** & \\
**Type** & **Selection** & **Spectra** & & & **4 Spectra** & & & **10 Spectra** & \\ \cline{3-10}  & **Algorithm** & **CV** & **Training** & **Testing** & **CV** & **F1-Score** & **Training** & **Testing** & **CV** & **F1-Score** \\ \hline \multirow{8}{*}{Raw} & RF & & 89.12 & 81.91 & 87.80 & 0.680 & 90.45 & 81.91 & 86.74 & 0.658 \\  & IG & & 77.45 & 73.40 & 77.45 & 0 & 86.74 & 81.66 & 83.02 & 0.500 \\  & AdaBoost & & 88.59 & 82.98 & 86.74 & 0.632 & 92.57 & 85.11 & 91.78 & 0.797 \\  & mRMR & 93.63 & 77.45 & 73.40 & 77.72 & 0.045 & 89.12 & 82.98 & 86.74 & 0.597 \\  & Chi2 & 79.31 & 77.45 & 77.45 & 0 & 84.08 & 82.98 & 81.70 & 0.389 \\  & ANOVA & & 77.45 & 77.45 & 77.45 & 0 & 77.45 & 77.45 & 0 \\  & Relieff & & 89.12 & 82.98 & 87.53 & 0.671 & 91.78 & 86.17 & 90.19 & 0.755 \\  & Proposed & & 92.84 & 90.17 & 91.51 & 0.784 & 95.49 & 92.30 & 94.69 & 0.870 \\ \hline \multirow{8}{*}{SNV} & RF & & 87.80 & 80.85 & 87.53 & 0.684 & 96.55 & 86.17 & 94.96 & 0.886 \\  & IG & & 79.58 & 74.34 & 77.45 & 0.023 & 81.17 & 75.53 & 79.58 & 0.206 \\ \cline{1-1}  & AdaBoost & & 86.47 & 80.60 & 87.30 & 0.652 & 97.61 & 90.43 & 93.90 & 0.861 \\ \cline{1-1}  & mRMR & 96.02 & 88.30 & 94.43 & 0.874 & 97.61 & 92.55 & 94.69 & 0.884 \\ \cline{1-1}  & Chi2 & 94.43 & 85.68 & 77.66 & 85.15 & 0.588 & 96.82 & 88.30 & 93.90 & 0.866 \\ \cline{1-1}  & ANOVA & & 95.76 & 88.30 & 93.37 & 0.840 & 97.08 & 90.43 & 96.02 & 0.906 \\ \cline{1-1}  & Relieff & & 90.98 & 84.98 & 90.98 & 0.764 & 94.96 & 90.43 & 93.90 & 0.848 \\ \cline{1-1}  & Proposed & & 99.20 & 96.81 & 98.67 & 0.982 & 99.73 & 95.74 & 96.55 & 0.920 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Binary classification performance comparison of proposed and existing feature selection algorithm for dataset 1 (equal thickness, measured by vernier caliper). The SVM classification model achieved 4, 10, and full spectrum accuracy of 91.51%, 94.69%, and 93.63% for raw data and 98.67%, 95.74%, and 94.43% for SNV-processed data, respectively. The classification accuracy of the SVM classification model is \(\sim\)10%, and \(\sim\)10%, respectively. respectively. Also, the F1-score was 0.784 and 0.870 for raw data and 0.982 and 0.920 for SNV data, respectively, indicating the classification models' reliability. In raw data, 10 spectral bands achieved the highest classification accuracy compared to 4 and the full spectrum model. However, the 4 spectra set model outperformed the 10 and full spectra model for SNV-processed data. This is because the SNV removes the light-scattered effect from each spectrum; therefore, the 4 selected feature spectra become a more significant set than the 10 spectra set. Also, the 10 spectra may include some irrelevant bands, which reduces the classification accuracy. The SNV with 4 spectral bands achieved higher classification accuracy than the full spectrum model; this is because the full spectrum model contains both relevant and irrelevant spectra.