1 Introduction

Blood is an essential and dispersed fluid that distributes oxygen, nutrients, and energy to body cells while also removing waste and carbon dioxide [1]. WBCs, commonly referred as leukocytes or immunity cells, play an important function in the human immune system. They are produced in the bone marrow and circulate in the bloodstream. Therefore, they assist in the protection from diseases like leukemia, COVID-19 (coronavirus disease 2019), and other infections. Among these, leukemia is a form of blood cancer that is diagnosed by pathologists and is characterized by an abnormal proliferation of WBCs in the bone marrow. The American Cancer Society claims that leukemia is one of the most hazardous illness, with an estimated 61,780 cases and 22,840 fatalities in 2019 (accessed on 1 March 2021) [2]. The difference between normal and leukemic cells can be seen in Fig. 1. Global Cancer Observatory [3] shows approximately 474,519 cases were reported in 2020, with 311,594 deaths recorded in the United States (US). Within the same calendar year, in India leukemia cases observed were 48,419 making it the seventh most common form of cancer in the country [4].

Fig. 1
figure 1

Difference between normal (a) and leukemic cells (b)

For many years, pathologists have relied on microscopic examination of PBS to diagnose hematological diseases [5]. Counting leukocytes under a microscope is a perplexing and painstaking task and is heavily reliant on the pathologist’s abilities. To reduce subjectivity and burden, we can rely on cell morphology analysis with the help of an automated system. The following are the suggested method’s primary contributions in comparison to state of the art:

  1. 1.

    Many authors evaluate their segmentation performance approach on datasets that are private. The suggested technique has been validated using currently available datasets. We used microscopic blood smear images from ALL-IDB1, cellavision, and LISC datasets.

  2. 2.

    We proposed a robust combination of color thresholding, marker-based watershed segmentation, and localization of leukocytes.

  3. 3.

    Peak local maxima are used to locate leukocytes, and windows are produced on the mask image. After detecting the location of multiple leukocytes, they can be further cropped using the bounding box technique and can be used for future work.

  4. 4.

    Comparative analysis is performed using three different color spaces like HSV, YCbCr, and HLS for the segmentation of blast cells to find their performance on datasets.

The rest of the paper is organized as follows. Second section focuses on the related work of WBCs segmentation using image processing. It is processed by the overview of the proposed methodology and the dataset used. Finally, the last section presents result and conclusions.

2 Prior Art

The state-of-the-art includes a number of methods dedicated to leukocyte analysis. Many segmentation approaches for the automated detection of white blood cells have been developed in recent years using image processing. Many researchers used the thresholding method [6,7,8] like global thresholding and otsu thresholding on blood smear images and many other approaches have been used [9, 10] etc. Sadeghian et al. [6] proposed a framework using a zack thresholding to segment cytoplasm and achieved an accuracy of 92 percent only on twenty microscopic images. Madhloom et al. [7] used contrast stretching, histogram equalization, arithmetic, and thresholding operations on images for localization and segmentation. Biswas et al. [8] used a thresholding estimation-based watershed algorithm only on 30 images and obtained 93% accuracy. Fatichah et al. [11] proposed a fuzzy feature representation for counting leukocytes. However, inaccuracies came from a lack of a sufficient segmentation procedure. To overcome this issue, Safuan et al. [12] presented a system for the counting number of WBCs utilizing various color space analysis and otsu thresholding to improve the performance.

Moshavash et al. [13] proposed a novel exponential intuitionistic fuzzy divergence (IFD)-based thresholding method to autonomously segment leukocyte nuclei. A Grabcut approach based on edge strength has been developed to segment leukocytes [14]. It has limitations due to the algorithm’s composition as selecting the proper threshold by analyzing histogram peaks is critical. It has also resulted in a high number of false positives and false negatives because of cell morphology variation. To obtain high performance, three different color spaces: RGB, HSI, and CMYK was used by Zhang et al. [15] by applying k-means clustering on blood images. They achieved an accuracy of 94.6% and 95.1% in cytoplasm segmentation.

Ghane et al. [16] proposed a three-stage automated segmentation of cells. Color-based segmentation techniques such as CIE LAB and cyan, magenta, yellow, and black (CMYK) were applied, yielding similarity measures of 92% and 93% for the identification of leukocytes. Li et al. [17] demonstrated a dual-threshold strategy for segmenting leukocytes on images of Acute Lymphoblastic Leukemia. The dataset used was ALL-IDB, and the method was tested only on 130 images. Poisson distribution-based minimal error thresholding and translation to color spaces RGB and CIE LAB were used to produce a new gray-scale by Treef et al. [18].

