Deep Learning-Based Parasitic Egg Identification From a Slender-Billed Gull’s Nest

Intraspecific nest parasitism is a phenomenon that attracts the attention of biologists since it helps in saving the endangered species such as Slender Billed Gull. The problem comes from the fact that a parasite female lays its eggs in the nest of another female (host) of the same species which causes the abandon of the nest by the host. This behavior causes a significant reduction in future birds number and leads to the expansion of this specie. Thus, there has been an urgent necessity to clean the nest from parasitic eggs. So, our aim is to build an automatic parasitic egg identification system based on egg visual features information. Our system uses deep learning models which have proven their success for image classification. Indeed, our system conduct an egg image’s pre-processing phase followed by Fast Beta Wavelet Network (FBWN) to extract the most efficient descriptors (shape, texture, and color). Then, these features will be inputted to the Stacked AutoEncoder for egg classification. Our proposed system, has been evaluated on 91-egg dataset collected from 31 clutches of eggs in Sfax region, Tunisia. Our model has given a parasitic egg identification accuracy of 89.9% which has outperformed the state-of-the-art method and shows the efficiency and the robustness of our system.


I. INTRODUCTION
Egg-laying parasitism is a behavior seen in a wide range of animal species, including birds, amphibians, fish, and arthropods. In birds, the parasitic creature deposits its eggs in another bird's nest (clutch), shifting the expense of raising its young to the host. Two forms of parasitism can be identified: intraspecific parasitism, which involves members of the same species, and interspecific parasitism, in which the parasite lays eggs in the nest of a different species. Egg-laying parasitism is a reproductive strategy frequently encountered in large number of birds [1]. The Slender-billed gull is one of the bird species which faces the intraspecific parasitism problem [2]. Indeed, Slender-billed gull can lay up to three brown-spotted white eggs in a scrape sparsely lined [3] while in some nests, we can find four or five eggs which means The associate editor coordinating the review of this manuscript and approving it for publication was Antonio J. R. Neves . that this nest contains parasitic eggs [4]. Nests are typically placed 45 cm apart, but in the center of colonies, nests can be as close together as 15 cm (see figure 1) which increase the probability of the egg parasitism.
In fact, the Slender-Billed Gull is one of the species covered by the African-Eurasian Migratory Waterbirds Agreement (AEWA) [5], [6], which aids in the preservation of endangered species. Indeed, for this exact specie, once the female detects a parasitic egg in its nest, it will leave it [2] and the contained eggs will be lost. This will cause an important decrease of the specie future members. So, reducing the egg parasitism from the nest is crucial to save this specie. We therefore suggest a system for identifying slender-billed gull parasitic eggs based on the visual information of the egg in order to avoid this issue. The eggshell visual patterns of different females are closely similar which makes the parasitic egg identification a challenging task [7].
Our idea is to study the hypothesis that parasitic eggs may be distinguished from other eggs in a clutch based on visual features of their eggshells. The principal contributions of this work are: • Developing a method for automatically identifying parasite eggs based on egg visual characteristics will aid in keeping the nest clean, preventing the female from leaving the nest and preserving this species.
• Extracting efficient egg image features (texture, color, and shape) from various inputs (RGB image and alpha mask image) using the powerful Fast Beta Wavelet Network [8]. These features have effectively represented the unique signature of each female eggs.
• Producing the best features and classifying them with the use of the successful Stacked AutoEncoder SAE) model [9], [10], [11] to find the parasitic eggs in each Slender-Billed Gull's nest. In fact, compared to other machine learning and deep learning models, the SAE-based model has demonstrated its usefulness in recognizing the parasite eggs.
Our paper is organized as follows: in section II, we present the related work. While we detail the proposed approach in section III. Afterward, section IV provides the experimental results of our method variants, as well as a comparative study with other methods. Finally, the paper is concluded by giving the main findings and future directions.

