## 2 Materials and Methods
### Data Analysis  
The collected hyperspectral fluorescence images were calibrated using a dark reference image, and a flat-field image shows that fluorescence was exhibited uniformly [33].  
\[I(i)=(l\_s(i)-D(i))/(l\_r(i)-D(i)), \tag{1}\]  
where \(I\) is the corrected relative hyperspectral fluorescence image, \(I\)s is the sample hyperspectral fluorescence image, \(Ir\) is the hyperspectral fluorescence image of the fluorescent reference plate, and \(D\) is the hyperspectral image of the dark reference plate, all at the \(i\)-th wavelength.  
The fluorescence spectra of the pixels composed of fruit juice residues and the SS surfaces were extracted from the corrected fluorescence hyperspectral images and used to calculate the average fluorescence spectrum. The spectra were extracted from the region of interest (ROI) of the juice residue spots on the SSS in the corrected fluorescence image. The ROI comprises the region from the center to the boundary of the residue, and 15-25 pixels per droplet were selected in this region.  
As shown in Figure 2, algorithms were developed for detecting residues using a single waveband (SW) and a ratio of two wavebands. Data analysis was performed as follows. The SW algorithms were developed using the fluorescence intensity of one waveband, and the two waveband ratio (TWR) algorithms were developed using the ratio of the fluorescence intensity of two wavebands. The optimal wavebands for identifying the residues of each fruit and the SSS were determined via one-way analysis of variance (ANOVA) of the extracted spectra. The spectra extracted from the ROI were divided into two groups, namely, clean surface and residue, and labelled as 0 and 1, respectively. One-way ANOVA was performed on all 70 wavebands in the 450-730 nm region to differentiate between the two groups. The F-value obtained via the ANOVA analysis for an SW and the ratio of two wavebands was used to select the optimal wavebands [22; 30]. A larger F-value represents a more statistically significant mean separation between the two groups.  
Optimal bands were selected using the calibration data set for the six dilution concentrations of each fruit residue on two types of SS surfaces. The SW algorithms and TWR algorithms were developed using the selected optimal band, and these models were verified using a validation set. The data sets for the calibration and validation were randomly divided into 80% and 20% of the total data, respectively.  
The calibration algorithm determines the threshold value that has the highest residue detection accuracy in the calibration data set, and the detection accuracy of the validation model is determined by applying this threshold value to the validation data set. In addition, a global detection algorithm was developed that can be applied to the residues of all four types of fruits.  
The global residue detection image algorithm was developed by applying the developed global detection algorithm to the hyperspectral fluorescence images. A two waveband ratio image (TWRI) algorithm was developed using the ratio image of two wavebands selected in the TWR algorithm according to Equation (2).  
\[\text{RIa}/\text{b}\ =\ \frac{Ia}{lb}, \tag{2}\]  
where \(I_{a}\) and \(I_{b}\) denote the corrected images at wavebands a and b, respectively.  
Imaging algorithms were developed to use an SW and a TWR to detect juice residue on the SS surfaces. A binary image composed of black of a clean surface with '0' and white of the residue with '1' was generated by applying the threshold value to the image with the selected waveband, and the regions in white were identified as residues. The detection accuracy of the residues refers to the number of positives wherein the residues are correctly identified. Image processing, data extraction, and analysis were performed using MATLAB (Version R2016b, MathWorks, Inc., Natick, MA, USA, 2016).