Alferez [19] developed a segmentation system based on color data and fuzzy clustering of distinct color components. The preceding work employed only one quantitative evaluation. However other metrics, such as the dice index and SSIM can also be carried out. Despite several attempts to automate leukocyte analysis, a robust strategy is still necessary to handle variations in images. This research presents a unique leukocyte segmentation approach. Segmented images are compared with the ground truth of different datasets, as shown in Figs. 2, 3 and 4.

Fig. 2
figure 2

Sample images from ALL-IDB1 dataset: ac blast cells, df healthy cells and AF corresponding ground truth images

Fig. 3
figure 3

LISC dataset. ae Sample images from dataset AE corresponding ground truth images

Fig. 4
figure 4

CELLAVISION dataset. ae Sample images from dataset AE corresponding ground truth images

3 Material and Methods

3.1 Datasets

The lack of publicly available datasets is the most significant challenge in the comparison and performance analysis phase of an automated system. As a result, we implemented and tested the suggested technique on three major public datasets: Acute Lymphoblastic Leukemia Image Database (ALL-IDB1), CELLAVISION,Footnote 1 and LISC (Leukocyte Images for Segmentation and Classification) [20] as shown in Table 1.

Table 1 Database used in proposed methodology
  1. 1.

    ALL-IDB1: There are two sections of the database: ALL-IDB1 and ALL-IDB2. ALL-IDB2 dataset is developed from the All-IDB1 dataset containing 260 images that were previously utilised in our study [21]. Both datasets may be used to segment and categorise data. These images were captured with a PowerShot G5 camera in JPG (Joint Photographic Experts Group) format. These are in RGB color space of 24 bits and fixed resolution of 2592\(*\)1944 pixels. Ground truth images were manually created by experts with which results are compared.

  2. 2.

    LISC: Images were extracted from the peripheral blood of eight normal participants and hundred microscope slides yielded 400 samples [20]. Hematologists have categorised the dataset into five sub-classes. The microscope slides were smeared and stained using the Gismo-Right process, and images were acquired using a digital camera (Sony Model No. SSCDC50AP). The images have a resolution of 720\(*\)720 pixels and were collected from the hospital in Tehran, Iran. It contains 250 ground truth images.

  3. 3.

    Cellavision: Cells are typically purple in JPEG format and contain five classes: neutrophil, lymphocyte, monocyte, eosinophil, and basophil. The ground truth is contained in the dataset, and the images of leukocytes from CellaVision have been categorised by professionals in the field of hematology. The images were collected in the Core Laboratory at the Hospital Clinic of Barcelona using the analyzer CellaVision DM96.The nuclei, cytoplasms, and background, including red blood cells, are manually drawn by domain specialists.

4 Methodology

4.1 Overview

Color plays an important role as it provides a tremendous amount of information in image processing and segmentation. However, because this information is partially buried, human eyes frequently fail to analyse it [22]. The flow diagram for the WBC segmentation and detection process is illustrated in Fig. 5.

Fig. 5
figure 5

Block diagram of proposed methodology

4.2 Pre-processing

Color space is a mathematical paradigm that defines color information and how colors can be represented numerically. The default color space is RGB for all three datasets.

4.2.1 Color Conversion from RGB to HSV, HLS, and YCbCr Color Space

RGB is a very well-known and widely used color model. However it has nothing to do with hue, saturation, or intensity of images. Color images are segmented more easily than grayscale images as it is more accurate since there is more information at the pixel level. [23]. Images in the dataset are translated to the following color spaces:

  1. 1.

    HSV: The HSV color space is represented in three dimensions by a hexacone where intensity is represented by a central vertical axis [24]. It becomes easier to segment a given color if the range for H, S, V is selected. For example, for ALL-IDB1 dataset Cmin values for H,S,V are 80, 115, 70 and values for Cmax are 180, 255 and 255. Figure 6 illustrates the proposed segmentation method in which challenging blood smear images from three datasets are transformed to HSV color space.

  2. 2.

    HSL: HSL represents color more perceptually and intuitively than RGB space [25]. The three different color components are hue, saturation, and lightness, where hue denotes the base colors reflecting different shades. The second component denotes ratio of colorfulness to brightness which is expressed in percentage. The brightness of equally illuminated white described as third component [26]. The values are set to maximum and lowest for thresholding the background. The min values and max values for hue, saturation, and lightness are 30, 30, 55 and 240, 255, 255 for the ALL-IDB1 dataset.

  3. 3.

    YCrCb: The RGB color space is translated into a third color space for comparison i.e. YCrCb to produce effective segmentation results to compensate for uncertainties and illumination invariance of three different datasets. For example, the specified range of values i.e lower and upper limit for the ALL-IDB1 dataset is set to 100, 90, 80 and 255, 255, 255 respectively. This step effectively segments the blood smear images of varying resolutions and intensities [27]. The RGB color space images are transformed to YCbCr color space using the following equation:

    $$\begin{aligned} \left[ \begin{array}{l} Y\\ C_{r}\\ C_{b} \\ \end{array}\right] =\left[ \begin{array}{lll} 0.257 &{} 0.504 &{} 0.098\\ 0.439 &{} -0.368 &{} -0.071 \\ -0.148 &{} -0.291&{} 0.439 \end{array}\right] \left[ \begin{array}{l} R\\ G\\ B \\ \end{array}\right] + \left[ \begin{array}{l} 16\\ 128\\ 128\\ \end{array}\right] \end{aligned}$$
    (1)
