# Non-destructive Detection of the pH Value of Cold Fresh Pork Using Hyperspectral Imaging Technique

Shanmei Liu, Ruifang Zhai, Hui Peng

► To cite this version:

Shanmei Liu, Ruifang Zhai, Hui Peng. Non-destructive Detection of the pH Value of Cold Fresh Pork Using Hyperspectral Imaging Technique. 9th International Conference on Computer and Computing Technologies in Agriculture (CCTA), Sep 2015, Beijing, China. pp.266-274, 10.1007/978-3-319-48357-3_26. hal-01557834

HAL Id: hal-01557834

https://inria.hal.science/hal-01557834

Submitted on 6 Jul 2017

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Non-destructive Detection of the pH Value of Cold Fresh Pork Using Hyperspectral Imaging Technique

Shanmei Liu¹,ᵃ,*, Ruifang Zhai¹,ᵇ, Hui Peng¹,ᶜ

¹College of Informatics, Huazhong agricultural University, Wuhan 430070, China;
ªlsmei@mail.hzau.edu.cn, ᵇzhairuifang@mail.hzau.edu.cn, ᶜmoonbird@mail.hzau.edu.cn

**Abstract.** In this paper, the pH value of cold fresh pork was non-destructively detected based on hyperspectral imaging (HSI) technique, and some useful data processing methods were discussed. After some sample set partition methods, some spectral pretreatment methods, and some optimum wavelength selection methods were compared respectively, the most suitable data processing method was chosen and the robust hyperspectral model for predicting the pH value of cold fresh pork was established. The results indicated that the pH value hyperspectral model of cold fresh pork established by using the whole wavelengths after the sample set was divided by using concentration gradient (CG) algorithm, and the spectral data was pretreated by using normalization combined with mean center(MC) had the best prediction abilities, with the determination coefficients $R_{cv}^2$ equaled to 0.768, $R_p^2$ equaled to 0.694, RMSECV equaled to 0.1113, and RMSEP equaled to 0.1204. The results also indicated that the model established by using the characteristic wavelengths which were selected by using CARS algorithm had better prediction abilities, with $R_{cv}^2$ equaled to 0.8581, $R_p^2$ equaled to 0.8668, RMSECV equaled to 0.0858, and RMSEP equaled to 0.0772. All the results showed that suitable data processing methods was advantageous to the prediction ability of the model, and that HSI technique can be utilized to measure the pH value of cold fresh pork in a rapid and non-destructive way.

**Keywords:** cold fresh pork, pH value, hyperspectral imaging technique, data processing

## 1 Introduction

Pork is one of China's staple meats. In recent years more and more people have shown increasing concern with pork quality and safety. So some reliable, quick and non-destructive detection methods for pork quality control become more and more important. However, traditional pork quality detection methods mostly depend on physical or chemical analysis, sensory evaluation which are not conductive to rapid detection of pork products in circulation. As one of the important evaluation indexes of pork quality, the pH value is closely associated with meat's color [1, 2], water-holding, tenderness [3], shelf life [4], soluble protein concentration, after-cooking flavor [5], and some other quality attribute properties [6]. The pH value of cold fresh pork is generally measured by utilizing the pH meter, which is time consuming,
unsuitable and invasive when large amounts of samples are measured [7]. So it is
essential to develop a rapid and accurate technique for pork pH value detection.
Recently, hyperspectral imaging technology provides an alternative methodology in
agricultural and livestock product (pork, beef and some other meats) nondestructive
detection field. Some works that adopt HSI for evaluating the quality of meat
characteristics, such as tenderness, water-holding, and marbling level, have been done
[8,9, 10,11,12,13,14,15,16]. However, only a few studies have been reported that
focus on the use of HSI for evaluating the pH value of cold fresh pork. In this study,
the HSI technique was tried to detect the pH value of cold fresh pork by a non-
destructive way. Furthermore, some data processing methods were discussed to find
out the most suitable one, and then improve the prediction ability of the model of pH
value. After discussing the sample set partition methods and spectral pretreatment
methods, a quantitative PLSR prediction model is built with the whole wavelengths.
Furthermore, the characteristic wavelengths are selected by utilizing competitive
adaptive re-weighted algorithm, after which a new PLSR model is established by
using the characteristic wavelengths.

