Blood cell detection method and device, electronic equipment and storage medium

By constructing an initial training set and adding random noise to train the feature extraction model, and combining UNet and CARAFE modules for image denoising and feature extraction to generate detection boxes, the problem of long time consumption and low accuracy in blood cell detection in existing technologies is solved, and efficient automated detection under small sample conditions is achieved.

CN121564709APending Publication Date: 2026-02-24FIRST AFFILIATED HOSPITAL OF XINJIANG MEDICAL UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511665835.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-13
Publication Date
2026-02-24

AI Technical Summary

Technical Problem

Existing technologies for blood cell testing suffer from drawbacks such as reliance on manual operation, high time consumption, susceptibility to errors, high cost of automated testing instruments, scarcity of labeled data, poor model generalization performance, and low detection efficiency when faced with new samples.

Method used

An initial training set is constructed and random noise is added. The feature extraction model is trained through diffusion processing. The UNet backbone network and CARAFE module are used for image denoising and feature extraction to generate detection boxes that meet the preset scale and aspect ratio. The MPDIoU loss function is used to optimize the detection boxes to achieve automated detection of blood cells.

Benefits of technology

It achieves efficient blood cell detection under small sample conditions, removes image noise, improves detection accuracy and robustness, reduces dependence on labeled data, and improves detection efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121564709A_ABST
    Figure CN121564709A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of automatic medical treatment, discloses a medical image processing method, and particularly relates to a blood cell detection method and device, electronic equipment and a storage medium. According to the embodiment provided by the invention, the initial training set is constructed, the random noise is added to the sample based on the initial training set, and the feature extraction model based on diffusion processing is trained based on the training set added with the random noise, so that the trained feature extraction model can perform denoising processing on the image and obtain the initial feature map; performing secondary feature extraction on the initial feature map to obtain a target feature map; and finally, taking the target feature map as final input to generate a detection frame, and obtaining a final blood cell detection result based on the detection frame. Compared with the prior art, the embodiment of the invention can remove image noise and realize automatic detection of the blood cells on the basis of detail representation of the blood cells and small sample conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of automated medical technology, specifically a medical image processing method, and more specifically to a blood cell detection method, device, electronic equipment, and storage medium. Background Technology

[0002] Microscopic examination and morphological assessment of peripheral blood smears are crucial diagnostic techniques for identifying blood-related diseases. Traditionally, peripheral blood smear analysis requires manual examination, which is labor-intensive and inefficient. Recently, there has been increasing research on intelligent cell image classification based on deep learning. However, conventional deep learning models require a large number of labeled images, and acquiring a large number of correctly labeled medical images is time-consuming and relies heavily on the expertise of medical specialists. How to achieve efficient classification tasks with limited training data is key to the further development of deep learning in the medical field. Existing methods using small sample images still suffer from poor generalization and unstable performance with noisy images. Summary of the Invention

[0003] To address the aforementioned technical problems, this invention provides a method, apparatus, electronic device, and storage medium for blood cell detection, including a feature extraction module and a prediction module, thereby achieving automated detection of blood cells in images. To achieve the above objectives, the technical solution adopted by this invention is as follows:

[0004] In a first aspect, a method for detecting blood cells is provided. The method includes: removing image noise and extracting features from an acquired peripheral blood cell image based on a trained convergent feature extraction model to obtain an initial feature map after noise removal; the noise reduction model is constructed based on a backbone network and trained through diffusion processing; the initial feature map is upsampled to obtain a target feature map, wherein the upsampling kernel in the upsampling process is updated based on the position information of each feature in the feature map; multiple initial detection boxes conforming to multiple preset scales and aspect ratios are generated on the target feature map; the offsets of the multiple initial detection boxes from the ground truth boxes are predicted to obtain final detection boxes; and the blood cell detection result is obtained based on the final detection boxes.

