Blood cell image classification method

By constructing a deep learning network model and performing data augmentation and preprocessing, the shortcomings of existing blood cell image classification technology in feature extraction, data scale and model design are solved, and high accuracy and high efficiency blood cell image classification are achieved.

CN120071345APending Publication Date: 2025-05-30YONGCHUAN HOSPITAL AFFILIATED TO CHONGQING MEDICAL UNIV (CHONGQING SECOND PEOPLES HOSPITAL)

Patent Information

Application Number
CN202510145624.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-10
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

The existing blood cell image classification technology has shortcomings in feature extraction, data scale, image information mining, data processing and model design, resulting in low classification accuracy and efficiency.

Method used

By building a deep learning network model, including input layer, multiple convolutional layers, batch normalization layer, maximum pooling layer, flattening layer, multiple fully connected layers, Dropout layer and output layer, data augmentation and preprocessing of blood cell images are performed, randomly divided into training sets, verification sets and test sets, and model performance is evaluated in real time through the verification sets, and training strategies are adjusted to optimize model training.

Benefits of technology

It significantly improves the accuracy and efficiency of blood cell image classification, enhances the generalization ability and robustness of the model, avoids overfitting, and ensures the stability and reliability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120071345A_ABST
    Figure CN120071345A_ABST
Patent Text Reader

Abstract

The invention provides a blood cell image classification method, and relates to the technical field of medical image processing. The method comprises the following steps: firstly, acquiring a blood cell image set of a peripheral blood smear of a suspected blood cancer patient under a microscope; then, carrying out data enhancement and preprocessing on the images, and randomly dividing the images into a training set, a verification set and a test set according to a proportion; then, a deep learning network model is constructed, and the model comprises an input layer, multiple convolution layers, a batch normalization layer, a maximum pooling layer, a flattening layer, multiple full connection layers, a Dropout layer and an output layer; and then, inputting the training set into the model for training, evaluating the performance in each iteration period by using the verification set, and adjusting a training strategy. And finally, evaluating the trained model by using the test set to obtain a model meeting a predetermined standard for classification processing of blood cell images. According to the technical scheme, the blood cell image classification accuracy and efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of medical image processing. Specifically, it relates to a method for classifying blood cell images. Background Art

[0002] Blood cancer is a serious blood disease, and early diagnosis is crucial for improving the survival rate of patients. Traditional diagnostic methods such as bone marrow puncture biopsy are accurate, but they are invasive, costly, and time-consuming, imposing a burden on patients. With the development of computer technology, the analysis of peripheral blood smear images provides a new way for early screening.

[0003] Currently, there have been studies attempting to use machine learning and deep learning algorithms to classify blood cell images for auxiliary diagnosis. However, traditional machine learning algorithms rely on manual feature extraction, have limited generalization ability, and are difficult to comprehensively reflect the true information of blood cells, resulting in unstable classification results. Although deep learning algorithms such as convolutional neural networks have achieved remarkable results in image recognition, different studies have differences in datasets, model structures, and training methods, leading to uneven model performance.

[0004] In summary, the existing blood cell image classification technologies have deficiencies in aspects such as feature extraction, data scale, image information mining, data processing, and model design, so that the accuracy and efficiency of blood cell image classification cannot be well guaranteed. Therefore, it is an urgent need in current research to propose a blood cell image classification method that can improve the accuracy and efficiency of blood cell image classification. Summary of the Invention

[0005] The purpose of this application is to provide a method for classifying blood cell images, which can improve the accuracy and efficiency of blood cell image classification.

[0006] This application is implemented as follows:

[0007] In a first aspect, this application provides a method for classifying blood cell images, including the following steps: obtaining a target image set, where the target image set is a set of blood cell images obtained by collecting images of peripheral blood smears of suspected blood cancer patients under a microscope; after performing data augmentation and preprocessing on the target image set, randomly dividing it into a training set, a validation set, and a test set according to a ratio; constructing a deep learning network model, where the deep learning network model is a sequential structure including an input layer, multiple convolutional layers, a batch normalization layer, a max pooling layer, a flattening layer, multiple fully connected layers, a Dropout layer, and an output layer in sequence; inputting the training set into the deep learning network model for model training, and at the same time evaluating the model performance using the validation set in each iteration cycle, and adjusting the training strategy according to the evaluation results; using the test set to evaluate the trained deep learning network model to obtain a deep learning network model whose performance reaches a predetermined standard for classifying the blood cell images to be classified.