## 2 Experiments and Methods

### 2.1 Experimental samples

A total of 161 samples of cold fresh pork were collected from several local supermarkets in Wuhan, Hubei, China. The samples came from 79 No.0 indigenous pigs and 82 Enshi mountain pigs. Each sample was taken from the back of an individual pig with the size of 6 cm × 6 cm × 3 cm.

### 2.2 Experimental equipment

The HSI system used in this study was the HyperSIS HSI system developed by Beijing Zhuo Li Han Guang Instrument Co.Ltd. The HSI system is mainly made up of a hyperspectral imager, a CCD camera with an objective lens, an illumination source, a sample mobile station, and a computer which had software SpectraSENS to acquire images and control the camera.
The main experimental instruments and equipment required in measuring the reference pH value of cold fresh pork included a laboratory pH meter (FE20) developed by the Swiss company Mettler- Toledo, meat grinder, beaker, and others.

### 2.3 Acquisition of hyperspectral data

Thirty minutes before the experiment, the HSI system was turned on for preheating to ensure a stable performance. The hyperspectral data acquisition software SpectraSENS in the computer was opened for parameter settings. In this experiment, the CCD parameter settings were as follows: image size of 1392 × 500 pixels, wavelength range of 391~1100 nm, Bining X and Bining Y values of 2, and exposure
time of 0.1ns. The motor parameter settings were as follows: the scanning rate of 40
nm/s, scanning distance started at 80 nm and ended at 220nm. At last, the focal length
of the CCD camera was regulated.

Before hyperspectral data acquisition, black and white calibration was conducted to remove the influence of black and white background on the hyperspectral images. The black calibration image was acquired after all the lights were switched off and the len of the CCD camera was covered, and the white image was obtained by using a white tile. The black calibration image and white calibration image were imported into the software SpectraSENS, which would automatically complete the black and white calibration of the hyperspectral images acquired by the HyperSIS HSI system and output the calibrated hyperspectral images of the measured samples.

## 2.4 Measurement of the pH value

After hyperspectral data acquisition, the reference pH value of each sample of cold fresh pork was measured on the basis of the Chinese agriculture industry standard NY/T 821-2004 [17]. First, each sample was minced and divided into four copies of solution. The pH values of the cold fresh pork were measured by a lab pH meter (FE20), and the mean value was calculated and considered the reference pH value of the sample. The statistical results of the reference pH values of the 161 pork samples are as follows: the minimum of 5.2400, the maximum of 6.4100, the mean of 5.5861, and the standard deviation of 0.2221.

## 2.5 Data processing methods

Data processing in this study mainly included spectral extraction, outlier detection, sample set division, spectral pretreatment, model establishment, and optimum wavelength selection. Spectral extraction was completed in ENVI4.7, and the remaining steps were performed in MATLAB R2010a.

The average spectrum of every sample was calculated and considered as the spectrum of this sample. The average spectrum of every pork sample was extracted from the region of interest (ROI) selected by the polygon tool in ENVI4.7. Through the polygon tool, the edges and seriously reflective regions of the sample were efficiently excluded from the ROI. The extracted spectral data from the cold fresh pork samples were put in a matrix named X (161 rows, 520 columns), where the rows represent 161 pork samples and the columns represent 520 wavelengths.

After spectral extraction, the Monte Carlo sampling algorithm(MCS) [18] was utilized for outlier detection. Several methods of sample set partition, such as Kennard-Stone(KS) [19], sample set partitioning based on joint X-Y distances(SPXY)[20], random sampling (RS), duplex, CG, were utilized to divide the sample set of cold fresh pork into the calibration and test sets. The most appropriate sample set partition method was determined based on the statistical results of the calibration and test sets obtained by different methods.

