1 Introduction

Leukemia is a type of blood cancer that starts in the bone marrow and results in a large number of abnormal blood cells. These blood cells, often known as blasts or leukemia cells, are not fully matured. Bleeding, bruising, bone discomfort, weariness, fever, and a higher risk of infection are all possible symptoms. A shortage of regular blood cells causes these symptoms. Blood tests or a bone marrow biopsy are usually used to make the diagnosis. The actual causes of leukemia are unknown to scientists. It appears to be the result of a mix of environmental and genetic factors. A fundamental concern in the realm of illness diagnostics is the precise differentiation of malignant leukocytes with low expense in the early stages of the disease, which is a major difficulty. Flow cytometry equipment is in restricted supply, and the procedures accessible in laboratory diagnostic centers are time-consuming. Leukemia is the most frequent type of blood cancer in people of all ages, especially youngsters. Excessive proliferation and immature growth of blood cells cause this abnormal phenomenon, which can harm red blood cells, bone marrow, and the immune system. With over 60,000 new cases reported in 2018, leukemia accounts for more than 3.5 percent of all new cancer cases in the United States. Malignant white blood cells, also known as lymphoblasts, travel through the bloodstream to other organs such as the spleen, brain, liver, and kidneys, where they metastasize to vital bodily tissues [2, 13, 23]. On the basis of microscopic pictures, hematologists in cell transplant facilities can differentiate and diagnose various kinds of leukemia. Some forms of leukemia are easier to identify and distinguish than others if the slide is properly stained, but determining underlying leukemia requires more technology. The stained slides of the most frequent kinds of leukemia as illustrated in Fig. 1. Leukemia is divided into four categories, acute myeloid leukemia (AML) Fig. 1a, acute lymphoblastic leukemia (ALL) Fig. 1b, chronic myeloid leukemia (CML) Fig. 1c, and chronic lymphocytic leukemia (CLL) Fig. 1d, as well as a few less frequent kinds.

Fig. 1
figure 1

The four main types of leukemia

In general, leukemia research is divided into two categories: clinical or translational research and basic research. Clinical/translational research focuses on studying disease in a specific and generally immediately applicable manner, such as testing a new drug in humans. Basic science research, on the other hand, looks at the disease process from afar, such as whether a suspected carcinogen can cause leukemic changes in isolated cells in the laboratory or how the DNA changes inside leukemia cells as the disease progresses. The findings of basic research studies are generally less immediately useful to people suffering from the disease. But the speed of detection of the disease leads to avoiding deterioration of the patient's health. Researchers, clinicians, and hematologists have traditionally struggled to make an early diagnosis of leukemia. Lymphocytic enlargement, pallor, fever, and weight loss are all indications of leukemia, but they can also be signs of other illnesses. Because the symptoms of leukemia are so minor in the early stages, diagnosing it can be challenging. Although microscopic examination of PBS is the most commonly used method for a leukemia diagnosis, obtaining and analyzing bone marrow samples is the gold standard for leukemia diagnosis [3, 23, 29, 42]. Several research studies have used machine learning (ML) and computer-aided diagnostic approaches for laboratory image analysis in the last two decades in the hopes of overcoming the limits of a late leukemia diagnosis and determining its subgroups. In this research, blood smear pictures were evaluated for diagnosing, distinguishing, and counting cells in distinct kinds of leukemia [41, 43].

Traditional approaches couldn't evaluate or uncover patterns in such a massive amount of data. It has been demonstrated that machine learning is ideally adapted to dealing with vast amounts of complex data and could prove to be a useful tool in understanding and combating disease. Traditionally, experienced practitioners assess diagnostic tests and patient data based on years of medical study and training. However, in a number of tasks, including initial diagnosis, prognosis estimation, and prediction of treatment problems, as well as relapse tracking in hematologic malignancies, machine learning algorithms have recently been demonstrated to be on par with professionals.

Two decades ago, the first studies of ML methods in the diagnosis of hematologic malignancies were carried out. They began by using flow cytometry to identify leukemic cells in blood samples and analyzing genetic data to provide the framework for machine learning methods in the investigation of hematologic malignancies. It is a well-known branch of artificial intelligence that consists of algorithms and mathematical relationships, and it has been swiftly used in clinical research. ML allows computers to be programmed without explicit experience and then learn from it. The results of incorporating these technologies into medical data processing have been astounding, and they have proven to be quite effective in illness diagnosis [6, 10, 24]. According to research, ML approaches considerably enhance complex medical decision-making processes in medical image processing by extracting and then assessing the properties of these images [25, 30, 45].