[0005] In some specific implementations, the training process of the feature extraction model includes: constructing an initial training set, performing a forward diffusion process on each image in the initial training set, adding noise in a uniform distribution manner with time step as a condition to obtain a target training set, and training based on the target training set to converge to obtain the feature extraction model.

[0006] In some specific embodiments, the construction of the initial training set includes: acquiring multiple peripheral blood cell images, and performing continuous rotation transformations on the multiple peripheral blood cell images to obtain multiple training images, each training image corresponding to a rotation angle label to form a rotation label for each image, thereby obtaining the initial training set.

[0007] In some specific embodiments, the backbone network includes an encoder and a decoder, the encoder and the decoder are connected by a downsampling method, and are connected at the bottom of the encoder and the decoder by an intermediate block.

[0008] In some specific embodiments, the encoder includes a convolutional projection layer and three downsampling blocks, each of which includes two residual blocks and a downsampling layer connection; the encoder includes three upsampling blocks and a convolutional layer, each of which includes three residual blocks and an upsampling layer; the feature map output by the decoder is gradually restored to the size of the input image after three upsampling processes, and the channel dimensions are adjusted to be consistent with the image through the convolutional layer to obtain prediction noise, and the prediction noise is removed to obtain the initial feature map.

[0009] In some specific implementations, the intermediate block includes two residual blocks and an attention mechanism layer. The feature vector output by the encoder is enhanced by the feature representation through the residual blocks, and the attention mechanism layer is constructed based on self-attention.

[0010] In some specific implementations, the residual block includes a normalization layer, an activation function layer, and a two-dimensional convolutional layer connection.

[0011] Secondly, a blood cell detection device is provided, the device comprising: an initial feature extraction module, used to perform image noise removal and feature extraction on the acquired peripheral blood cell image based on a trained convergent feature extraction model to obtain an initial feature map after noise removal; a target feature extraction module, used to perform secondary feature acquisition on the initial feature map based on upsampling to obtain a target feature map; and a detection module, used to generate multiple initial detection boxes conforming to multiple preset scales and aspect ratios on the target feature map, predict the offset between the multiple initial detection boxes and the ground truth boxes to obtain a final detection box, and obtain the blood cell detection result based on the final detection box.

[0012] Thirdly, an electronic device is provided, comprising: a memory; and a processor coupled to the memory, the processor being configured to execute the blood cell detection method described in any of the preceding claims based on instructions stored in the memory.

[0013] Fourthly, a non-volatile computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the blood cell detection method described in any of the preceding claims.

[0014] The technical solution provided in this application involves constructing an initial training set and adding random noise to samples based on the initial training set. A feature extraction model based on diffusion processing is then trained on the training set with added random noise. This allows the trained feature extraction model to denoise the image and obtain an initial feature map. A secondary feature extraction is then performed on the initial feature map to obtain a target feature map. Finally, the target feature map is used as the final input to generate detection boxes, and the final blood cell detection result is obtained based on the detection boxes. Compared to existing technologies, this application can remove image noise and achieve automated blood cell detection based on the detailed representation of blood cells under small sample conditions. Attached Figure Description

[0015] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0016] The methods, systems, and / or procedures shown in the accompanying drawings will be further described with reference to exemplary embodiments. These exemplary embodiments will be described in detail with reference to the drawings. These exemplary embodiments are non-limiting exemplary embodiments, wherein example figures represent similar mechanisms in the various views of the drawings.

[0017] Figure 1 This is a schematic diagram of the detection method provided in the embodiments of this application.

[0018] Figure 2 This is a schematic diagram of a rotationally enhanced image of peripheral blood cells provided in an embodiment of this application.

[0019] Figure 3 This is a schematic diagram of the CARAFE module provided in the embodiments of this application.

[0020] Figure 4 This is a schematic diagram of the detection results provided in the embodiments of this application.

[0021] Figure 5 This is a schematic diagram of the blood cell detection device provided in the embodiments of this application.