II. RELATED WORK
In support of efforts to protect endangered birds such as the Slender-Billed Gulls, recent research works based on egg visual features have been proposed. These works can be divided into two categories: shallow features-based methods [12], [13], [14], [15] and deep learning-based methods [16], [17] (see table 1).
Indeed, many shallow features have been used to characterize the bird's eggs in order to classify them and identify possible parasitism. In [12], a parasitic egg identification method has been proposed. This method identifies the egg of the Cuckoo finch from the egg of the Anomali Spiza host. This method computes a granularity spectrum for each egg region which is issued by applying a fast Fourier transform succeeded by seven octave-wide isotropic band-pass filters. Then, from this spectrum, pattern filter size and pattern proportion energy are computed. Additionally, the color difference between the host and the parasite's eggs and pattern dispersion are extracted from each egg to reinforce the egg characterization. Afterwards, these four features are classified using a logistic regression model performed on a dataset of 309 eggs (224 host eggs and 85 parasitic eggs) collected from 125 clutches. This dataset has been gathered from Choma, District of southern Zambia. An overall explained variance in egg rejection of 31.9% has been reached.
Afterwards, Stoddard et al. [13] proposed an approach to identify the parasitic eggs (cuckoo finch eggs) from tawny-flanked prinia eggs (host) based on several visual features. Indeed, similarly to [12], two low-level features derive After granularity analysis (pattern filter size and pattern proportion energy calculated from the granularity spectrum which is obtained by applying fast Fourier transform and band-pass filtering on the egg region), as well as the egg color difference and the pattern dispersion features, have been extracted to represent the egg. In addition, the Scale Invariant feature transform (SIFT) high-level features extracted by the Nature Pattern Match (NPM) [18] obtained by histogram equalization and median filtering have been extracted to capture the information about the shape and orientation of markings inside the egg. Then, a logistic regression model has been used to predict the egg parasitism. According to this study and evaluated on a generated dataset, the model using the color difference, low-level and high-level pattern features have given 42%, 44% and 14% of explained variance in egg rejection respectively. The best performance has been reached using the low-level features since they are relevant to the bird vision, simple and easy to quantify. While, the higher-level pattern features may be helpful when low-level pattern features and color offer hosts little information. This method has been evaluated on a generated dataset.
In [14], an image classification method was provided for the egg classification task. The aim is to classify each egg into their corresponding clutches (out of 92 clutches) by their visual features. This method uses SpotEgg tool to characterize eggs with 27 features such as spottiness, shape, color and size from calibrated images of Eurasian coot (Fulica atra) specie. These features are classified by the Support Vector Machines (SVM) algorithm. In fact, each egg has been assigned to the most matched clutch. An egg classification accuracy of 53% has been reached.
Furthermore, in [15] a proposed method to identify the parasitic cuckoo egg from the Great Reed Warbler (GRW) and Eurasian Reed Warbler (RW) based on visual features of egg. The aim of this study is to detect the parasitic egg of cuckoo. Then, a granularity spectrum for quantifying spotting pattern, size and shape of egg pattern. Indeed, spectrometry to extract the color of the egg. A dataset of 64 clutches of GRW and 456 clutches of RW has been parasitized by cuckoo eggs, collected from the fishpond area between Mutěnice and Hodonín in South Moravia. Then, these features are classified by an unsupervised method with Hierarchical clustering VOLUME 11, 2023  which yields an accuracy of 45.2%. and with Random Forest an accuracy of 81.1%.
As it can be noticed from the shallow-based features methods previously described and illustrated in Table 1, low parasitic egg identification results have been reached. This can be explained by the unsatisfactory egg characterization using the proposed shallow-the features. Consequently, and due to the high performances of the deep learning models in image classification, recent avian egg classification methods [16], [17] have used these models and given promising results.
In [16], a slender-billed Gull egg classification method based on Convolution Neural Networks (CNN) has been proposed. Indeed, the egg RGB images have been introduced to the CNN to extract the egg features. Then they have been classified with the Softmax algorithm. It has given an egg classification accuracy of 87%. While, using the same CNN model, [17] has reached an egg classification accuracy of 91% and 93% using Softmax and SVM classifiers respectively. This method extracts features from 4 multiresolution images issued by applying the Discrete Wavelet Transform (DWT) of the egg images. Indeed, these two methods [16], [17] have used the CNN model which is considered as a simple deep learning model. In addition, they have been evaluated on a relatively parasitized dataset.
In spite of the recent works on deep learning-based avian egg classification, deep learning models have not been sufficiently leveraged for parasitic egg identification tasks. Consequently, in this paper, we propose a deep-learning-based method to identify the Slender-Billed Gull parasitic egg from their visual feature.

III. PROPOSED APPROACH
Due to the success of deep learning model in image classification, we have adopted it for our Slender-Billed Gull egg parasitism identification method. Actually, our system consists on conducting a preprocessing step on egg images which helps in extracting the most accurate egg features (shape, color and texture features) using the Fast Beta Wavelet Network (FBWN) [8], [19]. Then, all the extracted features are concatenated together and the resulted features are flanked to a Stacked AutoEncoder (SAE) [10], [11] to be more optimized by selecting the most important of them. Finally, the optimal extracted features will be classified using a Softmax algorithm to identify the parasitic eggs. The pipeline of our proposed method is illustrated in figure 2 and the main phases will be described subsequently.

A. PREPROCESSING
In order to extract the most important egg visual features for our method, we have evaluated three variants of preprocessing techniques: RGB egg image resizing into 1024 × 1024 × 3 size, egg image binarization, image alpha blending by computing image alpha mask from the original egg image.
The image binarization has been done by applying different MATLAB binarization functions: imbinarize 1 (see figure 3.b), locally adaptive threshold 2 (see figure 3.c), global image threshold using Otsu's method 3 (see figure 3.d). As it can be seen from figure 3, the locally adaptive thresholding technique gives the most visually effective binarization. In addition, image alpha blending [20], [21] has been widely used for image segmentation [22], [23]. It consists in extracting the image alpha mask 4 by overlaying the locally adaptive thresholding mask to the original RGB image (see figure 4) which will highlight the spot image regions than the RGB image. In the context of the egg images, alpha mask (called also: alpha matte) makes the eggshell spots, which serve as host identifiers, more visible which helps in boosting the extraction of representative egg features. The image alpha mask is computed following equation 1.
where F is the original image, B is the locally adaptive thresholding mask and α = 0.5 is the pixel value in the alpha mask divided by 255 (α between 0 and 1).

B. FAST BETA WAVELET NETWORK FOR FEATURE EXTRACTION
Once the pre-processing step has been conducted, the Fast Beta Wavelet Network (FBWN) analysis is exploited for the rapid extraction of appropriate shape, texture and color features from the egg images. The FBWN success has been demonstrated in a variety works for different applications [19], [24], [25]. A FBWN is a type of neural network that uses wavelet transforms as its basic building blocks to extract the most important features that allow the reconstruction of the input data [8], [19], [26], [27]. It is designed to handle high-dimensional and complex data by efficiently reducing the number of features that better represent the input data. FBWN aims to provide a simple way to exploit the multiresolution analysis. Wavelet has the property of being fast, meaning that it can analyze data quickly while still retaining important information about the underlying patterns in the data.
Thus, the FBWN applies the wavelet transforms (horizontal wavelets ψ Hi , vertical wavelets ψ Vi and diagonal wavelets ψ Di ) and a scaling function φ i to the input image in order to decompose it into multiple frequency bands. Afterwards, a set of convolutional filters are applied to these bands to extract relevant features. Indeed, selected coefficients from the most optimal wavelet coefficients (w Hi , w Vi , w Di ) and the optimal scaling function coefficients (v i ) that provide the best image reconstruction are taken as shape and texture features respectively. While, the color feature is extracted as the first and second color moments of the reconstructed image represented in the HSV color space since it provides better correspondence with human perceptions of color similarities than other color spaces [8], [19]. FBWN-feature extraction is illustrated in figure 5 (for simplicity, random number of neurons and the coefficients are shown).

C. FEATURE FUSION PROCESS
After that the egg features (shape, color, and texture) are extracted by the FBWN (see figure 5), they are concatenated together into one visual feature vector. Then, this resulted feature vector is injected into a stacked autoencoder to generated from it the most significant and important characteristics leading to an optimal parasitic egg identification (see figure 2).

D. STACKED AutoEncoder
In order to improve the quality of the features, we have applied the Stacked AutoEncoder (SAE) which will also classify the images using the SoftMax algorithm in its final layer. A Stacked AutoEncoder is a neural network consisting mainly of numerous layers of basic AutoEncoder (AE) VOLUME 11, 2023 [10], [28]. Figure 6 illustrates a SAE composed of two AEs and a SoftMax layer.
Indeed, an AE is a neural network model that extract a compact representation of input data based on the extracted features in the latent space level (see figure 7). The AE is composed of an encoder which extracts the most valuable features, latent space containing the extracted features (encoded data) and decoder which reconstruct the input data based on the extracted features by minimizing the discrepancy between input data and its reconstruction data [29].
In this work, we have conducted the SAE represented in figure 6 on the image features which have been already extracted with FBWN in order to extract from them more significant features and classify them to identify the parasitic eggs. In fact, as shown in figure 6, the decoder layers of the two AEs have been neglected. So, the input FBWN features are introduced to the first AE to extract more significant features from them (Feature 1). Then, feature 1 is inputted to the second AE to extract more optimal features (Feature 2) which will be injected to the SoftMax layer to classify them and detect the egg parasitism. A backpropagation (also known as fine-tuning) is used to improve the model classification performance. The network is fine-tuned in a supervised manner by retraining it with the training data.
For our proposed approach, we have conducted different preprocessing techniques as mentioned before to help the FBWN to extract accurate shape, texture and color features which will be concatenated in the feature fusion phase and more optimal features are obtained and classified with the SAE to detect the parasitic eggs.
As shown in figure 8, and after multiple experiments (see Table 2), the best accuracy (89.9%) has been reached when the RGB color and the texture features a well as the image alpha mask shape feature generated from the FBWN are concatenated together and inputted to the SAE to identify the parasitic egg.

IV. EXPERIMENTAL STUDY
To evaluate the performance of the proposed method for parasitic egg detection and to determine the best configuration, we performed extensive experiments on the Slender Billed Gull dataset by varying the image preprocessing techniques, the input image features as well as the SAE parameters (see table 2). Our method was implemented using the MATLAB software. Moreover, a comparative study with the state-ofthe-art methods results on the same dataset has been provided (see table 3).

A. DATASET COLLECTION
The dataset used in the paper is formed of 91 Slender-Billed Gull eggs collected from 31 clutches located in Sfax salt flats in Tunisia [2], [6]. Each clutch contains at least 2 eggs of the host (some clutches contain 3 eggs). However, not all the clutches are parasitized. The dataset has been labelled by the biologists by applying genetic test which involve egg breaking. In fact, compared to the dataset used in [16] and [17], the dataset used to evaluate our method has been built with new egg samples which are more challenging in terms of illumination, quality, distance from the camera, etc. In addition, this dataset includes more parasitic eggs (13 parasitic eggs).
To evaluate our method, we have taken around 70% of the dataset as training set (62 eggs) while around 30% of the dataset has been used for testing the models (29 eggs: 13 parasitic eggs and 16 eggs of the host). Each egg image is resized to 1024 × 1024 × 3 (where the third dimension refers to the RGB color space). Samples from our dataset are shown in figure 9.

B. PERFORMANCE EVALUATION METRIC
Several image classification metrics have been used (accuracy, precision, recall, F1 score, variance, etc.) to measure how well the method performs across all classes [30]. To evaluate our method, we have adopted the classification accuracy metric which represents the percentage of the correctly classified test images (see equation 2) since it is the commonly used metric for egg parasitism detection and in order to conduct a comparison study with other methods.

Accuracy =
# of test samples recognized correctly Total number of test samples (2)

C. EXPERIMENTAL SETTINGS
In order to reach the best egg parasitism detection results, different experiments have been conducted while varying the input image preprocessing and extracted features and empirically tuning the SAE parameters. As a result, the best values of the SAE regularization term were: 0.004 for the first AE and 0.002 for the second AE. In addition, the best values for the SAE sparsity proportion were: 0.1 for the first AE and 0.15 for the second AE. While, the best values of the SAE weight sparsity penalty for each configuration are shown in table 2.

D. SINGLE VISUAL INFORMATION-BASED RESULTS
Following our architecture, the extracted visual information (shape, color and texture) from the FBWN is injected to the SAE to select the most important information from it. Thus, in order to test the efficiency of each visual information, we have evaluated them separately. As it can be seen from table 2, the shape feature extracted from the original RGB image has given 48% while the binary image shape resulted from the image binarization technique using the imbinarize Matlab function method (Figure3.b) has given an accuracy of 54.2%. But, the shape of the alpha mask image (which is built based on the locally adaptive thresholding) has given 60.5% which proves the efficiency of the locally adaptive thresholding in valuing the image shape information. However, the RGB image provided the best color feature given an accuracy of 48% in comparison with the image alpha mask which gives an accuracy of 35.5%. Furthermore, the texture information of the RGB image has  given better accuracy (55.7%) compared to the image alpha mask (54.3%). Indeed, the RGB image generates the best color and texture features since it includes these information more naturally that the image alpha mask.

