Abstract: Near-infrared spectroscopy (NIRS) has been widely applied to quality assessment for various products. The recent breakthrough in the miniaturization of NIR sensors allows users to scan samples onsite and get results in seconds, making the technology suitable for mobile sensing and IoT applications. However, external factors, such as temperature, humidity, and illumination, can affect the sensor response and the samples, leading to distorted spectra. This causes a domain shift problem in statistical learning algorithms where the spectra collected from one environment may have a different distribution from the spectra collected from another environment. As a result, the performance of the pretrained model can be severely degraded when the operating environment differs significantly from the training one. Existing works suggest fine-tuning the pretrained model using the spectra of reference samples collected from the target environment. Although the number of samples required for model fine-tuning is usually much smaller than that required for model pretraining, it is still impractical to ask users to always carry many reference samples in mobile sensing scenarios. This article presents the NIRWatchdog to address the cross-domain issue of NIRS-based mobile sensing tasks. The proposed approach provides much flexibility and practicality as the transfer data set can be automatically generated based on as few as one reference sample onsite. With only one reference sample, the area under the curve (AUC) of the NIRWatchdog is higher than 85% even when the target environment is considerably different from the training one. In comparison, the conventional approach needs more than 15 reference samples onsite to achieve a comparable performance under the same conditions.
Loading