Skip to main content

Augmenting interpretation of vaginoscopy observations in cycling bitches with deep learning model

Abstract

Successful identification of estrum or other stages in a cycling bitch often requires a combination of methods, including assessment of its behavior, exfoliative vaginal cytology, vaginoscopy, and hormonal assays. Vaginoscopy is a handy and inexpensive tool for the assessment of the breeding period. The present study introduces an innovative method for identifying the stages in the estrous cycle of female canines. With a dataset of 210 vaginoscopic images covering four reproductive stages, this approach extracts deep features using the inception v3 and Residual Networks (ResNet) 152 models. Binary gray wolf optimization (BGWO) is applied for feature optimization, and classification is performed with the extreme gradient boosting (XGBoost) algorithm. Both models are compared with the support vector machine (SVM) with the Gaussian and linear kernel, k-nearest neighbor (KNN), and convolutional neural network (CNN), based on performance metrics such as accuracy, specificity, F1 score, sensitivity, precision, matthew correlation coefficient (MCC), and runtime. The outcomes demonstrate the superiority of the deep model of ResNet 152 with XGBoost classifier, achieving an average model accuracy of 90.37%. The method gave a specific accuracy of 90.91%, 96.38%, 88.37%, and 88.24% in predicting the proestrus, estrus, diestrus, and anestrus stages, respectively. When performing deep feature analysis using inception v3 with the same classifiers, the model achieved an accuracy of 89.41%, which is comparable to the results obtained with the ResNet model. The proposed model offers a reliable system for identifying the optimal mating period, providing breeders and veterinarians with an efficient tool to enhance the success of their breeding programs.

Peer Review reports

Introduction

Effective management of canine breeding plays a crucial role in safeguarding the genetic well-being of dog breeds while simultaneously fostering responsible breeding practices and compliance with legal regulations [1]. Among domesticated animals, bitch has a comparatively longer duration of estrous cycle. Breeders and veterinarians study cyclic changes in hormones and the bitch’s behavior to identify stages of the estrous cycle. Various methods like exfoliative vaginal cytology, serum progesterone assay, and vaginoscopy, have been used to identify stages of the estrous cycle, for breeding management [2, 3]. Vaginoscopy is used to assess changes in the anterior vagina, and thus helps in identifying stages of the estrous cycle in bitches.

Studying the changes in vagina during different stages of the estrous cycle in bitches, helps detect the mating period [4]. The estrous cycle consists of four stages: proestrus, estrus, diestrus, and anestrus [5]. During proestrus, vaginal folds appear swollen with bright red fluid along the folds. During estrus, angulation of the vaginal mucous membrane folds is at its peak with a wide lumen. The rounding out of the mucosal folds along with patchy areas of mucosal hyperemia is suggestive of the onset of diestrus. The anestrus phase is characterized by lesser and rounded mucosal folds.

Determining the optimal timing of mating is of prime importance in controlled breeding. To identify the phase of the reproductive cycle, veterinarians have to examine the physical and behavioral changes in dogs and correlate them with hormonal changes. They observe the color, texture, and vascularization of the tissues using various techniques. Though vaginoscopy has been used widely by veterinarians with fairly accurate results, there are certain challenges related to the process such as suboptimal image quality and increased expertise needed for precise interpretation [6]. The limitations are accentuated when cheaper forms of vaginoscopy are employed. However, now, features can be extracted from images recorded with cheaper vaginoscopes and classified using advanced image processing and machine learning algorithms. Such techniques would be beneficial for veterinarians in identifying optimal mating period from vaginoscopic images.

Feature extraction is a critical component in the prediction of the optimal mating period of female canines. Various features, including shape, texture, and color, can be obtained from vaginoscopic images using feature extraction methods. Texture features of lateral ventricles, extracted using bidimensional multiscale entropy, are used to differentiate Alzheimer’s conditions in brain magnetic resonant (MR) images [7]. Convolutional neural network (CNN) can effectively function as a feature extractor by converting raw pixel data into numerical features, preserving the inherent information present in the original dataset. CNN can capture intricate details and complexities within the image. The derived features can subsequently be utilized in a classifier network or traditional machine learning algorithms for effective image classification [8].

Deep feature extraction leverages the capabilities of deep learning models to automatically learn and extract intricate features from raw image data. This technique offers numerous advantages, including high-level abstraction, transfer learning capabilities, improved accuracy, and reduced overfitting. It simplifies the classification workflow by enabling end-to-end learning and scalability to handle large datasets. Unsupervised and supervised deep feature extraction have been used for the classification of hyperspectral images [9, 10]. Deep feature extraction has been used to detect brain tumors [11], diabetic retinopathy [12], synthetic aperture radar targets [13], and breast cancer [14]. The extreme gradient boosting (XGBoost) algorithm has demonstrated superior accuracy and computational efficiency in classifying orthopedic clinical data compared to other algorithms [15]. Additionally, leveraging a pre-trained DenseNet201 model for learning features from breast cancer histology images, followed by classification with XGBoost, has yielded high predictive accuracy for breast cancer diagnosis [16]. Moreover, employing the XGBoost algorithm for feature extraction has proven effective in quantifying distinctions between low-magnitude earthquakes, explosions, and mining-induced seismic events within a particular region [17]. Deep learning has been effectively used in the evaluation of sperm acrosome health [18] and artificial insemination [19] in boars. It has been possible to detect oestrus and the optimal timing of artificial insemination in cattle using a pressure-sensing radiotelemetric system [20]. Deep learning is effectively used to differentiate between meningiomas and gliomas in canine MR images [21].