[0008] In some implementations, the deep learning network model sequentially includes: an input layer for receiving image data in a target image set; a plurality of convolutional layers, each convolutional layer configured with a different number of filters, as well as different convolutional kernel sizes and strides, for extracting features in the image data; a batch normalization layer arranged after each convolutional layer for normalizing the output of the convolutional layer; a max pooling layer arranged after the batch normalization layer for reducing the dimension of the data while retaining the most significant features; a flattening layer for converting the multi-dimensional feature map after convolution, batch normalization, and pooling operations into a one-dimensional vector; a plurality of fully connected layers arranged after the flattening layer for classifying the extracted features, where the neurons in the fully connected layer are connected to all neurons in the previous layer; a Dropout layer arranged between the fully connected layers for randomly discarding a part of the neurons during the training process; and an output layer having the same number of neurons as the number of blood cell categories to be classified, using a softmax activation function for multi-classification and outputting the prediction probability for each category.

[0009] In some implementations, the initial convolutional layer of the plurality of convolutional layers is configured with 128 filters, the convolutional kernel size is (8, 8), the stride is (3, 3), the activation function is relu, the number of filters in subsequent convolutional layers gradually increases, such as 256 and 512, etc., and different convolutional kernel sizes and strides are adopted to gradually extract features of different scales and levels in the image.

[0010] In some implementations, the deep learning network model uses a stochastic gradient descent optimizer and uses categorical cross-entropy as the loss function.

[0011] In some implementations, the learning rate of the stochastic gradient descent optimizer is 0.001.

[0012] In some implementations, the data augmentation includes rotation, flipping, scaling, and / or adding noise processing.

[0013] In some implementations, ImageDataGenerator is used to perform data augmentation and preprocessing on the target image set.

[0014] In some implementations, the randomly dividing into a training set, a validation set, and a test set according to a ratio includes: randomly selecting 70% of the blood cell images from the target image set that has undergone data augmentation and preprocessing as the training set, the remaining 30% of the blood cell images as the test set, and randomly extracting 20% of the blood cell images from the training set as the validation set.

[0015] In some implementations, when inputting the training set into the deep learning network model for model training, it includes: using the model.fit function for training, where the epochs parameter is set to 10 and the verbose parameter is set to 1; when using the test set to evaluate the trained deep learning network model, it includes evaluating through the model.evaluate function.

[0016] In some implementations, when using the test set to evaluate the trained deep learning network model, it includes evaluating through precision, recall, and F1-score.

[0017] Compared with the prior art, the present application has at least the following advantages or beneficial effects:

[0018] The present application proposes a classification method for blood cell images. By optimizing the construction and training of the deep learning network model, it can automatically learn the complex features in blood cell images and achieve accurate classification of blood cell images. Compared with traditional manual classification methods, this method can significantly improve the accuracy and efficiency of classification. At the same time, the introduction of data augmentation and preprocessing steps increases the diversity and consistency of data, which helps to improve the generalization ability of the model. This enables the model to better adapt to blood cell images from different sources and conditions and improves the robustness of classification. Moreover, through the real-time evaluation of the model performance using the validation set and dynamically adjusting the training strategy according to the evaluation results, the training process can be optimized, the convergence speed and performance of the model can be improved. At the same time, the occurrence of overfitting is avoided, ensuring the stability and reliability of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] To more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings required in the embodiments. It should be understood that the following drawings only show some embodiments of the present application and should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.

[0020] Figure 1 It is a flowchart of an embodiment of a classification method for blood cell images of the present application;

[0021] Figure 2 It is a structural block diagram of an electronic device provided by an embodiment of the present application.

[0022] Icons: 201, processor; 202, memory; 203, communication interface. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0023] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are some, but not all, of the embodiments of this application. Components of the embodiments of this application usually described and illustrated in the accompanying drawings here can be arranged and designed in various different configurations.

[0024] The following will describe in detail some embodiments of this application with reference to the accompanying drawings. Without conflict, the following various embodiments and the various features in the embodiments can be combined with each other.

[0025] Embodiment 1

[0026] Early diagnosis of blood cancer is crucial for the survival rate of patients. However, traditional diagnostic methods such as bone marrow aspiration biopsy have problems such as strong invasiveness, high cost, and time-consuming. With the development of computer technology, peripheral blood smear image analysis provides a new way for the early screening of blood cancer. However, existing blood cell image classification technologies, whether traditional machine learning algorithms or deep learning algorithms, have deficiencies, such as feature extraction relying on humans, limited data scale, insufficient mining of image information, low data processing efficiency, and large differences in model design, resulting in low classification accuracy and efficiency.