Mean centering(MC) can significantly improve the performance of the PLSR model. Thus, this method should generally always be used. The spectra of the samples of cold fresh pork were processed by several spectral preprocessing methods: MC, autoscale (AS), multiplicative scattering correction (MSC) combined with MC,
standard normalized variate (SNV) combined with MC, first derivative (FD) combined with MC, second derivative (SD) combined with MC, orthogonal signal correction (OSC) combined with MC, and normalization combined with MC. The PLSR models were then established using the whole wavelengths, and the most suitable spectral preprocessing method was determined based on the performance parameters of the PLSR models.

Hyperspectral data has large amount of redundant information because some different wavelengths have the same spectral information, which will cause some adverse effects on the prediction accuracy and speed of the hyperspectral model. Some characteristic wavelength selection algorithm can solve this problem well. In this paper, the competitive adaptive reweighted sampling algorithm [21], which has remarkable ability in selecting characteristic wavelengths, was utilized to select the characteristic wavelengths of the pH value of cold fresh pork. A new model (CARS-PLSR) was established with the selected optimum wavelengths.

## 2.6 Model performance parameters

Model performance was evaluated by utilizing leave one out validation with four parameters ($R_{cv}^2$, $R_p^2$, RMSECV, RMSEP). The values of $R_{cv}^2$ and $R_p^2$ are larger, and the values of RMSECV and RMSEP are lower. Hence, the performance of the corresponding model is better.

# 3 Results and Discussions

## 3.1 Spectral profiles

The spectra which were obtained from the hyperspectral images of the 161 samples of cold fresh pork are shown in Fig.1.

<figure><img src="image_2.png" /><figcaption>Fig. 1. Reflectance spectra of the samples of cold fresh pork</figcaption></figure>

## 3.2 Outliers of pork samples

The outliers of the sample set of cold fresh pork were detected by MCS method, and the results are presented in Fig.2.
<figure><img src="image_3.png" /><figcaption>Fig. 2. Results of the outlier detection by MCS</figcaption></figure>

Fig.2 indicates that sample no.82 and sample no.152 were outliers. After deleting the two outliers, the remaining 159 normal samples were used for subsequent analysis.

### 3.3 Selection of the sample set partition method

The statistical results of the calibration set (120 samples) and test set (39 samples) obtained by KS, SPXY, RS, duplex, and CG are shown in Table 1.

<table><caption>Table 1. Statistical results for the pH values of cold fresh pork</caption><thead><tr><th rowspan="2">Sample partition method</th><th colspan="3">The calibration set</th><th colspan="3">The test set</th></tr><tr><th>Range</th><th>Mean</th><th>Standard deviation</th><th>Range</th><th>Mean</th><th>Standard deviation</th></tr></thead><tbody><tr><td>KS</td><td>5.2425-6.4100</td><td>5.5885</td><td>0.2245</td><td>5.2400-6.2100</td><td>5.5713</td><td>0.2166</td></tr><tr><td>SPXY</td><td>5.2400-6.4100</td><td>5.5997</td><td>0.2372</td><td>5.2825-6.0375</td><td>5.5367</td><td>0.1605</td></tr><tr><td>RS</td><td>5.2400-6.4100</td><td>5.5818</td><td>0.2272</td><td>5.2425-6.2325</td><td>5.5918</td><td>0.2079</td></tr><tr><td>Duplex</td><td>5.2400-6.4100</td><td>5.5727</td><td>0.2053</td><td>5.2950-6.3525</td><td>5.6199</td><td>0.2670</td></tr><tr><td>CG</td><td>5.2400-6.4100</td><td>5.5863</td><td>0.2281</td><td>5.2825-6.2325</td><td>5.5779</td><td>0.2050</td></tr></tbody></table>

