## 3 Results and Discussion
### Visualization of SO\({}_{2}\) Residual Content Distribution  
A full-spectra PLSR model obtained good performance for SO\({}_{2}\) residual content determination. As mentioned in section \"Image Visualization\", full spectra of all pixels within the hyperspectral images was a heavy computational task and required high-level computational hardware. A fact that _Bw_-PLSR obtained similar performances as the full spectrum, and the amount of data was significantly reduced by 88.9%. Thus, the _Bw_-PLSR model was applied to predict the SO\({}_{2}\) residual content of each pixel within the hyperspectral images. Firstly, the samples were isolated from the background to make the reflectance of the background zero. Secondly, the spectrum of each pixel was extracted, and the sample preprocessing methods were applied on the extracted pixel-wise spectra. Thirdly, the optimal  
Figure 4: Prediction results of the calibration set (**a**) and the prediction set (**b**) of the _Bw_-PLSR model \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Methods** & **Model** & **Par *** & \(\mathbf{r_{c}}\) & **RMSEC (g/kg)** & \(\mathbf{r_{p}}\) & **RMSEP (g/kg)** \\ \hline SPA & PLSR & 13 & 0.939 & 0.668 & 0.912 & 0.819 \\ Random & PLSR & 7 & 0.888 & 0.892 & 0.845 & 1.064 \\ frog & PLSR & 13 & 0.942 & 0.653 & 0.917 & 0.786 \\ _Bw_ & PLSR & 12 & 0.956 & 0.568 & 0.909 & 0.840 \\ \hline \hline \end{tabular}  
* part: par means the parameter of the model, i.e., number of LVs in PLSR model.  
\end{table} 
Table 3: Results of PLSR models using optimal wavelengths selected by four different methods. wavelength selected by _Bw_ from the pixel-wise full spectra was extracted. Fourthly, the _Bw_-PLSR model expressed as Equation (2) was applied to predict the SO\({}_{2}\) residual content of each pixel, and the predicted pixels were formed as a prediction map. The prediction map of a hyperspectral image of the samples fumigated by 10 g sulfur per 500 g samples is shown in Figure 5. The prediction map was acquired on a computer for less than two minutes with an Intel Core (TM) i7-6700 processor (3.40 GHZ), a NVIDIA GeForce GTX 750 Ti graphics cards and a 256 GB solid state disk. As shown in Figure 4, the distribution of SO\({}_{2}\) residual content in sulfur-fumigated _Fritillaria thunbergi_ Bulbus was non-uniform. The samples within the hyperspectral images showed the average measured SO\({}_{2}\) residual contents in the range of 1.1-3.464 g/kg, and it could be found that most of the predicted SO\({}_{2}\) residual contents were in the measured range, indicating the efficiency of the prediction map. The distribution of SO\({}_{2}\) residual content could be directly visualized from the prediction map. In fact, it was difficult to measure the actual SO\({}_{2}\) residual contents of each pixel; thus, the accuracy of the prediction map now evaluated by the theoretical distribution and the average prediction value of the samples. The calibration model was essential in image visualization, a representative, robust, and accurate model was needed to ensure the prediction performance. The prediction maps showed that HSI combined with the chemometric methods could be used to detect and visualize SO\({}_{2}\) residual content in _Fritillaria thunbergi_ Bulbus, providing a new method for online visualization and monitor of the quality of _Fritillaria thunbergi_ Bulbus and other Chinese medicines. However, the disadvantage of HSI to detect residual SO\({}_{2}\) in _Fritillaria thunbergi_ Bulbus could be attributed to the high cost of the instruments, and establishment and maintenance of the calibration models. The cost of the instruments would decrease with the development of HSI-related manufacturing techniques. Establishment and maintenance of calibration models is essential in practical application. The calibration models should be accurate and robust, and maintenance of calibration models to cover more features of the unknown samples would enhance the prediction accuracy and model applicability.