Method for automatic classification and counting of microscopic images of blood cells
By acquiring microscopic images of blood cells under different staining gradients, performing grayscale conversion and segmentation enhancement processing, extracting the morphological, color, and texture features of blood cells, and using the stability of feature parameters for weighted classification, the problem of inaccurate blood cell classification caused by staining differences is solved, and more accurate automatic classification and counting are achieved.
Patent Information
- Application Number
- CN202511802824.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-03
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2045-12-03
AI Technical Summary
In existing technologies, differences in blood cell staining lead to different image colors, which affects the accuracy of blood cell classification.
We acquired microscopic images of blood cells under different staining gradients, and performed image segmentation and enhancement processing through grayscale processing and local variance segmentation. We extracted the morphological, color, and texture curve feature parameters of blood cells, and performed weighted classification based on the stability of the feature parameters.
It eliminates the influence of staining differences on cell characteristics, improving the accuracy of blood cell classification and counting precision.
Smart Images

Figure CN121259820B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, specifically to an automatic classification and counting method for blood cell microscopic images. Background Technology
[0002] A complete blood count (CBC) is one of the most basic, frequently used, and important clinical laboratory tests. By analyzing the number and morphology of white blood cells (WBC), red blood cells (RBC), and platelets, it can assist in the diagnosis of various diseases such as infection, inflammation, anemia, and leukemia. Almost every patient undergoes this test upon admission or during a physical examination, generating a massive demand for testing. Large-scale blood analyzers, using techniques such as flow cytometry and fluorescence staining, can achieve high-speed, high-throughput cell counting and preliminary classification, and are currently the mainstream automated equipment in hospitals. With the improvement of computer computing power, digital image processing technologies (such as image segmentation and feature extraction) are being applied to cell image analysis, attempting to automatically identify cells.
[0003] To automatically classify and count blood cell microscopic images, it is necessary to acquire blood cell fiber images and identify and analyze the blood cells in the images. However, since blood cells need to be stained before acquiring blood cell microscopic images, different staining scenarios can lead to different colors in the images, and the cellular characteristics of blood cells can be affected by staining, resulting in inaccurate classification results. Summary of the Invention
[0004] To address the technical problem of inaccurate blood cell classification in existing technologies, the present invention aims to provide an automatic classification and counting method for blood cell microscopic images. The specific technical solution adopted is as follows:
[0005] An automatic classification and counting method for blood cell microscopic images, the method comprising:
[0006] Microscopic images of first blood cells from different batches under a preset staining gradient were acquired and then grayscale images of blood cells were obtained.
[0007] The local variance of pixels in the grayscale image of blood cells is obtained, and the segmentation variance value of the grayscale image of blood cells is obtained accordingly.
[0008] For grayscale images of blood cells from different batches, the segmentation variance value is used as a threshold to segment the local variance of the pixels, resulting in multiple regions;
[0009] Multiple regions in each grayscale image of blood cells were enhanced separately to obtain second blood cell microscopic images of different batches with relatively standardized colors and appearances.
[0010] Each cell in different batches of second blood cell microscopic images was segmented to obtain an image of each individual cell;
[0011] The morphology, color, and texture curve of blood cells in each single cell image are extracted to obtain three feature parameters of blood cells;
[0012] The stability of three characteristic parameters in the second blood cell microscopic image was calculated respectively;
[0013] Blood cells are classified using a weighted average method based on the stability of three characteristic parameters.
[0014] Preferably, obtaining the local variance of pixels in a grayscale image of blood cells includes:
[0015] Obtain the eight neighboring pixels of each pixel in the grayscale image of blood cells, as well as the grayscale value of the eight neighboring pixels. Calculate the variance of the grayscale values of the eight neighboring pixels of the pixel, and denot it as the local variance of the pixel.
[0016] Furthermore, the local variance of pixels in the grayscale image of blood cells is obtained, and the segmentation variance value of the grayscale image of blood cells is obtained from this variance, including:
[0017] Based on the local variance of the pixels, the local variance histogram of the pixels in the grayscale image of blood cells is obtained, and the fitting curve of the local variance histogram is obtained accordingly.
[0018] Find the minimum point in the fitted curve of the local variance histogram;
[0019] Select any two local minimum points in the fitted curve of the local variance histogram, divide the fitted curve into three segments, and obtain the definite integral of each segment.
[0020] Obtain the variance of the definite integral of each fitted curve segment, and denote it as the loss value;
[0021] Find the minimum point corresponding to the minimum loss value, and thus obtain the segmentation extreme points of the fitted curve;
[0022] The local variance at the extreme points of the obtained fitted curve is denoted as the segmentation variance value.
[0023] Preferably, multiple regions in each grayscale image of blood cells are enhanced separately to obtain second blood cell microscopic images of different batches with relatively standardized colors and appearances, including:
[0024] The three distinct regions are labeled as smooth region, medium contrast region, and high contrast region, respectively, based on the local variance of their pixels from smallest to largest.
[0025] The enhancement processing for smooth regions is as follows:
[0026] Obtain the maximum and minimum gray values of pixels in the smooth region;
[0027] Based on the maximum and minimum gray values of the obtained pixels, gray value compression is performed on the gray values of the pixels in the smooth region.
[0028] The enhancement process for areas with moderate contrast is as follows:
[0029] Histogram equalization is used to enhance contrast in pixels in moderately contrasting regions;
[0030] No enhancement processing is performed on high-contrast areas;
[0031] By performing the same enhancement process on each grayscale image of blood cells, second blood cell microscopic images of different batches with relatively standardized color appearance are obtained.
[0032] Preferably, each cell in different batches of second blood cell microscopic images is segmented to obtain an image of each single cell, including:
[0033] The U-Net algorithm was used to segment each cell in different batches of second blood cell microscopic images, and the segmented cells were extracted into individual small images, which were recorded as each single cell image.
[0034] Preferably, the morphology of blood cells in each individual cell image is extracted, including:
[0035] Extract the connected components of the nucleus and cytoplasm in each single cell image, and obtain the size of the connected components of the nucleus and cytoplasm in each single cell image respectively;
[0036] The nucleocytoplasmic ratio in a single cell image is obtained by calculating the size of the nuclear connected domain and the size of the cytoplasmic connected domain, thus representing the cell morphology.
[0037] Preferably, the color of blood cells in each individual cell image is extracted, including:
[0038] The single-cell image is projected onto the HSV space, and the hue of each pixel in the single-cell image is extracted;
[0039] Based on the hue of each pixel, the mean hue of the nucleus and cytoplasm in a single cell image, as well as the hue variance of the nucleus and cytoplasm, are obtained respectively.
[0040] The color richness of a single cell image is calculated based on the mean hue of the nucleus and cytoplasm, as well as the variance of the hue of the nucleus and cytoplasm.
[0041] Preferably, the texture curves of blood cells in each individual cell image are extracted, including:
[0042] Obtain a grayscale image of a single cell and obtain the 8 neighboring pixels of each pixel in the single cell image;
[0043] Arrange the 8 neighboring pixels of each pixel in a clockwise order according to the same arrangement;
[0044] For each neighboring pixel, compare its gray value with that of the center pixel. If the gray value of the neighboring pixel is greater than that of the center pixel, then the position of the neighboring pixel is 1; otherwise, it is 0.
[0045] The obtained values are arranged according to the order of the 8 neighboring pixels, thus obtaining an 8-bit binary sequence of the pixel;
[0046] Convert the 8-bit binary sequence of a pixel into a decimal number and record it as the texture value of that pixel;
[0047] Obtain the histogram of texture values of pixels in a single cell image, and fit the histogram using the least squares method to obtain the fitted curve, which is denoted as the texture curve of the single cell image.
[0048] Preferably, the stability of the blood cell characteristics of the three characteristic parameters is calculated separately, including:
[0049] Each individual cell image is labeled and classified, thereby dividing the second blood cell microscopic image into several categories of cell images;
[0050] To obtain images of the same type of cells from different batches of second blood cell microscopic images;
[0051] The first variance of a certain feature parameter of each type of cell image in each second blood cell micrograph is obtained, thereby obtaining the first mean of the first variance of the certain feature parameter of the same type of cell images in different second blood cell micrographs.
[0052] Obtain the second mean of a certain feature parameter in each cell image of each type in each second blood cell micrograph, and obtain the second variance of the second mean of the certain feature parameter in cell images of the same type in different second blood cell micrographs;
[0053] The stability of each characteristic parameter is calculated based on the first mean and the second variance.
[0054] Preferably, weighted classification is performed based on the stability of three characteristic parameters of blood cells, including:
[0055] Stability feature repetition is dynamically generated based on the stability of three feature parameters;
[0056] Additional weights are then added to key pathological features to obtain biological weights;
[0057] The weighted feature vector, which includes stability feature weights and biological weights, is input into the classifier, and the weight allocation is dynamically optimized through a stability gating mechanism.
[0058] Finally, by combining the analysis of misclassified samples, the weight allocation is dynamically optimized, and the cell type and its characteristics are output to achieve automatic component division and counting.
[0059] The present invention has the following beneficial effects:
[0060] To automatically classify and count blood cell microscopic images, first blood cell microscopic images under different staining gradients were acquired. The images were then segmented using the grayscale variations (local variance) of pixels in these first images, and each segmented region was enhanced. Blood cells were extracted from the enhanced second blood cell microscopic images, and three feature parameters—morphology, color, and texture curve—were extracted for each cell. The stability of these feature parameters across different batches of images was assessed, and finally, the stability was used to weight the feature parameters for classification. Compared to traditional methods of image classification and enhancement followed by weighted classification of different feature parameters, this approach eliminates the influence of different staining on cell features, resulting in more accurate cell classification. Attached Figure Description
[0061] To more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0062] Figure 1 This invention provides an automatic classification and counting method for blood cell microscopic images, as an embodiment of the present invention. Detailed Implementation
[0063] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the following describes an automatic classification and counting method for blood cell microscopic images according to the present invention, in conjunction with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.
[0064] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0065] The following describes in detail, with reference to the accompanying drawings, a specific scheme for an automatic classification and counting method for blood cell microscopic images provided by the present invention.
[0066] Please see Figure 1 This illustrates a flowchart of an automatic classification and counting method for blood cell microscopic images provided by an embodiment of the present invention; as shown below. Figure 1 As shown, an automatic classification and counting method for blood cell micrographs includes:
[0067] Microscopic images of first blood cells from different batches under a preset staining gradient were acquired and then grayscale images of blood cells were obtained.
[0068] The local variance of pixels in the grayscale image of blood cells is obtained, and the segmentation variance value of the grayscale image of blood cells is obtained accordingly.
[0069] For grayscale images of blood cells from different batches, the segmentation variance value is used as a threshold to segment the local variance of the pixels, resulting in multiple regions;
[0070] Multiple regions in each grayscale image of blood cells were enhanced separately to obtain second blood cell microscopic images of different batches with relatively standardized colors and appearances.
[0071] Each cell in different batches of second blood cell microscopic images was segmented to obtain an image of each individual cell;
[0072] The morphology, color, and texture curve of blood cells in each single cell image are extracted to obtain three feature parameters of blood cells;
[0073] The stability of three characteristic parameters in the second blood cell microscopic image was calculated respectively;
[0074] Blood cells are classified using a weighted average method based on the stability of three characteristic parameters.
[0075] In one specific embodiment, microscopic images of first blood cells from different batches under a preset staining gradient are acquired, and grayscale images of blood cells are obtained by grayscale processing, including:
[0076] Within the framework of professional clinical research, the data collection process strictly follows the standardized procedures below: Patients meeting ethical review requirements (including healthy volunteers, patients with anemia, and leukemia, and other typical hematological subtypes) obtain informed consent and have 3-5 mL of venous blood collected from their elbows using a vacuum blood collection system (including EDTA-K2 anticoagulant tubes) in a standardized blood collection room. The blood samples are immediately transferred to a constant-temperature logistics box (4±1℃) and delivered to the laboratory within 2 hours. Technicians prepare blood smears according to ISO 15189 standards, placing 10 μL of anticoagulated whole blood on one end of a glass slide and pushing it at a 45° angle to form a monolayer cell membrane. Multiple batches of pre-validated staining agents (such as Wright-Gymsa staining solution of Lot#A / B / C) are then used for differential staining according to a preset staining gradient (30 seconds / 60 seconds / 90 seconds). After staining, the slides are sealed with neutral resin. The sealed slides are then placed in a clinical-grade microscope (such as Olympus) equipped with a motorized stage. Under strict Köhler illumination conditions, first-order blood cell microscopic images were acquired using a 100× oil immersion lens (NA=1.4) and a scientific-grade CMOS camera (such as Hamamatsu ORCA-Flash4.0). Each image sample captured no fewer than 50 fields of view (including sparsely distributed, densely distributed, and edge areas of cell distribution). The original images were saved in 16-bit TIFF format (resolution ≥1920×1440 pixels). Key metadata matrices were recorded simultaneously: patient clinical characteristic codes (age, gender, initial / follow-up visit status), sample processing timestamp, staining agent batch number, staining duration, microscope optical parameters (objective lens model, camera gain value), and ambient temperature and humidity. A structured staining variation database (SVDb) was ultimately formed, and data traceability was achieved through the LIS system and pathological gold standard labels (such as cell subclass counting results from manual re-examination).
[0077] For the first blood cell microscopic image acquired, cell features in the blood need to be extracted for automatic classification; however, due to some differences in staining, data preprocessing is required for different batches of first blood cell microscopic images, such as grayscale processing of the acquired first blood cell microscopic images to obtain blood cell grayscale images.
[0078] In one specific embodiment, the image is enhanced to reduce staining differences in the microscopic images of first blood cells from different batches. However, different tissues in the cells are affected by staining differently during the staining process, so the image needs to be enhanced in different regions.
[0079] In one specific embodiment, obtaining the local variance of pixels in a grayscale image of blood cells includes:
[0080] The local variance of a pixel is calculated by acquiring the eight neighboring pixels of each pixel in the grayscale image of a blood cell, along with the grayscale values of those eight neighboring pixels. It should be noted that the pixel in question is also the center pixel of those eight neighboring pixels.
[0081] In one specific embodiment, due to the biological characteristics of the cell, the chromatin inside the cell nucleus will have significant differences between the nuclei due to the difference between euchromatin and heterochromatin, and the cytoplasm will have a uniform distribution of dye due to the homogenized solution.
[0082] The local variance of pixels in the grayscale image of blood cells is obtained, and the segmentation variance value of the grayscale image of blood cells is obtained from this variance, including:
[0083] Based on the local variance of the pixels, the local variance histogram of the pixels in the grayscale image of blood cells is obtained, and the fitting curve q1 of the local variance histogram is obtained accordingly.
[0084] Obtain the minimum point in the fitted curve q1 of the local variance histogram;
[0085] Select any two local minimum points in the fitted curve q1 of the local variance histogram, divide the fitted curve q1 into three segments, and obtain the definite integral of each segment of the fitted curve, denoted as f1, f2, and f3 respectively.
[0086] Obtain the variance of the definite integral of each fitted curve segment, and denote it as the loss value;
[0087] Find the minimum point corresponding to the minimum loss value, and thus obtain the segmentation extreme points of the fitted curve;
[0088] The local variance at the extreme points of the obtained fitted curve is denoted as the segmentation variance value.
[0089] In one specific embodiment, in order to reduce the staining differences in blood cell microscopic images from different batches, the images are enhanced. However, different tissues in the cells are affected by staining differently during the staining process, so it is necessary to enhance the images in different regions.
[0090] This invention enhances multiple regions in each grayscale image of blood cells to obtain second blood cell microscopic images of different batches with relatively standardized colors and appearances, including:
[0091] The three different regions are labeled as smooth region, medium contrast region and high contrast region according to the local variance of the pixels from small to large.
[0092] For smooth regions, since these regions primarily consist of a homogeneous cytoplasm solution, enhancement needs to be continuously suppressed to minimize the impact of uneven staining and to avoid significant noise. Therefore, the enhancement treatment for smooth regions is as follows:
[0093] Obtain the maximum grayscale value (max) and minimum grayscale value (min) of pixels in the smooth region;
[0094] Based on the maximum gray value (max) and minimum gray value (min) of the obtained pixel, gray value compression is performed on the gray values of the pixels in the smooth region.
[0095] In this invention, the grayscale value of any pixel is compressed to hi×((hi-min)÷(max-min)), where hi is the grayscale value of the pixel. The present invention obtains the proportion of the current grayscale value in the range of the maximum and minimum grayscale values by subtracting the minimum grayscale value from the grayscale value of the pixel and dividing by the difference between the maximum and minimum grayscale values. The obtained proportion is then used to compress the pixel.
[0096] For moderately contrasting regions, which include nuclear margins and cell membrane folds with rich texture, contrast enhancement is needed to reduce staining effects. Therefore, the enhancement process for moderately contrasting regions is as follows:
[0097] Histogram equalization is used to enhance contrast in pixels in moderately contrasting regions.
[0098] For high-contrast regions, which are the interior of the cell nucleus and granular areas with dense chromatin, no enhancement is performed to prevent loss of detail or oversaturation. Therefore, no enhancement processing is applied to high-contrast regions.
[0099] By performing the same enhancement process on each grayscale image of blood cells, second blood cell microscopic images of different batches with relatively standardized color appearance are obtained.
[0100] In one specific embodiment, each cell in different batches of second blood cell microscopic images is segmented to obtain an image of each single cell, including:
[0101] The U-Net algorithm was used to segment each cell in different batches of second blood cell microscopic images, and the segmented cells were extracted into individual small images, which were recorded as each single cell image.
[0102] In one specific embodiment, when classifying blood cells, analysis is usually performed based on the morphology, color, and texture curve of the blood cells, thus requiring feature extraction for each individual cell image acquired.
[0103] This invention extracts the morphology, color, and texture curve of blood cells from each single cell image to obtain three characteristic parameters of blood cells;
[0104] The morphology of blood cells in each individual cell image is extracted, including:
[0105] Extract the connected components of the nucleus and cytoplasm in each single cell image, and obtain the size s1 of the connected component of the nucleus and the size s2 of the connected component of the cytoplasm in each single cell image.
[0106] The nucleocytoplasmic ratio in a single cell image is obtained by calculating the size of the nuclear connected domain and the size of the cytoplasmic connected domain, thus representing the cell morphology.
[0107] In this embodiment, due to the functional and morphological differences of different cell types, the ratio of nucleus to cytoplasm varies among different cell types. Therefore, the nucleus-to-cytoplasm ratio HZ in a single cell image can be obtained, which can be obtained by normalizing s1÷s2. For s1÷s2, the value indicates that the larger the cell nucleus and the smaller the cytoplasm, the larger the nucleus-to-cytoplasm ratio in the single cell image.
[0108] When performing color analysis of blood cells, it is necessary to analyze the color distribution of cells after staining because the color appearance varies under different staining conditions.
[0109] This invention extracts the color of blood cells from each individual cell image, including:
[0110] The single-cell image is projected onto the HSV space, and the hue H of each pixel in the single-cell image is extracted;
[0111] Based on the hue of each pixel, the mean hue of the nucleus and cytoplasm in a single cell image are obtained and denoted as h1 and h2, respectively, and the hue variance of the nucleus and cytoplasm is denoted as c1 and c2, respectively.
[0112] When the color distribution of blood cells is wide, the hue difference between the cell nucleus and cytoplasm will be large and the hue variance will be large; therefore, the color richness YF of a single cell image can be calculated based on the mean hue of the cell nucleus and cytoplasm, as well as the hue variance of the cell nucleus and cytoplasm.
[0113] Specifically, the color richness YF of a single cell image is obtained by normalization using (h1-h2)×(c1+c2). The larger the value of (h1-h2)×(c1+c2), the greater the difference in hue between the cell nucleus and cytoplasm in the image, and the greater the hue variance between the cell nucleus and cytoplasm. Therefore, it indicates a wider hue distribution in the cell image and thus a greater color richness of the single cell image.
[0114] In this invention, the texture curve of blood cells in each individual cell image is extracted, including:
[0115] Obtain a grayscale image of a single cell and obtain the 8 neighboring pixels of each pixel in the single cell image;
[0116] Arrange the 8 neighboring pixels of each pixel in a clockwise order according to the same arrangement;
[0117] For each neighboring pixel, compare its gray value with that of the center pixel. If the gray value of the neighboring pixel is greater than that of the center pixel, then the position of the neighboring pixel is 1; otherwise, it is 0.
[0118] The obtained values are arranged according to the order of the 8 neighboring pixels, thus obtaining an 8-bit binary sequence of the pixel;
[0119] Convert the 8-bit binary sequence of a pixel into a decimal number and record it as the texture value of that pixel;
[0120] Obtain the histogram of the texture values of pixels in a single cell image, and fit the histogram using the least squares method to obtain the fitted curve, denoted as the texture curve w of the single cell image.
[0121] Using the above feature parameter extraction methods, three feature parameters of a single cell image can be obtained, namely morphology, color, and texture curve, which can be denoted as t1, t2, and t3, respectively.
[0122] In one specific embodiment, for the feature parameters in the acquired blood cell microscopic images, since different staining environments during the staining process may affect the various feature parameters in blood cells, it is first necessary to determine the stability of each feature parameter.
[0123] In this invention, the stability of blood cell characteristics for three feature parameters is calculated separately, including:
[0124] Each single cell image is labeled and classified, thereby dividing the second blood cell microscopic image into several categories of cell images; specifically, for each single cell image (i.e., a small image of a single cell) extracted from each second blood cell microscopic image, human experts are used to label and classify the single cell image, thereby dividing each second blood cell microscopic image into several categories of cell images.
[0125] When the feature parameters in the second blood cell microscopic image are affected by the staining process, the feature parameters of blood cells in the image will vary greatly under different staining batches.
[0126] To obtain images of the same type of cells from different batches of second blood cell microscopic images;
[0127] The first variance t' of a certain feature parameter of each cell class in each second blood cell microscopic image is obtained, thereby obtaining the first mean t'' of the first variance t' of the certain feature parameter of the same cell class in different second blood cell microscopic images; (It should be noted that when the feature parameter is a texture curve, the difference between texture features is quantified by DTW when calculating the variance of the feature parameter).
[0128] Obtain the second mean T of a certain feature parameter in each cell image of each type in each second blood cell micrograph, and obtain the second variance T' of the second mean T of the certain feature parameter in the same cell image of different second blood cell micrographs;
[0129] When the variation of characteristic parameters in the same type of cell images in different batches of stained second blood cell micrographs is small, it indicates that the stability of the characteristic parameter is high; therefore, the stability of each characteristic parameter is calculated based on the first mean and the second variance.
[0130] The stability WD of each feature parameter can be obtained by normalizing the inverse of T'×t''; where, for T'×t'', the smaller the value, the smaller the variance of the same type of cells in the image of different batches of second blood cell microscopic images, thus indicating that the stability of the feature parameter is stronger.
[0131] In this invention, the stability of the characteristic parameters of the same type of cells in different batches of second blood cell microscopic images is used as a weighting factor in subsequent automatic classification.
[0132] In one specific embodiment, weighted classification is performed based on the stability of three characteristic parameters of blood cells, including:
[0133] Stability feature repetition is dynamically generated based on the stability of three feature parameters;
[0134] Specifically, in the automatic blood cell classification system, weighted classification is performed directly using the stability of the characteristic parameters of each blood cell. Stability feature weights are dynamically generated based on stability, as follows: highly stable feature parameters are assigned a weight of 1.5-2.0 times; low-stability feature parameters are weighted down to 0.3-0.5 times. In this embodiment, a feature parameter stability greater than or equal to 0.5 is considered highly stable, and less than 0.5 is considered low-stability. The specific classification of high and low stability can be based on the magnitude of the stability of the normalized feature parameters.
[0135] Additional weights (such as the nuclear chromatin looseness of leukemia cells) are added to key pathological features to obtain biological weights;
[0136] The weighted feature vector, which includes stability features and biological weights, is input into a classifier (such as an improved YOLOv7 or SVM), and the weight allocation is dynamically optimized through a stability gating mechanism. This invention can enable the model to focus on high-weight features to construct the decision boundary through a stability gating mechanism (such as the weight adjustment layer in CNN-Transformer).
[0137] In this invention, the core task of the classifier is to determine the category (e.g., "leukemia cells" or "normal cells") of a sample based on the input weighted feature vector. At this stage, the features are simply "self-weighted labels." Dynamically optimizing the weight allocation through a stability gating mechanism performs a secondary screening and enhancement of the input weighted feature vector, further strengthening the influence of high-weight features (high stability and high biological importance) and suppressing the interference of low-weight features. This helps the model construct decision boundaries (e.g., the classification threshold for distinguishing between normal cells and leukemia cells) based on more reliable and crucial information.
[0138] Finally, by combining the analysis of misclassified samples, the weight allocation is dynamically optimized (such as increasing the weight of nuclear porosity for cases of misclassification of primitive cells), and the cell type and its characteristics (such as labeling "nuclear membrane fold stability contribution of 98%) are output to achieve automatic component and counting.
[0139] The misclassified sample refers to a case in which the classifier makes an incorrect prediction (e.g., misclassifying "primitive leukemia cells" as "normal cells", or vice versa).
[0140] This invention combines analysis of misclassified samples with dynamic optimization of weight allocation. Its advantages are: for key features confirmed in misclassified cases (such as nuclear porosity), even if their initial stability or biological weight is not prominent, their weight will be increased through manual intervention or automatic algorithmic feedback mechanisms (e.g., from 1.2 times to 1.8 times). For low-value features that repeatedly cause interference, their weight can be further compressed (e.g., from 0.5 times to 0.2 times), reducing the misleading impact on decision-making.
[0141] Ultimately, the essence of dynamically optimizing weight allocation by combining misclassified samples is to anchor the classification criteria to the inherent biological properties of cells (such as nuclear structural stability) rather than apparent features that are susceptible to environmental interference through stability-driven feature weighting (increasing the weight of high-stability features and decreasing the weight of low-stability features).
[0142] The method described in this invention can increase the recall rate of leukemia cells to 93.6% and reduce the misjudgment rate of staining differences to below 5%.
[0143] It should be noted that the order of the above embodiments of the present invention is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. The processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0144] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.
Claims
1. A method for automatic classification and counting of blood cell microscopic images, characterized in that: The method includes: Microscopic images of first blood cells from different batches under a preset staining gradient were acquired and then grayscale images of blood cells were obtained. The local variance of pixels in the grayscale image of blood cells is obtained, and the segmentation variance value of the grayscale image of blood cells is obtained accordingly. For grayscale images of blood cells from different batches, the segmentation variance value is used as a threshold to segment the local variance of the pixels, resulting in multiple regions; Multiple regions in each grayscale image of blood cells were enhanced separately to obtain second blood cell microscopic images of different batches with relatively standardized colors and appearances. Each cell in different batches of second blood cell microscopic images was segmented to obtain an image of each individual cell; The morphology, color, and texture curve of blood cells in each single cell image are extracted to obtain three feature parameters of blood cells; The stability of three feature parameters in the second blood cell microscopic image is calculated separately, including: labeling and classifying each individual cell image to divide the second blood cell microscopic image into several classes of cell images; obtaining cell images of the same class in the second blood cell microscopic images from different batches; obtaining the first variance of a certain feature parameter of each class of cell images in each second blood cell microscopic image, thereby obtaining the first mean of the first variance of the certain feature parameter of the same class of cell images in different second blood cell microscopic images; obtaining the second mean of the certain feature parameter of each class of cell images in each second blood cell microscopic image, and obtaining the second variance of the second mean of the certain feature parameter of the same class of cell images in different second blood cell microscopic images; and calculating the stability of each feature parameter based on the first mean and the second variance. Weighted classification is performed based on the stability of three characteristic parameters of blood cells. This includes: dynamically generating stability feature weights based on the stability of the three characteristic parameters; adding additional weights to key pathological features to obtain biological weights; inputting the weighted feature vector including stability feature weights and biological weights into the classifier, and dynamically optimizing the weight allocation through a stability gating mechanism; finally, combining the analysis of misclassified samples to dynamically optimize the weight allocation, outputting cell type and based features, and realizing automatic component division and counting.
2. The automatic classification and counting method for blood cell microscopic images according to claim 1, characterized in that: Obtain the local variance of pixels in a grayscale image of blood cells, including: Obtain the eight neighboring pixels of each pixel in the grayscale image of blood cells, as well as the grayscale value of the eight neighboring pixels. Calculate the variance of the grayscale values of the eight neighboring pixels of the pixel, and denot it as the local variance of the pixel.
3. The automatic classification and counting method for blood cell microscopic images according to claim 2, characterized in that: The local variance of pixels in the grayscale image of blood cells is obtained, and the segmentation variance value of the grayscale image of blood cells is obtained from this variance, including: Based on the local variance of the pixels, the local variance histogram of the pixels in the grayscale image of blood cells is obtained, and the fitting curve of the local variance histogram is obtained accordingly. Find the minimum point in the fitted curve of the local variance histogram; Select any two local minimum points in the fitted curve of the local variance histogram, divide the fitted curve into three segments, and obtain the definite integral of each segment. Obtain the variance of the definite integral of each fitted curve segment, and denote it as the loss value; Find the minimum point corresponding to the minimum loss value, and thus obtain the segmentation extreme points of the fitted curve; The local variance at the extreme points of the obtained fitted curve is denoted as the segmentation variance value.
4. The automatic classification and counting method for blood cell microscopic images according to claim 1, characterized in that: Enhancement processing was performed on multiple regions within each grayscale blood cell image to obtain second blood cell microscopic images of different batches with relatively standardized colors and appearances, including: The three different regions are labeled as smooth region, medium contrast region and high contrast region according to the local variance of the pixels from small to large. The enhancement processing for smooth regions is as follows: Obtain the maximum and minimum gray values of pixels in the smooth region; Based on the maximum and minimum gray values of the obtained pixels, gray value compression is performed on the gray values of the pixels in the smooth region. The enhancement process for areas with moderate contrast is as follows: Histogram equalization is used to enhance contrast in pixels in moderately contrasting regions; No enhancement processing is performed on high-contrast areas; By performing the same enhancement process on each grayscale image of blood cells, second blood cell microscopic images of different batches with relatively standardized color appearance are obtained.
5. The automatic classification and counting method for blood cell microscopic images according to claim 1, characterized in that: Each cell in different batches of second blood cell microscopic images was segmented to obtain an image of each individual cell, including: The U-Net algorithm was used to segment each cell in different batches of second blood cell microscopic images, and the segmented cells were extracted into individual small images, which were recorded as each single cell image.
6. The automatic classification and counting method for blood cell microscopic images according to claim 1, characterized in that: The morphology of blood cells in each individual cell image is extracted, including: Extract the connected components of the nucleus and cytoplasm in each single cell image, and obtain the size of the connected components of the nucleus and cytoplasm in each single cell image respectively; The nucleocytoplasmic ratio in a single cell image is obtained by calculating the size of the nuclear connected domain and the size of the cytoplasmic connected domain, thus representing the cell morphology.
7. The automatic classification and counting method for blood cell microscopic images according to claim 1, characterized in that: The color of blood cells in each individual cell image is extracted, including: The single-cell image is projected onto the HSV space, and the hue of each pixel in the single-cell image is extracted; Based on the hue of each pixel, the mean hue of the nucleus and cytoplasm in a single cell image, as well as the hue variance of the nucleus and cytoplasm, are obtained respectively. The color richness of a single cell image is calculated based on the mean hue of the nucleus and cytoplasm, as well as the variance of the hue of the nucleus and cytoplasm.
8. The automatic classification and counting method for blood cell microscopic images according to claim 1, characterized in that: The texture curves of blood cells in each individual cell image are extracted, including: Obtain a grayscale image of a single cell and obtain the 8 neighboring pixels of each pixel in the single cell image; Arrange the 8 neighboring pixels of each pixel in a clockwise order according to the same arrangement; For each neighboring pixel, compare its gray value with that of the center pixel. If the gray value of the neighboring pixel is greater than that of the center pixel, then the position of the neighboring pixel is 1; otherwise, it is 0. The obtained values are arranged according to the order of the 8 neighboring pixels, thus obtaining an 8-bit binary sequence of the pixel; Convert the 8-bit binary sequence of a pixel into a decimal number and record it as the texture value of that pixel; Obtain the histogram of texture values of pixels in a single cell image, and fit the histogram using the least squares method to obtain the fitted curve, which is denoted as the texture curve of the single cell image.
Citation Information
Patent Citations
Intelligent hemodialysis data processing system based on smart phone application program
CN118430732A
MRI medical image segmentation method and system based on deep learning
CN119741312A