## 1 Introduction
The use of Raman spectroscopy can rapidly identify causative agent and its susceptibility to antimicrobials [14], and the combination of Raman tweezers and microfluidics enables real-time analysis and identification of single microbial cells [15]. Rapid microbial detection can shorten hospital stay, reduce mortality and reduce costs of medical. It is likely to become a reliable and fast diagnostic tool in the future. Confocal Raman spectroscopy combines confocal microcopy and Raman spectroscopy, and is widely used in the fields of physical chemistry and biomedicine for its non-destructive testing, tomography, and molecular fingerprint characteristics [16; 17; 18]. High-lateral resolution and well-resolved depth profiling with the confocal Raman spectroscopy allows it to identify tiny targets and investigate hidden phases underneath the surface without destruction of extraterrestrial materials [19]. By adopting the reflective illumination light path, the designed confocal micro-Raman system has the enhanced intensity of the Raman spectrum signal and the improved signal-to-noise ratio [20]. In the field of in vivo confocal Raman spectroscopy, detection methods can be divided into the following two types. For the first type of system, confocal Raman spectra were obtained without imaging guidance. During the measurement, the biological tissue of interest is pressed on the cover glass, and Raman spectra of different depths are obtained by vertical scanning [21]. The second type of system combines Raman microscopy with reflectance confocal microscopy (RCM), in which Raman microscopy and RCM work alternately. RCM imaging is used to identify points of interest (POIs). The RCM imaging channel was then closed to acquire micro-Raman from a predetermined POI [22]. In order to expand application scenarios, methods to improve resolution have been proposed. Combining the confocal Raman spectroscopy imaging with radially polarized light compact focusing, the spatial resolution of confocal Raman spectroscopy imaging can be improved by compressing the incident spot diameter and image restoration techniques [23]. As a new type of Raman spectroscopy detection method, spatially offset Raman spectroscopy (SORS) can effectively suppress the interference of surface component Raman spectroscopy and fluorescence background. Combined with appropriate data processing methods, it is especially suitable for translucent or deep spectral information extraction of substances with highly fluorescent background materials [24]. Its detection depth is usually from 20 \(\upmu\)m to 5 mm, which exceeds the detection depth limit of confocal Raman spectroscopy [25]. Samples from which spectra were collected do not need to be prepared and can be measured under high-temperature, low-temperature and high-pressure environments. The instrument is stable, moderate in size, has a low maintenance cost and is simple to use [26]. However, locating the right excitation position in order to precisely identify the material has always been a challenge in the abovementioned spectroscopic methodologies. When using the autostereoscopic 3D measurement method to measure the spatial position of the target, the robustness of judging the depth by the sharpness function of the focus position is poor. There are two main reasons for this shortcoming. One is the unapparent visual characteristics of the object hinder the judgment of the algorithm, and the other one is that the optical system has a depth of field, and the ability to distinguish different depths of focus is not strong. Furthermore, it is not possible to discriminate the substance composition only using a visual inspection system. Using Raman spectroscopy to discriminate material composition is a good choice. However, when the existing spectroscopic system, such as confocal Raman spectroscopy, detects sparsely distributed targets in a three-dimensional space, the imaging system needs to scan the entire depth to find the target because the microscopic imaging system has a small depth of field.