Skip to main content

Optimization-based convolutional neural model for the classification of white blood cells


White blood cells (WBCs) are one of the most significant parts of the human immune system, and they play a crucial role in diagnosing the characteristics of pathologists and blood-related diseases. The characteristics of WBCs are well-defined based on the morphological behavior of their nuclei, and the number and types of WBCs can often determine the presence of diseases or illnesses. Generally, there are different types of WBCs, and the accurate classification of WBCs helps in proper diagnosis and treatment. Although various classification models were developed in the past, they face issues like less classification accuracy, high error rate, and large execution. Hence, a novel classification strategy named the African Buffalo-based Convolutional Neural Model (ABCNM) is proposed to classify the types of WBCs accurately. The proposed strategy commences with collecting WBC sample databases, which are preprocessed and trained into the system for classification. The preprocessing phase removes the noises and training flaws, which helps improve the dataset's quality and consistency. Further, feature extraction is performed to segment the WBCs, and African Buffalo fitness is updated in the classification layer for the correct classification of WBCs. The proposed framework is modeled in Python, and the experimental analysis depicts that it achieved 99.12% accuracy, 98.16% precision, 99% sensitivity, 99.04% specificity, and 99.02% f-measure. Furthermore, a comparative assessment with the existing techniques validated that the proposed strategy obtained better performances than the conventional models.


Generally, WBC is also called a white corpuscle or leukocyte; the functions of WBC contain a nucleus capable of mobility and defending the human body from disease and infection by feeding cellular debris and foreign materials by creating antibodies [1]. Besides, WBC produces multipotent cells in the bone marrow, also called hematopoietic stem cells [2]. Furthermore, the quantity of WBC in blood indicates the disease; WBC count is the most important subset for completing blood count [3]. Additionally, the average WBC count is approximately 1% in the blood, significantly changing health since immunity depends on the WBC [4, 5]. The different types of WBC play different jobs in our body, such as killing harmful bacteria, recognizing intruders, create antibodies to protect the body against viruses and bacteria [6, 7]. The types of WBC are detailed in Fig. 1.

Fig. 1
figure 1

Types and function of WBC

Generally, WBC begins in the bone marrow, and every blood cell descends after the Hematopoietic Stem Cell (HSC) [8]. Initially, HSC cells are isolated into a myeloid or lymphoid cell, which provides rise to the lymphoid cell line; the family of cells creates T and B cells [9]. As well, the infection affects elevated WBC in terms of WBC count, which is increased by overproduction. Some reasons to increase WBC counts are pregnancy, infections, cancers, asthma, inflammation, allergy, exercise, and Trauma [10, 11]. WBC plays an important role in the immune system. It contains different types for performing the various functions [12]. Also, WBC protects against parasites, viruses, and bacteria [13]. Likewise, a high WBC count causes infection and illness, and a low WBC count causes vulnerable serious infections such as chemotherapy [14, 15].

Hence, the accurate detection and classification of WBCs is significant for effective disease diagnosis and treatment planning. The traditional way of WBC classification relies on manual analysis by trained clinical experts, which is typically time-consuming and prone to errors. These issues in traditional approaches demand an automatic WBC classification strategy. Consequently, the researchers focused on developing a classification mechanism using advanced data analysis tools, including artificial intelligence approaches such as machine learning and deep learning [16]. The AI-based classification models have shown more potential in automating the detection and classification of WBCs compared to traditional approaches regarding accuracy and precision. These models learn by analyzing the complex patterns and relations within the input blood sample images, enabling them to identify the difference between various types of WBCs more effectively [17]. However, AI-based models face significant issues like overfitting, lack of generalizability, data complexity, and high computational time. To address these issues, several types of research are developed by using deep learning techniques such as Capsule network-based deep learning [20], CNN using image processing [21], computer-aided automated system [22], Canonical Correlation Analysis (CCA) [23], and WBC-Net based ResNet and Unet +  + [24] but still having the problem of less successive rate, less prediction accuracy and high error rate [18]. Furthermore, current studies develop techniques like advanced convolutional neural networks [36], Deep neural networks [37], efficient lightweight CNN [38], etc., for detecting and classifying different kinds of WBCs. These models offer improved precision and accuracy than the conventional models. However, they cannot handle the dynamic variations in the input samples, leading to suboptimal performances and reduced efficiency in real-world scenarios. To resolve these issues, a hybrid classification strategy is proposed in the presented work using an optimized deep learning model [19].

The classification of WBC includes three main processes: data preprocessing, feature extraction, and classification [20]. Initially, microscopic input images are trained to the system, and the input images contain small particles such as noise and errors in the staining process [21]. Those errors are removed in the preprocessing layer using suitable filters. Furthermore, features are extracted based on morphological operation, a relationship of colors, and granularity features [22]. Also, extracted features are updated for CNN to classify WBC [23]. However, there are some issues during classification, such as less detection accuracy, high execution time, and errors [24]. The main motive of this current work is there is no proper system to detect and classify WBC because the classification of WBC is essential for identifying health conditions [25]. CNN is also used to classify WBC and attain accurate results, but it contains some issues like noisy errors, less accuracy, and high False Positive Rate (FPR) [26]. Moreover, many developed techniques only involve the process of feature extraction and classification [27]. So, accurate identification and detection of WBC is more risky. These reasons motivated this present research towards designing the optimized deep learning model.

This article is structured as follows: Sect. "Related works" details the related work based on WBC classification. Sect. "Proposed methodology" describes the process of the proposed methodology. Sect. "Results and discussion″mentions the achieved outcomes. Finally, Sect."Discussion" concludes with a conclusion and future work about the developed model.

Related works

Yusuf Yarg and Umit Atila [28] have developed a Capsule network-based deep learning framework for improving the accuracy rate of the data testing process. Thus, the developed capsule network attains better results, such as high accuracy during training data, and the gained accuracy rate is 96.86%. However, it takes more time to classify the WBC because of the data complexity.