The main contributions of this paper are:

  1. 1.

    Proposing a Proposed Leukemia Classification Technique (PLCT)

  2. 2.

    PLCT consists of three main phases as shown in Fig. 2 which are: (i) Image Preprocessing Phase (IPP), (ii) Feature Extraction Phase (FEP), and (iii) Classification Phase (CP).

  3. 3.

    Finding best values for hyperparameters using a proposed hyperparameter tuning algorithm.

  4. 4.

    Comparing OCNN with the state-of-the-art used algorithms.

Fig. 2
figure 2

Framework of the Proposed Leukemia Classification Technique (PLCT)

The remaining work is organized as follows. In Section 2, some of the recent related work in the detection and classification of Leukemia is presented. In Section 3, the proposed method is presented. Experimental evaluation is provided in Section 4. And in Section 5, we conclude this work.

2 Related work

This section discusses a number of studies that have been conducted by researchers. The literature discusses some of the previous research between (2012-2023). De Oliveira et al. [22] suggest minor changes to typical neural network topologies to obtain good performance in the categorization of malignant leukocytes. The architectures of VGG16, VGG19, and Xception were the ones that were put to the test. To balance the training and validation sets, data augmentation was used. Mirroring, rotation, blurring, shearing, and the addition of salt and pepper noise were among the transformations used. Using a ResNeXt convolutional neural network with Squeeze-and-Excitation modules, Jonas Prellberg et al. [28] provides a simple yet successful classification method. The technique received a weighted F1 score of 88.91 percent on the test set in the C-NMC online challenge. The source code can be found at https://github.com/jprellberg/isbi2019cancer.

Authors in [26] propose the neighborhood-correction algorithm (NCA), which consists of three major steps: (i) fine-tuning a pre-trained residual network with training data and producing initial labels and feature maps for test data, (ii) building a Fisher vector for each cell image based on its feature maps, and (iii) correcting the initial label of each test cell image using weighted majority voting based on its most similar neighborhood. Supardi et al. [1] proposed a classification system for acute leukemia that distinguishes between two types: acute myelogenous leukemia (AML) and acute lymphocytic leukemia (ALL) (ALL). From image samples, twelve features were manually retrieved. Finally, a K-NN classifier was employed to categorize the data. Experiments on a database of 1500 photos yielded an accuracy of 86%.

Kumar et al. [17] presented an automated acute leukemia detection system. The technique began with noise and blurring in microscopic digital images being preprocessed. Color, geometric, textural, and statistical characteristics were retrieved and classified as benign or malignant. The k-nearest neighbor (K-NN) and nave Bayes classification models were utilized Experimental experiments on a dataset of 60 blood samples found that the K-NN classifier was superior, with a classification accuracy of 92.8 percent.

Madhukar et al. [20] created a classification approach based on AML that improved image contrast and identified five features. The classification was done using an SVM classifier. Experiments on a dataset of 50 photos yielded a classification accuracy of 93.5 percent. Setiawan et al. [31] proposed a classification scheme for cells of AML subtypes M4, M5, and M7. The cells were first segmented using a color k-means algorithm. Six statistical features were then retrieved and used to train a multi-class SVM classifier. The results produced 87 percent segmentation accuracy and 92.9 percent classification accuracy in the best-case scenario.

With feature extraction, coding, and classification, Faivdullah et al. [9] suggested a three-layered system. The goal of this framework was to determine whether a patient had leukemia and what form of leukemia they had based on a blood smear image. In order to extract features, a dense scale-invariant feature transform was applied. The retrieved feature vectors' dimensionality was then decreased in the coding layer. Finally, the categorization was done using a multi-class SVM classifier. Experiments on a dataset of 400 samples yielded a classification accuracy of 79.37 percent.