Fig. 6
figure 6

Sample images, their HSV transformation and threshold masks of a ALL-IDB1 non healthy cell, b ALL-IDB1 healthy cell, ce LISC dataset (baso, eosi and lymp) and f cellavision dataset

4.3 Morphological Operations

Morphological operations are a set of non-linear operations that process images based on their morphology and apply “disc” shape structural element to it. After color correction, there are little dot-like patches that depict noise or ambiguity created during image acquisition. As a result, to overcome unwanted objects and eliminate imperfections from the images, morphological operations play an important role to purify cell mask [27].

To perform morphological image analysis or image cleaning, two processes, including erosion and opening with a structural element in the shape of a “disc” are frequently combined. Unwanted regions present in the thresholded image as seen in Figs. 6, 7 and 8 are removed by image erosion followed by dilation for image enhancement.

Fig. 7
figure 7

Sample images, their HSL transformation and threshold masks

Fig. 8
figure 8

Sample images, their YCbCr transformation and threshold masks

4.4 Watershed Transform

Beucher and Lantuéjoul [28] proposed the watershed algorithm and it is now utilized alongside morphological techniques as a potent tool in intricate image segmentation. Watershed algorithm is a topology-based segmentation method and L. Vincent and Soille [29] introduced the classical watershed calculation method in 1991. This segmentation approach performs efficiently if one can “label” the foreground and background items to recognise the boundaries of connected cells and correctly segregate the linked nuclei. So, foreground and background objects are marked, and the watershed transform function is computed [30] (Fig. 9).

Fig. 9
figure 9

The resulted image after morphological operations (erosion and dilation) are applied a, b belong to ALL-IDB1 dataset of healthy individuals, ci belong to LISC dataset (baso, eosi and, lymp) and jl belong to cellavision dataset

The marking function depicts the topological surface where the fluid rises and defines the watershed margins where two torrents meet. Because these markers correspond to the cell sites where flooding occurs, finding them is the most essential phase in the marker-controlled watershed algorithm [31]. Figures 10 and 11 demonstrate marker-based watershed segmentation after morphological phase.

Fig. 10
figure 10

Images from a the dataset which are to be segmented, b RGB mask of segmentation results, c marker-based watershed segmentation results

Fig. 11
figure 11

Segmented results: ai, mq are segmented results using marker-based watershed algorithm on ALL-IDB1, LISC AND CELLAVISION datasets respectively and jl, r are mapped on original images of three datasets

4.5 Peak Local Maxima

The peak local maxima function, which provides the coordinates of local peaks in an image, is presented in this section. After applying a marker-based watershed algorithm on blood smear images,a boundary box is applied to the object of interest. It helps in cropping cells which are marked by the smallest rectangle as can be seen in Fig. 12. This helps in the location detection of leukocytes which are segmented with the help of the proposed methodology. This method significantly improves the performance of leukocyte segmentation, as traditional methods fail to detect multiple WBCs. Moreover, this method takes less computational time in the segmentation of leukocytes with good results. Cells can be further cropped by the bounding box technique as seen in Fig. 13 which can be further used for processing and as datasets.

Fig. 12
figure 12

Output of segmentation using peak local maxima on watershed algorithm which computes windows on leukocytes (ROI)

Fig. 13
figure 13

Example of cropping leukocytes on image of ALL-IDB1 dataset

5 Performance Evaluation Methodology