Nowadays, image processing is used in biomedical systems to analyze various diseases. Burhanet et al. [29] have proposed a convolutional neural system using image processing methods to improve classification accuracy performance in WBC. Moreover, maximal information coefficient and ridge feature selection are used to extract the relevant features. Finally, the proposed technique obtains a 97.95% successive rate to classify WBC but has the problem of overfitting.

Huseyin et al. [30] developed a computer-aided automated system technique to locate and identify WBC types. It involves five processes: preprocessing, feature extraction, segmentation, feature selection, and classification. Moreover, the developed Convolutional Neural Network (CNN) has extracted the features based on the object by object recognition. It shows better performance in accuracy, yet it has taken a high execution time to classify the WBC.

WBC is used to detect human health conditions related to blood disease. It consists of characterization and identification of sample blood from the patient. Patil et al. [31] developed Connected Component Analysis (CCA) to overcome the problem of multiple cell overlap. Moreover, extracting multiple nuclei patches from the dataset using CCA has reduced classification time, but the false prediction rate is high compared to other techniques.

Yan Lu et al. [32] developed deep learning WBC-Net-based ResNet and Unet +  + techniques. Initially, the designed WBC-Net extracts the multi-scale features based on residual blocks of encoder context-aware feature. Furthermore, the WBC will be segmented based on extracted features, and decoder deconvolution and convolution incorporation will be used to refine the segmentation of the WBC mask. However, the developed technique does not perform a classification process, and the classification of WBC is essential to identifying the types of WBC. Some recent work related to the proposed technique is detailed in the Table 1.

Table 1 Literature survey of medical image analysis

WBCs are a significant part of the immune system, which protects our human body against infectious diseases and foreign invaders. Ahmed et al. [33] developed a hybrid technique for improving the classification of Leukemia. First, the features from the WBC images will be extracted using the salp swarm algorithm. Thus, the developed algorithm identifies and selects the relevant features and also removes the noisy and highly correlated features. The developed technique attains high accuracy and reduces computational complexity but has missed classification problems.

Quan et al. [34] proposed a CNN-based classification network for improving the classification performance of Red Blood Cells (RBC). Consequently, an attentive, dense circular net is designed in CNN to enhance performance. Additionally, classification is processed using feature sets, and the experimental results are compared with other DL techniques. Finally, the network attains 94.61% accuracy, but the error rate is high.

Nowadays, transfer learning techniques are utilized to complete the identification of WBCs in blood smear images. Shahin et al. [35] developed an end-to-end CNN system for the identification of various types of WBCs. Moreover, the developed design improves the classification of WBCs by attaining better classification accuracy. However, computational complexity is high due to the vast amount of data.


WBCs play a significant role in the human immune system by diagnosing pathological conditions such as infections, immune system disorders, etc. Accurate identification and classification of WBCs is important for effective diagnosis of health conditions and proper treatment planning. The conventional way of WBCs classification involves a manual examination of blood samples by trained healthcare professionals. However, this traditional methodology is time-consuming, prone to human error, and demands significant expertise. These drawbacks of the traditional method create a demand for automatic classification mechanisms. The evolution of Artificial Intelligence (AI) techniques in the medical field has paved the way for automatically classifying WBCs. The AI techniques, including deep learning and machine learning approaches, have offered greater WBC classification accuracy than traditional methods.

The AI models are trained using the blood sample images using supervised or unsupervised learning mechanisms. These learning processes enable the AI models to learn the pattern difference between the different types of WBCs, allowing them to classify more accurately. Although various AI-based models have been developed, including deep neural networks, artificial neural networks, support vector machines, etc., they face certain challenges. Firstly, training the AI-based models is complex and time-consuming due to the vast data required for effective training. Secondly, the existing models cannot handle dynamic changes in the blood sample images, leading to inaccurate classifications. Moreover, the overlapping of cells, noise features, etc., in the images makes the existing techniques ineffective, leading to suboptimal classification performance. In addition, scalability and interpretability are the other challenging issues in the existing techniques. These challenges make the existing models ineffective for real-time WBC classification.

Hence, to address these issues, an innovative solution is proposed in this study by leveraging the benefits of the African Buffalo Optimization algorithm and Convolutional Neural Network. The novelty of the approach lies in the seamless integration of deep learning and meta-heuristic optimization algorithms for WBC classification. The adaptive nature of the ABO approach enables the system to understand the dynamic variations in cell appearance, providing optimal classification results. In addition, the integration of ABO into CNN minimizes the computational efforts, thereby lowering the training time and resource demands. Moreover, iterative updation of ABO fitness in the classification layer enhances the scalability and reliability of the approach in WBC classification. The model upgrades its fitness and parameters at each iteration, enabling the system to handle more images and ensuring scalability and reliability in real-world scenarios. The major contributions of the proposed work are described below.

  1. 1.

    This study proposes a unique solution for accurately classifying different types of WBCs by combining the efficiency of African Buffalo Optimization and Convolutional Neural Network.

  2. 2.

    The convolutional layer of CNN performs image preprocessing and feature extraction, which improves the accuracy of the classification process by reducing noise and retaining the most significant features.

  3. 3.

    The fitness of the ABO is integrated into the pooling layer of the CNN approach, which enables the system to segment WBCs by detecting variations in pixel values, leading to better classification performance.

  4. 4.

    Finally, the fully connected layer of the CNN performs WBC classification by understanding the patterns and interconnections within the segmented images.

  5. 5.

    The proposed strategy is implemented in the Python tool, and the results are determined and validated with the existing techniques in terms of accuracy, precision, sensitivity, specificity and f-measure.

Proposed methodology

