Enhancement of signal-to-noise ratio for fluorescence endoscope image based on fast digital lock-in algorithm

In this paper, the signal-to-noise ratios (SNR) of two image channels were enhanced with the fast digital lock-in algorithm. In order to simultaneously improve the quality of white and fluorescence images obtained by fluorescence endoscope, and improve the SNR to achieve a better image processing effect, two sources of white light and near-infrared light of a fluorescence endoscope were modulated, then the acquired images were demodulated into white and fluorescence images. A fluorescent endoscope experimental platform was setup to acquire endoscopic images of a target dyed by indocyanine green. The experimental results showed that the SNR of white and fluorescent images without the lock-in algorithm were 36.56 dB and 33.47 dB, respectively. However, with the lock-in algorithm, the SNR of white and fluorescent images were 39.54 dB and 35.70 dB, respectively. The SNR of white and fluorescent images was increased by 8.2% and 6.7%, respectively, by appling the digital lock-in algorithm. Therefore, this novel fluorescence endoscope based on the fast digital lock-in algorithm can rapidly and simultaneously obtain two-channel images of white light and fluorescence, effectively enhance the SNR of white and fluorescent images, and improve the imaging quality.

HW, 0000-0002-7896-303X; MH, 0000-0001-5571-4332 In this paper, the signal-to-noise ratios (SNR) of two image channels were enhanced with the fast digital lock-in algorithm. In order to simultaneously improve the quality of white and fluorescence images obtained by fluorescence endoscope, and improve the SNR to achieve a better image processing effect, two sources of white light and near-infrared light of a fluorescence endoscope were modulated, then the acquired images were demodulated into white and fluorescence images. A fluorescent endoscope experimental platform was setup to acquire endoscopic images of a target dyed by indocyanine green. The experimental results showed that the SNR of white and fluorescent images without the lock-in algorithm were 36.56 dB and 33.47 dB, respectively. However, with the lock-in algorithm, the SNR of white and fluorescent images were 39.54 dB and 35.70 dB, respectively. The SNR of white and fluorescent images was increased by 8.2% and 6.7%, respectively, by appling the digital lock-in algorithm. Therefore, this novel fluorescence endoscope based on the fast digital lock-in algorithm can rapidly and simultaneously obtain twochannel images of white light and fluorescence, effectively enhance the SNR of white and fluorescent images, and improve the imaging quality.
postoperative pain and scars [1]. Currently, the recognition and resection of tumours mainly depend on a visual inspection and digital examination by surgeons under white light during minimally invasive surgery treatment. However, it is difficult to accurately recognize and completely remove the tumour during surgery when the contrast of the tumour edge is low or the tumour is small [2]. Owing to the different absorption of fluorescent agents in tumour and healthy tissues, indocyanine green (ICG) has been Food and Drug Administration approved, which can guarantee the safety during the operation, near-infrared fluorescence-guided surgery can improve the success rate of early stage cancer detection, reduce the rate of missed detection, improve the accuracy of tumour resection and reduce the risk of cancer recurrence. Owing to the deep penetration depth of near-infrared light in biological tissues and the high resolution of near-infrared fluorescence imaging [3][4][5][6][7][8][9], near-infrared light can provide doctors with an accurate, objective and effective organizational structure and functional information in realtime during surgery. At present, fluorescence imaging technology is widely used in the endoscope, mainly by the time-sharing method to collect the white images and fluorescence images. The dualchannel fluorescence endoscopy imaging system proposed by Oh et al. [10] is illuminated by white light and near-infrared light, and the white images and fluorescence images are collected by a timesharing method. In this way, on the one hand, the image acquisition frame rate is reduced, and cannot realize simultaneous imaging of white and fluorescence channels. On the other hand, the fluorescence signal is easily disturbed by noise, and the signal-to-noise ratio (SNR) is relatively low. A team of professor Gang Li from Tianjin University [11,12] proposed a fast digital lock-in algorithm based on the classic digital lock-in algorithm. This algorithm no longer needs multiplication in the positive cross-correlation operation, and the amplitude and phase of the signal can be calculated by the addition and subtraction of discrete time series. Using this fast digital lock-in algorithm greatly reduces the amount of calculation and data storage, and reduces the algorithm's requirements on the microprocessor. At the same time, the microprocessor does not need to generate a reference signal with the same frequency as the input signal, which reduces the burden on the microprocessor and improves the speed of algorithm realization. The digital lock-in algorithm has been widely used in the fields of magnetic [13,14], light [15,16] and electricity [17] with the advantages of improving the SNR and the system stability. Therefore, this study proposes a fluorescence endoscope imaging system based on the fast digital lock-in algorithm to improve the image SNR of the fluorescence endoscope without reducing the image acquisition frame rate.
In this paper, the MATLAB software is used to simulate the digital lock-in algorithm, in other words, modulation of the light sources and image demodulation process of the fluorescence endoscope system are simulated, and then the image SNR theoretical values with and without digital lock-in algorithm processing are calculated. Based on the simulation results, a fluorescence endoscope imaging system is constructed. The system uses white light as the bright field illumination source and 760 nm narrow-band near-infrared light as fluorescent excitation light, and both sources are modulated simultaneously. A camera is used to capture the images. Then white and fluorescent images are obtained using the fast digital lock-in algorithm, followed by image SNR analysis. The experimental results show that the fast digital lock-in algorithm can improve the image SNR, facilitate the subsequent image processing process and improve the image processing effect while maintaining the image acquisition frame rate.

