Abstract:Abstract: For detecting the quality of pork, traditional optical equipment has high accuracy, whereas heavy weight, large size and high price make it difficult to use widely. The purpose of this research was to develop a portable optical device for detecting pork quality based on visible/near infrared spectroscopy and embedded system. This paper mainly explained the models building and the development of application software. Firstly, a compact and flexible system was made. Halogen lamp is as light source. To adapt to various complex environments, its hand-held probe can form black room on the surface of pork. Micro spectrometer (USB4000) receives and measures reflected light. ARM (advanced RISC machines) processor controls all parts in device and analyzes spectrum data. Based on Linux embedded operation system, liquid crystal display (LCD) touch screen interfaces with users. The whole weight of 3.5 kg makes it convenient for users. Secondly, collect the spectrum reflected from pork samples and build the partial least squares regression (PLSR) model. Before these, spectrometer parameters should be set, so that it works under the best conditions. Integration time of USB4000 was set to 7 ms, pixel boxcar width zero. Thus the reflection intensity of standard white plate was about 80% of spectrometer scale span. During experiment, after acquiring white and black spectrum data, detection probe was put on the surface of pork samples. Spectrum data in the wavelength range from 400 to 1 000 nm were collected from the surfaces of 39 pork samples, 29 spectra of which were as calibration, while others as validation. The acquired spectrum data were then processed by standard normalized variables (SNV) and Savitzky-Golay filter (S-G) to eliminate the spectra noise. After collecting the spectrum data, reference pH values of pork samples were immediately tested by pH meter (METTLER TOLEDO FE20, Switzerland), and color parameters (L*, a*, b*) were measured by precision colorimeter (HP-200, Shanghai, China). The partial least squares regression (PLSR) was applied to establish the prediction models. Experiment results showed that prediction correlation coefficients of pH value, L*, a* and b* were 0.94, 0.98, 0.95 and 0.85, and standard deviations of pH value, L*, a* and b* were 0.17, 1.19, 0.42 and 0.61, respectively. Thirdly, application software was designed and developed for detecting the quality of pork. It consisted of spectrometer control unit, spectrum data acquisition unit, spectrum analysis unit, and displaying and saving unit for prediction result of pork quality. Particularly, in spectrometer control unit, all parameters of USB4000 were set as the same as those when building the PLSR models. The coefficients matrixes of models were loaded into pork quality detection software in spectrum analysis unit. After debugged, the application program detecting the quality of pork was cross-compiled, and downloaded into the device. Finally, the accuracy of models were tested. The reflect spectra of external 41 pork samples were collected and analyzed with the device. At the same time, the real values of these samples' pH, L*, a* and b* were measured. For the pH value, the prediction model could give satisfactory results with the correlation coefficient (Rv) of 0.88 and the standard error of prediction (SEP) of 0.19. For the color L*, a* and b*, the prediction models could gain prediction results with the Rv of 0.90, 0.97 and 0.97, and the SEP of 1.77, 1.17 and 0.63, respectively. In conclusion, the field application results indicate that this portable device can satisfy the requirements of meat quality detection with high accuracy and good performance.