Table 1 indicates that the KS algorithm only included the maximum pH value into the calibration set, whereas SPXY, RS, duplex, and CG algorithm all integrated the minimum and maximum pH values into the calibration set. Thus, the pH value range of the test set obtained by SPXY, RS, duplex, and CG was within their corresponding calibration set only. Before the sample partition, the mean pH value of all the samples was determined to be 5.5861. Table 1 also indicates that the mean value of 5.5863 in the calibration set and the mean value of 5.5779 in the test set obtained by CG were the closest values to the mean value of 5.5861 of all the samples. In other words, the calibration and test sets obtained by the CG algorithm were well-distributed. Hence, the CG algorithm was determined to be the most suitable sample set partition method in this study.

### 3.4 PLSR models using the whole wavelengths

The PLSR models were established using the whole wavelengths after preprocessing the spectra using different methods, the results are presented in Table 2.
<table><caption>**Table 2.** Results of PLSR models built by using the whole wavelengths after different spectral pre-treatments</caption><thead><tr><th>Spectral pretreatment method</th><th>Principal component numbers</th><th>R<sub>cv</sub><sup>2</sup></th><th>RMSECV</th><th>R<sub>p</sub><sup>2</sup></th><th>RMSEP</th></tr></thead><tbody><tr><td>MC</td><td>20</td><td>0.7417</td><td>0.1184</td><td>0.6809</td><td>0.1286</td></tr><tr><td>AS</td><td>20</td><td>0.7311</td><td>0.1208</td><td>0.6788</td><td>0.1269</td></tr><tr><td>MSC+MC</td><td>18</td><td>0.7549</td><td>0.1148</td><td>0.6685</td><td>0.1235</td></tr><tr><td>SNV+MC</td><td>19</td><td>0.7488</td><td>0.1161</td><td>0.6802</td><td>0.1278</td></tr><tr><td>FD+MC</td><td>20</td><td>0.7606</td><td>0.1130</td><td>0.5772</td><td>0.1442</td></tr><tr><td>SD+MC</td><td>20</td><td>0.6969</td><td>0.1274</td><td>0.5809</td><td>0.1492</td></tr><tr><td>OSC+MC</td><td>20</td><td>0.7445</td><td>0.1186</td><td>0.6810</td><td>0.1315</td></tr><tr><td>Normalization+MC</td><td>18</td><td><strong>0.7680</strong></td><td><strong>0.1113</strong></td><td><strong>0.6940</strong></td><td><strong>0.1204</strong></td></tr></tbody></table>

Table 2 indicates that, after the spectra were preprocessed by normalization combined with MC, the performance of the pH value PLSR model built using the whole wavelengths was optimal, with $R_{cv}^2$ equaled to 0.7680 and $R_p^2$ equaled to 0.6940, which were the maximum values, RMSECV equaled to 0.1113 and RMSEP equaled to 0.1204, which were the minimum values. Thus, normalization combined with MC was determined to be the most suitable spectral preprocessing method when the PLSR model for predicting the pH value of cold fresh pork was established using the whole wavelengths.

### 3.5 Selection of optimum wavelengths

By CARS algorithm, 35 optimum wavelengths closely related to the pH value of cold fresh pork, were selected. The distribution of the characteristic wavelengths is presented in Fig.3.

<figure><img src="image_4.png" /><figcaption>**Fig.3.** Distribution of the characteristic wavelengths selected by CARS</figcaption></figure>

### 3.6 PLSR models using optimum wavelengths