Generally, White Blood Cells (WBC) provide more relevant information about the health status of human beings. Furthermore, the ratio of cells and deformation shows the diagnosis process of some diseases. Therefore, correct identification and classification of WBC type are essential. The WBC sample image dataset is collected from the net source and trained in the system in this work. Hereafter, a novel African Buffalo-based Convolutional Neural Model (ABCNM) is designed with suitable parameters. Immediately, the training errors are preprocessed in the preprocessing frame, and feature extraction is executed for the segment of the WBC cells. Followed by, extracted features are sent to the classification layers to classify the WBC cells. The proposed architecture is shown in Fig. 2.

Fig. 2
figure 2

Proposed methodology

Here, the best solution for the African buffalo is upgraded in the classification layer to identify the type of WBC cells. Consequently, the segmentation process is performed, and the WBC type is predicted successfully. Thus, the developed framework enhances the classification accuracy of WBC and also performs better in sensitivity and specificity.

Dataset description

The presented study used the publicly available blood sample images dataset from Kaggle, accessible at This dataset contains blood sample images from four types of leukocytes: Neutrophil (NE), Eosinophil (EO), Lymphocyte (LM), and Monocyte (MN). It contains a total of 12,444 images, with each leukocyte type indicated as follows: 3144 images of Eosinophils, 3139 images of Lymphocytes, 3132 images of Monocytes, and 3171 images of Neutrophils. This database was split into ratios of 80:20 for the training and testing process. 80% of the images were used for model training, while 20% of the data was used for model testing. The size of the image present in the dataset is 256 × 192 pixels. Table 2 presents the details of the dataset.

Table 2 Dataset details

Process of ABCNM

Generally, ABCNM is developed to classify the WBC in blood samples. Moreover, the fitness function of AB is updated to the developed CNN, and it contains five layers: input layer, convolutional layer, pooling layer, fully connected layer, and output layer. Furthermore, African Buffalo Optimization (ABO) is based on searching the location of each buffalo depending upon the two sounds, such as the 'maa’ and ‘waa’ sound. Additionally, the maa sound denotes the buffalo's to a safe place, and the waa sound denotes the search place for food. Based on the sound location, buffalos can search for food. The purpose of using AB fitness in the classification layer is to search the types of WBC present in the blood sample using their fitness function and also classify the types of WBC. Thus, the fitness function is denoted as \(f\left( {t_{1} } \right)\) and \(f\left( {t_{2} } \right)\) where, \(f\left( {t_{1} } \right)\) it is used to segment the WBC cells based on extracted features and \(f\left( {t_{2} } \right)\) is used to classify WBC type. The blood sample image is initially tested and trained to the system, and the collected dataset is imported to the developed ABCNM.

First, WBC sample images are trained to the system; trained datasets are updated to the input layer of developed ABCNM, as given in Eq. (1).

$$D\left( i \right) = k\left( {n - 1} \right),k\left( {n - 2} \right),k\left( {n - 3} \right),.......k\left( {n - d} \right)$$

where \(D\left( i \right)\) is denoted as the total quantity of updated datasets \(k\left( {n - 1} \right),k\left( {n - 2} \right),\), which are considered different types of WBC sample datasets. Figure 3 illustrates the ABCNM technique process.

Fig. 3
figure 3

Process of ABCNM technique

  • Preprocessing

Image preprocessing indicates converting the raw input data into an appropriate format for subsequent processing. In the proposed framework, the data preprocessing was performed in the convolutional layer of the CNN model. The input layer of the CNN forwards the input raw database into the convolutional layer for preprocessing. The preprocessing phase involves the removal of errors and noise from the raw blood sample images. The convolutional layer serves as a filter bank that applies various filters to the input image, which helps reduce the noises and other unwanted features from the input image. The errors, training flaws, and noise are filtered through convolutional operations. This is achieved by convolving the input image with specific kernels. In addition, the original input images were converted into grayscale images for effective and accurate classification of WBC. Moreover, a probability density function of preprocessing is obtained using Equation (2).

$$L\left( p \right) = \left[ {L\left( o \right)\frac{{k_{o} }}{{k_{p} }}} \right]$$

where, \(L\left( p \right)\) is represented as probability density function of preprocessing and \(L\left( o \right)\) is denoted as an errors and noise presented in the dataset. Also \(k_{o}\) and \(k_{p}\) is considered as the input blood sample WBC image.

  • Feature extraction

Feature extraction is an essential step in White blood cell classification. The objective of the step is to extract and capture the most relevant and significant attributes from the preprocessed blood sample images. In this phase, the meaningful features and patterns inherent in the data are identified and captured, which plays a crucial role in classifying different types of WBCs. This step reduces the dimensionality of the data and enhances the discriminative power of the classification model. In this process, the distinct features of WBC morphology, including color, shape, texture, size, length, and other spatial characteristics, are extracted through a series of convolution operations in the convolution layer. Additionally, feature extraction is obtained by Eq. (3).

$$K\left( w \right) = \frac{{\left( {K\left( w \right) - F_{a} } \right) \times \left( {F\left( e \right) - H_{a} } \right)}}{{F_{a} - H_{a} }}$$

where, \(K\left( w \right)\) is denoted as feature extraction of collected WBC blood samples and \(F_{a}\) is represented as redundant information of the WBC blood sample. Moreover, \(H_{a}\) it is represented as relevant information about WBC blood samples like size, shape, color, etc.

  • Segmentation

In the pooling layer, the fitness function of ABO is updated for detecting WBC. Moreover, this layer segments and classifies WBC types using the fitness function of AB. In this technique, segmentation is done using mask images, and masking is used to identify the WBC types using color, size, shape, and length features. It helps classify variation among pixels in the segmented region. It can perform parallel prediction on the WBC blood samples. Moreover, the large image can be modified with the help of a binary image because binary images contain zero and non-zero values. Where the gained value is 1 in a binary mask, it is a real value, but if the value is 0 in a binary mask, it means null. Thus, the process of segmentation is obtained by Eq. (4).