Fast digital lock-in algorithm for fluorescence endoscopic images acquisition 2.1. Dual-channel digital lock-in algorithm
The fluorescence endoscope consists of a white image signal channel and a fluorescent image signal channel, where the fluorescence signal is weak. Therefore, in order to detect the weak fluorescence signal under strong background, this study uses the fast digital lock-in algorithm to modulate the white light and near-infrared light sources to improve the SNR of the image signal. The digital lock-in algorithm detects the target signals using the principle of cross-correlation detection. The principle is to perform spectrum shifting on the original signal and use a low-pass filter to filter out the noise to obtain a high SNR demodulated signal. The schematic diagram of the dual-channel digital lock-in algorithm is shown in figure 1. It can be seen from figure 1 that the two-channel digital lock-in algorithm requires two carriers with different frequencies, that is, the modulation frequencies of the light sources are different. The phasesensitive detector is a multiplier that can multiply the high correlation input signal and the reference royalsocietypublishing.org/journal/rsos R. Soc. Open Sci. 8: 200779 signal, and the original spectrum ω=ω 0 is moved to ω = 0. Because the noise is not correlated with the reference signal, the noise spectrum will not migrate. After the input signal is multiplied with the reference signal, the low-pass filter is used to filter out the high-frequency noise, and the SNR of the image signal is improved. The modulation and the reference signals adopted in this paper are both square wave signals. The schematic diagram of light sources modulation is shown in figure 2.
Taking the white image signal channel as an example: assuming the original signal is W, the amplitude of the modulated square wave is A, the frequency is ω 0 , the Fourier series expansion is performed that can be expressed as The Fourier series expansion of the reference signal is The low-pass filter can be regarded as an integrator, so the output signal through the low-pass filter can be expressed as In equation (2.3), if the integration time is long enough, the result of the integration is the average of the modulated and the reference signals. As the phase difference changes, the relationship between u 0 (t) and w can be expressed as  It is known from equation (2.4) that when the modulated and the reference signals are both square waves, the output signal is proportional to the original signal, and the white image signal and the fluorescent image signal can be detected.

Image signal-to-noise ratio
The image SNR is an important standard for the objective evaluation of image quality of fluorescence endoscopic imaging systems. The image SNR is the ratio of the power spectrum of the signal and the noise. The errors between the original and the processed images with and without the digital lock-in algorithm are calculated to determine the SNR enhancement effect of the digital lock-in algorithm.
The calculation formula of the image SNR is as follows: X N j¼1 f 2 ði,jÞ, ð2:5Þ ðf ði,jÞ À g 1 ði,jÞÞ 2 , ð2:6Þ In the equations (2.5), (2.6) and (2.7), M and N represent the numbers of rows and columns of the image, that is, the image size, respectively, (i, j ) represent the pixels in the image, f, g 1 , and g 0 represent the original image, the image with the lock-in algorithm and the image without the lock-in algorithm, respectively. SNR d and SNR 0 represent the SNR of the images obtained with and without the lock-in algorithm, respectively.

Fluorescence endoscope image acquisition system
The schematic diagram of the fluorescence endoscope imaging system is shown in figure 3. The modulation signal generator is used to modulate the white light and the near-infrared light sources. The object to be measured is irradiated with white light and near-infrared light sources. The white image and the fluorescence image signals enter the fluorescence endoscopy guiding system and the image signals are collected by a complementary metal oxide semiconductor (CMOS). Then, the white and the fluorescent images are obtained by the image demodulator and displayed on a PC. Based on the system structure, a fluorescence endoscope imaging system was built, as shown in figure 4.