New PLSR models were built by using the characteristic wavelengths after the spectra were preprocessed by different methods. The results are shown in Table 3.
<table><caption>**Table 3.** Results of the PLSR models built by using the selected wavelengths after different spectral pre-treatments</caption><thead><tr><th>Spectral pretreatment method</th><th>Principal component numbers</th><th>R<sub>cv</sub><sup>2</sup></th><th>RMSECV</th><th>R<sub>p</sub><sup>2</sup></th><th>RMSEP</th></tr></thead><tbody><tr><td>none</td><td>20</td><td>0.8434</td><td>0.0905</td><td>0.8281</td><td>0.0946</td></tr><tr><td><strong>MC</strong></td><td><strong>18</strong></td><td><strong>0.8581</strong></td><td><strong>0.0858</strong></td><td><strong>0.8668</strong></td><td><strong>0.0772</strong></td></tr><tr><td>AS</td><td>19</td><td>0.8553</td><td>0.0868</td><td>0.8798</td><td>0.0727</td></tr><tr><td>MSC+MC</td><td>20</td><td>0.8276</td><td>0.0948</td><td>0.8328</td><td>0.0858</td></tr><tr><td>SNV+MC</td><td>20</td><td>0.8230</td><td>0.0961</td><td>0.8316</td><td>0.0859</td></tr><tr><td>OSC+MC</td><td>17</td><td>0.8563</td><td>0.0865</td><td>0.8427</td><td>0.0855</td></tr><tr><td>Normalization+MC</td><td>20</td><td>0.8557</td><td>0.0868</td><td>0.8395</td><td>0.0866</td></tr></tbody></table>

Table 3 clearly indicates that, after the spectra were preprocessed by MC, the new PLSR model built by using the characteristic wavelengths had very good prediction ability, with $R_{cv}^2$ equaled to 0.8581, $R_p^2$ equaled to 0.8668, RMSECV equaled to 0.0858, and RMSEP equaled to 0.0772. Table 2 and Table 3 also show that, better results were achieved by the new PLSR model than by the PLSR model built using the whole wavelengths. Moreover, more than 93% of the wavelengths were eliminated (i.e., 35 vs. 520). The prediction ability of the new PLSR model and the number of characteristic wavelengths all indicated that the CARS algorithm was efficient in selecting the optimum wavelength in this study.

## 4 Conclusions

In this study, the pH value of cold fresh pork was non-destructively detected based on hyperspectral imaging (HSI) technique, and some useful data processing methods were discussed. The PLSR prediction model was built by using the whole wavelengths and the characteristic wavelengths, respectively. Different methods of sample set division and spectral preprocessing were compared. The CG algorithm was determined to be the most suitable method of sample set division for cold fresh pork samples, and normalization combined with MC method was identified as the optimal spectral preprocessing method for the PLSR model established using the whole wavelengths, which resulted in $R_{cv}^2$ equaled to 0.7680, $R_p^2$ equaled to 0.6940, RMSECV equaled to 0.1113, and RMSEP equaled to 0.1204. The characteristic wavelengths were selected by using CARS method to improve the performance of the PLSR model. Out of 520 wavelengths, only 35 optimum wavelengths were considered in developing a new PLSR prediction model, which performed effectively, with $R_{cv}^2$ equaled to 0.8581, $R_p^2$ equaled to 0.8668, and RMSECV equaled to 0.0858, and RMSEP equaled to 0.0772, after preprocessing the spectra by MC. The overall results indicated that suitable data processing method can effectively improve the performance of the PLSR model for predicting the pH value of cold fresh pork and the HSI technique is a powerful method for non-destructive detection of the pH value of cold fresh pork.
Acknowledgment

Fund for this research was provided by the project 2662015QC024 supported by
the Fundamental Research funds for the Central Universities.

References

1. Brewer M S, Novakofski J, Freise K. Instrumental Evaluation of pH Effects on Ability of Pork Chops to Bloom.[J]. Meat Science, 2006, 72(4):596-602.

2. Andrews B S, Hutchison S, Unruh J A, et al. Influence of pH At 24H Postmortem on Quality Characteristics of Pork Loins Aged 45 Days Postmortem[J]. Journal of Muscle Foods, 2007, volume 18(4):401-419(19).

3. van Laack R L, Stevens S G, Stalder K J.. The Influence of Ultimate pH and Intramuscular Fat Content on Pork Tenderness and Tenderization.[J]. Journal of Animal Science, 2001, 79(2):392-397.

4. Knox B L, Van Laack R L J M, Davidson P M. Relationships between Ultimate pH and Microbial, Chemical, and Physical Characteristics of Vacuum-Packaged Pork Loins.[J]. Journal of Food Science, 2008, 73(3):M104-M110.