$$N_{s} \left( h \right) = \frac{{b\left( t \right) \times K\left( w \right)f\left( {t_{1} } \right) \times D\left( i \right)}}{2}$$

where, \(N_{s} \left( h \right)\) is called the segmentation of WBC blood samples and \(b\left( t \right)\) is denoted as a mask image. Moreover, \(f\left( {t_{1} } \right)\) is denoted as fitness function segmentation based on extracted features. Moreover, WBC types are classified using the proposed ABCNM as detailed in Algorithm.1.

figure a
  • Classification

Then, the segmented datasets are sent to the fully connected layer, which searches for the correct position of WBC types based on the labels such as 0 and 1 and classifies the WBC types such as Monocytes, Lymphocytes, Neutrophils, and Eosinophils. It can classify the WBC types based on all object binary images assigned in unique numeric values. Then, the binary image values are computed using maximum and minimum pixels for each label. Finally, various types of WBC present in the collected blood sample dataset are classified using Eq. (5).

$$T_{p} = N_{s} \left( h \right) \times \frac{D\left( i \right)}{{K\left( w \right)}} \times f\left( {t_{2} } \right)$$

where, \(f\left( {t_{2} } \right)\) denotes the fitness function to classify WBC types from the collected blood samples. At last, the output layer provided the segmented output using a multilayer network and it classify WBC types based on the variation of pixels which is detailed in Fig. 4.

Fig. 4
figure 4

Workflow of developed ABCNM

Results and discussion

This study presented a unique solution for accurate classification of WBCs by combining the efficiency of ABO and CNN. The proposed strategy is modeled and executed in Python, version 3.7.8. Metrics like accuracy, precision, sensitivity, f-measure, specificity, and execution time determine the experimental results. Finally, a comparative assessment was made with the conventional models to validate the effectiveness of the proposed algorithm. Table 3 tabulates the implementation parameters and its description.

Table 3 Implementation parameters and its description

Case study

Classification of WBC is the most common and crucial issue in humans, and our bodies protect it against infections by eliminating bacteria, viruses, fungi, and parasites. The segmentation and classification of WBC is the most challenging task. Initially, blood sample datasets are trained for the system and updated to the proposed ABCNM to execute WBC-type preprocessing, feature extraction, segmentation, and classification. In this case study, several patient datasets with various WBC types are taken, and the input sample blood images of neutrophils, lymphocytes, monocytes, and eosinophils are mentioned in Fig. 5.

Fig. 5
figure 5

Input blood sample images

Consequently, preprocessing executed in the convolution layer removes noise and errors in the dataset. Moreover, the original input images are converted into greyscale images for segmentation. After that, feature extraction is processed to extract the relevant information in the WBC based on size, color, shape, etc.

  • Segmentation

Next, in the Pooling layer, WBC in the blood samples are segmented with the help of fitness function AB of the proposed technique. Initially, mask the WBC using a binary mask. Then, segmentation happens based on the pixel values. Thus, the developed technique enhances the accuracy and performance of the classification of WBC types. Figure 6 (a, b) presents the preprocessed and corresponding segmentation images. The preprocessed images indicate the input image after applying steps like grayscale conversion, noise removal, and standardization, while the segmented image defines the outcome of the segmentation process. It indicates where the white blood cells are located in the blood sample images. The segmented images isolate the WBCs from the background and other cells.

  • Classification

Fig. 6
figure 6

a Preprocessed image, b Segmented image

With the help of a segmented image, developed ABCNM track the position of the WBC in blood sample based on labels 0 and 1. In the fully connected layer, detect the accurate position of WBC also classify the types of WBC based on the segmented results. Moreover, the classified WBC type is detailed in Table 4.

Table 4 Classification of WBC type

Finally, the type of WBC present in the sample blood dataset is identified and the calculation is made using segmented images from the developed ABCNM. Moreover, the developed technique performs outcomes for classifying WBC types.

Model training and testing

This subsection assesses the proposed model's training and testing performance by increasing the epoch. Firstly, the input database is split into ratios of 80:20 for the training and testing phases, and the performances were assessed in terms of accuracy and loss. Table 5 tabulates the implementation parameters and their values.

Table 5 ABCNM model parameters and its values

The accuracy metric measures the effectiveness of the developed model in identifying the pattern difference between the different types of WBCs. In contrast, the loss metric determines the misclassification made by the model in WBC classification. Figure 7 (a, b) presents the training and testing performance of the developed model. The training accuracy demonstrates how quickly the proposed model understands the patterns and relations influencing the types of WBCs, and the improvement of the model's training accuracy over increasing epochs highlights that the designed strategy effectively learns different WBC patterns. On the other hand, testing accuracy indicates the model's generalization efficiency over the unseen data samples (data not used for model training). The enhancement of the model’s testing accuracy over epochs highlights that the presented model identifies and classifies the different types of WBCs precisely on unseen data.

Fig. 7
figure 7

Training and testing performance: a accuracy, b loss

Consequently, the training loss quantifies the deviation between the actual and the predicted outcomes within the training sequence. It measures how effectively the proposed model fits into the training data. The testing loss defines the difference between the predicted and actual outcomes on real-world data (unseen data). It measures how effectively the developed algorithm applies the learned information on unknown data and predicts the WBC types. Reducing training and testing accuracy highlights the model's learning efficiency and reliability across real-world scenarios.