Simulation experiment results and analysis
In order to objectively evaluate the effect of the digital lock-in algorithm on the image SNR of the fluorescence endoscopy imaging system, the white original image and the fluorescence original image were collected separately in this study, and the fluorescent agent ICG was applied to the two letters 'TJ' in 'TJPU' in the original image. MATLAB was used to conduct the simulation research of the digital lock-in algorithm. The original white original image and the fluorescent original image were copied to generate multiple frames of images, and the noise was added to the image to simulate the noise in the actual image signal. Figure 5 shows the original images, the images with the digital lock-in algorithm and images without the digital lock-in algorithm when SNR = 10.46 dB. Figure 5a and b represent the original white and fluorescent images, respectively. Figure 5c and d represent the white and the fluorescence images after the digital lock-in algorithm processing, respectively, while, figure 5e and f represent the white and the fluorescent images that have not been processed by the digital lock-in algorithm, respectively. It can be seen from figure 5 that the image quality after lock-in algorithm processing is significantly improved, compared with the image quality royalsocietypublishing.org/journal/rsos R. Soc. Open Sci. 8: 200779 without lock-in algorithm processing. Next, the image SNR is quantitatively calculated and analysed, and the results are shown in figure 6.
It can be seen from figure 6a and b that the SNR of the demodulated white and fluorescence images are relatively stable at the same noise level. Tables 1 and 2 show the SNRs of the white and the fluorescence images as functions of the noise level. As shown in tables 1 and 2, compared with the SNRs of white and fluorescence images without the lock-in algorithm processing, the SNRs of white and fluorescence images with the lock-in algorithm processing are effectively improved by about 7 dB.

Experiment results and analysis
In order to verify the availability of the digital lock-in algorithm in the fluorescence endoscopy imaging system, a fluorescence endoscopy imaging system was built. When using the fast digital lock-in algorithm, the sampling rate must be 4k times the original signal frequency, and k is an integer ( f s = 4k · f). In the experiment, the modulation frequency of the white light source was 12 Hz, the modulation frequency of the near-infrared light source was 6 Hz, and the acquisition frame rate of the camera was 48 fps. Without light source modulation and digital lock-in algorithm demodulation of the image, the time-sharing method is used to collect the white image and the fluorescence image respectively. Among them, the camera's acquisition frame rate is set to 48 fps, that is, within 1 s, 24     lock-in processing, respectively. In figure 7e and f, fusion images of white and fluorescence images with and without the digital lock-in processing, are shown, respectively. After that, the SNR of the collected white and fluorescence images were quantitatively calculated, and the results are shown in figure 8.      Figure 8a and b show the SNRs of the white and fluorescence images with and without digital lock-in algorithm processing, respectively. It can be seen from figure 8 that the SNRs of the images processed by the digital lock-in algorithm are stable. The average SNRs of white and fluorescence images without the digital lock-in algorithm processing are 36.56 dB and 33.47 dB, respectively, while the average SNRs of white and fluorescence images with the digital lock-in algorithm processing are 39.54 dB and 35.70 dB, respectively. Compared with the SNRs of white and fluorescence images without the lock-in algorithm processing, the SNRs of white and fluorescence images with the lock-in algorithm processing increased by 8.2% and 6.7%, respectively. Therefore, the fast digital lock-in algorithm can effectively enhance the image SNR and improve image quality.

Conclusion
In this paper, the white light source and the near-infrared light source of the fluorescence endoscope were modulated simultaneously, and fast image acquisition was performed. Then, the captured images were demodulated into white and fluorescent images using the fast digital lock-in algorithm, and the image SNR was quantitatively analysed. The experimental results showed that the fast lock-in algorithm can effectively improve the imaging quality of white and fluorescent images without changing the video output frequency. Compared with the current two-channel fluorescence endoscope obtaining white and fluorescence images based on a time-sharing method, the frequency division method has certain advantages in both the video output frequency and the SNR. Moreover, with the development of high-speed sampling optical devices, the imaging quality of the fluorescence endoscope based on the digital lock-in algorithm will be further improved and the development of a multi-spectral endoscope will be realized in the future. On the other hand, the fluorescence endoscope based on a fast digital lock-in algorithm can help further image processing, such as tumour edge detection, improve the accuracy of input data in big data analysis and ultimately can help or guide doctors to identify tumour regions in clinical practice.
Data accessibility. See the electronic supplementary material.