[0022] Figure 6 This is a schematic diagram of the terminal device structure provided in the embodiments of this application. Detailed Implementation

[0023] To better understand the above technical solutions, the technical solutions of this application will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the embodiments of this application and the specific features in the embodiments are detailed descriptions of the technical solutions of this application, rather than limitations on the technical solutions of this application. In the absence of conflict, the embodiments of this application and the technical features in the embodiments can be combined with each other.

[0024] In the detailed description below, numerous specific details are illustrated with examples to provide a comprehensive understanding of the relevant guidance. However, it will be apparent to those skilled in the art that this application can be practiced without these details. In other instances, well-known methods, procedures, systems, components, and / or circuits have been described at a relatively high level without detail to avoid unnecessarily obscuring aspects of this application.

[0025] This application uses flowcharts to illustrate the execution process performed by a system according to embodiments of this application. It should be clearly understood that the execution processes in the flowcharts may not be executed sequentially. Instead, these execution processes may be executed in reverse order or simultaneously. Additionally, at least one other execution process may be added to the flowchart. One or more execution processes may be deleted from the flowchart.

[0026] Before providing a further detailed description of the embodiments of the present invention, the nouns and terms involved in the embodiments of the present invention will be explained, and the nouns and terms involved in the embodiments of the present invention shall be interpreted as follows.

[0027] (1) In response to, used to indicate the conditions or states on which the operation is performed depends. When the conditions or states on which the operation is performed are met, one or more operations may be performed in real time or with a set delay. Unless otherwise specified, there is no restriction on the order in which the multiple operations are performed.

[0028] (2) Based on, used to indicate the conditions or states on which the operation is performed depends. When the conditions or states on which it depends are met, one or more operations can be performed in real time or with a set delay. Unless otherwise specified, there is no restriction on the order of execution of the multiple operations.

[0029] In clinical diagnostic systems, blood cell testing plays a crucial role. Through quantitative analysis and morphological observation of various blood cells, doctors can obtain key information for disease diagnosis. This testing helps assess a patient's health status, identify potential problems such as anemia, infection, and bleeding, and provides support for further diagnosis and treatment. Red blood cells, white blood cells, and platelets, as the main components of blood cells, play unique roles in disease diagnosis. Red blood cells are the most abundant cell type in blood, primarily responsible for transporting oxygen and carbon dioxide. Abnormalities in red blood cell count usually indicate blood disorders; decreased red blood cell count is common in iron deficiency anemia or chronic anemia, while increased red blood cell volume may be associated with vitamin B12 or folic acid deficiency. White blood cells are an important component of the immune system, responsible for defending against pathogens. White blood cell count and differential often show significant changes in infection, immune responses, and blood disorders; increased white blood cell count is usually seen in bacterial infections or acute inflammation, while decreased white blood cell count may be related to viral infections, immunosuppression, or bone marrow dysfunction. Platelets play a key role in hemostasis and wound healing; abnormal platelet counts are closely related to the diagnosis of hemorrhagic diseases. Thrombocytopenia can lead to symptoms such as easy bleeding and hematoma, while thrombocytopenia may be associated with risk factors such as thrombosis and cardiovascular and cerebrovascular diseases. Therefore, by comprehensively analyzing the quantity and morphology of red blood cells, white blood cells, and platelets, clinicians can more accurately determine a patient's underlying disease. Furthermore, blood cell testing plays an important role in monitoring treatment effectiveness, assessing disease progression and recovery, and its value in disease diagnosis cannot be ignored.

