Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

Computers and Electronics in Agriculture 157 (2019) 471–478

Contents lists available at ScienceDirect

Computers and Electronics in Agriculture


journal homepage: www.elsevier.com/locate/compag

Original papers

Identification of unfertilized duck eggs before hatching using visible/near T


infrared transmittance spectroscopy
Jun Donga, Xiaoguang Donga, Yanlei Lia, Yankun Penga, Kuanglin Chaob, Cuiying Gaoc,
Xiuying Tanga,

a
China Agricultural University, College of Engineering, 17 Qinghua East Road, Haidian, Beijing 100083, China
b
USDA-ARS Environmental Microbial and Food Safety Laboratory, Henry A. Wallace Beltsville Agricultural Research Center, Beltsville, MD 20705, United States
c
Inner Mongolia Saifeiya Agricultural Science and Technology Development Co., Ltd., Xizi Town, Ningcheng County, Chifeng City, Mongolia Interior 024207, China

ARTICLE INFO ABSTRACT

Keywords: Identification of unfertilized duck eggs before hatching was hardly achieved in the poultry farm by the traditional
Unfertilized egg method. Visible/near infrared (VIS/NIR) transmittance spectroscopy was used as a rapid and non-destructive tech-
Duck nique to distinguish the unfertilized duck eggs before hatching. Transmittance spectral data of duck eggs laid by the
Before hatching same flock of ducks was obtained. Prediction models were developed and used to link the non-destructive assessment
Naive Bayes
methods and qualitative observation values of spectral with the spectral data. Established models were validated by
Visible/near infrared transmittance
spectroscopy
the internal leave-one-out cross-validation (LOOCV) and external validation. The prediction model established by
standard normal variate (SNV) pre-processing method and naive Bayes (NB) modeling method got the best perfor-
mance. The overall prediction accuracy of the validation set was 94.54% and the prediction accuracy of internal
validation was 95.06%. The prediction accuracy of 667 duck eggs by means of NB modeling method by SNV pre-
processing was 94.77%. Results showed that the VIS/NIR transmittance spectroscopy was an effective tool for de-
tecting the unfertilized duck eggs. This provided technical support for identification of the unfertilized duck eggs.

1. Introduction chicken eggs lost economic value, which resulted in a great waste. Al-
though researchers used near/infrared reflectance spectroscopy (Zhu
For the poultry farm, identifying the unfertilized duck eggs before et al., 2012) and hyperspectral imaging (Zhu et al., 2015) to detect un-
hatching is important and hard work because it is hardly achieved by fertilized eggs before hatching, complex detection method and expensive
the traditional candling method. The traditional candling method, detection cost was not conducive to industrial application.
widely used to assess flock fertility of hatching duck eggs and dead Compared with identification of unfertilized chicken eggs from
embryos, is labor consuming, subjective and artificial (Liu and Ngadi, fertilized ones, detection of unfertilized duck eggs from fertilized ones
2013). In addition, the unfertilized duck eggs not picked out before before hatching has received little attention. Detective methods and
hatching will occupy hatching space and turn sour quickly during qualitative models of chicken eggs are not suitable for the duck eggs, on
hatching. The spoiled unfertilized duck eggs burst easily and produced account of the detection technology and the differences in physiology
bacteria, which infect the surrounding eggs. Therefore, it is of im- and inside content between chicken and duck eggs. In addition, there is
portance to use a non-destructive and accurate method to detect the little research so far on identification of unfertilized duck eggs before
unfertilized duck eggs before hatching for poultry farms. hatching based on VIS/NIR transmittance spectroscopy.
In recent years, researchers have focused on identifying the fertilized Nowadays, VIS/NIR transmittance spectroscopy as a rapid and non-
chicken eggs incubated for 2–5 days by machine vision (Das and Evans, destructive detection method was used for predicting eggs freshness
1992a,b), acoustic sensors (Zhang et al., 2012), near/infrared hyper- and albumen quality (Abdel-Nour et al., 2011), detecting unfertilized
spectral imaging (Liu and Ngadi, 2013; Zhang et al., 2014), thermal eggs containing blood spots (Brant et al., 1953), and monitoring
imaging (Lin et al., 2013), temperature sensors (Tong et al., 2016) and chicken eggs embryo development (Kemps et al., 2010). The above
VIS/NIR transmittance spectroscopy (Qin et al., 2017). These methods studies by VIS/NIR transmittance spectroscopy indicated that trans-
could achieve high accuracy. However, these hatching eggs identification mittance light could penetrate whole egg and the transmittance mea-
methods were concentrated on the mid-term hatching, and the picked surements were preferable to reflectance measurements acquiring