[0027] In response to this, the embodiments of this application provide a classification method for blood cell images. This method first collects peripheral blood smear images of suspected blood cancer patients through a microscope to form a target image set. Then, data augmentation and preprocessing are performed on the target image set to improve data diversity and quality. Next, the processed image set is randomly divided into a training set, a validation set, and a test set. On this basis, a deep learning network model is constructed. This model effectively extracts image features and reduces overfitting through structures such as multi-layer convolution, batch normalization, max pooling, flattening, fully connected, and Dropout. During the model training process, the validation set is used to evaluate the model performance in real time, and the training strategy is adjusted according to the evaluation results to ensure the stable improvement of the model performance. Finally, the trained model is evaluated using the test set to obtain a deep learning network model whose performance reaches the predetermined standard, which is used for efficient and accurate classification processing of the blood cell images to be classified.

[0028] Please refer to Figure 1 , the classification method for a blood cell image includes the following steps:

[0029] Step S101: Obtain a target image set, where the target image set is a set of blood cell images obtained by collecting images of peripheral blood smears of suspected blood cancer patients under a microscope.

[0030] Exemplarily, a Zeiss camera can be used to collect images under a microscope. With its high resolution and precise imaging capabilities, the Zeiss camera can ensure that blood cell images (PBS images) can clearly capture the morphology and characteristics of blood cells, providing high-quality raw data for subsequent analysis.

[0031] Step S102: After performing data augmentation and preprocessing on the target image set, randomly divide it into a training set, a validation set, and a test set according to a certain ratio.

[0032] It should be noted that by performing data augmentation on the target image set, including operations such as rotation, flipping, scaling, and / or adding noise, the diversity of the data can be enhanced, thereby improving the generalization ability and training efficiency of the subsequent model. At the same time, by performing preprocessing steps such as normalization and denoising, the quality and consistency of the data can be improved. The processed data is randomly divided into a training set, a validation set, and a test set according to a certain ratio for subsequent model training and evaluation. Among them, in terms of data annotation and classification, experts using flow cytometry tools can clearly determine cell types and subtypes, and divide the data set into two categories: benign and malignant (including three subtypes: early Pre-B, Pre-B, and Pro-BALL), ensuring accurate and reliable annotation.

[0033] Step S103: Construct a deep learning network model, which is a sequential structure including an input layer, multiple convolutional layers, batch normalization layers, max pooling layers, flattening layers, multiple fully connected layers, Dropout layers, and an output layer in sequence. Among them, the convolutional layer is used to extract image features, the batch normalization layer is used to accelerate training convergence, the max pooling layer is used to reduce the feature dimension, the flattening layer converts multi-dimensional features into one-dimensional vectors, the fully connected layer is used for feature fusion and classification decision-making, the Dropout layer is used to prevent overfitting, and the output layer gives the final classification result.

[0034] Step S104: Input the training set into the deep learning network model for model training, and at the same time evaluate the model performance using the validation set in each iteration cycle, and adjust the training strategy according to the evaluation results.

[0035] In the above steps, the training set is input into the model, and the network weights are updated through the backpropagation algorithm. At the end of each iteration cycle, the model performance is evaluated using the validation set, and the training strategy is adjusted according to the evaluation results (such as reducing the learning rate, increasing the regularization strength, etc.). Thus, through iterative training, the model gradually converges to the optimal solution. The introduction of the validation set ensures that the model can also maintain good performance on unseen data, avoiding the overfitting phenomenon. At the same time, dynamically adjusting the training strategy can further improve the model training efficiency and performance.

[0036] Step S105: Use the test set to evaluate the trained deep learning network model to obtain a deep learning network model whose performance meets the predetermined standard, and use it to classify the blood cell images to be classified.

[0037] In the above steps, the trained model is evaluated using the test set, and performance metrics (such as accuracy, recall, F1-score, etc.) are calculated by comparing the predicted results with the true labels. If the model performance meets the predetermined standard (such as accuracy ≥ 90%), it is applied to the blood cell images to be classified. That is, the evaluation results of the test set provide an objective evaluation of the model performance, ensuring the reliability and accuracy of the model in practical applications. At the same time, by setting performance standards, models with excellent performance can be selected for practical applications.

[0038] In summary, by optimizing the construction and training of the deep learning network model, it can automatically learn the complex features in the blood cell images and achieve accurate classification of the blood cell images. Compared with the traditional manual classification method, this method can significantly improve the accuracy and efficiency of classification. At the same time, the introduction of data augmentation and preprocessing steps increases the diversity and consistency of the data, which helps to improve the generalization ability of the model. This enables the model to better adapt to blood cell images from different sources and conditions, improving the robustness of classification. And, by evaluating the model performance in real time using the validation set and dynamically adjusting the training strategy according to the evaluation results, the training process can be optimized, the convergence speed and performance of the model can be improved. At the same time, the occurrence of overfitting is avoided, ensuring the stability and reliability of the model.