[0030] Traditional methods for blood cell testing primarily rely on microscopy and automated blood analyzers. Microscopy involves manually observing the morphological characteristics of blood smears to identify and classify blood cells such as red blood cells, white blood cells, and platelets. However, microscopy is highly dependent on the operator's experience and skill. When dealing with large numbers of blood cell samples, manual operation is labor-intensive, time-consuming, and susceptible to human error. Furthermore, inconsistencies in standards among different operators can lead to discrepancies in diagnostic results. Automated blood analyzers utilize optical and flow cytometry techniques to rapidly analyze the quantity and some morphological characteristics of blood cells, offering high efficiency and accuracy. However, they have limitations in cell morphology identification and classification, struggling to distinguish subtle cellular abnormalities. In addition, automated analyzers are sensitive to blood sample quality; sample contamination or hemolysis can affect test results. Moreover, their high cost and maintenance can become a burden on primary care hospitals. Overall, traditional methods each have their advantages and disadvantages in terms of operation and efficiency, and their application in complex cases and early diagnosis is limited. Therefore, an increasing number of solutions are exploring deep learning-based automated blood cell detection methods to improve detection accuracy and efficiency. Traditional blood cell detection methods rely on manual methods, which are time-consuming and prone to false positives and false negatives. Meanwhile, currently available blood cell datasets are relatively few, and the scarcity of labeled data limits the models from learning sufficiently rich and diverse feature patterns. This results in poor generalization ability when faced with new samples, making accurate blood cell detection impossible. Therefore, improving the performance of deep learning models with limited labeled data has become a significant challenge.

[0031] Therefore, in order to solve the above-mentioned practical technical problems, this application provides a method for blood cell detection, which is described in the following embodiment. Figure 1 Includes the following steps:

[0032] Step S11. The acquired peripheral blood cell image is subjected to image noise removal and feature extraction based on a trained and convergent feature extraction model to obtain an initial feature map after noise removal.

[0033] In this embodiment, the denoising model is constructed based on a backbone network and trained using a diffusion process. Specifically, the training process for the feature extraction module first constructs an initial training set, and then performs a forward diffusion process on each image in the initial training set, adding noise in a uniform distribution according to the time step condition to obtain a target training set. Training is then performed based on this target training set until convergence, resulting in the feature extraction model.

[0034] Specifically, given a training set D = {(x i ,y iLet )|i=1,2,…,H}, where xi and yi represent the image and its base class label, and H is the total number of images in the training set. First, perform continuous rotation transformation operations Rd={r d×θ |d=0,1,…,M-1}, where rd×θ represents the rotation operation of d×θ angle. Each image is transformed by continuous rotation to obtain a total of M images, including the original image. Each image obtains a corresponding rotation angle label, forming the rotation label d for each image. Rotation enhancement of peripheral blood cell images is as follows: Figure 2 As shown.

[0035] After rotating the training images, noise is added to each image through a forward diffusion process. The forward diffusion process uses a Markov chain model, iteratively adding noise to the original image by sampling randomly from a uniform distribution [1,T] at time steps t. The forward process is shown below: This formula indicates that, given xt-1, xt follows a mean of 1 / xt. The variance is β t I follows a normal distribution; where x0 represents the original image without noise, x t This represents the original image weighted with noise at time step t to obtain a noisy image. T represents the number of diffusion time steps, and β... t It is a variance table that changes with time t, and I is an identity matrix with the same dimension as x0.

[0036] Using reparameterization techniques, a noisy image xt can be directly generated from x0, as shown below: Where α t =1-β t , By sampling Gaussian noise And based on the following formula, xt is further obtained: The above formula shows that as long as the original image x0 and the noise β at each step are given... t This allows us to obtain noisy images at any given time. Gaussian noise is added to each image using a random sampling time step t. The final training set Drt, obtained after data preprocessing, can be represented as: D rt ={N(R)} θ (x i ),t),y i ,d}.

[0037] In this embodiment, UNet is used as the backbone network structure for the feature extraction model. The noisy image and time step are used as inputs. The encoder performs feature extraction, and the decoder performs noise prediction output. There are residual connections between each layer of the encoder and decoder to prevent the decoder from forgetting previous information during the reconstruction of the noisy image.