Corresponding author.
E-mail address: txying@cau.edu.cn (X. Tang).

https://doi.org/10.1016/j.compag.2019.01.021
Received 12 November 2018; Received in revised form 7 January 2019; Accepted 18 January 2019
0168-1699/ © 2019 Published by Elsevier B.V.
J. Dong et al. Computers and Electronics in Agriculture 157 (2019) 471–478

information of internal qualities for detection the unfertilized eggs ranging from 330 to 1030 nm with a 0.38 nm increment. Two halogen
(Kimura et al., 2015), the obtained spectra could carry large amounts of lamps, 20 w each, were placed underneath the egg. The lamps were used
internal information of egg. as light source and turned on for half an hour before spectral measure-
In this study, VIS/NIR transmittance spectroscopy was used to ment. Temperature sensor was installed at the bottom of the loading
identify unfertilized duck eggs before hatching. The main objectives of table to ensure that temperature of the duck egg was below 38 °C. A
this present research were: (1) to build a VIS/NIR transmittance spec- fiber-optics was placed above the egg and fixed on a lift table. The dis-
troscopy system in the spectral wavelength range of 330–1030 nm to tance from the fiber-optics probe to the experimental duck egg was ap-
obtain transmittance spectra of duck eggs before hatching; (2) to study proximately 20 mm. Spectral data of duck egg was obtained by averaging
whether spectral pre-processing methods can improve the prediction three measurements and the acquisition time was 600 ms. The detection
accuracy of models; (3) to build robust naive Bayes (NB) models upon number was written on the pallet according to the detection order after
the qualitative relationship between the spectral data and qualitative the VIS/NIR transmittance spectroscopy measurement.
observation values of duck eggs; (4) to validate the predictive ability of
the optimum model to predict duck eggs. 2.3. Acquisition of spectral qualitative observation values

2. Material and methods Duck eggs were put into an incubator at 37.8 °C and 65% relative
humidity with blunt end upwards. After hatching for seven days, the
2.1. Sample preparation candling method was applied to distinguish unfertilized duck eggs. The
unfertilized duck eggs, which could not be identified by the candling
A total of 890 Cherry Valley Duck eggs were used in this experiment, method, would be broken artificially to observe the embryo development.
among which 223 duck eggs were used to establish prediction models At the same time, the spectral qualitative observation values of fertilized
and 667 eggs were applied to validate the optimum prediction model. duck eggs and unfertilized ones were set to 1 and 0, respectively.
Eggs were collected from ducks which were fed in the same environment
from a poultry farm named Inner Mongolia Saifeiya Agricultural Science 2.4. Detection of outlier
and Technology Development Co., Ltd in Inner Mongolia, China. The size
and color of all duck eggs were nearly consistent. There were pollutants, Outliers are indicative of atypical phenomena. Outliers produce due
such as feces and soil, on the eggshell of duck eggs after oviposition due to the uncontrolled process, wrong analytical technique, contamination
to the feeding. In order to prevent the mildew and increase the perme- during the preparation of the sample, sample inhomogeneity and
ability of duck eggs during hatching, duck eggs were rinsed by for- measurements with a high systematic error (Oliveira et al., 2010).
maldehyde fumigation before hatching. So, the eggs after 24 h of ovi- Outliers can affect prediction accuracies of models. Therefore, Maha-
position were stored under the controlled condition at 18 °C, and the eggs lanobis Distance (MD) and Leverage Diagnostic (LD) were used to
were not cleaned and disinfected. Duck eggs were wiped by alcohol with identify and eliminate outliers.
the content of 75% and were dried naturally. All samples were randomly
taken out for VIS/NIR spectral data acquisition in one day. 2.5. Spectral data pre-processing