The confusion matrix is a tabular representation of the performance of the classification model. It enables us to understand how effectively the classification model differentiates the different types of WBCs: NE, EO, LM, and MN. It evaluates the classification performance using four different metrics, namely: True Positive (TP), False Positive (FP), True Negative (TN), and False Negative (FN). TP indicates the scenarios where the model correctly identifies the specific class of WBC, while FP defines scenarios where the model incorrectly classifies the specific class of WBCs. TN represents the case where the model accurately predicts the absence of the specific WBC class. At the same time, FN indicates the scenario where the model inaccurately identifies the absence of a specific WBC class. Figure 8 presents the confusion matrix of the proposed strategy.

Fig. 8
figure 8

Confusion matrix

Performance metrics

The implementation work of the developed ABCNM is done using the Python tool, and parameters like accuracy, sensitivity, specificity, execution time, F1-measure, and precision are calculated. Moreover, the developed approach is validated using existing methods like the Classification of WBC using Capsule Networks (CN) [28], the Classification of WBC using CNN-based Feature Selection Technique (FST) [29], WBC detection and classification-based Regional CNN (RCNN) [30], WBC image classification using Canonical Correlation Analysis (CCA) [31], and WBC classification based Optimized Swarm (OS) [33].


Accuracy is defined as the degree of calculation of the efficiency of the proposed model functioning. Also, it is the fraction of properly expected observance of all the observations that are expressed in Eq. (6),

$$A = \frac{{T_{p} + T_{n} }}{{T_{p} + T_{n} + F_{p} + F_{n} }}$$

where, \(T_{p}\) is denoted as accurate prediction and exact segmentation,\(T_{n}\) is denoted as accurate prediction and incorrect segmentation, \(F_{p}\) is considered as inaccurate prediction and exact segmentation, and \(F_{n}\) is denoted as inaccurate prediction and incorrect segmentation of WBC. Moreover, accuracy comparison with the existing technique is detailed in Fig. 9. Generally, increasing the number of samples helps to reduce overfitting when training and testing also increase the generalization of our model. Increasing the amount of data automatically increases the accuracy of the testing and training. The benefits of increasing sample datasets are high speed, better prediction, classification results, and reduced cost.

Fig. 9
figure 9

Comparison of accuracy

The developed technique's achieved accuracy rate is compared with other existing methods such as CN, FST, RCNN, OS, and CCA. Moreover, the RCNN replica attained 96%, and the FST technique gained 94.88%. Also, the CN and OS techniques' gained accuracy rates are 96.86% and 96.11%, respectively. The developed ABCNM attained high accuracy while comparing other techniques to classify WBC as 99.12%.


This process has been evaluated to identify the correct positive estimates that are aligned with the overall positive estimates. Also, precision is the proportion of WBC classification, which is computed using Eq. (7),

$$P = \frac{{T_{p} }}{{T_{p} + F_{p} }}$$

The precision of the proposed ABCNM model is calculated and validated using prevailing methods like CN, RCNN, FST, CCA, and OS approaches. Initially, the RCNN technique gained a 96% precision rate, and the CN replica achieved 92.50% precision using a 2000 sample dataset. Moreover, the FST and CCA methods gained a 94.75% and 92.5% precision rate. Finally, the developed ABCNM technique gained 98.16% in precision rate. Thus, the comparison of precision rate is detailed in Fig. 10.

Fig. 10
figure 10

Comparison of Precision

Here, the existing approaches have achieved a lower precision of only almost 97%. Additionally, the developed ABCNM approach has obtained a higher precision value of 98.16% than other methods.


The calculation is based on precision and recall measurements to recognize the efficiency of tracing images, which is measured using Eq. (8),

$$F - measure = 2\left( {\frac{P*R}{{P + R}}} \right)$$

Let P denote the precision value, and R represents the recall value. The F1-score of the proposed ABCNM model is calculated and validated using existing methods like OS, FST, and CCA approaches. Initially, the FST technique gained 95% in F-measure, and the OS replica achieved 98.5% in precision for using a 2000 sample dataset. Moreover, the CCA method gained a 92% precision rate. Finally, the developed ABCNM technique gained an F-measure rate of 99.02%. Thus, the comparison of the F-measure rate is detailed in Fig. 11. Here, the existing approaches achieved a lower F1-score, and the proposed model has attained a higher F1-score value of 99.02% than other methods.

Fig. 11
figure 11

Comparison of F-measure


Sensitivity calculates the precise number of predicted true positives. Also, the probability of segmenting the WBC is measured using Eq. (9),

$$S_{N} = \frac{{T_{p} }}{{T_{p} + T_{n} }}$$

The sensitivity of the proposed ABCNM model is calculated and validated using existing methods like OS, CN, RCNN, FST, and CCA approaches.

The developed technique's achieved sensitivity rate is compared with existing methods such as CN, FST, RCNN, OS, and CCA. Moreover, the RCNN replica attained 98%, and the FST technique gained 95%. Also, the CN and OS techniques gained sensitivity rates of 92.50% and 93%, respectively.

The existing approaches have achieved a lower sensitivity of almost 98% for the 2000 data size. This ABCNM method has achieved a 99% higher sensitivity value than other methods, which proves the effectiveness of the developed model. The comparison of sensitivity is graphically represented in Fig. 12.

Fig. 12
figure 12

Comparison of Sensitivity


Specificity is defined as the degree to which the number of true negatives recognized accurately is determined. Specificity is also employed to calculate the efficiency of detecting WBC using segmented images. The mathematical expression to calculate specificity is detailed in Eq. (10).

$$S = \frac{{T_{n} }}{{T_{p} + T_{n} }}$$

The achieved specificity rate of the developed technique is compared with other existing methods such as CN, OS, and CCA. Moreover, the CN replica attained 98.01 for using 500 sample WBC datasets. +.Also, OS and CCA techniques gained specificity rates are 95% and 97%, respectively. The developed ABCNM attained high specificity while comparing other techniques to classify WBC as 99.04%. The comparison of specificity is illustrated in Fig. 13.

Fig. 13
figure 13