[0038] The encoder consists of one 3×3 convolutional projection layer and three downsampling blocks. Each downsampling block comprises two residual blocks and one downsampling layer. The residual block mainly consists of a normalization layer, an activation function layer, and a two-dimensional convolutional layer with a kernel size of 3 and a stride of 1. The normalization layer stabilizes the feature distribution during training, promoting faster convergence. It normalizes the feature maps by grouping them and calculating the mean and variance within each group, thereby reducing batch processing dependency. The activation function used is the SiLu activation function, which enhances the network's non-linear expressive power, enabling the network to better capture complex feature patterns. Compared to traditional activation functions such as ReLU, SiLu provides smoother response characteristics while maintaining gradient flow, which is beneficial for gradient propagation during optimization.

[0039] The intermediate block structure consists of two residual blocks and one attention mechanism layer. The feature vector output by the encoder is further enhanced by the residual blocks while retaining the original information. The attention mechanism layer improves the model's context awareness and generalization performance based on self-attention. Through this structure, the intermediate blocks not only enhance the richness and accuracy of the feature representation but also provide a more reliable basis for the subsequent reconstruction task of the decoder, thereby significantly improving the overall performance and robustness of the model.

[0040] The decoder consists of three upsampling blocks and one 3×3 convolutional layer. Each upsampling block consists of three residual blocks and one upsampling layer. The upsampling layer is a 2D deconvolutional layer with a kernel size of 3 and a stride of 2 to restore the feature dimension. The feature map output by the encoder is gradually restored to the size of the input image through three upsampling operations, and finally the channel dimension is adjusted to be consistent with the image through a 3×3 convolutional layer, resulting in the predicted noise.

[0041] Specifically, at the application layer, noise is removed using a pre-trained model based on a diffusion-based reverse process, and the final initial feature map is obtained after denoising.

[0042] Step S12. The initial feature map is upsampled to obtain a secondary feature map.

[0043] After processing in step S11, an initial feature map is obtained. This initial feature map is the feature result after denoising, but it is crucial for understanding the importance of edge and detail information in blood cell images. Therefore, after denoising, it is necessary to enhance the detailed edge information in the initial feature map to make subsequent processing more accurate.

[0044] Specifically, a lightweight upsampling operator for content-aware feature recombination, CARAFE, is introduced to better predict dense blood cell detection tasks. CARAFE offers greater flexibility and the ability to recover details, generating smoother and more detailed results. CARAFE adaptively adjusts its recombination strategy by generating location-specific upsampling kernels, dynamically adapting to different input features, which is more flexible than traditional fixed-kernel methods. By using pixel shuffling and learnable convolutional kernels, CARAFE can consider dependencies within local regions, thus better recovering high-frequency details. The CARAFE module reduces the number of parameters through channel compression and encoding steps, providing powerful upsampling performance with only a small increase in parameters. The structure of the CARAFE module can be found in [reference needed]. Figure 3 As shown, the initial feature map is processed in two branches. One branch sequentially performs convolutional layers of size B×64×H×W and B×s. 2 k up 2 ×H×W structure encoder, B×k up 2 The process involves an upsampling structure with a ×sH×sW architecture and a softmax loss function. First, the initial feature map is convolved to compress the channels to 64 dimensions to reduce subsequent computational complexity. Then, a convolution kernel generator outputs reconstructed data and parameters. Spatial dimension reconstructing decomposes the spatial information of the kernel parameters to the target size. Finally, normalization is performed along the kernel parameter dimensions to generate probability distribution weights. The second branch sequentially performs upsampling, sliding cropping, reshaping, and tensor element-wise multiplication and summation of the previous branch's output to obtain the target feature map. Specifically, the initial feature map input is initially amplified to B×C×sH×sW using interpolation, and then a sliding window extracts local blocks B×k. 2 C×sH×sW, each position is expanded into a k×k neighborhood vector, and finally dynamically weighted and fused with the output of the previous branch to output the final feature B×C×sH×sW, achieving a spatial resolution improvement of s times.

