White blood cell single classification method based on mean shift feature and direct subspace optimization

By combining mean-biased features and direct subspace optimization, the problems of overfitting and catastrophic collapse in white blood cell classification are solved, improving the accuracy and stability of white blood cell single classification, especially showing excellent performance in the identification of subtle differences.

CN115512352BActive Publication Date: 2026-04-03MINJIANG UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-26
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Existing technologies for white blood cell classification suffer from problems such as overfitting, class imbalance, catastrophic collapse due to fine-tuning of pre-trained features, and difficulty in identifying subtle differences. In particular, the image features of white blood cell classes with similar characteristics and low resolution have not been studied in depth in clinical medicine.

Method used

By combining mean-shift features and direct subspace optimization, and through initial feature extraction, feature adaptation, and outlier score calculation stages, this approach overcomes the incompatibility between self-supervised contrastive learning and single-classification methods, alleviates the catastrophic collapse problem caused by fine-tuning, and improves the model's ability to identify subtle differences in white blood cells.

Benefits of technology

It significantly improves the accuracy and stability of white blood cell single classification, solves the overfitting and catastrophic collapse problems existing in traditional methods, enhances the ability to identify subtle differences, and achieves higher classification accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115512352B_ABST
    Figure CN115512352B_ABST
Patent Text Reader

Abstract

This invention relates to a white blood cell single classification method based on mean-shift features and direct optimization subspace. First, mean-shift features are used to overcome the incompatibility between self-supervised contrastive learning and single classification methods, while mitigating the catastrophic collapse problem caused by fine-tuning. Then, a direct optimization subspace is introduced in combination with mean-shift features to improve the model's ability to identify subtle differences in white blood cells, thereby enhancing the accuracy of white blood cell single classification. Experimental results on two real-world white blood cell datasets demonstrate that the method of this invention has good classification performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image processing technology, specifically relating to a white blood cell single classification method based on mean shift features and direct optimization of subspace. Background Technology

[0002] As a common part of human health checks, a key component of routine blood tests is the classification and counting of white blood cells and the analysis of abnormal morphology. Accurate white blood cell analysis and detection can help doctors diagnose many related blood diseases clinically. Currently, domestic hospitals typically use blood cell analyzers based on electrical impedance tomography and flow cytometry for white blood cell classification and counting. These methods require manual re-examination, making the process very time-consuming and susceptible to the influence of doctors' subjective biases. Computer-aided automated analysis of blood cell images can not only save manpower and time but also reduce human error. Supervised deep learning methods have been widely used for white blood cell classification, and the high success rate achieved by CNN models is convincing, but they are limited by large datasets and computational resources. In most cases, white blood cell datasets have a limited number of images, low resolution, imbalances between classes, and a much smaller number of abnormal samples than normal samples. Therefore, unsupervised one-class classification (OCC) methods have achieved a breakthrough due to their characteristics of requiring no labels and only training on normal samples.

[0003] These methods typically train a single classifier that learns from normal samples, and then, during the inference phase, determine whether a sample is abnormal or normal based on its deviation from the normal distribution (e.g., the distance between the sample and a class center) to achieve classification. Traditional single classification methods usually include encoder-decoder networks and discriminative models (such as Support Vector Machines (OCSVM) and Support Vector Data Descriptions (SVDD)). Self-supervised single classification learns better feature representations by setting an auxiliary excuse task, but because the training set only contains normal samples, the model can only learn from the features of the normal class, thus easily leading to overfitting. Another type of single classification method based on pre-trained models usually utilizes large-scale datasets (such as ImageNet, COCO, etc.) to provide fixed features to fit the single classifier. Recently, methods that fine-tune pre-trained models have achieved better single classification performance. However, these methods still face significant challenges because fine-tuning can lead to catastrophic collapse of the single classification, i.e., the training features may degenerate and become meaningless, preventing the model from learning effective classification features. Currently, corresponding single classification methods have been explored in medical fields such as brain MR images, malignant polyp images, and lung X-rays, but methods for white blood cell single classification remain to be explored.