[0039] Based on the foregoing solution, in some implementation manners of the present application, the deep learning network model sequentially includes: an input layer for receiving image data in the target image set; a plurality of convolutional layers, each convolutional layer being configured with an unequal number of filters, as well as different convolutional kernel sizes and strides, for extracting features in the image data; a batch normalization layer arranged after each convolutional layer for normalizing the output of the convolutional layer; a max pooling layer arranged after the batch normalization layer for reducing the dimension of the data while retaining the most significant features; a flattening layer for converting the multi-dimensional feature map after convolution, batch normalization, and pooling operations into a one-dimensional vector; a plurality of fully connected layers arranged after the flattening layer for classifying the extracted features, where the neurons in the fully connected layer are connected to all neurons in the previous layer; a Dropout layer arranged between the fully connected layers for randomly discarding a part of neurons during the training process; and an output layer having the same number of neurons as the number of blood cell categories to be classified, using the softmax activation function for multi-classification and outputting the prediction probabilities of each category.

[0040] In the above implementation, the specific structure of the deep learning network model is further defined to improve the accuracy of processing and analyzing blood cell image data. First, the input layer is responsible for receiving the image data in the target image set. This is the starting point of the entire model, and the input image data will be processed and analyzed through subsequent layers. Next, each of the multiple convolutional layers is configured with an unequal number of filters, as well as different convolutional kernel sizes and strides. These configurations enable the convolutional layer to extract multi-level and multi-scale features in the image. As the number of layers increases, the extracted features gradually transform from low-level detailed features to high-level abstract features. Then, the batch normalization layer is set after each convolutional layer to normalize the output of the convolutional layer, making the input distribution of each layer more stable. This helps to accelerate the convergence speed of the model and improve the stability of the model. Then, the max pooling layer, set after the batch normalization layer, is used to reduce the dimension of the data while retaining the most significant features. The max pooling operation can reduce the resolution of the feature map, reduce the computational amount and memory occupancy, while retaining the feature information that is most critical for classification decisions. Then, the flattening layer is responsible for converting the multi-dimensional feature map after convolution, batch normalization, and pooling operations into a one-dimensional vector. This step is the bridge connecting the convolutional layer and the fully connected layer, enabling the features extracted by the convolutional layer to be further processed and classified by the fully connected layer. Then, multiple fully connected layers, set after the flattening layer, are used to classify the extracted features. The neurons in the fully connected layer are connected to all neurons in the previous layer, and through linear transformation and non-linear activation with weight and bias parameters, the fusion and classification decisions of the features are achieved. Then, the Dropout layer, set between the fully connected layers, is used to randomly discard a part of the neurons during the training process to prevent the model from overfitting and improve the generalization ability of the model. By discarding some neurons, the model can be forced to learn more robust feature representations. Finally, the output layer has the same number of neurons as the number of blood cell categories to be classified, and uses the softmax activation function for multi-classification. The softmax function can convert the output of the fully connected layer into a probability distribution and output the prediction probability of each category.

[0041] In summary, through the extraction of multi-level and multi-scale features in the image by multiple convolutional layers, and the fusion and classification decisions of the features by the fully connected layer, the accurate classification of blood cell images can be achieved. The introduction of the batch normalization layer can accelerate the convergence speed of the model and improve the stability of the model. This helps to reduce the training time and improve the training efficiency. The max pooling layer can reduce the dimension of the data and the resolution of the feature map, thereby reducing the computational amount and memory occupancy. This helps to make the model more suitable for the processing and analysis of large-scale data. The introduction of the Dropout layer can prevent the model from overfitting and improve the generalization ability of the model. This enables the model to maintain good performance when facing unseen data.

[0042] In other words, the above implementation method realizes the accurate classification of blood cell images by constructing a deep learning network model with the ability of multi-level and multi-scale feature extraction. This model has beneficial effects such as fast convergence speed, low computational complexity, and strong generalization ability, providing an effective solution for the classification of blood cell images.

[0043] To facilitate a more intuitive understanding of this application by those skilled in the art, a specific example will be used here to illustrate the construction of this deep learning network model.

[0044] First of all, this deep learning network model is a Sequential model, which includes multiple Conv2D layers, BatchNormalization layers, and MaxPool2D layers to gradually extract image features and deepen the network. The last few layers of the model include a Flatten layer, multiple Dense layers, a Dropout layer, and an output layer, using the softmax activation function for multi-classification. The detailed construction description of each layer is as follows:

[0045] (1) Convolutional Layers

[0046] 1) Initial Convolutional Layer