[0045] Step S13. Generate multiple initial detection boxes that conform to multiple preset scales and aspect ratios on the target feature map, predict the offset between the multiple initial detection boxes and the ground truth boxes to obtain the final detection boxes, and obtain the blood cell detection result based on the final detection boxes.

[0046] In this embodiment, the Minimum Point Distance (MPDIoU) loss function is used to measure the similarity of bounding boxes. The point distance loss ensures that the differences in the top-left and bottom-right corner positions between the ground truth bounding box and the predicted bounding box are minimized, resulting in faster convergence and higher accuracy. MPDIoU simplifies the similarity comparison between two bounding boxes by directly minimizing the distance between the top-left and bottom-right corner points of the predicted bounding box and the actual labeled box. It effectively solves the problem of optimization failure when the predicted and actual labeled boxes have the same aspect ratio but completely different widths and heights. For details, please refer to [link / reference]. Figure 4 Regarding the detection results corresponding to the final prediction box of the method provided in the embodiments of this application.

[0047] This application provides a blood cell detection method. It involves constructing an initial training set and adding random noise to samples based on this set. A diffusion-based feature extraction model is then trained on this noise-added training set. The trained model denoises the image to obtain an initial feature map. A secondary feature extraction is then performed on the initial feature map to obtain a target feature map. Finally, the target feature map is used as the final input to generate detection boxes, and the final blood cell detection result is obtained based on these boxes. Compared to existing technologies, this application can remove image noise and achieve automated blood cell detection based on detailed blood cell representation under small sample conditions.

[0048] See Figure 5 This application embodiment also provides a blood cell detection device 50, the device comprising:

[0049] The initial feature extraction module 51 is used to remove image noise and extract features from the acquired peripheral blood cell image based on a trained and convergent feature extraction model, so as to obtain an initial feature map after noise removal.

[0050] The target feature extraction module 52 is used to perform secondary feature extraction on the initial feature map based on upsampling to obtain the target feature map;

[0051] The detection module 53 is used to generate multiple initial detection boxes that conform to multiple preset scales and aspect ratios on the target feature map, predict the offset between the multiple initial detection boxes and the ground truth boxes to obtain the final detection boxes, and obtain the blood cell detection result based on the final detection boxes.

[0052] See Figure 6The above methods can also be integrated into the provided terminal device 600. Since the device may vary significantly due to different configurations or performance, it may include one or more processors 601 and memories 602. The memory 602 may store one or more application programs or data. The memory 602 can be temporary or persistent storage. The application programs stored in the memory 602 may include one or more modules (not shown in the figure), each module may include a series of computer-executable instructions from the terminal device. Furthermore, the processor 601 may be configured to communicate with the memory 602, and the terminal device may execute the series of computer-executable instructions stored in the memory 602. The terminal device may also include one or more power supplies 603, one or more wired / wireless network interfaces 604, one or more input / output interfaces 605, one or more keyboards 606, etc.

[0053] In one specific embodiment, the terminal device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer-executable instructions for use in the terminal device, and is configured to be executed by one or more processors. The one or more programs include computer-executable instructions for performing the following:

[0054] The acquired peripheral blood cell images are subjected to image noise removal and feature extraction based on a trained and convergent feature extraction model to obtain an initial feature map after noise removal; the noise reduction model is constructed based on a backbone network and trained through diffusion processing;

[0055] The initial feature map is upsampled to obtain a secondary feature map, and the upsampling kernel in the upsampling process is updated and generated based on the position information of each feature in the feature map.

[0056] Multiple initial detection boxes with preset scales and aspect ratios are generated on the target feature map. The offsets between the multiple initial detection boxes and the ground truth boxes are predicted to obtain the final detection boxes. The blood cell detection results are obtained based on the final detection boxes.

