# Detecting Multiple Mixed Bacteria Using Dual-Mode Hyperspectral Imaging and Deep Neural Networks
## 2 Materials and Methods  
### System Setup and Calibration  
Multi-wavelength fluorescence/transmission spectra of bacterial suspensions were measured by our self-developed dual-mode hyperspectral microscopic detection system, whose detailed light path diagrams in two different modes are displayed in Figure 1. In fluorescence hyperspectral mode, a 405 nm laser is utilized as the excitation light source. After being reflected by a dichroic mirror, the 405 nm laser passes through a tube lens (Thorlabs, Newton, NJ, USA), a 10\(\times\) micro-objective (Olympus, Tokyo, Japan; Lumpflflw), and illuminates at the measurement sample. The sample is placed on a moving stage, which can be adjusted along \(x\), \(y\), and \(z\) direction to ensure the proper focus depth and illumination position. The sample that is irradiated by the laser generates fluorescent light, which returns along the original light path sequentially travelling through the micro-objective, tube lens, dichroic mirror, and is converged and imaged at the place where a 10 \(\upmu\)m width slit is placed. A 450 nm long-pass filter (HENG YANG GUANG XUE, Guangzhou, China) in front of the slit is used to filter out the reflected excitation light and glass fluorescence. After passing through the slit, the fluorescent light of the bacterial sample is collimated by a collimator lens, and then dispersed at the spectral dimension in the range of 450-800 nm by the prism-grating-prism, and finally focused on a CMOS-1 by an imaging lens to form a spectral image of the line region. The spectral images the line regions after image preprocessing were used as the raw input of the deep neural networks at the next step. In the transmission hyperspectral mode, a white light-emitting diode (LED) with spectral range covering visible bands is used as lighting source, which directly irradiates the bacterial sample in a trans-illumination way. The transmission signal from the bacterial sample is then collected by the micro-objective, passing through the tube lens, and is divided into two paths by a beam splitter with splitting ratio of 50:50. One path of the incident light directly travels through the beam splitter and the slit. One line region of the transmission light enters the hyperspectral detection module, forming a corresponding spectral image. Transmission hyperspectral imaging can also be performed using the system. Using the moving stage to manipulate the movement of the specimen holder  
Figure 1: The schematic diagram of the dual-mode hyperspectral detection system in (**a**) fluorescence hyperspectral mode and (**b**) transmission hyperspectral mode. along the \(x\) or \(y\) direction, different line regions of the measurement sample can undergo continuous passage through the slit, allowing for the collection of corresponding spectral images from different line regions. In this way, complete transmission hyperspectral images containing bacterial characteristic spectra and shape profile can be collected, which can be used for cell counting. As for the other path of the transmission light, it is reflected by the beam splitter and imaged at the CMOS-2 plane to form a grayscale microscopic image. The two imaging planes of CMOS-1 (in the hyperspectral detection module) and CMOS-2 are conjugate, enabling sample observation to determine whether it is in focus or not, and to adjust the setting position. Prior to hyperspectral measurement, a wavelength calibration was carried out to establish a corresponding relationship between pixel index \(x\) and wavelength value \(\lambda\) at the spectral axis (along the direction of spectral expansion) of the hyperspectral image [21]. The calibration method is as follows. A mercury argon source with known spectral features was utilized as the standard calibration light source, and corresponding hyperspectral image was collected by the spectral detection module, as shown in Figure 2a.