Comparison of Specificity

Execution time

The execution time defines the time taken by the developed strategy to perform tasks such as data preprocessing, feature extraction, segmentation, classification, and optimization. It defines the computational efficiency of the model in classifying the different types of WBCs. The Fig. 14 presents the computational time comparison.

Fig. 14
figure 14

Execution time comparison

Here, the execution time of the developed algorithm was compared and validated with existing techniques such as CN, OS, FST, RCNN, and CCA. These models consumed 12 s, 13 s, 17 s, 9 s, and 11 s, respectively, to perform the above tasks, while the designed strategy incurred a minimum execution time of 4 s. The reduction of execution time in the proposed algorithm validates its computational efficiency.

ROC curve comparison

The Receiver Operating Characteristic (ROC) curve indicates the graphical representation classification performance of the developed model in WBC categorization. The ROC curve plots the true positive rate (sensitivity) against the false positive rate (1-specificity) across a range of threshold values. This enables us to determine how well the classification model differentiates between different classes of WBCs. The Area Under the ROC Curve (AUC) in the ROC curve determines the model’s discrimination efficiency.

An AUC of 1 represents perfect classification and vice versa. High AUC values indicate that the algorithm effectively differentiates between various types of white blood cells, leading to more reliable diagnostic outcomes. Figure 15 compares the ROC curve of the proposed model with conventional models like CN and RCNN. The proposed strategy achieved an AUC of 0.99, perfectly classifying the WBC types. ROC curve 1 defines the AUC of RCNN, while ROC curve 2 defines the AUC of CN. The ROC curve 3 indicates the curve achieved by the proposed strategy.

Fig. 15
figure 15

AUC and ROC Curves Comparison

Comparison with hybrid methods

In this module, the performance of the proposed strategy was compared with the hybrid classification models. The existing techniques included in the comparative evaluation include deep convolutional autoencoder (DCAE) [39], Grey Wolf Optimization with Discrete Charlier-Meixner hybrid polynomials (GWO-DCMP) [40], Hybrid Mayfly Algorithm with Particle Swarm Optimization (HMA-PSO) [41], and Support Vector Machine-Convolutional Neural Network (SVM-CNN) [42]. The parameters used for comparative assessment include accuracy, precision, sensitivity, f-measure, and specificity.

The accuracy represents the overall effectiveness and correctness of the proposed strategy in classifying WBCs. The existing models, including DCAE, GWO-DCMP, HMA-PSO, and SVM-CNN, obtained an accuracy of 94.62%, 96.17%, 92.65%, and 94.36%, respectively, while the proposed strategy obtained an accuracy of 99.12%. The significant enhancement of accuracy indicates the proposed strategy classifies the WBCs more accurately than the conventional models. This illustrates that the integration of ABO into the CNN approach improves the classification of WBCs, providing a promising solution for real-time WBC classification. On the other hand, precision measures the model's effectiveness in accurately identifying the true positives from all positive instances. The above-stated conventional models achieved a precision of 94.18%, 95.68%, 91.37%, and 94.48%, respectively, while the proposed strategy obtained a higher precision of 98.16%. The improved precision of the developed algorithm highlights its effectiveness in classifying the specific class of WBCs. Consequently, the sensitivity quantifies the model's ability to identify all relevant instances in WBC classification. The existing techniques, such as DCAE, GWO-DCMP, HMA-PSO, and SVM-CNN, earned sensitivity of 94.34%, 95.68%, 91.37%, and 94.48%, respectively, while the developed algorithm achieved 99% sensitivity. The higher sensitivity rate of the proposed methodology highlights the model's effectiveness in precisely detecting all relevant instances. Finally, the f-measure performance was compared and validated with the existing hybrid models. The f-measure metric provides a balanced evaluation of system performances considering positive and negative cases. The above-stated conventional models obtained f-measures of 94.37%, 95.06%, 92.33%, and 94.05%, respectively. However, the proposed strategy earned a higher f-measure of 99.02%, indicating that it accurately classifies both positive and negative instances. Table 6 presents the comparative evaluation of the proposed model's performance with the existing techniques.

Table 6 Comparison with hybrid models

The comprehensive comparative evaluation clearly shows that the proposed strategy achieved improved results compared to the existing hybrid models. These improved outcomes depict its effectiveness and robustness in identifying and classifying the different types of WBCs. This also highlights that integrating African Buffalo Optimization into the Convolutional Neural Network seamlessly enhances the classification of WBCs.


The proposed ABCNM model attained the best results in accuracy, sensitivity, specificity, F-measure, precision, and execution time. Thus, the developed scheme removed the training flaws in the initial stage. At next, extract features based on colours, morphological operation, and granularity features. The graphical representation of ROC curve is shown in Fig. 16.

Fig. 16
figure 16

ROC curve

Moreover, segmentation is executed in the pooling layer and WBC is classified in the fully connected layer. Thus, the developed ABCNM technique enhances the performance of WBC classification.

The outstanding metrics comparisons are tabulated in Table 7, in all parameter validation, the proposed ABCNM has gained the finest results. Moreover, they gained less execution time as 40 ms, high sensitivity as 99% and high classification accuracy as 99.12%. Hence, the robustness of the proposed ABCNM is verified and it can classify WBC.

Table 7 Overall performance metrics

Conclusions and future work

A novel ABCNM is developed to classify WBC type in the blood sample, enhancing classification accuracy. Here, blood sample images are taken as input images and trained in the system. The developed ABCNM involves preprocessing, feature extraction, segmentation, and classification. Moreover, the proposed technique is processed on blood sample datasets, and the WBC is finally segmented. Furthermore, segmented images are employed in the fully connected layer to track the position of the WBC and classify the WBC type.

