# Detecting Multiple Mixed Bacteria Using Dual-Mode Hyperspectral Imaging and Deep Neural Networks
## 3 Results and Discussion
### Quantitative Analysis of Four Mixed Bacteria Using MB-Net  
As shown in Table 1, 84 groups of mixed bacterial samples with various mixing proportions were prepared for transmission and fluorescence spectra collection and analysis. Using the dual-mode hyperspectral detection system, we collected 50 sets of transmission spectra data and 50 sets of fluorescence spectra data for each measurement sample group with specific mixed ratio. In total, for 84 groups of mixed samples, 8400 sets of dual-mode transmission/fluorescence spectra data were obtained, forming the datasets in the experiments.  
After data preprocessing, the dual-mode spectral data were input into the MB-Net, generating the regression results of mixing proportions or the composition of each bacterium. Figure 5 shows the training process of the MB-Net. With the increase in iterations, the network parameters are gradually optimized and the loss gradually decreases. Here, the root mean square error (named RMSE) is also used as the key index for performance evaluation of the MB-Net both in the training set and validation set, indicating the magnitude of the error in model predictions. The losses of the MB-Net in both training set and validation set are less than 0.01, which demonstrates the capability of the network model in nonlinear conversation, which can cope well with the dual-mode hyperspectral information to build a sensitive and robust prediction model.  
In Figures 6-9, we compare the actual concentration and predicted concentration of _E. coli_, _S. marcescens_, _P. aeruginosa_, and _S. aureus_, respectively. The red line region indicates the accuracy interval with precision of 0.1. Five-fold cross-validation was applied for performance evaluation of the model, calculating the average RMSE and correlation coefficient \(R^{2}\). Corresponding values are indicated at Figures 6-9. \(R^{2}\) is utilized to evaluate the adequacy of the model in estimating the concentration of each bacterial class, thus, indicating the goodness of fit. \(R^{2}\) is defined as the following expression  
\[R^{2}=1-\frac{\sum_{i}(\hat{y}_{i}-y_{i})^{2}}{\sum_{i}(\overline{y}_{i}-y_{i} )^{2}} \tag{2}\]  
where \(y_{i}\) and \(\hat{y}_{i}\) are the actual value and predicted value of the \(i\)-th sample, respectively, and \(\overline{y}_{i}\) is the mean of \(y\)-values.  
Figure 4: (**a**) Spectral image of the mixed bacteria (using 40\(\times\) micro-objective). (**b**) Transmission spectral curves and (**c**) fluorescent spectral curves of the mixed bacterial samples with different mixed ratios. Sample 01: 0.1/0.1/0.1/0.7; sample 07: 0.1/0.1/0.7/0.1; sample 28: 0.1/0.7/0.1/0.1; sample 77: 0.5/0.1/0.3/0.1. (Sequence: _E. coli_/_S. marcescens_/_P. aeruginosa_/_S. aureus_).  
Figure 5: (**a**) Loss value and (**b**) RMSE during training process of the MB-Net.  
Table 2 summarizes and compares the prediction performance (RMSE and \(R^{2}\) of validation set) using transmission spectra only and dual-mode spectra. It can be seen that the prediction performance is greatly improved by combining transmission and fluorescence spectra in deep learning method. It is worth noting that the \(R^{2}\) of _P. aeruginosa_ is significantly improved from 0.90 to 0.99. This is because the fluorescence spectra of _P. aeruginosa_ provide additional fluorescent information related to the bacterial concentration, effectively increasing the accuracy of concentration prediction. The average RMSE of validation set of _E. coli_, _S. marcescens_, _P. aeruginosa_, and _S. aureus_ are calculated to be 0.0402, 0.0356, 0.0181, and 0.0289, respectively. The total bacterial content can be counted using the transmission hyperspectral images, while the MB-Net provides the predicted proportion of each bacterium in the mixed samples. Therefore, the combination of hyperspectral detection and DL provides an effective strategy in simultaneous quantitative analysis of multiple mixed bacterial samples.