E. RESULTS ENHANCEMENT WITH FEATURE FUSION
After several tests to identify the best single information, we have conducted a feature fusion-based experiments in order to improve the method accuracy. As it can be seen from table 2, merging the RGB image shape, color and texture features has led to an accuracy of 69.7% while merging these features fir the image alpha mask has given an accuracy of 77.4%.
In fact, fusing features from different input images may give better results. That is why, we have evaluated different combinations of features from different images (fusion 1 to fusion 5 in table 2). It is shown in table 2 that the last fusion (fusion 5) has given the best accuracy (89.9%) in comparison with the other features fusions. This can be explained by the fact that fusion 5 is the result of combination the best single information feature together.

F. COMPARISON WITH STATE OF THE ART MODELS
Due to the absence of stat-of-the-art results on the same dataset, we considered testing various classifiers to assess the effectiveness of our model. Table 3 illustrates the performance comparison results for different classifiers. Indeed, we have tested the SVM 5 and the decision tree 6 with the features of Fusion 5 and they achieved an accuracy of 44.8% and 49.3%, respectively. However, as deep learning models are conducted directly on images, the CNN 7 and the Faster-RCNN 8 models have been tested on the egg RGB images and they achieved an accuracy of 57.3% and 68.7%, respectively. While these classifiers have all been tested using the same hardware configurations, the SAE have shown its superiority among them, given an accuracy of 89.9%, as can be shown in table 3 and figure 10.

V. DISCUSSION
From table 2 and as previously presented, we can notice that the RGB image texture and color features are the better than the ones of the image alpha mask input. Indeed, as it can be seen from figure 9, the egg spots texture and color of the different Gulls are relatively different which makes the RGB image texture and color important features for the egg parasitism detection. Whereas, for the shape feature, the image alpha mask performs better than the RGB and the binary images since it provides the most accurate egg spots shapes generated from the locally adaptive thresholding binarization (see figure 3). However, merging different features has giving better accuracy results for both RGB image and image alpha mask (see Table 2). Indeed, after several features fusion evaluations, merging the best single-features (Fusion 5) has given the best egg parasitism detection accuracy (89.9%) which   prove that merging the most powerful features leads to higher results.
In addition, as it can be seen from table 3 and figure 10, the deep learning classifiers (CNN, FasterRCNN and SAE) perform better than the shallow features-based classifiers (SVM and Decision Tree). This proves more the effectiveness of the deep learning models to extract and classify significant visual features. However, the SAE has given the best result among the other deep learning models (89.9%). This can be explained by the fact that CNN and FasterRCNN needs large dataset to be sufficiently trained while the dataset used for this work is relatively of a small size. contrariwise, the SAE can perform well with limited data. In addition, the SAE is simpler model and requires less hyperparameters regularization.
Consequently, our proposed method has exploited the power of the FBWN in extracting accurate visual features and the SAE ability in selecting and classifying these features to detect the parasitic eggs from the Slender-Billed Gull's dataset. The experimental results reached confirm the effectiveness of our method. Nevertheless, our architecture is relatively time consuming since it involves several phases to detect the parasitic egg. But, this is not a big problem  since the task of parasitic egg identification is not a real-time application due that the time criterion constraint is not crucial for the biologist.

VI. CONCLUSION
In this paper, we have proposed a Slender-Billed Gull's parasitic egg identification method based on the egg visual features which contributes in saving this endangered species. Our method extracts powerful features from pre-processed egg image using the FBWN. Then these features are introduced to the SAE to select the most suitable features and classify them by the SoftMax algorithm. The experimental results and the comparative study with other classifiers prove the robustness and efficiency of our method. As for the future works, we plan to use more egg image features and evaluate our method on other egg datasets to confirm more its effectiveness. In addition, our method will be upgraded by including more powerful deep learning models.

DATA AVAILABILITY
Data may be available from the corresponding author upon request.

CONFLICTS OF INTEREST
The authors declare that there is no conflict of interest regarding the publication of this paper.