The developed technique has also achieved better accuracy, precision, F-measure, recall, sensitivity, execution time, and error rate. Thus, it achieved 99.12% accuracy in classifying WBC types. Comparing the past methods, it has shown a 2% accuracy improvement for classifying WBC types such as neutrophil, lymphocyte, eosinophil, and monocyte.

Although the proposed strategy achieved improved outcomes in WBC classification, it faces certain challenges. Firstly, the classification performance of the developed algorithm relies on the quality and quantity of the data used, which makes the system data-dependent and restricts its application in real-world scenarios. Secondly, the proposed algorithm may struggle to handle imbalanced datasets, reducing its classification. The other limitation of the study is that it is not tested or validated across diverse databases, which restricts its generalization efficiency. Hence, future work should concentrate on developing a multi-objective classification model, which produces accurate results irrespective of the quality and quantity of the data used in model training. Also, future work should focus on evaluating the developed strategy across imbalanced and diverse blood sample image databases to ensure its generalization across real-world scenarios.

Availability of data and materials

Data sharing is not applicable to this article as no new data were created or analyzed in this study.

Code availability

Not applicable.


  1. Saghiv MS, Michael SS. The immune system basic exercise physiology. Cham: Springer; 2020.

    Book  Google Scholar 

  2. Chen X, et al. Bone marrow myeloid cells regulate myeloid-biased hematopoietic stem cells via a histamine-dependent feedback loop. Cell Stem Cell. 2017;21(6):747–60.

    Article  Google Scholar 

  3. Ruberto Di, Cecilia AL, Putzu L. Detection of red and white blood cells from microscopic blood images using a region proposal approach. Comput Biol Med. 2020;116:103530.

    Article  Google Scholar 

  4. Wirth MD, et al. The dietary inflammatory index is associated with elevated white blood cell counts in the national health and nutrition examination survey. Brain, Behavior Immunity. 2018;69:296–303.

    Article  Google Scholar 

  5. Gupta D, et al. Optimized binary bat algorithm for classification of white blood cells. Measurement. 2019;143:180–90.

    Article  Google Scholar 

  6. Maresso AW. Innate immunological defensesagainst bacterial attack. In: Maresso AW, editor. Bacterial Virulence. Cham: Springer; 2019. p. 31–46.

    Chapter  Google Scholar 

  7. Schuppan D, Gisbert-Schuppan K. "Immunology of the intestine wheat syndromes. Cham: Springer; 2019. p. 11–23.

    Book  Google Scholar 

  8. Wolfien M, et al. Hematopoietic stem-cell senescence and myocardial repair-Coronary artery disease genotype/phenotype analysis of post-MI myocardial regeneration response induced by CABG/CD133+ bone marrow hematopoietic stem cell treatment in RCT PERFECT Phase 3. EBioMedicine. 2020;57:102862.

    Article  Google Scholar 

  9. Giger S, et al. A single metabolite which modulates lipid metabolism alters hematopoietic stem/progenitor cell behavior and promotes lymphoid reconstitution. Stem cell reports. 2020;15(3):566–76.

    Article  Google Scholar 

  10. Ghosh S, et al. A review on the effect of COVID-19 in type 2 asthma and its management. Int Immunopharmacol. 2021;91:107309.

    Article  Google Scholar 

  11. Khazdair MR, et al. A qualitative and quantitative comparison of Crocus sativus and Nigella sativaimmunomodulatory effects. Biomed Pharmacother. 2021;140:111774.

    Article  Google Scholar 

  12. Harshanand BA, Sangaiah AK. Comprehensive analysis of deep learning methodology in classification of leukocytes and enhancement using swish activation units. Mobile Netw Appl. 2020;25(6):2302–20.

    Article  Google Scholar 

  13. Muriel J, et al. Ontogeny of leukocyte profiles in a wild altricial passerine. J Comp Physiol B. 2021;191(1):195–206.

    Article  Google Scholar 

  14. Abdul-Jawad S, et al. Acute immune signatures and their legacies in severe acute respiratory syndrome coronavirus-2 infected cancer patients. Cancer Cell. 2021;39(2):257–75.

    Article  Google Scholar 

  15. Zeng Z, et al. Longitudinal changes of inflammatory parameters and their correlation with disease severity and outcomes in patients with COVID-19 from Wuhan, China. Crit Care. 2020;24(1):1.

    Article  Google Scholar 

  16. Baydilli YY, Atila U, Elen A. Learn from one data set to classify all–a multi-target domain adaptation approach for white blood cell classification. Computer Methods Programs Biomed. 2020;196:105645.

    Article  Google Scholar 

  17. Ma Li, et al. Combining DC-GAN with ResNet for blood cell image classification. Med Biol Eng Comput. 2020;58(6):1251–64.

    Article  Google Scholar 

  18. Teng, Chieh-Fang, et al. 2021 "Convolutional neural network-aided bit-flipping for belief propagation decoding of polar codes." ICASSP 2021–2021 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP). IEEE.

  19. Sevinc O, et al. White blood cell classification using genetic algorithm-enhanced deep convolutional neural networks. In: Arabnia HR, Ferens K, de la Fuente D, Kozerenko EB, Varela JAO, Tinetti FG, editors., et al., Advances in Artificial Intelligence and Applied Cognitive Computing. Cham: Springer; 2021. p. 29–43.

    Chapter  Google Scholar 

  20. Al-Dulaimi K, Khudhair, A, et al. "Classification of white blood cell types from microscope images: Techniques and challenges. In: Mendez-Vilas A, Torres-Hergueta E, editors., et al., Microscopy science: last approaches on educational programs and applied research (Microscopy Book Series, 8). Spain: Formatex Research Center; 2018. p. 17–25.

    Google Scholar 

  21. Battiato, Sebastiano, et al. 2020 "Detection and classification of pollen grain microscope images." Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops.

  22. Li L, et al. Recent advances in artificial intelligence and machine learning for nonlinear relationship analysis and process control in drinking water treatment: a review. Chem Eng J. 2021;405:126673.

    Article  Google Scholar 

  23. Tavakoli S, et al. New segmentation and feature extraction algorithm for classification of white blood cells in peripheral smear images. Sci Rep. 2021;11(1):1–13.

    Article  MathSciNet  Google Scholar 

  24. Saadatnejad S, Oveisi M, Hashemi M. LSTM-based ECG classification for continuous monitoring on personal wearable devices. IEEE J Biomed Health Informat. 2020;24(2):515–23.

    Article  Google Scholar 

  25. Ferdosi, Bilkis Jamal, SharmileeNowshin, and Farzana Ahmed Sabera. 2018 "White blood cell detection and segmentation from fluorescent images with an improved algorithm using k-means clustering and morphological operators." 2018 4th International Conference on Electrical Engineering and Information & Communication Technology (iCEEiCT). IEEE,.

  26. Özyurt F. A fused CNN model for WBC detection with MRMR feature selection and extreme learning machine. Soft Comput. 2020;24(11):8163–72.

    Article  Google Scholar 

  27. Hong K-S, Jawad Khan M, Hong MJ. Feature extraction and classification methods for hybrid fNIRS-EEG brain-computer interfaces. Front Human Neurosci. 2018;12:246.

    Article  Google Scholar 

  28. Baydilli YY, Atila Ü. Classification of white blood cells using capsule networks. Comput Med Imaging and Graph. 2020;80:101699.

    Article  Google Scholar 

  29. Toğaçar M, Ergen B, Cömert Z. Classification of white blood cells using deep features obtained from convolutional neural network models based on the combination of feature selection methods. Appl Soft Comput. 2020;97:106810.

    Article  Google Scholar 

  30. Kutlu H, Avci E, Özyurt F. White blood cells detection and classification based on regional convolutional neural networks. Med Hypotheses. 2020;135:109472.

    Article  Google Scholar 

  31. Patil AM, Patil MD, Birajdar GK. White blood cells image classification using deep learning with canonical correlation analysis. IRBM. 2021;42(5):378–89.

    Article  Google Scholar 

  32. Lu Y, et al. WBC-Net: a white blood cell segmentation network based on UNet++ and ResNet. Appl Soft Comput. 2021;101:107006.

    Article  Google Scholar 

  33. Sahlol AT, Kollmannsberger P, Ewees AA. Efficient classification of white blood cell leukemia with improved swarm optimization of deep features. Sci Rep. 2020;10(1):1–11.

    Article  Google Scholar 

  34. Quan Q, Wang J, Liu L. An effective convolutional neural network for classifying red blood cells in malaria diseases. Int Sci Comput Life Sci. 2020;12(2):217–25.

    Google Scholar 

  35. Shahin AI, et al. White blood cells identification system based on convolutional deep neural learning networks. Comput Method Program Biomed. 2019;168:69–80.

    Article  Google Scholar 

  36. Ghaderzadeh M, Hosseini A, Asadi F, Abolghasemi H, Bashash D, Roshanpoor A. Automated detection model in classification of B-lymphoblast cells from normal B-lymphoid precursors in blood smear microscopic images based on the majority voting technique. Sci Program. 2022;2022:1–8.

    Google Scholar 

  37. Fasihfar Z, Rokhsati H, Sadeghsalehi H, Ghaderzadeh M, Gheisari M. AI-driven malaria diagnosis: developing a robust model for accurate detection and classification of malaria parasites. Iranian J Blood Cancer. 2023;15(3):112–24.

    Article  Google Scholar 

  38. Hosseini A, Eshraghi MA, Taami T, Sadeghsalehi H, Hoseinzadeh Z, Ghaderzadeh M, Rafiee M. A mobile application based on efficient lightweight CNN model for classification of B-ALL cancer from non-cancerous cells: a design and implementation study. Informat Med Unlocked. 2023;39:101244.

    Article  Google Scholar 

  39. Elhassan TA, Rahim MSM, Zaiton MHS, Swee TT, Alhaj TA, Ali A, Aljurf M. Classification of atypical white blood cells in acute myeloid leukemia using a two-stage hybrid model based on deep convolutional autoencoder and deep convolutional neural network. Diagnostics. 2023;13(2):196.

    Article  Google Scholar 

  40. Tahiri MA, Bencherqui A, Karmouni H, Amakdouf H, Sayyouri M, Qjidaa H. White blood cell automatic classification using deep learning and optimized quaternion hybrid moments. Biomed Signal Process Control. 2023;86:105128.

    Article  Google Scholar 

  41. Yentrapragada D. Deep features based convolutional neural network to detect and automatic classification of white blood cells. J Ambient Intell Humaniz Comput. 2023;14(7):9191–205.

    Article  Google Scholar 

  42. Olayah F, Senan EM, Ahmed IA, Awaji B. Blood slide image analysis to classify WBC types for prediction haematology based on a hybrid model of CNN and handcrafted features. Diagnostics. 2023;13(11):1899.

    Article  Google Scholar 

Download references


Not applicable.

Author information

Authors and Affiliations



Author 1 has worked on the problem statement and drafted the entire manuscript with experimental results. Author 2 reviewed the manuscript and guided with valuable inputs.

Corresponding author

Correspondence to Tulasi Gayatri Devi.

Ethics declarations

Ethics approval and consent to participate

Not applicable.

Consent for publication

Informed consent does not apply as this was a retrospective review with no identifying patient information.

Human and animal rights

This article does not contain any studies with human or animal subjects performed by any of the authors.

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 4.0 International License, which permits use, sharing, adaptation, 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 changes were made. 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

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Devi, T.G., Patil, N. Optimization-based convolutional neural model for the classification of white blood cells. J Big Data 11, 90 (2024).

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: