3.3.2. Ablation Study

To evaluate the superior performance of the microcrack nondestructive detection algorithm for egg electrical characteristics based on wavelet scattering convolution network proposed in this paper, the extracted current original signal and the characteristics processed by wavelet scattering transformation were inputted to four classification methods for comparison, including LSTM, Bi-LSTM, GRU, and 1DCNN. The results are shown in Figure 9a. For the four classification methods, the accuracy of the wavelet scattering feature extraction was 2.243%, 1.8692%, 3.3644%, and 2.9907% higher than the accuracy of directly feeding microcurrent signals into the deep learning network. The average statistical error of accuracy of LSTM, Bi-LSTM, GRU, and 1DCNN is 0.9622%, 0.6339%, 0.9157%, and 0.5449% respectively. The results indicate that under the same conditions, the features extracted by wavelet scattering transformation were more recognizable and more capable of distinguishing cracked eggs from intact eggs.

The wavelet scattering network finally constructed in this paper has two cascaded filter banks. The first filter bank has eight wavelets per octave, and the second has one wavelet per octave. As for the selection of filter banks, the experiment proves that the scattering coefficient energy converges rapidly with the deepening of the network, and the energy after the two-layer network structure is about 1% [30], so two cascades of filter banks are constructed in this paper. For the number of wavelets per octave in the filter bank, different experiments as shown in Figure 9b have been made, proving that the combination of (8, 1) has the best result.

**Figure 9.** Comparison of ablation study results. (**a**) Results comparison using wavelet scattering transform versus without wavelet scattering transform methods. (**b**) Comparison of the results of the combination of the number of wavelets per octave of the filter bank.

3.3.3. More Results on Imbalanced and Duck Egg Datasets

It is worth noting that the data in a real industrial scenario are unpredictable.To verify the performance and versatility of the proposed method, the class-imbalanced dataset of eggs collected in this experiment and the duck egg dataset experiment were set up. The distribution of cracks in the duck egg dataset is shown in Figure 10. The experimental results for the class-imbalanced and duck egg datasets are shown in Table 5. The class-imbalanced dataset removed some collected data to simulate an imbalanced state. The dataset has 200 entries, including 169 intact and 31 cracked egg signal data. The MCC (98.0788%) was obtained under the condition of fewer cracked eggs, which is slightly lower than the previous experiments. It is still in the high-accuracy range, fully demonstrating its stability under data imbalance. A total of 267 fresh duck eggs were purchased from the advanced breeding duck incubation base. Signal data of 130 intact and 137 cracked eggs were obtained in this experiment, and an accuracy of 99.6169% was finally obtained. This experiment shows that the method proposed in this paper has good universality and extensibility.

**Figure 10.** Crack size distribution of cracked duck eggs.

#### *3.4. Discussion*

This paper used the micro-current high-voltage discharge method to detect microcracks in eggs, but there is a small amount of literature and patents that investigate this technique. The most studied application for this technique is the case of plastic container leaks. Regarding the range of voltages, some studies [12] suggest that the voltage applied is typically 3000 V∼5000 V DC, but no relevant theoretical description is given. The electrode may cause certain damage to the detected object when it is in direct contact with the detected object. In the previous experiment, 1500 V was used, which may cause damage to eggs that are being incubated. The voltage in this study was set to 1000 V. The results obtained from the above four experiments proved the effectiveness of the proposed method.Especially for the detection of eggs to be hatched, the lower the voltage used, the safer the eggs will be, and the less they will be damaged. In this study, twenty eggs (ten intact and ten microcracked) were selected to conduct classification experiments on the signals extracted from poultry eggs with different voltages. The extracted signals were tested by the existing method [14] and the method proposed in this paper. The results are shown in Figures 11 and 12.

**Figure 11.** Crack detection results of eggs with different voltages by existing method [14]. Where, 0 in the figure represents cracked eggs, and 1 in the figure represents intact eggs; The green line indicates that the tested sample is classified as intact eggs, and the orange line indicates that the tested sample is classified as cracked eggs.

**Figure 12.** Crack detection results of eggs with different voltages by the method proposed in this paper. Where, 0 in the figure represents cracked eggs, and 1 in the figure represents intact eggs; The green line indicates that the tested sample is classified as intact eggs, and the orange line indicates that the tested sample is classified as cracked eggs.

**Table 5.** Method performance and versatility experiments.


The selected eggs were tested using 250 V, 500 V, 750 V, 1000 V, 1200 V, 1400 V, 1500 V, and 1800 V. From Figures 11 and 12, it can be concluded that the existing method and the

method based on the wavelet scattering convolutional network proposed in this paper can be used to distinguish the microcurrent signals obtained from cracked eggs and intact eggs in the voltage between 1000 V and 1500 V. Both methods have detection errors when the voltage is higher than 1500 V. This is because when the voltage is increased, the current signal generated by the system fluctuates strongly, resulting in the voltage breakdown of the intact egg, which will reflect on the current and lead to false detection. The effect of the existing method on the classification of current signals below 1000 V is not obvious because of the weakening of the current response at the crack for voltages below 1000 V. The method proposed in this paper has the characteristics of translation invariance and elastic deformation stability and still maintains a good effect on the classification of current signals between 500 V and 1000 V. When the voltage is less than 500 V, the system cannot generate enough feedback signals, so it is difficult to detect extremely small cracks. The egg crack detection method based on electrical characteristics may cause damage to incubating eggs under high-voltage conditions, while the wavelet scattering convolutional network method proposed in this paper can adapt the sensing voltage from 1500 V to 500 V and can obtain higher detection accuracy on the data with a low signal-to-noise ratio, thus greatly reducing the risk of high-voltage damage to incubating eggs.
