An artificial intelligence-based blood cell automatic detection method, device and medium
By collecting metadata and performing conditional normalization, the problem of insufficient domain adaptability of the automatic blood cell detection model under non-ideal experimental conditions was solved, improving the accuracy and reliability of detection and achieving more accurate cell localization and class probability prediction.
Patent Information
- Application Number
- CN202610561897.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-27
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2046-04-27
AI Technical Summary
Existing deep learning-based automated blood cell detection methods suffer from insufficient domain adaptability when faced with non-ideal experimental conditions, leading to a decrease in the accuracy and reliability of the identification results.
By acquiring visual field image frames of blood smears and simultaneously recording metadata, an acquisition package is generated. Sharpness and exposure are then filtered, a neural network model is constructed, and conditional normalization of the acquired metadata is performed. Candidate regions of blood cell connected domains are located, classified, and confidence levels are calibrated. Finally, the neural network model is updated.
It improves the consistency and discriminative power of visual features of neural network models under non-ideal experimental conditions, enhances the accuracy of blood cell localization and the reliability of class probability prediction, and strengthens the model's adaptability in complex and variable experimental scenarios.
Smart Images

Figure CN122199522B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical testing technology, and in particular to an automated blood cell detection method, device, and medium based on artificial intelligence. Background Technology
[0002] In recent years, with the rapid development of deep learning and computer vision technologies, significant progress has been made in medical image analysis based on artificial intelligence, especially in the field of pattern recognition of microscopic images. In the specific scenario of blood cell analysis, the automatic identification and classification of cell morphology in blood smears using models such as convolutional neural networks has become an important research direction for improving detection efficiency and standardization. Related technologies are evolving towards higher precision and full automation.
[0003] However, existing deep learning-based automatic blood cell detection methods typically assume that the experimental conditions during model training and deployment are ideal and consistent. In reality, unavoidable staining differences and illumination fluctuations during blood smear preparation and digital scanning can alter the underlying features of the input image, such as color and contrast. This leads to a decrease in the generalization ability of models that rely on end-to-end image feature extraction, and the accuracy of pattern recognition and the reliability of result confidence are prone to fluctuation when dealing with unseen experimental conditions. Summary of the Invention
[0004] In view of the aforementioned existing problems, the present invention is proposed.
[0005] Therefore, this invention provides an artificial intelligence-based automatic blood cell detection method to solve the problems of insufficient domain adaptability and low reliability of recognition results caused by variations in experimental conditions in existing automatic blood cell detection models.
[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution: In a first aspect, the present invention provides an automatic blood cell detection method based on artificial intelligence, comprising: acquiring visual field image frames of blood smears and simultaneously recording metadata of acquisition conditions; performing sharpness and exposure screening on the visual field image frames to generate an acquisition package; encoding the metadata in the acquisition package into acquisition metadata vectors, and binding and aligning the acquisition metadata vectors with the corresponding visual field image frames to generate a domain alignment set; constructing a neural network model, inputting the domain alignment set, performing conditional normalization processing on the acquisition metadata, outputting visual field features, and integrating the visual field features into a depth feature package; based on the depth feature package, locating candidate regions of blood cell connected domains, screening overlapping and clustered candidate regions, retrieving corresponding image blocks, and encapsulating them into a candidate region image package; classifying each candidate image block in the candidate region image package, outputting the probability distribution and count entries of blood cell types, and simultaneously calculating the confidence level of the probability distribution of blood cell types, and integrating them into a detection report; calibrating the confidence level in the detection report, generating a calibrated confidence level, screening out candidate image blocks with low confidence levels and performing verification annotation, and using the annotation results to update the neural network model.
[0007] In a preferred embodiment of the artificial intelligence-based automated blood cell detection method of the present invention, the steps for generating the collection package are as follows: Collect field-view image frames of blood smears, synchronously record the staining batch number metadata and microscope illumination exposure parameter metadata corresponding to the field-view image frames, and bind them with timestamps to form initial data pairs; The sharpness evaluation value of the field-of-view image frame is calculated based on the weighted gradient energy, and the field-of-view image frame is converted to the CIELAB color space and then the weighted information entropy is calculated based on the luminance channel distribution as the exposure evaluation value. Based on the set of sharpness evaluation values and the set of exposure evaluation values of all image frames in the field of view, the sharpness threshold and the exposure threshold are dynamically determined. All initial data pairs are filtered using clarity and exposure thresholds, and qualified data pairs are retained. All qualified data pairs of the current blood smear are then packaged into an acquisition package.
[0008] In a preferred embodiment of the artificial intelligence-based automated blood cell detection method of the present invention, the steps for generating the domain alignment set are as follows: Read all qualified data pairs in the acquisition package, and construct a dynamic metadata interaction graph based on the corresponding staining batch number metadata and microscope light exposure parameter metadata of the qualified data pairs. The metadata of all incoming neighbor nodes of each node in the dynamic metadata interaction graph is aggregated and encoded into a collected metadata vector; The acquired metadata vectors are cross-modal aligned with the corresponding qualified field-of-view image frames, and a hybrid alignment feature vector is output. All hybrid alignment feature vectors are integrated to form a domain alignment set.
[0009] In a preferred embodiment of the artificial intelligence-based automated blood cell detection method of the present invention, the steps for constructing the neural network model are as follows: The backbone feature extraction layer is built based on the residual network architecture, the multi-scale feature fusion layer is built through the feature pyramid network, the cell type classification layer is built with fully connected layers and the Softmax activation function, and the cell region proposal layer is built with convolutional layers and spatial attention mechanism. A neural network model is constructed by forward and backward connections between the backbone feature extraction layer, the multi-scale feature fusion layer, the cell type classification layer, and the cell region proposal layer through deep supervision and multi-scale fusion.
[0010] As a preferred embodiment of the artificial intelligence-based automatic blood cell detection method of the present invention, the step of integrating visual field features into a depth feature package is as follows: The domain alignment set is input into the backbone feature extraction layer and the multi-scale feature fusion layer of the neural network model for feature extraction processing to obtain preliminary feature maps and feature maps at various levels. The hybrid aligned feature vectors are encoded in high dimension and spatially expanded by a conditional coding network to generate the corresponding spatial conditional feature map. By using spatial condition feature maps, dynamic scaling and translation modulation are applied layer by layer to the preliminary feature map and feature maps at each level to generate modulated feature maps; The modulated feature maps of all levels are aggregated to form a field-of-view feature vector, and all field-of-view feature vectors are encapsulated with the corresponding field-of-view image frames to generate a depth feature package.
[0011] In a preferred embodiment of the artificial intelligence-based automatic blood cell detection method of the present invention, the encapsulation into a candidate region image package comprises the following steps. The field feature vectors in the depth feature package are input into the cell region proposal layer of the neural network model for feature decoding and probabilistic mapping to generate a spatial probability heatmap. Candidate seed points, their coordinates, and response values are then located from the spatial probability heatmap. Using all candidate seed points as nodes, construct a nearest neighbor graph structure based on the coordinates of the candidate seed points, and initialize a state vector for each node; Based on the comprehensive energy minimization, the state vectors of all nodes in the nearest neighbor graph structure are iteratively optimized to obtain the optimized cell center position, existence confidence and boundary estimate. Based on the optimized cell center location and boundary estimation, image patches are cropped from the field-of-view image frame, and overlapping candidate regions are eliminated according to the cross-union ratio and existence confidence between the boundary estimations of each candidate region, forming a candidate region image package.
[0012] As a preferred embodiment of the AI-based automated blood cell detection method of the present invention, the steps for integrating the data into a detection report are as follows: Each candidate image patch in the candidate region image package is input into the cell type classification layer of the neural network model to perform multi-scale feature extraction and classification, and outputs the blood cell type probability distribution corresponding to each candidate image patch. Calculate the confidence level of the blood cell type probability distribution for each candidate image patch, and aggregate the blood cell type probability distributions of all candidate image patches to generate blood cell type count entries; The probability distribution, confidence level, and count entries of blood cell types corresponding to each candidate image block are integrated to generate a detection report.
[0013] As a preferred embodiment of the AI-based automatic blood cell detection method of the present invention, the confidence level in the detection report is parametrically modeled and its uncertainty is decoupled based on subjective logic and Dirichlet distribution to generate a calibrated confidence level. Based on the calibrated confidence level, candidate image patches with low confidence levels are selected and submitted for review to obtain annotation results. Based on the annotation results, the neural network model is incrementally updated.
[0014] In a second aspect, the present invention provides a computer device including a memory and a processor, wherein the memory stores a computer program, wherein when the computer program is executed by the processor, it implements any step of the artificial intelligence-based automatic blood cell detection method described in the first aspect of the present invention.
[0015] Thirdly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, it implements any step of the artificial intelligence-based automatic blood cell detection method described in the first aspect of the present invention.
[0016] The beneficial effects of this invention are as follows: By collecting metadata and conditionally normalizing it, explicit modeling and compensation for non-ideal experimental conditions are achieved, improving the consistency and discriminative power of the visual features extracted by the neural network model; this process can guide the neural network model to adaptively focus on the morphological and texture information most relevant to cell category discrimination when extracting high-level semantic features of images, rather than the disturbed underlying color or brightness distribution; the visual field features have stronger domain invariance and discriminative power, providing a higher quality and more robust feature representation foundation for the core pattern recognition task, thereby directly contributing to more accurate cell localization and more reliable category probability prediction, effectively improving the adaptability to complex and variable experimental scenarios. Attached Figure Description
[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. 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.
[0018] Figure 1 This is a flowchart of an AI-based automated blood cell detection method.
[0019] Figure 2 The flowchart for generating the acquisition package.
[0020] Figure 3 This is a flowchart for generating domain alignment sets.
[0021] Figure 4 A flowchart for locating candidate regions and generating candidate region image packets.
[0022] Figure 5 Comparative data plot showing the variation of the discriminant power index with the intensity of domain offset.
[0023] Figure 6 Heatmap showing the increase in macro-average F1 value under different staining batches and domain offset intensities. Detailed Implementation
[0024] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0025] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.
[0026] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.
[0027] Reference Figures 1-6 This is one embodiment of the present invention, which provides an automated blood cell detection method based on artificial intelligence, comprising the following steps: S1. Acquire visual field image frames of blood smears and simultaneously record metadata of acquisition conditions. Filter the visual field image frames based on sharpness and exposure to generate an acquisition package.
[0028] S1.1: Acquire the field-of-view image frames of the blood smear, synchronously record the staining batch number metadata and microscope light exposure parameter metadata corresponding to the field-of-view image frames, and bind them with timestamps to form initial data pairs; Specifically, continuous field-of-view image frames are acquired through the microscope imaging device. At the same time, the staining batch number metadata corresponding to the current blood smear is extracted from the staining record database, and the illumination exposure parameter metadata used for the current imaging is read from the microscope controller. The three items are timestamped at the time of acquisition to form an initial data pair containing the field-of-view image frames, staining batch number metadata, and microscope illumination exposure parameter metadata.
[0029] S1.2: Calculate the sharpness evaluation value of the field-of-view image frame based on the weighted gradient energy, and convert the field-of-view image frame to the CIELAB color space and calculate the weighted information entropy based on the brightness channel distribution as the exposure evaluation value; Specifically, the visual image frames are sequentially converted from the original color space to the XYZ color space, and then from the XYZ color space to the CIELAB color space.
[0030] The sharpness evaluation value of the field-of-view image frame is calculated based on weighted gradient energy, and the expression is as follows: ; ; ; In the formula, The image frame in the field of view is represented by a sharpness rating. This represents the horizontal coordinate of a pixel in the field-of-view image frame; Represents the vertical coordinates of a pixel in a field-of-view image frame; The weighting coefficients represent the gradient in the horizontal direction; Indicates the position of the image frame in the field of view. The horizontal gradient magnitude at that location; The weighting coefficients represent the gradient in the vertical direction; Indicates the position of the image frame in the field of view. The vertical gradient magnitude at that location; This indicates the position of the adjacent pixel on the right side of the image frame in the horizontal direction. The grayscale value at that location; This indicates the position of the adjacent pixel on the left side of the image frame in the horizontal direction. The grayscale value at that location; Indicates the position of adjacent pixels in the vertical direction of the image frame in the field of view. The grayscale value at that location; Indicates the position of adjacent pixels in the vertical direction of the image frame in the field of view. The grayscale value at that location.
[0031] It should be noted that the weight coefficient of the horizontal gradient is determined by setting a fixed value before implementation. The example value is 0.5. The basis for this value is that the cell edges in blood smear images usually exhibit isotropic characteristics in both the horizontal and vertical directions. Using equal weights can avoid directional bias and ensure the balance of sharpness evaluation. The weight coefficient of the vertical gradient is obtained by the difference between 1 and the pre-set weight coefficient of the horizontal gradient. The example value is 0.5. The basis for this value is to ensure that the sum of the weights of the two orthogonal directions is always 1, so as to maintain the dimensional consistency and numerical stability of the weighted gradient energy evaluation value across different images.
[0032] The weighted information entropy calculated based on the brightness channel distribution is used as the exposure evaluation value, and the expression is: ; ; In the formula, This represents the exposure evaluation value of the image frame in the field of view; Represents the luminance channel in the CIELAB color space. Maximum gray level; Indicates the brightness channel A certain gray level in; Indicates the brightness channel medium gray level Normalized frequency of occurrence; This represents a very small positive constant introduced to avoid undefined values in logarithmic operations; This represents taking the base-2 logarithm of the normalized frequency; This represents a Gaussian weighted function centered on the mean of the luminance channel at the gray level. The weight value at that location, This indicates the brightness channel of the image frame in the CIELAB color space. The arithmetic mean of the grayscale values of all pixels; This indicates the brightness channel of the image frame in the CIELAB color space. The variance of all pixel grayscale values.
[0033] S1.3: Dynamically determine the sharpness threshold and exposure threshold based on the sharpness evaluation value set and exposure evaluation value set of all visual image frames; Specifically, all sharpness and exposure evaluation values are collected to form a sharpness evaluation value set and an exposure evaluation value set. Among them, the higher the sharpness evaluation value, the sharper the image. The exposure evaluation value is defined as negative information entropy, and the lower the value, the closer the exposure is to the ideal state. The sharpness evaluation value set is sorted from largest to smallest value, and the sharpness evaluation value at a preset sharpness percentile (such as the 80th percentile) is selected as the sharpness threshold. The exposure evaluation value set is sorted from smallest to largest value, and the exposure evaluation value at a preset exposure percentile (such as the 20th percentile) is selected as the exposure threshold.
[0034] It should be noted that the resolution percentile is set based on historical blood smear image quality distribution experience. The example value is 70%, which is based on the fact that under conventional microscopic imaging conditions, about 70% of the field of view image frames have sufficiently clear cell edges to support reliable detection. This proportion can exclude obviously blurry frames while ensuring the validity of the data. The exposure percentile is set based on the distribution of exposure evaluation values of typical qualified blood smear images under the CIELAB luminance channel. The example value is 65%. The basis for this value is that images with exposure evaluation values in the top 65% usually have a balanced distribution of light and dark and recognizable cell details, avoiding morphological distortion caused by overexposure or underexposure.
[0035] S1.4: Use the clarity threshold and exposure threshold to filter all initial data pairs, retain qualified data pairs, and package all qualified data pairs of the current blood smear into an acquisition package; Specifically, when filtering all initial data pairs using the sharpness threshold and exposure threshold, the sharpness evaluation value and sharpness threshold, and the exposure evaluation value and exposure threshold of each initial data pair are compared one by one; the initial data pairs with a sharpness evaluation value higher than the sharpness threshold and an exposure evaluation value lower than the exposure threshold are retained and judged as qualified data pairs; all qualified data pairs corresponding to the current blood smear are collected and packaged into an acquisition package.
[0036] It should be noted that the exemplary range of the sharpness threshold is the numerical range corresponding to the 70% to 85% percentile; the basis for the value is that this range can effectively cover high-quality field-of-view image frames with clear imaging and distinguishable cell edges, while excluding obviously blurry frames; if the selected percentile is lower than 70%, too many blurry images may be introduced, leading to false detection; if it is higher than 85%, it may excessively remove usable images, resulting in insufficient effective field-of-view and affecting the statistical representativeness of blood cell count.
[0037] An exemplary range for the exposure threshold is the numerical range corresponding to the 60% to 75% percentile. The value is chosen based on the fact that the image in this range has a balanced distribution of light and dark and sufficient detail retention in the luminance channel of the CIELAB color space, avoiding overexposure or underexposure. If the selected percentile is below 60%, a large number of overly dark or overly bright images may be retained, causing cell morphology distortion. If it is above 75%, normally exposed images may be mistakenly rejected, reducing the number of qualified data pairs and weakening the stability of the detection results.
[0038] S2. Encode the metadata in the acquisition packet into an acquisition metadata vector, and bind and align the acquisition metadata vector with the corresponding field-of-view image frame to generate a domain alignment set.
[0039] S2.1: Read all qualified data pairs in the acquisition package, and construct a dynamic metadata interaction graph based on the corresponding staining batch number metadata and microscope light exposure parameter metadata of the qualified data pairs; Specifically, all qualified data pairs in the acquisition package are read, and the staining batch number metadata and microscope illumination exposure parameter metadata contained in each qualified data pair are extracted. Each qualified data pair is regarded as a node in a graph structure. The connection relationship between nodes is determined based on whether the staining batch number metadata is the same and the similarity of the microscope illumination exposure parameter metadata. If the staining batch number metadata of two qualified data pairs is the same and the difference in microscope illumination exposure parameter metadata is within a preset tolerance, an edge is established between the corresponding nodes, thereby forming a dynamic metadata interaction graph.
[0040] It should be noted that the preset tolerance is set based on the normal fluctuation range of the metadata of illumination and exposure parameters in the historical microscope imaging record. The example value range is that the change in light source intensity does not exceed ±10% and the change in exposure time does not exceed ±5%. The basis for the value is that blood smear images imaged within this range have no significant difference in visual perception and cell morphology fidelity, and can be regarded as having similar imaging conditions.
[0041] S2.2: Aggregate the metadata of all incoming neighbor nodes of each node in the dynamic metadata interaction graph and encode it into a collected metadata vector; Specifically, in the dynamic metadata interaction graph, for each node, the staining batch number metadata and microscope illumination exposure parameter metadata corresponding to all neighboring nodes connected to it through incoming edges are collected; the staining batch number metadata and microscope illumination exposure parameter metadata of the current node are concatenated with the corresponding metadata of all incoming neighboring nodes to form a metadata sequence containing local context information; the metadata sequence is sequentially embedded and mapped to fixed-length numerical vectors, and all embedding results are fused through average pooling to finally generate the acquisition metadata vector representing the context-aware imaging conditions of the node.
[0042] S2.3: Align the acquired metadata vector with the corresponding qualified field-of-view image frame across modalities, output the hybrid alignment feature vector, and integrate all hybrid alignment feature vectors to form a domain alignment set; Specifically, for qualified visual image frames, multi-scale visual features are extracted through the backbone of a convolutional neural network to obtain image feature vectors; simultaneously, the acquired metadata vectors are mapped to a semantic space of the same dimension as the image feature vectors through a fully connected layer; the acquired metadata vectors and image feature vectors are concatenated in the channel dimension, and the feature representations are adjusted through a shared fusion layer to form a hybrid aligned feature vector that fuses the imaging conditional context and visual content; alignment operations are performed on each qualified data pair in the acquisition package, and after obtaining all hybrid aligned feature vectors, they are aggregated to form a domain alignment set.
[0043] It should be noted that the pre-training process of the convolutional neural network uses publicly available weight parameters from a large-scale natural image dataset as initial parameters. This large-scale natural image dataset contains color image samples with clearly defined category labels. By loading the publicly available weight parameters, the convolutional neural network backbone already possesses general edge, texture, and local structure perception capabilities before encountering blood smear images. During the pre-training stage, no blood smear-related data is used, nor are the network weights updated. The publicly available pre-trained weights are directly used for feature extraction from qualified field-of-view image frames.
[0044] S3. Construct a neural network model, input the domain alignment set, perform conditional normalization processing on the collected metadata, output the field features, and integrate the field features into a depth feature package.
[0045] S3.1: The backbone feature extraction layer is built based on the residual network architecture, the multi-scale feature fusion layer is built through the feature pyramid network, the cell type classification layer is built with fully connected layers and the Softmax activation function, and the cell region proposal layer is built with convolutional layers and spatial attention mechanism. The overall structure is composed of multiple stacked residual blocks. Each residual block contains several convolutional layers, and the input is directly added to the output of the residual block through skip connections, so that information is transmitted along the main path and the skip path simultaneously during forward propagation. The multiple residual blocks are organized in stages, and the residual blocks in each stage share the same output feature map size and number of channels. The spatial resolution is reduced and the number of channels is increased between adjacent stages through stride convolution or pooling operations, thereby generating feature maps with progressive semantic abstraction capabilities step by step, and completing the construction of the backbone feature extraction layer. Multiple feature maps from different levels are selected from the main feature extraction layer. Using a top-down path, the feature maps are upsampled sequentially to the same spatial size as the corresponding low-level feature maps. Horizontal connections are then made to output a set of multi-scale fusion feature maps with consistent scale, enhanced semantics, and preserved fine structure, thus completing the construction of the multi-scale feature fusion layer. The feature representation corresponding to a single cell region is fed into a fully connected layer, which maps it into a vector with a dimension equal to the number of cell categories. This vector is then input into a Softmax activation function, which transforms the values of each dimension into a probability distribution that sums to 1, thereby obtaining the probability that the cell belongs to each category and completing the construction of the cell type classification layer. The feature map output from the backbone feature extraction layer is input into the convolutional layer, and a preliminary cell region response map is generated through convolution operation. A spatial attention mechanism is applied to this response map, and a spatial weight distribution is generated using global information in the channel dimension. The original response map is modulated position by position to enhance the response intensity of the cell region and suppress background interference, thus completing the construction of the cell region proposal layer.
[0046] S3.2: By using deep supervision and multi-scale fusion, the backbone feature extraction layer, multi-scale feature fusion layer, cell type classification layer, and cell region proposal layer are connected forward and backward to construct a neural network model; Specifically, feature maps of different levels are generated in the backbone feature extraction layer at different stages, and then fed into the multi-scale feature fusion layer. Through a top-down path and lateral connections, a multi-scale fused feature map is formed. The portion of the multi-scale fused feature map corresponding to a single cell region is used in the cell type classification layer. The cell category probability is obtained through a fully connected layer and a Softmax activation function. At the same time, the feature map in the backbone feature extraction layer is used in the cell region proposal layer. The spatial probability heatmap is generated through a convolutional layer and a spatial attention mechanism. During training, supervision signals are applied to the cell type classification layer and the cell region proposal layer, and the loss signal is backpropagated along the original connection path to the multi-scale feature fusion layer and the backbone feature extraction layer. This allows the parameters of each layer to be optimized collaboratively under the guidance of multi-scale supervision, thus completing the construction of the neural network model.
[0047] It should be noted that the pre-training process of the neural network model uses a residual network architecture that has been trained on a large-scale general image dataset as the initial parameters of the backbone feature extraction layer. The structure of the backbone feature extraction layer, multi-scale feature fusion layer, cell type classification layer, and cell region proposal layer remains unchanged. Blood cell images are fed into the neural network model, and corresponding real label supervision signals are applied to the cell type classification layer and cell region proposal layer. The parameters of all layers are updated through backpropagation, so that the neural network model can adapt to the specific distribution of the blood cell detection task while retaining the general visual representation ability, thus completing the pre-training process.
[0048] S3.3: Input the domain alignment set into the backbone feature extraction layer and multi-scale feature fusion layer of the neural network model for feature extraction processing to obtain preliminary feature maps and feature maps at each level; Specifically, the domain alignment set is fed into the backbone feature extraction layer of the neural network model. The backbone feature extraction layer consists of multiple stacked residual blocks, which generate feature maps with different spatial resolutions and semantic intensities in stages. The feature map generated in the first stage is used as the preliminary feature map, and the feature maps generated in subsequent stages are used as feature maps at each level. The feature maps at each level are fed into the multi-scale feature fusion layer. The multi-scale feature fusion layer combines the feature maps at each level through a top-down upsampling path and a lateral connection method to form a fused multi-scale representation, thus completing the extraction process from the domain alignment set to the preliminary feature map and the feature maps at each level.
[0049] S3.4: The hybrid aligned feature vectors are encoded in high dimension and expanded in space using a conditional coding network to generate the corresponding spatial conditional feature map; Specifically, each hybrid alignment feature vector in the domain alignment set is fed into a conditional coding network, which consists of several fully connected layers and activation units connected sequentially. The hybrid alignment feature vector is mapped to a high-dimensional latent space through the fully connected layers to form a high-dimensional coding vector. The high-dimensional coding vector is expanded into a two-dimensional tensor with the same resolution as the feature maps of each residual stage of the backbone feature extraction layer through a transposed convolutional layer operation. For feature maps of different levels, two-dimensional tensors matching their spatial dimensions are generated as spatial conditional feature maps of the corresponding levels.
[0050] It should be noted that the pre-training process of the conditional coding network uses a metadata-image dataset already publicly available in blood smear image-related tasks for supervised training. This dataset contains paired samples of acquired conditional metadata and corresponding qualified field-of-view image frames. The acquired metadata vector is used as the initial input of the conditional coding network, and the image features extracted by the backbone feature extraction layer and the multi-scale feature fusion layer are used as the regression target. The mean squared error loss is used to measure the difference between the spatial conditional feature map output by the conditional coding network and the target feature map. The Adam optimizer is used for gradient backpropagation, and the parameter update step size is adjusted in conjunction with the learning rate decay strategy. When the loss on the validation set does not decrease for several consecutive rounds, the pre-training is terminated, the conditional coding network parameters at this time are saved, and the pre-trained conditional coding network is obtained.
[0051] S3.5: Using spatial condition feature maps, the preliminary feature map and feature maps at each level are dynamically scaled and translated layer by layer to generate modulated feature maps; Specifically, after aligning the preliminary feature map with the corresponding level of spatial conditional feature map through channels, scale modulation factors and translation modulation factors are generated respectively. The scale modulation factors are applied to the preliminary feature map by channel-by-channel multiplication, and the translation modulation factors are superimposed on the result by channel-by-channel addition to obtain the modulated feature map. The same operation is repeated for each level of feature map, and each level is used to complete independent scale and translation modulation using spatial conditional feature maps that match its resolution, finally obtaining a set of modulated feature maps. All modulation operations are performed in the feature channel dimension to keep the spatial structure unchanged.
[0052] S3.6: Aggregate the modulated feature maps of all levels to form a field of view feature vector, and encapsulate all field of view feature vectors with the corresponding field of view image frames to generate a depth feature package; Specifically, the preliminary feature map and the feature maps at each level in the modulated feature map are unified into vectors of the same dimension through an adaptive two-dimensional average pooling layer. These vectors are then concatenated along the channel dimension to form a single field of view feature vector. The field of view feature vector is paired and encapsulated with its corresponding qualified field of view image frame. The pairing and encapsulation operation is performed on the field of view feature vectors generated corresponding to all hybrid aligned feature vectors in the domain alignment set. Finally, all pairing results are collected to generate a depth feature package.
[0053] It should be noted that, Figure 5 Using domain offset intensity (simulating / measuring the degree to which the non-ideal experimental conditions corresponding to the acquired metadata deviate from the norm) as the horizontal axis and discriminant power index (measuring the separability / discrimination ability of field features for cell categories after conditional normalization of acquired metadata) as the vertical axis, the trend of feature discriminant power changes under different domain offset degrees is compared between "unconditional normalization" and "conditional normalization of acquired metadata". It can be intuitively seen that as the domain offset intensity increases, the discriminant power index of the baseline group is more likely to decrease or fluctuate, while the group of this invention maintains a higher and more stable discriminant power index overall. This indicates that after explicit compensation for non-ideal acquisition conditions through "conditional normalization of acquired metadata", the field features extracted by the network are more focused on morphological / texture information related to cell category discrimination, thereby improving feature separability and pattern recognition discriminant power in cross-domain situations.
[0054] Figure 6Plotting the dyeing batch number (reflecting batch differences) on the vertical axis and the domain offset intensity on the horizontal axis, the color represents the "improvement of the macro-average F1 value relative to the baseline Δmacro-average F1 value" of the invention group. The "hotter" (greater the improvement) position on the heatmap indicates a more significant performance gain for the invention under that dyeing batch and domain offset intensity combination. The continuous distribution shows that the gain is not a random, point-like occurrence, but rather a stable manifestation under multiple batches and offset conditions. This result intuitively verifies that the invention, through metadata modeling and conditional normalization compensation, enables features to possess stronger domain invariance and consistency, thereby achieving more reliable category prediction and more robust overall recognition performance in complex and variable experimental scenarios.
[0055] S4. Based on the deep feature package, locate the candidate regions of blood cell connected domains, filter the candidate regions of overlapping clusters, retrieve the corresponding image blocks, and encapsulate them into candidate region image packages.
[0056] S4.1: Input the vision feature vector in the depth feature package into the cell region proposal layer of the neural network model for feature decoding and probabilistic mapping, generate a spatial probability heatmap, and locate the candidate seed point, the coordinates of the candidate seed point and the response value from the spatial probability heatmap; Specifically, the cell region proposal layer includes convolutional layers and a spatial attention mechanism. The convolutional layers spatially expand and adjust the channels of the field feature vector to generate a preliminary response map. The spatial attention mechanism generates a spatial weight distribution based on the global information of the channels and modulates the preliminary response map position by position to form a spatial probability heatmap. In the spatial probability heatmap, local maxima locations are selected as candidate seed points, the spatial coordinates of each candidate seed point are recorded, and the heatmap values at the corresponding locations are read as response values.
[0057] S4.2: Using all candidate seed points as nodes, construct a nearest neighbor graph structure based on the coordinates of the candidate seed points, and initialize a state vector for each node; Specifically, all candidate seed points are used as nodes in the graph structure. The Euclidean distance between any two nodes is obtained based on the coordinates of the candidate seed points. If the distance condition is met, an undirected edge is established between the corresponding nodes to construct a nearest neighbor graph structure. Each node is associated with a state vector, which consists of three parts: the normalized position of the candidate seed point coordinates, the normalized value of the response value, and the initial boundary estimation radius. The ratio of the candidate seed point coordinates to the width and height of the qualified field-of-view image frame is used as the normalized position, the ratio of the response value to the maximum response value in the spatial probability heatmap is used as the normalized response value, and the initial boundary estimation radius is set to a fixed empirical value.
[0058] For example, the initial boundary estimation radius can be set to 8 pixels, which is determined based on the average radius range of typical mature red blood cells or white blood cells in a blood smear at standard imaging magnification.
[0059] It should be noted that the distance condition refers to the Euclidean distance between any two candidate seed points being less than or equal to the neighborhood radius. For example, a neighborhood radius of 20 to 40 pixels can cover the spatial span of most individual blood cells, while avoiding incorrectly connecting adjacent but independent cells as neighbors of the same graph node.
[0060] S4.3: Based on the comprehensive energy minimization, iteratively optimize the state vectors of all nodes in the nearest neighbor graph structure to obtain the optimized cell center position, existence confidence and boundary estimate; Specifically, the overall energy is defined as consisting of a data fidelity term, a smoothing constraint term, and a boundary consistency term. The data fidelity term is based on the response values of nodes, encouraging high-response locations to remain centered. The smoothing constraint term, based on the coordinate distance and response differences between connected nodes in the nearest neighbor graph structure, suppresses isolated or conflicting center estimations. The boundary consistency term, combined with the initial boundary estimation radius, constrains the spatial expansion range of the cell region. In each iteration, the state vector of each node is adjusted to gradually reduce the overall energy. When the change in overall energy tends to stabilize, i.e., the decrease in overall energy is lower than the observable change level in multiple consecutive iterations, optimization stops. At this point, the coordinate components contained in the state vector of each node are used as the optimized cell center position, the response value component is normalized and used as the existence confidence, and the boundary radius component is used as the boundary estimate.
[0061] It should be noted that the observable level of change refers to the smallest effective change in the overall energy that can be distinguished by the equipment or experimental environment over multiple consecutive iterations, which usually corresponds to the small fluctuation range in the numerical steady state.
[0062] S4.4: Based on the optimized cell center position and boundary estimation, image patches are cropped from the field image frame, and overlapping candidate regions are filtered out according to the cross-union ratio and existence confidence between the boundary estimations of each candidate region to form a candidate region image package; Specifically, based on the optimized cell center location and boundary estimation, each cell center location is used as the cropping center, and the diameter defined by the corresponding boundary estimation is used as the cropping window size. The corresponding image patch is cropped from the qualified field-of-view image frame. For all candidate regions, the cross-union ratio (CUP) between any two candidate regions is calculated. If the CUP is greater than or equal to a preset overlap threshold, the candidate region with the highest confidence is retained, and the candidate region with the lowest confidence is removed. This screening process is repeated until the CUP between all candidate regions is lower than the preset overlap threshold. The final retained candidate region image patches constitute the candidate region image bag.
[0063] The crossover ratio (CRR) between any two candidate regions is calculated using the following expression: ; In the formula, Indicates candidate region With candidate regions The crossover and union ratio between them; Indicates the first One candidate region; Indicates the first One candidate region; Indicates candidate region With candidate regions The area of intersection on the image plane; Indicates candidate region With candidate regions The area of the union on the image plane.
[0064] It should be noted that the overlap threshold is set based on the statistical distribution of the cross-union ratio of truly adjacent non-same cell regions in the labeled qualified field-of-view image frame. 80% to 90% of the maximum value is taken as the overlap threshold, with an example value range of 0.25 to 0.35. This range can effectively distinguish between reasonable contact and repeated detection, which is consistent with the distribution characteristics of cells in blood smears that are mostly independent and occasionally have slight contact.
[0065] S5. Classify each candidate image block in the candidate region image package, output the probability distribution and count of blood cell types, calculate the confidence level of the probability distribution of blood cell types, and integrate them into a detection report.
[0066] S5.1: Input each candidate image block in the candidate region image bag into the cell type classification layer of the neural network model, perform multi-scale feature extraction and classification, and output the blood cell type probability distribution corresponding to each candidate image block; Specifically, the multi-scale fusion features are fed into the cell type classification layer, which contains a fully connected layer and a Softmax activation function. The multi-scale fusion features are mapped to the total number of blood cell types, and the Softmax activation function generates the probability values of each type of blood cell, forming the blood cell type probability distribution corresponding to the candidate image patch.
[0067] S5.2: Calculate the confidence level of the blood cell type probability distribution for each candidate image patch, and aggregate the blood cell type probability distributions of all candidate image patches to generate blood cell type count entries; Specifically, the confidence level of the probability distribution of blood cell types for each candidate image block is calculated. For all candidate image blocks, the blood cell type with the highest confidence level is selected as its classification category, and the count of this category is incremented by one in the blood cell type count entry. All candidate image blocks in the candidate region image package are traversed, and the occurrence frequency of each blood cell type is accumulated to form a blood cell type count entry.
[0068] ; In the formula, Indicates the first Confidence level of the probability distribution of blood cell types in candidate image patches; Indicates the candidate image patch index; This indicates that the maximum value is taken within the index range of all blood cell types; Represents a blood cell type index; Indicates the total number of blood cell types; Indicates the first The probability distribution of blood cell type corresponding to the candidate image patch is as follows: The probability value of the class.
[0069] S5.3: Integrate the probability distribution, confidence level, and count entries of blood cell types corresponding to each candidate image block to generate a detection report; Specifically, the probability distribution of blood cell types, the final confidence level, and the count entries of blood cell types corresponding to each candidate image patch are structured and integrated to form a detection report. The detection report contains three parts: the first part is the count entries of blood cell types, listing the integer counts of each blood cell type; the second part is the judgment result of each candidate image patch, including the determined blood cell type, the corresponding probability distribution, and the confidence level; the third part is the image index information, recording the position coordinates of each candidate image patch in the original qualified field-of-view image frame and the identifier of the acquisition package to which it belongs. All content is organized in the order of candidate region image packages to ensure that the detection results can be traced back to the original imaging data.
[0070] S6. Calibrate the confidence level in the detection report, generate the calibrated confidence level, screen out candidate image blocks with low confidence and perform verification annotation, and use the annotation results to update the neural network model.
[0071] S6.1: Based on subjective logic and Dirichlet distribution, parameterize the confidence level in the test report and decouple the uncertainty to generate the calibrated confidence level; Specifically, the probability distribution of blood cell types in each candidate image patch is treated as a parameter vector of a Dirichlet distribution, which is used to characterize the uncertainty of category prediction. Through a subjective logic framework, confidence is mapped to evidence strength, and cognitive uncertainty and accidental uncertainty are separated by combining the concentration parameter of the Dirichlet distribution. Under this framework, the calibrated confidence is determined by the total evidence strength and the proportion of evidence of the largest class, reflecting the credibility of the model's judgment result. Finally, the calibrated confidence replaces the original confidence in the test report, forming a test report that has been decoupled from uncertainty.
[0072] S6.2: Based on the calibrated confidence level, select candidate image patches with low confidence and submit them for review to obtain the annotation results. Based on the annotation results, perform incremental updates on the neural network model. Specifically, based on the calibrated confidence level, candidate image blocks with a calibrated confidence level lower than a preset confidence threshold are selected and submitted for manual review. Professionals annotate the low-confidence candidate image blocks with blood cell types to form annotation results. The annotation results are paired with the corresponding qualified field-of-view image frames and added to the historical training dataset to form an incremental training set. On the incremental training set, the same optimization strategy as the initial training of the neural network model is adopted, including the Adam optimizer, gradient clipping, and early stopping mechanism, to update the parameters of the backbone feature extraction layer, multi-scale feature fusion layer, cell type classification layer, and cell region proposal layer of the neural network model.
[0073] It should be noted that the confidence threshold is set based on the correspondence between the calibrated confidence level and the manual review results in historical detection reports. The specific steps are as follows: select candidate image patches that are correctly classified in the reviewed samples, and take 90% of the lower limit of their calibrated confidence level as the threshold; the exemplary value range is 0.65 to 0.75; this range can take into account the classification reliability and the workload of review; if it is lower than 0.65, too many low-quality samples will be introduced, increasing the review burden; if it is higher than 0.75, valuable and difficult samples may be missed, affecting the incremental learning effect of the model.
[0074] This embodiment also provides a computer device applicable to the case of an automated blood cell detection method based on artificial intelligence, comprising: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to realize the automated blood cell detection method based on artificial intelligence as proposed in the above embodiment.
[0075] The computer device can be a terminal, comprising a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.
[0076] This embodiment also provides a storage medium storing a computer program, which, when executed by a processor, implements the artificial intelligence-based automatic blood cell detection method proposed in the above embodiments. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0077] In summary, this invention achieves explicit modeling and compensation for non-ideal experimental conditions through the conditional normalization and processing of collected metadata, thereby improving the consistency and discriminative power of the visual features extracted by the neural network model. This process guides the neural network model to adaptively focus on the morphological and texture information most relevant to cell category discrimination when extracting high-level semantic features of images, rather than the disturbed underlying color or brightness distribution. The visual field features possess stronger domain invariance and discriminative power, providing a higher-quality and more robust feature representation foundation for the core pattern recognition task, thus directly contributing to more accurate cell localization and more reliable category probability prediction, effectively improving the adaptability to complex and variable experimental scenarios.
[0078] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. An automated blood cell detection method based on artificial intelligence, characterized in that: include, Acquire visual field image frames of blood smears and simultaneously record metadata of acquisition conditions. Filter the visual field image frames based on sharpness and exposure to generate an acquisition package. The metadata in the acquisition packet is encoded into an acquisition metadata vector, and the acquisition metadata vector is bound and aligned with the corresponding field-of-view image frame to generate a domain alignment set; A neural network model is constructed, and a domain alignment set is input. Conditional normalization processing of the acquired metadata is performed, and the visual field features are output. These visual field features are then integrated into a depth feature package. The steps are as follows. The domain alignment set is input into the backbone feature extraction layer and the multi-scale feature fusion layer of the neural network model for feature extraction processing to obtain preliminary feature maps and feature maps at various levels. The hybrid aligned feature vectors are encoded in high dimension and spatially expanded by a conditional coding network to generate the corresponding spatial conditional feature map. By using spatial condition feature maps, dynamic scaling and translation modulation are applied layer by layer to the preliminary feature map and feature maps at each level to generate modulated feature maps; The modulated feature maps of all levels are aggregated to form a field feature vector, and all field feature vectors are encapsulated with the corresponding field image frames to generate a depth feature package. Based on the deep feature package, candidate regions of connected components in blood cells are located, and overlapping and clustered candidate regions are screened. The corresponding image patches are retrieved and packaged into candidate region image packages. The steps are as follows. The field feature vectors in the depth feature package are input into the cell region proposal layer of the neural network model for feature decoding and probabilistic mapping to generate a spatial probability heatmap. Candidate seed points, their coordinates, and response values are then located from the spatial probability heatmap. Using all candidate seed points as nodes, construct a nearest neighbor graph structure based on the coordinates of the candidate seed points, and initialize a state vector for each node; Based on the comprehensive energy minimization, the state vectors of all nodes in the nearest neighbor graph structure are iteratively optimized to obtain the optimized cell center position, existence confidence and boundary estimate. Based on the optimized cell center location and boundary estimation, image patches are cropped from the field image frame, and overlapping candidate regions are eliminated according to the cross-union ratio and existence confidence between the boundary estimates of each candidate region, forming a candidate region image package; Each candidate image patch in the candidate region image package is classified, and the probability distribution and count entries of blood cell types are output. At the same time, the confidence level of the probability distribution of blood cell types is calculated and integrated into a detection report. The confidence level in the detection report is calibrated to generate a calibrated confidence level. Candidate image patches with low confidence are selected and verified and labeled. The labeling results are then used to update the neural network model.
2. The automated blood cell detection method based on artificial intelligence as described in claim 1, characterized in that: The steps for generating the acquisition package are as follows: Collect field-view image frames of blood smears, synchronously record the staining batch number metadata and microscope illumination exposure parameter metadata corresponding to the field-view image frames, and bind them with timestamps to form initial data pairs; The sharpness evaluation value of the field-of-view image frame is calculated based on the weighted gradient energy, and the field-of-view image frame is converted to the CIELAB color space and then the weighted information entropy is calculated based on the luminance channel distribution as the exposure evaluation value. Based on the set of sharpness evaluation values and the set of exposure evaluation values of all image frames in the field of view, the sharpness threshold and the exposure threshold are dynamically determined. All initial data pairs are filtered using clarity and exposure thresholds, and qualified data pairs are retained. All qualified data pairs of the current blood smear are then packaged into an acquisition package.
3. The automated blood cell detection method based on artificial intelligence as described in claim 2, characterized in that: The steps for generating the domain alignment set are as follows: Read all qualified data pairs in the acquisition package, and construct a dynamic metadata interaction graph based on the corresponding staining batch number metadata and microscope light exposure parameter metadata of the qualified data pairs. The metadata of all incoming neighbor nodes of each node in the dynamic metadata interaction graph is aggregated and encoded into a collected metadata vector; The acquired metadata vectors are cross-modal aligned with the corresponding qualified field-of-view image frames, and a hybrid alignment feature vector is output. All hybrid alignment feature vectors are integrated to form a domain alignment set.
4. The automated blood cell detection method based on artificial intelligence as described in claim 1, characterized in that: The steps for constructing the neural network model are as follows. The backbone feature extraction layer is built based on the residual network architecture, the multi-scale feature fusion layer is built through the feature pyramid network, the cell type classification layer is built with fully connected layers and the Softmax activation function, and the cell region proposal layer is built with convolutional layers and spatial attention mechanism. A neural network model is constructed by forward and backward connections between the backbone feature extraction layer, the multi-scale feature fusion layer, the cell type classification layer, and the cell region proposal layer through deep supervision and multi-scale fusion.
5. The automated blood cell detection method based on artificial intelligence as described in claim 1, characterized in that: The steps for integrating the data into a test report are as follows: Each candidate image patch in the candidate region image package is input into the cell type classification layer of the neural network model to perform multi-scale feature extraction and classification, and outputs the blood cell type probability distribution corresponding to each candidate image patch. Calculate the confidence level of the blood cell type probability distribution for each candidate image patch, and aggregate the blood cell type probability distributions of all candidate image patches to generate blood cell type count entries; The probability distribution, confidence level, and count entries of blood cell types corresponding to each candidate image block are integrated to generate a detection report.
6. The artificial intelligence-based automatic blood cell detection method as described in claim 5, characterized in that: The steps for updating the neural network model using the labeled results are as follows. Based on subjective logic and Dirichlet distribution, the confidence level in the test report is parametrically modeled and its uncertainty is decoupled to generate a calibrated confidence level. Based on the calibrated confidence level, candidate image patches with low confidence levels are selected and submitted for review to obtain annotation results. Based on the annotation results, the neural network model is incrementally updated.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, it implements the steps of the artificial intelligence-based automatic blood cell detection method according to any one of claims 1 to 6.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements the steps of the artificial intelligence-based automatic blood cell detection method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Auxiliary film reading method and system based on artificial intelligence
CN121353757A
Reticulocyte recognition and grading system based on blood smear
CN121354096A