Laosai and Chamnongthai [19] proposed an AML classification system based on k-means and contour signature approaches to segment nuclei. Then, using morphology, features such as cell size, cell color, and so on were extracted. The SVM classifier had an accuracy of up to 92 percent in experiments on a dataset of 100 photos. Patel and Mishra [27] established a microscopic image-based automated leukemia method. During preprocessing, the system began by removing noise and blurring. After that, k-means and Zack algorithms were used to segment the WBCs. After that, color, statistical, geometric, and textural aspects were retrieved. In [21], an SVM classifier was used to differentiate between normal and abnormal photos. Experiments on a dataset of 27 photos yielded a 93.57 percent accuracy. Table 1 summarizes the most common recent studies in Leukemia classification that uses C-NMC 2019 Dataset. Finally, in [4] the authors proposed a model for the categorization of acute leukemia images, they suggested a CNN model based on the Tversky loss function includes six convolution layers, four dense layers, and a Softmax activation function. The proposed approach was 99% accurate in diagnosing acute leukemia types such as ALL and AML. Table 2 provides the pros and cons of the various algorithms discussed.

Table 1 Recent studies in Leukemia classification that uses C-NMC 2019 Dataset
Table 2 Pros and cons of the various algorithms

3 The proposed leukemia classification technique (PLCT)

The Proposed Leukemia Classification Technique (PLCT) consists of three main phases as shown in Fig. 2 which are: (i) Image Preprocessing Phase (IPP), (ii) Feature Extraction Phase (FEP), and (iii) Classification Phase (CP).

3.1 Image preprocessing phase (IPP)

The input blood microscopic images are first transformed into an RGB color model, and then a number of processes are applied to them at this stage. After that, their dimensions are set to 227 x 227. Finally, data augmentation is used to compensate for the lack of a large dataset, which is necessary for deep neural networks to complete their training and testing phases. Translation, reflection, and rotation are the three operations that make up data augmentation. The images are shifted along the X-and Y-axes in translation, with selected values randomly bound by the interval [1, 9, 17, 19,20,21,22, 26,27,28, 31]. The images are mirrored along the vertical axis during the reflection process. Finally, the photos are rotated right or left with a random rotation angle of values bounded by the interval [21,22,23,24,25] with a step equal to five during the rotation process.

3.2 Feature extraction phase (FEP)

CNN is one of the most common network designs used in machine-learning applications. The capacity of CNNs to complete tasks regardless of tilting, translation, or scaling is the major reason for their success [44]. Convolutional, pooling, and fully connected layers are the three primary types of layers in the CNN architecture, as depicted in Fig. 3. Convolutional layers compute the output of neurons by adding the bias to the weighted sum and using a rectified linear unit as an activation function (ReLu).

Fig. 3
figure 3

General architecture of convolution neural networks (CNNs) [40]

3.3 Classification phase (CP)

Image classification could be useful in robotics, human-machine interface, surveillance, retrieval, transportation, and other domains. It is one of the most active study areas in computer vision. It entails the categorization of photographs. It looks for regions in an image that might contain a specific object, then extracts and classifies each of these regions with the use of an image classification model. An optimized CNN (OCNN) is used for classification. OCNN is utilized to detect and classify the photo as "normal" or "abnormal." Fuzzy optimization is used to optimize the CNN hyperparameters. The use of fuzzy logic in optimization is a quite beneficial. When faced with a challenging task, the fuzzy logic system can deliver the most efficient solution. It's simple to tweak the performance to improve or change it. CNN has a significant advantage over its predecessors in that it can detect crucial characteristics without the requirement for human interaction. CNN's performance is improved by optimizing its hyperparameters. The overall steps of the OCNN are shown in Algorithm 1.

Algorithm 1
figure a

OCNN algorithm

4 Implementation and experiments

The following data identify the primary components of the computer system used for the simulation tests. Although the actual hardware may alter the overall completion time for a simulation, it should have little, if any, impact on the simulation outcomes. In contrast, for completeness and to allow this study to be duplicated for future comparison, the following is a summary of the most important components. Intel FX6300 9-core processor at 6.5GHz, Memory: 64 GB DDR3 RAM divided into two 32GB banks4 terabyte sata3 physical drive, 64-megabyte cache capacity. Windows 10 64-bit with Service Pack 1 is the operating system that we used. Nota bene: Windows 11 was accessible as "upgrades" during the research period. They were denied in order to ensure compatibility and consistency of operation across the research. The following section describes the implementation of our model, the experiments conducted, and the used dataset.

4.1 Dataset