Optimization after deep feature extraction is essential for refining feature representations, training models effectively, tuning hyperparameters, regularizing the model, and adapting pre-trained models to specific tasks, ultimately enhancing overall system performance. A popular technique used for optimizing deep neural networks in practical applications is the stochastic gradient descent (SGD). One of the challenging aspects of SGD is the tuning of its learning rate, which serves as a critical hyperparameter and often necessitates periodic adjustments during the training process. In response to this challenge, various adaptive SGD variants have been introduced, including adaptive moment estimation, adaptive delta, adaptive gradient, and root mean square propagation [22]. Binary gray wolf optimization (BGWO) is used to address feature selection problems in the classification of electromyography signals [23, 24], and detection of sickle cell anemia [25]. In the proposed methodology, the BGWO technique is employed to enhance the selection of deep features from the vaginoscopic images of female canines. Various classifiers, such as XGBoost [17], k-nearest neighbors (kNN [26, 27]), support vector machines (SVM) with different kernels [28, 29] and CNN [8] have been effectively used for classifying deep features. In this study, the performance of the proposed method has been compared with that of SVM, with the Gaussian and linear kernel, XGBoost, kNN, and CNN.

Materials and methods

The proposed methodology has five steps as in Fig. 1. The first step involves preprocessing and resizing the input images. This critical phase ensures that the images are brought to a consistent format, enhancing their suitability for subsequent processing. Resizing ensures that all images have the same dimensions, simplifying the subsequent computational steps. All the images are resized using the same software program prior to feeding into the deep learning model. Once the images have been preprocessed and resized, they are fed into the inception v3 [30] and ResNet 152 [31] models for deep feature extraction. This model is a state-of-the-art deep learning architecture that excels at capturing high-level features from images. This step involves passing each image through the neural network, which results in the extraction of a rich set of deep features that encode various visual characteristics, from simple edges to complex object structures. Then, an optimization algorithm is applied to the extracted features, to enhance the efficiency and effectiveness of the system. The refined feature subset, obtained through optimization, is then inputted into machine learning algorithms. Finally, well-established classification algorithms-XGBoost, kNN, SVM, and CNN are applied. All the images are processed using python programming language.

Fig. 1
figure 1

Proposed methodology

Image database

A total of 210 vaginoscopic images of the anterior vagina from healthy bitches, brought for identifying optimal breeding time or for general check-ups, were collected from the database of the College of Veterinary and Animal Sciences, Thrissur, Kerala, India. They are recorded after getting approval from the Institutional Ethic Committee (Ref. No.: RCMTY/054/2020, dated: 15/06/2020). The images were obtained using a Welch Allyn fiber optic sigmoidoscope paired with a DEPSTECH WiFi borescope with a camera resolution of 1280\(\times\)720 pixels. During the vaginoscopic examination, the bitches were made to stand on a table with mild restraint. The perineum and vulval labia were examined and cleansed before the sigmoidoscope, moistened with sterile normal saline (0.9% w/v NaCl), was inserted through the vulva [4]. All images in the dataset were captured using the same protocol to ensure consistency and reliability in the data. The images obtained were classified into different stages of the estrous cycle [4]: proestrus (51 images), estrus (64), diestrus (53), and anestrus (42). The data collection process, integral to the model’s training and validation, was approved by the institutional ethical committee. The stages were further confirmed based on the serum progesterone levels obtained on the same day as the images (proestrus, 1.74 ± 0.017 ng/ml; estrus, 10.61 ± 0.63 ng/ml; diestrus, 33.36 ± 1.69 ng/ml; and anestrus, <1.5 ng/ml).

Deep feature extraction using inception v3 model

Inception v3, a convolutional neural network architecture, is used in this work for its ability to extract rich, high-level features from images. It includes an input layer, an initial convolutional layer, inception modules, auxiliary classifiers, fully connected layers, and an output layer. The network takes an input image, typically of size 350\(\times\)350 pixels, with three color channels (RGB) in the input layer. Inception v3 begins with two convolutional layers with small filter sizes of 3\(\times\)3 and 5\(\times\)5 and a max-pooling layer to extract basic features from the input image. The core of inception v3 consists of an array of inception modules, comprising parallel convolutional layers with varying filter sizes and pooling operations. These modules are designed to capture features at multiple scales and levels of abstraction. Each inception module typically includes 1\(\times\)1, 3\(\times\)3, and 5\(\times\)5 convolutions, as well as max-pooling, and their outputs are concatenated to form a richer feature map. Inception v3 includes auxiliary classifiers with softmax activation during training. These auxiliary classifiers are attached to intermediate layers within the network and help combat the vanishing gradient problem. They contribute to the overall loss function during training but are typically not used during inference. The feature maps obtained from the inception modules are flattened and connected to a series of fully connected layers. These layers progressively reduce the spatial dimensions and ultimately produce the final classification scores. The final output layer consists of softmax activation units, producing class probabilities for image classification [30].

The inception v3 model used in this work has 229 different layers. Three different convolution kernels of sizes 1\(\times\)1, 3\(\times\)3, and 5\(\times\)5 are used for multi-level feature extraction. The model extracts global features using 5\(\times\)5 convolutions, while it captures distributed features through 3\(\times\)3 convolutions in the convolutional layer. The structural specifications and the descriptions of the layers of the inception v3 model used in this work are presented in Tables 1 and 2, respectively.