[0047] The model starts with a Conv2D layer, which is configured with 128 filters, a convolutional kernel size of (8, 8), a stride of (3, 3), the relu activation function is selected, and the input shape is set to (224, 224, 3). This layer plays a crucial role in the entire network. It extracts preliminary features from the input blood cell images through convolutional operations. The relatively large convolutional kernel (8, 8) helps to capture the macroscopic features in the image, such as the overall shape and general distribution of the cells, while the relu activation function introduces non-linearity into the network, enabling the model to learn more complex feature representations.

[0048] 2) Stacking of Convolutional Layers

[0049] This is followed by a stacking of multiple convolutional layers with a gradually increasing number of filters, such as 256 and 512. Different convolutional layers use different convolution kernel sizes and strides, including kernel_size = (5,5), (3,3), and (1,1). This diverse parameter setting is designed to enable the model to capture features of different scales and levels in blood cell images. Smaller convolution kernels (such as (3,3) and (1,1)) can focus on finer details, such as texture features of the internal structure of cells, while larger convolution kernels can capture feature information in wider areas. Through stacking and combining layers, the model is able to gradually abstract higher-level and more representative features, which are essential for accurately distinguishing different types of blood cells.

[0050] (2) Pooling Layers

[0051] Multiple MaxPool2D pooling layers are embedded in the model, with pooling sizes of (3,3) and (2,2). The main function of the pooling layer in the network is to reduce the spatial dimension of the feature map. By taking the maximum value in the local area, the pooling operation can retain the most significant feature information while reducing the amount of data. This not only helps to reduce the amount of calculation in subsequent layers and improve the computational efficiency of the model, but also can ensure the translation invariance of the features to a certain extent, which is very beneficial for the task of blood cell image classification. Because in actual blood cell images, the position of the cells may be offset to a certain extent, but through the processing of the pooling layer, the model can still effectively identify the category characteristics of the cells.

[0052] (3) Batch Normalization Layers

[0053] The BatchNormalization layer follows multiple convolutional layers. Batch normalization plays an important role in the model training process. It normalizes the input of each layer to make the data distribution more stable. Specifically, batch normalization helps to accelerate the convergence of the model because it can alleviate the gradient vanishing or gradient exploding problems caused by changes in data distribution. In addition, by reducing internal covariate shift, batch normalization reduces the risk of model overfitting to a certain extent, making model training more stable and efficient.

[0054] (4) Fully-connected Layers

[0055] 1) Feature Flattening

[0056] After multiple convolution and pooling operations, the Flatten layer is used to convert the multi-dimensional feature map into a one-dimensional vector. This step is to transform the spatial features extracted previously into a form suitable for processing by the fully connected layer.

[0057] 2) Connective layer structure

[0058] Following are multiple Dense layers (fully connected layers), among which two layers have 1024 neurons and the activation function is relu. The fully connected layer plays the role of classifying or making regression predictions on the extracted features in the model. Through a large number of neuron and weight connections, the fully connected layer can comprehensively consider various features extracted previously and map them to different category spaces.

[0059] (5) Dropout layer

[0060] The Dropout layer is used between the fully connected layers with a dropout rate of 0.5. The Dropout layer is an effective technique to prevent overfitting. In each training iteration, it randomly discards a part of the neurons, so that the model cannot overly rely on certain specific neurons for prediction during the training process. This random discarding mechanism forces the model to learn more robust features, thereby improving the generalization ability of the model on unseen data.

[0061] (6) Output layer

[0062] The last layer of the model is a Dense layer with 4 neurons and the activation function is softmax. Since this application is for the multi-classification problem of blood cells, the softmax activation function can convert the output of the fully connected layer into a probability distribution over each category. This enables the model to predict the likelihood that the input blood cell image belongs to each category and determine the final classification result by comparing the probability magnitudes.

[0063] Based on the foregoing solution, in some implementation manners of this application, the initial convolutional layer of the multiple convolutional layers is configured with 128 filters, the convolutional kernel size is (8, 8), the stride is (3, 3), the activation function is selected as relu, the number of filters in the subsequent convolutional layers gradually increases, such as 256 and 512, etc., and different convolutional kernel sizes and strides are adopted to gradually extract features of different scales and levels in the image.

[0064] In the above implementation, by gradually increasing the number of filters and using convolutional kernels of different sizes, it will be possible to more effectively extract multi-level and multi-scale features from the image, thereby improving the accuracy of tasks such as image recognition and classification. Among them, although a larger convolutional kernel and stride are used in the initial convolutional layer, the subsequent layers can adjust these parameters to reduce the computational complexity and memory consumption while maintaining the feature extraction ability, which helps to improve the training speed and inference efficiency of the model. And by capturing features of different scales and levels in the image, it will be possible to enhance the adaptability of the model to image changes, improve the generalization ability of the model, and enable it to better process unseen image data.

