Innovative Food Science and Emerging Technologies 11 (2010) 520–525
Contents lists available at ScienceDirect
Innovative Food Science and Emerging Technologies j o u r n a l h o m e p a g e : w w w. e l s ev i e r. c o m / l o c a t e / i f s e t
Pattern recognition of eggshell crack using PCA and LDA Yu Zhao, Jun Wang ⁎, Qiujun Lu, Ruise Jiang Department of Biosystems Engineering, Zhejiang University, 268 Kaixuan Road, Hangzhou 310029, PR China
a r t i c l e
i n f o
Article history: Received 22 November 2008 Accepted 23 December 2009 Editor Proof Receive Date 10 March 2010 Keywords: Egg Crack Detection LDA PCA
a b s t r a c t The eggshell crack was detected with dynamic frequency response and an egg was excited by a light mechanical impact on different locations of the eggshell. The dominant resonance frequency can be observed using flexible piezoelectric film sensors. The results showed that some frequencies were higher for the cracked eggs, whereas the dominant frequency value was lower for the intact eggs. In normalized power spectrum, the first 10 or 20 features were extracted based on interval frequency (IFM), maximum magnitudes in turn (HVM) and frequencies by magnitudes in turn (MVF), and were used as input of pattern recognition algorithms The pattern recognition was conducted by Principal Component Analysis (PCA) and Linear Discriminant Analysis (LDA). Intact egg and cracked egg could be distinguished by LDA and PCA using HVM and MVF. More distinguishing effects were obtained based on LDA using 10 MVFs. Industrial relevance: The examination of cracks on eggshell was usually conducted by floodlighting before, but it gives eye fatigue, makes misjudgment and is not easy to detect hairline crack. The acoustic impulse response method was suggested in this research to measure hairline crack for eggshell using flexible piezoelectric film sensors. The result was found that the acoustic impulse response method can distinguish between intact egg and cracked egg. This research provides a technology detection of cracked egg. © 2009 Elsevier Ltd. All rights reserved.
1. Introduction Recent researches on the detection of eggshell crack are mainly focused on the vibration-based response analysis. For instance, De Ketelaere, Coucke, and De Baerdemaeker (2000) analyzed the frequency pattern of acoustic signal by impact on the places around the equator and detected the cracks on eggshell. The crack detection level of 90% was possible by using the Pearson correlation coefficient as an evaluation factor from the impacts on four different locations around the egg equator. Cho, Choi, and Paek (2000) developed an inspection system to detect eggshell crack in an eggshell using acoustic impulse response method. The classification was conducted using minimum variables, which are average area of power spectrum, average y-coordinate of centroid, difference between the maximum and minimum values in the x-coordinate of centroid, difference in the y-coordinate of centroid, and average peak resonant frequency. Wang, Teng, and Yu (2004) and Wang and Jiang (2005) found that the magnitudes of the same peak frequencies of the cracked eggs were great, and the first dominant resonance frequency value was lower than that of intact eggs. Jindal and Sritham (2003a,b) developed an experimental inspection system to detect the cracks in eggshells. They found that the performance of crack detection accuracy was 98.7% based on the back propagation Artificial Neural Networks with three hidden slabs for the acoustic response of the eight impacts on the equator. ⁎ Corresponding author. Tel.: +86 571 86971881; fax: +86 571 86971139. E-mail address:
[email protected] (J. Wang). 1466-8564/$ – see front matter © 2009 Elsevier Ltd. All rights reserved. doi:10.1016/j.ifset.2009.12.003
The development of low-cost, lightweight, and flexible piezoelectric film sensors, reported by Shmulevich, Galili, and Rosenfeld (1996) and Galili, Shmulevich, and Benichou (1998), added new possibilities for dynamic testing of agricultural products. The measuring technique of fruit firmness with the piezoelectric film sensors has been found to be simple, fast, and repeatable (Gomez & Wang, 2005; Gomez, Wang, & Pereira, 2006; Wang, Ying, & Cheng, 2007). However, in the area of eggshell crack detection, there is little research using piezoelectric film sensors. And there is no report about pattern recognition analysis on response and spectrum signals of acoustic impulse response for eggshell cracks detection based on Principal Component Analysis (PCA) and Linear Discriminant Analysis (LDA). For the detection by acoustic impulse response method, the data analysis for resonant frequency is very important. Different data processes and analysis methods may lead to different distinguishing results. The objective of this research is to detect eggshell crack by the acoustic impulse response method, using flexible piezoelectric film sensors. Response frequency spectrums were obtained, and then pattern recognitions for eggshell crack were conducted using PCA and LDA. 2. Materials and methods 2.1. Experimental system and experimental procedure The experimental equipment was developed to detect the eggshell crack with dynamic frequency response. The equipment consisted of
Y. Zhao et al. / Innovative Food Science and Emerging Technologies 11 (2010) 520–525
an egg-bed with sensors (a polyvinylidene fluoride film, LDTO-028K, 0.001 Hz–1 GHz), a mechanical impulse device, signal amplifiers, a personal computer (PC) and machined egg-bed. The software was developed to control the experimental setup and analyze the results. A schematic diagram of the system is presented in Fig. 1. The egg tested was placed in a PVC-machined egg-bed with three piezoelectric sensors. Three sensors were placed by a flexible beam on the egg equator, the sharp side of the egg and the blunt side of the egg, respectively. The mechanical impulse device was composed of a pendulum at an angle of 0–90°, a 9.5 g wooden ball on extremely thin nylon string. The impact intensity does not affect the value of the dominant frequency and only affects the magnitude of the dominant frequency (Jiang, 2004; Wang, Jiang, & Yu, 2004). In order not to cause any damage to the eggshell, preliminary tests were performed. As a result, a peripheral velocity of 0.584 m/s was selected for the impulse device for all further tests. The egg response (propagating wave) was picked up by the piezoelectric sensor that was coupled through an amplifier and a commercial analogue-to-digital PC board (PCL-6250) to the PC, which simultaneously served as the data acquisition system. A self-trigger sensor was used to trigger the acquisition. The signal was sampled at a rate of 2,000,000 samples per second per sensor for a period of 20 ms. The MATLAB 5.3 computer program transformed the response from the time domain to the frequency domain by means of fast Fourier transform (FFT).
521
3. Response characteristics and extraction of feature 3.1. Response characteristics of intact egg and crack egg The eggs were impacted on the one equator side, and detected on the other equator side. The typical response signals in the time domain and the transformed frequency domain were shown in Fig. 2. It was shown that the response signal of crack egg differed from the one of intact egg. Some peak frequency could be acquired in Fig. 2b, for example, the first one was f1 (called as the first dominant frequency, the magnitude is greatest), the second peak was f2, the third peak was f3,…, in the frequency domain. For the intact eggs, there were some peak frequencies f1, f2, f3, …, the magnitude of f1 was obviously greater than the ones of f2 and f3, and the value of f1 frequency was lower in the frequency domain. Oppositely, for the cracked eggs, the values of f1, f2, f3, …, frequency were higher, the magnitudes of f1, f2, f3… were approximate and greater. Similar results were found by Cho et al. (2000) and De Ketelaere et al. (2000). The intact eggs and the crack eggs were impacted on the equator, and detected on the blunt side and on the sharp side, respectively, similar results could be found and the figures were omitted. 3.2. Average value of normalized power spectral amplitude The frequency domain was suggested as a major variable for crack detection, and the detection was usually conducted for crack egg
2.2. Egg samples Egg samples were newly laid eggs collected from Hangzhou Hennery, China, October 5, 2007. The weight of samples varied from 51.1 g to 63.4 g, and their density varied from 0.98 g/cm3 to 1.19 g/cm3. 60 eggs were artificially inflicted as hairline crack eggs (crack at equator) and 60 intact eggs were used for the experiment (a total 120 eggs).
2.3. Principal Component Analysis and Linear Discriminant Analysis The measurement data were analyzed by Principal Component Analysis and Linear Discriminant Analysis. Principal Component Analysis (PCA) and Linear Discriminant Analysis (LDA) were performed. Using the PCA, the measurement data, previously trained, will be transformed into two-dimensional (2D) ordinates. This is carried out through the data reduction that extracts the most important information from the database as a result. PCA is based on a linear project of multidimensional data into different coordinates based on maximum variance and minimum correlation. Linear Discriminant Analysis (LDA) is one of the most used classification procedures. The method maximizes the variance between categories and minimizes the variance within categories. It merely looks for a sensible rule to discriminate between them by forming linear functions of the data maximizing the ratio of the between-group sum of squares to the within-group sum of squares.
Fig. 1. Schematic diagram of the detection system.
Fig. 2. Typical time signal and frequency signal of response of egg (54.4 g, 1.17 g/cm3). a. Time signal. b. Frequency signal of response.
522
Y. Zhao et al. / Innovative Food Science and Emerging Technologies 11 (2010) 520–525
under similar egg characteristics. However, the magnitude in the frequency domain was always affected by impacting intensity and some physical parameters, including egg's size, shape index, the shell stiffness, and so on (Jiang, 2004; Wang et al., 2004). So a variable of normalization average of the frequency domain was constructed based on the analysis of frequency domain (Eq. (1)). P1 =
P Pmax
ð1Þ
Where: P1 P Pmax
Normalization magnitude of frequency domain from 0 to 7500 HZ Magnitude of frequency domain from 0 to 7500 HZ Maximum magnitude of frequency domain from 0 to 7500 HZ
3.3. Extraction of feature In this paper, the tested egg was impacted on equator and detected on the blunt side, the sharp side and the other equator side. 3.3.1. Extraction of feature (magnitude) by interval frequency (IFM) The magnitudes (P1) of normalized frequency domain were taken out by step of interval frequency 750 Hz (IFM), from Fig. 2b. 10 magnitudes (750 Hz, 1500 Hz, 2250 Hz, …, …7500 Hz) were extracted as features and used as input of pattern recognition algorithms at each detected point. So, there were 30 features (magnitude) of frequency domain for the three detected points. Similarly, the magnitudes of normalized frequency domain (IFM) were taken out in step of 375 Hz, there were 20 magnitudes in normalized frequency domain extracted as feature for detecting eggshell crack. And there were 60 features all together for three detected points. 3.3.2. Extraction of feature (magnitude) by magnitude value in turn (HVM) In the magnitudes (P1) of normalized frequency domain, after the highest magnitude value (HVM) was taken out, the second highest magnitude was taken out, then the third, and so on, till the tenth magnitude was taken out (from the high magnitude to the low
magnitude, HVM). These anterior ten normalized magnitudes (P1) were taken as features and used as input of pattern recognition algorithms for detecting eggshell crack. So there were 30 features in normalized frequency domain for the three detected points. Similarly, from the high magnitude to the low magnitude, 20 normalized magnitudes (HVMs) from frequency domain were taken as features, and there were 60 features in the three detected points. 3.3.3. Extraction of feature (frequency) from frequency value in turn (MVF) In the normalized frequency domain, the first one was f1 (the frequency with the highest magnitude value), the second peak f2, the third peak f3 … were found in frequency domain (MVF). Anterior 10 frequencies were taken as features from high magnitude to low magnitude. There were 30 features in normalized frequency domain for the three detected points. These features were used to detect eggshell crack. In the same way, 20 features were taken out. So there were 60 features (MVFs) in the three points all together. 4. Results and discussion Pattern recognition was conducted by PCA and LDA using IFM, HVM and MVF as features, respectively. The results were shown in Figs. 3–8. It was shown that the sum of the analyzed value (PC1 or LD1) of the first principal and second principal (PC2 or LD2) were up to 85% and this implied that the analyzed figures were helpful for detection. 4.1. Analysis of feature (magnitude) by interval frequency (IFM) The discriminations for eggshell crack by PCA and LDA using 10 IFMs were shown in Fig. 3. The areas of intact egg and the one of crack egg were overlapped by PCA in Fig. 3a, and PCA could not discriminate crack egg from intact egg. It was also shown that LDA was not useful in detecting crack egg in Fig. 3b. The discriminations for eggshell crack by PCA and LDA, respectively, using 20 IFMs were shown in Fig. 4. Both methods could not discriminate crack egg from intact egg. Comparing Fig. 4 with Fig. 3, more distinguishing effect was obtained using 10 features than 20 features. There were the obvious differences between intact and crack eggs in the low frequency range (0–2500 Hz, Fig. 2b) in the frequency
Fig. 3. Discrimination for crack or intact egg based on 10 IFMs.
Y. Zhao et al. / Innovative Food Science and Emerging Technologies 11 (2010) 520–525
523
Fig. 4. Discrimination for crack or intact egg using 20 IFMs.
domain, not in the middle frequency range (2500–5000 Hz) and the high frequency range (5000–7500 Hz). In 20 IFMs, the increase of features in the middle and high frequency ranges was more than in low frequency range. This may lead to the worse result of discrimination by PCA and LDA using 20 IFMs than using 10 IFMs. These results agreed also with the findings of Cho et al. (2000) and De Ketelaere et al. (2000), the amplitude of acoustic signals was considered as an evaluation criterion, is not enough potential for classification of eggshell cracks. Jindal and Sritham (2003a,b) found also that amplitude of acoustic signals could not be used in Artificial Neural Networks for eggshell cracks. 4.2. Analysis of feature (magnitude) by magnitude value in turn (HVM) The discriminations for eggshell crack by PCA and LDA, respectively, using 10 HVMs were shown in Fig. 5. Both PCA and LDA can discriminate crack eggs from intact eggs, and the result by LDA was better than by PCA. Comparing Fig. 5 with Fig. 3, it was noted that the
method of extracting 10 features from the high magnitude to the low magnitude in turn (HVM) is better than the method of extracting 10 features by interval frequency (IFM). The discriminations for eggshell crack by PCA and LDA, respectively, using 20 HVMs were shown in Fig. 6. Though the areas of intact and crack eggs are overlapped by PCA, there was a tendency of discrimination (Fig. 6). It was also shown that intact and crack eggs can be discriminated by LDA (Fig. 6). Comparing Fig. 5 with Fig. 6, the result of discrimination using 10 HVMs was better than using 20 HVMs. It was shown in Fig. 2 that the magnitude of intact egg was obviously higher in the low frequency range (0–2500 Hz) and relatively lower in the middle (2500–5000 Hz) and the high frequency ranges (5000–7500 Hz). The difference among the magnitude values in normalized frequency domain for intact egg was obviously great, but the difference among the ones for crack egg was relatively small. When 10 magnitudes were extracted, the values of features for intact egg were relatively higher than the ones for crack egg. However, when 20 magnitudes were
Fig. 5. Discrimination for crack or intact egg based on 10 HVMs.
524
Y. Zhao et al. / Innovative Food Science and Emerging Technologies 11 (2010) 520–525
Fig. 6. Discrimination for crack or intact egg using 20 HVMs.
extracted, the difference between features for intact egg and for crack egg was not so obvious, and this leads to a better result of discrimination using 10 magnitudes than result using 20 magnitudes.
4.3. Analysis of features (frequency) from frequency value in turn (MVF) The discriminations for eggshell crack by PCA and LDA, respectively, using 10 MVFs were shown in Fig. 7. There were clear discriminations by both methods. And better discrimination by PCA than by LDA. Comparing Fig. 7 with Fig. 5, it was found that a better result of discrimination was found using MVF than using HVM. This may be because the first 10 MVFs centralized mostly in low frequency range for intact egg, whereas the first 10 MVFs centralized in the middle and high frequency ranges for crack egg. However, this distribution was not obvious for HVMs. The highest HVM, second HVM and anterior HVMs may appear in lower frequency range for intact egg in nor-
malized frequency domain. Other HVM's values for intact egg may be approximate HVM's value for crack egg. The discriminations for eggshell crack by PCA and LDA, respectively, using 20 magnitudes based on frequency in turn, were showed in Fig. 8. The better discrimination result was found in MVF using IFM and HVM. But compared to Fig. 7, the discriminated result was not as good as the one using 10 magnitudes. In response frequency of intact egg, the 10 MVFs mostly centralized in low frequency range, whereas the 20 MVFs do not centralized in low frequency range. In 20 MVFs, the high frequencies increased for intact eggs. But in the first 20 frequencies, the low frequencies increased for crack eggs. This may be the reason of better discriminated result using 10 MVFs than 20 MVFs. A thorough monitoring of acoustic patterns obtained by Jindal and Sritham (2003a,b) from both intact and cracked eggs revealed the useful frequency range between 597 and 9173 Hz for the training of Artificial Neural Networks (ANNs). In the training of ANNs, the respective percentages of crack detection and false reject were used
Fig. 7. Discrimination for crack or intact egg using 10 MVFs.
Y. Zhao et al. / Innovative Food Science and Emerging Technologies 11 (2010) 520–525
525
Fig. 8. Discrimination for crack or intact egg using 20 MVFs.
for evaluating the accuracy of classification. In general, the overall performance with 98.7% crack detection and 10.2% false reject. In comparison to Artificial Neural Networks, this might be thought as that there was a better discrimination basing on PCA and LDA.
ment Program of China through Project 2006AA10Z212, and the Research Fund for the Doctoral Program of Chinese National Higher Education through Project 20060335060. References
5. Conclusions After impacted by a light mechanical impact with flexible piezoelectric film sensors on crack egg and intact egg, the frequency domains were observed. In normalization average of frequency domain, 10 or 20 magnitudes by interval frequency (IFM), maximum magnitudes in turn (HVM) and frequencies by magnitudes in turn (MVF) were extracted as features. Then pattern recognition was conducted by PCA and LDA. Three aspects should be illuminated: (1) The dominant frequency value is lower for the intact eggs, whereas the magnitudes of the same peak frequencies were similar and the frequency values were higher for the cracked eggs. (2) The dynamic frequency response could distinguish between intact egg and cracked egg basing on LDA and PCA using HVM and MVF. (3) More distinguishing effect can be obtained basing on LDA using 10 MVFs. Acknowledgements The authors acknowledge the financial support of the Chinese National Foundation of Nature and Science through Project 30570449 and 30771246, the National High Technology Research and Develop-
Cho, H. K., Choi, W. K., & Paek, J. H. (2000). Detection of surface in shell eggs by acoustic impulse method. Transactions of ASAE, 43(6), 1921−1926. De Ketelaere, B., Coucke, P., & De Baerdemaeker, J. (2000). Eggshell crack detection based on acoustic resonance frequency analysis. Journal of Agricultural Engineering Research, 76(1), 157−163. Galili, N., Shmulevich, I., & Benichou, N. (1998). Acoustic testing for fruit ripeness evaluation. Transactions of the ASAE, 41(2), 399−407. Gomez, A. H., & Wang, J. (2005). Impulse response of pear fruit and its relation to Magness–Taylor firmness during storage. Postharvest Biology and Technology, 35(2), 209−215. Gomez, A. H., Wang, J., & Pereira, A. G. (2006). Firmness of mandarin at different picking dates. Food Science and Technology International, 12(4), 273−279. Jiang, R. (2004). Dynamic frequency analysis for egg detection [D] (pp. 6). Hangzhou: Zhejiang University. Jindal, V. K., & Sritham, E. (2003). Detecting eggshell cracks by acoustic impulse response and Artificial Neural Networks. ASAE Annual International Meeting, Las Vegas, USA, 27–30 July, Paper Number 036170. Jindal, V. K., & Sritham, E. (2003). Detecting eggshell cracks by acoustic impulse response and Artificial Neural Networks. ASAE Annual International Meeting Las Vegas, Nevada, USA. 27–30 July. Shmulevich, I., Galili, N., & Rosenfeld, D. (1996). Detecting of fruit firmness by frequency analysis. Transactions of the ASAE, 39(3), 1047−1055. Wang, J., & Jiang, R. S. (2005). Eggshell crack detection by dynamic frequency analysis. European Food Research and Technology, 221(1–2), 214−220. Wang, J., Jiang, R. S., & Yu, Y. (2004). Relationship between dynamic resonance frequency and egg physical properties. Food Research International, 37(1), 289−294. Wang, J., Teng, B., & Yu, Y. (2004). Pear dynamic characteristics and firmness detection. European Food Research and Technology, 218, 289−294. Wang, J., Ying, T. J., & Cheng, K. C. (2007). Evaluation of pear firmness by dynamic characteristics of drop impact. Journal of the Science of Food and Agriculture, 87(8), 1449−1454.