The C-NMC 2019 dataset (https://www.kaggle.com/gauravrajpal/leukemia-classification-v1-3-inceptionv3-65-29/data) (Mourya et al. 2019) contains 15114 lymphocyte images collected from 118 subjects and divided into three folders with names such as "C-NMC training data" which contains 10661 cells, 7272 malignant cells from 47 subjects, and 3389 healthy cells from 26 subjects; "CNMC test preliminary phase data", which contains 1867 cells, 1219 malignant cells from 13 subjects, and 648 healthy cells from 15 subjects, and “C-NMC test final phase data” containing 2586 unlabeled cells from 17 subjects. Single-cell photos of malignant and benign lymphocytes already identified by experienced oncologists can be found in these folders. A sample of the data set is presented in Fig. 4.

Fig. 4
figure 4

Sample of the dataset

4.2 Data augmentation

The original dataset was unbalanced and, for that reason, data augmentation was employed to balance the Training and Validation sets. This technique was not applied to the Test set. Standard image transformation techniques were used, such as mirroring, rotation, and Gaussian blurring, to produce the augmented images.

We also attempted different augmentation techniques, and it was noticed that shearing and addition of salt and pepper noise resulted in a better training performance and model accuracy. An example of these techniques applied to a random image from the dataset can be seen in Fig. 4. The augmented Training set had 20,000 samples, and the Validation set has 10,000 samples, as shown in Table 3.

Table 3 Number of samples in training, validation and test sets

4.3 Implementation and experiments

Python code was used to implement the proposed method including OCNN to evaluate their performance in terms of precision, recall, accuracy, and specificity, which are defined as shown.

$$\mathrm{Precision}=\mathrm{TP}/\;\left(\mathrm{TP}+\mathrm{FP}\right)$$
(1)
$$\mathrm{Recall}=\mathrm{TP}/\;\left(\mathrm{TP}+\mathrm{FN}\right)$$
(2)
$$\mathrm{Accuracy}=\left(\mathrm{TP}+\mathrm{TN}\right)/\;\left(\mathrm{TP}+\mathrm{TN}+\mathrm{FP}+\mathrm{FN}\right)$$
(3)
$$\mathrm{Specificity}=\mathrm{TN}/\;\left(\mathrm{TN}+\mathrm{FP}\right)$$
(4)

where

TP is true positive; TN is true negative; FP is false positive; and FN is false negative.

The performance of the proposed method (OCNN) is compared with the previous common used classifiers as Decision Tree (DT), Linear Discriminant (LD), Support Vector Machine (SVM), and K-Nearest Neighbor (K-NN) as shown in Table 4.

Table 4 The performance of the proposed method (OCNN) vs. previous classifiers

A graphical representation of the results is shown in Fig. 5. From Fig. 5, It is shown that the OCNN as a classifier achieved the best results due to the enhancement of the performance of the CNN after the optimization of the hyperparameters of the CNN. Figure 6 illustrates the performance of the proposed algorithm vs. previous algorithms.

Fig. 5
figure 5

Comparison of OCNN vs. previous algorithms

Fig. 6
figure 6

OCNN vs. CNN and previous methods

The performance of the proposed method (OCNN) is compared with CNN and previous methods using F1-score as shown in Table 5.

Table 5 The performance of the proposed method (OCNN) vs. CNN and previous methods

It is shown from Table 5, the OCNN outperforms CNN and other algorithms.

5 Conclusions

A significant issue in the field of illness diagnostics is the early detection and diagnosis of leukemia, that is, the accurate distinction of malignant leukocytes with minimal costs in the early stages of the disease. Flow cytometer equipment is few, and the methods used at laboratory diagnostic centers are laborious despite the high prevalence of leukemia. Leukemia can be treated more effectively if it is detected early. This work developed a new classification model for blood microscopic pictures that distinguishes between leukemia-free and leukemia-affected images. The general proposed method in this paper consists of three main steps which are: (i) Image_Preprocessing, (ii) Feature Extraction, and (iii) Classification. An optimized CNN (OCNN) is used for classification. OCNN is utilized to detect and classify the photo as "normal" or "abnormal." Fuzzy optimization is used to optimize the CNN hyperparameters. The use of fuzzy logic in optimization is a quite beneficial. From results, it is shown that the OCNN as a classifier achieved the best results due to the enhancement of the performance of the CNN after the optimization of the hyperparameters of the CNN. In the future work, we can use OCNN [35] to achieve better results as it achieved a good performance in [7, 8, 11, 12, 32, 33, 36,37,38,39]. We can also use correlation methods like [34].