5. Bryhni E A, Byrne D V, Rodbotten M, et al. Consumer and Sensory Investigations in Relation to Physical/Chemical Aspects of Cooked Pork in Scandinavia.[J]. Meat Science, 2003, 65(2):737-748.

6. Liao Yitao, Fan Yuxia, Wu Xueqian, et al. Online Determination of pH in Fresh Pork by Visible/Near-Infrared Spectroscopy[J]. Guang Pu Xue Yu Guang Pu Fen Xi, 2010, 30(3):681-684(4).

7. He H J., Wu D, Sun D W. Application of hyperspectral imaging technique for non-destructive pH prediction in salmon fillets. Proceedings of the 3rd CIGR International Conference of Agricultural Engineering (CIGR-AgEng2012) (Valencia, Spain).

8. Naganathan G K, Grimes L M, Subbiah J, et al. Visible/near-infrared hyperspectral imaging for beef tenderness prediction[J]. Computers & Electronics in Agriculture, 2008, 64(2):225-233.

9. Naganathan G K, Grimes L M, Subbiah J, et al. Partial Least Squares Analysis of Near-Infrared Hyperspectral Images for Beef Tenderness Prediction[J]. Sensing & Instrumentation for Food Quality & Safety, 2008, 2(3):178-188.

10. Elmasry G, Sun D W, Allen P. Non-destructive Determination of Water-holding Capacity in Fresh Beef by Using NIR Hyperspectral Imaging[J]. Food Research International, 2011, 44(9):2624-2633.

11. Elmasry G, Sun D W, Allen P. Near-infrared Hyperspectral Imaging for Predicting Colour, pH and Tenderness of Fresh Beef[J]. Journal of Food Engineering, 2012, 110(1):127-140.

12. Kamruzzaman M, ElMasry G, Sun D W, et al. Prediction of Some Quality Attributes of Lamb Meat Using Near-infrared Hyperspectral Imaging and Multivariate Analysis [J]. Analytica Chimica Acta, 2012, 714(3):57-67.

13. Qiao J, Wang N, Ngadi M O, et al. Prediction of Drip-loss, pH, and Color for Pork Using a Hyperspectral Imaging Technique [J]. Meat Science, 2007, 76(1):1-8.

14 Qiao J, Ngadi M O, Wang N, et al. Pork Quality and Marbling Level Assessment Using a Hyperspectral Imaging System[J]. Journal of Food Engineering, 2007, 83(1):10-16.

15. Peng Yankun, Zhang Jing, Wang Wei, et al. Potential Prediction of the Microbial Spoilage of Beef Using Spatially Resolved Hyperspectral Scattering Profiles[J]. Journal of Food Engineering, 2011, 102(2):163-169.
16. Tao Feifei, Peng Yankun, Li Yongyu, et al. Simultaneous Determination of Tenderness and Escherichia Coli Contamination of Pork Using Hyperspectral Scattering Technique.[J]. Meat Science, 2012, 90(3):851-857.

17.NY/T 821-2004.Agriculture standard: technical specification for determination of meat quality of pigs.

18. Cao Dongsheng, Liang Yizeng, Xu Qingsong, et al. A New Strategy of Outlier Detection for QSAR/QSPR.[J]. Journal of Computational Chemistry, 2010, 31(3):592-602.

19. Wu W, Walczak B, Massart D L, et al. Artificial Neural Networks in Classification of NIR Spectral Data: Design of the Training Set[J]. Chemometrics & Intelligent Laboratory Systems, 1996, 33(95):35-46.

20. Galvao R K H, Araujo M C U, Jose G E, et al. A Method for Calibration and Validation Subset Partitioning [J]. Talanta, 2005, 67(4):736-740.

21. Li Hongdong, Liang Yizeng, Xu Qingsong, et al. Key Wavelengths Screening Using Competitive Adaptive Reweighted Sampling Method for Multivariate Calibration.[J]. Analytica Chimica Acta, 2009, 648(1):77-84.