Table 1 Inception v3 model
Table 2 Layers in proposed inception v3 model

Deep feature extraction using ResNet 152 model

ResNet-152 is an advanced deep convolutional neural network architecture, part of the ResNet family, designed to address the challenges of training very deep networks. It consists of 152 layers, making it one of the deeper variants within this family. The key innovation in ResNet is the introduction of residual blocks, which incorporate shortcut connections to bypass one or more convolutional layers. These skip connections allow the network to learn residual functions instead of directly learning the desired output, effectively mitigating the vanishing gradient problem and enabling the training of very deep models.

The architecture of ResNet-152 is structured with multiple residual blocks, each containing convolutional layers, batch normalization, and ReLU activations. The inclusion of these residual connections facilitates the propagation of gradients through the network, ensuring that the performance does not degrade as the network depth increases. The model concludes with a global average pooling layer and a fully connected layer, making it highly effective for tasks such as image classification and object detection. The ResNet 152 model used in this work has 94 layers. Two different convolution kernels of sizes 1\(\times\)1, 3\(\times\)3, are used for feature extraction. The structural specification and descriptions of layers used in ResNet 152 model is presented in Tables 3 and 4, respectively.

Table 3 ResNet 152 model
Table 4 Layers in ResNet 152 model

Feature optimization and selection

Feature optimization is essential for enhancing model performance, reducing overfitting, and improving computational efficiency by selecting or engineering the most relevant and informative features from the dataset. Continuous gray wolf optimization (CGWO) requires a large number of evaluations, making it computationally expensive for feature selection tasks, especially when dealing with a high-dimensional feature space. Within the context of feature selection, where solutions are constrained to binary \(\{\)0, 1\(\}\) values representing the presence or absence of features, CGWO poses a challenge as it continually updates its positions, adapting to various points within the space. To address this issue, a specialized version of CGWO is required to ensure that solutions align with these binary constraints effectively.

BGWO is an optimization algorithm inspired by the social hierarchy and hunting behavior of grey wolves. It is used to select the most relevant features from the deep features extracted by inception v3. This step reduces the dimensionality of the feature set, enhances the signal-to-noise ratio, and improves the overall performance of the classifiers by focusing on the most informative features. In BGWO, the wolves in the population represent binary solutions, and the algorithm’s operators are adapted to handle binary values. The updating equation for the wolves depends on three position vectors, \(x_{\alpha }\), \(x_{\beta }\), and \(x_{\delta }\), which exert attractive forces on each wolf, directing them toward the top three best solutions. The solutions for the fitness function are named \(\alpha\), \(\beta\), and \(\delta\). In BGWO, the solution pool is binary, and all solutions are located at the vertices of a hypercube [32].

The binary vectors \(x_{1}\), \(x_{2}\), and \(x_{3}\) signify how the wolf’s movement is influenced by its proximity to the \(\alpha\), \(\beta\), and \(\delta\) gray wolves, respectively. These binary vectors are evaluated using Eqs. (1), (4), and (7), respectively. The revised position vector of the gray wolf is constrained to binary values.