[0004] Therefore, the challenge of white blood cell single differential is that: (1) in clinical medicine, the characteristics of white blood cell categories and abnormal-normal categories are very similar (e.g. Figure 1 (1) As shown in the figure, overfitting is likely to occur when training with only specific classes; (2) The number of white blood cell categories varies greatly, and imbalance is likely to occur when performing multi-class classification, and only specific categories (lymphocytes and neutrophils) have abnormal morphological analysis value; (3) Using a single classification method with fine-tuned pre-trained features to classify white blood cells will face catastrophic collapse, which may cause the model to fail to learn effective classification features; (4) At present, considering the small differences in white blood cells and the low resolution of image features, the technology of single classification of white blood cells has not been studied in depth, and the single classifier needs to have the sensitivity to identify small differences and significant features at the same time. Summary of the Invention

[0005] The purpose of this invention is to solve the problem of identifying subtle differences between white blood cell categories and to better adaptively capture cell features through fine-tuning. Therefore, it provides a white blood cell single classification method based on mean offset features and direct optimization of subspace.

[0006] To achieve the above objectives, the technical solution of this invention is: a white blood cell single classification method based on mean-shift features and direct optimization subspace. First, mean-shift features are used to overcome the incompatibility between self-supervised contrastive learning and single classification methods, while mitigating the catastrophic collapse problem caused by fine-tuning. Then, a combination of direct optimization subspace and mean-shift features is introduced to improve the model's ability to identify subtle differences in white blood cells, thereby improving the accuracy of white blood cell single classification. This method includes three stages: initial feature extraction, feature adaptation, and anomaly score calculation. Specifically, given a set of normal training samples...

[0007] Initial feature extraction stage: Feature extractor Initial feature extractor based on pre-trained model Initialization; Feature Adaptation Stage: Fine-tuning the Network for Feature Extractors To form the final feature adaptive classifier

[0008] Calculating anomaly scores: using Extract features for anomaly score calculation.

[0009] Compared to existing technologies, this invention offers the following advantages: Firstly, the method utilizes mean-shift features to overcome the incompatibility between self-supervised contrastive learning and single-classification methods, while mitigating the catastrophic crash problem caused by fine-tuning. Then, it introduces a combination of direct optimization subspace and mean-shift features to enhance the model's ability to identify subtle differences in white blood cell classification, thereby improving the accuracy of white blood cell single-classification. Experiments on real datasets have demonstrated the effectiveness and superiority of the algorithm presented in this invention. Attached Figure Description

[0010] Figure 1 These are partial examples from two real white blood cell datasets.

[0011] Figure 2 This is a structural diagram of the method of the present invention.

[0012] Figure 3 An example of data augmentation for self-supervised learning.

[0013] Figure 4 This is a comparison between mean-shifted features and traditional contrastive learning features.

[0014] Figure 5 This is a comparison of the feature-adaptive increase effect of the present invention on WBC.

[0015] Figure 6 This is a comparison of the feature-adaptive growth effect of the present invention on BCISC1K.

[0016] Figure 7 This invention provides a comparison of the ability of the present invention to solve catastrophic collapse in single-class feature adaptation. Detailed Implementation

[0017] The technical solution of the present invention will now be described in detail with reference to the accompanying drawings.

[0018] This invention presents a white blood cell single classification method based on mean-shift features and direct optimization subspace. First, mean-shift features are used to overcome the incompatibility between self-supervised contrastive learning and single classification methods, while mitigating the catastrophic collapse problem caused by fine-tuning. Then, a direct optimization subspace is introduced in combination with mean-shift features to improve the model's ability to identify subtle differences in white blood cells, thereby enhancing the accuracy of white blood cell single classification. This method includes three stages: initial feature extraction, feature adaptation, and anomaly score calculation. Specifically, given a set of normal training samples...

[0019] Initial feature extraction stage: Feature extractor Initial feature extractor based on pre-trained model Initialization; Feature Adaptation Stage: Fine-tuning the Network for Feature Extractors To form the final feature adaptive classifier

[0020] Calculating anomaly scores: using Extract features for anomaly score calculation.

[0021] The following is a detailed implementation process of the present invention.

[0022] This invention proposes an unsupervised adaptive feature-based method for white blood cell single classification (e.g., Figure 2 Given a set of normal training samples (excluding other classes). The goal is to distinguish test samples into normal or abnormal (i.e., other classes). The method structure consists of three stages: initial feature extraction, feature adaptation, and calculation of anomaly scores. First, Feature extractor Feature extractor based on pre-trained model Initialization. Then, the initialized network is further fine-tuned through a feature adaptation stage. To form the final feature adaptive classifier Finally, use Extract features for anomaly score calculation. The anomaly detection problem is defined as follows:

[0023] For test set Y test y1, y2…y N Each sample is associated with d-dimensional features. Our goal is to learn a scoring function. Using a threshold t for sample y i Categorize:

[0024]

[0025] Where s i Indicates y i The label 0 indicates the normal class, and l indicates the abnormal class (other classes).

[0026] 1. Initial Feature Extraction Stage

[0027] First, we define an initial feature extractor. in This refers to the feature dimension. The feature extractor parameterizes normal training samples and generates feature representations. Since using ImageNet pre-trained models can improve performance on datasets almost unrelated to ImageNet classes, this invention uses an ImageNet pre-trained model as the initial feature extractor. Initial feature extraction is performed on normal training samples. Weights are initialized. It was used for the next step of feature adaptation.

[0028] 2. Feature Adaptation Stage

[0029] In this stage, we propose an unsupervised feature adaptation method based on the mean-shifted subspace by combining mean-shifted features and direct optimization subspace. The specific process is as follows:

[0030] 2.1 Data Augmentation and Feature Encoder

[0031] In self-supervised learning methods, the combination of different data augmentation techniques is crucial to the representation learning effect. Given a sample set with a batch size of K, each sample is split in two through data augmentation to obtain 2K views, denoted as x and x'. * Similarly, the enhanced view of the same text is considered a positive pair, and all other views in the batch are considered negative pairs. The image enhancements we used include RandomCrop, HorizontalFlip, ColorJitter, GrayScale, and GaussianBlur. Figure 3 This shows the effect after partial image enhancement. Then, a ResNet18 feature encoder initialized in stage 1 is used to enhance the views x and x'. * Encode and generate representations r and r * And normalize it.

[0032] 2.2 Mean Shift Characteristics

[0033] The purpose of mean shift features is to address the incompatibility between traditional contrastive learning and uniclass classification. For uniclass classification tasks, the goal is to bring training samples (normal class) as close to the center as possible and push outliers away from the center. This is typically achieved using compactness loss, which can be written as:

[0034]

[0035] in It is a feature extractor The initialization representation, where c is a constant, represents the mean center of the pre-trained feature representations. However, special attention is needed. The emergence of trivial solutions. This means that the initial feature extractor... The ability to distinguish features will be lost, and features will degenerate and become meaningless, resulting in a catastrophic collapse. If traditional contrastive learning is used to solve this problem, a contradictory incompatibility will be encountered: on the one hand, contrastive learning attempts to push negative sample pairs apart, which may cause negative samples to move far away from the mean center point c; on the other hand, the training set consists entirely of normal samples, meaning that negative samples belong to the normal class, according to L... compactIt should be close to the mean center point c (e.g.) Figure 4 ).

[0036] Therefore, this invention optimizes the compactness loss by updating the distance calculation center from the feature mean center c (i.e., the origin o) to the feature normalization center c0. For example... Figure 4 As shown, when the angle between negative pairs is maximized, their distance relative to the normalization center remains unchanged. Thus, the contradiction between contrastive learning and single-class classification is resolved, and catastrophic collapse is avoided. Let r and r' represent... * The mean feature offset θ is generated by subtracting it from the normalization center c0. * The resulting mean offset feature is represented as follows:

[0037]

[0038] By simply shifting the mean of the features, the features of normal class samples can be distributed as evenly as possible around the normalization center point, rather than being evenly distributed around the origin of the unit sphere.

[0039] 2.3 Direct optimization of subspace

[0040] While using mean-based feature shift avoids the catastrophic collapse of contrastive learning in single-class classification, it still suffers from a more "mild" collapse—dimensionality collapse. This is similar to a 3D model being compressed into a 2D drawing. Figure 1 This means the image will shrink to a lower-dimensional subspace. When this happens, the model cannot fully utilize its learning capacity, thus hitting a performance bottleneck. Furthermore, the differences between white blood cell categories are much smaller than in typical images, so it's necessary to improve the model's ability to recognize these subtle differences.

[0041] To address this issue, this invention employs a direct optimization subspace to enhance the contrastive learning model's ability to distinguish subtle differences between classes. The direct optimization subspace is analogous to using a low-rank diagonal projection head, which projects the representation into a low-dimensional space. Unlike a projection head, the direct optimization subspace requires no additional parameters or computation; it only needs to extract a fixed mean offset subspace z0, z1. * This process removes redundant high-dimensional information, maximizing learning capabilities. It is represented as follows:

[0042] z = θ[0: dim]

[0043] Here, dim represents the dimension of the optimization subspace. Compared to other self-supervised learning methods, this strategy directly sends a fixed low-rank subspace of the representation to the loss function without going through the widely used projection head.

[0044] 2.4 Loss Function

[0045] Finally, the standard InfoNCE loss was used to analyze the mean-biased subspaces z0 and z1. * The calculation is performed using the following formula:

[0046]

[0047] Among them, 1 [m≠i] ∈{0,1} represents the index function with a value of 1 when m≠i, and τ is the temperature hyperparameter.

[0048] 3. Abnormal Score Calculation Stage

[0049] Finally, this invention uses a KNN-based scoring function as the criterion for anomaly detection to calculate the degree of anomaly in the test sample. For a given test sample y, its features are calculated and compared with those in the training set. The cosine distance between the features of the K nearest normal samples is scored using the following function:

[0050]

[0051] Where N k (x) represents the K features in the training feature set that are closest to the features of the test sample y. It consists of feature representations extracted from training and test samples. The test sample y is determined to be normal or abnormal (other classes) by verifying whether its KNN score is greater than a threshold t.

[0052] We used two real-world white blood cell image datasets (WBC and BCISC1K) to evaluate the performance of the proposed method. WBC includes 300 cell images across 5 classes (176 neutrophils, 22 eosinophils, 1 basophil, 48 monocytes, and 53 lymphocytes). The images are 120×120 pixels in size. We ignored the minor class "basophils" (which has only one image) and preprocessed the other four classes using an 80% / 20% training / test segmentation ratio. BCISC1K includes six white blood cell subtypes: 84 basophils, 99 eosinophils, 165 lymphocytes, 83 monocytes, 143 neutrophils, and 447 polymorphonuclear leukocytes (primarily neutrophils, with a small number of eosinophils and basophils). It contains 1021 images of 256×256 pixels in size. We split the training and test sets into 70% and 30% categories. Following the standard protocol for single-class classification, we assign one category as "normal" and the others as "abnormal." During training, only normal images are used; the task during inference is to distinguish between normal and abnormal images. Therefore, a dataset containing N classes can be considered as N "normal-abnormal" binary datasets.

[0053] To evaluate the performance of the proposed method, we calculate AUROC (Area Under the Receiver Operating Characteristic curve, i.e., the area under the ROC curve), a commonly used metric for anomaly detection and classification. It defines the false positive rate (FPR) on the X-axis and the true positive rate (TPR) on the Y-axis, as shown in the following formula:

[0054]

[0055]

[0056] In this system, TP stands for True Positive, meaning a positive sample predicted as positive by the model; FP stands for False Positive, meaning a negative sample predicted as positive by the model; TN stands for True Negative, meaning a positive sample predicted as positive by the model; and FN stands for False Negative, meaning a positive sample predicted as negative by the model. The closer the AUROC value is to 1, the better the classifier can distinguish between positive and negative samples.

[0057] Since the dataset will be divided into N anomaly detection datasets for training, the average AUROC is used as the final detection performance score.

[0058] The experimental environment for this invention was a Windows 11 operating system, using an NVIDIA GeForce RTX 3060Ti graphics card with 6GB of video memory, 128GB of RAM, and an AMD Ryzen 75800H CPU. All our models were based on a Python 3.8 runtime environment, the PyTorch 1.11.0 deep learning framework, CUDA 11.6, and the CUDNN 8.3 acceleration library. In terms of parameter selection, this invention set the loss temperature parameter τ to 0.1 and selected the subspace θ[0:dim=300] as the optimal subspace, calculating the anomaly score with KNN=2.

[0059] (1) Qualitative comparison

[0060] To qualitatively compare the performance of this invention with other excellent feature adaptive algorithms, we conducted comparative experiments, such as... Figure 5 and Figure 6 As shown, our invention demonstrates excellent expansion effect. Especially in Figure 6 In the BCISC1K dataset, the algorithm of this invention brought a significant increase in performance through unsupervised adaptation, greatly improving the model's single classification ability.

[0061] In addition, such as Figure 7 As shown, we qualitatively compare the performance of our invention with other excellent feature adaptation algorithms for the catastrophic collapse problem of feature adaptation in single classification. From Figure 7 As we can see from (a) and 7(b), on both real datasets, our method solves the catastrophic collapse problem encountered by the traditional contrastive learning DirectCLR (i.e., feature degradation, the model fails to learn effective features and collapses), and breaks through the bottleneck of single-class performance improvement of feature adaptation methods such as Mean-Shifted. This proves that our method has stability and effectiveness in white blood cell single classification and can be applied to white blood cell single classification applications.

[0062] (2) Quantitative comparison

[0063] To quantitatively compare the accuracy of seven methods (PaDiM, Orthoad, PatchCore, SPADE, PANDA, Mean-Shifted, and our proposed algorithm) in white blood cell single-class classification, we conducted experiments on the WBC dataset (300 images of 5 white blood cell classes) and the BCISC1K dataset (1021 images of 6 white blood cell classes), and used AUROC to quantitatively evaluate the results. Tables 1 and 2 show the quantitative evaluation results of single-class classification for each white blood cell subclass on the two real-world datasets, with the best metric value in each column highlighted in bold. It is clear that our proposed algorithm achieves the best classification performance on the white blood cell dataset, surpassing existing state-of-the-art white blood cell classification algorithms. Moreover, even on the BCISC1K dataset, which contains varying lighting conditions and low contrast and resolution, our proposed algorithm still exhibits superior performance. Therefore, overall, our proposed algorithm achieves the best single-class classification performance for white blood cells.

[0064] Table 1. Quantitative comparison of the present invention with state-of-the-art algorithms on WBC.

[0065] Method Neut Lym Mon Eos Mean-AUROC PaDiM 75.93 75.63 77.32 35.78 66.16 Orthoad 46.06 32.71 42.74 67.02 37.73 PatchCore 85.80 92.50 79.52 53.29 86.01 SPADE 93.98 97.71 93.65 73.66 89.75 PANDA-EO 88.58 67.85 72.41 88.12 79.24 PANDA-EWC 95.83 98.54 94.33 78.88 91.90 Mean-shifted 92.59 97.64 96.83 90.64 94.42 ours 93.06 98.68 99.02 90.64 95.35

[0066] Table 2. Quantitative comparison of the present invention with state-of-the-art algorithms on BCISC1K.

[0067] Method Baso Eos Lym Mon Muti Neut Mean-AUROC PaDiM 51.00 78.33 64.83 55.50 59.00 38.48 57.86 SPADE 46.50 56.33 68.50 59.00 76.58 81.09 64.67 Orthoad 50.50 54.50 52.50 64.00 68.50 52.01 57.00 PatchCore 75.00 63.11 73.78 66.66 72.55 70.94 70.34 PANDA-EO 55.67 54.22 63.61 50.83 62.58 82.46 61.56 PANDA-EWC 50.50 59.67 69.67 63.00 77.67 83.84 67.39 Mean-shifted 73.50 66.00 73.56 44.00 82.03 86.52 70.93 ours 85.50 68.11 75.94 48.17 82.25 90.07 75.01

[0068] The above are preferred embodiments of the present invention. Any changes made to the technical solution of the present invention that do not exceed the scope of the technical solution of the present invention shall fall within the protection scope of the present invention.

Claims

1. A white blood cell single classification method based on mean shift features and direct subspace optimization, characterized in that, include: The process consists of three stages: initial feature extraction, feature adaptation, and anomaly score calculation, given a set of normal training samples. ; Initial feature extraction stage: Feature extractor Initial feature extractor based on pre-trained model Initialization; specifically, defining an initial feature extractor. ,in It is the feature dimension; The initial feature extractor can parameterize normal training samples and generate feature representations; an ImageNet pre-trained model is used as the initial feature extractor. Initial feature extraction is performed on normal training samples; Initialize weights It was used for the next step of feature adaptation; Feature Adaptation Stage: Fine-tuning the Network for Feature Extractors To form the final feature adaptive classifier Specifically, an unsupervised feature adaptation method based on the mean-shifted subspace is proposed by combining mean-shifted features and direct optimization subspace. The specific process is as follows: (1) Data augmentation and feature encoder: For a given batch size of The sample set, each sample is split in two through data augmentation to obtain... A view, denoted as Similarly, the enhanced view of the same sample is considered a positive pair, and all other views in the batch are considered negative pairs; then, the initial feature extractor is used. For the enhanced view Encode and generate representation And normalize it; (2) Mean shift characteristics: For single-class classification tasks, the mean shift feature aims to bring the training samples (normal class) as close to the center as possible and the abnormal class as far away from the center. This goal is achieved using compactness loss, written as: It is the initial feature extractor Initialization representation, The constant is the mean center point of the pre-trained feature representation; the compactness loss is optimized by moving the distance calculation center from the feature mean center. That is, the origin Updated to feature normalization center ;express Through the normalization center Subtraction is used to generate mean feature shift. The resulting mean offset feature is represented as follows: (3) Directly optimize the subspace: Directly optimizing the subspace requires no additional parameters or computation; it only requires extracting a subspace with a fixed mean offset. Its representation is as follows: This indicates the dimension of the optimized subspace; (4) Loss function: The mean-biased subspace was shifted using the standard InfoNCE loss. The calculation is performed using the following formula: Indicates when An index function with a time value of 1. This refers to temperature hyperparameters. Calculating anomaly scores: using Features are extracted for anomaly score calculation; specifically, a KNN-based scoring function is used as the criterion for anomaly detection to calculate the degree of anomaly in the test sample; for a given test sample Calculate its features and training set The most recent The cosine distance between features of normal samples is scored using the following function: Distance between the training feature set and the test samples The most recent features One characteristic, , It consists of feature representations extracted from training and testing samples; the KNN score is verified to be greater than a threshold. Determine the test sample Is it normal or abnormal, i.e., other categories? 2. The white blood cell single classification method based on mean shift feature and direct subspace optimization according to claim 1, characterized in that, Image enhancement methods include random cropping, horizontal flipping, color dithering, grayscale conversion, and Gaussian blur.