2.2. Experiment equipment and spectral data acquisition Different mathematical pre-processing methods were adopted to
preprocess raw data for reserving the undesirable variations and
Fig. 1 showed the experiment equipment used for VIS/NIR trans- leaving the useful information. Savitzky–Golay (S-G) smoothing and
mittance spectral measurements. VIS/NIR transmittance data of each standard normal variate (SNV) were applied to improve the predictive
duck egg was collected by a spectrometer (USB2000+, Ocean Optics ability of models. S-G method was for removing high frequency noise,
Inc., USA). The spectrometer measured transmittance at wavelengths improving signal to noise ratio (SNR) of spectral curves, and preserving

Fig. 1. The experiment equipment of VIS/NIR transmittance spectroscopy.

472
J. Dong et al. Computers and Electronics in Agriculture 157 (2019) 471–478

the important information maximally (Vidal and Amigo, 2012). SNV unfertilized duck eggs); positive predictive value (PPV (Eq. (7))); ne-
method could correct the effects of different scattering characteristics gative predictive value (NPV (Eq. (8)))
from unknown samples by normalizing the spectra individually TP + TN
(Luypaert et al., 2005). Effects of different pre-processing methods were Q=
(4)
TP + TN + FP + FN
determined by comparing the prediction accuracy of different models
relating the pre-processing spectra. However, it was worth investigating SE =
TP
whether the two pre-processing methods could eliminate the effects of TP + FN (5)
noise and improve the robustness of models.
TN
SP =
TN + FP (6)
2.6. Modeling and validation methods
TP
PPV =
VIS/NIR spectral data was linked to spectral qualitative observation TP + FP (7)
values of fertilized duck eggs and unfertilized duck eggs with 0 and 1
TN
for building prediction models. With the purpose of evaluating the NPV =
(8)
TN + FN
performance of models and obtaining the optimal model, cross-valida-
tion methods of leave-one-out cross-validation (LOOCV) and external where TP (true positives) is the fertilized duck eggs that are correctly
validation methods were used. recognized; TN (true negatives) is the unfertilized duck eggs that are
correctly identified; FP (false positive) is the fertilized duck eggs are
2.6.1. Leave-one-out cross-validation wrongly predicted as the unfertilized ones; FN (false negative) is the
The internal LOOCV method was used to select the optimum cali- unfertilized duck eggs are wrongly predicted as the fertilized ones.
bration set and pre-processing methods. The principle of LOOCV was These parameters are also widely applied to evaluate the accuracy of
using one sample spectral data from the original dataset as the vali- models, and the higher parameters values, the better accuracy of pre-
dation set, and the remaining sample data as the calibration set. This is diction models.
repeated in such a way that each sample spectral data is used once as
the validation set, and and the prediction accuracy is calculated for 3. Results and discussions
each time (Joshi et al., 2012). Finally, the average value of predictive
accuracy by the LOOCV was calculated and used as the evaluating in- 3.1. Selection and analysis of spectral information
dicator.
The transmittance spectral measurements from 330 to 500 nm as
2.6.2. Naïve Bayes classifier well as from 940 to 1030 nm could convey little characteristic ab-
Naïve Bayes (NB) classifier was applied to build calibration model. sorption and low signal-to-noise. And eggshell could absorb spectral
Discriminant values of model were calculated and compared with information of less than 500 nm (Brant et al., 1953). So the spectral
spectral qualitative observation of 1 and 0, for determining the final data from 330 to 500 nm as well as from 940 to 1030 nm were not
predictive accuracy. NB classifier, a statistical learning algorithm, recommended for establishing calibration models, and the spectral data
performs probabilistic classification based on Bayesian networks from 500 to 940 nm were used for further analysis. The average VIS/
(Kotsiantis, 2007). The formulae was as follow: NIR spectral response of fertilized duck eggs and unfertilized ones be-
fore hatching were illustrated in Fig. 2. Although the VIS/NIR spectra
P (x / wi ) P (wi )
p(wi /x ) = information had a similar trend, there were differences in the trans-
p (x ) (1) mittance values of duck eggs as a function of the fertility or infertility
where x was the spectral data, wi was the category of the fertilized duck throughout whole spectral range. It was observed that the unfertilized
eggs or the unfertilized ones, p (wi ) was the prior probability, p(x /wi) duck eggs had higher absorbance values than the fertilized ones, which
was the class conditional density, and p(wi/x ) was the posterior prob- provided a mathematical basis for discriminating duck eggs. In addi-
ability (Joshi et al., 2012). tion, fertility occured prior to the formation of the eggshell, and the
The p (x ) works as a scale factor that guarantees that the posterior fertilized eggs had generated development zone in the yolk (Steiner
probabilities sum up to unity, and as all good probabilities must. For a et al., 2011), which were different from the unfertilized eggs. Differ-
two-category classification, p (x ) is given by the Eq. (2). ences of biotic component between the fertilized and unfertilized duck
2
eggs lead to the differences in VIS/NIR spectral data. Although, denti-
p(x ) = p (x / wj ) P (wj ) fication of fertility and infertility of duck eggs involves many compli-
j =1 (2) cated parameters, they could be predicted using VIS/NIR spectral re-
sponse from 500 nm to 940 nm.
For any observation, the probability of a category is given by Eq.
(3). 3.2. Analysis and elimination of outlier
P (w1/x ), if we decide w2,
P(error/ x ) = After selecting the related spectral waveband and different pre-
P (w2 /x ), if we decide w1, (3)
processing methods, a total of 223 duck eggs were randomly divided on
So, Bayes Decision Rule decides w1 if P (w1/ x ) > P (w2/ x ); otherwise a scale of 3:1 into two groups including the calibration set with 168
decide w2 (Joshi et al., 2012). samples and the validation set with 55 samples. The numbers of duck
eggs in the calibration and validation set were showed in Table 1.
2.6.3. Evaluation parameters of models Spectra data of duck eggs without the eliminated samples was set as
The developed model with raw spectral data was regarded as NB, the X matrix and the spectral observation qualitative values were set as
and the models with a series of pre-processing methods were named as Y matrix. All spectral calculations were operated by the Matlab soft-
NB-1, NB-2…NB-n (n = 1, 2, 3…). To obtain optimum model, the ware (Version 5.3, The MathWorks Inc., Natick, MA). LD and MD
predictive ability of each model was evaluated by the following para- methods were applied to detect outlier in the calibration set before the
meters (Zhang et al., 2017): the all prediction accuracy (Q (Eq. (4))); calibration set was used to establish a qualitative calibration model.
sensitivity (SE (Eq. (5)), the prediction accuracy for the fertilized duck It could be seen that from Fig. 3, threshold value with 0.07 of LD
eggs); specificity (SP (Eq. (6)), the prediction accuracy for the method was calculated by three times of all samples leverage values,

473
J. Dong et al. Computers and Electronics in Agriculture 157 (2019) 471–478

Fig. 2. Original average VIS/NIR transmittance spectra of fertilized duck eggs and unfertilized ones.

Table 1 could not be decided. The discrimination accuracy after the elimination
The number of duck eggs in the calibration and validation sets. of samples numbered 84, 57, 92 and 141 was 82.93%, which was
Subsets Fertilized duck eggs Unfertilized duck eggs Total higher than that of raw spectral data and after elimination of samples
numbered 84 and 57. So, spectral data of samples numbered 84, 57, 92
Calibration set 76 92 168 and 141 were eliminated as outliers. As could be seen from Table 2, MD
Validation set 25 30 55
values of samples numbered 81 with 10.92 and numbered 83 with
Total 101 122 223
11.48 were close to threshold value with 10.08, which meant that the
two samples numbered 81 and 83 could not be confirmed as outliers.
and it was represented by a curve to distinguish outlier from normal The prediction accuracy without samples numbered 81 and 83 in-
data. Data point (one point represents one sample) of numbered 84, 57, creased from 82.74% to 82.92%, which represented that the two sam-
92 and 141 those were above the threshold line, which indicated that ples would affect the prediction of calibration set.
the corresponding sample was noticeably different from the other The prediction accuracy without numbered 57, 81, 83, 84, 92 and
samples (Wu et al., 2017), and spectral data of sample was eliminated 141 was 83.33%, which was higher than that by LD. Therefore, samples
as an outlier and excluded from the dataset. LD values of these ab- 81, 83, 84, 57, 92 and 141 were determined as outliers and eliminated.
normal samples were showed in Table 2. Predictive ability of calibration set was improved greatly by using MD
Only one method may not identify the true outliers (Alameddine than LD.
et al., 2010). MD method was also used for outlier detection in the
calibration set. From Fig. 4, threshold value with 10.48 of MD method 3.3. Analysis of internal and external validation of the Naïve Bayes
was calculated by three percent of number of all samples, which was prediction models
represented by a curve to distinguish outlier from normal data. Data
point (one point represents one sample) of samples numbed 81, 83, 84, 3.3.1. Analysis of internal cross validation of leave-one-out
57, 92 and 141 above the line were treat as outliers and the corre- After selecting the related spectral waveband, eliminating outliers
sponding spectral data were removed from dataset. MD values for these and different pre-processing, calibration set was applied to establish a
outliers were showed in Table 2. qualitative calibration model, and LOOCV as internal validation
With the purpose of evaluating real outlier, LOOCV was applied to method was used to evaluate predictive ability before the external va-
validate the influence of outliers for calibration sets by prediction ac- lidation. The effects of different pre-processing methods should be
curacy. Results of the LOOCV validation without the outliers were taken into consideration in establishing models before evaluating cali-
showed in Table 3. bration set.
The prediction accuracy of calibration model calculated by all VIS/NIR spectral data of 163 duck eggs by different pre-processing
sample data without the outliers was 82.74%. It could be seen from the methods linked with the spectral qualitative observation values of fer-
Table 2, LD values of samples numbered 84 with 0.07 and numbered 57 tilized duck eggs and unfertilized ones with 1 and 0 were evaluated by
with 0.11 approached to threshold value with 0.07. In order to decide LOOCV method. And a total of 163 calibration models were obtained by
whether samples numbered 84 and 57 were outliers of calibration set, LOOCV method in accordance with 163 prediction accuracy values.
LOOCV was applied to recognize outliers. The prediction accuracy of Calibration set was evaluated by the average prediction accuracy,
eliminating the unfertilized duck eggs from all the duck eggs without which was calculated by the 163 prediction accuracy values. The
the two samples numbered 84 and 57 decreased from 82.74% to average prediction accuracies of LOOCV with raw VIS/NIR spectral
82.53%. That which one of samples numbered 84 and 57 was outlier data, S-G and SNV preprocessing were 83.33%, 86.42% and 95.06%,

474
J. Dong et al. Computers and Electronics in Agriculture 157 (2019) 471–478

Fig. 3. Elimination of Outliers by LD method for calibration set.

Table 2 From Tables 4 and 5, we could find that value of Q for NB model by
LD and MD values of outliers. raw spectral data (NB-0 model) was 70.91%. Values of SE and SP of NB-
Number of samples Values of LD Values of MD
0 were 66.67% and 75.00%, respectively. And values of PPV and NPV
were 72.00% and 70.00% respectively. By using NB-0 model in the
57 0.11 18.05 external validation, 16 duck eggs were predicted wrongly, among
81 – 10.92 which 7 fertilized duck eggs were mistaken as unfertilized eggs and 9
83 – 11.48
84 0.07 12.01
unfertilized duck eggs were mistaken as the fertilized. Results illu-
92 0.12 22.23 strated NB-0 model with raw spectral data achieved an unsatisfactory
141 0.14 23.81 result of identifying unfertilized duck eggs from fertilized ones.
Therefore, S-G and SNV pre-processing methods were used for VIS/NIR
LD, Leverage Diagnostic; MD, Mahalanobis Distance. spectral data to improve the prediction ability of prediction model.
The prediction results of validation set of NB model by S-G pre-
respectively. In contrast to the raw VIS/NIR spectral data, prediction processing method (NB-1 model) were showed in Tables 4 and 5. As
accuracies were improved with appropriate pre-processing methods, could be seen, the value of Q for NB-1 model was 83.64%. The values of
which showed that pre-processing methods could reduce the undesir- SE and SP were 80.77% and 83.33%, respectively. values of PPV and
able variables and leave the useful information. The prediction ac- NPV were 84.00% and 80.00%. respectively. However, 9 duck eggs
curacies by raw VIS/NIR spectral data and S-G method were lower than were predicted wrongly among which 4 fertilized duck eggs were
that by SNV method, which illustrated that SNV preprocessing method mistaken as unfertilized duck eggs and 5 unfertilized duck eggs were
was more suitable for modeling between VIS/NIR spectral data of duck mistaken as fertilized duck eggs. The prediction results of the NB-1
eggs and spectral qualitative values with large information. Obviously, model was significantly better than that of the NB-0 model, which
the above results confirmed that appropriate pre-processing method suggested that S-G pre-processing methods could smooth raw data to
was an important and a good strategy to avoid the inclusion of in- remove high frequency noise and improve signal to noise ratio of
formation for the calibration set. spectral curve.
To improve the prediction performance of NB model, SNV pre-
3.3.2. Analysis of external validation of Naïve Bayes prediction models processing methods were also applied for spectral data. Prediction re-
NB method combined with different pre-processing methods was ap- sults of validation set for NB model by SNV pre-processing method (NB-
plied to establish prediction model between VIS/NIR spectral data of cali- 2 model) were listed in Tables 4 and 5. Q of the validation set was
bration set and spectral qualitative observation values of fertilized duck eggs 94.54%, and 1 fertilized duck egg was mistaken as unfertilized duck
and unfertilized ones with 1, 0, respectively. Validation set as external va- eggs and 2 unfertilized duck eggs were mistaken as fertilized duck eggs.
lidation tool was used for evaluating predictive ability and reliability of a The values of SE and SP were 92.31%, were 92.31% and 96.55%, re-
classification model. The prediction accuracies of internal and external va- spectively. PPV and NPV were 96.00% and 93.33%, respectively.
lidation models were compared to obtain the optimum prediction model. Compared the performance of above prediction models, the pre-
To further analyze the predictive ability of prediction models, the diction performance of NB-2 model was superior to other models pre-
indicators values of the all prediction accuracy(Q), sensitivity(SE), sented. SNV pre-processing method was used to correct scatter inter-
specificity(SP), positive predictive value(PPV) and negative predictive ferences and differences due to particle size differences between the
value(NPV) were applied to evaluate the established models. Prediction duck eggs. To perform the SNV pre-processing correction, the mean
results of three NB models by different preprocessing methods were value of each spectral data was subtracted from the whole spectrum and
displayed in Tables 4 and 5.

475
J. Dong et al. Computers and Electronics in Agriculture 157 (2019) 471–478

Fig. 4. Elimination of Outliers by MD method for calibration set.

Table 3 Table 5
Results for the LOOCV validation with elimination different outliers. The prediction performance of external validation for NB-0 (raw data); NB-1 (S-
G); NB-2 (SNV) prediction models.
Number of samples Validation results of LD Validation results of MD
(%) (%) Model Q (%) SE (%) SP (%) PPV (%) NPV (%)

92, 141 82.53 – NB-0 70.91 66.67 75.00 72.00 70.00


84, 57, 92, 141 82.93 – NB-1 83.64 80.77 83.33 84.00 80.00
57, 84, 92, 141 – 82.92 NB-2 94.54 92.31 96.55 96.00 93.33
57, 81, 83, 84, 92, 141 – 83.33
NB-0, naive Bayes model by raw data; NB-1, naive Bayes model by S-G pre-
LOOCV, leave-one-out cross-validation; LD, Leverage Diagnostic; MD, processing method; NB-2, naive Bayes model by SNV pre-processing method; S-
Mahalanobis Distance. G, Savitzky-Golay; SNV, standard normal variate; Q, the all prediction accuracy;
SE, the prediction accuracy for the fertilized duck eggs; SP, the prediction ac-
Table 4 curacy for the unfertilized duck eggs; PPV, positive predictive value; NPV,
The prediction results for the validation set, NB-0 (raw data); NB-1 (S-G); NB-2 negative predictive value.
(SNV).
Predicted
was the optimum prediction model with higher prediction accuracies
and more reliable predictive performance.
Model Actual Fertilized Unfertilized Correct/Total
3.4. Validation result of the optimum prediction model
NB-0 Fertilized 18 7(False Positive) 18/25
Unfertilized 9(False Negative) 21 21/30
Total – – 39/55 669 duck eggs were used for validation of the optimum prediction
NB-1 Fertilized 21 4(False positive) 21/25
model. NB-2 model was applied to discriminate each duck egg for va-
Unfertilized 5(False Negative) 25 25/30 lidating the stability and predictive ability. Each duck egg was detected
Total – – 46/55 by the optimum model of NB-2 to validate the stability and predictive
NB-2 Fertilized 24 1(False Positive) 24/25 ability
Unfertilized 2(False Negative) 28 28/30 The spectral waveband from 550 nm to 940 nm of the unfertilized
Total – – 52/55 duck eggs and the fertilized ones was preprocessed by SNV pre-pro-
cessing at the first. Then each pre-processed spectra data of duck eggs
NB-0, naive Bayes model by raw data; NB-1, naive Bayes model by S-G pre-
was predicted respectively by NB-2 model. Prediction process of each
processing method; NB-2, naive Bayes model by SNV pre-processing method; S-
unknown samples by NB-2 model was showed in the Fig. 4.
G, Savitzky-Golay; SNV, standard normal variate.
Prediction process contained modeling and predicting. NB method
was based on the theory of Bayes probability, the prior probability was
these centered values were divided by the standard deviation of each
calculated in the part of NB-2 model and the posterior probability in the
spectral data. Compared with the original spectra and S-G pre-proces-
part of prediction (Fig. 5), which could classify the data according to its
sing method, the reason why SNV pre-processing method made the
posterior probability dynamically (Zhang et al., 2017). The posterior
model prediction better may be that the SNV algorithm eliminated the
probability of each sample in two categories of 1 and 0 were calculated
spectral scattering caused by the uneven size of duck eggs by correcting
and compared to determine the category of the unknown sample.
each spectral curve. Therefore, the established NB-2 prediction model
A total of 669 eggs including 303 fertilized eggs and 366

476
J. Dong et al. Computers and Electronics in Agriculture 157 (2019) 471–478

Fig. 5. Prediction process of each unknown samples by NB-2 model.

unfertilized eggs were used for prediction detection. Prediction ac- information of duck eggs. MD and LD methods were applied to elim-
curacies of NB-2 model were shown in Table 6. The value of overall inate outliers. Then, S-G and SNV pre-processing method were used to
prediction accuracy was 94.77%. And the value of prediction accuracies improve the prediction ability of models. Established models were va-
with fertilized eggs and unfertilized eggs were 93.40% and 95.90%, lidated by LOOCV and external validation. NB model by SNV pre-pro-
respectively. Compared to predict fertilized duck eggs, the optimum cessing (NB-2) showed the best prediction performance, which yielded
model of unfertilized duck egg got a higher accuracy. that the overall prediction accuracy of the validation set was 94.54%
and the prediction accuracy rates of internal validation was 95.06%.
4. Conclusion The prediction accuracy of 667 duck eggs by means of the optimum
model of NB-2 was 94.77%. The results suggested that the VIS/NIR
In this study, the prediction model of the unfertilized duck eggs by spectroscopy combined with mathematical modeling methods could be
using naive Bayes method was established. The results showed that the used as a non-destructive method for detecting the unfertilized duck
VIS/NIR transmittance spectral data contained fertility or infertility eggs.

Table 6
Prediction results of NB-2 model.
NB-2 model Predicted

Fertilized Unfertilized Correct/Total Accuracy (%)

Actual Fertilized 283 20(False Positive) 283/303 93.40


Unfertilized 15(False Negative) 351 351/366 95.90
Total – – 634/669 94.77

NB-2, naive Bayes model by SNV pre-processing method.

477
J. Dong et al. Computers and Electronics in Agriculture 157 (2019) 471–478

Acknowledgements creams. J. Pharmaceut. Biomed. 36 (3), 495–503.


Lin, C.S., Yeh, P.T., Chen, D.C., Chiou, Y.C., Lee, C.H., 2013. The identification and fil-
tering of fertilized eggs with a thermal imaging system. Comput. Electron. Agr. 91
The authors gratefully acknowledge the National Natural Science (4), 94–105.
Foundation Project of China (NO 31571921) and the Natural Science Liu, L., Ngadi, M.O., 2013. Detecting fertility and early embryo development of chicken
Foundation Project of Beijing, China (NO 6162015) for supporting this eggs using near-infrared hyperspectral imaging. Food Bioprocess Tech. 6 (9),
2503–2513.
research. Oliveira, P.M.S., Munita, C.S., Hazenfratz, R., 2010. Comparative study between three
methods of outlying detection on experimental results. J. Radioanal. Nucl. Ch. 283
Conflict of interest (2), 433–437.
Qin, W.C., Tang, X.Y., Peng, Y.K., Zhao, X.H., 2017. Identification of fertilized chicken
eggs based on visible/near-infrared spectrum during early stage of hatching.
The authors declare that there is no conflict of interest. Spectrosc. Spect. Anal. 37 (1), 200–204.
Steiner, G., Bartels, T., Stelling, A., Fuhrmann, H., Sablinskas, V., Koch, E., 2011. Gender
determination of fertilized unincubated chicken eggs by infrared spectroscopic ima-
References
ging. Anal. Bioanal. Chem. 400 (9), 2775–2782.
Tong, Q., Romanini, C.E.B., Exadaktylos, V., Mcgonnell, I.M., Berckmans, D., Bahr, C.,
Alameddine, I., Kenney, M.A., Gosnell, R.J., Reckhow, K.H., 2010. Robust multivariate Bergoug, H., Roulston, N., Guinebretiere, M., Eterradossi, N., Verhelst, R., Demmers,
outlier detection methods for environmental data. J. Environ. Eng. 136 (11), T.G.M., 2016. Detection of embryo mortality and hatch using thermal differences
1299–1304. among incubated chicken eggs. Livest. Sci. 183, 19–23.
Abdel-Nour, N., Ngadi, M., Prasher, S., Karimi, Y., 2011. Prediction of egg freshness and Vidal, M., Amigo, J.M., 2012. Pre-processing of hyperspectral images. Essential steps
albumen quality using visible/near infrared spectroscopy. Food Bioprocess Tech. 4 before image analysis. Chemometr. Intell. Lab 117 (6), 138–148.
(5), 731–736. Wu, C., Chen, J., Li, M., Wu, Y., Liu, X., 2017. Improvement of nir models for quality
Brant, A.W., Norris, K.H., Chin, G., 1953. A spectrophotometric method for detecting parameters of leech and earthworm medicines using outlier multiple diagnoses. J.
blood in white-shell eggs. Poultry Sci. 32 (2), 357–363. Innov. Opt. Heal. Sci. 11 (1).
Das, K., Evans, M.D., 1992a. Detecting fertility of hatching eggs using machine vision i. Zhu, Z.H., Wang, Q.H., Wang, S.C., Dai, M.Y., Ma, M.H., 2012. The detection of hatching
histogram characterization method. T ASAE 35 (4), 1335–1341. eggs prior to hatching by the near infrared spectrum. Spectrosc. Spect. Anal. 32 (4),
Das, K., Evans, M.D., 1992b. Detecting fertility of hatching eggs using machine vision ii: 962–965.
neural network classifiers. T ASAE 35 (6), 2035–2041. Zhang, W., Tu, K., Liu, P., Pan, L., Zhan, G., 2012. Early fertility detection of hatching
Joshi, D., Mishra, A., Anand, S., 2012. A naïve gaussian bayes classifier for detection of duck egg based on fusion between computer vision and impact excitation. Trans.
mental activity in gait signature. Comput. Method Biomec. 15 (4), 411–416. Chinese Soc. Agric. Mach. 43 (2), 140–145.
Kemps, B.J., Bamelis, F.R., Mertens, K., Decuypere, E.M., De Baerdemaeker, J.G., De, K.B., Zhang, W., Pan, L., Tu, K., Zhang, Q., Liu, M., 2014. Comparison of spectral and image
2010. Assessment of embryonic growth in chicken eggs by means of visible trans- morphological analysis for egg early hatching property detection based on hyper-
mission spectroscopy. Biotechnol. Progr. 26 (2), 512–516. spectral imaging. Plos One 9 (2), e88659.
Kimura, K., Nakano, K., Ohashi, S., Takizawa, K., Nakano, T., 2015. Led measurement for Zhu, Z.H., Liu, T., Xie, D.J., Wang, Q.H., Ma, M.H., 2015. Nondestructive detection of
development of a non-destructive detector of unsuitable chicken eggs in influenza infertile hatching eggs based on spectral and imaging information. Int. J. Agr. Biol.
vaccine production. Biosyst. Eng. 134, 68–73. Eng. 8 (4), 69–76.
Kotsiantis, S.B., 2007. Supervised machine learning: a review of classification techniques Zhang, H., Kang, Y.L., Zhu, Y.Y., Zhao, K.X., Liang, J.Y., Ding, L., Zhang, T.G., Zhang, J.,
31 (3), 3–24. 2017. Novel naïve bayes classification models for predicting the chemical Ames
Luypaert, J., Heuerding, S., Vander, H.Y., Massart, D.L., 2005. The effect of preprocessing mutagenicity. Toxicol. In Vitro 41, 56–63.
methods in reducing interfering variability from near-infrared measurements of

478

You might also like