$$\begin{aligned} x_{1}^{d}=\left\{ \begin{array}{lcl} 1 & if \left( x_\alpha ^{d}+bstep_{\alpha } ^{d}\right) \ge 1\\ 0 & otherwise \end{array}\right. \end{aligned}$$
(1)

Here \(x_\alpha ^{d}\) represents the position vector of the \(\alpha\) wolf in dimension d, while \(bstep_{\alpha } ^{d}\) is a binary step in d that can be calculated as,

$$\begin{aligned} bstep_{\alpha }^{d}=\left\{ \begin{array}{lcl} 1 & if \left( cstep_{\alpha } ^{d}\right) \ge rand\\ 0 & otherwise \end{array}\right. \end{aligned}$$
(2)

Here rand denotes a randomly generated number from a uniform distribution and \(\in \{0,1\}\). \(x_{d}^{t+1}\) signifies the updated binary position in dimension d at iteration t, and sigmoidal function is defined as,

$$\begin{aligned} cstep_{\alpha }^{d}=\frac{1}{1+e^{-10\left( A_{1}^{d}D_{\alpha }^{d}-0.5\right) }} \end{aligned}$$
(3)
$$\begin{aligned} x_{2}^{d}=\left\{ \begin{array}{lcl} 1 & if \left( x_\beta ^{d}+bstep_{\beta } ^{d}\right) \ge 1\\ 0 & otherwise \end{array}\right. \end{aligned}$$
(4)

Where \(x_\beta ^{d}\) is the position vector of the \(\beta\) wolf in the dimension d, and \(bstep_{\beta } ^{d}\) is a binary step in d that can be calculated as,

$$\begin{aligned} bstep_{\beta }^{d}=\left\{ \begin{array}{lcl} 1 & if \left( cstep_{\beta } ^{d}\right) \ge rand\\ 0 & otherwise \end{array}\right. \end{aligned}$$
(5)

\(cstep_{\beta } ^{d}\) is the continuous-valued step size for dimension d and can be calculated using sigmoidal function as,

$$\begin{aligned} cstep_{\beta }^{d}=\frac{1}{1+e^{-10\left( A_{1}^{d}D_{\beta }^{d}-0.5\right) }} \end{aligned}$$
(6)
$$\begin{aligned} x_{3}^{d}=\left\{ \begin{array}{lcl} 1 & if \left( x_\delta ^{d}+bstep_{\delta } ^{d}\right) \ge 1\\ 0 & otherwise \end{array}\right. \end{aligned}$$
(7)

Where \(x_\delta ^{d}\) is the position vector of the beta wolf in dimension d, and \(bstep_{\delta } ^{d}\) is a binary step in dimension d that can be calculated as,

$$\begin{aligned} bstep_{\delta }^{d}=\left\{ \begin{array}{lcl} 1 & if \left( cstep_{\delta } ^{d}\right) \ge rand\\ 0 & otherwise \end{array}\right. \end{aligned}$$
(8)

\(cstep_{\delta } ^{d}\) is the continuous-valued step size for dimension d and can be calculated using sigmoidal function as follows:

$$\begin{aligned} cstep_{\delta }^{d}=\frac{1}{1+e^{-10\left( A_{1}^{d}D_{\delta }^{d}-0.5\right) }} \end{aligned}$$
(9)

The main updating equation is,

$$\begin{aligned} x_{d}^{t+1}=\left\{ \begin{array}{lcl} 1 & if\ sigmoid\left( \frac{x_{1}+x_{2}+x_{3}}{3}\right) \ge rand\\ 0 & otherwise \end{array}\right. \end{aligned}$$
(10)

The BGWO algorithm is as follows:

  1. 1.

    Initialize the wolf population, denoted as n, with randomly generated binary solutions, and let \(N_{iter}\) represent the number of iterations for the optimization process.

  2. 2.

    Determine solutions for \(\alpha\), \(\beta\), and \(\delta\) based on their fitness.

  3. 3.

    Update \(i^{th}\) wolf position to a binary position according to Eq. (10).

  4. 4.

    Evaluate the positions of individual wolves.

  5. 5.

    Update \(\alpha\), \(\beta\), and \(\delta\).

The fitness function employed in BGWO for assessing the positions of individual gray wolves is as follows:

$$\begin{aligned} Fittness=\alpha \delta _{R}(D)+\beta \frac{\left| C-R \right| }{\left| C \right| } \end{aligned}$$
(11)

Where \(\alpha \delta _{R}(D)\) is the classification quality of condition attribute set R relative to decision D, R is the length of selected feature subset, C is the total number of features, \(\alpha\), and \(\beta\) are parameters corresponding to the importance of classification quality a subset length, \(\alpha \in \{0,1\}\), and \(\beta\) = 1 - \(\alpha\) [32].

Classifications

In this study, the machine learning algorithms, XGBoost, kNN, SVM, and CNN, are utilized to classify the extracted deep features. XGBoost is a powerful machine learning algorithm for classifying structured data. It works by combining lots of simple models, usually decision trees, one after the other. Each new model tries to fix mistakes made by the previous ones, making predictions better and better. XGBoost uses a depth-first approach to grow trees during training and employs pruning techniques to control their size. This prevents the model from growing overly complex and helps in generalization [15].

In kNN, a data point is classified by considering the majority class among its k-nearest neighbors in the feature space. The algorithm calculates the distance between the data point in question and all other data points in the training set, typically using Euclidean distance. It then selects the k-nearest data points based on these distances. The majority class among these neighbors determines the class of the data point being classified [26].

The SVM stands out as a robust supervised learning algorithm employed for tasks involving classification and regression. Various kernels such as Gaussian, linear, and cubic can be used in SVM. Using SVM with the Gaussian kernel is useful for capturing nonlinear relationships within the data. The Gaussian kernel works by mapping the initial feature space into a higher-dimensional realm, to identify a hyperplane that effectively separates data points belonging to distinct classes while optimizing the margin between these classes. This kernel is particularly useful when the data is not linearly separable. SVM with the Gaussian kernel offers high accuracy and robustness, but it is sensitive to the choice of kernel parameters, such as the regularization parameter (R) and the kernel width (\(\sigma\)) [28].

SVM with a linear kernel is particularly useful when the data is linearly separable. It aims to find the optimal hyperplane that maximizes the margin between the classes while minimizing classification errors. This variant of SVM is computationally efficient and can work well when the data exhibits a clear linear boundary. However, it may struggle with complex, nonlinear data distributions where the Gaussian kernel variant might perform better [29].

The classification metrics such as accuracy, sensitivity, F1 score, specificity, precision, matthew correlation coefficient (MCC), and runtime are computed to evaluate the efficiency of classifiers [33].

$$\begin{aligned} Accuracy=\frac{TP+TN}{TP+FP+TN+FN} \end{aligned}$$
(12)
$$\begin{aligned} Sensitivity=\frac{TP}{TP+FN} \end{aligned}$$
(13)
$$\begin{aligned} F1 score=\frac{2TP}{2TP+FP+FN} \end{aligned}$$
(14)
$$\begin{aligned} Specificity=\frac{TN}{TN+FP} \end{aligned}$$
(15)
$$\begin{aligned} Precision=\frac{TP}{TP+FP} \end{aligned}$$
(16)
$$\begin{aligned} MCC=\frac{(TN\times TP)-(FN \times FP)}{\sqrt{(TP+FP)(TP+FN)(TN+FP)(TN+FN)}} \end{aligned}$$
(17)

TP: True positive; TN: True negative; FP: False positive; FN: False negative.

Results

The typical vaginoscopic images of healthy female canines that correspond to different stages of the estrous cycle are presented in Fig. 2. During proestrus, the vaginal tissues of a female canine undergo distinct changes. They appear swollen, congested, and deep red or pinkish. In estrus, the vaginal tissues continue to be swollen and congested, but the color may change to light or pale pink. During diestrus, the vaginal tissues start to return to normal, becoming less swollen and congested. In anestrus, the vaginal tissues appear normal, with no signs of swelling or congestion, and are pale pink or flesh-colored [34].

Fig. 2
figure 2

Representative vaginoscopic images of female canines: a proesturs, b estrus, c diestrus, and d anestrus

The dataset was divided into: a training set and a testing set. The training set comprised 80% of the total dataset, which was further divided into an 80% portion used for training the model and 20% for validation. The testing set constituted the remaining 20% of the dataset and was used to evaluate the performance of the trained model on unseen data.

Preprocessing

The images are first standardized to dimensions of 79\(\times\)79, 151\(\times\)151, and 299\(\times\)299 before being fed into the inception v3 network. The 299\(\times\)299 images provided the most favorable results and is shown in Fig. 3.

Fig. 3
figure 3

Resized images of representative images: a proestrus, b estrus, c diestrus, and d anestrus

Deep feature extraction

A set of 2048 deep features for each of the stages is extracted from the fully connected layer of the inception v3 model and shown in Fig. 4a. Feature distribution for ResNet 152 model is shown in Fig 5a. In the heatmap, the intensity of colors corresponds to the activation level of different features. The color scale ranges from cool blue to warm yellow. The distribution of colors gives an idea of the correlation between the features predicted by the pre-trained network model and the characteristics corresponding to each stage. The horizontal lines in the heatmap represent the 2048 features for each of the four stages. The yellow lines have greater influence in detecting the corresponding stages whereas blue lines indicate less significant features having lesser influence. There is a lack of textural characteristics in anestrus since vaginal tissues appear normal. This results in more blue lines in the heatmap, which reflects the occurrence of less significant features during this phase. During the other three stages, as the vulva changes from rigid to swollen and the discharge changes from bloody to pink, there will be a greater number of the more significant features, as depicted by more yellow lines in the heat map. This suggests that these stages exhibit more pronounced characteristics in comparison to anestrus. The regions that are consistently activated by yellow lines across different reproductive stages indicate specific features that are crucial for distinguishing between different stages.

Fig. 4
figure 4

Heatmap of extracted features a from inception v3 deep model and b after optimization

Fig. 5
figure 5

Heatmap of extracted features a from ResNet 152 deep model and b after optimization

BGWO of features

The optimal feature sets selected by BGWO for inception v3 and ResNet 152 modelare shown by a heatmap in Figs. 4b and 5b respectively. Heatmap highlights the features that contribute more significantly to the accurate identification of reproductive stages. After the optimization process, 946 features are selected based on the optimal fitness value of 0.08 for further classification. The optimal value for the fitness function is determined after 160 iterations. After the optimization, more yellow lines appear in the heatmap for anestrus. Because of the poor textural and color characteristics of this stage [34], the optimization algorithm based on pre-trained deep model output yields fewer dominant features. It will be enough to select a reduced number of dominant features in the estrus stage due to the strong presence of textural and color characteristics [34]. Therefore, in the heatmap after optimization, a greater number of blue lines can be seen in the estrus phase. In contrast, since the diestrus and proestrus stages lack these distinct features, more yellow lines are present. These yellow lines influence the model’s decision in predicting these stages. During the estrus stage, increased hormonal activity induces notable variations in the textural appearance of images, resulting in significant differences in the extracted features and heatmap compared to other stages.

Classification

The classifiers XGBoost [15], kNN [26], SVM [28], and CNN [8] are employed for evaluating the fitness values of the optimization function. Deep features extracted from inception v3 and ResNet 152 models are classified using these classifiers. The choice of kernel in SVM plays a pivotal role in achieving precise classification. In the context of this work, both the linear and Gaussian kernel methods are tested. Three essential tuning parameters come into play, significantly impacting the SVM’s performance. The threshold parameter \(\gamma\) measures the impact of individual data points on the decision boundary. The regularization parameter, R signifies the number of correctly trained points. The third parameter, \(\sigma\), dictates the rate at which the similarity metric converges to zero as training samples move farther apart. These parameters are meticulously fine-tuned to optimize accuracy. For SVM with the Gaussian kernel after 200 iterations, the following values are chosen: \(\gamma\) = 0.2, R = 1, and \(\sigma\) = 0.1.

Performance of inception v3 after and before optimization with various classifiers is shown in Table 5. In the case of inception v3deep model XGBoost after optimization gives a better model accuracy of 89.41%. The specificity, F1 score, sensitivity, precision, MCC, and runtime values for the this approach are notably high at 63.64%, 93.88%, 93.24%, 94.52%, 54.83%, and 1.60 sec respectively, as shown in Table 5. In comparison, the CNN model attains an accuracy of 78.82% in the detection of the optimal mating period. 20% of the dataset is validated as unseen data and is also tested using the model which exhibits specific accuracies of 90.24%, 90.38%, 88.37%, and 88.24% for predicting the proestrus, estrus, diestrus, and anestrus stages, respectively, as in Table 6. The analysis leads to the conclusion that the method, utilizing the XGBoost algorithm for deep feature classification of vaginoscopic images, outperforms other approaches. The impact of distinct features during the estrus stage becomes prominently evident in the heat map after optimization. Consequently, employing the proposed model for classifying vaginoscopic images has led to improved accuracy specifically for images captured during the estrus stage. Further, BGWO with XGBoost exhibits superior performance with commendable specificity, F1 score, sensitivity, precision, MCC, and runtime. It is evident that after optimization, there was a significant improvement in the evaluation parameters. The runtime was reduced from about 30% to 58 %.

Table 5 Performance of various classifiers with Inception V3 deep model
Table 6 Inception v3 deep feature+ XGBoost classifier performance metrics for various stages of canine reproductive cycle

Figure 6 shows the confusion matrix representing the performance of the inception v3 model with the XGBoost classifier across classes. The different outcomes for the classifier’s prediction are represented in a 4\(\times\)4 matrix, where each row and column corresponds to a specific class. The diagonal elements of the matrix represent the TP values for each class, of correct classification. So, for each class, the value on the diagonal represents the number of instances that were correctly classified as belonging to that class. The off-diagonal elements represent the FP and FN values. Specifically, the off-diagonal element (i, j) represents the number of instances of class i that were incorrectly classified as class j.

Fig. 6
figure 6

Confusion matrix of different classes in given dataset for inception v3 deep model+XGBoost

TP values of the four stages are represented by the darkest shade of orange in the diagonal cells of the confusion matrix. The dark orange color emphasizes the correct classification of these instances, highlighting their importance in the model’s performance. TN values are represented by a lighter shade of orange in the non-diagonal cells of the confusion matrix. The lighter shade of orange distinguishes these correct classifications from FPs and FNs, providing visual clarity. FP values are represented by a slightly brighter shade of orange in the cells where the model incorrectly classifies instances of the negative class as positive. The brighter shade of orange alerts the viewer to misclassifications, highlighting areas for improvement in the model. FN values are represented by a pale orange color in the cells where the model incorrectly classifies instances of the positive class as negative. The pale orange color conveys these misclassifications, prompting attention to areas where the model may need adjustments to better capture positive instances. Thus, the various shades of orange effectively distinguish between different types of classifications and highlight areas of success and potential improvement. The dark orange shade in the confusion matrix of the estrus stage represents the strong performance of the inception v3 model in correctly identifying instances in this stage.

The performance of various classifiers with the ResNet 152 deep model after and before optimization is shown in Table 7. The model with optimization for the XGBoost classifier gives an accuracy of 90.37% which outperforms other classifiers. The other classification parameters such as specificity, sensitivity, F1 score, precision, MCC, and, runtime are 50.00%, 92.91%, 94.78%, 96.72%, 78.73 %, and 1.12 sec, respectively. This model also exhibits specific accuracies of 90.91%, 90.38%, 88.37%, and 88.24% for predicting the proestrus, estrus, diestrus, and anestrus stages, respectively, as in Table 8. It is observed that after optimization the valuation parameters have improved much and the runtime was reduced significantly.

Table 7 Performance of various classifiers with ResNet-152 deep model
Table 8 ResNet-152 deep feature+ XGBoost classifier performance metrics for various stages of canine reproductive cycle

Figure 7 shows the confusion matrix representing the performance of the ResNet 152 model with the XGBoost classifier across classes. The diagonal elements (32 for proestrus, 42 for estrus, 32 for diestrus, and 26 for anestrus) correspond to the true positives, indicating correctly classified instances for each stage. The off-diagonal elements represent misclassifications, with false positives and false negatives generally showing lower values (pale orange). This matrix highlights strong predictive performance across the stages, especially in the estrus stage, where the highest number of true positives is observed, indicating that the model is particularly effective in identifying this stage.

Fig. 7
figure 7

Confusion matrix of different classes in given dataset for inception v3 deep model+XGBoost

The study used image processing and machine learning techniques for the accurate prediction of the mating period in female canines. The higher accuracy of XGBoost with the ResNet 152 model reflects its superior performance over SVM, kNN, and CNN in classifying deep features extracted from vaginoscopic images. this model achieved the best results due to its advanced ensemble method, which leverages the strengths of multiple weak learners to enhance predictive accuracy. Its ability to handle feature interactions, robustness to overfitting through regularization, and effective handling of missing data contribute to its superior performance. Further, the proposed method outperformed the other methods, highlighting the applicability of deep feature-based classification in identifying different stages in the female canine reproductive cycle. Performance evaluation was based on sensitivity, F1 score, specificity, precision, accuracy, MCC, and runtime. Implementing the deep learning model streamlines the process, providing critical insights that contribute to informed breeding decisions and improved reproductive management in canine breeding programs.

Conclusion

Identifying stages of the estrous cycle in female canines is a critical aspect of successful breeding management. Vaginoscopy is useful in this regard but is often limited by the cost of high-end equipment required for obtaining quality images. In this study, a comprehensive approach is presented that leverages state-of-the-art computer vision techniques to address this challenge. This methodology involves the extraction of deep features from vaginoscopic images using the ResNet 152 model, followed by classification with XGBoost. This model is compared with inception v3 deep features. Notably, this proposed methodology exhibited exceptional performance, achieving an average accuracy rate of 90.37%. Additionally, metrics such as specificity, sensitivity, F1 score, precision, MCC, and runtime stood at 50.00%, 92.91%, 94.78%, 96.72%, 34.35%, and 1.12 sec respectively, further validating the robustness of the method. Comparative analyses with conventional CNN, kNN, and SVM with a linear and Gaussian kernel, have highlighted the superiority of the proposed approach in accurately detecting the optimal mating period. These findings emphasize the potential practical applicability of the system within the context of canine breeding. In conclusion, the study proposes a reliable method for determining the optimal mating period in female canines, thus helping improve breeding efficiency and success rates.

Limitations

The limitations of this study include the relatively small size and potential lack of diversity in the dataset, which consists of 210 vaginoscopic images. This dataset, while useful, may not fully capture the variability across different breeds, ages, or health conditions of female canines, potentially affecting the generalizability of the model. Additionally, the dataset might exhibit class imbalance, with varying numbers of images for each reproductive stage. This imbalance could influence the performance of the classification algorithms, leading to skewed results. Addressing these limitations may require expanding the dataset to include a broader range of images and employing techniques to mitigate class imbalance, such as oversampling or adjusting class weights, to enhance the robustness and accuracy of the model.

Availability of data and materials

Not applicable.

Data availability

No datasets were generated or analysed during the current study.

References

  1. Soderberg SF. Canine breeding management. Vet Clin North Am Small Anim Pract. 1996;16(3):419–33. https://doi.org/10.1016/S0195-5616(86)50051-6.

    Article  Google Scholar 

  2. Jeffcoate IA, Lindsay FE. Ovulation detection and timing of insemination based on hormone concentrations, vaginal cytology and the endoscopic appearance of the vagina of domestic bitches. J Reprod Fert. 1989;39:277–87.

  3. Hewitt D, England G. Assessment of optimal mating time in the bitch. Practice. 2000;22(1):24-33.

  4. Lindsay FEF. The normal endoscopic appearance of the caudal reproductive tract of the cyclic and non-cyclic bitch: post-uterine endoscopy. J Small Anim Pract. 1983;1–15.

  5. Jochle W, Andersen AC. The estrous cycle in the dog: A review. Theriogenology. 1977;113–40. https://doi.org/10.1016/0093-691X(77)90240-0.

  6. Lévy X. Videovaginoscopy of the canine vagina. Reprod Domest Anim. 2016;31–6. https://doi.org/10.1111/rda.12785.

  7. Veluppal A. Differentiation of Alzheimer conditions in brain MR images using bidimensional multiscale entropy-based texture analysis of lateral ventricles. Biomed Signal Process Control. 2022;78:103974.

    Article  Google Scholar 

  8. Chen Y, Jiang H, Li C, Jia X, Ghamisi P. Deep feature extraction and classification of hyperspectral images based on convolutional neural networks. IEEE Trans Geosci. Remote Sens. 2016;6232–51. https://doi.org/10.1109/TGRS.2016.2584107.

  9. Romero A, Gatta C, Camps-Valls G. Unsupervised deep feature extraction for remote sensing image classification. IEEE Trans Geosci Remote Sens. 2015;1349–62. https://doi.org/10.1109/TGRS.2015.2478379.

  10. Liu B, Yu X, Zhang P, Yu A, Fu Q, Wei X. Supervised deep feature extraction for hyperspectral image classification. IEEE Trans Geosci Remote Sens. 2017;1909–21. https://doi.org/10.1109/TGRS.2017.2769673.

  11. Basheera S, Satya Sai Ram M. Classification of brain tumors using deep features extracted using CNN. J Phys Conf Ser. 2019;1172:012016. https://doi.org/10.1088/1742-6596/1172/1/012016.

    Article  Google Scholar 

  12. Sungheetha A. Design an early detection and classification for diabetic retinopathy by deep feature extraction based convolution neural network. J Trends Comput Sci Smart Technol. 2021;3(02):81–94.

  13. Amrani M, Jiang F. Deep feature extraction and combination for synthetic aperture radar target classification. J Appl Remote Sens. 2017;11(4):042616.

  14. Antropova N, Huynh BQ, Giger ML. A deep feature fusion methodology for breast cancer diagnosis demonstrated on three imaging modality datasets. Med Phys. 2017;5162–71. https://doi.org/10.1002/mp.12453.

  15. Li S, Zhang X. Research on orthopedic auxiliary classification and prediction model based on XGBoost algorithm. Neural Comput Applic. 2020;32:1971–9.

    Article  Google Scholar 

  16. Liew XY, Hameed N, Clos J. An investigation of XGBoost-based algorithm for breast cancer classification. Mach Learn Appl. 2021;6:100154.

    Google Scholar 

  17. Wang T, Bian Y, Zhang Y, Hou X. Classification of earthquakes, explosions and mining induced earthquakes based on XGBoost algorithm. Comput Geoscie. 2023;170:105242.

    Article  Google Scholar 

  18. Keller A, Kerns K. Deep learning, artificial intelligence methods to predict boar sperm acrosome health. Anim Reprod Sci. 2022;247:107110.

    Article  Google Scholar 

  19. Kerns K, Keller A, Pascual IR. Incorporating AI [Artificial Intelligence] into Boar Semen AI [Artificial Insemination]. Anim Reprod Sci. 2022;247:107111.

    Article  Google Scholar 

  20. Nebel RL, Dransfield MG, Jobst SM, Bame JH. Automated electronic systems for the detection of oestrus and timing of AI in cattle. Anim Reprod Sci. 2000;60:713–23.

    Article  PubMed  Google Scholar 

  21. Banzato T, Bernardini M, Cherubini GB, d Alessandro Z. A methodological approach for deep learning to distinguish between meningiomas and gliomas on canine MR-images. BMC Vet Res. 2018;14:317. https://doi.org/10.1186/s12917-018-1638-2.

    Article  PubMed  PubMed Central  Google Scholar 

  22. Kumar KK. An efficient image classification of malaria parasite using convolutional neural network and ADAM optimizer. Turk J Comput Math Educ. 2021;12(2):3376–84.

  23. Too J, Abdullah AR, Mohd Saad N, Mohd Ali N, Tee W. A new competitive binary grey wolf optimizer to solve the feature selection problem in EMG signals classification. Computers. 2018;7(4):58. https://doi.org/10.3390/computers7040058.

    Article  Google Scholar 

  24. Al-Tashi Q, Md Rais H, Abdulkadir SJ, Mirjalili S, Alhussian H. A review of grey wolf optimizer-based feature selection methods for classification. Evol Mach Learn Tech Algorithm Appl. 2020;273–86.

  25. Alagu S, Kavitha G, Bhoopathy Bagan K. A novel deep learning approach for sickle cell anemia detection in human RBCs using an improved wrapper-based feature selection technique in microscopic blood smear images. Biomed Eng/Biomed Tech. 2023;68(2):175–85. https://doi.org/10.1515/bmt-2021-0127.

    Article  Google Scholar 

  26. Huang K, Li S, Kang X, Fang L. Spectral-spatial hyperspectral image classification based on KNN. Sens Imaging. 2016;17:1–13.

  27. Amato G, Falchi F. kNN based image classification relying on local feature similarity. In: Proceedings of the Third International Conference on Similarity Search and Applications. ACM digital library; 2010. p. 101–8.

  28. Kim J, Kim BS, Savarese S. Comparing image classification methods: K-nearest-neighbor and support-vector-machines. In: Proceedings of the 6th WSEAS International Conference on Computer Engineering and Applications, and Proceedings of the 2012 American Conference on Applied Mathematics. ACM digital library; 2012. p. 133–8.

  29. Chandra MA, Bedi SS. Survey on SVM and their application in image classification. Int J Inf Technol. 2021;13(5):1–11.

  30. Dong N, Zhao L, Wu CH, Chang JF. Inception v3 based cervical cell classification combined with artificially extracted features. Appl. Soft Comput. 2020;106311. https://doi.org/10.1016/j.asoc.2020.106311.

  31. Roy P, Chisty MMO, Fattah HA. Alzheimer’s disease diagnosis from MRI images using ResNet-152 Neural Network Architecture. In: 2021 5th International Conference on Electrical Information and Communication Technology (EICT). IEEE Explore; 2021. p. 1–6.

  32. Emary E, Zawbaa HM, Hassanien AE. Binary grey wolf optimization approaches for feature selection. Neurocomputing. 2016;371–81. https://doi.org/10.1016/j.neucom.2015.06.083.

  33. Seliya N, Khoshgoftaar TM, Van Hulse J. A study on the relationships of classifier performance metrics. In: 2009 21st IEEE International Conference on Tools with Artificial Intelligence. IEEE Explore; 2009. p. 59–66.

  34. Christie DW, Bell ET. Studies on canine reproductive behaviour during the normal oestrous cycle. Animal Behaviour. 1972;20(4):621–31.

Download references

Acknowledgements

Not applicable.

Funding

Not applicable.

Author information

Authors and Affiliations

Authors

Contributions

K. Rajan: Writing- Original draft, Software, Methodology, Investigation, Conceptualization G.: Conceptualization, Methodology, Investigation, Formal analysis, Writing- Review and editing, and Supervision Harshan M.:- Supervision, Formal analysis, Methodology and Review Swaminathan: Formal analysis, Investigation, Review and Supervision.

Corresponding author

Correspondence to Bindhu K. Rajan.

Ethics declarations

Ethics approval and consent to participate

The images used in this work were collected from the database of the College of Veterinary and Animal Sciences, Thrissur, Kerala, India. They are recorded after getting approval from the Institutional Ethic Committee ssRef. No.: RCMTY/054/2020, dated: 15/06/2020). The project was approved after review by the Project coordination group on Animal Reproduction of the Kerala Veterinary and Animal Sciences University; subsequently, it was vetted by the faculty research council of the university. The research was carried out on clinical cases at the teaching veterinary clinical complex, College of Veterinary and Animal Sciences Mannuthy, Kerala, India, which functions under the regulations of the Veterinary Council of India.

Consent for publication

Not applicable.

Competing interests

The authors declare no competing interests.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License, which permits any non-commercial use, sharing, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if you modified the licensed material. You do not have permission under this licence to share adapted material derived from this article or parts of it. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

K. Rajan, B., G., V., Harshan M., H. et al. Augmenting interpretation of vaginoscopy observations in cycling bitches with deep learning model. BMC Vet Res 20, 401 (2024). https://doi.org/10.1186/s12917-024-04242-1

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1186/s12917-024-04242-1

Keywords