*2.5. Hyperspectral Image Acquisition and ROI Selection*

Images of shrimp were acquired using a pushbroom HSI system in the reflectance mode. The system consisted of 4 components: a charge-coupled device (CCD) camera (FX 10, Specim Ltd., Helsinki, Finland) with a resolution of 1024 pixels in the spatial dimension and 224 bands in the spectral dimension, hyperspectral imaging workstation with a spectral range of 400–1000 nm, 2 halogen lamps, and computer with hyperspectral image analysis software. The spectral resolution was 5.5 nm, and the imaging speed of full band acquisition was 330 Frames Per Second (FPS). Before the experiment, the instrument was preheated for 30 min to ensure its stability. The samples were placed on a mobile platform for image acquisition. To prevent image oversaturation, it was necessary to set the speed of the moving platform, camera exposure time, and acquisition distance in advance; after repeated testing, these three parameters were set to 7.5 mm/s, 50 ms, and 30 cm, respectively. Simultaneously, black and white correction of the acquired hyperspectral image was conducted to reduce the influence of the dark current of the CCD camera and uneven brightness of the light source. The correction formula is given by:

$$R = \frac{R\_{\rm co} - R\_{\rm d}}{R\_{\rm w} - R\_{\rm d}} \tag{2}$$

where *R*o represents the original spectral image, *R*w represents the whiteboard image, and *R*<sup>d</sup> represents the darkfield image.

ROI spectral extraction of the hyperspectral image was performed using ENVI 5.2 software (Exelis Visual Information Solutions Co., Boulder, CO, USA). All pixels, except those corresponding to the shrimp head and tail, were selected to contain as much information as possible about the sample. As the collected spectral images were clear in all bands, the entire spectral range with 224 bands was retained for analysis.

#### *2.6. Spectral Pre-Processing and Optimal Wavelengths Selection*

Spectral preprocessing involves the use of appropriate mathematical analyses to correct random noise in the spectra and light scattering generated by the instruments, which is helpful for highlighting valuable spectral information [28]. In current work, Savitzky–Golay smoothing and standard normal variable transformation (SNV) method were employed to remove the interference information from the spectra. Meanwhile, among the collected spectral information, the spectral data of certain bands could be explained or replaced by those of other bands. This situation caused a large amount of redundant information in the spectrum. Owing to the existence of redundant information, the prediction accuracy of the established model decreased; as the computational burden increased, the computational speed decreased. To overcome these problems, it was important to select a small set of optimal wavelengths that reflected the changes in quality to establish the model. The competitive adaptive reweighting sampling (CARS) method was used to select the optimal wavelengths in this study.