[0065] That is, in the above implementation, by carefully designing the parameter configuration of the convolutional layer, the effective extraction of image features is achieved while taking into account the computational efficiency and generalization ability.

[0066] Based on the foregoing solution, in some implementations of the present application, the deep learning network model uses a stochastic gradient descent optimizer and categorical cross-entropy as the loss function. Among them, the stochastic gradient descent optimizer gradually optimizes the model by iteratively updating the parameters, enabling it to better fit the training data. At the same time, the categorical cross-entropy loss function can accurately evaluate the performance of the model and guide the update direction of the model parameters, thereby improving the classification accuracy of the model.

[0067] It should be noted that although the stochastic gradient descent optimizer may introduce some noise, this noise helps the model to jump out of local optima and explore a wider parameter space, thereby enhancing the generalization ability of the deep learning network model to a certain extent. Exemplarily, in some implementations of the present application, the learning rate of the stochastic gradient descent optimizer is 0.001. Among them, the selection of the learning rate is crucial. A smaller learning rate (such as 0.001 in the present application) can make the model training more stable, but may lead to a slower convergence speed; a larger learning rate may accelerate the convergence, but may also cause the model to oscillate near the minimum value or even fail to converge. In the above implementation, the learning rate of 0.001 is a more appropriate value obtained through multiple experiments and adjustments, which can ensure the convergence of the deep learning network model while making the training process relatively efficient.

[0068] Based on the foregoing solution, in some implementations of the present application, ImageDataGenerator is used to perform data augmentation and preprocessing on the target image set.

[0069] It should be noted that ImageDataGenerator is a very useful utility class provided in the Keras framework, which is specifically used for the preprocessing and augmentation of image data. By using ImageDataGenerator, it is possible to easily perform batch processing on image data, including various forms of data augmentation operations such as rotation, scaling, translation, flipping, as well as common preprocessing operations such as normalization and standardization.

[0070] Based on the foregoing solution, in some implementation manners of the present application, the randomly dividing into a training set, a validation set, and a test set according to a ratio includes: randomly selecting 70% of the blood cell images from the target image set that has undergone data augmentation and preprocessing as the training set, and the remaining 30% of the blood cell images as the test set, and randomly extracting 20% of the blood cell images from the training set as the validation set.

[0071] In the above implementation manner, 70% of the blood cell images are randomly selected from the target image set that has undergone augmentation and preprocessing as the training set. This part of the data will be used to train a machine learning or deep learning model so that the model can learn the characteristics of blood cells. The remaining 30% of the blood cell images are used as the test set. The test set is used after the model training is completed to evaluate the performance of the model and ensure that the model can also perform well on unseen data. 20% of the blood cell images are randomly extracted from the training set as the validation set. The validation set is used during the model training process and will be used to adjust the hyperparameters of the model (such as the learning rate, batch size, etc.), as well as to perform strategies such as early stopping to prevent overfitting.

[0072] Exemplarily, the os.walk function in Python can be used to traverse the directory structure storing blood cell image data (target image set) to obtain the image file paths. According to the data categories, the image file paths of different categories are stored in the filepaths list respectively, and the corresponding category labels are stored in the labels list. Then, these two lists are combined into a data frame named bloodCell_df through the pandas library, and statistical and viewing operations are performed on the data frame, such as printing the first few rows of data and performing value count statistics on the category labels, to deeply understand the distribution characteristics of the data set. Secondly, the train_test_split function is used to divide the data set. First, 70% of the total data volume is divided into the training set train_images for model parameter learning and iteration; the remaining 30% is used as the test set test_images for evaluating the model generalization ability. Then, 20% is extracted from the training set as the validation set val_set. In each iteration cycle of model training, the model performance is evaluated on the validation set, and the training strategy is adjusted according to the evaluation metrics. Then, data augmentation and preprocessing are performed with the help of ImageDataGenerator. Set its preprocessing function to tf.keras.applications.mobilenet_v2.preprocess_input to perform standard normalization operation on the input images. Read data from the data frames (corresponding to the training set, test set, and validation set) through the flow_from_dataframe method, set the target size to (244, 244) pixels, color_mode = 'rgb', class_mode = "categorical", and the batch size to 8 to unify the data specifications, make the data meet the input requirements of the subsequent deep learning network model, and improve the model generalization ability and training effect.

[0073] Based on the foregoing solution, in some implementation manners of the present application, when the training set is input into the deep learning network model for model training, it includes: using the model.fit function for training, where the epochs parameter is set to 10 and the verbose parameter is set to 1; when using the test set to evaluate the trained deep learning network model, it includes evaluating through the model.evaluate function.