[0057] Optionally, the processor can perform various functions, such as the above-mentioned functions, by running or executing software programs stored in memory and by calling data stored in memory. Figure 1 The method shown.

[0058] In a specific implementation, as one example, the processor may include one or more microprocessors.

[0059] The memory is used to store the software program that executes the solution of this application, and the execution is controlled by the processor. The specific implementation method can be referred to the above method embodiment, which will not be repeated here.

[0060] In this application, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or multiple items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.

[0061] It should be understood that in the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0062] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0063] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

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

[0065] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for detecting blood cells, characterized in that, The method includes: The acquired peripheral blood cell images are subjected to image noise removal and feature extraction based on a trained and convergent feature extraction model to obtain an initial feature map after noise removal; the noise reduction model is constructed based on a backbone network and trained through diffusion processing; The initial feature map is upsampled to obtain a secondary feature map, and the upsampling kernel in the upsampling process is updated and generated based on the position information of each feature in the feature map. Multiple initial detection boxes with preset scales and aspect ratios are generated on the target feature map. The offsets between the multiple initial detection boxes and the ground truth boxes are predicted to obtain the final detection boxes. The blood cell detection results are obtained based on the final detection boxes.

2. The blood cell detection method according to claim 1, characterized in that, The training process of the feature extraction model includes: constructing an initial training set, performing a forward diffusion process on each image in the initial training set, adding noise in a uniform distribution manner with time step as a condition to obtain a target training set, and training based on the target training set until convergence to obtain the feature extraction model.

3. The blood cell detection method according to claim 2, characterized in that, The construction of the initial training set includes: acquiring multiple peripheral blood cell images, and performing continuous rotation transformations on the multiple peripheral blood cell images to obtain multiple training images. Each training image corresponds to a rotation angle label and forms a rotation label for each image, thus obtaining the initial training set.

4. The blood cell detection method according to claim 1, characterized in that, The backbone network includes an encoder and a decoder. The encoder and the decoder are connected by a downsampling method and are connected at the bottom of the encoder and the decoder by an intermediate block.

5. The blood cell detection method according to claim 4, characterized in that, The encoder includes a convolutional projection layer and three downsampling blocks, each of which includes two residual blocks and a downsampling layer connection; the encoder includes three upsampling blocks and a convolutional layer, each of which includes three residual blocks and an upsampling layer. The feature map output by the decoder is gradually restored to the size of the input image after three upsampling processes, and the channel dimensions are adjusted to be consistent with the image through the convolutional layer to obtain prediction noise. The prediction noise is then removed to obtain the initial feature map.

6. The blood cell detection method according to claim 4, characterized in that, The intermediate block includes two residual blocks and an attention mechanism layer. The feature vector output by the encoder is enhanced by the feature representation through the residual blocks, and the attention mechanism layer is constructed based on self-attention.

7. The blood cell detection method according to claim 5 or 6, characterized in that, The residual block includes a normalization layer, an activation function layer, and a two-dimensional convolutional layer connection.

8. A blood cell detection device, characterized in that, The device includes: The initial feature extraction module is used to remove image noise and extract features from the acquired peripheral blood cell images based on a trained and convergent feature extraction model, so as to obtain an initial feature map after noise removal. The target feature extraction module is used to perform secondary feature extraction on the initial feature map based on upsampling to obtain the target feature map; The detection module is used to generate multiple initial detection boxes that conform to multiple preset scales and aspect ratios on the target feature map, predict the offsets between the multiple initial detection boxes and the ground truth boxes to obtain the final detection boxes, and obtain the blood cell detection results based on the final detection boxes.

9. An electronic device, comprising: Memory; and a processor coupled to the memory, the processor being configured to execute the blood cell detection method of any one of claims 1-7 based on instructions stored in the memory.

10. A non-volatile computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the blood cell detection method according to any one of claims 1-7.