This section focuses on several performance metrics used for quantitative performance evaluation for leukemic segmentation.

  1. 1.

    Dice score: It is [32] also called as DICE similarity coefficient (DSC). It is a statistical measure that is used to determine the resemblance of two images or samples.

    $$\begin{aligned} DSC=\frac{2(X\cap Y)}{|X|+|Y|} \end{aligned}$$
    (2)
  2. 2.

    Structural Similarity Index Metric (SSIM): It is a psychometric for measuring picture quality deterioration. Its value ranges from 0 to 1.

    $$\begin{aligned} SSIM (f,g)=l(f,g)c(f,g)s(f,g) \end{aligned}$$
    (3)

    where,

    $$\begin{aligned} \left\{ \begin{array}{l} l(f,g)=\frac{2\mu _{f}\mu _{g}+C_{1}}{\mu _{f}^{2}+\mu _{g}^{2}+C_{1}}\\ c(f,g)= \frac{2\sigma _{f}\sigma _{g}+C_{2}}{\sigma _{f}^{2}+\sigma _{g}^{2}+C_{2}}\\ s(f,g)= \frac{\sigma _{fg}+C_{3}}{\sigma _{f}\sigma _{g}+C_{3}} \end{array}\right. \end{aligned}$$
    (4)

    in which \(\mu\)x and \(\mu\)y are the original and normalized images and their standard deviations are \(\sigma\)x and \(\sigma\)y and C1 and C2 are the constants.

  3. 3.

    Mean square error(MSE): It analyses the similarity between ground truth image and segmented image by calculating the pixel difference. Lower the MSE score, closer the two pictures are.

    $$\begin{aligned} MSE(S,G)=\frac{1}{N}\sum _{i=1}^{N}(S_{i}-G_{i})^{2}) \end{aligned}$$
    (5)

    where G is ground image and S is segmented image.

  4. 4.

    Precision: It is defined as the ratio of correctly diagnosed blast or healthy cells (TP) to all blast or healthy cells observed (TP+FP). Positive predictive value (PPV)is another name for it [33].

    $$\begin{aligned} {\text {Precision}}({\text {P}}) = {\text {TP}}/({\text {TP}} + {\text {FP}}) \end{aligned}$$
    (6)
  5. 5.

    Recall: It is a ratio of actual positives among all real positives. It is measured by:

    $$\begin{aligned} {\text {Recall}} ({\text {R}}) = {\text {TP}}/({\text {TP}} + {\text {FN}}) \end{aligned}$$
    (7)

    where, TP is for True Positives, TN stands for True Negatives, FP stands for False Positives, and FN stands for False Negatives (Equations 2, 3, 4, 5).

6 Experimental Results

In this section, performance of the proposed segmentation model was tested using three types of ablation studies. All the images of cells using different color spaces from different datasets were quantified based on pixels and the results were compared against the ground truth obtained through manual quantification. Availability of ground truth and its comparison with our results plays a major role in determining the accuracy of our supervised learning-based segmentation system. In every case with different color space on each dataset,results were able to match the ground truth with an accuracy of 86–98%. Within a few steps, segmentation can be done effectively. The performance is evaluated and ground truth requirement should be specified initially for a full quantitative examination. It can be shown from Fig. 12 that the suggested technique fit the ground truths of the multiple image databases employed despite of color fluctuation. As per analysis shown in Tables 2, 3, 4 and 5 HSV has better performance compared to HLS and YCbCr. Average precision for all three datasets is same for their color spaces but recall and SSIM is better for HSV color space. With proper choice of color space, the proposed method can produce results that are highly accordant with those manually segmented by the domain expert. We examined the variation between our method and the manual segmentation(Ground truth). The quality of segmentation produced by proposed method is equivalent to that obtained by human observers and better than many state-of-the-art methods as shown in Table 6.

Table 2 Performance evaluation with different color space ALL-IDB1 dataset
Table 3 Performance evaluation with different color spaces of LISC Dataset: Baso, Eosi, Lymp, Mono, Neut
Table 4 Performance evaluation with different color spaces of CellaVision dataset
Table 5 Comparison with state of art: CellaVision dataset
Table 6 Comparison with state of art: ALL-IDB1 Dataset

7 Conclusion

Analyzing various spherical blood smear images databases is difficult due to brightness and coloring differ depending on equipment used and circumstances. Results for various blood smear images captured using different hardware equipment have been analyzed using three different datasets. Our suggested technique greatly improves state-of-the-art methods, according to experimental findings acquired from datasets. Although images that have been experimented upon, have different values of textual, shape and color features, robustness of our model ensures that the segmentation results are better than many state-of-the art methods. Furthermore, in the realm of medical imaging, digital image processing is fast evolving. Applying the bounding box technique helps to crop the localized wbc so that it can be used in future work for classification. Experimental results show that the suggested method outperformed the others in terms of segmentation accuracy. Finally, it can be stated that the WBC accuracy can be improved by using a colour space correcting procedure.

8 Declarations

We author of the above titled paper hereby declare that the work included in the above paper is original and is an outcome of the research carried out by the authors indicated in it. Further, We author declare that the work submitted for Wireless Personal Communications An International Journal has not been published already or under consideration for publication in any Journals/Conferences/Symposia/Seminars.