[0074] In the above implementation, by setting the verbose parameter to 1, information such as the progress bar, loss value, and accuracy during the training process is printed in real time. This helps researchers or developers monitor the training process and promptly discover and solve potential problems. At the same time, using an independent test set to evaluate the model through the model.evaluate function can ensure the objectivity and accuracy of the evaluation results. This helps to judge the performance of the model in real application scenarios and provides guidance for subsequent model optimization. Additionally, by reasonably setting the epochs parameter, while ensuring the model performance, unnecessary waste of training time can be avoided. Too many training epochs may lead to overfitting, while too few training epochs may result in the model not being fully converged. Moreover, the model.fit and model.evaluate functions provide rich interfaces and parameter settings, facilitating researchers or developers to optimize and debug the model according to actual needs. For example, the model performance can be further improved by adjusting hyperparameters such as the learning rate and batch size.

[0075] In summary, the above implementation provides a feasible implementation path for the application of deep learning in the field of blood cell image analysis. By training and optimizing the deep learning model, the accuracy and efficiency of blood cell image recognition can be improved. Through the reasonable use of the model.fit and model.evaluate functions in the deep learning framework, not only the efficient training and accurate evaluation of the model are achieved, but also the convenience for subsequent model optimization and debugging is provided.

[0076] Based on the foregoing solution, in some implementations of the present application, when using a test set to evaluate a trained deep learning network model, it includes evaluating through precision, recall, and F1-score, so as to evaluate the accuracy, integrity, and balance of the model from different perspectives, achieving the purpose of comprehensively reflecting the performance of the deep learning network model in blood cell image analysis and providing strong guidance for model optimization.

[0077] Embodiment 2

[0078] Please refer to Figure 2 , the embodiment of the present application provides an electronic device, which includes at least one processor 201 and at least one memory 202; wherein, the processor 201 is directly connected to the memory 202, or communicates with each other through the communication interface 203, or is electrically connected through one or more communication buses or signal lines to achieve data transmission or interaction; the memory 202 stores program instructions executable by the processor 201, and the processor 201 calls the program instructions to execute a classification method for blood cell images. For example, it can implement:

[0079] Obtain a target image set, where the target image set is a collection of blood cell images obtained by collecting images of peripheral blood smears of suspected blood cancer patients under a microscope; after performing data augmentation and preprocessing on the target image set, randomly divide it into a training set, a validation set, and a test set according to a ratio; construct a deep learning network model, where the deep learning network model is a sequential structure including an input layer, multiple convolutional layers, a batch normalization layer, a max pooling layer, a flattening layer, multiple fully connected layers, a Dropout layer, and an output layer in sequence; input the training set into the deep learning network model for model training, and at the same time evaluate the model performance using the validation set in each iteration cycle, and adjust the training strategy according to the evaluation results; use the test set to evaluate the trained deep learning network model to obtain a deep learning network model whose performance reaches a predetermined standard, and use it to classify the blood cell images to be classified.

[0080] Among them, the memory 202 can be, but is not limited to, a random access memory (Random Access Memory, RAM), a read-only memory (Read Only Memory, ROM), a programmable read-only memory (Programmable Read-Only Memory, PROM), an erasable programmable read-only memory (Erasable Programmable Read-Only Memory, EPROM), an electrically erasable programmable read-only memory (Electric Erasable Programmable Read-Only Memory, EEPROM), etc.

[0081] The processor 201 can be an integrated circuit chip with signal processing capabilities. The processor 201 can be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; it can also be a digital signal processor (Digital Signal Processing, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0082] It can be understood that Figure 2 The structure shown is only for illustration, and the electronic device may also include more or fewer components than those shown Figure 2 in the figure, or have a different configuration from that shown Figure 2 in the figure. Figure 2Each component shown in the figure may be implemented by hardware, software, or a combination thereof.

[0083] Embodiment 3

[0084] This application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor 201, a classification method for blood cell images is implemented. For example, it implements:

[0085] Obtain a target image set, where the target image set is a set of blood cell images obtained by collecting images of peripheral blood smears of suspected blood cancer patients under a microscope; after performing data augmentation and preprocessing on the target image set, randomly divide it into a training set, a validation set, and a test set according to a ratio; construct a deep learning network model, where the deep learning network model is a sequential structure including an input layer, multiple convolutional layers, a batch normalization layer, a max pooling layer, a flattening layer, multiple fully connected layers, a Dropout layer, and an output layer in sequence; input the training set into the deep learning network model for model training, and at the same time evaluate the model performance using the validation set in each iteration cycle, and adjust the training strategy according to the evaluation results; use the test set to evaluate the trained deep learning network model to obtain a deep learning network model whose performance meets a predetermined standard, and use it to classify the blood cell images to be classified.

[0086] If the above functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store program codes.

[0087] For those skilled in the art, it is obvious that this application is not limited to the details of the above exemplary embodiments, and can be implemented in other specific forms without departing from the spirit or basic characteristics of this application. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-limiting. The scope of this application is defined by the appended claims rather than the above description. Therefore, all changes falling within the meaning and scope of the equivalent elements of the claims are intended to be included in this application. Any reference signs in the claims should not be regarded as limiting the claimed rights.

Claims

1. A blood cell image classification method, characterized in that: The following steps are involved: Acquire a target image set, wherein the target image set is a collection of blood cell images obtained by collecting images of peripheral blood smears of patients suspected of blood cancer under a microscope; After data enhancement and preprocessing, the target image set is randomly divided into a training set, a validation set, and a test set according to a certain ratio; Constructing a deep learning network model, wherein the deep learning network model is a sequence structure including an input layer, multiple convolutional layers, a batch normalization layer, a maximum pooling layer, a flattening layer, multiple fully connected layers, a Dropout layer and an output layer in sequence; Input the training set into the deep learning network model to train the model. Use the validation set to evaluate the model performance in each iteration cycle and adjust the training strategy based on the evaluation results. The trained deep learning network model is evaluated using the test set to obtain a deep learning network model whose performance meets the predetermined standard, which is used to classify the blood cell images to be classified.

2. The method according to claim 1, characterized in that The deep learning network model includes, in order: An input layer, used to receive image data in a target image set; Multiple convolutional layers, each with a different number of filters, kernel sizes and strides, to extract features from image data; Batch normalization layer, set after each convolutional layer, is used to normalize the output of the convolutional layer; The max pooling layer is placed after the batch normalization layer to reduce the dimensionality of the data while retaining the most significant features; The flattening layer is used to convert the multi-dimensional feature map after convolution, batch normalization and pooling operations into a one-dimensional vector; Multiple fully connected layers, set after the flattening layer, are used to classify the extracted features. The neurons in the fully connected layer are connected to all the neurons in the previous layer; Dropout layer, set between fully connected layers, is used to randomly drop some neurons during training; The output layer has the same number of neurons as the number of blood cell categories to be classified. It uses the softmax activation function for multi-classification and outputs the predicted probability of each category.

3. The method according to claim 2, characterized in that The initial convolution layer of the multiple convolution layers is configured with 128 filters, the convolution kernel size is (8,8), the step size is (3,3), and the activation function is relu. The number of filters in subsequent convolution layers gradually increases, such as 256 and 512, and different convolution kernel sizes and step sizes are used to gradually extract features of different scales and levels in the image.

4. The method according to claim 1 or 2, characterized in that: The deep learning network model adopts a stochastic gradient descent optimizer and uses the classification cross quotient as the loss function.

5. The method according to claim 4, characterized in that The learning rate of the stochastic gradient descent optimizer is 0.

001.

6. The method according to claim 1, characterized in that The data enhancement includes rotation, flipping, scaling and / or adding noise processing.

7. The method according to claim 1 or 6, characterized in that: ImageDataGenerator is used to perform data enhancement and preprocessing on the target image set.

8. The method according to claim 1, characterized in that: The randomly dividing into a training set, a validation set and a test set in proportion includes: randomly selecting 70% of the blood cell images from the target image set that has undergone data enhancement and preprocessing as the training set, the remaining 30% of the blood cell images as the test set, and randomly selecting 20% ​​of the blood cell images from the training set as the validation set.

9. The method according to claim 1, characterized in that: The training set is input into the deep learning network model, and the model training includes: using the model.fit function for training, wherein the epochs parameter is set to 10 and the verbose parameter is set to 1; When using the test set to evaluate the trained deep learning network model, it includes evaluating it through the model.evaluate function.

10. The method according to claim 1, characterized in that The use of the test set to evaluate the trained deep learning network model includes evaluation through precision, recall, and F1 score.

Citation Information

Patent Citations

  • Ultra-high-definition video compression damage grade evaluation method based on deep learning network

    CN116524387A

  • Image classification width learning system, training method thereof and image classification method

    CN116740455A

  • Deep learning algorithm of whole genome prediction model

    CN117877587A

  • Brain tumor image classification method based on MD-MAResNeXt neural network

    CN118115820A

  • Deep learning based bone fracture detection

    IN202341060903A

Cited By

  • Deep learning-based blood smear whole red blood cell abnormal morphology evaluation system

    CN121544632A