Blood image recognition and analysis method

By using multi-category blood image dataset, convolutional neural network and random forest model in blood image recognition analysis, combined with MobileNetV2 for image classification, the problem of low detection accuracy of existing blood image recognition analysis methods is solved, and higher detection accuracy and image classification effect are achieved.

CN118644734BActive Publication Date: 2025-03-11YONGCHUAN HOSPITAL AFFILIATED TO CHONGQING MEDICAL UNIV (CHONGQING SECOND PEOPLES HOSPITAL)
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410872279.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-01
Publication Date
2025-03-11
Estimated Expiration
2044-07-01

AI Technical Summary

Technical Problem

When processing blood images, the existing blood image recognition and analysis methods have low detection accuracy and lack rich data sets, which makes the accuracy of calibration results to be verified.

Method used

The blood image recognition and analysis method is used to select blood image data sets of multiple categories, and the training set and test set are preprocessed and divided, and a random forest model based on convolutional neural network is trained. Finally, MobileNetV2 is used as the image classification model to classify blood images.

Benefits of technology

The detection accuracy of blood image recognition analysis is improved, and the accuracy and recall rate of image classification are improved through multi-layer data preprocessing and model training.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118644734B_ABST
    Figure CN118644734B_ABST
Patent Text Reader

Abstract

The present invention belongs to the technical field of machine learning, and proposes a blood image recognition and analysis method, comprising: dividing images in all blood image data sets into a first training set and a first test set according to a first division ratio; preprocessing the images in the blood image data sets, and dividing the preprocessed first training set into a second training set and a second test set according to a second division ratio; setting an image generator and a data stream based on the second training set and the second test set; training a random forest model based on a convolutional neural network; determining its loss function and correct rate by adjusting the learning rate and fitting training of the image classification model, and adjusting the confusion matrix of the image classification model to calculate its precision and recall rate, so as to obtain a final image classification model based on MobileNetV2; when a blood image is input, classifying the input blood image by the final image classification model based on MobileNetV2.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of machine learning, and in particular to a blood image recognition and analysis method. Background Art

[0002] Currently, blood analysis is mostly done manually by experienced medical personnel, and blood testing is also done automatically through automated testing equipment to promptly detect whether the relevant population has blood-related diseases.

[0003] For example, the patent application with application number CN202311026075.2 discloses a blood image sampling compensation method, device, equipment and readable storage medium. The main scheme of the application is: obtain a blood sample image of the blood sample carried on the counting plate; determine the chromatographic area and the unchromatographic area in the blood sample image; based on the chromatographic area and the unchromatographic area, compensate the visual sampling points to obtain effective visual sampling points; use the effective visual sampling points to sample the blood sample image to determine the blood test results of the blood sample. Through this application, accurate blood test results can be detected and calculated even when the blood sample chromatography is insufficient, and the efficiency of blood testing is also higher.

[0004] However, the above application directly processes blood images without a richer data set, and the accuracy of its calibration results needs to be verified. Summary of the invention

[0005] The object of the present invention is to provide a blood image recognition and analysis method with high detection accuracy.

[0006] The present invention solves the technical problem and adopts the following technical solution:

[0007] The blood image recognition and analysis method comprises the following steps:

[0008] Selecting a plurality of categories of blood image data sets, and dividing the images in all the blood image data sets into a first training set and a first test set according to a first division ratio;

[0009] Preprocessing the images in the blood image data set, and dividing the preprocessed first training set into a second training set and a second test set according to a second division ratio;

[0010] Setting an image generator and a data flow based on a second training set and a second test set;

[0011] After inputting the second training set into the image generator and the data stream, training a random forest model based on a convolutional neural network, wherein the last fully connected layer of the random forest model based on the convolutional neural network is an image classification model based on MobileNetV2;

[0012] By adjusting the learning rate and fitting training of the image classification model, its loss function and accuracy are determined, and the confusion matrix of the image classification model is adjusted to calculate its precision and recall, and the final image classification model based on MobileNetV2 is obtained;

[0013] When a blood image is input, the input blood image is classified by the final MobileNetV2-based image classification model.

[0014] As a further optimization, the selected multiple categories of blood image datasets include a CML dataset, an IDA dataset, a Thalassemia Major dataset, a Thalassemia Minor dataset, a Normal dataset, an APML dataset, and a Blast Cells dataset.

[0015] As a further optimization, the first division ratio and the second division ratio are both 9:1.

[0016] As a further optimization, the image is preprocessed, including the following steps:

[0017] Use OpenCV library to read the image and resize it to 224x224;

[0018] Get the image label by splitting the image path using the path separator;

[0019] Determine the path to save the image based on different tags;

[0020] Depending on the tag, the image is saved using different subfolders and file names.

[0021] As a further optimization, after saving the image, the following is also included:

[0022] Convert the image from BGR color space to RGB color space;

[0023] Convert the image from RGB color space to LAB color space and separate the LAB channel into L, A, and B channels;

[0024] Flatten the A channel into a one-dimensional array, cluster the pixel values ​​into 7 clusters through K-means clustering, and map the cluster centers back to the original data points;

[0025] Reshape the reconstructed clustering result into the same shape as the original image and convert the data type to an unsigned 8-bit integer;

[0026] The image is binarized according to the threshold, and the pixel values ​​greater than 141 are set to 255, and the pixel values ​​less than 141 are set to 0;

[0027] Fill holes in binary images using morphological operations;

[0028] Remove objects smaller than 200 pixels in binary images, and remove holes smaller than 250 pixels in binary images;

[0029] Perform a bitwise AND operation on the original RGB image and the binarized image to extract the target area of ​​interest.

[0030] As a further optimization, the settings of the image generator and data flow refer to:

[0031] Two image generator objects gen and gen2 are created through ImageDataGenerator. These generators will be used to preprocess and enhance the images.

[0032] The gen generator uses some preprocessing operations, including scaling pixel values ​​to the range 0-1 and random vertical and horizontal flipping operations;

[0033] The gen2 generator scales pixel values ​​to the range 0-1;

[0034] Three data flows are created using the flow_from_dataframe method: train_gen, valid_gen, and test_gen, where gen is used to generate training sets and gen2 is used to generate validation sets and test sets.

[0035] As a further optimization, when training the random forest model, a grid search is used to search for the best parameter combination of the random forest model, including the n_estimators parameter, the max_depth parameter, the min_samples_split parameter, and the max_features parameter;

[0036] The n_estimators parameter defines the number of decision trees that make up the random forest and is set to 100, 150, 200, and 300;

[0037] The max_depth parameter defines the maximum depth of each decision tree and is set to 5 and 10;

[0038] The min_samples_split parameter specifies the minimum number of samples an internal node must have, which are 2, 5, and 10 respectively;

[0039] The max_features parameter defines the number of features considered when splitting nodes in each decision tree. max_features specifies the maximum number of features to be considered in each split, where 'max_features': ['auto', 'sqrt', 0.5] means that different max_features values ​​will be tried, including automatic determination, i.e. 'auto', square root, i.e. 'sqrt', and half the number of features, i.e. 0.5.

[0040] As a further optimization, when training the convolutional neural network model, the convolutional neural network is CNN, and CNN includes 3 convolutional layers, 2 normalization layers and 3 fully connected layers;

[0041] The first convolutional layer: 32 filters, each filter size is 3x3, using ReLU activation function;

[0042] The second convolutional layer: 64 filters, each filter size is 3x3, using the ReLU activation function;

[0043] The third convolutional layer has 128 filters, each with a size of 3x3 and uses a ReLU activation function.

[0044] As a further optimization, use the tf.keras.applications.mobilenet_v2.MobileNetV2 function to build an image classification model based on MobileNetV2;

[0045] The image classification model is set to not include fully connected layers, use pre-trained ImageNet weights, set the weights of the pre-trained model to be non-trainable, that is, freeze these weights and do not participate in the training process, and specify the input shape as 224,224, 3;

[0046] When defining the layer operations of the image classification model, first, the output of the model is passed as input to the GlobalAveragePooling2D layer for global average pooling of the feature map. Then, the features are batch normalized using the BatchNormalization layer. Finally, the code uses the Dense function to build the output layer, which has 7 nodes and a softmax activation function.

[0047] As a further optimization, the last line of code of the image classification model creates a Model object, connects the input and output of the model, and obtains the final classification model.

[0048] The beneficial effects of the present invention are as follows: through the above-mentioned blood image recognition and analysis method, first, multiple categories of blood image data sets are selected, and the images in all blood image data sets are divided into a first training set and a first test set according to a first division ratio; secondly, the images in the blood image data set are preprocessed, and the preprocessed first training set is divided into a second training set and a second test set according to a second division ratio; then, an image generator and a data stream are set based on the second training set and the second test set; then, after the second training set is input into the image generator and the data stream, a random forest model based on a convolutional neural network is trained, and the last fully connected layer of the random forest model based on the convolutional neural network is an image classification model based on MobileNetV2; then, the loss function and the correct rate of the image classification model are determined by adjusting the learning rate and fitting training of the image classification model, and the confusion matrix of the image classification model is adjusted to calculate its precision and recall rate, so as to obtain a final image classification model based on MobileNetV2; finally, when a blood image is input, the input blood image is classified by the final image classification model based on MobileNetV2. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 Flow chart of a blood image recognition and analysis method according to an embodiment of the present invention;

[0050] Figure 2 Schematic diagram of the loss function and accuracy of the training set and the test set in an embodiment of the present invention;

[0051] Figure 3 A schematic diagram of the loss function and accuracy of the training process for fitting data in an embodiment of the present invention;

[0052] Figure 4 It is a schematic diagram of the framework of the model in the embodiment of the present invention;

[0053] Figure 5 It is a graphic preprocessing of the model in the embodiment of the present invention and a visualization diagram of MobileNetV2;

[0054] Figure 6 Schematic diagram of the confusion matrix of the MobileNetV2 model after fine-tuning in an embodiment of the present invention;

[0055] Figure 7 It is a schematic diagram of calculating the recall rate and precision rate of each category of the confusion matrix in an embodiment of the present invention. DETAILED DESCRIPTION

[0056] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations. Example

[0057] This embodiment provides a blood image recognition and analysis method, and its flow chart is shown in Figure 1 , wherein the method comprises the following steps:

[0058] S1, selecting a plurality of categories of blood image data sets, and dividing the images in all the blood image data sets into a first training set and a first test set according to a first division ratio;

[0059] S2, preprocessing the images in the blood image data set, and dividing the preprocessed first training set into a second training set and a second test set according to a second division ratio;

[0060] S3, setting an image generator and a data stream based on a second training set and a second test set;

[0061] S4, after inputting the second training set into the image generator and the data stream, training a random forest model based on a convolutional neural network, wherein the last fully connected layer of the random forest model based on the convolutional neural network is an image classification model based on MobileNetV2;

[0062] S5. Determine the loss function and accuracy of the image classification model by adjusting the learning rate and fitting training of the image classification model, and adjust the confusion matrix of the image classification model to calculate its precision and recall rate, and obtain the final image classification model based on MobileNetV2;

[0063] S6. When a blood image is input, the input blood image is classified by the final MobileNetV2-based image classification model.

[0064] In this example, the blood dataset is selected, which has a total of 7 categories, including CML (chronic myeloid leukemia) dataset, IDA (iron deficiency anemia) dataset, Thalassemia Major (severe thalassemia) dataset, Thalassemia Minor (minor thalassemia) dataset, Normal dataset, APML (acute promyelocytic leukemia) dataset, and Blast Cells dataset.

[0065] CML Dataset: Chronic Myeloid Leukemia (CML) is a leukemia caused by abnormal bone marrow stem cells, characterized by an abnormal increase in white blood cells. This dataset contains a variety of mixed white blood cell types for identification and detection of CML.

[0066] IDA dataset: Iron Deficiency Anemia (IDA) is a common anemia disease characterized by insufficient iron in the body to synthesize hemoglobin. Pencil cells and target cells can be observed in red blood cells, which have abnormal morphology and are very thin.

[0067] Thalesemia major dataset: Thalesemia major is a hereditary anemia disorder in which patients experience severe anemia. Some target cells are visible, but many red blood cells are ruptured and the number of white blood cells is low.

[0068] Thalesimia minor dataset: Thalassemia minor is also a hereditary anemia disease, and patients usually have no obvious anemia symptoms. This dataset contains some target cells with obvious characteristics (thin rings with a dot in the middle), while the red blood cells are thin in shape and the white blood cell ratio is normal.

[0069] Normal data set: The normal data set used is mainly used as a control group for comparison and analysis with the data of leukemia and anemia diseases. This data set contains normal proportions of blood cells and white blood cells.

[0070] APML dataset: Acute Promyelocytic Leukemia (APML) is a subtype of leukemia characterized by an abnormal increase in promyelocytes in the bone marrow. It is used to study and identify this type of leukemia.

[0071] Burst Cell Dataset: This dataset is used to detect Acute Lymphoblastic Leukemia (ALL).

[0072] The use of these datasets is intended to help researchers better understand and identify different types of leukemia and anemia diseases.

[0073] In this embodiment, APML: 91, blast cell: 101, CML: 140, IDA: 99, normal: 115, Thalesemia_major: 56, Thalesemia_minor: 88. There are 690 images in total.

[0074] It can be seen that the Chronic Myeloid Leukemia (CML) dataset has the largest number of 140, while the Thalassemia minor hereditary anemia disease dataset has the smallest number of 56. In general, the datasets of each category are relatively balanced and do not need to be balanced.

[0075] First, we divide the 690 images into training set and test set, and use train_test_split to divide them into 9 and 1. We get the training set and the test set.

[0076] Now we need to preprocess the image. The preprocessing method of this embodiment includes: First, the code uses the OpenCV library to read the image and resizes it to 224x224. Then, the image path is split using the path separator (os.path.sep) to obtain the image label. Then, based on the different labels, the path to save the image is determined. Depending on the different labels, different subfolders and file names are used to save the image, and the test set images are saved in the same way.

[0077] Next, the image is converted from the BGR color space to the RGB color space. Then the image is converted from the RGB color space to the LAB color space, and the LAB channel is separated into L, A, and B channels. Then, the A channel is flattened into a one-dimensional array, the pixel values ​​are clustered into 7 clusters by K-means clustering, and the cluster centers are mapped back to the original data points. The reconstructed clustering results are reshaped into the same shape as the original image, and the data type is converted to an unsigned 8-bit integer. The image is binarized according to the threshold, and the pixel values ​​greater than 141 are set to 255, and the pixel values ​​less than 141 are set to 0. Afterwards, morphological operations are used to fill the holes in the binary image. Objects less than 200 pixels in the binary image are removed. Holes less than 250 pixels in the binary image are removed. Finally, the original RGB image and the binarized image are bitwise ANDed to extract the target area of ​​interest. In this way, the data preprocessing of this embodiment is temporarily terminated.

[0078] Next, the training set needs to be split into 9 parts, 1 part becomes the test set, and the training set contains 2443 images, the validation set contains 272 images, and the test set contains 126 images.

[0079] In order to make the model have better effects, the image generator and data flow are then set up for training, validation, and testing, while scaling and enhancing the data. The ImageDataGenerator class creates two image generator objects gen and gen2, which will be used to preprocess and enhance the images. The gen generator uses some preprocessing operations, including scaling pixel values ​​to the range of 0-1, and random vertical and horizontal flipping operations. The gen2 generator scales pixel values ​​to the range of 0-1. Three data streams are created using the flow_from_dataframe method: train_gen, valid_gen, and test_gen. Among them, gen is used to generate training sets, and gen2 is used to generate validation sets and test sets.

[0080] Next, use the random forest model for training, and use grid search (GridSearchCV) to search for the best parameter combination for the random forest model. The n_estimators parameter is an important parameter in the random forest model. It defines the number of decision trees that make up the random forest. Specifically, n_estimators specifies the number of decision trees to be built, so it is set to 100, 150, 200, 300. The max_depth parameter is another important parameter in the random forest model. It defines the maximum depth of each decision tree. We set it to 5 and 10. min_samples_split specifies the minimum number of samples that an internal node must have, which are 2, 5, and 10 respectively. The max_features parameter is also another important parameter in the random forest model. It defines the number of features considered when splitting nodes in each decision tree.

[0081] Specifically, max_features specifies the maximum number of features to be considered in each split. 'max_features': ['auto', 'sqrt', 0.5] means that different max_features values ​​will be tried, including automatic determination ('auto'), square root ('sqrt'), and half the number of features (0.5). By trying different parameter combinations and selecting the best performing parameters. Through grid search, our test set accuracy increased from 88.8% to 91.2%, which can be said to have improved a lot, which also shows that random forest has a good fit for predicting blood data.

[0082] Then we train the convolutional neural network CNN, which contains 3 convolutional layers, 2 normalization layers, and 3 fully connected layers. The first convolutional layer has 32 filters, each with a size of 3x3, and uses the ReLU activation function. The second convolutional layer has 64 filters, each with a size of 3x3, and uses the ReLU activation function. The third convolutional layer has 128 filters, each with a size of 3x3, and uses the ReLU activation function. After running 30 epochs, the accuracy of the training set reached 88.78%, and the validation set reached 85%. We selected parameters for the ouput layer of CNN, and found that softmax was the best, with a test set accuracy of 88.88%, which was in line with expectations.

[0083] In addition to using the random forest machine learning model deep learning model CNN, this example also uses the MobileNetV2 model for classification and builds an image classification model based on MobileNetV2. A MobileNetV2 model is built using the tf.keras.applications.mobilenet_v2.MobileNetV2 function. This model is set to not include the top (i.e., fully connected layer), use the pre-trained ImageNet weights, and set the weights of the pre-trained model to be untrainable, i.e., freeze these weights and do not participate in the training process. And specify the input shape as (224,224, 3). After that, define a series of layer operations.

[0084] Here, when building an image classification model based on MobileNetV2, first, the output of the model is passed as input to the GlobalAveragePooling2D layer for global average pooling of the feature map. Then, the features are batch normalized using the BatchNormalization layer. Finally, the code uses the Dense function to build the output layer, which has 7 nodes (corresponding to 7 categories) and a softmax activation function. The last line of code creates a Model object, which connects the input and output of the model to get the final classification model. The code loads the pre-trained MobileNetV2 model and specifies that the weights are ImageNet weights and the input shape is (224, 224, 3). At the same time, by setting include_top=False, the top classifier of the model is not included. Then, the code continues, and the code uses tf.keras.Sequential to build the complete network model. The model consists of a pre-trained model, a global average pooling layer, and a fully connected layer with 7 nodes and a softmax activation function. After that, the code compiles the model using model.compile, sets the optimizer to Adam, the loss function to categorical_crossentropy, and the evaluation metric to accuracy. Finally, the code trains the model using model.fit. The history of the training process will be saved in the history variable. The accuracy of the training set is 87%, the accuracy of the validation machine is 85%, and the accuracy of the test set is 95%. Figure 2 Here are the loss functions and accuracy of the training set and test set. We can see that we have achieved good results.

[0085] Next, this embodiment fine-tunes the model, hoping that the model will have better performance. First, the learning rate learning = 0.001 is changed to 0.005. The learning rate (Learning Rate) is an important hyperparameter in neural network training, which is used to control the step size of model parameter updates in each iteration. The choice of learning rate has a significant impact on the convergence speed of training and the quality of results, so the training is changed 30 times. Through model training, it was found that there was no better than the learning rate of 0.005. Then, the model structure was fine-tuned. Since the original model only had one fully connected layer, the output layer, a fully connected layer with unit = 128 was added in front of the output layer. Fit the data for training, Figure 3 Schematic diagram of the loss function and accuracy of the training process.

[0086] pass Figure 3 It can be found that the accuracy of the model's training set exceeds 87.5%, the accuracy of the validation set is about 87.5%, and the accuracy of the test set is as high as 99%, which is 4% higher than the accuracy of the meta-model. Figure 4 The following is a schematic diagram of the model framework. You can see that the first layer mobilenetv2_1.00_224 is the bottom MobileNetV2 convolution part, and the input shape is (None, 7, 7,1280). Next is a global average pooling layer global_average_pooling2d_3, which converts the input shape from (None, 7, 7, 1280) to (None, 1280). Then there is a fully connected layer dense_2 with 128 neurons and an output shape of (None, 128). Finally, there is an output layer dense_3 with 7 neurons, corresponding to the 7 categories of the classification problem, and the output shape is (None, 7). The total number of parameters is 2422855, which is about 9.24MB. Among them, the number of trainable parameters is 164871, which is about 644.03 KB; the number of non-trainable parameters is 2257984, which is about 8.61 MB.

[0087] See also Figure 5 , graph preprocessing of the model and visualization of MobileNetV2.

[0088] In this embodiment, not only the accuracy of the model should be considered, but also the precision and recall rate should be considered because it is a classification problem. Figure 6 This is a diagram of the confusion matrix of the fine-tuned MobileNetV2 model. By calculating the recall and precision of each category, see the diagram Figure 7 It can be seen that the MobileNetV2 model has a very high resolution for the blood dataset, which is basically 100%, except for the APML (acute promyelocytic leukemia) dataset, where the precision is 95%, and the BlastCells (primitive cells) dataset, where the recall rate is 95%. Through our comparison of the above three models, we found that the MobileNetV2 model has a better effect on the classification of our blood dataset images.

[0089] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A blood image recognition and analysis method, characterized in that: The steps include: Selecting a plurality of categories of blood image data sets, and dividing the images in all the blood image data sets into a first training set and a first test set according to a first division ratio; Preprocessing the images in the blood image data set, and dividing the preprocessed first training set into a second training set and a second test set according to a second division ratio; The preprocessing of the images in the blood image data set comprises the following steps: Use OpenCV library to read the image and resize it to 224x224; Get the image label by splitting the image path using the path separator; Determine the path to save the image based on different tags; Depending on the tag, the images are saved using different subfolders and file names; After saving the image, the method further includes: Convert the image from BGR color space to RGB color space; Convert the image from RGB color space to LAB color space and separate the LAB channel into L, A, and B channels; Flatten the A channel into a one-dimensional array, cluster the pixel values ​​into 7 clusters through K-means clustering, and map the cluster centers back to the original data points; Reshape the reconstructed clustering result into the same shape as the original image and convert the data type to an unsigned 8-bit integer; The image is binarized according to the threshold, and the pixel values ​​greater than 141 are set to 255, and the pixel values ​​less than 141 are set to 0; Fill holes in binary images using morphological operations; Remove objects smaller than 200 pixels in binary images, and remove holes smaller than 250 pixels in binary images; Perform a bitwise AND operation on the original RGB image and the binarized image to extract the target area of ​​interest; Setting an image generator and a data flow based on a second training set and a second test set; After inputting the second training set into the image generator and the data stream, training a random forest model based on a convolutional neural network, wherein the last fully connected layer of the random forest model based on the convolutional neural network is an image classification model based on MobileNetV2; By adjusting the learning rate and fitting training of the image classification model, its loss function and accuracy are determined, and the confusion matrix of the image classification model is adjusted to calculate its precision and recall, and the final image classification model based on MobileNetV2 is obtained; When a blood image is input, the input blood image is classified by the final MobileNetV2-based image classification model; Among them, the image classification model based on MobileNetV2 was set to not include a fully connected layer, using the pre-trained ImageNet weights, and setting the weights of the pre-trained model to be non-trainable, freezing these weights and not participating in the training process; When defining the layer operations of the image classification model, first, the output of the model is passed as input to the GlobalAveragePooling2D layer, which is used to perform global average pooling on the feature map. Then, the features are batch normalized using the BatchNormalization layer. Finally, the code uses the Dense function to build the output layer.

2. The blood image recognition and analysis method according to claim 1, characterized in that: The selected multiple categories of blood image datasets include a chronic myeloid leukemia dataset, an iron deficiency anemia dataset, a major thalassemia dataset, a minor thalassemia dataset, a normal dataset, an acute promyelocytic leukemia dataset, and a blast dataset.

3. The blood image recognition and analysis method according to claim 1, characterized in that: The first division ratio and the second division ratio are both 9:

1.

4. The blood image recognition and analysis method according to claim 1, characterized in that: The setting of the image generator and data flow refers to: Two image generator objects gen and gen2 are created through ImageDataGenerator. These generators will be used to preprocess and enhance the images. The gen generator uses preprocessing operations, including scaling pixel values ​​to the range 0-1 and random vertical and horizontal flipping operations; The gen2 generator scales pixel values ​​to the range 0-1; Three data flows are created using the flow_from_dataframe method: train_gen, valid_gen, and test_gen, where gen is used to generate training sets and gen2 is used to generate validation sets and test sets.

5. The blood image recognition and analysis method according to claim 1, characterized in that: When training the random forest model based on the convolutional neural network, a grid search is used to search for the best parameter combination of the random forest model, including the n_estimators parameter, the max_depth parameter, the min_samples_split parameter, and the max_features parameter; The n_estimators parameter defines the number of decision trees that make up the random forest and is set to 100, 150, 200, and 300; The max_depth parameter defines the maximum depth of each decision tree and is set to 5 and 10; The min_samples_split parameter specifies the minimum number of samples an internal node must have, which are 2, 5, and 10 respectively; The max_features parameter defines the number of features considered when splitting nodes in each decision tree. max_features specifies the maximum number of features to be considered in each split, where 'max_features': ['auto', 'sqrt', 0.5] means that different max_features values ​​will be tried, including automatic determination, i.e. 'auto', square root, i.e. 'sqrt', and half the number of features, i.e. 0.

5.

6. The blood image recognition and analysis method according to claim 1, characterized in that: When the random forest model based on the convolutional neural network is trained, the convolutional neural network is CNN, and CNN includes 3 convolutional layers, 2 normalization layers and 3 fully connected layers; The first convolutional layer: 32 filters, each filter size is 3x3, using ReLU activation function; The second convolutional layer: 64 filters, each filter size is 3x3, using the ReLU activation function; The third convolutional layer has 128 filters, each with a size of 3x3 and uses a ReLU activation function.

Citation Information

Patent Citations

  • Blood image sampling compensation method, device and equipment and readable storage medium

    CN117078619A

  • Circulating tumor cell recognition system based on random forest algorithm

    CN114037662A

  • Complex background bridge crack image classification method based on random forest

    CN117830692A