# Fertility Detection of Hitching Eggs Based on a Convolutional Neural Network
## 2 Methods
### Data Acquisition and Pre-Processing  
The excellent performance of deep learning in the field of classification is based on abundant experimental data distributed independently. In this paper, we choose the heartbeat signal of hatching eggs as the feature data to identify the survival of the embryos. For the purpose of avoiding introducing a large amount of environmental noise during data collection, we adopt the method of PhotoPlethysmoGraphy to collect data. PhotoPlethysmoGraphy is based on Lamber-Bee's law which is described as follows:  
\[\mathrm{A}=\mathrm{lg}(\frac{\mathrm{I}_{0}}{\mathrm{I}})=\mathrm{lg}(\frac{ \mathrm{1}}{\mathrm{T}})=\mathrm{kcd} \tag{1}\]  
where \(I_{0}\) and \(I\) represent incident light and transmitted light intensity respectively, \(A\) is absorbance, \(T\) is transmittance rate, \(k\) is a scale factor, \(c\) is concentration of matter, and \(d\) is absorbent layer thickness.  
We collected heartbeat signal data of 9-day-after hatching eggs by adopting the transmissive light method. The structure of the data acquisition device is shown in Figure 1. In the process of data acquisition, the hatching egg was placed between a laser and a sensor which receives light signals transmitted through the egg. Then the transmitted light signals is converted into digital signals by A/D module. Finally the signal is transferred to the microcontroller via SPI (Serial Peripheral Interface). The 8-second-long heartbeat signal of hatching eggs is sampled at 62.5 Hz continuously for every egg and we eventually get a sequence of 500 data points. The collected heartbeat signal of the embryo is depicted in Figure 2. We can see that the difference of waveform between a fertile egg and a dead egg is not so obvious. Although the waveform of a fertile egg presents a cyclical trend, the amplitude changes are not prominent compared with dead egg. The noise introduced into the signal and baseline drift could account for this phenomenon, and consequently the filtering operation is necessary before processing data.  
Given that the heartbeat frequency of 9-day-later hatching eggs ranges from 1 to 4 Hz [20], we design a second order Butterworth high pass filter used for filtering out the noise interference in the original signal and removing the baseline drift. Figure 3 shows the filtered heartbeat signal corresponding to the original heartbeat signal depicted in Figure 2. We take the last 350 stable data of the filtered signal as the sampling points. Apparently, the difference between a fertile egg and a  
Figure 1: Data acquisition device schematic. The system acquisition terminal uses the AFE(Active Front End)4490 chip, which is a fully integrated analog front end designed by Texas Instruments for clinically required arterial oxygen saturation measurements. The control terminal selects the STM (STMicroelectronics)32 microcontroller. The sensor uses a photo-silicon cell with a large photosensitive area, high sensitivity, and wide sensitivity range. The laser source uses a near-infrared source of 808 nm [19].  
Figure 2: The original waveform of collected heartbeat signal of hatching eggs. The amplitude of heartbeat signal data is normalized to within 0–1 in order to reflect the changes of waveform more intuitively.  
dead egg on heartbeat signal waveforms becomes more obvious, which is conducive to subsequent classification algorithms.